@powerhousedao/connect 1.0.0 → 1.0.8

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 (483) hide show
  1. package/dist/.env +13 -3
  2. package/dist/assets/app-Bw1Ba-jV.js +79356 -0
  3. package/dist/assets/app-D3TxLTK-.css +5634 -0
  4. package/dist/assets/app-loader-CjrEwupY.css +5481 -0
  5. package/dist/assets/app-loader-KTD3Q6e9.js +31333 -0
  6. package/dist/assets/ccip-D3HujWHr.js +170 -0
  7. package/dist/assets/connect-loader-CvOC68Ih.mp4 +0 -0
  8. package/dist/assets/content-D3TuBhK9.js +3937 -0
  9. package/dist/assets/home-bg-BEhF9NuW.png +0 -0
  10. package/dist/assets/index-DpasqVlD.js +12 -0
  11. package/dist/assets/index-DsNVpRhT.js +46414 -0
  12. package/dist/assets/index-yFk8X8m1.js +2560 -0
  13. package/dist/assets/main.CzEw2R-H.js +105 -0
  14. package/dist/assets/powerhouse-rounded-CeKGGUG4.png +0 -0
  15. package/dist/assets/renown-short-hover-BiSLBV7L.png +0 -0
  16. package/dist/assets/rwa-report-Bb0W5-ac.png +0 -0
  17. package/dist/assets/style-D4JhTt_m.css +1663 -0
  18. package/dist/hmr.js +1 -0
  19. package/dist/icon.ico +0 -0
  20. package/dist/index.html +49 -8
  21. package/dist/modules/@powerhousedao/reactor-browser/chunk-2ESYSVXG.js +48 -0
  22. package/dist/modules/@powerhousedao/reactor-browser/chunk-2X2M6BYG.js +2542 -0
  23. package/dist/modules/@powerhousedao/reactor-browser/chunk-45DCPCA7.js +67 -0
  24. package/dist/modules/@powerhousedao/reactor-browser/chunk-4LZZ55AN.js +82 -0
  25. package/dist/modules/@powerhousedao/reactor-browser/chunk-6AXML2S3.js +113 -0
  26. package/dist/modules/@powerhousedao/reactor-browser/chunk-7OQWVUC5.js +43 -0
  27. package/dist/modules/@powerhousedao/reactor-browser/chunk-DKDARAJS.js +0 -0
  28. package/dist/modules/@powerhousedao/reactor-browser/chunk-F3RCGUF6.js +53 -0
  29. package/dist/modules/@powerhousedao/reactor-browser/chunk-FQF4YAVC.js +11917 -0
  30. package/dist/modules/@powerhousedao/reactor-browser/chunk-FW7N6EJH.js +786 -0
  31. package/dist/modules/@powerhousedao/reactor-browser/chunk-G6LMXRY5.js +50 -0
  32. package/dist/modules/@powerhousedao/reactor-browser/chunk-GDP7BUIH.js +45 -0
  33. package/dist/modules/@powerhousedao/reactor-browser/chunk-IQTSFTNF.js +48 -0
  34. package/dist/modules/@powerhousedao/reactor-browser/chunk-J5TYPY7U.js +36 -0
  35. package/dist/modules/@powerhousedao/reactor-browser/chunk-LH2T6NLN.js +0 -0
  36. package/dist/modules/@powerhousedao/reactor-browser/chunk-LRNZZ3SR.js +14 -0
  37. package/dist/modules/@powerhousedao/reactor-browser/chunk-M2UUQ5LH.js +250 -0
  38. package/dist/modules/@powerhousedao/reactor-browser/chunk-OVGOA2P5.js +11 -0
  39. package/dist/modules/@powerhousedao/reactor-browser/chunk-P46ZMPJ3.js +178 -0
  40. package/dist/modules/@powerhousedao/reactor-browser/chunk-P6NJ6IAQ.js +12 -0
  41. package/dist/modules/@powerhousedao/reactor-browser/chunk-POMUCSTC.js +2459 -0
  42. package/dist/modules/@powerhousedao/reactor-browser/chunk-QXHTR6KF.js +0 -0
  43. package/dist/modules/@powerhousedao/reactor-browser/chunk-RGIB4DD4.js +162 -0
  44. package/dist/modules/@powerhousedao/reactor-browser/chunk-U36SV333.js +0 -0
  45. package/dist/modules/@powerhousedao/reactor-browser/chunk-XBTEGV5M.js +17 -0
  46. package/dist/modules/@powerhousedao/reactor-browser/chunk-Y7NTRTMT.js +25 -0
  47. package/dist/modules/@powerhousedao/reactor-browser/chunk-YG67WAIS.js +0 -0
  48. package/dist/modules/@powerhousedao/reactor-browser/chunk-YOX3ZAET.js +13978 -0
  49. package/dist/modules/@powerhousedao/reactor-browser/chunk-YWKVPJNL.js +52 -0
  50. package/dist/modules/@powerhousedao/reactor-browser/chunk-ZL5IPB6D.js +0 -0
  51. package/dist/modules/@powerhousedao/reactor-browser/context/index.js +16 -0
  52. package/dist/modules/@powerhousedao/reactor-browser/context/read-mode.js +15 -0
  53. package/dist/modules/@powerhousedao/reactor-browser/crypto/browser.js +7 -0
  54. package/dist/modules/@powerhousedao/reactor-browser/crypto/index.js +7 -0
  55. package/dist/modules/@powerhousedao/reactor-browser/document-model.js +10 -0
  56. package/dist/modules/@powerhousedao/reactor-browser/hooks/document-state.js +96 -0
  57. package/dist/modules/@powerhousedao/reactor-browser/hooks/index.js +98 -0
  58. package/dist/modules/@powerhousedao/reactor-browser/hooks/useAddDebouncedOperations.js +11 -0
  59. package/dist/modules/@powerhousedao/reactor-browser/hooks/useConnectCrypto.js +12 -0
  60. package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocument.js +7 -0
  61. package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocumentDispatch.js +7 -0
  62. package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocumentDrives.js +13 -0
  63. package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocumentEditor.js +20 -0
  64. package/dist/modules/@powerhousedao/reactor-browser/hooks/useDriveActions.js +9 -0
  65. package/dist/modules/@powerhousedao/reactor-browser/hooks/useDriveActionsWithUiNodes.js +14 -0
  66. package/dist/modules/@powerhousedao/reactor-browser/hooks/useDriveContext.js +9 -0
  67. package/dist/modules/@powerhousedao/reactor-browser/hooks/useUiNodesContext.js +46 -0
  68. package/dist/modules/@powerhousedao/reactor-browser/hooks/useUserPermissions.js +7 -0
  69. package/dist/modules/@powerhousedao/reactor-browser/index.js +125 -0
  70. package/dist/modules/@powerhousedao/reactor-browser/reactor.js +11 -0
  71. package/dist/modules/@powerhousedao/reactor-browser/renown/constants.js +53 -0
  72. package/dist/modules/@powerhousedao/reactor-browser/renown/types.js +1 -0
  73. package/dist/modules/@powerhousedao/reactor-browser/storage/index.js +1 -0
  74. package/dist/modules/@powerhousedao/reactor-browser/storage/types.js +1 -0
  75. package/dist/modules/@powerhousedao/reactor-browser/uiNodes/constants.js +37 -0
  76. package/dist/modules/@powerhousedao/reactor-browser/uiNodes/types.js +1 -0
  77. package/dist/modules/@powerhousedao/reactor-browser/utils/export-document.js +8 -0
  78. package/dist/modules/@powerhousedao/reactor-browser/utils/index.js +9 -0
  79. package/dist/modules/@powerhousedao/reactor-browser/utils/signature.js +10 -0
  80. package/dist/service-worker.js +46 -2
  81. package/dist/swEnv.js +10 -6
  82. package/dist/vite-envs.sh +69 -21
  83. package/nginx.conf +93 -0
  84. package/nginx.sh +10 -0
  85. package/package.json +35 -52
  86. package/dist/assets/ArrowFilledRight-BXP1j8Cl.js +0 -2
  87. package/dist/assets/ArrowFilledRight-BXP1j8Cl.js.map +0 -1
  88. package/dist/assets/ArrowFilledRight-blx8xu7X-D3d8PUWh.js +0 -2
  89. package/dist/assets/ArrowFilledRight-blx8xu7X-D3d8PUWh.js.map +0 -1
  90. package/dist/assets/ArrowLeft-7pYNK4eX-8ZR_YHAJ.js +0 -2
  91. package/dist/assets/ArrowLeft-7pYNK4eX-8ZR_YHAJ.js.map +0 -1
  92. package/dist/assets/ArrowLeft-8ZR_YHAJ.js +0 -2
  93. package/dist/assets/ArrowLeft-8ZR_YHAJ.js.map +0 -1
  94. package/dist/assets/ArrowUp-Bbr_dwo_-C5ppCQo4.js +0 -2
  95. package/dist/assets/ArrowUp-Bbr_dwo_-C5ppCQo4.js.map +0 -1
  96. package/dist/assets/ArrowUp-E2jS6Wzt.js +0 -2
  97. package/dist/assets/ArrowUp-E2jS6Wzt.js.map +0 -1
  98. package/dist/assets/BarChart-B0G05Nfd-CHDJ7OaJ.js +0 -2
  99. package/dist/assets/BarChart-B0G05Nfd-CHDJ7OaJ.js.map +0 -1
  100. package/dist/assets/BarChart-C-E6t7dt.js +0 -2
  101. package/dist/assets/BarChart-C-E6t7dt.js.map +0 -1
  102. package/dist/assets/BaseArrowLeft-DBzhFHMt-Dkbf2sWs.js +0 -2
  103. package/dist/assets/BaseArrowLeft-DBzhFHMt-Dkbf2sWs.js.map +0 -1
  104. package/dist/assets/BaseArrowLeft-DtHrkTW4.js +0 -2
  105. package/dist/assets/BaseArrowLeft-DtHrkTW4.js.map +0 -1
  106. package/dist/assets/BaseArrowRight-BIwzFHnh.js +0 -2
  107. package/dist/assets/BaseArrowRight-BIwzFHnh.js.map +0 -1
  108. package/dist/assets/BaseArrowRight-DYQTBWAs-CkkPllYm.js +0 -2
  109. package/dist/assets/BaseArrowRight-DYQTBWAs-CkkPllYm.js.map +0 -1
  110. package/dist/assets/Braces-3LcexUsR.js +0 -2
  111. package/dist/assets/Braces-3LcexUsR.js.map +0 -1
  112. package/dist/assets/Braces-N-sH2Zyc-3LcexUsR.js +0 -2
  113. package/dist/assets/Braces-N-sH2Zyc-3LcexUsR.js.map +0 -1
  114. package/dist/assets/Branch-CWdBw1_P-CmGdOXsI.js +0 -2
  115. package/dist/assets/Branch-CWdBw1_P-CmGdOXsI.js.map +0 -1
  116. package/dist/assets/Branch-D0CssEh3.js +0 -2
  117. package/dist/assets/Branch-D0CssEh3.js.map +0 -1
  118. package/dist/assets/BrickGlobe-67zaG6_H-DP0By6z_.js +0 -2
  119. package/dist/assets/BrickGlobe-67zaG6_H-DP0By6z_.js.map +0 -1
  120. package/dist/assets/BrickGlobe-CdHw7ZVP.js +0 -2
  121. package/dist/assets/BrickGlobe-CdHw7ZVP.js.map +0 -1
  122. package/dist/assets/Briefcase-CV2bgnSj.js +0 -2
  123. package/dist/assets/Briefcase-CV2bgnSj.js.map +0 -1
  124. package/dist/assets/Briefcase-CedW3KRR-DO5_k15F.js +0 -2
  125. package/dist/assets/Briefcase-CedW3KRR-DO5_k15F.js.map +0 -1
  126. package/dist/assets/Calendar-C-6HV96D-YetudWvP.js +0 -2
  127. package/dist/assets/Calendar-C-6HV96D-YetudWvP.js.map +0 -1
  128. package/dist/assets/Calendar-DuXN-sPt.js +0 -2
  129. package/dist/assets/Calendar-DuXN-sPt.js.map +0 -1
  130. package/dist/assets/CalendarTime-Bhjzlgn_-BVlYgNLL.js +0 -2
  131. package/dist/assets/CalendarTime-Bhjzlgn_-BVlYgNLL.js.map +0 -1
  132. package/dist/assets/CalendarTime-BowYBiVM.js +0 -2
  133. package/dist/assets/CalendarTime-BowYBiVM.js.map +0 -1
  134. package/dist/assets/Caret-Ep0j0fz2-By3ojfim.js +0 -2
  135. package/dist/assets/Caret-Ep0j0fz2-By3ojfim.js.map +0 -1
  136. package/dist/assets/Caret-r16V7Hcs.js +0 -2
  137. package/dist/assets/Caret-r16V7Hcs.js.map +0 -1
  138. package/dist/assets/CaretDown-3X7LFYBf-C43xdKg8.js +0 -2
  139. package/dist/assets/CaretDown-3X7LFYBf-C43xdKg8.js.map +0 -1
  140. package/dist/assets/CaretDown-DljrBfIz.js +0 -2
  141. package/dist/assets/CaretDown-DljrBfIz.js.map +0 -1
  142. package/dist/assets/CaretLeft-B_Lzd_Rn.js +0 -2
  143. package/dist/assets/CaretLeft-B_Lzd_Rn.js.map +0 -1
  144. package/dist/assets/CaretLeft-Df3E-68c-wke5zKLt.js +0 -2
  145. package/dist/assets/CaretLeft-Df3E-68c-wke5zKLt.js.map +0 -1
  146. package/dist/assets/CaretRight-Bbz5nCpg.js +0 -2
  147. package/dist/assets/CaretRight-Bbz5nCpg.js.map +0 -1
  148. package/dist/assets/CaretRight-DSVWUSka-Cx0Mkcqa.js +0 -2
  149. package/dist/assets/CaretRight-DSVWUSka-Cx0Mkcqa.js.map +0 -1
  150. package/dist/assets/CaretSort-BkGdLETT-DVOzEEqR.js +0 -2
  151. package/dist/assets/CaretSort-BkGdLETT-DVOzEEqR.js.map +0 -1
  152. package/dist/assets/CaretSort-DSgBum1h.js +0 -2
  153. package/dist/assets/CaretSort-DSgBum1h.js.map +0 -1
  154. package/dist/assets/Check-CbV9BYHY.js +0 -2
  155. package/dist/assets/Check-CbV9BYHY.js.map +0 -1
  156. package/dist/assets/Check-DV-U4AEq-B582NMZp.js +0 -2
  157. package/dist/assets/Check-DV-U4AEq-B582NMZp.js.map +0 -1
  158. package/dist/assets/CheckCircle-CX2jIKoF.js +0 -2
  159. package/dist/assets/CheckCircle-CX2jIKoF.js.map +0 -1
  160. package/dist/assets/CheckCircle-DI5fEgGd-CVF4LDhR.js +0 -2
  161. package/dist/assets/CheckCircle-DI5fEgGd-CVF4LDhR.js.map +0 -1
  162. package/dist/assets/CheckCircleFill-C-F0v5mB-BSW1YMqM.js +0 -2
  163. package/dist/assets/CheckCircleFill-C-F0v5mB-BSW1YMqM.js.map +0 -1
  164. package/dist/assets/CheckCircleFill-DLK12sW5.js +0 -2
  165. package/dist/assets/CheckCircleFill-DLK12sW5.js.map +0 -1
  166. package/dist/assets/Checkmark-BXnfChpo-CyQitGI2.js +0 -2
  167. package/dist/assets/Checkmark-BXnfChpo-CyQitGI2.js.map +0 -1
  168. package/dist/assets/Checkmark-DBvUEZAd.js +0 -2
  169. package/dist/assets/Checkmark-DBvUEZAd.js.map +0 -1
  170. package/dist/assets/ChevronDown-eUsCPXcB.js +0 -2
  171. package/dist/assets/ChevronDown-eUsCPXcB.js.map +0 -1
  172. package/dist/assets/ChevronDown-ouBxrU-k-eUsCPXcB.js +0 -2
  173. package/dist/assets/ChevronDown-ouBxrU-k-eUsCPXcB.js.map +0 -1
  174. package/dist/assets/Circle-8dOehHQf.js +0 -2
  175. package/dist/assets/Circle-8dOehHQf.js.map +0 -1
  176. package/dist/assets/Circle-n3-Wh4HS-8dOehHQf.js +0 -2
  177. package/dist/assets/Circle-n3-Wh4HS-8dOehHQf.js.map +0 -1
  178. package/dist/assets/CircleInfo-BhZY3C2Q-CZgYK1h2.js +0 -2
  179. package/dist/assets/CircleInfo-BhZY3C2Q-CZgYK1h2.js.map +0 -1
  180. package/dist/assets/CircleInfo-D0ktZDko.js +0 -2
  181. package/dist/assets/CircleInfo-D0ktZDko.js.map +0 -1
  182. package/dist/assets/Clock-CudavWaE.js +0 -2
  183. package/dist/assets/Clock-CudavWaE.js.map +0 -1
  184. package/dist/assets/Clock-DF-XMxha-CudavWaE.js +0 -2
  185. package/dist/assets/Clock-DF-XMxha-CudavWaE.js.map +0 -1
  186. package/dist/assets/ClockFill-Bd0t48q7-CcfHiJtH.js +0 -2
  187. package/dist/assets/ClockFill-Bd0t48q7-CcfHiJtH.js.map +0 -1
  188. package/dist/assets/ClockFill-yWs52y_e.js +0 -2
  189. package/dist/assets/ClockFill-yWs52y_e.js.map +0 -1
  190. package/dist/assets/CloudSlash-B-zJBjaD-CxVyp-Ac.js +0 -2
  191. package/dist/assets/CloudSlash-B-zJBjaD-CxVyp-Ac.js.map +0 -1
  192. package/dist/assets/CloudSlash-D18Hl3VW.js +0 -2
  193. package/dist/assets/CloudSlash-D18Hl3VW.js.map +0 -1
  194. package/dist/assets/Collapse-BOxZH5-e.js +0 -2
  195. package/dist/assets/Collapse-BOxZH5-e.js.map +0 -1
  196. package/dist/assets/Collapse-DRDB8Czs-CGcuZQgy.js +0 -2
  197. package/dist/assets/Collapse-DRDB8Czs-CGcuZQgy.js.map +0 -1
  198. package/dist/assets/Connect-Dme-qfKq-CgniLji8.js +0 -2
  199. package/dist/assets/Connect-Dme-qfKq-CgniLji8.js.map +0 -1
  200. package/dist/assets/Connect-laqJZT3s.js +0 -2
  201. package/dist/assets/Connect-laqJZT3s.js.map +0 -1
  202. package/dist/assets/Copy-CkOtWZ6m.js +0 -2
  203. package/dist/assets/Copy-CkOtWZ6m.js.map +0 -1
  204. package/dist/assets/Copy-ms9-7m7Y-CkOtWZ6m.js +0 -2
  205. package/dist/assets/Copy-ms9-7m7Y-CkOtWZ6m.js.map +0 -1
  206. package/dist/assets/CrossCircle-B6ZawoOx-z5-kkOo3.js +0 -2
  207. package/dist/assets/CrossCircle-B6ZawoOx-z5-kkOo3.js.map +0 -1
  208. package/dist/assets/CrossCircle-Bp9diEe9.js +0 -2
  209. package/dist/assets/CrossCircle-Bp9diEe9.js.map +0 -1
  210. package/dist/assets/Danger-CLu7nxgz.js +0 -2
  211. package/dist/assets/Danger-CLu7nxgz.js.map +0 -1
  212. package/dist/assets/Danger-KM8BZjue-CLu7nxgz.js +0 -2
  213. package/dist/assets/Danger-KM8BZjue-CLu7nxgz.js.map +0 -1
  214. package/dist/assets/Discord-CAS0Cj7s-CcsBWpnf.js +0 -2
  215. package/dist/assets/Discord-CAS0Cj7s-CcsBWpnf.js.map +0 -1
  216. package/dist/assets/Discord-CcPWRT8g.js +0 -2
  217. package/dist/assets/Discord-CcPWRT8g.js.map +0 -1
  218. package/dist/assets/Drive-CzahDx9j.js +0 -2
  219. package/dist/assets/Drive-CzahDx9j.js.map +0 -1
  220. package/dist/assets/Drive-GMcgBcIY-CzahDx9j.js +0 -2
  221. package/dist/assets/Drive-GMcgBcIY-CzahDx9j.js.map +0 -1
  222. package/dist/assets/Edit-D9GlgGu8.js +0 -2
  223. package/dist/assets/Edit-D9GlgGu8.js.map +0 -1
  224. package/dist/assets/Edit-Dr-ZiMSE-D9GlgGu8.js +0 -2
  225. package/dist/assets/Edit-Dr-ZiMSE-D9GlgGu8.js.map +0 -1
  226. package/dist/assets/Ellipsis-DWNUJYUI.js +0 -2
  227. package/dist/assets/Ellipsis-DWNUJYUI.js.map +0 -1
  228. package/dist/assets/Ellipsis-XK8AwMEC-BuVBeYhB.js +0 -2
  229. package/dist/assets/Ellipsis-XK8AwMEC-BuVBeYhB.js.map +0 -1
  230. package/dist/assets/Error-BmIZ2ZUy-CphzuMLn.js +0 -2
  231. package/dist/assets/Error-BmIZ2ZUy-CphzuMLn.js.map +0 -1
  232. package/dist/assets/Error-FBAhqFT5.js +0 -2
  233. package/dist/assets/Error-FBAhqFT5.js.map +0 -1
  234. package/dist/assets/Exclamation-BGFGsVRw.js +0 -2
  235. package/dist/assets/Exclamation-BGFGsVRw.js.map +0 -1
  236. package/dist/assets/Exclamation-CVsNS_QS-DLccamql.js +0 -2
  237. package/dist/assets/Exclamation-CVsNS_QS-DLccamql.js.map +0 -1
  238. package/dist/assets/File-Ba7ClyaL-BU1g1wjO.js +0 -2
  239. package/dist/assets/File-Ba7ClyaL-BU1g1wjO.js.map +0 -1
  240. package/dist/assets/File-DWKl25DR.js +0 -2
  241. package/dist/assets/File-DWKl25DR.js.map +0 -1
  242. package/dist/assets/FilesEarmark-BTL53WSf.js +0 -2
  243. package/dist/assets/FilesEarmark-BTL53WSf.js.map +0 -1
  244. package/dist/assets/FilesEarmark-CyrCQy8E-Bhut4E02.js +0 -2
  245. package/dist/assets/FilesEarmark-CyrCQy8E-Bhut4E02.js.map +0 -1
  246. package/dist/assets/FolderClose-BVMKeKvW.js +0 -2
  247. package/dist/assets/FolderClose-BVMKeKvW.js.map +0 -1
  248. package/dist/assets/FolderClose-DG_qHisc-CH6NoBuu.js +0 -2
  249. package/dist/assets/FolderClose-DG_qHisc-CH6NoBuu.js.map +0 -1
  250. package/dist/assets/FolderOpen-DT55_X9N.js +0 -2
  251. package/dist/assets/FolderOpen-DT55_X9N.js.map +0 -1
  252. package/dist/assets/FolderOpen-kDoWFkJO-Cciutkdg.js +0 -2
  253. package/dist/assets/FolderOpen-kDoWFkJO-Cciutkdg.js.map +0 -1
  254. package/dist/assets/FolderPlus-C2G5PVs-.js +0 -2
  255. package/dist/assets/FolderPlus-C2G5PVs-.js.map +0 -1
  256. package/dist/assets/FolderPlus-CSBSl9lZ-CifD0ek9.js +0 -2
  257. package/dist/assets/FolderPlus-CSBSl9lZ-CifD0ek9.js.map +0 -1
  258. package/dist/assets/Forum-Cfgyizyn.js +0 -2
  259. package/dist/assets/Forum-Cfgyizyn.js.map +0 -1
  260. package/dist/assets/Forum-DZ-CkLFh-BwabccAX.js +0 -2
  261. package/dist/assets/Forum-DZ-CkLFh-BwabccAX.js.map +0 -1
  262. package/dist/assets/Gear-CoQ9O06k.js +0 -2
  263. package/dist/assets/Gear-CoQ9O06k.js.map +0 -1
  264. package/dist/assets/Gear-cUlHJ4q6-B9R2l_9_.js +0 -2
  265. package/dist/assets/Gear-cUlHJ4q6-B9R2l_9_.js.map +0 -1
  266. package/dist/assets/Github-0PLiINY0-CjkZIHCO.js +0 -2
  267. package/dist/assets/Github-0PLiINY0-CjkZIHCO.js.map +0 -1
  268. package/dist/assets/Github-CjkZIHCO.js +0 -2
  269. package/dist/assets/Github-CjkZIHCO.js.map +0 -1
  270. package/dist/assets/Globe-CIYqVkpa-CL530H46.js +0 -2
  271. package/dist/assets/Globe-CIYqVkpa-CL530H46.js.map +0 -1
  272. package/dist/assets/Globe-Dy2otZRk.js +0 -2
  273. package/dist/assets/Globe-Dy2otZRk.js.map +0 -1
  274. package/dist/assets/GlobeWww-Ci7aa5CE.js +0 -2
  275. package/dist/assets/GlobeWww-Ci7aa5CE.js.map +0 -1
  276. package/dist/assets/GlobeWww-DN4yKujh-Ci7aa5CE.js +0 -2
  277. package/dist/assets/GlobeWww-DN4yKujh-Ci7aa5CE.js.map +0 -1
  278. package/dist/assets/Hdd-CP-hFB7d.js +0 -2
  279. package/dist/assets/Hdd-CP-hFB7d.js.map +0 -1
  280. package/dist/assets/Hdd-Dn_LdJIh-CJ6x9Bve.js +0 -2
  281. package/dist/assets/Hdd-Dn_LdJIh-CJ6x9Bve.js.map +0 -1
  282. package/dist/assets/History-BP4SmaS_-P4WBKyqX.js +0 -2
  283. package/dist/assets/History-BP4SmaS_-P4WBKyqX.js.map +0 -1
  284. package/dist/assets/History-CmOiP5qa.js +0 -2
  285. package/dist/assets/History-CmOiP5qa.js.map +0 -1
  286. package/dist/assets/InfoSquare-C98JaLiz-yPcGR71f.js +0 -2
  287. package/dist/assets/InfoSquare-C98JaLiz-yPcGR71f.js.map +0 -1
  288. package/dist/assets/InfoSquare-DbYZrwmg.js +0 -2
  289. package/dist/assets/InfoSquare-DbYZrwmg.js.map +0 -1
  290. package/dist/assets/Link-BF7aZjVu-CXIVQOz6.js +0 -2
  291. package/dist/assets/Link-BF7aZjVu-CXIVQOz6.js.map +0 -1
  292. package/dist/assets/Link-CXIVQOz6.js +0 -2
  293. package/dist/assets/Link-CXIVQOz6.js.map +0 -1
  294. package/dist/assets/Linkedin-DJwIkS6q-Dkb5Tp_Z.js +0 -2
  295. package/dist/assets/Linkedin-DJwIkS6q-Dkb5Tp_Z.js.map +0 -1
  296. package/dist/assets/Linkedin-exhl1yGN.js +0 -2
  297. package/dist/assets/Linkedin-exhl1yGN.js.map +0 -1
  298. package/dist/assets/Lock-DWdDRi_O.js +0 -2
  299. package/dist/assets/Lock-DWdDRi_O.js.map +0 -1
  300. package/dist/assets/Lock-PyaFHdNS-D_qxRTye.js +0 -2
  301. package/dist/assets/Lock-PyaFHdNS-D_qxRTye.js.map +0 -1
  302. package/dist/assets/M-ByQIo8bX.js +0 -2
  303. package/dist/assets/M-ByQIo8bX.js.map +0 -1
  304. package/dist/assets/M-DozhhPMY-DBQw97P_.js +0 -2
  305. package/dist/assets/M-DozhhPMY-DBQw97P_.js.map +0 -1
  306. package/dist/assets/PackageManager-B-MUWliB-bW01ZQSP.js +0 -2
  307. package/dist/assets/PackageManager-B-MUWliB-bW01ZQSP.js.map +0 -1
  308. package/dist/assets/PackageManager-D6Ia8zHs.js +0 -2
  309. package/dist/assets/PackageManager-D6Ia8zHs.js.map +0 -1
  310. package/dist/assets/Pencil-D7lvxXIP-D830iveq.js +0 -2
  311. package/dist/assets/Pencil-D7lvxXIP-D830iveq.js.map +0 -1
  312. package/dist/assets/Pencil-D830iveq.js +0 -2
  313. package/dist/assets/Pencil-D830iveq.js.map +0 -1
  314. package/dist/assets/People-B1tewG8c.js +0 -2
  315. package/dist/assets/People-B1tewG8c.js.map +0 -1
  316. package/dist/assets/People-CUB8LYKf-CyJmMqcw.js +0 -2
  317. package/dist/assets/People-CUB8LYKf-CyJmMqcw.js.map +0 -1
  318. package/dist/assets/Person-BPRmm67U.js +0 -2
  319. package/dist/assets/Person-BPRmm67U.js.map +0 -1
  320. package/dist/assets/Person-DuL4PQzm-ttQR0nPy.js +0 -2
  321. package/dist/assets/Person-DuL4PQzm-ttQR0nPy.js.map +0 -1
  322. package/dist/assets/Pin-D53eCMAz.js +0 -2
  323. package/dist/assets/Pin-D53eCMAz.js.map +0 -1
  324. package/dist/assets/Pin-DF70btCU-D53eCMAz.js +0 -2
  325. package/dist/assets/Pin-DF70btCU-D53eCMAz.js.map +0 -1
  326. package/dist/assets/PinFilled-CMXfFW67.js +0 -2
  327. package/dist/assets/PinFilled-CMXfFW67.js.map +0 -1
  328. package/dist/assets/PinFilled-vImzS0do-CMXfFW67.js +0 -2
  329. package/dist/assets/PinFilled-vImzS0do-CMXfFW67.js.map +0 -1
  330. package/dist/assets/Plus-DPFWGJM4-BztpK8li.js +0 -2
  331. package/dist/assets/Plus-DPFWGJM4-BztpK8li.js.map +0 -1
  332. package/dist/assets/Plus-XUIm1wNw.js +0 -2
  333. package/dist/assets/Plus-XUIm1wNw.js.map +0 -1
  334. package/dist/assets/PlusCircle-BEnWRjHa-w5zztKGx.js +0 -2
  335. package/dist/assets/PlusCircle-BEnWRjHa-w5zztKGx.js.map +0 -1
  336. package/dist/assets/PlusCircle-D1IRYULb.js +0 -2
  337. package/dist/assets/PlusCircle-D1IRYULb.js.map +0 -1
  338. package/dist/assets/PowerhouseLogoSmall-CmO95IAS-CDGLkst3.js +0 -2
  339. package/dist/assets/PowerhouseLogoSmall-CmO95IAS-CDGLkst3.js.map +0 -1
  340. package/dist/assets/PowerhouseLogoSmall-DF1uUwIC.js +0 -2
  341. package/dist/assets/PowerhouseLogoSmall-DF1uUwIC.js.map +0 -1
  342. package/dist/assets/Project-BlXuclr0-EsBam9d0.js +0 -2
  343. package/dist/assets/Project-BlXuclr0-EsBam9d0.js.map +0 -1
  344. package/dist/assets/Project-EsBam9d0.js +0 -2
  345. package/dist/assets/Project-EsBam9d0.js.map +0 -1
  346. package/dist/assets/QuestionSquare-B6O9Le7r-CDaw1i6L.js +0 -2
  347. package/dist/assets/QuestionSquare-B6O9Le7r-CDaw1i6L.js.map +0 -1
  348. package/dist/assets/QuestionSquare-CDaw1i6L.js +0 -2
  349. package/dist/assets/QuestionSquare-CDaw1i6L.js.map +0 -1
  350. package/dist/assets/RedoArrow-BJeEsiph-BbidqIFP.js +0 -2
  351. package/dist/assets/RedoArrow-BJeEsiph-BbidqIFP.js.map +0 -1
  352. package/dist/assets/RedoArrow-DM-fqhEP.js +0 -2
  353. package/dist/assets/RedoArrow-DM-fqhEP.js.map +0 -1
  354. package/dist/assets/Reload-6C2CYgrl-DPZbA7yl.js +0 -2
  355. package/dist/assets/Reload-6C2CYgrl-DPZbA7yl.js.map +0 -1
  356. package/dist/assets/Reload-DPZbA7yl.js +0 -2
  357. package/dist/assets/Reload-DPZbA7yl.js.map +0 -1
  358. package/dist/assets/Renown-6m7hx37h-CItksi2j.js +0 -2
  359. package/dist/assets/Renown-6m7hx37h-CItksi2j.js.map +0 -1
  360. package/dist/assets/Renown-CItksi2j.js +0 -2
  361. package/dist/assets/Renown-CItksi2j.js.map +0 -1
  362. package/dist/assets/RenownHover-CQ0TZHZv-cYQgnwQW.js +0 -2
  363. package/dist/assets/RenownHover-CQ0TZHZv-cYQgnwQW.js.map +0 -1
  364. package/dist/assets/RenownHover-cYQgnwQW.js +0 -2
  365. package/dist/assets/RenownHover-cYQgnwQW.js.map +0 -1
  366. package/dist/assets/Ring-BivnmVc5.js +0 -2
  367. package/dist/assets/Ring-BivnmVc5.js.map +0 -1
  368. package/dist/assets/Ring-DKv0gnwT-CDHLz87h.js +0 -2
  369. package/dist/assets/Ring-DKv0gnwT-CDHLz87h.js.map +0 -1
  370. package/dist/assets/Save-BBxj68pn-BkUvn89C.js +0 -2
  371. package/dist/assets/Save-BBxj68pn-BkUvn89C.js.map +0 -1
  372. package/dist/assets/Save-BWCZPY82.js +0 -2
  373. package/dist/assets/Save-BWCZPY82.js.map +0 -1
  374. package/dist/assets/Search-BiEcSbcf.js +0 -2
  375. package/dist/assets/Search-BiEcSbcf.js.map +0 -1
  376. package/dist/assets/Search-YUJuRBLe-CecGUkZA.js +0 -2
  377. package/dist/assets/Search-YUJuRBLe-CecGUkZA.js.map +0 -1
  378. package/dist/assets/Server-Bfkkjui1-lBan_3Dm.js +0 -2
  379. package/dist/assets/Server-Bfkkjui1-lBan_3Dm.js.map +0 -1
  380. package/dist/assets/Server-cAzmNxsS.js +0 -2
  381. package/dist/assets/Server-cAzmNxsS.js.map +0 -1
  382. package/dist/assets/Settings-Cca-sV-_.js +0 -2
  383. package/dist/assets/Settings-Cca-sV-_.js.map +0 -1
  384. package/dist/assets/Settings-mbbylBS5-Cca-sV-_.js +0 -2
  385. package/dist/assets/Settings-mbbylBS5-Cca-sV-_.js.map +0 -1
  386. package/dist/assets/Synced-CjieGKOk.js +0 -2
  387. package/dist/assets/Synced-CjieGKOk.js.map +0 -1
  388. package/dist/assets/Synced-DKJXzPiw-Cui8pDsS.js +0 -2
  389. package/dist/assets/Synced-DKJXzPiw-Cui8pDsS.js.map +0 -1
  390. package/dist/assets/Syncing-KnDBLSYe.js +0 -2
  391. package/dist/assets/Syncing-KnDBLSYe.js.map +0 -1
  392. package/dist/assets/Syncing-aT9WSMFf-2VhhyCcX.js +0 -2
  393. package/dist/assets/Syncing-aT9WSMFf-2VhhyCcX.js.map +0 -1
  394. package/dist/assets/Trash-CgSbHk-P-DIYkVMER.js +0 -2
  395. package/dist/assets/Trash-CgSbHk-P-DIYkVMER.js.map +0 -1
  396. package/dist/assets/Trash-DIHOD5wQ.js +0 -2
  397. package/dist/assets/Trash-DIHOD5wQ.js.map +0 -1
  398. package/dist/assets/TrashFill-CG3humXp.js +0 -2
  399. package/dist/assets/TrashFill-CG3humXp.js.map +0 -1
  400. package/dist/assets/TrashFill-DN50ercb-Oqx67xXN.js +0 -2
  401. package/dist/assets/TrashFill-DN50ercb-Oqx67xXN.js.map +0 -1
  402. package/dist/assets/TreeViewSlash-BywCsx5o-CUTTXZi-.js +0 -2
  403. package/dist/assets/TreeViewSlash-BywCsx5o-CUTTXZi-.js.map +0 -1
  404. package/dist/assets/TreeViewSlash-CKJADIpa.js +0 -2
  405. package/dist/assets/TreeViewSlash-CKJADIpa.js.map +0 -1
  406. package/dist/assets/TriangleDown-Boh-WZzH.js +0 -2
  407. package/dist/assets/TriangleDown-Boh-WZzH.js.map +0 -1
  408. package/dist/assets/TriangleDown-eCXwUfu8-F-V79AL3.js +0 -2
  409. package/dist/assets/TriangleDown-eCXwUfu8-F-V79AL3.js.map +0 -1
  410. package/dist/assets/VariantArrowLeft-CnuX59_e-6Zt_Q3tm.js +0 -2
  411. package/dist/assets/VariantArrowLeft-CnuX59_e-6Zt_Q3tm.js.map +0 -1
  412. package/dist/assets/VariantArrowLeft-Dl1-3L5q.js +0 -2
  413. package/dist/assets/VariantArrowLeft-Dl1-3L5q.js.map +0 -1
  414. package/dist/assets/VerticalDots-C8QYf7et-CCxZfvjq.js +0 -2
  415. package/dist/assets/VerticalDots-C8QYf7et-CCxZfvjq.js.map +0 -1
  416. package/dist/assets/VerticalDots-CCZxgZM8.js +0 -2
  417. package/dist/assets/VerticalDots-CCZxgZM8.js.map +0 -1
  418. package/dist/assets/WarningFill-CRRaW3Oz.js +0 -2
  419. package/dist/assets/WarningFill-CRRaW3Oz.js.map +0 -1
  420. package/dist/assets/WarningFill-WowAvi5P-D5XCckM6.js +0 -2
  421. package/dist/assets/WarningFill-WowAvi5P-D5XCckM6.js.map +0 -1
  422. package/dist/assets/XTwitter-CW6IaHUb.js +0 -2
  423. package/dist/assets/XTwitter-CW6IaHUb.js.map +0 -1
  424. package/dist/assets/XTwitter-k3Pt8itk-mvLk8TKx.js +0 -2
  425. package/dist/assets/XTwitter-k3Pt8itk-mvLk8TKx.js.map +0 -1
  426. package/dist/assets/Xmark-8qnJCs2Y-CZ3t0Fap.js +0 -2
  427. package/dist/assets/Xmark-8qnJCs2Y-CZ3t0Fap.js.map +0 -1
  428. package/dist/assets/Xmark-CZ3t0Fap.js +0 -2
  429. package/dist/assets/Xmark-CZ3t0Fap.js.map +0 -1
  430. package/dist/assets/XmarkLight-BkhBFy51.js +0 -2
  431. package/dist/assets/XmarkLight-BkhBFy51.js.map +0 -1
  432. package/dist/assets/XmarkLight-GHzDR5_F-CloMvuzt.js +0 -2
  433. package/dist/assets/XmarkLight-GHzDR5_F-CloMvuzt.js.map +0 -1
  434. package/dist/assets/Youtube-h-Dc9pri.js +0 -2
  435. package/dist/assets/Youtube-h-Dc9pri.js.map +0 -1
  436. package/dist/assets/Youtube-i8V0IXUU-Bkiwoayp.js +0 -2
  437. package/dist/assets/Youtube-i8V0IXUU-Bkiwoayp.js.map +0 -1
  438. package/dist/assets/app-DKrzRA2f.js +0 -449
  439. package/dist/assets/app-DKrzRA2f.js.map +0 -1
  440. package/dist/assets/app-loader-DH_VGIVv.css +0 -1
  441. package/dist/assets/app-loader-mj_poB3V.js +0 -3
  442. package/dist/assets/app-loader-mj_poB3V.js.map +0 -1
  443. package/dist/assets/browser-BbIPlSaA.js +0 -2
  444. package/dist/assets/browser-BbIPlSaA.js.map +0 -1
  445. package/dist/assets/browser-DtMtdCgJ.js +0 -7
  446. package/dist/assets/browser-DtMtdCgJ.js.map +0 -1
  447. package/dist/assets/ccip-DUUHdwDo.js +0 -2
  448. package/dist/assets/ccip-DUUHdwDo.js.map +0 -1
  449. package/dist/assets/content-DFQJzB7I.js +0 -7
  450. package/dist/assets/content-DFQJzB7I.js.map +0 -1
  451. package/dist/assets/editor-Dms2goxJ.js +0 -346
  452. package/dist/assets/editor-Dms2goxJ.js.map +0 -1
  453. package/dist/assets/getEnsName-DoyRgFOP.js +0 -35
  454. package/dist/assets/getEnsName-DoyRgFOP.js.map +0 -1
  455. package/dist/assets/index-Bg4jiu9P.js +0 -3
  456. package/dist/assets/index-Bg4jiu9P.js.map +0 -1
  457. package/dist/assets/index-CLu1C_is-jUM7ckQa.js +0 -12
  458. package/dist/assets/index-CLu1C_is-jUM7ckQa.js.map +0 -1
  459. package/dist/assets/index-q_KV5Ymp.js +0 -16
  460. package/dist/assets/index-q_KV5Ymp.js.map +0 -1
  461. package/dist/assets/isAddressEqual-H3jvLfD0.js +0 -2
  462. package/dist/assets/isAddressEqual-H3jvLfD0.js.map +0 -1
  463. package/dist/assets/json-m8fnOd5g.js +0 -3
  464. package/dist/assets/json-m8fnOd5g.js.map +0 -1
  465. package/dist/assets/main.Bp4zjrbL.js +0 -2
  466. package/dist/assets/main.Bp4zjrbL.js.map +0 -1
  467. package/dist/assets/root-R8rJ5_ai.js +0 -17
  468. package/dist/assets/root-R8rJ5_ai.js.map +0 -1
  469. package/dist/assets/router-DX6s3TD2.js +0 -12
  470. package/dist/assets/router-DX6s3TD2.js.map +0 -1
  471. package/dist/assets/useUiNodes-BqBkjrKn.js +0 -107
  472. package/dist/assets/useUiNodes-BqBkjrKn.js.map +0 -1
  473. package/dist/service-worker.js.map +0 -1
  474. package/dist/studio/cli.js +0 -6
  475. package/dist/studio/helpers.d.ts +0 -2
  476. package/dist/studio/hmr.js +0 -10
  477. package/dist/studio/index.d.ts +0 -19
  478. package/dist/studio/index.js +0 -624
  479. package/dist/studio/server.d.ts +0 -7
  480. package/dist/studio/vite-plugins/base.d.ts +0 -14
  481. package/dist/studio/vite-plugins/external-packages.d.ts +0 -5
  482. package/dist/studio/vite-plugins/hmr.d.ts +0 -2
  483. package/dist/studio/vite-plugins/studio.d.ts +0 -3
@@ -1,449 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-q_KV5Ymp.js","assets/main.Bp4zjrbL.js","assets/app-loader-mj_poB3V.js","assets/app-loader-DH_VGIVv.css","assets/browser-DtMtdCgJ.js","assets/getEnsName-DoyRgFOP.js","assets/isAddressEqual-H3jvLfD0.js","assets/router-DX6s3TD2.js"])))=>i.map(i=>d[i]);
2
- var hP=Object.defineProperty;var C0=t=>{throw TypeError(t)};var pP=(t,e,n)=>e in t?hP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Ve=(t,e,n)=>pP(t,typeof e!="symbol"?e+"":e,n),Fg=(t,e,n)=>e.has(t)||C0("Cannot "+n);var ce=(t,e,n)=>(Fg(t,e,"read from private field"),n?n.call(t):e.get(t)),bt=(t,e,n)=>e.has(t)?C0("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ht=(t,e,n,r)=>(Fg(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),sn=(t,e,n)=>(Fg(t,e,"access private method"),n);var Uf=(t,e,n,r)=>({set _(i){ht(t,e,i,n)},get _(){return ce(t,e,r)}});import{_ as Se}from"./main.Bp4zjrbL.js";import{jsx as P,jsxs as we,Fragment as Us}from"react/jsx-runtime";import*as Y from"react";import $e,{createElement as Ea,isValidElement as es,cloneElement as sp,Children as mP,createContext as Lu,useContext as Yo,useState as We,useRef as qt,useEffect as Dt,useLayoutEffect as Sm,useCallback as He,useMemo as Pn,Suspense as VT,lazy as gP,forwardRef as Qa,Component as yP,Fragment as Zy,useSyncExternalStore as vP,useReducer as bP,useDebugValue as _P}from"react";import{g as HT,a as Mb,o as Lb,s as wP,n as Fb,L as op,c as Ns,b as Bf,p as EP}from"./app-loader-mj_poB3V.js";import*as SP from"react-dom";import xP,{createPortal as TP}from"react-dom";function IP(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}function st(){return st=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},st.apply(null,arguments)}var rr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ec(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Jre(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var OP={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};const CP=ec(OP);var kP=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function k0(t){var e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=t.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(e.name=n[1],(CP[n[1]]||t.charAt(t.length-2)==="/")&&(e.voidElement=!0),e.name.startsWith("!--"))){var r=t.indexOf("-->");return{type:"comment",comment:r!==-1?t.slice(4,r):""}}for(var i=new RegExp(kP),s=null;(s=i.exec(t))!==null;)if(s[0].trim())if(s[1]){var o=s[1].trim(),a=[o,""];o.indexOf("=")>-1&&(a=o.split("=")),e.attrs[a[0]]=a[1],i.lastIndex--}else s[2]&&(e.attrs[s[2]]=s[3].trim().substring(1,s[3].length-1));return e}var DP=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,RP=/^\s*$/,NP=Object.create(null);function WT(t,e){switch(e.type){case"text":return t+e.content;case"tag":return t+="<"+e.name+(e.attrs?function(n){var r=[];for(var i in n)r.push(i+'="'+n[i]+'"');return r.length?" "+r.join(" "):""}(e.attrs):"")+(e.voidElement?"/>":">"),e.voidElement?t:t+e.children.reduce(WT,"")+"</"+e.name+">";case"comment":return t+"<!--"+e.comment+"-->"}}var AP={parse:function(t,e){e||(e={}),e.components||(e.components=NP);var n,r=[],i=[],s=-1,o=!1;if(t.indexOf("<")!==0){var a=t.indexOf("<");r.push({type:"text",content:a===-1?t:t.substring(0,a)})}return t.replace(DP,function(c,u){if(o){if(c!=="</"+n.name+">")return;o=!1}var l,d=c.charAt(1)!=="/",f=c.startsWith("<!--"),h=u+c.length,m=t.charAt(h);if(f){var p=k0(c);return s<0?(r.push(p),r):((l=i[s]).children.push(p),r)}if(d&&(s++,(n=k0(c)).type==="tag"&&e.components[n.name]&&(n.type="component",o=!0),n.voidElement||o||!m||m==="<"||n.children.push({type:"text",content:t.slice(h,t.indexOf("<",h))}),s===0&&r.push(n),(l=i[s-1])&&l.children.push(n),i[s]=n),(!d||n.voidElement)&&(s>-1&&(n.voidElement||n.name===c.slice(2,-1))&&(s--,n=s===-1?r:i[s]),!o&&m!=="<"&&m)){l=s===-1?r:i[s].children;var g=t.indexOf("<",h),y=t.slice(h,g===-1?void 0:g);RP.test(y)&&(y=" "),(g>-1&&s+l.length>=0||y!==" ")&&l.push({type:"text",content:y})}}),r},stringify:function(t){return t.reduce(function(e,n){return e+WT("",n)},"")}};function Nh(){if(console&&console.warn){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];typeof e[0]=="string"&&(e[0]=`react-i18next:: ${e[0]}`),console.warn(...e)}}const D0={};function ap(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];typeof e[0]=="string"&&D0[e[0]]||(typeof e[0]=="string"&&(D0[e[0]]=new Date),Nh(...e))}const qT=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}};function R0(t,e,n){t.loadNamespaces(e,qT(t,n))}function N0(t,e,n,r){typeof n=="string"&&(n=[n]),n.forEach(i=>{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,qT(t,r))}function PP(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=e.languages[0],i=e.options?e.options.fallbackLng:!1,s=e.languages[e.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(a,c)=>{const u=e.services.backendConnector.state[`${a}|${c}`];return u===-1||u===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!o(e.isLanguageChangingTo,t)?!1:!!(e.hasResourceBundle(r,t)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||o(r,t)&&(!i||o(s,t)))}function MP(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!e.languages||!e.languages.length?(ap("i18n.languages were undefined or empty",e.languages),!0):e.options.ignoreJSONStructure!==void 0?e.hasLoadedNamespace(t,{lng:n.lng,precheck:(i,s)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!s(i.isLanguageChangingTo,t))return!1}}):PP(t,e,n)}function $g(t,e){if(!t)return!1;const n=t.props?t.props.children:t.children;return e?n.length>0:!!n}function jg(t){if(!t)return[];const e=t.props?t.props.children:t.children;return t.props&&t.props.i18nIsDynamicList?Lc(e):e}function LP(t){return Object.prototype.toString.call(t)!=="[object Array]"?!1:t.every(e=>es(e))}function Lc(t){return Array.isArray(t)?t:[t]}function FP(t,e){const n={...e};return n.props=Object.assign(t.props,e.props),n}function GT(t,e){if(!t)return"";let n="";const r=Lc(t),i=e.transSupportBasicHtmlNodes&&e.transKeepBasicHtmlNodesFor?e.transKeepBasicHtmlNodesFor:[];return r.forEach((s,o)=>{if(typeof s=="string")n+=`${s}`;else if(es(s)){const a=Object.keys(s.props).length,c=i.indexOf(s.type)>-1,u=s.props.children;if(!u&&c&&a===0)n+=`<${s.type}/>`;else if(!u&&(!c||a!==0))n+=`<${o}></${o}>`;else if(s.props.i18nIsDynamicList)n+=`<${o}></${o}>`;else if(c&&a===1&&typeof u=="string")n+=`<${s.type}>${u}</${s.type}>`;else{const l=GT(u,e);n+=`<${o}>${l}</${o}>`}}else if(s===null)Nh("Trans: the passed in value is invalid - seems you passed in a null child.");else if(typeof s=="object"){const{format:a,...c}=s,u=Object.keys(c);if(u.length===1){const l=a?`${u[0]}, ${a}`:u[0];n+=`{{${l}}}`}else Nh("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",s)}else Nh("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",s)}),n}function $P(t,e,n,r,i,s){if(e==="")return[];const o=r.transKeepBasicHtmlNodesFor||[],a=e&&new RegExp(o.map(g=>`<${g}`).join("|")).test(e);if(!t&&!a&&!s)return[e];const c={};function u(g){Lc(g).forEach(v=>{typeof v!="string"&&($g(v)?u(jg(v)):typeof v=="object"&&!es(v)&&Object.assign(c,v))})}u(t);const l=AP.parse(`<0>${e}</0>`),d={...c,...i};function f(g,y,v){const b=jg(g),E=m(b,y.children,v);return LP(b)&&E.length===0||g.props&&g.props.i18nIsDynamicList?b:E}function h(g,y,v,b,E){g.dummy?(g.children=y,v.push(sp(g,{key:b},E?void 0:y))):v.push(...mP.map([g],w=>{const x={...w.props};return delete x.i18nIsDynamicList,$e.createElement(w.type,st({},x,{key:b,ref:w.ref},E?{}:{children:y}))}))}function m(g,y,v){const b=Lc(g);return Lc(y).reduce((w,x,_)=>{const k=x.children&&x.children[0]&&x.children[0].content&&n.services.interpolator.interpolate(x.children[0].content,d,n.language);if(x.type==="tag"){let R=b[parseInt(x.name,10)];v.length===1&&!R&&(R=v[0][x.name]),R||(R={});const F=Object.keys(x.attrs).length!==0?FP({props:x.attrs},R):R,V=es(F),T=V&&$g(x,!0)&&!x.voidElement,L=a&&typeof F=="object"&&F.dummy&&!V,S=typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,x.name);if(typeof F=="string"){const C=n.services.interpolator.interpolate(F,d,n.language);w.push(C)}else if($g(F)||T){const C=f(F,x,v);h(F,C,w,_)}else if(L){const C=m(b,x.children,v);h(F,C,w,_)}else if(Number.isNaN(parseFloat(x.name)))if(S){const C=f(F,x,v);h(F,C,w,_,x.voidElement)}else if(r.transSupportBasicHtmlNodes&&o.indexOf(x.name)>-1)if(x.voidElement)w.push(Ea(x.name,{key:`${x.name}-${_}`}));else{const C=m(b,x.children,v);w.push(Ea(x.name,{key:`${x.name}-${_}`},C))}else if(x.voidElement)w.push(`<${x.name} />`);else{const C=m(b,x.children,v);w.push(`<${x.name}>${C}</${x.name}>`)}else if(typeof F=="object"&&!V){const C=x.children[0]?k:null;C&&w.push(C)}else h(F,k,w,_,x.children.length!==1||!k)}else if(x.type==="text"){const R=r.transWrapTextNodes,F=s?r.unescape(n.services.interpolator.interpolate(x.content,d,n.language)):n.services.interpolator.interpolate(x.content,d,n.language);R?w.push(Ea(R,{key:`${x.name}-${_}`},F)):w.push(F)}return w},[])}const p=m([{dummy:!0,children:t||[]}],l,Lc(t||[]));return jg(p[0])}function jP(t){let{children:e,count:n,parent:r,i18nKey:i,context:s,tOptions:o={},values:a,defaults:c,components:u,ns:l,i18n:d,t:f,shouldUnescape:h,...m}=t;const p=d||Mb();if(!p)return ap("You will need to pass in an i18next instance by using i18nextReactModule"),e;const g=f||p.t.bind(p)||(T=>T);s&&(o.context=s);const y={...HT(),...p.options&&p.options.react};let v=l||g.ns||p.options&&p.options.defaultNS;v=typeof v=="string"?[v]:v||["translation"];const b=GT(e,y),E=c||b||y.transEmptyNodeValue||i,{hashTransKey:w}=y,x=i||(w?w(b||E):b||E);p.options&&p.options.interpolation&&p.options.interpolation.defaultVariables&&(a=a&&Object.keys(a).length>0?{...a,...p.options.interpolation.defaultVariables}:{...p.options.interpolation.defaultVariables});const _=a?o.interpolation:{interpolation:{...o.interpolation,prefix:"#$?",suffix:"?$#"}},k={...o,count:n,...a,..._,defaultValue:E,ns:v},R=x?g(x,k):E;u&&Object.keys(u).forEach(T=>{const L=u[T];if(typeof L.type=="function"||!L.props||!L.props.children||R.indexOf(`${T}/>`)<0&&R.indexOf(`${T} />`)<0)return;function S(){return $e.createElement($e.Fragment,null,L)}u[T]=$e.createElement(S,null)});const F=$P(u||e,R,p,y,k,h),V=r!==void 0?r:y.defaultTransParent;return V?Ea(V,m,F):F}const ZT=Lu();class UP{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function YT(t){let{children:e,count:n,parent:r,i18nKey:i,context:s,tOptions:o={},values:a,defaults:c,components:u,ns:l,i18n:d,t:f,shouldUnescape:h,...m}=t;const{i18n:p,defaultNS:g}=Yo(ZT)||{},y=d||p||Mb(),v=f||y&&y.t.bind(y);return jP({children:e,count:n,parent:r,i18nKey:i,context:s,tOptions:o,values:a,defaults:c,components:u,ns:l||v&&v.ns||g||y&&y.options&&y.options.defaultNS,i18n:y,t:f,shouldUnescape:h,...m})}const BP=(t,e)=>{const n=qt();return Dt(()=>{n.current=t},[t,e]),n.current};function tc(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:n}=e,{i18n:r,defaultNS:i}=Yo(ZT)||{},s=n||r||Mb();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new UP),!s){ap("You will need to pass in an i18next instance by using initReactI18next");const b=(w,x)=>typeof x=="string"?x:x&&typeof x=="object"&&typeof x.defaultValue=="string"?x.defaultValue:Array.isArray(w)?w[w.length-1]:w,E=[b,{},!1];return E.t=b,E.i18n={},E.ready=!1,E}s.options.react&&s.options.react.wait!==void 0&&ap("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...HT(),...s.options.react,...e},{useSuspense:a,keyPrefix:c}=o;let u=i||s.options&&s.options.defaultNS;u=typeof u=="string"?[u]:u||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(u);const l=(s.isInitialized||s.initializedStoreOnce)&&u.every(b=>MP(b,s,o));function d(){return s.getFixedT(e.lng||null,o.nsMode==="fallback"?u:u[0],c)}const[f,h]=We(d);let m=u.join();e.lng&&(m=`${e.lng}${m}`);const p=BP(m),g=qt(!0);Dt(()=>{const{bindI18n:b,bindI18nStore:E}=o;g.current=!0,!l&&!a&&(e.lng?N0(s,e.lng,u,()=>{g.current&&h(d)}):R0(s,u,()=>{g.current&&h(d)})),l&&p&&p!==m&&g.current&&h(d);function w(){g.current&&h(d)}return b&&s&&s.on(b,w),E&&s&&s.store.on(E,w),()=>{g.current=!1,b&&s&&b.split(" ").forEach(x=>s.off(x,w)),E&&s&&E.split(" ").forEach(x=>s.store.off(x,w))}},[s,m]);const y=qt(!0);Dt(()=>{g.current&&!y.current&&h(d),y.current=!1},[s,c]);const v=[f,s,l];if(v.t=f,v.i18n=s,v.ready=l,l||!l&&!a)return v;throw new Promise(b=>{e.lng?N0(s,e.lng,u,()=>b()):R0(s,u,()=>b())})}function zP(t){return t?typeof t=="number"?{width:t.toString()+"px",height:t.toString()+"px"}:{width:t,height:t}:{}}const $b="-",VP=t=>{const e=WP(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{const a=o.split($b);return a[0]===""&&a.length!==1&&a.shift(),KT(a,e)||HP(o)},getConflictingClassGroupIds:(o,a)=>{const c=n[o]||[];return a&&r[o]?[...c,...r[o]]:c}}},KT=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),i=r?KT(t.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const s=t.join($b);return(o=e.validators.find(({validator:a})=>a(s)))==null?void 0:o.classGroupId},A0=/^\[(.+)\]$/,HP=t=>{if(A0.test(t)){const e=A0.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},WP=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return GP(Object.entries(t.classGroups),n).forEach(([s,o])=>{Yy(o,r,s,e)}),r},Yy=(t,e,n,r)=>{t.forEach(i=>{if(typeof i=="string"){const s=i===""?e:P0(e,i);s.classGroupId=n;return}if(typeof i=="function"){if(qP(i)){Yy(i(r),e,n,r);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,o])=>{Yy(o,P0(e,s),n,r)})})},P0=(t,e)=>{let n=t;return e.split($b).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},qP=t=>t.isThemeGetter,GP=(t,e)=>e?t.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?e+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,a])=>[e+o,a])):s);return[n,i]}):t,ZP=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const i=(s,o)=>{n.set(s,o),e++,e>t&&(e=0,r=n,n=new Map)};return{get(s){let o=n.get(s);if(o!==void 0)return o;if((o=r.get(s))!==void 0)return i(s,o),o},set(s,o){n.has(s)?n.set(s,o):i(s,o)}}},JT="!",YP=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,i=e[0],s=e.length,o=a=>{const c=[];let u=0,l=0,d;for(let g=0;g<a.length;g++){let y=a[g];if(u===0){if(y===i&&(r||a.slice(g,g+s)===e)){c.push(a.slice(l,g)),l=g+s;continue}if(y==="/"){d=g;continue}}y==="["?u++:y==="]"&&u--}const f=c.length===0?a:a.substring(l),h=f.startsWith(JT),m=h?f.substring(1):f,p=d&&d>l?d-l:void 0;return{modifiers:c,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:o}):o},KP=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},JP=t=>({cache:ZP(t.cacheSize),parseClassName:YP(t),...VP(t)}),XP=/\s+/,QP=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=e,s=[],o=t.trim().split(XP);let a="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:l,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=n(u);let m=!!h,p=r(m?f.substring(0,h):f);if(!p){if(!m){a=u+(a.length>0?" "+a:a);continue}if(p=r(f),!p){a=u+(a.length>0?" "+a:a);continue}m=!1}const g=KP(l).join(":"),y=d?g+JT:g,v=y+p;if(s.includes(v))continue;s.push(v);const b=i(p,m);for(let E=0;E<b.length;++E){const w=b[E];s.push(y+w)}a=u+(a.length>0?" "+a:a)}return a};function ff(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=XT(e))&&(r&&(r+=" "),r+=n);return r}const XT=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=XT(t[r]))&&(n&&(n+=" "),n+=e);return n};function eM(t,...e){let n,r,i,s=o;function o(c){const u=e.reduce((l,d)=>d(l),t());return n=JP(u),r=n.cache.get,i=n.cache.set,s=a,a(c)}function a(c){const u=r(c);if(u)return u;const l=QP(c,n);return i(c,l),l}return function(){return s(ff.apply(null,arguments))}}const un=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},QT=/^\[(?:([a-z-]+):)?(.+)\]$/i,tM=/^\d+\/\d+$/,nM=new Set(["px","full","screen"]),rM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,iM=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,sM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,oM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,aM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ws=t=>Vc(t)||nM.has(t)||tM.test(t),so=t=>Fu(t,"length",mM),Vc=t=>!!t&&!Number.isNaN(Number(t)),Ug=t=>Fu(t,"number",Vc),rl=t=>!!t&&Number.isInteger(Number(t)),cM=t=>t.endsWith("%")&&Vc(t.slice(0,-1)),yt=t=>QT.test(t),oo=t=>rM.test(t),uM=new Set(["length","size","percentage"]),lM=t=>Fu(t,uM,eI),dM=t=>Fu(t,"position",eI),fM=new Set(["image","url"]),hM=t=>Fu(t,fM,yM),pM=t=>Fu(t,"",gM),il=()=>!0,Fu=(t,e,n)=>{const r=QT.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},mM=t=>iM.test(t)&&!sM.test(t),eI=()=>!1,gM=t=>oM.test(t),yM=t=>aM.test(t),vM=()=>{const t=un("colors"),e=un("spacing"),n=un("blur"),r=un("brightness"),i=un("borderColor"),s=un("borderRadius"),o=un("borderSpacing"),a=un("borderWidth"),c=un("contrast"),u=un("grayscale"),l=un("hueRotate"),d=un("invert"),f=un("gap"),h=un("gradientColorStops"),m=un("gradientColorStopPositions"),p=un("inset"),g=un("margin"),y=un("opacity"),v=un("padding"),b=un("saturate"),E=un("scale"),w=un("sepia"),x=un("skew"),_=un("space"),k=un("translate"),R=()=>["auto","contain","none"],F=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto",yt,e],T=()=>[yt,e],L=()=>["",ws,so],S=()=>["auto",Vc,yt],C=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],N=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>["start","end","center","between","around","evenly","stretch"],$=()=>["","0",yt],q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>[Vc,yt];return{cacheSize:500,separator:":",theme:{colors:[il],spacing:[ws,so],blur:["none","",oo,yt],brightness:j(),borderColor:[t],borderRadius:["none","","full",oo,yt],borderSpacing:T(),borderWidth:L(),contrast:j(),grayscale:$(),hueRotate:j(),invert:$(),gap:T(),gradientColorStops:[t],gradientColorStopPositions:[cM,so],inset:V(),margin:V(),opacity:j(),padding:T(),saturate:j(),scale:j(),sepia:$(),skew:j(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",yt]}],container:["container"],columns:[{columns:[oo]}],"break-after":[{"break-after":q()}],"break-before":[{"break-before":q()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...C(),yt]}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",rl,yt]}],basis:[{basis:V()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",yt]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",rl,yt]}],"grid-cols":[{"grid-cols":[il]}],"col-start-end":[{col:["auto",{span:["full",rl,yt]},yt]}],"col-start":[{"col-start":S()}],"col-end":[{"col-end":S()}],"grid-rows":[{"grid-rows":[il]}],"row-start-end":[{row:["auto",{span:[rl,yt]},yt]}],"row-start":[{"row-start":S()}],"row-end":[{"row-end":S()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",yt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",yt]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",yt,e]}],"min-w":[{"min-w":[yt,e,"min","max","fit"]}],"max-w":[{"max-w":[yt,e,"none","full","min","max","fit","prose",{screen:[oo]},oo]}],h:[{h:[yt,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[yt,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[yt,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[yt,e,"auto","min","max","fit"]}],"font-size":[{text:["base",oo,so]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ug]}],"font-family":[{font:[il]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",yt]}],"line-clamp":[{"line-clamp":["none",Vc,Ug]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ws,yt]}],"list-image":[{"list-image":["none",yt]}],"list-style-type":[{list:["none","disc","decimal",yt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...N(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ws,so]}],"underline-offset":[{"underline-offset":["auto",ws,yt]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",yt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",yt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...C(),dM]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",lM]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},hM]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...N(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:N()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...N()]}],"outline-offset":[{"outline-offset":[ws,yt]}],"outline-w":[{outline:[ws,so]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[ws,so]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",oo,pM]}],"shadow-color":[{shadow:[il]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...U(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",oo,yt]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[l]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[l]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",yt]}],duration:[{duration:j()}],ease:[{ease:["linear","in","out","in-out",yt]}],delay:[{delay:j()}],animate:[{animate:["none","spin","ping","pulse","bounce",yt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[rl,yt]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[x]}],"skew-y":[{"skew-y":[x]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",yt]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",yt]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",yt]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[ws,so,Ug]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Vt=eM(vM);var bM="Expected a function",M0=NaN,_M="[object Symbol]",wM=/^\s+|\s+$/g,EM=/^[-+]0x[0-9a-f]+$/i,SM=/^0b[01]+$/i,xM=/^0o[0-7]+$/i,TM=parseInt,IM=typeof rr=="object"&&rr&&rr.Object===Object&&rr,OM=typeof self=="object"&&self&&self.Object===Object&&self,CM=IM||OM||Function("return this")(),kM=Object.prototype,DM=kM.toString,RM=Math.max,NM=Math.min,Bg=function(){return CM.Date.now()};function AM(t,e,n){var r,i,s,o,a,c,u=0,l=!1,d=!1,f=!0;if(typeof t!="function")throw new TypeError(bM);e=L0(e)||0,Ky(n)&&(l=!!n.leading,d="maxWait"in n,s=d?RM(L0(n.maxWait)||0,e):s,f="trailing"in n?!!n.trailing:f);function h(x){var _=r,k=i;return r=i=void 0,u=x,o=t.apply(k,_),o}function m(x){return u=x,a=setTimeout(y,e),l?h(x):o}function p(x){var _=x-c,k=x-u,R=e-_;return d?NM(R,s-k):R}function g(x){var _=x-c,k=x-u;return c===void 0||_>=e||_<0||d&&k>=s}function y(){var x=Bg();if(g(x))return v(x);a=setTimeout(y,p(x))}function v(x){return a=void 0,f&&r?h(x):(r=i=void 0,o)}function b(){a!==void 0&&clearTimeout(a),u=0,r=c=i=a=void 0}function E(){return a===void 0?o:v(Bg())}function w(){var x=Bg(),_=g(x);if(r=arguments,i=this,c=x,_){if(a===void 0)return m(c);if(d)return a=setTimeout(y,e),h(c)}return a===void 0&&(a=setTimeout(y,e)),o}return w.cancel=b,w.flush=E,w}function Ky(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function PM(t){return!!t&&typeof t=="object"}function MM(t){return typeof t=="symbol"||PM(t)&&DM.call(t)==_M}function L0(t){if(typeof t=="number")return t;if(MM(t))return M0;if(Ky(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Ky(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(wM,"");var n=SM.test(t);return n||xM.test(t)?TM(t.slice(2),n?2:8):EM.test(t)?M0:+t}var LM=AM;const F0=ec(LM);var FM=typeof window<"u"?Sm:Dt;function $M(t,e,n,r){const i=qt(e);FM(()=>{i.current=e},[e]),Dt(()=>{const s=window;if(!(s&&s.addEventListener))return;const o=a=>{i.current(a)};return s.addEventListener(t,o,r),()=>{s.removeEventListener(t,o,r)}},[t,n,r])}function Xre(){const[t,e]=We(null),n=He(async r=>{if(!(navigator!=null&&navigator.clipboard))return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(r),e(r),!0}catch(i){return console.warn("Copy failed",i),e(null),!1}},[]);return[t,n]}function jM(t){const e=qt(t);e.current=t,Dt(()=>()=>{e.current()},[])}function UM(t,e=500,n){const r=qt();jM(()=>{r.current&&r.current.cancel()});const i=Pn(()=>{const s=F0(t,e,n),o=(...a)=>s(...a);return o.cancel=()=>{s.cancel()},o.isPending=()=>!!r.current,o.flush=()=>s.flush(),o},[t,e,n]);return Dt(()=>{r.current=F0(t,e,n)},[t,e,n]),i}function BM(t,e,n){const r=(u,l)=>u===l,i=t instanceof Function?t():t,[s,o]=We(i),a=qt(i),c=UM(o,e,n);return r(a.current,i)||(c(i),a.current=i),[s,c]}function Qre(t,e,n="mousedown",r={}){$M(n,i=>{const s=i.target;if(!s||!s.isConnected)return;(Array.isArray(t)?t.filter(a=>!!a.current).every(a=>a.current&&!a.current.contains(s)):t.current&&!t.current.contains(s))&&e(i)},void 0,r)}const zM=(t,e,n)=>{const r=t[e];return r?typeof r=="function"?r():Promise.resolve(r):new Promise((i,s)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==n?". Note that variables only represent file names one level deep.":""))))})};function VM(t){return P("div",{style:{width:t.width,height:t.height}})}function HM(t){try{return gP(()=>zM(Object.assign({"../../../assets/icon-components/ArrowFilledRight.tsx":()=>Se(()=>import("./ArrowFilledRight-BXP1j8Cl.js"),[]),"../../../assets/icon-components/ArrowLeft.tsx":()=>Se(()=>import("./ArrowLeft-8ZR_YHAJ.js"),[]),"../../../assets/icon-components/ArrowUp.tsx":()=>Se(()=>import("./ArrowUp-E2jS6Wzt.js"),[]),"../../../assets/icon-components/BarChart.tsx":()=>Se(()=>import("./BarChart-C-E6t7dt.js"),[]),"../../../assets/icon-components/BaseArrowLeft.tsx":()=>Se(()=>import("./BaseArrowLeft-DtHrkTW4.js"),[]),"../../../assets/icon-components/BaseArrowRight.tsx":()=>Se(()=>import("./BaseArrowRight-BIwzFHnh.js"),[]),"../../../assets/icon-components/Braces.tsx":()=>Se(()=>import("./Braces-3LcexUsR.js"),[]),"../../../assets/icon-components/Branch.tsx":()=>Se(()=>import("./Branch-D0CssEh3.js"),[]),"../../../assets/icon-components/BrickGlobe.tsx":()=>Se(()=>import("./BrickGlobe-CdHw7ZVP.js"),[]),"../../../assets/icon-components/Briefcase.tsx":()=>Se(()=>import("./Briefcase-CV2bgnSj.js"),[]),"../../../assets/icon-components/Calendar.tsx":()=>Se(()=>import("./Calendar-DuXN-sPt.js"),[]),"../../../assets/icon-components/CalendarTime.tsx":()=>Se(()=>import("./CalendarTime-BowYBiVM.js"),[]),"../../../assets/icon-components/Caret.tsx":()=>Se(()=>import("./Caret-r16V7Hcs.js"),[]),"../../../assets/icon-components/CaretDown.tsx":()=>Se(()=>import("./CaretDown-DljrBfIz.js"),[]),"../../../assets/icon-components/CaretLeft.tsx":()=>Se(()=>import("./CaretLeft-B_Lzd_Rn.js"),[]),"../../../assets/icon-components/CaretRight.tsx":()=>Se(()=>import("./CaretRight-Bbz5nCpg.js"),[]),"../../../assets/icon-components/CaretSort.tsx":()=>Se(()=>import("./CaretSort-DSgBum1h.js"),[]),"../../../assets/icon-components/Check.tsx":()=>Se(()=>import("./Check-CbV9BYHY.js"),[]),"../../../assets/icon-components/CheckCircle.tsx":()=>Se(()=>import("./CheckCircle-CX2jIKoF.js"),[]),"../../../assets/icon-components/CheckCircleFill.tsx":()=>Se(()=>import("./CheckCircleFill-DLK12sW5.js"),[]),"../../../assets/icon-components/Checkmark.tsx":()=>Se(()=>import("./Checkmark-DBvUEZAd.js"),[]),"../../../assets/icon-components/ChevronDown.tsx":()=>Se(()=>import("./ChevronDown-eUsCPXcB.js"),[]),"../../../assets/icon-components/Circle.tsx":()=>Se(()=>import("./Circle-8dOehHQf.js"),[]),"../../../assets/icon-components/CircleInfo.tsx":()=>Se(()=>import("./CircleInfo-D0ktZDko.js"),[]),"../../../assets/icon-components/Clock.tsx":()=>Se(()=>import("./Clock-CudavWaE.js"),[]),"../../../assets/icon-components/ClockFill.tsx":()=>Se(()=>import("./ClockFill-yWs52y_e.js"),[]),"../../../assets/icon-components/CloudSlash.tsx":()=>Se(()=>import("./CloudSlash-D18Hl3VW.js"),[]),"../../../assets/icon-components/Collapse.tsx":()=>Se(()=>import("./Collapse-BOxZH5-e.js"),[]),"../../../assets/icon-components/Connect.tsx":()=>Se(()=>import("./Connect-laqJZT3s.js"),[]),"../../../assets/icon-components/Copy.tsx":()=>Se(()=>import("./Copy-CkOtWZ6m.js"),[]),"../../../assets/icon-components/CrossCircle.tsx":()=>Se(()=>import("./CrossCircle-Bp9diEe9.js"),[]),"../../../assets/icon-components/Danger.tsx":()=>Se(()=>import("./Danger-CLu7nxgz.js"),[]),"../../../assets/icon-components/Discord.tsx":()=>Se(()=>import("./Discord-CcPWRT8g.js"),[]),"../../../assets/icon-components/Drive.tsx":()=>Se(()=>import("./Drive-CzahDx9j.js"),[]),"../../../assets/icon-components/Edit.tsx":()=>Se(()=>import("./Edit-D9GlgGu8.js"),[]),"../../../assets/icon-components/Ellipsis.tsx":()=>Se(()=>import("./Ellipsis-DWNUJYUI.js"),[]),"../../../assets/icon-components/Error.tsx":()=>Se(()=>import("./Error-FBAhqFT5.js"),[]),"../../../assets/icon-components/Exclamation.tsx":()=>Se(()=>import("./Exclamation-BGFGsVRw.js"),[]),"../../../assets/icon-components/File.tsx":()=>Se(()=>import("./File-DWKl25DR.js"),[]),"../../../assets/icon-components/FilesEarmark.tsx":()=>Se(()=>import("./FilesEarmark-BTL53WSf.js"),[]),"../../../assets/icon-components/FolderClose.tsx":()=>Se(()=>import("./FolderClose-BVMKeKvW.js"),[]),"../../../assets/icon-components/FolderOpen.tsx":()=>Se(()=>import("./FolderOpen-DT55_X9N.js"),[]),"../../../assets/icon-components/FolderPlus.tsx":()=>Se(()=>import("./FolderPlus-C2G5PVs-.js"),[]),"../../../assets/icon-components/Forum.tsx":()=>Se(()=>import("./Forum-Cfgyizyn.js"),[]),"../../../assets/icon-components/Gear.tsx":()=>Se(()=>import("./Gear-CoQ9O06k.js"),[]),"../../../assets/icon-components/Github.tsx":()=>Se(()=>import("./Github-CjkZIHCO.js"),[]),"../../../assets/icon-components/Globe.tsx":()=>Se(()=>import("./Globe-Dy2otZRk.js"),[]),"../../../assets/icon-components/GlobeWww.tsx":()=>Se(()=>import("./GlobeWww-Ci7aa5CE.js"),[]),"../../../assets/icon-components/Hdd.tsx":()=>Se(()=>import("./Hdd-CP-hFB7d.js"),[]),"../../../assets/icon-components/History.tsx":()=>Se(()=>import("./History-CmOiP5qa.js"),[]),"../../../assets/icon-components/InfoSquare.tsx":()=>Se(()=>import("./InfoSquare-DbYZrwmg.js"),[]),"../../../assets/icon-components/Link.tsx":()=>Se(()=>import("./Link-CXIVQOz6.js"),[]),"../../../assets/icon-components/Linkedin.tsx":()=>Se(()=>import("./Linkedin-exhl1yGN.js"),[]),"../../../assets/icon-components/Lock.tsx":()=>Se(()=>import("./Lock-DWdDRi_O.js"),[]),"../../../assets/icon-components/M.tsx":()=>Se(()=>import("./M-ByQIo8bX.js"),[]),"../../../assets/icon-components/PackageManager.tsx":()=>Se(()=>import("./PackageManager-D6Ia8zHs.js"),[]),"../../../assets/icon-components/Pencil.tsx":()=>Se(()=>import("./Pencil-D830iveq.js"),[]),"../../../assets/icon-components/People.tsx":()=>Se(()=>import("./People-B1tewG8c.js"),[]),"../../../assets/icon-components/Person.tsx":()=>Se(()=>import("./Person-BPRmm67U.js"),[]),"../../../assets/icon-components/Pin.tsx":()=>Se(()=>import("./Pin-D53eCMAz.js"),[]),"../../../assets/icon-components/PinFilled.tsx":()=>Se(()=>import("./PinFilled-CMXfFW67.js"),[]),"../../../assets/icon-components/Plus.tsx":()=>Se(()=>import("./Plus-XUIm1wNw.js"),[]),"../../../assets/icon-components/PlusCircle.tsx":()=>Se(()=>import("./PlusCircle-D1IRYULb.js"),[]),"../../../assets/icon-components/PowerhouseLogoSmall.tsx":()=>Se(()=>import("./PowerhouseLogoSmall-DF1uUwIC.js"),[]),"../../../assets/icon-components/Project.tsx":()=>Se(()=>import("./Project-EsBam9d0.js"),[]),"../../../assets/icon-components/QuestionSquare.tsx":()=>Se(()=>import("./QuestionSquare-CDaw1i6L.js"),[]),"../../../assets/icon-components/RedoArrow.tsx":()=>Se(()=>import("./RedoArrow-DM-fqhEP.js"),[]),"../../../assets/icon-components/Reload.tsx":()=>Se(()=>import("./Reload-DPZbA7yl.js"),[]),"../../../assets/icon-components/Renown.tsx":()=>Se(()=>import("./Renown-CItksi2j.js"),[]),"../../../assets/icon-components/RenownHover.tsx":()=>Se(()=>import("./RenownHover-cYQgnwQW.js"),[]),"../../../assets/icon-components/Ring.tsx":()=>Se(()=>import("./Ring-BivnmVc5.js"),[]),"../../../assets/icon-components/Save.tsx":()=>Se(()=>import("./Save-BWCZPY82.js"),[]),"../../../assets/icon-components/Search.tsx":()=>Se(()=>import("./Search-BiEcSbcf.js"),[]),"../../../assets/icon-components/Server.tsx":()=>Se(()=>import("./Server-cAzmNxsS.js"),[]),"../../../assets/icon-components/Settings.tsx":()=>Se(()=>import("./Settings-Cca-sV-_.js"),[]),"../../../assets/icon-components/Synced.tsx":()=>Se(()=>import("./Synced-CjieGKOk.js"),[]),"../../../assets/icon-components/Syncing.tsx":()=>Se(()=>import("./Syncing-KnDBLSYe.js"),[]),"../../../assets/icon-components/Trash.tsx":()=>Se(()=>import("./Trash-DIHOD5wQ.js"),[]),"../../../assets/icon-components/TrashFill.tsx":()=>Se(()=>import("./TrashFill-CG3humXp.js"),[]),"../../../assets/icon-components/TreeViewSlash.tsx":()=>Se(()=>import("./TreeViewSlash-CKJADIpa.js"),[]),"../../../assets/icon-components/TriangleDown.tsx":()=>Se(()=>import("./TriangleDown-Boh-WZzH.js"),[]),"../../../assets/icon-components/VariantArrowLeft.tsx":()=>Se(()=>import("./VariantArrowLeft-Dl1-3L5q.js"),[]),"../../../assets/icon-components/VerticalDots.tsx":()=>Se(()=>import("./VerticalDots-CCZxgZM8.js"),[]),"../../../assets/icon-components/WarningFill.tsx":()=>Se(()=>import("./WarningFill-CRRaW3Oz.js"),[]),"../../../assets/icon-components/XTwitter.tsx":()=>Se(()=>import("./XTwitter-CW6IaHUb.js"),[]),"../../../assets/icon-components/Xmark.tsx":()=>Se(()=>import("./Xmark-CZ3t0Fap.js"),[]),"../../../assets/icon-components/XmarkLight.tsx":()=>Se(()=>import("./XmarkLight-BkhBFy51.js"),[]),"../../../assets/icon-components/Youtube.tsx":()=>Se(()=>import("./Youtube-h-Dc9pri.js"),[])}),`../../../assets/icon-components/${t}.tsx`,6))}catch(e){return console.error(e),VM}}function vt({name:t,size:e=24,color:n,style:r,...i}){const s=zP(e),o={color:n,...s,style:r},a=Pn(()=>HM(t),[t]);return P(VT,{fallback:P("div",{"data-testid":"icon-fallback",style:s}),name:"icon-component",children:P(a,{...i,style:o})})}function ka(t){"@babel/helpers - typeof";return ka=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ka(t)}function WM(t,e){if(ka(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(ka(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tI(t){var e=WM(t,"string");return ka(e)=="symbol"?e:e+""}function bl(t,e,n){return(e=tI(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $0(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function it(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?$0(Object(n),!0).forEach(function(r){bl(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$0(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function qM(t){if(Array.isArray(t))return t}function GM(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,s,o,a=[],c=!0,u=!1;try{if(s=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(a.push(r.value),a.length!==e);c=!0);}catch(l){u=!0,i=l}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function Jy(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function nI(t,e){if(t){if(typeof t=="string")return Jy(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jy(t,e):void 0}}function ZM(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fs(t,e){return qM(t)||GM(t,e)||nI(t,e)||ZM()}function YM(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function Js(t,e){if(t==null)return{};var n,r,i=YM(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)n=s[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var KM=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function JM(t){var e=t.defaultInputValue,n=e===void 0?"":e,r=t.defaultMenuIsOpen,i=r===void 0?!1:r,s=t.defaultValue,o=s===void 0?null:s,a=t.inputValue,c=t.menuIsOpen,u=t.onChange,l=t.onInputChange,d=t.onMenuClose,f=t.onMenuOpen,h=t.value,m=Js(t,KM),p=We(a!==void 0?a:n),g=Fs(p,2),y=g[0],v=g[1],b=We(c!==void 0?c:i),E=Fs(b,2),w=E[0],x=E[1],_=We(h!==void 0?h:o),k=Fs(_,2),R=k[0],F=k[1],V=He(function(K,$){typeof u=="function"&&u(K,$),F(K)},[u]),T=He(function(K,$){var q;typeof l=="function"&&(q=l(K,$)),v(q!==void 0?q:K)},[l]),L=He(function(){typeof f=="function"&&f(),x(!0)},[f]),S=He(function(){typeof d=="function"&&d(),x(!1)},[d]),C=a!==void 0?a:y,N=c!==void 0?c:w,U=h!==void 0?h:R;return it(it({},m),{},{inputValue:C,menuIsOpen:N,onChange:V,onInputChange:T,onMenuClose:S,onMenuOpen:L,value:U})}function XM(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function j0(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,tI(r.key),r)}}function QM(t,e,n){return j0(t.prototype,e),j0(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Xy(t,e){return Xy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Xy(t,e)}function eL(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Xy(t,e)}function cp(t){return cp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},cp(t)}function rI(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rI=function(){return!!t})()}function tL(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function nL(t,e){if(e&&(ka(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tL(t)}function rL(t){var e=rI();return function(){var n,r=cp(t);if(e){var i=cp(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return nL(this,n)}}function iL(t){if(Array.isArray(t))return Jy(t)}function sL(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function oL(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jb(t){return iL(t)||sL(t)||nI(t)||oL()}function aL(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function cL(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var uL=function(){function t(n){var r=this;this._insertTag=function(i){var s;r.tags.length===0?r.insertionPoint?s=r.insertionPoint.nextSibling:r.prepend?s=r.container.firstChild:s=r.before:s=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,s),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(r){r.forEach(this._insertTag)},e.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(cL(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var s=aL(i);try{s.insertRule(r,s.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},e.flush=function(){this.tags.forEach(function(r){var i;return(i=r.parentNode)==null?void 0:i.removeChild(r)}),this.tags=[],this.ctr=0},t}(),tr="-ms-",up="-moz-",Ht="-webkit-",iI="comm",Ub="rule",Bb="decl",lL="@import",sI="@keyframes",dL="@layer",fL=Math.abs,xm=String.fromCharCode,hL=Object.assign;function pL(t,e){return Xn(t,0)^45?(((e<<2^Xn(t,0))<<2^Xn(t,1))<<2^Xn(t,2))<<2^Xn(t,3):0}function oI(t){return t.trim()}function mL(t,e){return(t=e.exec(t))?t[0]:t}function Wt(t,e,n){return t.replace(e,n)}function Qy(t,e){return t.indexOf(e)}function Xn(t,e){return t.charCodeAt(e)|0}function Kl(t,e,n){return t.slice(e,n)}function qi(t){return t.length}function zb(t){return t.length}function zf(t,e){return e.push(t),t}function gL(t,e){return t.map(e).join("")}var Tm=1,hu=1,aI=0,kr=0,An=0,$u="";function Im(t,e,n,r,i,s,o){return{value:t,root:e,parent:n,type:r,props:i,children:s,line:Tm,column:hu,length:o,return:""}}function sl(t,e){return hL(Im("",null,null,"",null,null,0),t,{length:-t.length},e)}function yL(){return An}function vL(){return An=kr>0?Xn($u,--kr):0,hu--,An===10&&(hu=1,Tm--),An}function Ur(){return An=kr<aI?Xn($u,kr++):0,hu++,An===10&&(hu=1,Tm++),An}function ts(){return Xn($u,kr)}function Ah(){return kr}function hf(t,e){return Kl($u,t,e)}function Jl(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function cI(t){return Tm=hu=1,aI=qi($u=t),kr=0,[]}function uI(t){return $u="",t}function Ph(t){return oI(hf(kr-1,ev(t===91?t+2:t===40?t+1:t)))}function bL(t){for(;(An=ts())&&An<33;)Ur();return Jl(t)>2||Jl(An)>3?"":" "}function _L(t,e){for(;--e&&Ur()&&!(An<48||An>102||An>57&&An<65||An>70&&An<97););return hf(t,Ah()+(e<6&&ts()==32&&Ur()==32))}function ev(t){for(;Ur();)switch(An){case t:return kr;case 34:case 39:t!==34&&t!==39&&ev(An);break;case 40:t===41&&ev(t);break;case 92:Ur();break}return kr}function wL(t,e){for(;Ur()&&t+An!==57;)if(t+An===84&&ts()===47)break;return"/*"+hf(e,kr-1)+"*"+xm(t===47?t:Ur())}function EL(t){for(;!Jl(ts());)Ur();return hf(t,kr)}function SL(t){return uI(Mh("",null,null,null,[""],t=cI(t),0,[0],t))}function Mh(t,e,n,r,i,s,o,a,c){for(var u=0,l=0,d=o,f=0,h=0,m=0,p=1,g=1,y=1,v=0,b="",E=i,w=s,x=r,_=b;g;)switch(m=v,v=Ur()){case 40:if(m!=108&&Xn(_,d-1)==58){Qy(_+=Wt(Ph(v),"&","&\f"),"&\f")!=-1&&(y=-1);break}case 34:case 39:case 91:_+=Ph(v);break;case 9:case 10:case 13:case 32:_+=bL(m);break;case 92:_+=_L(Ah()-1,7);continue;case 47:switch(ts()){case 42:case 47:zf(xL(wL(Ur(),Ah()),e,n),c);break;default:_+="/"}break;case 123*p:a[u++]=qi(_)*y;case 125*p:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+l:y==-1&&(_=Wt(_,/\f/g,"")),h>0&&qi(_)-d&&zf(h>32?B0(_+";",r,n,d-1):B0(Wt(_," ","")+";",r,n,d-2),c);break;case 59:_+=";";default:if(zf(x=U0(_,e,n,u,l,i,a,b,E=[],w=[],d),s),v===123)if(l===0)Mh(_,e,x,x,E,s,d,a,w);else switch(f===99&&Xn(_,3)===110?100:f){case 100:case 108:case 109:case 115:Mh(t,x,x,r&&zf(U0(t,x,x,0,0,i,a,b,i,E=[],d),w),i,w,d,a,r?E:w);break;default:Mh(_,x,x,x,[""],w,0,a,w)}}u=l=h=0,p=y=1,b=_="",d=o;break;case 58:d=1+qi(_),h=m;default:if(p<1){if(v==123)--p;else if(v==125&&p++==0&&vL()==125)continue}switch(_+=xm(v),v*p){case 38:y=l>0?1:(_+="\f",-1);break;case 44:a[u++]=(qi(_)-1)*y,y=1;break;case 64:ts()===45&&(_+=Ph(Ur())),f=ts(),l=d=qi(b=_+=EL(Ah())),v++;break;case 45:m===45&&qi(_)==2&&(p=0)}}return s}function U0(t,e,n,r,i,s,o,a,c,u,l){for(var d=i-1,f=i===0?s:[""],h=zb(f),m=0,p=0,g=0;m<r;++m)for(var y=0,v=Kl(t,d+1,d=fL(p=o[m])),b=t;y<h;++y)(b=oI(p>0?f[y]+" "+v:Wt(v,/&\f/g,f[y])))&&(c[g++]=b);return Im(t,e,n,i===0?Ub:a,c,u,l)}function xL(t,e,n){return Im(t,e,n,iI,xm(yL()),Kl(t,2,-2),0)}function B0(t,e,n,r){return Im(t,e,n,Bb,Kl(t,0,r),Kl(t,r+1,-1),r)}function Hc(t,e){for(var n="",r=zb(t),i=0;i<r;i++)n+=e(t[i],i,t,e)||"";return n}function TL(t,e,n,r){switch(t.type){case dL:if(t.children.length)break;case lL:case Bb:return t.return=t.return||t.value;case iI:return"";case sI:return t.return=t.value+"{"+Hc(t.children,r)+"}";case Ub:t.value=t.props.join(",")}return qi(n=Hc(t.children,r))?t.return=t.value+"{"+n+"}":""}function IL(t){var e=zb(t);return function(n,r,i,s){for(var o="",a=0;a<e;a++)o+=t[a](n,r,i,s)||"";return o}}function OL(t){return function(e){e.root||(e=e.return)&&t(e)}}function CL(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var kL=function(e,n,r){for(var i=0,s=0;i=s,s=ts(),i===38&&s===12&&(n[r]=1),!Jl(s);)Ur();return hf(e,kr)},DL=function(e,n){var r=-1,i=44;do switch(Jl(i)){case 0:i===38&&ts()===12&&(n[r]=1),e[r]+=kL(kr-1,n,r);break;case 2:e[r]+=Ph(i);break;case 4:if(i===44){e[++r]=ts()===58?"&\f":"",n[r]=e[r].length;break}default:e[r]+=xm(i)}while(i=Ur());return e},RL=function(e,n){return uI(DL(cI(e),n))},z0=new WeakMap,NL=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var n=e.value,r=e.parent,i=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&n.charCodeAt(0)!==58&&!z0.get(r))&&!i){z0.set(e,!0);for(var s=[],o=RL(n,s),a=r.props,c=0,u=0;c<o.length;c++)for(var l=0;l<a.length;l++,u++)e.props[u]=s[c]?o[c].replace(/&\f/g,a[l]):a[l]+" "+o[c]}}},AL=function(e){if(e.type==="decl"){var n=e.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(e.return="",e.value="")}};function lI(t,e){switch(pL(t,e)){case 5103:return Ht+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ht+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return Ht+t+up+t+tr+t+t;case 6828:case 4268:return Ht+t+tr+t+t;case 6165:return Ht+t+tr+"flex-"+t+t;case 5187:return Ht+t+Wt(t,/(\w+).+(:[^]+)/,Ht+"box-$1$2"+tr+"flex-$1$2")+t;case 5443:return Ht+t+tr+"flex-item-"+Wt(t,/flex-|-self/,"")+t;case 4675:return Ht+t+tr+"flex-line-pack"+Wt(t,/align-content|flex-|-self/,"")+t;case 5548:return Ht+t+tr+Wt(t,"shrink","negative")+t;case 5292:return Ht+t+tr+Wt(t,"basis","preferred-size")+t;case 6060:return Ht+"box-"+Wt(t,"-grow","")+Ht+t+tr+Wt(t,"grow","positive")+t;case 4554:return Ht+Wt(t,/([^-])(transform)/g,"$1"+Ht+"$2")+t;case 6187:return Wt(Wt(Wt(t,/(zoom-|grab)/,Ht+"$1"),/(image-set)/,Ht+"$1"),t,"")+t;case 5495:case 3959:return Wt(t,/(image-set\([^]*)/,Ht+"$1$`$1");case 4968:return Wt(Wt(t,/(.+:)(flex-)?(.*)/,Ht+"box-pack:$3"+tr+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ht+t+t;case 4095:case 3583:case 4068:case 2532:return Wt(t,/(.+)-inline(.+)/,Ht+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(qi(t)-1-e>6)switch(Xn(t,e+1)){case 109:if(Xn(t,e+4)!==45)break;case 102:return Wt(t,/(.+:)(.+)-([^]+)/,"$1"+Ht+"$2-$3$1"+up+(Xn(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~Qy(t,"stretch")?lI(Wt(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Xn(t,e+1)!==115)break;case 6444:switch(Xn(t,qi(t)-3-(~Qy(t,"!important")&&10))){case 107:return Wt(t,":",":"+Ht)+t;case 101:return Wt(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ht+(Xn(t,14)===45?"inline-":"")+"box$3$1"+Ht+"$2$3$1"+tr+"$2box$3")+t}break;case 5936:switch(Xn(t,e+11)){case 114:return Ht+t+tr+Wt(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return Ht+t+tr+Wt(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return Ht+t+tr+Wt(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return Ht+t+tr+t+t}return t}var PL=function(e,n,r,i){if(e.length>-1&&!e.return)switch(e.type){case Bb:e.return=lI(e.value,e.length);break;case sI:return Hc([sl(e,{value:Wt(e.value,"@","@"+Ht)})],i);case Ub:if(e.length)return gL(e.props,function(s){switch(mL(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Hc([sl(e,{props:[Wt(s,/:(read-\w+)/,":"+up+"$1")]})],i);case"::placeholder":return Hc([sl(e,{props:[Wt(s,/:(plac\w+)/,":"+Ht+"input-$1")]}),sl(e,{props:[Wt(s,/:(plac\w+)/,":"+up+"$1")]}),sl(e,{props:[Wt(s,/:(plac\w+)/,tr+"input-$1")]})],i)}return""})}},ML=[PL],LL=function(e){var n=e.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(p){var g=p.getAttribute("data-emotion");g.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var i=e.stylisPlugins||ML,s={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(p){for(var g=p.getAttribute("data-emotion").split(" "),y=1;y<g.length;y++)s[g[y]]=!0;a.push(p)});var c,u=[NL,AL];{var l,d=[TL,OL(function(p){l.insert(p)})],f=IL(u.concat(i,d)),h=function(g){return Hc(SL(g),f)};c=function(g,y,v,b){l=v,h(g?g+"{"+y.styles+"}":y.styles),b&&(m.inserted[y.name]=!0)}}var m={key:n,sheet:new uL({key:n,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:c};return m.sheet.hydrate(a),m},dI={exports:{}},Qt={};/** @license React v16.13.1
5
- * react-is.production.min.js
6
- *
7
- * Copyright (c) Facebook, Inc. and its affiliates.
8
- *
9
- * This source code is licensed under the MIT license found in the
10
- * LICENSE file in the root directory of this source tree.
11
- */var Gn=typeof Symbol=="function"&&Symbol.for,Vb=Gn?Symbol.for("react.element"):60103,Hb=Gn?Symbol.for("react.portal"):60106,Om=Gn?Symbol.for("react.fragment"):60107,Cm=Gn?Symbol.for("react.strict_mode"):60108,km=Gn?Symbol.for("react.profiler"):60114,Dm=Gn?Symbol.for("react.provider"):60109,Rm=Gn?Symbol.for("react.context"):60110,Wb=Gn?Symbol.for("react.async_mode"):60111,Nm=Gn?Symbol.for("react.concurrent_mode"):60111,Am=Gn?Symbol.for("react.forward_ref"):60112,Pm=Gn?Symbol.for("react.suspense"):60113,FL=Gn?Symbol.for("react.suspense_list"):60120,Mm=Gn?Symbol.for("react.memo"):60115,Lm=Gn?Symbol.for("react.lazy"):60116,$L=Gn?Symbol.for("react.block"):60121,jL=Gn?Symbol.for("react.fundamental"):60117,UL=Gn?Symbol.for("react.responder"):60118,BL=Gn?Symbol.for("react.scope"):60119;function qr(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case Vb:switch(t=t.type,t){case Wb:case Nm:case Om:case km:case Cm:case Pm:return t;default:switch(t=t&&t.$$typeof,t){case Rm:case Am:case Lm:case Mm:case Dm:return t;default:return e}}case Hb:return e}}}function fI(t){return qr(t)===Nm}Qt.AsyncMode=Wb;Qt.ConcurrentMode=Nm;Qt.ContextConsumer=Rm;Qt.ContextProvider=Dm;Qt.Element=Vb;Qt.ForwardRef=Am;Qt.Fragment=Om;Qt.Lazy=Lm;Qt.Memo=Mm;Qt.Portal=Hb;Qt.Profiler=km;Qt.StrictMode=Cm;Qt.Suspense=Pm;Qt.isAsyncMode=function(t){return fI(t)||qr(t)===Wb};Qt.isConcurrentMode=fI;Qt.isContextConsumer=function(t){return qr(t)===Rm};Qt.isContextProvider=function(t){return qr(t)===Dm};Qt.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===Vb};Qt.isForwardRef=function(t){return qr(t)===Am};Qt.isFragment=function(t){return qr(t)===Om};Qt.isLazy=function(t){return qr(t)===Lm};Qt.isMemo=function(t){return qr(t)===Mm};Qt.isPortal=function(t){return qr(t)===Hb};Qt.isProfiler=function(t){return qr(t)===km};Qt.isStrictMode=function(t){return qr(t)===Cm};Qt.isSuspense=function(t){return qr(t)===Pm};Qt.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===Om||t===Nm||t===km||t===Cm||t===Pm||t===FL||typeof t=="object"&&t!==null&&(t.$$typeof===Lm||t.$$typeof===Mm||t.$$typeof===Dm||t.$$typeof===Rm||t.$$typeof===Am||t.$$typeof===jL||t.$$typeof===UL||t.$$typeof===BL||t.$$typeof===$L)};Qt.typeOf=qr;dI.exports=Qt;var zL=dI.exports,hI=zL,VL={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},HL={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},pI={};pI[hI.ForwardRef]=VL;pI[hI.Memo]=HL;var WL=!0;function qL(t,e,n){var r="";return n.split(" ").forEach(function(i){t[i]!==void 0?e.push(t[i]+";"):i&&(r+=i+" ")}),r}var mI=function(e,n,r){var i=e.key+"-"+n.name;(r===!1||WL===!1)&&e.registered[i]===void 0&&(e.registered[i]=n.styles)},GL=function(e,n,r){mI(e,n,r);var i=e.key+"-"+n.name;if(e.inserted[n.name]===void 0){var s=n;do e.insert(n===s?"."+i:"",s,e.sheet,!0),s=s.next;while(s!==void 0)}};function ZL(t){for(var e=0,n,r=0,i=t.length;i>=4;++r,i-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var YL={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},KL=/[A-Z]|^ms/g,JL=/_EMO_([^_]+?)_([^]*?)_EMO_/g,gI=function(e){return e.charCodeAt(1)===45},V0=function(e){return e!=null&&typeof e!="boolean"},zg=CL(function(t){return gI(t)?t:t.replace(KL,"-$&").toLowerCase()}),H0=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(JL,function(r,i,s){return Gi={name:i,styles:s,next:Gi},i})}return YL[e]!==1&&!gI(e)&&typeof n=="number"&&n!==0?n+"px":n};function Xl(t,e,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return Gi={name:i.name,styles:i.styles,next:Gi},i.name;var s=n;if(s.styles!==void 0){var o=s.next;if(o!==void 0)for(;o!==void 0;)Gi={name:o.name,styles:o.styles,next:Gi},o=o.next;var a=s.styles+";";return a}return XL(t,e,n)}case"function":{if(t!==void 0){var c=Gi,u=n(t);return Gi=c,Xl(t,e,u)}break}}var l=n;return l}function XL(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=Xl(t,e,n[i])+";";else for(var s in n){var o=n[s];if(typeof o!="object"){var a=o;V0(a)&&(r+=zg(s)+":"+H0(s,a)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&e==null)for(var c=0;c<o.length;c++)V0(o[c])&&(r+=zg(s)+":"+H0(s,o[c])+";");else{var u=Xl(t,e,o);switch(s){case"animation":case"animationName":{r+=zg(s)+":"+u+";";break}default:r+=s+"{"+u+"}"}}}return r}var W0=/label:\s*([^\s;{]+)\s*(;|$)/g,Gi;function yI(t,e,n){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var r=!0,i="";Gi=void 0;var s=t[0];if(s==null||s.raw===void 0)r=!1,i+=Xl(n,e,s);else{var o=s;i+=o[0]}for(var a=1;a<t.length;a++)if(i+=Xl(n,e,t[a]),r){var c=s;i+=c[a]}W0.lastIndex=0;for(var u="",l;(l=W0.exec(i))!==null;)u+="-"+l[1];var d=ZL(i)+u;return{name:d,styles:i,next:Gi}}var QL=function(e){return e()},e2=Y.useInsertionEffect?Y.useInsertionEffect:!1,t2=e2||QL,vI=Y.createContext(typeof HTMLElement<"u"?LL({key:"css"}):null);vI.Provider;var n2=function(e){return Qa(function(n,r){var i=Yo(vI);return e(n,i,r)})},r2=Y.createContext({}),qb={}.hasOwnProperty,tv="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",i2=function(e,n){var r={};for(var i in n)qb.call(n,i)&&(r[i]=n[i]);return r[tv]=e,r},s2=function(e){var n=e.cache,r=e.serialized,i=e.isStringTag;return mI(n,r,i),t2(function(){return GL(n,r,i)}),null},o2=n2(function(t,e,n){var r=t.css;typeof r=="string"&&e.registered[r]!==void 0&&(r=e.registered[r]);var i=t[tv],s=[r],o="";typeof t.className=="string"?o=qL(e.registered,s,t.className):t.className!=null&&(o=t.className+" ");var a=yI(s,void 0,Y.useContext(r2));o+=e.key+"-"+a.name;var c={};for(var u in t)qb.call(t,u)&&u!=="css"&&u!==tv&&(c[u]=t[u]);return c.className=o,n&&(c.ref=n),Y.createElement(Y.Fragment,null,Y.createElement(s2,{cache:e,serialized:a,isStringTag:typeof i=="string"}),Y.createElement(i,c))}),a2=o2,tt=function(e,n){var r=arguments;if(n==null||!qb.call(n,"css"))return Y.createElement.apply(void 0,r);var i=r.length,s=new Array(i);s[0]=a2,s[1]=i2(e,n);for(var o=2;o<i;o++)s[o]=r[o];return Y.createElement.apply(null,s)};(function(t){var e;e||(e=t.JSX||(t.JSX={}))})(tt);function Gb(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return yI(e)}function c2(){var t=Gb.apply(void 0,arguments),e="animation-"+t.name;return{name:e,styles:"@keyframes "+e+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}function u2(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const l2=["top","right","bottom","left"],Mo=Math.min,Mr=Math.max,lp=Math.round,Vf=Math.floor,ns=t=>({x:t,y:t}),d2={left:"right",right:"left",bottom:"top",top:"bottom"},f2={start:"end",end:"start"};function nv(t,e,n){return Mr(t,Mo(e,n))}function Bs(t,e){return typeof t=="function"?t(e):t}function zs(t){return t.split("-")[0]}function ju(t){return t.split("-")[1]}function Zb(t){return t==="x"?"y":"x"}function Yb(t){return t==="y"?"height":"width"}function Lo(t){return["top","bottom"].includes(zs(t))?"y":"x"}function Kb(t){return Zb(Lo(t))}function h2(t,e,n){n===void 0&&(n=!1);const r=ju(t),i=Kb(t),s=Yb(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=dp(o)),[o,dp(o)]}function p2(t){const e=dp(t);return[rv(t),e,rv(e)]}function rv(t){return t.replace(/start|end/g,e=>f2[e])}function m2(t,e,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?s:o;default:return[]}}function g2(t,e,n,r){const i=ju(t);let s=m2(zs(t),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(rv)))),s}function dp(t){return t.replace(/left|right|bottom|top/g,e=>d2[e])}function y2(t){return{top:0,right:0,bottom:0,left:0,...t}}function bI(t){return typeof t!="number"?y2(t):{top:t,right:t,bottom:t,left:t}}function fp(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function q0(t,e,n){let{reference:r,floating:i}=t;const s=Lo(e),o=Kb(e),a=Yb(o),c=zs(e),u=s==="y",l=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let h;switch(c){case"top":h={x:l,y:r.y-i.height};break;case"bottom":h={x:l,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(ju(e)){case"start":h[o]-=f*(n&&u?-1:1);break;case"end":h[o]+=f*(n&&u?-1:1);break}return h}const v2=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:l,y:d}=q0(u,r,c),f=r,h={},m=0;for(let p=0;p<a.length;p++){const{name:g,fn:y}=a[p],{x:v,y:b,data:E,reset:w}=await y({x:l,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:u,platform:o,elements:{reference:t,floating:e}});l=v??l,d=b??d,h={...h,[g]:{...h[g],...E}},w&&m<=50&&(m++,typeof w=="object"&&(w.placement&&(f=w.placement),w.rects&&(u=w.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):w.rects),{x:l,y:d}=q0(u,f,c)),p=-1)}return{x:l,y:d,placement:f,strategy:i,middlewareData:h}};async function Ql(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:c}=t,{boundary:u="clippingAncestors",rootBoundary:l="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Bs(e,t),m=bI(h),g=a[f?d==="floating"?"reference":"floating":d],y=fp(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:l,strategy:c})),v=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),E=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},w=fp(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:b,strategy:c}):v);return{top:(y.top-w.top+m.top)/E.y,bottom:(w.bottom-y.bottom+m.bottom)/E.y,left:(y.left-w.left+m.left)/E.x,right:(w.right-y.right+m.right)/E.x}}const b2=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:c}=e,{element:u,padding:l=0}=Bs(t,e)||{};if(u==null)return{};const d=bI(l),f={x:n,y:r},h=Kb(i),m=Yb(h),p=await o.getDimensions(u),g=h==="y",y=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",E=s.reference[m]+s.reference[h]-f[h]-s.floating[m],w=f[h]-s.reference[h],x=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let _=x?x[b]:0;(!_||!await(o.isElement==null?void 0:o.isElement(x)))&&(_=a.floating[b]||s.floating[m]);const k=E/2-w/2,R=_/2-p[m]/2-1,F=Mo(d[y],R),V=Mo(d[v],R),T=F,L=_-p[m]-V,S=_/2-p[m]/2+k,C=nv(T,S,L),N=!c.arrow&&ju(i)!=null&&S!==C&&s.reference[m]/2-(S<T?F:V)-p[m]/2<0,U=N?S<T?S-T:S-L:0;return{[h]:f[h]+U,data:{[h]:C,centerOffset:S-C-U,...N&&{alignmentOffset:U}},reset:N}}}),_2=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:c,elements:u}=e,{mainAxis:l=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...g}=Bs(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=zs(i),v=Lo(a),b=zs(a)===a,E=await(c.isRTL==null?void 0:c.isRTL(u.floating)),w=f||(b||!p?[dp(a)]:p2(a)),x=m!=="none";!f&&x&&w.push(...g2(a,p,m,E));const _=[a,...w],k=await Ql(e,g),R=[];let F=((r=s.flip)==null?void 0:r.overflows)||[];if(l&&R.push(k[y]),d){const S=h2(i,o,E);R.push(k[S[0]],k[S[1]])}if(F=[...F,{placement:i,overflows:R}],!R.every(S=>S<=0)){var V,T;const S=(((V=s.flip)==null?void 0:V.index)||0)+1,C=_[S];if(C)return{data:{index:S,overflows:F},reset:{placement:C}};let N=(T=F.filter(U=>U.overflows[0]<=0).sort((U,K)=>U.overflows[1]-K.overflows[1])[0])==null?void 0:T.placement;if(!N)switch(h){case"bestFit":{var L;const U=(L=F.filter(K=>{if(x){const $=Lo(K.placement);return $===v||$==="y"}return!0}).map(K=>[K.placement,K.overflows.filter($=>$>0).reduce(($,q)=>$+q,0)]).sort((K,$)=>K[1]-$[1])[0])==null?void 0:L[0];U&&(N=U);break}case"initialPlacement":N=a;break}if(i!==N)return{reset:{placement:N}}}return{}}}};function G0(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Z0(t){return l2.some(e=>t[e]>=0)}const w2=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=Bs(t,e);switch(r){case"referenceHidden":{const s=await Ql(e,{...i,elementContext:"reference"}),o=G0(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Z0(o)}}}case"escaped":{const s=await Ql(e,{...i,altBoundary:!0}),o=G0(s,n.floating);return{data:{escapedOffsets:o,escaped:Z0(o)}}}default:return{}}}}};async function E2(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=zs(n),a=ju(n),c=Lo(n)==="y",u=["left","top"].includes(o)?-1:1,l=s&&c?-1:1,d=Bs(e,t);let{mainAxis:f,crossAxis:h,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),c?{x:h*l,y:f*u}:{x:f*u,y:h*l}}const S2=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=e,c=await E2(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:o}}}}},x2=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:g=>{let{x:y,y:v}=g;return{x:y,y:v}}},...c}=Bs(t,e),u={x:n,y:r},l=await Ql(e,c),d=Lo(zs(i)),f=Zb(d);let h=u[f],m=u[d];if(s){const g=f==="y"?"top":"left",y=f==="y"?"bottom":"right",v=h+l[g],b=h-l[y];h=nv(v,h,b)}if(o){const g=d==="y"?"top":"left",y=d==="y"?"bottom":"right",v=m+l[g],b=m-l[y];m=nv(v,m,b)}const p=a.fn({...e,[f]:h,[d]:m});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[f]:s,[d]:o}}}}}},T2=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=Bs(t,e),l={x:n,y:r},d=Lo(i),f=Zb(d);let h=l[f],m=l[d];const p=Bs(a,e),g=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const b=f==="y"?"height":"width",E=s.reference[f]-s.floating[b]+g.mainAxis,w=s.reference[f]+s.reference[b]-g.mainAxis;h<E?h=E:h>w&&(h=w)}if(u){var y,v;const b=f==="y"?"width":"height",E=["top","left"].includes(zs(i)),w=s.reference[d]-s.floating[b]+(E&&((y=o.offset)==null?void 0:y[d])||0)+(E?0:g.crossAxis),x=s.reference[d]+s.reference[b]+(E?0:((v=o.offset)==null?void 0:v[d])||0)-(E?g.crossAxis:0);m<w?m=w:m>x&&(m=x)}return{[f]:h,[d]:m}}}},I2=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:o,elements:a}=e,{apply:c=()=>{},...u}=Bs(t,e),l=await Ql(e,u),d=zs(i),f=ju(i),h=Lo(i)==="y",{width:m,height:p}=s.floating;let g,y;d==="top"||d==="bottom"?(g=d,y=f===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,g=f==="end"?"top":"bottom");const v=p-l.top-l.bottom,b=m-l.left-l.right,E=Mo(p-l[g],v),w=Mo(m-l[y],b),x=!e.middlewareData.shift;let _=E,k=w;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(k=b),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(_=v),x&&!f){const F=Mr(l.left,0),V=Mr(l.right,0),T=Mr(l.top,0),L=Mr(l.bottom,0);h?k=m-2*(F!==0||V!==0?F+V:Mr(l.left,l.right)):_=p-2*(T!==0||L!==0?T+L:Mr(l.top,l.bottom))}await c({...e,availableWidth:k,availableHeight:_});const R=await o.getDimensions(a.floating);return m!==R.width||p!==R.height?{reset:{rects:!0}}:{}}}};function Fm(){return typeof window<"u"}function Uu(t){return _I(t)?(t.nodeName||"").toLowerCase():"#document"}function Br(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function hs(t){var e;return(e=(_I(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function _I(t){return Fm()?t instanceof Node||t instanceof Br(t).Node:!1}function Ci(t){return Fm()?t instanceof Element||t instanceof Br(t).Element:!1}function cs(t){return Fm()?t instanceof HTMLElement||t instanceof Br(t).HTMLElement:!1}function Y0(t){return!Fm()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Br(t).ShadowRoot}function pf(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=ki(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function O2(t){return["table","td","th"].includes(Uu(t))}function $m(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function Jb(t){const e=Xb(),n=Ci(t)?ki(t):t;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function C2(t){let e=Fo(t);for(;cs(e)&&!pu(e);){if(Jb(e))return e;if($m(e))return null;e=Fo(e)}return null}function Xb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function pu(t){return["html","body","#document"].includes(Uu(t))}function ki(t){return Br(t).getComputedStyle(t)}function jm(t){return Ci(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Fo(t){if(Uu(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Y0(t)&&t.host||hs(t);return Y0(e)?e.host:e}function wI(t){const e=Fo(t);return pu(e)?t.ownerDocument?t.ownerDocument.body:t.body:cs(e)&&pf(e)?e:wI(e)}function ed(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=wI(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),o=Br(i);if(s){const a=iv(o);return e.concat(o,o.visualViewport||[],pf(i)?i:[],a&&n?ed(a):[])}return e.concat(i,ed(i,[],n))}function iv(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function EI(t){const e=ki(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=cs(t),s=i?t.offsetWidth:n,o=i?t.offsetHeight:r,a=lp(n)!==s||lp(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function Qb(t){return Ci(t)?t:t.contextElement}function Wc(t){const e=Qb(t);if(!cs(e))return ns(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=EI(e);let o=(s?lp(n.width):n.width)/r,a=(s?lp(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const k2=ns(0);function SI(t){const e=Br(t);return!Xb()||!e.visualViewport?k2:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function D2(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Br(t)?!1:e}function Da(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=Qb(t);let o=ns(1);e&&(r?Ci(r)&&(o=Wc(r)):o=Wc(t));const a=D2(s,n,r)?SI(s):ns(0);let c=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,l=i.width/o.x,d=i.height/o.y;if(s){const f=Br(s),h=r&&Ci(r)?Br(r):r;let m=f,p=iv(m);for(;p&&r&&h!==m;){const g=Wc(p),y=p.getBoundingClientRect(),v=ki(p),b=y.left+(p.clientLeft+parseFloat(v.paddingLeft))*g.x,E=y.top+(p.clientTop+parseFloat(v.paddingTop))*g.y;c*=g.x,u*=g.y,l*=g.x,d*=g.y,c+=b,u+=E,m=Br(p),p=iv(m)}}return fp({width:l,height:d,x:c,y:u})}function e_(t,e){const n=jm(t).scrollLeft;return e?e.left+n:Da(hs(t)).left+n}function xI(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:e_(t,r)),s=r.top+e.scrollTop;return{x:i,y:s}}function R2(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",o=hs(r),a=e?$m(e.floating):!1;if(r===o||a&&s)return n;let c={scrollLeft:0,scrollTop:0},u=ns(1);const l=ns(0),d=cs(r);if((d||!d&&!s)&&((Uu(r)!=="body"||pf(o))&&(c=jm(r)),cs(r))){const h=Da(r);u=Wc(r),l.x=h.x+r.clientLeft,l.y=h.y+r.clientTop}const f=o&&!d&&!s?xI(o,c,!0):ns(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+l.x+f.x,y:n.y*u.y-c.scrollTop*u.y+l.y+f.y}}function N2(t){return Array.from(t.getClientRects())}function A2(t){const e=hs(t),n=jm(t),r=t.ownerDocument.body,i=Mr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=Mr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+e_(t);const a=-n.scrollTop;return ki(r).direction==="rtl"&&(o+=Mr(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function P2(t,e){const n=Br(t),r=hs(t),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,c=0;if(i){s=i.width,o=i.height;const u=Xb();(!u||u&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:o,x:a,y:c}}function M2(t,e){const n=Da(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=cs(t)?Wc(t):ns(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,c=i*s.x,u=r*s.y;return{width:o,height:a,x:c,y:u}}function K0(t,e,n){let r;if(e==="viewport")r=P2(t,n);else if(e==="document")r=A2(hs(t));else if(Ci(e))r=M2(e,n);else{const i=SI(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return fp(r)}function TI(t,e){const n=Fo(t);return n===e||!Ci(n)||pu(n)?!1:ki(n).position==="fixed"||TI(n,e)}function L2(t,e){const n=e.get(t);if(n)return n;let r=ed(t,[],!1).filter(a=>Ci(a)&&Uu(a)!=="body"),i=null;const s=ki(t).position==="fixed";let o=s?Fo(t):t;for(;Ci(o)&&!pu(o);){const a=ki(o),c=Jb(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||pf(o)&&!c&&TI(t,o))?r=r.filter(l=>l!==o):i=a,o=Fo(o)}return e.set(t,r),r}function F2(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?$m(e)?[]:L2(e,this._c):[].concat(n),r],a=o[0],c=o.reduce((u,l)=>{const d=K0(e,l,i);return u.top=Mr(d.top,u.top),u.right=Mo(d.right,u.right),u.bottom=Mo(d.bottom,u.bottom),u.left=Mr(d.left,u.left),u},K0(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function $2(t){const{width:e,height:n}=EI(t);return{width:e,height:n}}function j2(t,e,n){const r=cs(e),i=hs(e),s=n==="fixed",o=Da(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=ns(0);if(r||!r&&!s)if((Uu(e)!=="body"||pf(i))&&(a=jm(e)),r){const f=Da(e,!0,s,e);c.x=f.x+e.clientLeft,c.y=f.y+e.clientTop}else i&&(c.x=e_(i));const u=i&&!r&&!s?xI(i,a):ns(0),l=o.left+a.scrollLeft-c.x-u.x,d=o.top+a.scrollTop-c.y-u.y;return{x:l,y:d,width:o.width,height:o.height}}function Vg(t){return ki(t).position==="static"}function J0(t,e){if(!cs(t)||ki(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return hs(t)===n&&(n=n.ownerDocument.body),n}function II(t,e){const n=Br(t);if($m(t))return n;if(!cs(t)){let i=Fo(t);for(;i&&!pu(i);){if(Ci(i)&&!Vg(i))return i;i=Fo(i)}return n}let r=J0(t,e);for(;r&&O2(r)&&Vg(r);)r=J0(r,e);return r&&pu(r)&&Vg(r)&&!Jb(r)?n:r||C2(t)||n}const U2=async function(t){const e=this.getOffsetParent||II,n=this.getDimensions,r=await n(t.floating);return{reference:j2(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function B2(t){return ki(t).direction==="rtl"}const z2={convertOffsetParentRelativeRectToViewportRelativeRect:R2,getDocumentElement:hs,getClippingRect:F2,getOffsetParent:II,getElementRects:U2,getClientRects:N2,getDimensions:$2,getScale:Wc,isElement:Ci,isRTL:B2};function OI(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function V2(t,e){let n=null,r;const i=hs(t);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const u=t.getBoundingClientRect(),{left:l,top:d,width:f,height:h}=u;if(a||e(),!f||!h)return;const m=Vf(d),p=Vf(i.clientWidth-(l+f)),g=Vf(i.clientHeight-(d+h)),y=Vf(l),b={rootMargin:-m+"px "+-p+"px "+-g+"px "+-y+"px",threshold:Mr(0,Mo(1,c))||1};let E=!0;function w(x){const _=x[0].intersectionRatio;if(_!==c){if(!E)return o();_?o(!1,_):r=setTimeout(()=>{o(!1,1e-7)},1e3)}_===1&&!OI(u,t.getBoundingClientRect())&&o(),E=!1}try{n=new IntersectionObserver(w,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(w,b)}n.observe(t)}return o(!0),s}function H2(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=Qb(t),l=i||s?[...u?ed(u):[],...ed(e)]:[];l.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const d=u&&a?V2(u,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(y=>{let[v]=y;v&&v.target===u&&h&&(h.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(e)})),n()}),u&&!c&&h.observe(u),h.observe(e));let m,p=c?Da(t):null;c&&g();function g(){const y=Da(t);p&&!OI(p,y)&&n(),p=y,m=requestAnimationFrame(g)}return n(),()=>{var y;l.forEach(v=>{i&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),d==null||d(),(y=h)==null||y.disconnect(),h=null,c&&cancelAnimationFrame(m)}}const eie=S2,tie=x2,nie=_2,rie=I2,iie=w2,sie=b2,oie=T2,aie=(t,e,n)=>{const r=new Map,i={platform:z2,...n},s={...i.platform,_c:r};return v2(t,e,{...i,platform:s})};var sv=Sm,W2=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],hp=function(){};function q2(t,e){return e?e[0]==="-"?t+e:t+"__"+e:t}function G2(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var s=[].concat(r);if(e&&t)for(var o in e)e.hasOwnProperty(o)&&e[o]&&s.push("".concat(q2(t,o)));return s.filter(function(a){return a}).map(function(a){return String(a).trim()}).join(" ")}var X0=function(e){return nF(e)?e.filter(Boolean):ka(e)==="object"&&e!==null?[e]:[]},CI=function(e){e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme;var n=Js(e,W2);return it({},n)},xn=function(e,n,r){var i=e.cx,s=e.getStyles,o=e.getClassNames,a=e.className;return{css:s(n,e),className:i(r??{},o(n,e),a)}};function Um(t){return[document.documentElement,document.body,window].indexOf(t)>-1}function Z2(t){return Um(t)?window.innerHeight:t.clientHeight}function kI(t){return Um(t)?window.pageYOffset:t.scrollTop}function pp(t,e){if(Um(t)){window.scrollTo(0,e);return}t.scrollTop=e}function Y2(t){var e=getComputedStyle(t),n=e.position==="absolute",r=/(auto|scroll)/;if(e.position==="fixed")return document.documentElement;for(var i=t;i=i.parentElement;)if(e=getComputedStyle(i),!(n&&e.position==="static")&&r.test(e.overflow+e.overflowY+e.overflowX))return i;return document.documentElement}function K2(t,e,n,r){return n*((t=t/r-1)*t*t+1)+e}function Hf(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:hp,i=kI(t),s=e-i,o=10,a=0;function c(){a+=o;var u=K2(a,i,s,n);pp(t,u),a<n?window.requestAnimationFrame(c):r(t)}c()}function Q0(t,e){var n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=e.offsetHeight/3;r.bottom+i>n.bottom?pp(t,Math.min(e.offsetTop+e.clientHeight-t.offsetHeight+i,t.scrollHeight)):r.top-i<n.top&&pp(t,Math.max(e.offsetTop-i,0))}function J2(t){var e=t.getBoundingClientRect();return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width}}function eE(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function X2(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var DI=!1,Q2={get passive(){return DI=!0}},Wf=typeof window<"u"?window:{};Wf.addEventListener&&Wf.removeEventListener&&(Wf.addEventListener("p",hp,Q2),Wf.removeEventListener("p",hp,!1));var eF=DI;function tF(t){return t!=null}function nF(t){return Array.isArray(t)}function qf(t,e,n){return t?e:n}var rF=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var s=Object.entries(e).filter(function(o){var a=Fs(o,1),c=a[0];return!r.includes(c)});return s.reduce(function(o,a){var c=Fs(a,2),u=c[0],l=c[1];return o[u]=l,o},{})},iF=["children","innerProps"],sF=["children","innerProps"];function oF(t){var e=t.maxHeight,n=t.menuEl,r=t.minHeight,i=t.placement,s=t.shouldScroll,o=t.isFixedPosition,a=t.controlHeight,c=Y2(n),u={placement:"bottom",maxHeight:e};if(!n||!n.offsetParent)return u;var l=c.getBoundingClientRect(),d=l.height,f=n.getBoundingClientRect(),h=f.bottom,m=f.height,p=f.top,g=n.offsetParent.getBoundingClientRect(),y=g.top,v=o?window.innerHeight:Z2(c),b=kI(c),E=parseInt(getComputedStyle(n).marginBottom,10),w=parseInt(getComputedStyle(n).marginTop,10),x=y-w,_=v-p,k=x+b,R=d-b-p,F=h-v+b+E,V=b+p-w,T=160;switch(i){case"auto":case"bottom":if(_>=m)return{placement:"bottom",maxHeight:e};if(R>=m&&!o)return s&&Hf(c,F,T),{placement:"bottom",maxHeight:e};if(!o&&R>=r||o&&_>=r){s&&Hf(c,F,T);var L=o?_-E:R-E;return{placement:"bottom",maxHeight:L}}if(i==="auto"||o){var S=e,C=o?x:k;return C>=r&&(S=Math.min(C-E-a,e)),{placement:"top",maxHeight:S}}if(i==="bottom")return s&&pp(c,F),{placement:"bottom",maxHeight:e};break;case"top":if(x>=m)return{placement:"top",maxHeight:e};if(k>=m&&!o)return s&&Hf(c,V,T),{placement:"top",maxHeight:e};if(!o&&k>=r||o&&x>=r){var N=e;return(!o&&k>=r||o&&x>=r)&&(N=o?x-w:k-w),s&&Hf(c,V,T),{placement:"top",maxHeight:N}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(i,'".'))}return u}function aF(t){var e={bottom:"top",top:"bottom"};return t?e[t]:"bottom"}var RI=function(e){return e==="auto"?"bottom":e},cF=function(e,n){var r,i=e.placement,s=e.theme,o=s.borderRadius,a=s.spacing,c=s.colors;return it((r={label:"menu"},bl(r,aF(i),"100%"),bl(r,"position","absolute"),bl(r,"width","100%"),bl(r,"zIndex",1),r),n?{}:{backgroundColor:c.neutral0,borderRadius:o,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},NI=Lu(null),uF=function(e){var n=e.children,r=e.minMenuHeight,i=e.maxMenuHeight,s=e.menuPlacement,o=e.menuPosition,a=e.menuShouldScrollIntoView,c=e.theme,u=Yo(NI)||{},l=u.setPortalPlacement,d=qt(null),f=We(i),h=Fs(f,2),m=h[0],p=h[1],g=We(null),y=Fs(g,2),v=y[0],b=y[1],E=c.spacing.controlHeight;return sv(function(){var w=d.current;if(w){var x=o==="fixed",_=a&&!x,k=oF({maxHeight:i,menuEl:w,minHeight:r,placement:s,shouldScroll:_,isFixedPosition:x,controlHeight:E});p(k.maxHeight),b(k.placement),l==null||l(k.placement)}},[i,s,o,a,r,l,E]),n({ref:d,placerProps:it(it({},e),{},{placement:v||RI(s),maxHeight:m})})},lF=function(e){var n=e.children,r=e.innerRef,i=e.innerProps;return tt("div",st({},xn(e,"menu",{menu:!0}),{ref:r},i),n)},dF=lF,fF=function(e,n){var r=e.maxHeight,i=e.theme.spacing.baseUnit;return it({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:i,paddingTop:i})},hF=function(e){var n=e.children,r=e.innerProps,i=e.innerRef,s=e.isMulti;return tt("div",st({},xn(e,"menuList",{"menu-list":!0,"menu-list--is-multi":s}),{ref:i},r),n)},AI=function(e,n){var r=e.theme,i=r.spacing.baseUnit,s=r.colors;return it({textAlign:"center"},n?{}:{color:s.neutral40,padding:"".concat(i*2,"px ").concat(i*3,"px")})},pF=AI,mF=AI,gF=function(e){var n=e.children,r=n===void 0?"No options":n,i=e.innerProps,s=Js(e,iF);return tt("div",st({},xn(it(it({},s),{},{children:r,innerProps:i}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),r)},yF=function(e){var n=e.children,r=n===void 0?"Loading...":n,i=e.innerProps,s=Js(e,sF);return tt("div",st({},xn(it(it({},s),{},{children:r,innerProps:i}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),r)},vF=function(e){var n=e.rect,r=e.offset,i=e.position;return{left:n.left,position:i,top:r,width:n.width,zIndex:1}},bF=function(e){var n=e.appendTo,r=e.children,i=e.controlElement,s=e.innerProps,o=e.menuPlacement,a=e.menuPosition,c=qt(null),u=qt(null),l=We(RI(o)),d=Fs(l,2),f=d[0],h=d[1],m=Pn(function(){return{setPortalPlacement:h}},[]),p=We(null),g=Fs(p,2),y=g[0],v=g[1],b=He(function(){if(i){var _=J2(i),k=a==="fixed"?0:window.pageYOffset,R=_[f]+k;(R!==(y==null?void 0:y.offset)||_.left!==(y==null?void 0:y.rect.left)||_.width!==(y==null?void 0:y.rect.width))&&v({offset:R,rect:_})}},[i,a,f,y==null?void 0:y.offset,y==null?void 0:y.rect.left,y==null?void 0:y.rect.width]);sv(function(){b()},[b]);var E=He(function(){typeof u.current=="function"&&(u.current(),u.current=null),i&&c.current&&(u.current=H2(i,c.current,b,{elementResize:"ResizeObserver"in window}))},[i,b]);sv(function(){E()},[E]);var w=He(function(_){c.current=_,E()},[E]);if(!n&&a!=="fixed"||!y)return null;var x=tt("div",st({ref:w},xn(it(it({},e),{},{offset:y.offset,position:a,rect:y.rect}),"menuPortal",{"menu-portal":!0}),s),r);return tt(NI.Provider,{value:m},n?TP(x,n):x)},_F=function(e){var n=e.isDisabled,r=e.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},wF=function(e){var n=e.children,r=e.innerProps,i=e.isDisabled,s=e.isRtl;return tt("div",st({},xn(e,"container",{"--is-disabled":i,"--is-rtl":s}),r),n)},EF=function(e,n){var r=e.theme.spacing,i=e.isMulti,s=e.hasValue,o=e.selectProps.controlShouldRenderValue;return it({alignItems:"center",display:i&&s&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},SF=function(e){var n=e.children,r=e.innerProps,i=e.isMulti,s=e.hasValue;return tt("div",st({},xn(e,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":s}),r),n)},xF=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},TF=function(e){var n=e.children,r=e.innerProps;return tt("div",st({},xn(e,"indicatorsContainer",{indicators:!0}),r),n)},tE,IF=["size"],OF=["innerProps","isRtl","size"],CF={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},PI=function(e){var n=e.size,r=Js(e,IF);return tt("svg",st({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:CF},r))},t_=function(e){return tt(PI,st({size:20},e),tt("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},MI=function(e){return tt(PI,st({size:20},e),tt("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},LI=function(e,n){var r=e.isFocused,i=e.theme,s=i.spacing.baseUnit,o=i.colors;return it({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?o.neutral60:o.neutral20,padding:s*2,":hover":{color:r?o.neutral80:o.neutral40}})},kF=LI,DF=function(e){var n=e.children,r=e.innerProps;return tt("div",st({},xn(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||tt(MI,null))},RF=LI,NF=function(e){var n=e.children,r=e.innerProps;return tt("div",st({},xn(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||tt(t_,null))},AF=function(e,n){var r=e.isDisabled,i=e.theme,s=i.spacing.baseUnit,o=i.colors;return it({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?o.neutral10:o.neutral20,marginBottom:s*2,marginTop:s*2})},PF=function(e){var n=e.innerProps;return tt("span",st({},n,xn(e,"indicatorSeparator",{"indicator-separator":!0})))},MF=c2(tE||(tE=u2([`
12
- 0%, 80%, 100% { opacity: 0; }
13
- 40% { opacity: 1; }
14
- `]))),LF=function(e,n){var r=e.isFocused,i=e.size,s=e.theme,o=s.colors,a=s.spacing.baseUnit;return it({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?o.neutral60:o.neutral20,padding:a*2})},Hg=function(e){var n=e.delay,r=e.offset;return tt("span",{css:Gb({animation:"".concat(MF," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},FF=function(e){var n=e.innerProps,r=e.isRtl,i=e.size,s=i===void 0?4:i,o=Js(e,OF);return tt("div",st({},xn(it(it({},o),{},{innerProps:n,isRtl:r,size:s}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),tt(Hg,{delay:0,offset:r}),tt(Hg,{delay:160,offset:!0}),tt(Hg,{delay:320,offset:!r}))},$F=function(e,n){var r=e.isDisabled,i=e.isFocused,s=e.theme,o=s.colors,a=s.borderRadius,c=s.spacing;return it({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:c.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?o.neutral5:o.neutral0,borderColor:r?o.neutral10:i?o.primary:o.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:i?o.primary:o.neutral30}})},jF=function(e){var n=e.children,r=e.isDisabled,i=e.isFocused,s=e.innerRef,o=e.innerProps,a=e.menuIsOpen;return tt("div",st({ref:s},xn(e,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":a}),o,{"aria-disabled":r||void 0}),n)},UF=jF,BF=["data"],zF=function(e,n){var r=e.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},VF=function(e){var n=e.children,r=e.cx,i=e.getStyles,s=e.getClassNames,o=e.Heading,a=e.headingProps,c=e.innerProps,u=e.label,l=e.theme,d=e.selectProps;return tt("div",st({},xn(e,"group",{group:!0}),c),tt(o,st({},a,{selectProps:d,theme:l,getStyles:i,getClassNames:s,cx:r}),u),tt("div",null,n))},HF=function(e,n){var r=e.theme,i=r.colors,s=r.spacing;return it({label:"group",cursor:"default",display:"block"},n?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:s.baseUnit*3,paddingRight:s.baseUnit*3,textTransform:"uppercase"})},WF=function(e){var n=CI(e);n.data;var r=Js(n,BF);return tt("div",st({},xn(e,"groupHeading",{"group-heading":!0}),r))},qF=VF,GF=["innerRef","isDisabled","isHidden","inputClassName"],ZF=function(e,n){var r=e.isDisabled,i=e.value,s=e.theme,o=s.spacing,a=s.colors;return it(it({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},YF),n?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:a.neutral80})},FI={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},YF={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":it({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},FI)},KF=function(e){return it({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},FI)},JF=function(e){var n=e.cx,r=e.value,i=CI(e),s=i.innerRef,o=i.isDisabled,a=i.isHidden,c=i.inputClassName,u=Js(i,GF);return tt("div",st({},xn(e,"input",{"input-container":!0}),{"data-value":r||""}),tt("input",st({className:n({input:!0},c),ref:s,style:KF(a),disabled:o},u)))},XF=JF,QF=function(e,n){var r=e.theme,i=r.spacing,s=r.borderRadius,o=r.colors;return it({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:o.neutral10,borderRadius:s/2,margin:i.baseUnit/2})},e$=function(e,n){var r=e.theme,i=r.borderRadius,s=r.colors,o=e.cropWithEllipsis;return it({overflow:"hidden",textOverflow:o||o===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:s.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},t$=function(e,n){var r=e.theme,i=r.spacing,s=r.borderRadius,o=r.colors,a=e.isFocused;return it({alignItems:"center",display:"flex"},n?{}:{borderRadius:s/2,backgroundColor:a?o.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},$I=function(e){var n=e.children,r=e.innerProps;return tt("div",r,n)},n$=$I,r$=$I;function i$(t){var e=t.children,n=t.innerProps;return tt("div",st({role:"button"},n),e||tt(t_,{size:14}))}var s$=function(e){var n=e.children,r=e.components,i=e.data,s=e.innerProps,o=e.isDisabled,a=e.removeProps,c=e.selectProps,u=r.Container,l=r.Label,d=r.Remove;return tt(u,{data:i,innerProps:it(it({},xn(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),s),selectProps:c},tt(l,{data:i,innerProps:it({},xn(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:c},n),tt(d,{data:i,innerProps:it(it({},xn(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},a),selectProps:c}))},o$=s$,a$=function(e,n){var r=e.isDisabled,i=e.isFocused,s=e.isSelected,o=e.theme,a=o.spacing,c=o.colors;return it({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:s?c.primary:i?c.primary25:"transparent",color:r?c.neutral20:s?c.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:s?c.primary:c.primary50}})},c$=function(e){var n=e.children,r=e.isDisabled,i=e.isFocused,s=e.isSelected,o=e.innerRef,a=e.innerProps;return tt("div",st({},xn(e,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":s}),{ref:o,"aria-disabled":r},a),n)},u$=c$,l$=function(e,n){var r=e.theme,i=r.spacing,s=r.colors;return it({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:s.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},d$=function(e){var n=e.children,r=e.innerProps;return tt("div",st({},xn(e,"placeholder",{placeholder:!0}),r),n)},f$=d$,h$=function(e,n){var r=e.isDisabled,i=e.theme,s=i.spacing,o=i.colors;return it({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?o.neutral40:o.neutral80,marginLeft:s.baseUnit/2,marginRight:s.baseUnit/2})},p$=function(e){var n=e.children,r=e.isDisabled,i=e.innerProps;return tt("div",st({},xn(e,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},m$=p$,Bm={ClearIndicator:NF,Control:UF,DropdownIndicator:DF,DownChevron:MI,CrossIcon:t_,Group:qF,GroupHeading:WF,IndicatorsContainer:TF,IndicatorSeparator:PF,Input:XF,LoadingIndicator:FF,Menu:dF,MenuList:hF,MenuPortal:bF,LoadingMessage:yF,NoOptionsMessage:gF,MultiValue:o$,MultiValueContainer:n$,MultiValueLabel:r$,MultiValueRemove:i$,Option:u$,Placeholder:f$,SelectContainer:wF,SingleValue:m$,ValueContainer:SF},g$=function(e){return it(it({},Bm),e.components)},nE=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function y$(t,e){return!!(t===e||nE(t)&&nE(e))}function v$(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!y$(t[n],e[n]))return!1;return!0}function b$(t,e){e===void 0&&(e=v$);var n=null;function r(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];if(n&&n.lastThis===this&&e(i,n.lastArgs))return n.lastResult;var o=t.apply(this,i);return n={lastResult:o,lastArgs:i,lastThis:this},o}return r.clear=function(){n=null},r}var _$={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},w$=function(e){return tt("span",st({css:_$},e))},rE=w$,E$={guidance:function(e){var n=e.isSearchable,r=e.isMulti,i=e.tabSelectsValue,s=e.context,o=e.isInitialFocus;switch(s){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return o?"".concat(e["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var n=e.action,r=e.label,i=r===void 0?"":r,s=e.labels,o=e.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(s.length>1?"s":""," ").concat(s.join(","),", selected.");case"select-option":return o?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(e){var n=e.context,r=e.focused,i=e.options,s=e.label,o=s===void 0?"":s,a=e.selectValue,c=e.isDisabled,u=e.isSelected,l=e.isAppleDevice,d=function(p,g){return p&&p.length?"".concat(p.indexOf(g)+1," of ").concat(p.length):""};if(n==="value"&&a)return"value ".concat(o," focused, ").concat(d(a,r),".");if(n==="menu"&&l){var f=c?" disabled":"",h="".concat(u?" selected":"").concat(f);return"".concat(o).concat(h,", ").concat(d(i,r),".")}return""},onFilter:function(e){var n=e.inputValue,r=e.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},S$=function(e){var n=e.ariaSelection,r=e.focusedOption,i=e.focusedValue,s=e.focusableOptions,o=e.isFocused,a=e.selectValue,c=e.selectProps,u=e.id,l=e.isAppleDevice,d=c.ariaLiveMessages,f=c.getOptionLabel,h=c.inputValue,m=c.isMulti,p=c.isOptionDisabled,g=c.isSearchable,y=c.menuIsOpen,v=c.options,b=c.screenReaderStatus,E=c.tabSelectsValue,w=c.isLoading,x=c["aria-label"],_=c["aria-live"],k=Pn(function(){return it(it({},E$),d||{})},[d]),R=Pn(function(){var C="";if(n&&k.onChange){var N=n.option,U=n.options,K=n.removedValue,$=n.removedValues,q=n.value,j=function(ve){return Array.isArray(ve)?null:ve},D=K||N||j(q),X=D?f(D):"",Z=U||$||void 0,z=Z?Z.map(f):[],le=it({isDisabled:D&&p(D,a),label:X,labels:z},n);C=k.onChange(le)}return C},[n,k,p,a,f]),F=Pn(function(){var C="",N=r||i,U=!!(r&&a&&a.includes(r));if(N&&k.onFocus){var K={focused:N,label:f(N),isDisabled:p(N,a),isSelected:U,options:s,context:N===r?"menu":"value",selectValue:a,isAppleDevice:l};C=k.onFocus(K)}return C},[r,i,f,p,k,s,a,l]),V=Pn(function(){var C="";if(y&&v.length&&!w&&k.onFilter){var N=b({count:s.length});C=k.onFilter({inputValue:h,resultsMessage:N})}return C},[s,h,y,k,v,b,w]),T=(n==null?void 0:n.action)==="initial-input-focus",L=Pn(function(){var C="";if(k.guidance){var N=i?"value":y?"menu":"input";C=k.guidance({"aria-label":x,context:N,isDisabled:r&&p(r,a),isMulti:m,isSearchable:g,tabSelectsValue:E,isInitialFocus:T})}return C},[x,r,i,m,p,g,y,k,a,E,T]),S=tt(Zy,null,tt("span",{id:"aria-selection"},R),tt("span",{id:"aria-focused"},F),tt("span",{id:"aria-results"},V),tt("span",{id:"aria-guidance"},L));return tt(Zy,null,tt(rE,{id:u},T&&S),tt(rE,{"aria-live":_,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},o&&!T&&S))},x$=S$,ov=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],T$=new RegExp("["+ov.map(function(t){return t.letters}).join("")+"]","g"),jI={};for(var Wg=0;Wg<ov.length;Wg++)for(var qg=ov[Wg],Gg=0;Gg<qg.letters.length;Gg++)jI[qg.letters[Gg]]=qg.base;var UI=function(e){return e.replace(T$,function(n){return jI[n]})},I$=b$(UI),iE=function(e){return e.replace(/^\s+|\s+$/g,"")},O$=function(e){return"".concat(e.label," ").concat(e.value)},C$=function(e){return function(n,r){if(n.data.__isNew__)return!0;var i=it({ignoreCase:!0,ignoreAccents:!0,stringify:O$,trim:!0,matchFrom:"any"},e),s=i.ignoreCase,o=i.ignoreAccents,a=i.stringify,c=i.trim,u=i.matchFrom,l=c?iE(r):r,d=c?iE(a(n)):a(n);return s&&(l=l.toLowerCase(),d=d.toLowerCase()),o&&(l=I$(l),d=UI(d)),u==="start"?d.substr(0,l.length)===l:d.indexOf(l)>-1}},k$=["innerRef"];function D$(t){var e=t.innerRef,n=Js(t,k$),r=rF(n,"onExited","in","enter","exit","appear");return tt("input",st({ref:e},r,{css:Gb({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var R$=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function N$(t){var e=t.isEnabled,n=t.onBottomArrive,r=t.onBottomLeave,i=t.onTopArrive,s=t.onTopLeave,o=qt(!1),a=qt(!1),c=qt(0),u=qt(null),l=He(function(g,y){if(u.current!==null){var v=u.current,b=v.scrollTop,E=v.scrollHeight,w=v.clientHeight,x=u.current,_=y>0,k=E-w-b,R=!1;k>y&&o.current&&(r&&r(g),o.current=!1),_&&a.current&&(s&&s(g),a.current=!1),_&&y>k?(n&&!o.current&&n(g),x.scrollTop=E,R=!0,o.current=!0):!_&&-y>b&&(i&&!a.current&&i(g),x.scrollTop=0,R=!0,a.current=!0),R&&R$(g)}},[n,r,i,s]),d=He(function(g){l(g,g.deltaY)},[l]),f=He(function(g){c.current=g.changedTouches[0].clientY},[]),h=He(function(g){var y=c.current-g.changedTouches[0].clientY;l(g,y)},[l]),m=He(function(g){if(g){var y=eF?{passive:!1}:!1;g.addEventListener("wheel",d,y),g.addEventListener("touchstart",f,y),g.addEventListener("touchmove",h,y)}},[h,f,d]),p=He(function(g){g&&(g.removeEventListener("wheel",d,!1),g.removeEventListener("touchstart",f,!1),g.removeEventListener("touchmove",h,!1))},[h,f,d]);return Dt(function(){if(e){var g=u.current;return m(g),function(){p(g)}}},[e,m,p]),function(g){u.current=g}}var sE=["boxSizing","height","overflow","paddingRight","position"],oE={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function aE(t){t.cancelable&&t.preventDefault()}function cE(t){t.stopPropagation()}function uE(){var t=this.scrollTop,e=this.scrollHeight,n=t+this.offsetHeight;t===0?this.scrollTop=1:n===e&&(this.scrollTop=t-1)}function lE(){return"ontouchstart"in window||navigator.maxTouchPoints}var dE=!!(typeof window<"u"&&window.document&&window.document.createElement),ol=0,yc={capture:!1,passive:!1};function A$(t){var e=t.isEnabled,n=t.accountForScrollbars,r=n===void 0?!0:n,i=qt({}),s=qt(null),o=He(function(c){if(dE){var u=document.body,l=u&&u.style;if(r&&sE.forEach(function(m){var p=l&&l[m];i.current[m]=p}),r&&ol<1){var d=parseInt(i.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,h=window.innerWidth-f+d||0;Object.keys(oE).forEach(function(m){var p=oE[m];l&&(l[m]=p)}),l&&(l.paddingRight="".concat(h,"px"))}u&&lE()&&(u.addEventListener("touchmove",aE,yc),c&&(c.addEventListener("touchstart",uE,yc),c.addEventListener("touchmove",cE,yc))),ol+=1}},[r]),a=He(function(c){if(dE){var u=document.body,l=u&&u.style;ol=Math.max(ol-1,0),r&&ol<1&&sE.forEach(function(d){var f=i.current[d];l&&(l[d]=f)}),u&&lE()&&(u.removeEventListener("touchmove",aE,yc),c&&(c.removeEventListener("touchstart",uE,yc),c.removeEventListener("touchmove",cE,yc)))}},[r]);return Dt(function(){if(e){var c=s.current;return o(c),function(){a(c)}}},[e,o,a]),function(c){s.current=c}}var P$=function(e){var n=e.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},M$={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function L$(t){var e=t.children,n=t.lockEnabled,r=t.captureEnabled,i=r===void 0?!0:r,s=t.onBottomArrive,o=t.onBottomLeave,a=t.onTopArrive,c=t.onTopLeave,u=N$({isEnabled:i,onBottomArrive:s,onBottomLeave:o,onTopArrive:a,onTopLeave:c}),l=A$({isEnabled:n}),d=function(h){u(h),l(h)};return tt(Zy,null,n&&tt("div",{onClick:P$,css:M$}),e(d))}var F$={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},$$=function(e){var n=e.name,r=e.onFocus;return tt("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:F$,value:"",onChange:function(){}})},j$=$$;function n_(t){var e;return typeof window<"u"&&window.navigator!=null?t.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function U$(){return n_(/^iPhone/i)}function BI(){return n_(/^Mac/i)}function B$(){return n_(/^iPad/i)||BI()&&navigator.maxTouchPoints>1}function z$(){return U$()||B$()}function V$(){return BI()||z$()}var H$=function(e){return e.label},W$=function(e){return e.label},q$=function(e){return e.value},G$=function(e){return!!e.isDisabled},Z$={clearIndicator:RF,container:_F,control:$F,dropdownIndicator:kF,group:zF,groupHeading:HF,indicatorsContainer:xF,indicatorSeparator:AF,input:ZF,loadingIndicator:LF,loadingMessage:mF,menu:cF,menuList:fF,menuPortal:vF,multiValue:QF,multiValueLabel:e$,multiValueRemove:t$,noOptionsMessage:pF,option:a$,placeholder:l$,singleValue:h$,valueContainer:EF},Y$={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},K$=4,zI=4,J$=38,X$=zI*2,Q$={baseUnit:zI,controlHeight:J$,menuGutter:X$},Zg={borderRadius:K$,colors:Y$,spacing:Q$},ej={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:eE(),captureMenuScroll:!eE(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:C$(),formatGroupLabel:H$,getOptionLabel:W$,getOptionValue:q$,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:G$,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!X2(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var n=e.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function fE(t,e,n,r){var i=WI(t,e,n),s=qI(t,e,n),o=HI(t,e),a=mp(t,e);return{type:"option",data:e,isDisabled:i,isSelected:s,label:o,value:a,index:r}}function Lh(t,e){return t.options.map(function(n,r){if("options"in n){var i=n.options.map(function(o,a){return fE(t,o,e,a)}).filter(function(o){return pE(t,o)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var s=fE(t,n,e,r);return pE(t,s)?s:void 0}).filter(tF)}function VI(t){return t.reduce(function(e,n){return n.type==="group"?e.push.apply(e,jb(n.options.map(function(r){return r.data}))):e.push(n.data),e},[])}function hE(t,e){return t.reduce(function(n,r){return r.type==="group"?n.push.apply(n,jb(r.options.map(function(i){return{data:i.data,id:"".concat(e,"-").concat(r.index,"-").concat(i.index)}}))):n.push({data:r.data,id:"".concat(e,"-").concat(r.index)}),n},[])}function tj(t,e){return VI(Lh(t,e))}function pE(t,e){var n=t.inputValue,r=n===void 0?"":n,i=e.data,s=e.isSelected,o=e.label,a=e.value;return(!ZI(t)||!s)&&GI(t,{label:o,value:a,data:i},r)}function nj(t,e){var n=t.focusedValue,r=t.selectValue,i=r.indexOf(n);if(i>-1){var s=e.indexOf(n);if(s>-1)return n;if(i<e.length)return e[i]}return null}function rj(t,e){var n=t.focusedOption;return n&&e.indexOf(n)>-1?n:e[0]}var Yg=function(e,n){var r,i=(r=e.find(function(s){return s.data===n}))===null||r===void 0?void 0:r.id;return i||null},HI=function(e,n){return e.getOptionLabel(n)},mp=function(e,n){return e.getOptionValue(n)};function WI(t,e,n){return typeof t.isOptionDisabled=="function"?t.isOptionDisabled(e,n):!1}function qI(t,e,n){if(n.indexOf(e)>-1)return!0;if(typeof t.isOptionSelected=="function")return t.isOptionSelected(e,n);var r=mp(t,e);return n.some(function(i){return mp(t,i)===r})}function GI(t,e,n){return t.filterOption?t.filterOption(e,n):!0}var ZI=function(e){var n=e.hideSelectedOptions,r=e.isMulti;return n===void 0?r:n},ij=1,YI=function(t){eL(n,t);var e=rL(n);function n(r){var i;if(XM(this,n),i=e.call(this,r),i.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.isAppleDevice=V$(),i.controlRef=null,i.getControlRef=function(c){i.controlRef=c},i.focusedOptionRef=null,i.getFocusedOptionRef=function(c){i.focusedOptionRef=c},i.menuListRef=null,i.getMenuListRef=function(c){i.menuListRef=c},i.inputRef=null,i.getInputRef=function(c){i.inputRef=c},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(c,u){var l=i.props,d=l.onChange,f=l.name;u.name=f,i.ariaOnChange(c,u),d(c,u)},i.setValue=function(c,u,l){var d=i.props,f=d.closeMenuOnSelect,h=d.isMulti,m=d.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:m}),f&&(i.setState({inputIsHiddenAfterUpdate:!h}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(c,{action:u,option:l})},i.selectOption=function(c){var u=i.props,l=u.blurInputOnSelect,d=u.isMulti,f=u.name,h=i.state.selectValue,m=d&&i.isOptionSelected(c,h),p=i.isOptionDisabled(c,h);if(m){var g=i.getOptionValue(c);i.setValue(h.filter(function(y){return i.getOptionValue(y)!==g}),"deselect-option",c)}else if(!p)d?i.setValue([].concat(jb(h),[c]),"select-option",c):i.setValue(c,"select-option");else{i.ariaOnChange(c,{action:"select-option",option:c,name:f});return}l&&i.blurInput()},i.removeValue=function(c){var u=i.props.isMulti,l=i.state.selectValue,d=i.getOptionValue(c),f=l.filter(function(m){return i.getOptionValue(m)!==d}),h=qf(u,f,f[0]||null);i.onChange(h,{action:"remove-value",removedValue:c}),i.focusInput()},i.clearValue=function(){var c=i.state.selectValue;i.onChange(qf(i.props.isMulti,[],null),{action:"clear",removedValues:c})},i.popValue=function(){var c=i.props.isMulti,u=i.state.selectValue,l=u[u.length-1],d=u.slice(0,u.length-1),f=qf(c,d,d[0]||null);l&&i.onChange(f,{action:"pop-value",removedValue:l})},i.getFocusedOptionId=function(c){return Yg(i.state.focusableOptionsWithIds,c)},i.getFocusableOptionsWithIds=function(){return hE(Lh(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var c=arguments.length,u=new Array(c),l=0;l<c;l++)u[l]=arguments[l];return G2.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(c){return HI(i.props,c)},i.getOptionValue=function(c){return mp(i.props,c)},i.getStyles=function(c,u){var l=i.props.unstyled,d=Z$[c](u,l);d.boxSizing="border-box";var f=i.props.styles[c];return f?f(d,u):d},i.getClassNames=function(c,u){var l,d;return(l=(d=i.props.classNames)[c])===null||l===void 0?void 0:l.call(d,u)},i.getElementId=function(c){return"".concat(i.state.instancePrefix,"-").concat(c)},i.getComponents=function(){return g$(i.props)},i.buildCategorizedOptions=function(){return Lh(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return VI(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(c,u){i.setState({ariaSelection:it({value:c},u)})},i.onMenuMouseDown=function(c){c.button===0&&(c.stopPropagation(),c.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(c){i.blockOptionHover=!1},i.onControlMouseDown=function(c){if(!c.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&c.preventDefault()}},i.onDropdownIndicatorMouseDown=function(c){if(!(c&&c.type==="mousedown"&&c.button!==0)&&!i.props.isDisabled){var u=i.props,l=u.isMulti,d=u.menuIsOpen;i.focusInput(),d?(i.setState({inputIsHiddenAfterUpdate:!l}),i.onMenuClose()):i.openMenu("first"),c.preventDefault()}},i.onClearIndicatorMouseDown=function(c){c&&c.type==="mousedown"&&c.button!==0||(i.clearValue(),c.preventDefault(),i.openAfterFocus=!1,c.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(c){typeof i.props.closeMenuOnScroll=="boolean"?c.target instanceof HTMLElement&&Um(c.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(c)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(c){var u=c.touches,l=u&&u.item(0);l&&(i.initialTouchX=l.clientX,i.initialTouchY=l.clientY,i.userIsDragging=!1)},i.onTouchMove=function(c){var u=c.touches,l=u&&u.item(0);if(l){var d=Math.abs(l.clientX-i.initialTouchX),f=Math.abs(l.clientY-i.initialTouchY),h=5;i.userIsDragging=d>h||f>h}},i.onTouchEnd=function(c){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(c.target)&&i.menuListRef&&!i.menuListRef.contains(c.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(c){i.userIsDragging||i.onControlMouseDown(c)},i.onClearIndicatorTouchEnd=function(c){i.userIsDragging||i.onClearIndicatorMouseDown(c)},i.onDropdownIndicatorTouchEnd=function(c){i.userIsDragging||i.onDropdownIndicatorMouseDown(c)},i.handleInputChange=function(c){var u=i.props.inputValue,l=c.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(l,{action:"input-change",prevInputValue:u}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(c){i.props.onFocus&&i.props.onFocus(c),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(c){var u=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(c),i.onInputChange("",{action:"input-blur",prevInputValue:u}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(c){if(!(i.blockOptionHover||i.state.focusedOption===c)){var u=i.getFocusableOptions(),l=u.indexOf(c);i.setState({focusedOption:c,focusedOptionId:l>-1?i.getFocusedOptionId(c):null})}},i.shouldHideSelectedOptions=function(){return ZI(i.props)},i.onValueInputFocus=function(c){c.preventDefault(),c.stopPropagation(),i.focus()},i.onKeyDown=function(c){var u=i.props,l=u.isMulti,d=u.backspaceRemovesValue,f=u.escapeClearsValue,h=u.inputValue,m=u.isClearable,p=u.isDisabled,g=u.menuIsOpen,y=u.onKeyDown,v=u.tabSelectsValue,b=u.openMenuOnFocus,E=i.state,w=E.focusedOption,x=E.focusedValue,_=E.selectValue;if(!p&&!(typeof y=="function"&&(y(c),c.defaultPrevented))){switch(i.blockOptionHover=!0,c.key){case"ArrowLeft":if(!l||h)return;i.focusValue("previous");break;case"ArrowRight":if(!l||h)return;i.focusValue("next");break;case"Delete":case"Backspace":if(h)return;if(x)i.removeValue(x);else{if(!d)return;l?i.popValue():m&&i.clearValue()}break;case"Tab":if(i.isComposing||c.shiftKey||!g||!v||!w||b&&i.isOptionSelected(w,_))return;i.selectOption(w);break;case"Enter":if(c.keyCode===229)break;if(g){if(!w||i.isComposing)return;i.selectOption(w);break}return;case"Escape":g?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:h}),i.onMenuClose()):m&&f&&i.clearValue();break;case" ":if(h)return;if(!g){i.openMenu("first");break}if(!w)return;i.selectOption(w);break;case"ArrowUp":g?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":g?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!g)return;i.focusOption("pageup");break;case"PageDown":if(!g)return;i.focusOption("pagedown");break;case"Home":if(!g)return;i.focusOption("first");break;case"End":if(!g)return;i.focusOption("last");break;default:return}c.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++ij),i.state.selectValue=X0(r.value),r.menuIsOpen&&i.state.selectValue.length){var s=i.getFocusableOptionsWithIds(),o=i.buildFocusableOptions(),a=o.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=s,i.state.focusedOption=o[a],i.state.focusedOptionId=Yg(s,o[a])}return i}return QM(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Q0(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(i){var s=this.props,o=s.isDisabled,a=s.menuIsOpen,c=this.state.isFocused;(c&&!o&&i.isDisabled||c&&a&&!i.menuIsOpen)&&this.focusInput(),c&&o&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!c&&!o&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Q0(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,s){this.props.onInputChange(i,s)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var s=this,o=this.state,a=o.selectValue,c=o.isFocused,u=this.buildFocusableOptions(),l=i==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(a[0]);d>-1&&(l=d)}this.scrollToFocusedOptionOnUpdate=!(c&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[l],focusedOptionId:this.getFocusedOptionId(u[l])},function(){return s.onMenuOpen()})}},{key:"focusValue",value:function(i){var s=this.state,o=s.selectValue,a=s.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var c=o.indexOf(a);a||(c=-1);var u=o.length-1,l=-1;if(o.length){switch(i){case"previous":c===0?l=0:c===-1?l=u:l=c-1;break;case"next":c>-1&&c<u&&(l=c+1);break}this.setState({inputIsHidden:l!==-1,focusedValue:o[l]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",s=this.props.pageSize,o=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var c=0,u=a.indexOf(o);o||(u=-1),i==="up"?c=u>0?u-1:a.length-1:i==="down"?c=(u+1)%a.length:i==="pageup"?(c=u-s,c<0&&(c=0)):i==="pagedown"?(c=u+s,c>a.length-1&&(c=a.length-1)):i==="last"&&(c=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[c],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[c])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Zg):it(it({},Zg),this.props.theme):Zg}},{key:"getCommonProps",value:function(){var i=this.clearValue,s=this.cx,o=this.getStyles,a=this.getClassNames,c=this.getValue,u=this.selectOption,l=this.setValue,d=this.props,f=d.isMulti,h=d.isRtl,m=d.options,p=this.hasValue();return{clearValue:i,cx:s,getStyles:o,getClassNames:a,getValue:c,hasValue:p,isMulti:f,isRtl:h,options:m,selectOption:u,selectProps:d,setValue:l,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,s=i.isClearable,o=i.isMulti;return s===void 0?o:s}},{key:"isOptionDisabled",value:function(i,s){return WI(this.props,i,s)}},{key:"isOptionSelected",value:function(i,s){return qI(this.props,i,s)}},{key:"filterOption",value:function(i,s){return GI(this.props,i,s)}},{key:"formatOptionLabel",value:function(i,s){if(typeof this.props.formatOptionLabel=="function"){var o=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(i,{context:s,inputValue:o,selectValue:a})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var i=this.props,s=i.isDisabled,o=i.isSearchable,a=i.inputId,c=i.inputValue,u=i.tabIndex,l=i.form,d=i.menuIsOpen,f=i.required,h=this.getComponents(),m=h.Input,p=this.state,g=p.inputIsHidden,y=p.ariaSelection,v=this.commonProps,b=a||this.getElementId("input"),E=it(it(it({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":f,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!o&&{"aria-readonly":!0}),this.hasValue()?(y==null?void 0:y.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return o?Y.createElement(m,st({},v,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:b,innerRef:this.getInputRef,isDisabled:s,isHidden:g,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:l,type:"text",value:c},E)):Y.createElement(D$,st({id:b,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:hp,onFocus:this.onInputFocus,disabled:s,tabIndex:u,inputMode:"none",form:l,value:""},E))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,s=this.getComponents(),o=s.MultiValue,a=s.MultiValueContainer,c=s.MultiValueLabel,u=s.MultiValueRemove,l=s.SingleValue,d=s.Placeholder,f=this.commonProps,h=this.props,m=h.controlShouldRenderValue,p=h.isDisabled,g=h.isMulti,y=h.inputValue,v=h.placeholder,b=this.state,E=b.selectValue,w=b.focusedValue,x=b.isFocused;if(!this.hasValue()||!m)return y?null:Y.createElement(d,st({},f,{key:"placeholder",isDisabled:p,isFocused:x,innerProps:{id:this.getElementId("placeholder")}}),v);if(g)return E.map(function(k,R){var F=k===w,V="".concat(i.getOptionLabel(k),"-").concat(i.getOptionValue(k));return Y.createElement(o,st({},f,{components:{Container:a,Label:c,Remove:u},isFocused:F,isDisabled:p,key:V,index:R,removeProps:{onClick:function(){return i.removeValue(k)},onTouchEnd:function(){return i.removeValue(k)},onMouseDown:function(L){L.preventDefault()}},data:k}),i.formatOptionLabel(k,"value"))});if(y)return null;var _=E[0];return Y.createElement(l,st({},f,{data:_,isDisabled:p}),this.formatOptionLabel(_,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),s=i.ClearIndicator,o=this.commonProps,a=this.props,c=a.isDisabled,u=a.isLoading,l=this.state.isFocused;if(!this.isClearable()||!s||c||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return Y.createElement(s,st({},o,{innerProps:d,isFocused:l}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),s=i.LoadingIndicator,o=this.commonProps,a=this.props,c=a.isDisabled,u=a.isLoading,l=this.state.isFocused;if(!s||!u)return null;var d={"aria-hidden":"true"};return Y.createElement(s,st({},o,{innerProps:d,isDisabled:c,isFocused:l}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),s=i.DropdownIndicator,o=i.IndicatorSeparator;if(!s||!o)return null;var a=this.commonProps,c=this.props.isDisabled,u=this.state.isFocused;return Y.createElement(o,st({},a,{isDisabled:c,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),s=i.DropdownIndicator;if(!s)return null;var o=this.commonProps,a=this.props.isDisabled,c=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return Y.createElement(s,st({},o,{innerProps:u,isDisabled:a,isFocused:c}))}},{key:"renderMenu",value:function(){var i=this,s=this.getComponents(),o=s.Group,a=s.GroupHeading,c=s.Menu,u=s.MenuList,l=s.MenuPortal,d=s.LoadingMessage,f=s.NoOptionsMessage,h=s.Option,m=this.commonProps,p=this.state.focusedOption,g=this.props,y=g.captureMenuScroll,v=g.inputValue,b=g.isLoading,E=g.loadingMessage,w=g.minMenuHeight,x=g.maxMenuHeight,_=g.menuIsOpen,k=g.menuPlacement,R=g.menuPosition,F=g.menuPortalTarget,V=g.menuShouldBlockScroll,T=g.menuShouldScrollIntoView,L=g.noOptionsMessage,S=g.onMenuScrollToTop,C=g.onMenuScrollToBottom;if(!_)return null;var N=function(X,Z){var z=X.type,le=X.data,pe=X.isDisabled,ve=X.isSelected,je=X.label,ct=X.value,ut=p===le,Ye=pe?void 0:function(){return i.onOptionHover(le)},Ot=pe?void 0:function(){return i.selectOption(le)},O="".concat(i.getElementId("option"),"-").concat(Z),he={id:O,onClick:Ot,onMouseMove:Ye,onMouseOver:Ye,tabIndex:-1,role:"option","aria-selected":i.isAppleDevice?void 0:ve};return Y.createElement(h,st({},m,{innerProps:he,data:le,isDisabled:pe,isSelected:ve,key:O,label:je,type:z,value:ct,isFocused:ut,innerRef:ut?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(X.data,"menu"))},U;if(this.hasOptions())U=this.getCategorizedOptions().map(function(D){if(D.type==="group"){var X=D.data,Z=D.options,z=D.index,le="".concat(i.getElementId("group"),"-").concat(z),pe="".concat(le,"-heading");return Y.createElement(o,st({},m,{key:le,data:X,options:Z,Heading:a,headingProps:{id:pe,data:D.data},label:i.formatGroupLabel(D.data)}),D.options.map(function(ve){return N(ve,"".concat(z,"-").concat(ve.index))}))}else if(D.type==="option")return N(D,"".concat(D.index))});else if(b){var K=E({inputValue:v});if(K===null)return null;U=Y.createElement(d,m,K)}else{var $=L({inputValue:v});if($===null)return null;U=Y.createElement(f,m,$)}var q={minMenuHeight:w,maxMenuHeight:x,menuPlacement:k,menuPosition:R,menuShouldScrollIntoView:T},j=Y.createElement(uF,st({},m,q),function(D){var X=D.ref,Z=D.placerProps,z=Z.placement,le=Z.maxHeight;return Y.createElement(c,st({},m,q,{innerRef:X,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:b,placement:z}),Y.createElement(L$,{captureEnabled:y,onTopArrive:S,onBottomArrive:C,lockEnabled:V},function(pe){return Y.createElement(u,st({},m,{innerRef:function(je){i.getMenuListRef(je),pe(je)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:i.getElementId("listbox")},isLoading:b,maxHeight:le,focusedOption:p}),U)}))});return F||R==="fixed"?Y.createElement(l,st({},m,{appendTo:F,controlElement:this.controlRef,menuPlacement:k,menuPosition:R}),j):j}},{key:"renderFormField",value:function(){var i=this,s=this.props,o=s.delimiter,a=s.isDisabled,c=s.isMulti,u=s.name,l=s.required,d=this.state.selectValue;if(l&&!this.hasValue()&&!a)return Y.createElement(j$,{name:u,onFocus:this.onValueInputFocus});if(!(!u||a))if(c)if(o){var f=d.map(function(p){return i.getOptionValue(p)}).join(o);return Y.createElement("input",{name:u,type:"hidden",value:f})}else{var h=d.length>0?d.map(function(p,g){return Y.createElement("input",{key:"i-".concat(g),name:u,type:"hidden",value:i.getOptionValue(p)})}):Y.createElement("input",{name:u,type:"hidden",value:""});return Y.createElement("div",null,h)}else{var m=d[0]?this.getOptionValue(d[0]):"";return Y.createElement("input",{name:u,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,s=this.state,o=s.ariaSelection,a=s.focusedOption,c=s.focusedValue,u=s.isFocused,l=s.selectValue,d=this.getFocusableOptions();return Y.createElement(x$,st({},i,{id:this.getElementId("live-region"),ariaSelection:o,focusedOption:a,focusedValue:c,isFocused:u,selectValue:l,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),s=i.Control,o=i.IndicatorsContainer,a=i.SelectContainer,c=i.ValueContainer,u=this.props,l=u.className,d=u.id,f=u.isDisabled,h=u.menuIsOpen,m=this.state.isFocused,p=this.commonProps=this.getCommonProps();return Y.createElement(a,st({},p,{className:l,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:m}),this.renderLiveRegion(),Y.createElement(s,st({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:m,menuIsOpen:h}),Y.createElement(c,st({},p,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),Y.createElement(o,st({},p,{isDisabled:f}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,s){var o=s.prevProps,a=s.clearFocusValueOnUpdate,c=s.inputIsHiddenAfterUpdate,u=s.ariaSelection,l=s.isFocused,d=s.prevWasFocused,f=s.instancePrefix,h=i.options,m=i.value,p=i.menuIsOpen,g=i.inputValue,y=i.isMulti,v=X0(m),b={};if(o&&(m!==o.value||h!==o.options||p!==o.menuIsOpen||g!==o.inputValue)){var E=p?tj(i,v):[],w=p?hE(Lh(i,v),"".concat(f,"-option")):[],x=a?nj(s,v):null,_=rj(s,E),k=Yg(w,_);b={selectValue:v,focusedOption:_,focusedOptionId:k,focusableOptionsWithIds:w,focusedValue:x,clearFocusValueOnUpdate:!1}}var R=c!=null&&i!==o?{inputIsHidden:c,inputIsHiddenAfterUpdate:void 0}:{},F=u,V=l&&d;return l&&!V&&(F={value:qf(y,v,v[0]||null),options:v,action:"initial-input-focus"},V=!d),(u==null?void 0:u.action)==="initial-input-focus"&&(F=null),it(it(it({},b),R),{},{prevProps:i,ariaSelection:F,prevWasFocused:V})}}]),n}(yP);YI.defaultProps=ej;var sj=Qa(function(t,e){var n=JM(t);return Y.createElement(YI,st({ref:e},n))}),oj=sj;function aj(t){return P(Bm.DropdownIndicator,{...t,children:P(vt,{name:"ChevronDown",size:16})})}function cj(t){return P(Bm.ClearIndicator,{...t,children:P(vt,{name:"Xmark",size:16})})}function uj(t){const{label:e,onClick:n,...r}=t,i=!!e&&!!n;return we(Bm.MenuList,{...r,children:[t.children,i?P("button",{className:"w-full px-2 py-3 hover:bg-slate-50",onClick:n,children:e}):null]})}function _l(t){const e=t["aria-invalid"]==="true",{addItemButtonProps:n,...r}=t;return P(oj,{...r,components:{DropdownIndicator:aj,ClearIndicator:cj,MenuList:i=>uj({...i,...n})},styles:{dropdownIndicator:()=>({label:"indicatorContainer",display:"flex",transition:"color 150ms",color:"var(--gray-900)",padding:8,boxSizing:"border-box"}),clearIndicator:i=>({...i,color:"var(--gray-900)"}),container:i=>({...i,borderColor:"var(--gray-200)",fontSize:12}),placeholder:i=>({...i,color:e?"var(--red-800)":"var(--gray-500)"}),control:()=>({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:32,outline:"0 !important",position:"relative",transition:"all 100ms",backgroundColor:"var(--white)",borderColor:e?"var(--red-900)":"var(--gray-200)",borderStyle:"solid",borderWidth:1,borderRadius:"6px",boxSizing:"border-box"}),option:(i,s)=>({...i,backgroundColor:s.isSelected?"var(--slate-50)":"var(--white)",color:"var(--gray-800)",":hover":{backgroundColor:"var(--slate-50)"}}),menuList:i=>({...i,padding:0,borderRadius:"6px"})},theme:i=>({...i,colors:{...i.colors,primary:"var(--slate-100)",primary25:"var(--slate-50)",primary50:"var(--slate-100)",primary75:"var(--slate-100)",danger:"var(--red-900)",dangerLight:"var(--red-100)",neutral0:"var(--white)",neutral5:"var(--gray-50)",neutral10:"var(--gray-100)",neutral20:"var(--gray-200)",neutral30:"var(--gray-300)",neutral40:"var(--gray-400)",neutral50:"var(--gray-500)",neutral60:"var(--gray-600)",neutral70:"var(--gray-700)",neutral80:"var(--gray-800)",neutral90:"var(--gray-900)"}})})}function ti(t,e){const{className:n,...r}=t;return{className:Vt(e,typeof n=="string"&&n),...r}}const zn=Qa(function(t,e){const{color:n="dark",size:r="medium",className:i="",children:s,icon:o,iconPosition:a="left",...c}=t,u={small:"px-2 py-1.5 text-xs rounded-md font-medium",medium:"px-6 py-3 text-base rounded-xl font-semibold tracking-wide"},l=ff({light:"bg-gray-200 text-gray-600 hover:text-gray-700 hover:border-gray-300 active:border-slate-100 active:text-gray-600 disabled:text-gray-400",dark:"bg-gray-800 text-slate-50 hover:bg-slate-800 active:border-slate-700 disabled:bg-gray-300 disabled:text-slate-100",red:"bg-red-900 text-slate-50 hover:opacity-80 active:border-red-800 disabled:text-red-400 disabled:opacity-100",blue:"bg-blue-900 text-slate-50 hover:opacity-80 active:border-blue-800 disabled:text-blue-400 disabled:opacity-100"}[n],u[r]),d=Vt("flex items-center justify-center gap-2 border border-none outline-none transition disabled:cursor-not-allowed",l,i);return we("button",{className:d,ref:e,...c,children:[a==="left"&&o,s,a==="right"&&o]})}),lj=t=>{const{children:e,cookies:n,submitLabel:r,rejectLabel:i,onSubmit:s=()=>{},onReject:o=()=>{},...a}=t,[c,u]=We(n),l=f=>{const{id:h,checked:m}=f.target;u(p=>p.map(g=>g.id===h?{...g,value:m}:g))},d="min-w-64 h-8 text-base";return we("div",{...ti(a,"flex flex-col items-center"),children:[P("div",{className:"text-center",children:e}),P("div",{className:"my-8 flex gap-x-16 text-sm font-medium",children:c.map(f=>we("div",{className:"cursor-pointer",children:[P("input",{checked:f.value,className:"mr-1 size-3 cursor-pointer rounded-sm border-2 border-gray-900 accent-gray-900 focus:outline-none",id:f.id,onChange:l,type:"checkbox"}),P("label",{className:"cursor-pointer select-none",htmlFor:f.id,children:f.label})]},f.id))}),we("div",{className:"flex gap-x-8",children:[P(zn,{className:d,color:"light",onClick:()=>o(),size:"small",children:i}),P(zn,{className:d,onClick:()=>s(c),size:"small",children:r})]})]})};function mu(t){const{title:e,isOpen:n,onOpenChange:r,children:i,className:s,...o}=t;return we("div",{...o,children:[we("div",{className:"flex cursor-pointer justify-between text-gray-500",onClick:r,children:[P("h2",{className:" font-semibold text-gray-500",children:e}),P(vt,{className:ff("transition",n?"":"-rotate-90"),name:"ChevronDown"})]}),P("div",{className:Vt("max-h-0 overflow-hidden transition-[max-height] duration-300 ease-in-out",n&&"max-h-screen",s),children:i})]})}function Ir(t){return P("div",{...t,className:Vt("h-px bg-gray-200",t.className)})}const Gf="DRIVE",cie="FOLDER",qc="FILE",uie="CREATE",lie="WRITE",die="READ",fie="UI_NODE",r_="DUPLICATE",i_="NEW_FOLDER",zm="RENAME",s_="DELETE",KI="SETTINGS",JI="REMOVE_TRIGGER",XI="ADD_TRIGGER",QI="ADD_INVALID_TRIGGER",hie=[i_,zm,KI],pie=[zm,s_,r_],mie=[i_,zm,s_,r_],gie=[XI,JI,QI],dj=[{value:Lb,icon:P(vt,{name:"Lock"}),description:"Only available to you"},{value:wP,icon:P(vt,{name:"People"}),description:"Only available to people in this drive"},{value:Fb,icon:P(vt,{name:"Globe"}),description:"Available to everyone",disabled:!0}],fj={CLOUD:{title:"Secure cloud",description:"End to end encryption between members.",icon:P(vt,{name:"Lock"})},LOCAL:{title:"Local",description:"Private and only available to you.",icon:P(vt,{name:"Hdd"})},SWITCHBOARD:{title:"Switchboard",description:"Public and available to everyone.",icon:P(vt,{name:"Drive"})}},hj={[XI]:{label:"Add Trigger",icon:P(vt,{className:"text-orange-900",name:"Plus"})},[JI]:{label:"Remove Trigger",icon:P(vt,{className:"text-orange-900",name:"Xmark"})},[QI]:{label:"Add Trigger",icon:P(vt,{className:"text-orange-900",name:"Exclamation"})}},pj={[r_]:{label:"Duplicate",icon:P(vt,{name:"FilesEarmark"})},[i_]:{label:"New Folder",icon:P(vt,{name:"FolderPlus"})},[zm]:{label:"Rename",icon:P(vt,{name:"Pencil"})},[s_]:{label:"Delete",icon:P(vt,{name:"Trash"}),className:"text-red-900"},[KI]:{label:"Settings",icon:P(vt,{name:"Gear"})}},yie={...hj,...pj};function Do(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function mE(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function e1(...t){return e=>{let n=!1;const r=t.map(i=>{const s=mE(i,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():mE(t[i],null)}}}}function nc(...t){return Y.useCallback(e1(...t),t)}function mj(t,e){const n=Y.createContext(e),r=s=>{const{children:o,...a}=s,c=Y.useMemo(()=>a,Object.values(a));return P(n.Provider,{value:c,children:o})};r.displayName=t+"Provider";function i(s){const o=Y.useContext(n);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return[r,i]}function gj(t,e=[]){let n=[];function r(s,o){const a=Y.createContext(o),c=n.length;n=[...n,o];const u=d=>{var y;const{scope:f,children:h,...m}=d,p=((y=f==null?void 0:f[t])==null?void 0:y[c])||a,g=Y.useMemo(()=>m,Object.values(m));return P(p.Provider,{value:g,children:h})};u.displayName=s+"Provider";function l(d,f){var p;const h=((p=f==null?void 0:f[t])==null?void 0:p[c])||a,m=Y.useContext(h);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[u,l]}const i=()=>{const s=n.map(o=>Y.createContext(o));return function(a){const c=(a==null?void 0:a[t])||s;return Y.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return i.scopeName=t,[r,yj(i,...e)]}function yj(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:c,scopeName:u})=>{const d=c(s)[`__scope${u}`];return{...a,...d}},{});return Y.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function Ra(t){const e=Y.useRef(t);return Y.useEffect(()=>{e.current=t}),Y.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function vj({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=bj({defaultProp:e,onChange:n}),s=t!==void 0,o=s?t:r,a=Ra(n),c=Y.useCallback(u=>{if(s){const d=typeof u=="function"?u(t):u;d!==t&&a(d)}else i(u)},[s,t,i,a]);return[o,c]}function bj({defaultProp:t,onChange:e}){const n=Y.useState(t),[r]=n,i=Y.useRef(r),s=Ra(e);return Y.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}var o_=Y.forwardRef((t,e)=>{const{children:n,...r}=t,i=Y.Children.toArray(n),s=i.find(wj);if(s){const o=s.props.children,a=i.map(c=>c===s?Y.Children.count(o)>1?Y.Children.only(null):Y.isValidElement(o)?o.props.children:null:c);return P(av,{...r,ref:e,children:Y.isValidElement(o)?Y.cloneElement(o,void 0,a):null})}return P(av,{...r,ref:e,children:n})});o_.displayName="Slot";var av=Y.forwardRef((t,e)=>{const{children:n,...r}=t;if(Y.isValidElement(n)){const i=Sj(n);return Y.cloneElement(n,{...Ej(r,n.props),ref:e?e1(e,i):i})}return Y.Children.count(n)>1?Y.Children.only(null):null});av.displayName="SlotClone";var _j=({children:t})=>P(Us,{children:t});function wj(t){return Y.isValidElement(t)&&t.type===_j}function Ej(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{s(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function Sj(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var xj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ps=xj.reduce((t,e)=>{const n=Y.forwardRef((r,i)=>{const{asChild:s,...o}=r,a=s?o_:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P(a,{...o,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function Tj(t,e){t&&SP.flushSync(()=>t.dispatchEvent(e))}function Ij(t,e=globalThis==null?void 0:globalThis.document){const n=Ra(t);Y.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var Oj="DismissableLayer",cv="dismissableLayer.update",Cj="dismissableLayer.pointerDownOutside",kj="dismissableLayer.focusOutside",gE,t1=Y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),n1=Y.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...c}=t,u=Y.useContext(t1),[l,d]=Y.useState(null),f=(l==null?void 0:l.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=Y.useState({}),m=nc(e,_=>d(_)),p=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=p.indexOf(g),v=l?p.indexOf(l):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,E=v>=y,w=Nj(_=>{const k=_.target,R=[...u.branches].some(F=>F.contains(k));!E||R||(i==null||i(_),o==null||o(_),_.defaultPrevented||a==null||a())},f),x=Aj(_=>{const k=_.target;[...u.branches].some(F=>F.contains(k))||(s==null||s(_),o==null||o(_),_.defaultPrevented||a==null||a())},f);return Ij(_=>{v===u.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&a&&(_.preventDefault(),a()))},f),Y.useEffect(()=>{if(l)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(gE=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(l)),u.layers.add(l),yE(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=gE)}},[l,f,n,u]),Y.useEffect(()=>()=>{l&&(u.layers.delete(l),u.layersWithOutsidePointerEventsDisabled.delete(l),yE())},[l,u]),Y.useEffect(()=>{const _=()=>h({});return document.addEventListener(cv,_),()=>document.removeEventListener(cv,_)},[]),P(ps.div,{...c,ref:m,style:{pointerEvents:b?E?"auto":"none":void 0,...t.style},onFocusCapture:Do(t.onFocusCapture,x.onFocusCapture),onBlurCapture:Do(t.onBlurCapture,x.onBlurCapture),onPointerDownCapture:Do(t.onPointerDownCapture,w.onPointerDownCapture)})});n1.displayName=Oj;var Dj="DismissableLayerBranch",Rj=Y.forwardRef((t,e)=>{const n=Y.useContext(t1),r=Y.useRef(null),i=nc(e,r);return Y.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),P(ps.div,{...t,ref:i})});Rj.displayName=Dj;function Nj(t,e=globalThis==null?void 0:globalThis.document){const n=Ra(t),r=Y.useRef(!1),i=Y.useRef(()=>{});return Y.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){r1(Cj,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=c,e.addEventListener("click",i.current,{once:!0})):c()}else e.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function Aj(t,e=globalThis==null?void 0:globalThis.document){const n=Ra(t),r=Y.useRef(!1);return Y.useEffect(()=>{const i=s=>{s.target&&!r.current&&r1(kj,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function yE(){const t=new CustomEvent(cv);document.dispatchEvent(t)}function r1(t,e,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?Tj(i,s):i.dispatchEvent(s)}var Kg=0;function Pj(){Y.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??vE()),document.body.insertAdjacentElement("beforeend",t[1]??vE()),Kg++,()=>{Kg===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Kg--}},[])}function vE(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Jg="focusScope.autoFocusOnMount",Xg="focusScope.autoFocusOnUnmount",bE={bubbles:!1,cancelable:!0},Mj="FocusScope",i1=Y.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,c]=Y.useState(null),u=Ra(i),l=Ra(s),d=Y.useRef(null),f=nc(e,p=>c(p)),h=Y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;Y.useEffect(()=>{if(r){let p=function(b){if(h.paused||!a)return;const E=b.target;a.contains(E)?d.current=E:uo(d.current,{select:!0})},g=function(b){if(h.paused||!a)return;const E=b.relatedTarget;E!==null&&(a.contains(E)||uo(d.current,{select:!0}))},y=function(b){if(document.activeElement===document.body)for(const w of b)w.removedNodes.length>0&&uo(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",g);const v=new MutationObserver(y);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",g),v.disconnect()}}},[r,a,h.paused]),Y.useEffect(()=>{if(a){wE.add(h);const p=document.activeElement;if(!a.contains(p)){const y=new CustomEvent(Jg,bE);a.addEventListener(Jg,u),a.dispatchEvent(y),y.defaultPrevented||(Lj(Bj(s1(a)),{select:!0}),document.activeElement===p&&uo(a))}return()=>{a.removeEventListener(Jg,u),setTimeout(()=>{const y=new CustomEvent(Xg,bE);a.addEventListener(Xg,l),a.dispatchEvent(y),y.defaultPrevented||uo(p??document.body,{select:!0}),a.removeEventListener(Xg,l),wE.remove(h)},0)}}},[a,u,l,h]);const m=Y.useCallback(p=>{if(!n&&!r||h.paused)return;const g=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,y=document.activeElement;if(g&&y){const v=p.currentTarget,[b,E]=Fj(v);b&&E?!p.shiftKey&&y===E?(p.preventDefault(),n&&uo(b,{select:!0})):p.shiftKey&&y===b&&(p.preventDefault(),n&&uo(E,{select:!0})):y===v&&p.preventDefault()}},[n,r,h.paused]);return P(ps.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});i1.displayName=Mj;function Lj(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(uo(r,{select:e}),document.activeElement!==n)return}function Fj(t){const e=s1(t),n=_E(e,t),r=_E(e.reverse(),t);return[n,r]}function s1(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function _E(t,e){for(const n of t)if(!$j(n,{upTo:e}))return n}function $j(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function jj(t){return t instanceof HTMLInputElement&&"select"in t}function uo(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&jj(t)&&e&&t.select()}}var wE=Uj();function Uj(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=EE(t,e),t.unshift(e)},remove(e){var n;t=EE(t,e),(n=t[0])==null||n.resume()}}}function EE(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function Bj(t){return t.filter(e=>e.tagName!=="A")}var gp=globalThis!=null&&globalThis.document?Y.useLayoutEffect:()=>{},zj=Y.useId||(()=>{}),Vj=0;function Qg(t){const[e,n]=Y.useState(zj());return gp(()=>{t||n(r=>r??String(Vj++))},[t]),t||(e?`radix-${e}`:"")}var Hj="Portal",o1=Y.forwardRef((t,e)=>{var a;const{container:n,...r}=t,[i,s]=Y.useState(!1);gp(()=>s(!0),[]);const o=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?xP.createPortal(P(ps.div,{...r,ref:e}),o):null});o1.displayName=Hj;function Wj(t,e){return Y.useReducer((n,r)=>e[n][r]??n,t)}var Vm=t=>{const{present:e,children:n}=t,r=qj(e),i=typeof n=="function"?n({present:r.isPresent}):Y.Children.only(n),s=nc(r.ref,Gj(i));return typeof n=="function"||r.isPresent?Y.cloneElement(i,{ref:s}):null};Vm.displayName="Presence";function qj(t){const[e,n]=Y.useState(),r=Y.useRef({}),i=Y.useRef(t),s=Y.useRef("none"),o=t?"mounted":"unmounted",[a,c]=Wj(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return Y.useEffect(()=>{const u=Zf(r.current);s.current=a==="mounted"?u:"none"},[a]),gp(()=>{const u=r.current,l=i.current;if(l!==t){const f=s.current,h=Zf(u);t?c("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(l&&f!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),gp(()=>{if(e){let u;const l=e.ownerDocument.defaultView??window,d=h=>{const p=Zf(r.current).includes(h.animationName);if(h.target===e&&p&&(c("ANIMATION_END"),!i.current)){const g=e.style.animationFillMode;e.style.animationFillMode="forwards",u=l.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=g)})}},f=h=>{h.target===e&&(s.current=Zf(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{l.clearTimeout(u),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:Y.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Zf(t){return(t==null?void 0:t.animationName)||"none"}function Gj(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Zj=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},vc=new WeakMap,Yf=new WeakMap,Kf={},ey=0,a1=function(t){return t&&(t.host||a1(t.parentNode))},Yj=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=a1(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},Kj=function(t,e,n,r){var i=Yj(e,Array.isArray(t)?t:[t]);Kf[n]||(Kf[n]=new WeakMap);var s=Kf[n],o=[],a=new Set,c=new Set(i),u=function(d){!d||a.has(d)||(a.add(d),u(d.parentNode))};i.forEach(u);var l=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))l(f);else try{var h=f.getAttribute(r),m=h!==null&&h!=="false",p=(vc.get(f)||0)+1,g=(s.get(f)||0)+1;vc.set(f,p),s.set(f,g),o.push(f),p===1&&m&&Yf.set(f,!0),g===1&&f.setAttribute(n,"true"),m||f.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",f,y)}})};return l(e),a.clear(),ey++,function(){o.forEach(function(d){var f=vc.get(d)-1,h=s.get(d)-1;vc.set(d,f),s.set(d,h),f||(Yf.has(d)||d.removeAttribute(r),Yf.delete(d)),h||d.removeAttribute(n)}),ey--,ey||(vc=new WeakMap,vc=new WeakMap,Yf=new WeakMap,Kf={})}},Jj=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=Zj(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),Kj(r,i,n,"aria-hidden")):function(){return null}},Yi=function(){return Yi=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Yi.apply(this,arguments)};function c1(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function Xj(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}var Fh="right-scroll-bar-position",$h="width-before-scroll-bar",Qj="with-scroll-bars-hidden",e5="--removed-body-scroll-bar-size";function ty(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function t5(t,e){var n=We(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=e,n.facade}var n5=typeof window<"u"?Y.useLayoutEffect:Y.useEffect,SE=new WeakMap;function r5(t,e){var n=t5(null,function(r){return t.forEach(function(i){return ty(i,r)})});return n5(function(){var r=SE.get(n);if(r){var i=new Set(r),s=new Set(t),o=n.current;i.forEach(function(a){s.has(a)||ty(a,null)}),s.forEach(function(a){i.has(a)||ty(a,o)})}SE.set(n,t)},[t]),n}function i5(t){return t}function s5(t,e){e===void 0&&(e=i5);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(s){var o=e(s,r);return n.push(o),function(){n=n.filter(function(a){return a!==o})}},assignSyncMedium:function(s){for(r=!0;n.length;){var o=n;n=[],o.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var o=[];if(n.length){var a=n;n=[],a.forEach(s),o=n}var c=function(){var l=o;o=[],l.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(l){o.push(l),u()},filter:function(l){return o=o.filter(l),n}}}};return i}function o5(t){t===void 0&&(t={});var e=s5(null);return e.options=Yi({async:!0,ssr:!1},t),e}var u1=function(t){var e=t.sideCar,n=c1(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return Y.createElement(r,Yi({},n))};u1.isSideCarExport=!0;function a5(t,e){return t.useMedium(e),u1}var l1=o5(),ny=function(){},Hm=Y.forwardRef(function(t,e){var n=Y.useRef(null),r=Y.useState({onScrollCapture:ny,onWheelCapture:ny,onTouchMoveCapture:ny}),i=r[0],s=r[1],o=t.forwardProps,a=t.children,c=t.className,u=t.removeScrollBar,l=t.enabled,d=t.shards,f=t.sideCar,h=t.noIsolation,m=t.inert,p=t.allowPinchZoom,g=t.as,y=g===void 0?"div":g,v=t.gapMode,b=c1(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=f,w=r5([n,e]),x=Yi(Yi({},b),i);return Y.createElement(Y.Fragment,null,l&&Y.createElement(E,{sideCar:l1,removeScrollBar:u,shards:d,noIsolation:h,inert:m,setCallbacks:s,allowPinchZoom:!!p,lockRef:n,gapMode:v}),o?Y.cloneElement(Y.Children.only(a),Yi(Yi({},x),{ref:w})):Y.createElement(y,Yi({},x,{className:c,ref:w}),a))});Hm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Hm.classNames={fullWidth:$h,zeroRight:Fh};var c5=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function u5(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=c5();return e&&t.setAttribute("nonce",e),t}function l5(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function d5(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var f5=function(){var t=0,e=null;return{add:function(n){t==0&&(e=u5())&&(l5(e,n),d5(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},h5=function(){var t=f5();return function(e,n){Y.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},d1=function(){var t=h5(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},p5={left:0,top:0,right:0,gap:0},ry=function(t){return parseInt(t||"",10)||0},m5=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[ry(n),ry(r),ry(i)]},g5=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return p5;var e=m5(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},y5=d1(),Gc="data-scroll-locked",v5=function(t,e,n,r){var i=t.left,s=t.top,o=t.right,a=t.gap;return n===void 0&&(n="margin"),`
15
- .`.concat(Qj,` {
16
- overflow: hidden `).concat(r,`;
17
- padding-right: `).concat(a,"px ").concat(r,`;
18
- }
19
- body[`).concat(Gc,`] {
20
- overflow: hidden `).concat(r,`;
21
- overscroll-behavior: contain;
22
- `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
23
- padding-left: `.concat(i,`px;
24
- padding-top: `).concat(s,`px;
25
- padding-right: `).concat(o,`px;
26
- margin-left:0;
27
- margin-top:0;
28
- margin-right: `).concat(a,"px ").concat(r,`;
29
- `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
30
- }
31
-
32
- .`).concat(Fh,` {
33
- right: `).concat(a,"px ").concat(r,`;
34
- }
35
-
36
- .`).concat($h,` {
37
- margin-right: `).concat(a,"px ").concat(r,`;
38
- }
39
-
40
- .`).concat(Fh," .").concat(Fh,` {
41
- right: 0 `).concat(r,`;
42
- }
43
-
44
- .`).concat($h," .").concat($h,` {
45
- margin-right: 0 `).concat(r,`;
46
- }
47
-
48
- body[`).concat(Gc,`] {
49
- `).concat(e5,": ").concat(a,`px;
50
- }
51
- `)},xE=function(){var t=parseInt(document.body.getAttribute(Gc)||"0",10);return isFinite(t)?t:0},b5=function(){Y.useEffect(function(){return document.body.setAttribute(Gc,(xE()+1).toString()),function(){var t=xE()-1;t<=0?document.body.removeAttribute(Gc):document.body.setAttribute(Gc,t.toString())}},[])},_5=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;b5();var s=Y.useMemo(function(){return g5(i)},[i]);return Y.createElement(y5,{styles:v5(s,!e,i,n?"":"!important")})},uv=!1;if(typeof window<"u")try{var Jf=Object.defineProperty({},"passive",{get:function(){return uv=!0,!0}});window.addEventListener("test",Jf,Jf),window.removeEventListener("test",Jf,Jf)}catch{uv=!1}var bc=uv?{passive:!1}:!1,w5=function(t){return t.tagName==="TEXTAREA"},f1=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!w5(t)&&n[e]==="visible")},E5=function(t){return f1(t,"overflowY")},S5=function(t){return f1(t,"overflowX")},TE=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=h1(t,r);if(i){var s=p1(t,r),o=s[1],a=s[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},x5=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},T5=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},h1=function(t,e){return t==="v"?E5(e):S5(e)},p1=function(t,e){return t==="v"?x5(e):T5(e)},I5=function(t,e){return t==="h"&&e==="rtl"?-1:1},O5=function(t,e,n,r,i){var s=I5(t,window.getComputedStyle(e).direction),o=s*r,a=n.target,c=e.contains(a),u=!1,l=o>0,d=0,f=0;do{var h=p1(t,a),m=h[0],p=h[1],g=h[2],y=p-g-s*m;(m||y)&&h1(t,a)&&(d+=y,f+=m),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(l&&Math.abs(d)<1||!l&&Math.abs(f)<1)&&(u=!0),u},Xf=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},IE=function(t){return[t.deltaX,t.deltaY]},OE=function(t){return t&&"current"in t?t.current:t},C5=function(t,e){return t[0]===e[0]&&t[1]===e[1]},k5=function(t){return`
52
- .block-interactivity-`.concat(t,` {pointer-events: none;}
53
- .allow-interactivity-`).concat(t,` {pointer-events: all;}
54
- `)},D5=0,_c=[];function R5(t){var e=Y.useRef([]),n=Y.useRef([0,0]),r=Y.useRef(),i=Y.useState(D5++)[0],s=Y.useState(d1)[0],o=Y.useRef(t);Y.useEffect(function(){o.current=t},[t]),Y.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var p=Xj([t.lockRef.current],(t.shards||[]).map(OE),!0).filter(Boolean);return p.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),p.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=Y.useCallback(function(p,g){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!o.current.allowPinchZoom;var y=Xf(p),v=n.current,b="deltaX"in p?p.deltaX:v[0]-y[0],E="deltaY"in p?p.deltaY:v[1]-y[1],w,x=p.target,_=Math.abs(b)>Math.abs(E)?"h":"v";if("touches"in p&&_==="h"&&x.type==="range")return!1;var k=TE(_,x);if(!k)return!0;if(k?w=_:(w=_==="v"?"h":"v",k=TE(_,x)),!k)return!1;if(!r.current&&"changedTouches"in p&&(b||E)&&(r.current=w),!w)return!0;var R=r.current||w;return O5(R,g,p,R==="h"?b:E)},[]),c=Y.useCallback(function(p){var g=p;if(!(!_c.length||_c[_c.length-1]!==s)){var y="deltaY"in g?IE(g):Xf(g),v=e.current.filter(function(w){return w.name===g.type&&(w.target===g.target||g.target===w.shadowParent)&&C5(w.delta,y)})[0];if(v&&v.should){g.cancelable&&g.preventDefault();return}if(!v){var b=(o.current.shards||[]).map(OE).filter(Boolean).filter(function(w){return w.contains(g.target)}),E=b.length>0?a(g,b[0]):!o.current.noIsolation;E&&g.cancelable&&g.preventDefault()}}},[]),u=Y.useCallback(function(p,g,y,v){var b={name:p,delta:g,target:y,should:v,shadowParent:N5(y)};e.current.push(b),setTimeout(function(){e.current=e.current.filter(function(E){return E!==b})},1)},[]),l=Y.useCallback(function(p){n.current=Xf(p),r.current=void 0},[]),d=Y.useCallback(function(p){u(p.type,IE(p),p.target,a(p,t.lockRef.current))},[]),f=Y.useCallback(function(p){u(p.type,Xf(p),p.target,a(p,t.lockRef.current))},[]);Y.useEffect(function(){return _c.push(s),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,bc),document.addEventListener("touchmove",c,bc),document.addEventListener("touchstart",l,bc),function(){_c=_c.filter(function(p){return p!==s}),document.removeEventListener("wheel",c,bc),document.removeEventListener("touchmove",c,bc),document.removeEventListener("touchstart",l,bc)}},[]);var h=t.removeScrollBar,m=t.inert;return Y.createElement(Y.Fragment,null,m?Y.createElement(s,{styles:k5(i)}):null,h?Y.createElement(_5,{gapMode:t.gapMode}):null)}function N5(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const A5=a5(l1,R5);var m1=Y.forwardRef(function(t,e){return Y.createElement(Hm,Yi({},t,{ref:e,sideCar:A5}))});m1.classNames=Hm.classNames;const g1="2.22.17";let al={getDocsUrl:({docsBaseUrl:t,docsPath:e="",docsSlug:n})=>e?`${t??"https://viem.sh"}${e}${n?`#${n}`:""}`:void 0,version:`viem@${g1}`};class qn extends Error{constructor(e,n={}){var a;const r=(()=>{var c;return n.cause instanceof qn?n.cause.details:(c=n.cause)!=null&&c.message?n.cause.message:n.details})(),i=n.cause instanceof qn&&n.cause.docsPath||n.docsPath,s=(a=al.getDocsUrl)==null?void 0:a.call(al,{...n,docsPath:i}),o=[e||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...r?[`Details: ${r}`]:[],...al.version?[`Version: ${al.version}`]:[]].join(`
55
- `);super(o,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=i,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=e,this.version=g1}walk(e){return y1(this,e)}}function y1(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause!==void 0?y1(t.cause,e):e?null:t}class P5 extends qn{constructor({max:e,min:n,signed:r,size:i,value:s}){super(`Number "${s}" is not in safe ${i?`${i*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${n} to ${e})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}}class vie extends qn{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class M5 extends qn{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}class L5 extends qn{constructor({givenSize:e,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}class bie extends qn{constructor({offset:e,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}}class v1 extends qn{constructor({size:e,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}}class _ie extends qn{constructor({size:e,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${e} ${r} long.`,{name:"InvalidBytesLengthError"})}}function Bu(t,{dir:e,size:n=32}={}){return typeof t=="string"?F5(t,{dir:e,size:n}):$5(t,{dir:e,size:n})}function F5(t,{dir:e,size:n=32}={}){if(n===null)return t;const r=t.replace("0x","");if(r.length>n*2)throw new v1({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[e==="right"?"padEnd":"padStart"](n*2,"0")}`}function $5(t,{dir:e,size:n=32}={}){if(n===null)return t;if(t.length>n)throw new v1({size:t.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let i=0;i<n;i++){const s=e==="right";r[s?i:n-i-1]=t[s?i:t.length-i-1]}return r}function a_(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function CE(t){return a_(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}function iy(t,{dir:e="left"}={}){let n=typeof t=="string"?t.replace("0x",""):t,r=0;for(let i=0;i<n.length-1&&n[e==="left"?i:n.length-i-1].toString()==="0";i++)r++;return n=e==="left"?n.slice(r):n.slice(0,n.length-r),typeof t=="string"?(n.length===1&&e==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}const j5=new TextEncoder;function U5(t,e={}){return typeof t=="number"||typeof t=="bigint"?z5(t,e):typeof t=="boolean"?B5(t,e):a_(t)?b1(t,e):_1(t,e)}function B5(t,e={}){const n=new Uint8Array(1);return n[0]=Number(t),typeof e.size=="number"?(rc(n,{size:e.size}),Bu(n,{size:e.size})):n}const Es={zero:48,nine:57,A:65,F:70,a:97,f:102};function kE(t){if(t>=Es.zero&&t<=Es.nine)return t-Es.zero;if(t>=Es.A&&t<=Es.F)return t-(Es.A-10);if(t>=Es.a&&t<=Es.f)return t-(Es.a-10)}function b1(t,e={}){let n=t;e.size&&(rc(n,{size:e.size}),n=Bu(n,{dir:"right",size:e.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const i=r.length/2,s=new Uint8Array(i);for(let o=0,a=0;o<i;o++){const c=kE(r.charCodeAt(a++)),u=kE(r.charCodeAt(a++));if(c===void 0||u===void 0)throw new qn(`Invalid byte sequence ("${r[a-2]}${r[a-1]}" in "${r}").`);s[o]=c*16+u}return s}function z5(t,e){const n=yp(t,e);return b1(n)}function _1(t,e={}){const n=j5.encode(t);return typeof e.size=="number"?(rc(n,{size:e.size}),Bu(n,{dir:"right",size:e.size})):n}function rc(t,{size:e}){if(CE(t)>e)throw new L5({givenSize:CE(t),maxSize:e})}function V5(t,e={}){const{signed:n}=e;e.size&&rc(t,{size:e.size});const r=BigInt(t);if(!n)return r;const i=(t.length-2)/2,s=(1n<<BigInt(i)*8n-1n)-1n;return r<=s?r:r-BigInt(`0x${"f".padStart(i*2,"f")}`)-1n}function wie(t,e={}){let n=t;if(e.size&&(rc(n,{size:e.size}),n=iy(n)),iy(n)==="0x00")return!1;if(iy(n)==="0x01")return!0;throw new M5(n)}function Eie(t,e={}){return Number(V5(t,e))}const H5=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function W5(t,e={}){return typeof t=="number"||typeof t=="bigint"?yp(t,e):typeof t=="string"?E1(t,e):typeof t=="boolean"?q5(t,e):w1(t,e)}function q5(t,e={}){const n=`0x${Number(t)}`;return typeof e.size=="number"?(rc(n,{size:e.size}),Bu(n,{size:e.size})):n}function w1(t,e={}){let n="";for(let i=0;i<t.length;i++)n+=H5[t[i]];const r=`0x${n}`;return typeof e.size=="number"?(rc(r,{size:e.size}),Bu(r,{dir:"right",size:e.size})):r}function yp(t,e={}){const{signed:n,size:r}=e,i=BigInt(t);let s;r?n?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof t=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof s=="bigint"&&n?-s-1n:0;if(s&&i>s||i<o){const c=typeof t=="bigint"?"n":"";throw new P5({max:s?`${s}${c}`:void 0,min:`${o}${c}`,signed:n,size:r,value:`${t}${c}`})}const a=`0x${(n&&i<0?(1n<<BigInt(r*8))+BigInt(i):i).toString(16)}`;return r?Bu(a,{size:r}):a}const G5=new TextEncoder;function E1(t,e={}){const n=G5.encode(t);return w1(n,e)}class Z5 extends qn{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class c_ extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const n=super.get(e);return super.has(e)&&n!==void 0&&(this.delete(e),super.set(e,n)),n}set(e,n){if(super.set(e,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}function vp(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function Y5(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Wm(t,...e){if(!Y5(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function Sie(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");vp(t.outputLen),vp(t.blockLen)}function DE(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function K5(t,e){Wm(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}const Qf=BigInt(2**32-1),RE=BigInt(32);function J5(t,e=!1){return e?{h:Number(t&Qf),l:Number(t>>RE&Qf)}:{h:Number(t>>RE&Qf)|0,l:Number(t&Qf)|0}}function X5(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:s,l:o}=J5(t[i],e);[n[i],r[i]]=[s,o]}return[n,r]}const Q5=(t,e,n)=>t<<n|e>>>32-n,eU=(t,e,n)=>e<<n|t>>>32-n,tU=(t,e,n)=>e<<n-32|t>>>64-n,nU=(t,e,n)=>t<<n-32|e>>>64-n,wc=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function rU(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function xie(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Tie(t,e){return t<<32-e|t>>>e}const NE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function iU(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function AE(t){for(let e=0;e<t.length;e++)t[e]=iU(t[e])}function sU(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function S1(t){return typeof t=="string"&&(t=sU(t)),Wm(t),t}function Iie(...t){let e=0;for(let r=0;r<t.length;r++){const i=t[r];Wm(i),e+=i.length}const n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const s=t[r];n.set(s,i),i+=s.length}return n}let oU=class{clone(){return this._cloneInto()}};function aU(t){const e=r=>t().update(S1(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function Cie(t=32){if(wc&&typeof wc.getRandomValues=="function")return wc.getRandomValues(new Uint8Array(t));if(wc&&typeof wc.randomBytes=="function")return wc.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}const x1=[],T1=[],I1=[],cU=BigInt(0),cl=BigInt(1),uU=BigInt(2),lU=BigInt(7),dU=BigInt(256),fU=BigInt(113);for(let t=0,e=cl,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],x1.push(2*(5*r+n)),T1.push((t+1)*(t+2)/2%64);let i=cU;for(let s=0;s<7;s++)e=(e<<cl^(e>>lU)*fU)%dU,e&uU&&(i^=cl<<(cl<<BigInt(s))-cl);I1.push(i)}const[hU,pU]=X5(I1,!0),PE=(t,e,n)=>n>32?tU(t,e,n):Q5(t,e,n),ME=(t,e,n)=>n>32?nU(t,e,n):eU(t,e,n);function mU(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let o=0;o<10;o++)n[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,u=n[c],l=n[c+1],d=PE(u,l,1)^n[a],f=ME(u,l,1)^n[a+1];for(let h=0;h<50;h+=10)t[o+h]^=d,t[o+h+1]^=f}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=T1[o],c=PE(i,s,a),u=ME(i,s,a),l=x1[o];i=t[l],s=t[l+1],t[l]=c,t[l+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)n[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~n[(a+2)%10]&n[(a+4)%10]}t[0]^=hU[r],t[1]^=pU[r]}n.fill(0)}class u_ extends oU{constructor(e,n,r,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,vp(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=rU(this.state)}keccak(){NE||AE(this.state32),mU(this.state32,this.rounds),NE||AE(this.state32),this.posOut=0,this.pos=0}update(e){DE(this);const{blockLen:n,state:r}=this;e=S1(e);const i=e.length;for(let s=0;s<i;){const o=Math.min(n-this.pos,i-s);for(let a=0;a<o;a++)r[this.pos++]^=e[s++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:n,pos:r,blockLen:i}=this;e[r]^=n,n&128&&r===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){DE(this,!1),Wm(e),this.finish();const n=this.state,{blockLen:r}=this;for(let i=0,s=e.length;i<s;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,s-i);e.set(n.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return vp(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(K5(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:n,suffix:r,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new u_(n,r,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=r,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const gU=(t,e,n)=>aU(()=>new u_(e,t,n)),yU=gU(1,136,256/8);function vU(t,e){const n=e||"hex",r=yU(a_(t,{strict:!1})?U5(t):t);return n==="bytes"?r:W5(r)}const sy=new c_(8192);function O1(t,e){if(sy.has(`${t}.${e}`))return sy.get(`${t}.${e}`);const n=t.substring(2).toLowerCase(),r=vU(_1(n),"bytes"),i=n.split("");for(let o=0;o<40;o+=2)r[o>>1]>>4>=8&&i[o]&&(i[o]=i[o].toUpperCase()),(r[o>>1]&15)>=8&&i[o+1]&&(i[o+1]=i[o+1].toUpperCase());const s=`0x${i.join("")}`;return sy.set(`${t}.${e}`,s),s}function eh(t,e){if(!_U(t,{strict:!1}))throw new Z5({address:t});return O1(t,e)}const bU=/^0x[a-fA-F0-9]{40}$/,oy=new c_(8192);function _U(t,e){const{strict:n=!0}=e??{},r=`${t}.${n}`;if(oy.has(r))return oy.get(r);const i=bU.test(t)?t.toLowerCase()===t?!0:n?O1(t)===t:!0:!1;return oy.set(r,i),i}function wU(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}const Sa=(t,e,n)=>JSON.stringify(t,(r,i)=>typeof i=="bigint"?i.toString():i,n),kie=t=>t,l_=t=>t;class Ll extends qn{constructor({body:e,cause:n,details:r,headers:i,status:s,url:o}){super("HTTP request failed.",{cause:n,details:r,metaMessages:[s&&`Status: ${s}`,`URL: ${l_(o)}`,e&&`Request body: ${Sa(e)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=i,this.status=s,this.url=o}}class C1 extends qn{constructor({body:e,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${l_(r)}`,`Request body: ${Sa(e)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=n.code,this.data=n.data}}class LE extends qn{constructor({body:e,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${l_(n)}`,`Request body: ${Sa(e)}`],name:"TimeoutError"})}}const EU=-1;class Rr extends qn{constructor(e,{code:n,docsPath:r,metaMessages:i,name:s,shortMessage:o}){super(o,{cause:e,docsPath:r,metaMessages:i||(e==null?void 0:e.metaMessages),name:s||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=s||e.name,this.code=e instanceof C1?e.code:n??EU}}class zu extends Rr{constructor(e,n){super(e,n),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}}class td extends Rr{constructor(e){super(e,{code:td.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(td,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class nd extends Rr{constructor(e){super(e,{code:nd.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(nd,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class rd extends Rr{constructor(e,{method:n}={}){super(e,{code:rd.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`})}}Object.defineProperty(rd,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class id extends Rr{constructor(e){super(e,{code:id.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
56
- `)})}}Object.defineProperty(id,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class gu extends Rr{constructor(e){super(e,{code:gu.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(gu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class sd extends Rr{constructor(e){super(e,{code:sd.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
57
- `)})}}Object.defineProperty(sd,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class od extends Rr{constructor(e){super(e,{code:od.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(od,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class Ro extends Rr{constructor(e){super(e,{code:Ro.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(Ro,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class ad extends Rr{constructor(e){super(e,{code:ad.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(ad,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class la extends Rr{constructor(e,{method:n}={}){super(e,{code:la.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`})}}Object.defineProperty(la,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class yu extends Rr{constructor(e){super(e,{code:yu.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(yu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class cd extends Rr{constructor(e){super(e,{code:cd.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(cd,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class cr extends zu{constructor(e){super(e,{code:cr.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(cr,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class ud extends zu{constructor(e){super(e,{code:ud.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(ud,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class ld extends zu{constructor(e,{method:n}={}){super(e,{code:ld.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}}Object.defineProperty(ld,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class dd extends zu{constructor(e){super(e,{code:dd.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(dd,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class fd extends zu{constructor(e){super(e,{code:fd.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(fd,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class Na extends zu{constructor(e){super(e,{code:Na.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(Na,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class SU extends Rr{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}function xU(){let t=()=>{},e=()=>{};return{promise:new Promise((r,i)=>{t=r,e=i}),resolve:t,reject:e}}const ay=new Map;function TU({fn:t,id:e,shouldSplitBatch:n,wait:r=0,sort:i}){const s=async()=>{const l=c();o();const d=l.map(({args:f})=>f);d.length!==0&&t(d).then(f=>{i&&Array.isArray(f)&&f.sort(i);for(let h=0;h<l.length;h++){const{resolve:m}=l[h];m==null||m([f[h],f])}}).catch(f=>{for(let h=0;h<l.length;h++){const{reject:m}=l[h];m==null||m(f)}})},o=()=>ay.delete(e),a=()=>c().map(({args:l})=>l),c=()=>ay.get(e)||[],u=l=>ay.set(e,[...c(),l]);return{flush:o,async schedule(l){const{promise:d,resolve:f,reject:h}=xU();return(n==null?void 0:n([...a(),l]))&&s(),c().length>0?(u({args:l,resolve:f,reject:h}),d):(u({args:l,resolve:f,reject:h}),setTimeout(s,r),d)}}}async function IU(t){return new Promise(e=>setTimeout(e,t))}const th=new c_(8192);function OU(t,{enabled:e=!0,id:n}){if(!e||!n)return t();if(th.get(n))return th.get(n);const r=t().finally(()=>th.delete(n));return th.set(n,r),r}function k1(t,{delay:e=100,retryCount:n=2,shouldRetry:r=()=>!0}={}){return new Promise((i,s)=>{const o=async({count:a=0}={})=>{const c=async({error:u})=>{const l=typeof e=="function"?e({count:a,error:u}):e;l&&await IU(l),o({count:a+1})};try{const u=await t();i(u)}catch(u){if(a<n&&await r({count:a,error:u}))return c({error:u});s(u)}};o()})}function CU(t,e={}){return async(n,r={})=>{var d;const{dedupe:i=!1,methods:s,retryDelay:o=150,retryCount:a=3,uid:c}={...e,...r},{method:u}=n;if((d=s==null?void 0:s.exclude)!=null&&d.includes(u))throw new la(new Error("method not supported"),{method:u});if(s!=null&&s.include&&!s.include.includes(u))throw new la(new Error("method not supported"),{method:u});const l=i?E1(`${c}.${Sa(n)}`):void 0;return OU(()=>k1(async()=>{try{return await t(n)}catch(f){const h=f;switch(h.code){case td.code:throw new td(h);case nd.code:throw new nd(h);case rd.code:throw new rd(h,{method:n.method});case id.code:throw new id(h);case gu.code:throw new gu(h);case sd.code:throw new sd(h);case od.code:throw new od(h);case Ro.code:throw new Ro(h);case ad.code:throw new ad(h);case la.code:throw new la(h,{method:n.method});case yu.code:throw new yu(h);case cd.code:throw new cd(h);case cr.code:throw new cr(h);case ud.code:throw new ud(h);case ld.code:throw new ld(h);case dd.code:throw new dd(h);case fd.code:throw new fd(h);case Na.code:throw new Na(h);case 5e3:throw new cr(h);default:throw f instanceof qn?f:new SU(h)}}},{delay:({count:f,error:h})=>{var m;if(h&&h instanceof Ll){const p=(m=h==null?void 0:h.headers)==null?void 0:m.get("Retry-After");if(p!=null&&p.match(/\d/))return Number.parseInt(p)*1e3}return~~(1<<f)*o},retryCount:a,shouldRetry:({error:f})=>kU(f)}),{enabled:i,id:l})}}function kU(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===yu.code||t.code===gu.code:t instanceof Ll&&t.status?t.status===403||t.status===408||t.status===413||t.status===429||t.status===500||t.status===502||t.status===503||t.status===504:!0}function DU(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}function D1(t,{errorInstance:e=new Error("timed out"),timeout:n,signal:r}){return new Promise((i,s)=>{(async()=>{let o;try{const a=new AbortController;n>0&&(o=setTimeout(()=>{r?a.abort():s(e)},n)),i(await t({signal:(a==null?void 0:a.signal)||null}))}catch(a){(a==null?void 0:a.name)==="AbortError"&&s(e),s(a)}finally{clearTimeout(o)}})()})}function RU(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const FE=RU();function NU(t,e={}){return{async request(n){var d;const{body:r,onRequest:i=e.onRequest,onResponse:s=e.onResponse,timeout:o=e.timeout??1e4}=n,a={...e.fetchOptions??{},...n.fetchOptions??{}},{headers:c,method:u,signal:l}=a;try{const f=await D1(async({signal:m})=>{const p={...a,body:Array.isArray(r)?Sa(r.map(b=>({jsonrpc:"2.0",id:b.id??FE.take(),...b}))):Sa({jsonrpc:"2.0",id:r.id??FE.take(),...r}),headers:{"Content-Type":"application/json",...c},method:u||"POST",signal:l||(o>0?m:null)},g=new Request(t,p),y=await(i==null?void 0:i(g,p))??{...p,url:t};return await fetch(y.url??t,y)},{errorInstance:new LE({body:r,url:t}),timeout:o,signal:!0});s&&await s(f);let h;if((d=f.headers.get("Content-Type"))!=null&&d.startsWith("application/json"))h=await f.json();else{h=await f.text();try{h=JSON.parse(h||"{}")}catch(m){if(f.ok)throw m;h={error:h}}}if(!f.ok)throw new Ll({body:r,details:Sa(h.error)||f.statusText,headers:f.headers,status:f.status,url:t});return h}catch(f){throw f instanceof Ll||f instanceof LE?f:new Ll({body:r,cause:f,url:t})}}}}const jh="2.16.3",AU=()=>`@wagmi/core@${jh}`;var R1=function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},bp,N1;let A1=class lv extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return AU()}constructor(e,n={}){var s;super(),bp.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const r=n.cause instanceof lv?n.cause.details:(s=n.cause)!=null&&s.message?n.cause.message:n.details,i=n.cause instanceof lv&&n.cause.docsPath||n.docsPath;this.message=[e||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...i?[`Docs: ${this.docsBaseUrl}${i}.html${n.docsSlug?`#${n.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join(`
58
- `),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=i,this.metaMessages=n.metaMessages,this.shortMessage=e}walk(e){return R1(this,bp,"m",N1).call(this,this,e)}};bp=new WeakSet,N1=function t(e,n){return n!=null&&n(e)?e:e.cause?R1(this,bp,"m",t).call(this,e.cause,n):e};class dv extends A1{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}const fv=256;let nh=fv,rh;function P1(t=11){if(!rh||nh+t>fv*2){rh="",nh=0;for(let e=0;e<fv;e++)rh+=(256+Math.random()*256|0).toString(16).substring(1)}return rh.substring(nh,nh+++t)}function PU(t){const{batch:e,cacheTime:n=t.pollingInterval??4e3,ccipRead:r,key:i="base",name:s="Base Client",pollingInterval:o=4e3,type:a="base"}=t,c=t.chain,u=t.account?wU(t.account):void 0,{config:l,request:d,value:f}=t.transport({chain:c,pollingInterval:o}),h={...l,...f},m={account:u,batch:e,cacheTime:n,ccipRead:r,chain:c,key:i,name:s,pollingInterval:o,request:d,transport:h,type:a,uid:P1()};function p(g){return y=>{const v=y(g);for(const E in m)delete v[E];const b={...g,...v};return Object.assign(b,{extend:p(b)})}}return Object.assign(m,{extend:p(m)})}function MU({key:t,methods:e,name:n,request:r,retryCount:i=3,retryDelay:s=150,timeout:o,type:a},c){const u=P1();return{config:{key:t,name:n,request:r,retryCount:i,retryDelay:s,timeout:o,type:a},request:CU(r,{methods:e,retryCount:i,retryDelay:s,uid:u}),value:c}}class LU extends qn{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function FU(t,e={}){const{batch:n,fetchOptions:r,key:i="http",methods:s,name:o="HTTP JSON-RPC",onFetchRequest:a,onFetchResponse:c,retryDelay:u}=e;return({chain:l,retryCount:d,timeout:f})=>{const{batchSize:h=1e3,wait:m=0}=typeof n=="object"?n:{},p=e.retryCount??d,g=f??e.timeout??1e4,y=l==null?void 0:l.rpcUrls.default.http[0];if(!y)throw new LU;const v=NU(y,{fetchOptions:r,onRequest:a,onResponse:c,timeout:g});return MU({key:i,methods:s,name:o,async request({method:b,params:E}){const w={method:b,params:E},{schedule:x}=TU({id:y,wait:m,shouldSplitBatch(F){return F.length>h},fn:F=>v.request({body:F}),sort:(F,V)=>F.id-V.id}),_=async F=>n?x(F):[await v.request({body:F})],[{error:k,result:R}]=await _(w);if(k)throw new C1({body:w,error:k,url:y});return R},retryCount:p,retryDelay:u,timeout:g,type:"http"},{fetchOptions:r,url:y})}}let cy=!1;async function $U(t,e={}){var u,l;if(cy)return[];cy=!0,t.setState(d=>({...d,status:d.current?"reconnecting":"connecting"}));const n=[];if((u=e.connectors)!=null&&u.length)for(const d of e.connectors){let f;typeof d=="function"?f=t._internal.connectors.setup(d):f=d,n.push(f)}else n.push(...t.connectors);let r;try{r=await((l=t.storage)==null?void 0:l.getItem("recentConnectorId"))}catch{}const i={};for(const[,d]of t.state.connections)i[d.connector.id]=1;r&&(i[r]=0);const s=Object.keys(i).length>0?[...n].sort((d,f)=>(i[d.id]??10)-(i[f.id]??10)):n;let o=!1;const a=[],c=[];for(const d of s){const f=await d.getProvider().catch(()=>{});if(!f||c.some(p=>p===f)||!await d.isAuthorized())continue;const m=await d.connect({isReconnecting:!0}).catch(()=>null);m&&(d.emitter.off("connect",t._internal.events.connect),d.emitter.on("change",t._internal.events.change),d.emitter.on("disconnect",t._internal.events.disconnect),t.setState(p=>{const g=new Map(o?p.connections:new Map).set(d.uid,{accounts:m.accounts,chainId:m.chainId,connector:d});return{...p,current:o?p.current:d.uid,connections:g}}),a.push({accounts:m.accounts,chainId:m.chainId,connector:d}),c.push(f),o=!0)}return(t.state.status==="reconnecting"||t.state.status==="connecting")&&(o?t.setState(d=>({...d,status:"connected"})):t.setState(d=>({...d,connections:new Map,current:null,status:"disconnected"}))),cy=!1,a}class Ec extends A1{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}d_.type="injected";function d_(t={}){const{shimDisconnect:e=!0,unstable_shimAsyncInject:n}=t;function r(){const c=t.target;if(typeof c=="function"){const u=c();if(u)return u}return typeof c=="object"?c:typeof c=="string"?{...jU[c]??{id:c,name:`${c[0].toUpperCase()}${c.slice(1)}`,provider:`is${c[0].toUpperCase()}${c.slice(1)}`}}:{id:"injected",name:"Injected",provider(u){return u==null?void 0:u.ethereum}}}let i,s,o,a;return c=>({get icon(){return r().icon},get id(){return r().id},get name(){return r().name},get supportsSimulation(){return!0},type:d_.type,async setup(){const u=await this.getProvider();u!=null&&u.on&&t.target&&(o||(o=this.onConnect.bind(this),u.on("connect",o)),i||(i=this.onAccountsChanged.bind(this),u.on("accountsChanged",i)))},async connect({chainId:u,isReconnecting:l}={}){var h,m,p,g,y,v;const d=await this.getProvider();if(!d)throw new Ec;let f=[];if(l)f=await this.getAccounts().catch(()=>[]);else if(e)try{f=(g=(p=(m=(h=(await d.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:h.caveats)==null?void 0:m[0])==null?void 0:p.value)==null?void 0:g.map(E=>eh(E)),f.length>0&&(f=await this.getAccounts())}catch(b){const E=b;if(E.code===cr.code)throw new cr(E);if(E.code===Ro.code)throw E}try{!(f!=null&&f.length)&&!l&&(f=(await d.request({method:"eth_requestAccounts"})).map(w=>eh(w))),o&&(d.removeListener("connect",o),o=void 0),i||(i=this.onAccountsChanged.bind(this),d.on("accountsChanged",i)),s||(s=this.onChainChanged.bind(this),d.on("chainChanged",s)),a||(a=this.onDisconnect.bind(this),d.on("disconnect",a));let b=await this.getChainId();if(u&&b!==u){const E=await this.switchChain({chainId:u}).catch(w=>{if(w.code===cr.code)throw w;return{id:b}});b=(E==null?void 0:E.id)??b}return e&&await((y=c.storage)==null?void 0:y.removeItem(`${this.id}.disconnected`)),t.target||await((v=c.storage)==null?void 0:v.setItem("injected.connected",!0)),{accounts:f,chainId:b}}catch(b){const E=b;throw E.code===cr.code?new cr(E):E.code===Ro.code?new Ro(E):E}},async disconnect(){var l,d;const u=await this.getProvider();if(!u)throw new Ec;s&&(u.removeListener("chainChanged",s),s=void 0),a&&(u.removeListener("disconnect",a),a=void 0),o||(o=this.onConnect.bind(this),u.on("connect",o));try{await D1(()=>u.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}e&&await((l=c.storage)==null?void 0:l.setItem(`${this.id}.disconnected`,!0)),t.target||await((d=c.storage)==null?void 0:d.removeItem("injected.connected"))},async getAccounts(){const u=await this.getProvider();if(!u)throw new Ec;return(await u.request({method:"eth_accounts"})).map(d=>eh(d))},async getChainId(){const u=await this.getProvider();if(!u)throw new Ec;const l=await u.request({method:"eth_chainId"});return Number(l)},async getProvider(){if(typeof window>"u")return;let u;const l=r();return typeof l.provider=="function"?u=l.provider(window):typeof l.provider=="string"?u=Uh(window,l.provider):u=l.provider,u&&!u.removeListener&&("off"in u&&typeof u.off=="function"?u.removeListener=u.off:u.removeListener=()=>{}),u},async isAuthorized(){var u,l;try{if(e&&await((u=c.storage)==null?void 0:u.getItem(`${this.id}.disconnected`))||!t.target&&!await((l=c.storage)==null?void 0:l.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(n!==void 0&&n!==!1){const m=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",m),!!await this.getProvider()),p=typeof n=="number"?n:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(y=>window.addEventListener("ethereum#initialized",()=>y(m()),{once:!0}))]:[],new Promise(y=>setTimeout(()=>y(m()),p))]))return!0}throw new Ec}return!!(await k1(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:u,chainId:l}){var m,p,g,y;const d=await this.getProvider();if(!d)throw new Ec;const f=c.chains.find(v=>v.id===l);if(!f)throw new Na(new dv);const h=new Promise(v=>{const b=E=>{"chainId"in E&&E.chainId===l&&(c.emitter.off("change",b),v())};c.emitter.on("change",b)});try{return await Promise.all([d.request({method:"wallet_switchEthereumChain",params:[{chainId:yp(l)}]}).then(async()=>{await this.getChainId()===l&&c.emitter.emit("change",{chainId:l})}),h]),f}catch(v){const b=v;if(b.code===4902||((p=(m=b==null?void 0:b.data)==null?void 0:m.originalError)==null?void 0:p.code)===4902)try{const{default:E,...w}=f.blockExplorers??{};let x;u!=null&&u.blockExplorerUrls?x=u.blockExplorerUrls:E&&(x=[E.url,...Object.values(w).map(R=>R.url)]);let _;(g=u==null?void 0:u.rpcUrls)!=null&&g.length?_=u.rpcUrls:_=[((y=f.rpcUrls.default)==null?void 0:y.http[0])??""];const k={blockExplorerUrls:x,chainId:yp(l),chainName:(u==null?void 0:u.chainName)??f.name,iconUrls:u==null?void 0:u.iconUrls,nativeCurrency:(u==null?void 0:u.nativeCurrency)??f.nativeCurrency,rpcUrls:_};return await Promise.all([d.request({method:"wallet_addEthereumChain",params:[k]}).then(async()=>{if(await this.getChainId()===l)c.emitter.emit("change",{chainId:l});else throw new cr(new Error("User rejected switch after adding network."))}),h]),f}catch(E){throw new cr(E)}throw b.code===cr.code?new cr(b):new Na(b)}},async onAccountsChanged(u){var l;if(u.length===0)this.onDisconnect();else if(c.emitter.listenerCount("connect")){const d=(await this.getChainId()).toString();this.onConnect({chainId:d}),e&&await((l=c.storage)==null?void 0:l.removeItem(`${this.id}.disconnected`))}else c.emitter.emit("change",{accounts:u.map(d=>eh(d))})},onChainChanged(u){const l=Number(u);c.emitter.emit("change",{chainId:l})},async onConnect(u){const l=await this.getAccounts();if(l.length===0)return;const d=Number(u.chainId);c.emitter.emit("connect",{accounts:l,chainId:d});const f=await this.getProvider();f&&(o&&(f.removeListener("connect",o),o=void 0),i||(i=this.onAccountsChanged.bind(this),f.on("accountsChanged",i)),s||(s=this.onChainChanged.bind(this),f.on("chainChanged",s)),a||(a=this.onDisconnect.bind(this),f.on("disconnect",a)))},async onDisconnect(u){const l=await this.getProvider();u&&u.code===1013&&l&&(await this.getAccounts()).length||(c.emitter.emit("disconnect"),l&&(s&&(l.removeListener("chainChanged",s),s=void 0),a&&(l.removeListener("disconnect",a),a=void 0),o||(o=this.onConnect.bind(this),l.on("connect",o))))}})}const jU={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(t){return t!=null&&t.coinbaseWalletExtension?t.coinbaseWalletExtension:Uh(t,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(t){return Uh(t,e=>{if(!e.isMetaMask||e.isBraveWallet&&!e._events&&!e._state)return!1;const n=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"];for(const r of n)if(e[r])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(t){var e,n;return(e=t==null?void 0:t.phantom)!=null&&e.ethereum?(n=t.phantom)==null?void 0:n.ethereum:Uh(t,"isPhantom")}}};function Uh(t,e){function n(i){return typeof e=="function"?e(i):typeof e=="string"?i[e]:!0}const r=t.ethereum;if(r!=null&&r.providers)return r.providers.find(i=>n(i));if(r&&n(r))return r}function UU(t){if(typeof window>"u")return;const e=n=>t(n.detail);return window.addEventListener("eip6963:announceProvider",e),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",e)}function BU(){const t=new Set;let e=[];const n=()=>UU(i=>{e.some(({info:s})=>s.uuid===i.info.uuid)||(e=[...e,i],t.forEach(s=>s(e,{added:[i]})))});let r=n();return{_listeners(){return t},clear(){t.forEach(i=>i([],{removed:[...e]})),e=[]},destroy(){this.clear(),t.clear(),r==null||r()},findProvider({rdns:i}){return e.find(s=>s.info.rdns===i)},getProviders(){return e},reset(){this.clear(),r==null||r(),r=n()},subscribe(i,{emitImmediately:s}={}){return t.add(i),s&&i(e,{added:e}),()=>t.delete(i)}}}const zU=t=>(e,n,r)=>{const i=r.subscribe;return r.subscribe=(o,a,c)=>{let u=o;if(a){const l=(c==null?void 0:c.equalityFn)||Object.is;let d=o(r.getState());u=f=>{const h=o(f);if(!l(d,h)){const m=d;a(d=h,m)}},c!=null&&c.fireImmediately&&a(d,d)}return i(u)},t(e,n,r)},VU=zU;function HU(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var s;const o=c=>c===null?null:JSON.parse(c,void 0),a=(s=n.getItem(i))!=null?s:null;return a instanceof Promise?a.then(o):o(a)},setItem:(i,s)=>n.setItem(i,JSON.stringify(s,void 0)),removeItem:i=>n.removeItem(i)}}const hv=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(r){return hv(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return hv(r)(n)}}}},WU=(t,e)=>(n,r,i)=>{let s={storage:HU(()=>localStorage),partialize:p=>p,version:0,merge:(p,g)=>({...g,...p}),...e},o=!1;const a=new Set,c=new Set;let u=s.storage;if(!u)return t((...p)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...p)},r,i);const l=()=>{const p=s.partialize({...r()});return u.setItem(s.name,{state:p,version:s.version})},d=i.setState;i.setState=(p,g)=>{d(p,g),l()};const f=t((...p)=>{n(...p),l()},r,i);i.getInitialState=()=>f;let h;const m=()=>{var p,g;if(!u)return;o=!1,a.forEach(v=>{var b;return v((b=r())!=null?b:f)});const y=((g=s.onRehydrateStorage)==null?void 0:g.call(s,(p=r())!=null?p:f))||void 0;return hv(u.getItem.bind(u))(s.name).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==s.version){if(s.migrate)return[!0,s.migrate(v.state,v.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,v.state];return[!1,void 0]}).then(v=>{var b;const[E,w]=v;if(h=s.merge(w,(b=r())!=null?b:f),n(h,!0),E)return l()}).then(()=>{y==null||y(h,void 0),h=r(),o=!0,c.forEach(v=>v(h))}).catch(v=>{y==null||y(void 0,v)})};return i.persist={setOptions:p=>{s={...s,...p},p.storage&&(u=p.storage)},clearStorage:()=>{u==null||u.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>m(),hasHydrated:()=>o,onHydrate:p=>(a.add(p),()=>{a.delete(p)}),onFinishHydration:p=>(c.add(p),()=>{c.delete(p)})},s.skipHydration||m(),h||f},qU=WU,$E=t=>{let e;const n=new Set,r=(u,l)=>{const d=typeof u=="function"?u(e):u;if(!Object.is(d,e)){const f=e;e=l??(typeof d!="object"||d===null)?d:Object.assign({},e,d),n.forEach(h=>h(e,f))}},i=()=>e,a={setState:r,getState:i,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u))},c=e=t(r,i,a);return a},uy=t=>t?$E(t):$E;var M1={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,u,l){this.fn=c,this.context=u,this.once=l||!1}function s(c,u,l,d,f){if(typeof l!="function")throw new TypeError("The listener must be a function");var h=new i(l,d||c,f),m=n?n+u:u;return c._events[m]?c._events[m].fn?c._events[m]=[c._events[m],h]:c._events[m].push(h):(c._events[m]=h,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var u=[],l,d;if(this._eventsCount===0)return u;for(d in l=this._events)e.call(l,d)&&u.push(n?d.slice(1):d);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(l)):u},a.prototype.listeners=function(u){var l=n?n+u:u,d=this._events[l];if(!d)return[];if(d.fn)return[d.fn];for(var f=0,h=d.length,m=new Array(h);f<h;f++)m[f]=d[f].fn;return m},a.prototype.listenerCount=function(u){var l=n?n+u:u,d=this._events[l];return d?d.fn?1:d.length:0},a.prototype.emit=function(u,l,d,f,h,m){var p=n?n+u:u;if(!this._events[p])return!1;var g=this._events[p],y=arguments.length,v,b;if(g.fn){switch(g.once&&this.removeListener(u,g.fn,void 0,!0),y){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,l),!0;case 3:return g.fn.call(g.context,l,d),!0;case 4:return g.fn.call(g.context,l,d,f),!0;case 5:return g.fn.call(g.context,l,d,f,h),!0;case 6:return g.fn.call(g.context,l,d,f,h,m),!0}for(b=1,v=new Array(y-1);b<y;b++)v[b-1]=arguments[b];g.fn.apply(g.context,v)}else{var E=g.length,w;for(b=0;b<E;b++)switch(g[b].once&&this.removeListener(u,g[b].fn,void 0,!0),y){case 1:g[b].fn.call(g[b].context);break;case 2:g[b].fn.call(g[b].context,l);break;case 3:g[b].fn.call(g[b].context,l,d);break;case 4:g[b].fn.call(g[b].context,l,d,f);break;default:if(!v)for(w=1,v=new Array(y-1);w<y;w++)v[w-1]=arguments[w];g[b].fn.apply(g[b].context,v)}}return!0},a.prototype.on=function(u,l,d){return s(this,u,l,d,!1)},a.prototype.once=function(u,l,d){return s(this,u,l,d,!0)},a.prototype.removeListener=function(u,l,d,f){var h=n?n+u:u;if(!this._events[h])return this;if(!l)return o(this,h),this;var m=this._events[h];if(m.fn)m.fn===l&&(!f||m.once)&&(!d||m.context===d)&&o(this,h);else{for(var p=0,g=[],y=m.length;p<y;p++)(m[p].fn!==l||f&&!m[p].once||d&&m[p].context!==d)&&g.push(m[p]);g.length?this._events[h]=g.length===1?g[0]:g:o(this,h)}return this},a.prototype.removeAllListeners=function(u){var l;return u?(l=n?n+u:u,this._events[l]&&o(this,l)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a})(M1);var GU=M1.exports;const ZU=ec(GU);class YU{constructor(e){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new ZU})}on(e,n){this._emitter.on(e,n)}once(e,n){this._emitter.once(e,n)}off(e,n){this._emitter.off(e,n)}emit(e,...n){const r=n[0];this._emitter.emit(e,{uid:this.uid,...r})}listenerCount(e){return this._emitter.listenerCount(e)}}function KU(t){return new YU(t)}function JU(t,e){return JSON.parse(t,(n,r)=>{let i=r;return(i==null?void 0:i.__type)==="bigint"&&(i=BigInt(i.value)),(i==null?void 0:i.__type)==="Map"&&(i=new Map(i.value)),(e==null?void 0:e(n,i))??i})}function jE(t,e){return t.slice(0,e).join(".")||"."}function UE(t,e){const{length:n}=t;for(let r=0;r<n;++r)if(t[r]===e)return r+1;return 0}function XU(t,e){const n=typeof t=="function",r=typeof e=="function",i=[],s=[];return function(a,c){if(typeof c=="object")if(i.length){const u=UE(i,this);u===0?i[i.length]=this:(i.splice(u),s.splice(u)),s[s.length]=a;const l=UE(i,c);if(l!==0)return r?e.call(this,a,c,jE(s,l)):`[ref=${jE(s,l)}]`}else i[0]=c,s[0]=a;return n?t.call(this,a,c):c}}function QU(t,e,n,r){return JSON.stringify(t,XU((i,s)=>{let o=s;return typeof o=="bigint"&&(o={__type:"bigint",value:s.toString()}),o instanceof Map&&(o={__type:"Map",value:Array.from(s.entries())}),(e==null?void 0:e(i,o))??o},r),n??void 0)}function e3(t){const{deserialize:e=JU,key:n="wagmi",serialize:r=QU,storage:i=L1}=t;function s(o){return o instanceof Promise?o.then(a=>a).catch(()=>null):o}return{...i,key:n,async getItem(o,a){const c=i.getItem(`${n}.${o}`),u=await s(c);return u?e(u)??null:a??null},async setItem(o,a){const c=`${n}.${o}`;a===null?await s(i.removeItem(c)):await s(i.setItem(c,r(a)))},async removeItem(o){await s(i.removeItem(`${n}.${o}`))}}}const L1={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function t3(){const t=typeof window<"u"&&window.localStorage?window.localStorage:L1;return{getItem(e){return t.getItem(e)},removeItem(e){t.removeItem(e)},setItem(e,n){try{t.setItem(e,n)}catch{}}}}const pv=256;let ih=pv,sh;function n3(t=11){if(!sh||ih+t>pv*2){sh="",ih=0;for(let e=0;e<pv;e++)sh+=(256+Math.random()*256|0).toString(16).substring(1)}return sh.substring(ih,ih+++t)}function r3(t){const{multiInjectedProviderDiscovery:e=!0,storage:n=e3({storage:t3()}),syncConnectedChain:r=!0,ssr:i=!1,...s}=t,o=typeof window<"u"&&e?BU():void 0,a=uy(()=>s.chains),c=uy(()=>{const w=[],x=new Set;for(const _ of s.connectors??[]){const k=u(_);if(w.push(k),!i&&k.rdns){const R=typeof k.rdns=="string"?[k.rdns]:k.rdns;for(const F of R)x.add(F)}}if(!i&&o){const _=o.getProviders();for(const k of _)x.has(k.info.rdns)||w.push(u(l(k)))}return w});function u(w){var k;const x=KU(n3()),_={...w({emitter:x,chains:a.getState(),storage:n,transports:s.transports}),emitter:x,uid:x.uid};return x.on("connect",b),(k=_.setup)==null||k.call(_),_}function l(w){const{info:x}=w,_=w.provider;return d_({target:{...x,id:x.rdns,provider:_}})}const d=new Map;function f(w={}){const x=w.chainId??g.getState().chainId,_=a.getState().find(R=>R.id===x);if(w.chainId&&!_)throw new dv;{const R=d.get(g.getState().chainId);if(R&&!_)return R;if(!_)throw new dv}{const R=d.get(x);if(R)return R}let k;if(s.client)k=s.client({chain:_});else{const R=_.id,F=a.getState().map(L=>L.id),V={},T=Object.entries(s);for(const[L,S]of T)if(!(L==="chains"||L==="client"||L==="connectors"||L==="transports"))if(typeof S=="object")if(R in S)V[L]=S[R];else{if(F.some(N=>N in S))continue;V[L]=S}else V[L]=S;k=PU({...V,chain:_,batch:V.batch??{multicall:!0},transport:L=>s.transports[R]({...L,connectors:c})})}return d.set(x,k),k}function h(){return{chainId:a.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let m;const p="0.0.0-canary-";jh.startsWith(p)?m=Number.parseInt(jh.replace(p,"")):m=Number.parseInt(jh.split(".")[0]??"0");const g=uy(VU(n?qU(h,{migrate(w,x){if(x===m)return w;const _=h(),k=y(w,_.chainId);return{..._,chainId:k}},name:"store",partialize(w){return{connections:{__type:"Map",value:Array.from(w.connections.entries()).map(([x,_])=>{const{id:k,name:R,type:F,uid:V}=_.connector;return[x,{..._,connector:{id:k,name:R,type:F,uid:V}}]})},chainId:w.chainId,current:w.current}},merge(w,x){typeof w=="object"&&w&&"status"in w&&delete w.status;const _=y(w,x.chainId);return{...x,...w,chainId:_}},skipHydration:i,storage:n,version:m}):h));g.setState(h());function y(w,x){return w&&typeof w=="object"&&"chainId"in w&&typeof w.chainId=="number"&&a.getState().some(_=>_.id===w.chainId)?w.chainId:x}r&&g.subscribe(({connections:w,current:x})=>{var _;return x?(_=w.get(x))==null?void 0:_.chainId:void 0},w=>{if(a.getState().some(_=>_.id===w))return g.setState(_=>({..._,chainId:w??_.chainId}))}),o==null||o.subscribe(w=>{const x=new Set,_=new Set;for(const R of c.getState())if(x.add(R.id),R.rdns){const F=typeof R.rdns=="string"?[R.rdns]:R.rdns;for(const V of F)_.add(V)}const k=[];for(const R of w){if(_.has(R.info.rdns))continue;const F=u(l(R));x.has(F.id)||k.push(F)}n&&!g.persist.hasHydrated()||c.setState(R=>[...R,...k],!0)});function v(w){g.setState(x=>{const _=x.connections.get(w.uid);return _?{...x,connections:new Map(x.connections).set(w.uid,{accounts:w.accounts??_.accounts,chainId:w.chainId??_.chainId,connector:_.connector})}:x})}function b(w){g.getState().status==="connecting"||g.getState().status==="reconnecting"||g.setState(x=>{const _=c.getState().find(k=>k.uid===w.uid);return _?(_.emitter.listenerCount("connect")&&_.emitter.off("connect",v),_.emitter.listenerCount("change")||_.emitter.on("change",v),_.emitter.listenerCount("disconnect")||_.emitter.on("disconnect",E),{...x,connections:new Map(x.connections).set(w.uid,{accounts:w.accounts,chainId:w.chainId,connector:_}),current:w.uid,status:"connected"}):x})}function E(w){g.setState(x=>{const _=x.connections.get(w.uid);if(_){const R=_.connector;R.emitter.listenerCount("change")&&_.connector.emitter.off("change",v),R.emitter.listenerCount("disconnect")&&_.connector.emitter.off("disconnect",E),R.emitter.listenerCount("connect")||_.connector.emitter.on("connect",b)}if(x.connections.delete(w.uid),x.connections.size===0)return{...x,connections:new Map,current:null,status:"disconnected"};const k=x.connections.values().next().value;return{...x,connections:new Map(x.connections),current:k.connector.uid}})}return{get chains(){return a.getState()},get connectors(){return c.getState()},storage:n,getClient:f,get state(){return g.getState()},setState(w){let x;typeof w=="function"?x=w(g.getState()):x=w;const _=h();typeof x!="object"&&(x=_),Object.keys(_).some(R=>!(R in x))&&(x=_),g.setState(x,!0)},subscribe(w,x,_){return g.subscribe(w,x,_?{..._,fireImmediately:_.emitImmediately}:void 0)},_internal:{mipd:o,store:g,ssr:!!i,syncConnectedChain:r,transports:s.transports,chains:{setState(w){const x=typeof w=="function"?w(a.getState()):w;if(x.length!==0)return a.setState(x,!0)},subscribe(w){return a.subscribe(w)}},connectors:{providerDetailToConnector:l,setup:u,setState(w){return c.setState(typeof w=="function"?w(c.getState()):w,!0)},subscribe(w){return c.subscribe(w)}},events:{change:v,connect:b,disconnect:E}}}}function i3(t,e){const{initialState:n,reconnectOnMount:r}=e;return n&&!t._internal.store.persist.hasHydrated()&&t.setState({...n,chainId:t.chains.some(i=>i.id===n.chainId)?n.chainId:t.chains[0].id,connections:r?n.connections:new Map,status:r?"reconnecting":"disconnected"}),{async onMount(){t._internal.ssr&&(await t._internal.store.persist.rehydrate(),t._internal.mipd&&t._internal.connectors.setState(i=>{var c;const s=new Set;for(const u of i??[])if(u.rdns){const l=Array.isArray(u.rdns)?u.rdns:[u.rdns];for(const d of l)s.add(d)}const o=[],a=((c=t._internal.mipd)==null?void 0:c.getProviders())??[];for(const u of a){if(s.has(u.info.rdns))continue;const l=t._internal.connectors.providerDetailToConnector(u),d=t._internal.connectors.setup(l);o.push(d)}return[...i,...o]})),r?$U(t):t.storage&&t.setState(i=>({...i,connections:new Map}))}}}function s3(t){const{children:e,config:n,initialState:r,reconnectOnMount:i=!0}=t,{onMount:s}=i3(n,{initialState:r,reconnectOnMount:i});n._internal.ssr||s();const o=qt(!0);return Dt(()=>{if(o.current&&n._internal.ssr)return s(),()=>{o.current=!1}},[]),e}const o3=Lu(void 0);function a3(t){const{children:e,config:n}=t,r={value:n};return Ea(s3,t,Ea(o3.Provider,r,e))}var qm=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Gm=typeof window>"u"||"Deno"in globalThis;function fi(){}function c3(t,e){return typeof t=="function"?t(e):t}function u3(t){return typeof t=="number"&&t>=0&&t!==1/0}function l3(t,e){return Math.max(t+(e||0)-Date.now(),0)}function BE(t,e){return typeof t=="function"?t(e):t}function d3(t,e){return typeof t=="function"?t(e):t}function zE(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=t;if(o){if(r){if(e.queryHash!==f_(o,e.options))return!1}else if(!pd(e.queryKey,o))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||i&&i!==e.state.fetchStatus||s&&!s(e))}function VE(t,e){const{exact:n,status:r,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(hd(e.options.mutationKey)!==hd(s))return!1}else if(!pd(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function f_(t,e){return((e==null?void 0:e.queryKeyHashFn)||hd)(t)}function hd(t){return JSON.stringify(t,(e,n)=>mv(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function pd(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(n=>!pd(t[n],e[n])):!1}function F1(t,e){if(t===e)return t;const n=HE(t)&&HE(e);if(n||mv(t)&&mv(e)){const r=n?t:Object.keys(t),i=r.length,s=n?e:Object.keys(e),o=s.length,a=n?[]:{};let c=0;for(let u=0;u<o;u++){const l=n?u:s[u];(!n&&r.includes(l)||n)&&t[l]===void 0&&e[l]===void 0?(a[l]=void 0,c++):(a[l]=F1(t[l],e[l]),a[l]===t[l]&&t[l]!==void 0&&c++)}return i===o&&c===i?t:a}return e}function Die(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function HE(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function mv(t){if(!WE(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!WE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function WE(t){return Object.prototype.toString.call(t)==="[object Object]"}function f3(t){return new Promise(e=>{setTimeout(e,t)})}function h3(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?F1(t,e):e}function p3(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function m3(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var h_=Symbol();function $1(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===h_?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var va,Eo,iu,MT,g3=(MT=class extends qm{constructor(){super();bt(this,va);bt(this,Eo);bt(this,iu);ht(this,iu,e=>{if(!Gm&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ce(this,Eo)||this.setEventListener(ce(this,iu))}onUnsubscribe(){var e;this.hasListeners()||((e=ce(this,Eo))==null||e.call(this),ht(this,Eo,void 0))}setEventListener(e){var n;ht(this,iu,e),(n=ce(this,Eo))==null||n.call(this),ht(this,Eo,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){ce(this,va)!==e&&(ht(this,va,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof ce(this,va)=="boolean"?ce(this,va):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},va=new WeakMap,Eo=new WeakMap,iu=new WeakMap,MT),j1=new g3,su,So,ou,LT,y3=(LT=class extends qm{constructor(){super();bt(this,su,!0);bt(this,So);bt(this,ou);ht(this,ou,e=>{if(!Gm&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){ce(this,So)||this.setEventListener(ce(this,ou))}onUnsubscribe(){var e;this.hasListeners()||((e=ce(this,So))==null||e.call(this),ht(this,So,void 0))}setEventListener(e){var n;ht(this,ou,e),(n=ce(this,So))==null||n.call(this),ht(this,So,e(this.setOnline.bind(this)))}setOnline(e){ce(this,su)!==e&&(ht(this,su,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return ce(this,su)}},su=new WeakMap,So=new WeakMap,ou=new WeakMap,LT),_p=new y3;function v3(){let t,e;const n=new Promise((i,s)=>{t=i,e=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}function b3(t){return Math.min(1e3*2**t,3e4)}function U1(t){return(t??"online")==="online"?_p.isOnline():!0}var B1=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function ly(t){return t instanceof B1}function z1(t){let e=!1,n=0,r=!1,i;const s=v3(),o=p=>{var g;r||(f(new B1(p)),(g=t.abort)==null||g.call(t))},a=()=>{e=!0},c=()=>{e=!1},u=()=>j1.isFocused()&&(t.networkMode==="always"||_p.isOnline())&&t.canRun(),l=()=>U1(t.networkMode)&&t.canRun(),d=p=>{var g;r||(r=!0,(g=t.onSuccess)==null||g.call(t,p),i==null||i(),s.resolve(p))},f=p=>{var g;r||(r=!0,(g=t.onError)==null||g.call(t,p),i==null||i(),s.reject(p))},h=()=>new Promise(p=>{var g;i=y=>{(r||u())&&p(y)},(g=t.onPause)==null||g.call(t)}).then(()=>{var p;i=void 0,r||(p=t.onContinue)==null||p.call(t)}),m=()=>{if(r)return;let p;const g=n===0?t.initialPromise:void 0;try{p=g??t.fn()}catch(y){p=Promise.reject(y)}Promise.resolve(p).then(d).catch(y=>{var x;if(r)return;const v=t.retry??(Gm?0:3),b=t.retryDelay??b3,E=typeof b=="function"?b(n,y):b,w=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,y);if(e||!w){f(y);return}n++,(x=t.onFail)==null||x.call(t,n,y),f3(E).then(()=>u()?void 0:h()).then(()=>{e?f(y):m()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:c,canStart:l,start:()=>(l()?m():h().then(m),s)}}function _3(){let t=[],e=0,n=a=>{a()},r=a=>{a()},i=a=>setTimeout(a,0);const s=a=>{e?t.push(a):i(()=>{n(a)})},o=()=>{const a=t;t=[],a.length&&i(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;e++;try{c=a()}finally{e--,e||o()}return c},batchCalls:a=>(...c)=>{s(()=>{a(...c)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var dr=_3(),ba,FT,V1=(FT=class{constructor(){bt(this,ba)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),u3(this.gcTime)&&ht(this,ba,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Gm?1/0:5*60*1e3))}clearGcTimeout(){ce(this,ba)&&(clearTimeout(ce(this,ba)),ht(this,ba,void 0))}},ba=new WeakMap,FT),au,cu,Qr,nr,uf,_a,hi,xs,$T,w3=($T=class extends V1{constructor(e){super();bt(this,hi);bt(this,au);bt(this,cu);bt(this,Qr);bt(this,nr);bt(this,uf);bt(this,_a);ht(this,_a,!1),ht(this,uf,e.defaultOptions),this.setOptions(e.options),this.observers=[],ht(this,Qr,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,ht(this,au,S3(this.options)),this.state=e.state??ce(this,au),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=ce(this,nr))==null?void 0:e.promise}setOptions(e){this.options={...ce(this,uf),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ce(this,Qr).remove(this)}setData(e,n){const r=h3(this.state.data,e,this.options);return sn(this,hi,xs).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){sn(this,hi,xs).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=ce(this,nr))==null?void 0:r.promise;return(i=ce(this,nr))==null||i.cancel(e),n?n.then(fi).catch(fi):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ce(this,au))}isActive(){return this.observers.some(e=>d3(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===h_||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!l3(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=ce(this,nr))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=ce(this,nr))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),ce(this,Qr).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(ce(this,nr)&&(ce(this,_a)?ce(this,nr).cancel({revert:!0}):ce(this,nr).cancelRetry()),this.scheduleGc()),ce(this,Qr).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||sn(this,hi,xs).call(this,{type:"invalidate"})}fetch(e,n){var c,u,l;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ce(this,nr))return ce(this,nr).continueRetry(),ce(this,nr).promise}if(e&&this.setOptions(e),!this.options.queryFn){const d=this.observers.find(f=>f.options.queryFn);d&&this.setOptions(d.options)}const r=new AbortController,i=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(ht(this,_a,!0),r.signal)})},s=()=>{const d=$1(this.options,n),f={queryKey:this.queryKey,meta:this.meta};return i(f),ht(this,_a,!1),this.options.persister?this.options.persister(d,f,this):d(f)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(o),(c=this.options.behavior)==null||c.onFetch(o,this),ht(this,cu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=o.fetchOptions)==null?void 0:u.meta))&&sn(this,hi,xs).call(this,{type:"fetch",meta:(l=o.fetchOptions)==null?void 0:l.meta});const a=d=>{var f,h,m,p;ly(d)&&d.silent||sn(this,hi,xs).call(this,{type:"error",error:d}),ly(d)||((h=(f=ce(this,Qr).config).onError)==null||h.call(f,d,this),(p=(m=ce(this,Qr).config).onSettled)==null||p.call(m,this.state.data,d,this)),this.scheduleGc()};return ht(this,nr,z1({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var f,h,m,p;if(d===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(g){a(g);return}(h=(f=ce(this,Qr).config).onSuccess)==null||h.call(f,d,this),(p=(m=ce(this,Qr).config).onSettled)==null||p.call(m,d,this.state.error,this),this.scheduleGc()},onError:a,onFail:(d,f)=>{sn(this,hi,xs).call(this,{type:"failed",failureCount:d,error:f})},onPause:()=>{sn(this,hi,xs).call(this,{type:"pause"})},onContinue:()=>{sn(this,hi,xs).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),ce(this,nr).start()}},au=new WeakMap,cu=new WeakMap,Qr=new WeakMap,nr=new WeakMap,uf=new WeakMap,_a=new WeakMap,hi=new WeakSet,xs=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...E3(r.data,this.options),fetchMeta:e.meta??null};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return ly(i)&&i.revert&&ce(this,cu)?{...ce(this,cu),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),dr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),ce(this,Qr).notify({query:this,type:"updated",action:e})})},$T);function E3(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:U1(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function S3(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Bi,jT,x3=(jT=class extends qm{constructor(e={}){super();bt(this,Bi);this.config=e,ht(this,Bi,new Map)}build(e,n,r){const i=n.queryKey,s=n.queryHash??f_(i,n);let o=this.get(s);return o||(o=new w3({cache:this,queryKey:i,queryHash:s,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){ce(this,Bi).has(e.queryHash)||(ce(this,Bi).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=ce(this,Bi).get(e.queryHash);n&&(e.destroy(),n===e&&ce(this,Bi).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){dr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return ce(this,Bi).get(e)}getAll(){return[...ce(this,Bi).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>zE(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>zE(e,r)):n}notify(e){dr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){dr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){dr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Bi=new WeakMap,jT),zi,ar,wa,Vi,lo,UT,T3=(UT=class extends V1{constructor(e){super();bt(this,Vi);bt(this,zi);bt(this,ar);bt(this,wa);this.mutationId=e.mutationId,ht(this,ar,e.mutationCache),ht(this,zi,[]),this.state=e.state||I3(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){ce(this,zi).includes(e)||(ce(this,zi).push(e),this.clearGcTimeout(),ce(this,ar).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){ht(this,zi,ce(this,zi).filter(n=>n!==e)),this.scheduleGc(),ce(this,ar).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){ce(this,zi).length||(this.state.status==="pending"?this.scheduleGc():ce(this,ar).remove(this))}continue(){var e;return((e=ce(this,wa))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,s,o,a,c,u,l,d,f,h,m,p,g,y,v,b,E,w,x,_;ht(this,wa,z1({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(k,R)=>{sn(this,Vi,lo).call(this,{type:"failed",failureCount:k,error:R})},onPause:()=>{sn(this,Vi,lo).call(this,{type:"pause"})},onContinue:()=>{sn(this,Vi,lo).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ce(this,ar).canRun(this)}));const n=this.state.status==="pending",r=!ce(this,wa).canStart();try{if(!n){sn(this,Vi,lo).call(this,{type:"pending",variables:e,isPaused:r}),await((s=(i=ce(this,ar).config).onMutate)==null?void 0:s.call(i,e,this));const R=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,e));R!==this.state.context&&sn(this,Vi,lo).call(this,{type:"pending",context:R,variables:e,isPaused:r})}const k=await ce(this,wa).start();return await((u=(c=ce(this,ar).config).onSuccess)==null?void 0:u.call(c,k,e,this.state.context,this)),await((d=(l=this.options).onSuccess)==null?void 0:d.call(l,k,e,this.state.context)),await((h=(f=ce(this,ar).config).onSettled)==null?void 0:h.call(f,k,null,this.state.variables,this.state.context,this)),await((p=(m=this.options).onSettled)==null?void 0:p.call(m,k,null,e,this.state.context)),sn(this,Vi,lo).call(this,{type:"success",data:k}),k}catch(k){try{throw await((y=(g=ce(this,ar).config).onError)==null?void 0:y.call(g,k,e,this.state.context,this)),await((b=(v=this.options).onError)==null?void 0:b.call(v,k,e,this.state.context)),await((w=(E=ce(this,ar).config).onSettled)==null?void 0:w.call(E,void 0,k,this.state.variables,this.state.context,this)),await((_=(x=this.options).onSettled)==null?void 0:_.call(x,void 0,k,e,this.state.context)),k}finally{sn(this,Vi,lo).call(this,{type:"error",error:k})}}finally{ce(this,ar).runNext(this)}}},zi=new WeakMap,ar=new WeakMap,wa=new WeakMap,Vi=new WeakSet,lo=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),dr.batch(()=>{ce(this,zi).forEach(r=>{r.onMutationUpdate(e)}),ce(this,ar).notify({mutation:this,type:"updated",action:e})})},UT);function I3(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Rs,pi,lf,BT,O3=(BT=class extends qm{constructor(e={}){super();bt(this,Rs);bt(this,pi);bt(this,lf);this.config=e,ht(this,Rs,new Set),ht(this,pi,new Map),ht(this,lf,0)}build(e,n,r){const i=new T3({mutationCache:this,mutationId:++Uf(this,lf)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){ce(this,Rs).add(e);const n=oh(e);if(typeof n=="string"){const r=ce(this,pi).get(n);r?r.push(e):ce(this,pi).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(ce(this,Rs).delete(e)){const n=oh(e);if(typeof n=="string"){const r=ce(this,pi).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&ce(this,pi).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=oh(e);if(typeof n=="string"){const r=ce(this,pi).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const n=oh(e);if(typeof n=="string"){const i=(r=ce(this,pi).get(n))==null?void 0:r.find(s=>s!==e&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){dr.batch(()=>{ce(this,Rs).forEach(e=>{this.notify({type:"removed",mutation:e})}),ce(this,Rs).clear(),ce(this,pi).clear()})}getAll(){return Array.from(ce(this,Rs))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>VE(n,r))}findAll(e={}){return this.getAll().filter(n=>VE(e,n))}notify(e){dr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return dr.batch(()=>Promise.all(e.map(n=>n.continue().catch(fi))))}},Rs=new WeakMap,pi=new WeakMap,lf=new WeakMap,BT);function oh(t){var e;return(e=t.options.scope)==null?void 0:e.id}function qE(t){return{onFetch:(e,n)=>{var l,d,f,h,m;const r=e.options,i=(f=(d=(l=e.fetchOptions)==null?void 0:l.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,s=((h=e.state.data)==null?void 0:h.pages)||[],o=((m=e.state.data)==null?void 0:m.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let p=!1;const g=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(e.signal.aborted?p=!0:e.signal.addEventListener("abort",()=>{p=!0}),e.signal)})},y=$1(e.options,e.fetchOptions),v=async(b,E,w)=>{if(p)return Promise.reject();if(E==null&&b.pages.length)return Promise.resolve(b);const x={queryKey:e.queryKey,pageParam:E,direction:w?"backward":"forward",meta:e.options.meta};g(x);const _=await y(x),{maxPages:k}=e.options,R=w?m3:p3;return{pages:R(b.pages,_,k),pageParams:R(b.pageParams,E,k)}};if(i&&s.length){const b=i==="backward",E=b?C3:GE,w={pages:s,pageParams:o},x=E(r,w);a=await v(w,x,b)}else{const b=t??s.length;do{const E=c===0?o[0]??r.initialPageParam:GE(r,a);if(c>0&&E==null)break;a=await v(a,E),c++}while(c<b)}return a};e.options.persister?e.fetchFn=()=>{var p,g;return(g=(p=e.options).persister)==null?void 0:g.call(p,u,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=u}}}function GE(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function C3(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var wn,xo,To,uu,lu,Io,du,fu,zT,k3=(zT=class{constructor(t={}){bt(this,wn);bt(this,xo);bt(this,To);bt(this,uu);bt(this,lu);bt(this,Io);bt(this,du);bt(this,fu);ht(this,wn,t.queryCache||new x3),ht(this,xo,t.mutationCache||new O3),ht(this,To,t.defaultOptions||{}),ht(this,uu,new Map),ht(this,lu,new Map),ht(this,Io,0)}mount(){Uf(this,Io)._++,ce(this,Io)===1&&(ht(this,du,j1.subscribe(async t=>{t&&(await this.resumePausedMutations(),ce(this,wn).onFocus())})),ht(this,fu,_p.subscribe(async t=>{t&&(await this.resumePausedMutations(),ce(this,wn).onOnline())})))}unmount(){var t,e;Uf(this,Io)._--,ce(this,Io)===0&&((t=ce(this,du))==null||t.call(this),ht(this,du,void 0),(e=ce(this,fu))==null||e.call(this),ht(this,fu,void 0))}isFetching(t){return ce(this,wn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return ce(this,xo).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=ce(this,wn).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=ce(this,wn).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(BE(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return ce(this,wn).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=ce(this,wn).get(r.queryHash),s=i==null?void 0:i.state.data,o=c3(e,s);if(o!==void 0)return ce(this,wn).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return dr.batch(()=>ce(this,wn).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=ce(this,wn).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=ce(this,wn);dr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=ce(this,wn),r={type:"active",...t};return dr.batch(()=>(n.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(r,e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=dr.batch(()=>ce(this,wn).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(fi).catch(fi)}invalidateQueries(t,e={}){return dr.batch(()=>{if(ce(this,wn).findAll(t).forEach(r=>{r.invalidate()}),(t==null?void 0:t.refetchType)==="none")return Promise.resolve();const n={...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"};return this.refetchQueries(n,e)})}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=dr.batch(()=>ce(this,wn).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(fi)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(fi)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=ce(this,wn).build(this,e);return n.isStaleByTime(BE(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(fi).catch(fi)}fetchInfiniteQuery(t){return t.behavior=qE(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(fi).catch(fi)}ensureInfiniteQueryData(t){return t.behavior=qE(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return _p.isOnline()?ce(this,xo).resumePausedMutations():Promise.resolve()}getQueryCache(){return ce(this,wn)}getMutationCache(){return ce(this,xo)}getDefaultOptions(){return ce(this,To)}setDefaultOptions(t){ht(this,To,t)}setQueryDefaults(t,e){ce(this,uu).set(hd(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...ce(this,uu).values()],n={};return e.forEach(r=>{pd(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){ce(this,lu).set(hd(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...ce(this,lu).values()];let n={};return e.forEach(r=>{pd(t,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...ce(this,To).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=f_(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===h_&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...ce(this,To).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){ce(this,wn).clear(),ce(this,xo).clear()}},wn=new WeakMap,xo=new WeakMap,To=new WeakMap,uu=new WeakMap,lu=new WeakMap,Io=new WeakMap,du=new WeakMap,fu=new WeakMap,zT),H1=Y.createContext(void 0),Rie=t=>{const e=Y.useContext(H1);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},D3=({client:t,children:e})=>(Y.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),P(H1.Provider,{value:t,children:e}));const Nie="SYNCING",Aie="SUCCESS",Pie="CONFLICT",Mie="MISSING",R3="ERROR",Lie="INITIAL_SYNC";var mf=t=>t.type==="checkbox",da=t=>t instanceof Date,ur=t=>t==null;const W1=t=>typeof t=="object";var kn=t=>!ur(t)&&!Array.isArray(t)&&W1(t)&&!da(t),q1=t=>kn(t)&&t.target?mf(t.target)?t.target.checked:t.target.value:t,N3=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,G1=(t,e)=>t.has(N3(e)),A3=t=>{const e=t.constructor&&t.constructor.prototype;return kn(e)&&e.hasOwnProperty("isPrototypeOf")},p_=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function wr(t){let e;const n=Array.isArray(t),r=typeof FileList<"u"?t instanceof FileList:!1;if(t instanceof Date)e=new Date(t);else if(t instanceof Set)e=new Set(t);else if(!(p_&&(t instanceof Blob||r))&&(n||kn(t)))if(e=n?[]:{},!n&&!A3(t))e=t;else for(const i in t)t.hasOwnProperty(i)&&(e[i]=wr(t[i]));else return t;return e}var Zm=t=>Array.isArray(t)?t.filter(Boolean):[],On=t=>t===void 0,Re=(t,e,n)=>{if(!e||!kn(t))return n;const r=Zm(e.split(/[,[\].]+?/)).reduce((i,s)=>ur(i)?i:i[s],t);return On(r)||r===t?On(t[e])?n:t[e]:r},ei=t=>typeof t=="boolean",m_=t=>/^\w*$/.test(t),Z1=t=>Zm(t.replace(/["|']|\]/g,"").split(/\.|\[/)),nn=(t,e,n)=>{let r=-1;const i=m_(e)?[e]:Z1(e),s=i.length,o=s-1;for(;++r<s;){const a=i[r];let c=n;if(r!==o){const u=t[a];c=kn(u)||Array.isArray(u)?u:isNaN(+i[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;t[a]=c,t=t[a]}return t};const wp={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},bi={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Ss={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},P3=$e.createContext(null),g_=()=>$e.useContext(P3);var Y1=(t,e,n,r=!0)=>{const i={defaultValues:e._defaultValues};for(const s in t)Object.defineProperty(i,s,{get:()=>{const o=s;return e._proxyFormState[o]!==bi.all&&(e._proxyFormState[o]=!r||bi.all),n&&(n[o]=!0),t[o]}});return i},Er=t=>kn(t)&&!Object.keys(t).length,K1=(t,e,n,r)=>{n(t);const{name:i,...s}=t;return Er(s)||Object.keys(s).length>=Object.keys(e).length||Object.keys(s).find(o=>e[o]===(!r||bi.all))},Fl=t=>Array.isArray(t)?t:[t],J1=(t,e,n)=>!t||!e||t===e||Fl(t).some(r=>r&&(n?r===e:r.startsWith(e)||e.startsWith(r)));function y_(t){const e=$e.useRef(t);e.current=t,$e.useEffect(()=>{const n=!t.disabled&&e.current.subject&&e.current.subject.subscribe({next:e.current.next});return()=>{n&&n.unsubscribe()}},[t.disabled])}function M3(t){const e=g_(),{control:n=e.control,disabled:r,name:i,exact:s}=t,[o,a]=$e.useState(n._formState),c=$e.useRef(!0),u=$e.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),l=$e.useRef(i);return l.current=i,y_({disabled:r,next:d=>c.current&&J1(l.current,d.name,s)&&K1(d,u.current,n._updateFormState)&&a({...n._formState,...d}),subject:n._subjects.state}),$e.useEffect(()=>(c.current=!0,u.current.isValid&&n._updateValid(!0),()=>{c.current=!1}),[n]),$e.useMemo(()=>Y1(o,n,u.current,!1),[o,n])}var Xi=t=>typeof t=="string",X1=(t,e,n,r,i)=>Xi(t)?(r&&e.watch.add(t),Re(n,t,i)):Array.isArray(t)?t.map(s=>(r&&e.watch.add(s),Re(n,s))):(r&&(e.watchAll=!0),n);function L3(t){const e=g_(),{control:n=e.control,name:r,defaultValue:i,disabled:s,exact:o}=t,a=$e.useRef(r);a.current=r,y_({disabled:s,subject:n._subjects.values,next:l=>{J1(a.current,l.name,o)&&u(wr(X1(a.current,n._names,l.values||n._formValues,!1,i)))}});const[c,u]=$e.useState(n._getWatch(r,i));return $e.useEffect(()=>n._removeUnmounted()),c}function F3(t){const e=g_(),{name:n,disabled:r,control:i=e.control,shouldUnregister:s}=t,o=G1(i._names.array,n),a=L3({control:i,name:n,defaultValue:Re(i._formValues,n,Re(i._defaultValues,n,t.defaultValue)),exact:!0}),c=M3({control:i,name:n,exact:!0}),u=$e.useRef(i.register(n,{...t.rules,value:a,...ei(t.disabled)?{disabled:t.disabled}:{}})),l=$e.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Re(c.errors,n)},isDirty:{enumerable:!0,get:()=>!!Re(c.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Re(c.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Re(c.validatingFields,n)},error:{enumerable:!0,get:()=>Re(c.errors,n)}}),[c,n]),d=$e.useMemo(()=>({name:n,value:a,...ei(r)||c.disabled?{disabled:c.disabled||r}:{},onChange:f=>u.current.onChange({target:{value:q1(f),name:n},type:wp.CHANGE}),onBlur:()=>u.current.onBlur({target:{value:Re(i._formValues,n),name:n},type:wp.BLUR}),ref:f=>{const h=Re(i._fields,n);h&&f&&(h._f.ref={focus:()=>f.focus(),select:()=>f.select(),setCustomValidity:m=>f.setCustomValidity(m),reportValidity:()=>f.reportValidity()})}}),[n,i._formValues,r,c.disabled,a,i._fields]);return $e.useEffect(()=>{const f=i._options.shouldUnregister||s,h=(m,p)=>{const g=Re(i._fields,m);g&&g._f&&(g._f.mount=p)};if(h(n,!0),f){const m=wr(Re(i._options.defaultValues,n));nn(i._defaultValues,n,m),On(Re(i._formValues,n))&&nn(i._formValues,n,m)}return!o&&i.register(n),()=>{(o?f&&!i._state.action:f)?i.unregister(n):h(n,!1)}},[n,i,o,s]),$e.useEffect(()=>{i._updateDisabledField({disabled:r,fields:i._fields,name:n})},[r,n,i]),$e.useMemo(()=>({field:d,formState:c,fieldState:l}),[d,c,l])}const $3=t=>t.render(F3(t));var j3=(t,e,n,r,i)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:i||!0}}:{},ZE=t=>({isOnSubmit:!t||t===bi.onSubmit,isOnBlur:t===bi.onBlur,isOnChange:t===bi.onChange,isOnAll:t===bi.all,isOnTouch:t===bi.onTouched}),YE=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const $l=(t,e,n,r)=>{for(const i of n||Object.keys(t)){const s=Re(t,i);if(s){const{_f:o,...a}=s;if(o){if(o.refs&&o.refs[0]&&e(o.refs[0],i)&&!r)return!0;if(o.ref&&e(o.ref,o.name)&&!r)return!0;if($l(a,e))break}else if(kn(a)&&$l(a,e))break}}};var U3=(t,e,n)=>{const r=Fl(Re(t,n));return nn(r,"root",e[n]),nn(t,n,r),t},v_=t=>t.type==="file",Ki=t=>typeof t=="function",Ep=t=>{if(!p_)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},Bh=t=>Xi(t),b_=t=>t.type==="radio",Sp=t=>t instanceof RegExp;const KE={value:!1,isValid:!1},JE={value:!0,isValid:!0};var Q1=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!On(t[0].attributes.value)?On(t[0].value)||t[0].value===""?JE:{value:t[0].value,isValid:!0}:JE:KE}return KE};const XE={isValid:!1,value:null};var eO=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,XE):XE;function QE(t,e,n="validate"){if(Bh(t)||Array.isArray(t)&&t.every(Bh)||ei(t)&&!t)return{type:n,message:Bh(t)?t:"",ref:e}}var Sc=t=>kn(t)&&!Sp(t)?t:{value:t,message:""},eS=async(t,e,n,r,i,s)=>{const{ref:o,refs:a,required:c,maxLength:u,minLength:l,min:d,max:f,pattern:h,validate:m,name:p,valueAsNumber:g,mount:y}=t._f,v=Re(n,p);if(!y||e.has(p))return{};const b=a?a[0]:o,E=T=>{i&&b.reportValidity&&(b.setCustomValidity(ei(T)?"":T||""),b.reportValidity())},w={},x=b_(o),_=mf(o),k=x||_,R=(g||v_(o))&&On(o.value)&&On(v)||Ep(o)&&o.value===""||v===""||Array.isArray(v)&&!v.length,F=j3.bind(null,p,r,w),V=(T,L,S,C=Ss.maxLength,N=Ss.minLength)=>{const U=T?L:S;w[p]={type:T?C:N,message:U,ref:o,...F(T?C:N,U)}};if(s?!Array.isArray(v)||!v.length:c&&(!k&&(R||ur(v))||ei(v)&&!v||_&&!Q1(a).isValid||x&&!eO(a).isValid)){const{value:T,message:L}=Bh(c)?{value:!!c,message:c}:Sc(c);if(T&&(w[p]={type:Ss.required,message:L,ref:b,...F(Ss.required,L)},!r))return E(L),w}if(!R&&(!ur(d)||!ur(f))){let T,L;const S=Sc(f),C=Sc(d);if(!ur(v)&&!isNaN(v)){const N=o.valueAsNumber||v&&+v;ur(S.value)||(T=N>S.value),ur(C.value)||(L=N<C.value)}else{const N=o.valueAsDate||new Date(v),U=q=>new Date(new Date().toDateString()+" "+q),K=o.type=="time",$=o.type=="week";Xi(S.value)&&v&&(T=K?U(v)>U(S.value):$?v>S.value:N>new Date(S.value)),Xi(C.value)&&v&&(L=K?U(v)<U(C.value):$?v<C.value:N<new Date(C.value))}if((T||L)&&(V(!!T,S.message,C.message,Ss.max,Ss.min),!r))return E(w[p].message),w}if((u||l)&&!R&&(Xi(v)||s&&Array.isArray(v))){const T=Sc(u),L=Sc(l),S=!ur(T.value)&&v.length>+T.value,C=!ur(L.value)&&v.length<+L.value;if((S||C)&&(V(S,T.message,L.message),!r))return E(w[p].message),w}if(h&&!R&&Xi(v)){const{value:T,message:L}=Sc(h);if(Sp(T)&&!v.match(T)&&(w[p]={type:Ss.pattern,message:L,ref:o,...F(Ss.pattern,L)},!r))return E(L),w}if(m){if(Ki(m)){const T=await m(v,n),L=QE(T,b);if(L&&(w[p]={...L,...F(Ss.validate,L.message)},!r))return E(L.message),w}else if(kn(m)){let T={};for(const L in m){if(!Er(T)&&!r)break;const S=QE(await m[L](v,n),b,L);S&&(T={...S,...F(L,S.message)},E(S.message),r&&(w[p]=T))}if(!Er(T)&&(w[p]={ref:b,...T},!r))return w}}return E(!0),w};function B3(t,e){const n=e.slice(0,-1).length;let r=0;for(;r<n;)t=On(t)?r++:t[e[r++]];return t}function z3(t){for(const e in t)if(t.hasOwnProperty(e)&&!On(t[e]))return!1;return!0}function Ln(t,e){const n=Array.isArray(e)?e:m_(e)?[e]:Z1(e),r=n.length===1?t:B3(t,n),i=n.length-1,s=n[i];return r&&delete r[s],i!==0&&(kn(r)&&Er(r)||Array.isArray(r)&&z3(r))&&Ln(t,n.slice(0,-1)),t}var dy=()=>{let t=[];return{get observers(){return t},next:i=>{for(const s of t)s.next&&s.next(i)},subscribe:i=>(t.push(i),{unsubscribe:()=>{t=t.filter(s=>s!==i)}}),unsubscribe:()=>{t=[]}}},gv=t=>ur(t)||!W1(t);function bo(t,e){if(gv(t)||gv(e))return t===e;if(da(t)&&da(e))return t.getTime()===e.getTime();const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const i of n){const s=t[i];if(!r.includes(i))return!1;if(i!=="ref"){const o=e[i];if(da(s)&&da(o)||kn(s)&&kn(o)||Array.isArray(s)&&Array.isArray(o)?!bo(s,o):s!==o)return!1}}return!0}var tO=t=>t.type==="select-multiple",V3=t=>b_(t)||mf(t),fy=t=>Ep(t)&&t.isConnected,nO=t=>{for(const e in t)if(Ki(t[e]))return!0;return!1};function xp(t,e={}){const n=Array.isArray(t);if(kn(t)||n)for(const r in t)Array.isArray(t[r])||kn(t[r])&&!nO(t[r])?(e[r]=Array.isArray(t[r])?[]:{},xp(t[r],e[r])):ur(t[r])||(e[r]=!0);return e}function rO(t,e,n){const r=Array.isArray(t);if(kn(t)||r)for(const i in t)Array.isArray(t[i])||kn(t[i])&&!nO(t[i])?On(e)||gv(n[i])?n[i]=Array.isArray(t[i])?xp(t[i],[]):{...xp(t[i])}:rO(t[i],ur(e)?{}:e[i],n[i]):n[i]=!bo(t[i],e[i]);return n}var ul=(t,e)=>rO(t,e,xp(e)),iO=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>On(t)?t:e?t===""?NaN:t&&+t:n&&Xi(t)?new Date(t):r?r(t):t;function hy(t){const e=t.ref;return v_(e)?e.files:b_(e)?eO(t.refs).value:tO(e)?[...e.selectedOptions].map(({value:n})=>n):mf(e)?Q1(t.refs).value:iO(On(e.value)?t.ref.value:e.value,t)}var H3=(t,e,n,r)=>{const i={};for(const s of t){const o=Re(e,s);o&&nn(i,s,o._f)}return{criteriaMode:n,names:[...t],fields:i,shouldUseNativeValidation:r}},ll=t=>On(t)?t:Sp(t)?t.source:kn(t)?Sp(t.value)?t.value.source:t.value:t;const tS="AsyncFunction";var W3=t=>!!t&&!!t.validate&&!!(Ki(t.validate)&&t.validate.constructor.name===tS||kn(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===tS)),q3=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate);function nS(t,e,n){const r=Re(t,n);if(r||m_(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const s=i.join("."),o=Re(e,s),a=Re(t,s);if(o&&!Array.isArray(o)&&n!==s)return{name:n};if(a&&a.type)return{name:s,error:a};i.pop()}return{name:n}}var G3=(t,e,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(e||t):(n?r.isOnBlur:i.isOnBlur)?!t:(n?r.isOnChange:i.isOnChange)?t:!0,Z3=(t,e)=>!Zm(Re(t,e)).length&&Ln(t,e);const Y3={mode:bi.onSubmit,reValidateMode:bi.onChange,shouldFocusError:!0};function K3(t={}){let e={...Y3,...t},n={submitCount:0,isDirty:!1,isLoading:Ki(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1},r={},i=kn(e.defaultValues)||kn(e.values)?wr(e.defaultValues||e.values)||{}:{},s=e.shouldUnregister?{}:wr(i),o={action:!1,mount:!1,watch:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const l={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:dy(),array:dy(),state:dy()},f=ZE(e.mode),h=ZE(e.reValidateMode),m=e.criteriaMode===bi.all,p=I=>A=>{clearTimeout(u),u=setTimeout(I,A)},g=async I=>{if(!e.disabled&&(l.isValid||I)){const A=e.resolver?Er((await k()).errors):await F(r,!0);A!==n.isValid&&d.state.next({isValid:A})}},y=(I,A)=>{!e.disabled&&(l.isValidating||l.validatingFields)&&((I||Array.from(a.mount)).forEach(G=>{G&&(A?nn(n.validatingFields,G,A):Ln(n.validatingFields,G))}),d.state.next({validatingFields:n.validatingFields,isValidating:!Er(n.validatingFields)}))},v=(I,A=[],G,Q,H=!0,ee=!0)=>{if(Q&&G&&!e.disabled){if(o.action=!0,ee&&Array.isArray(Re(r,I))){const de=G(Re(r,I),Q.argA,Q.argB);H&&nn(r,I,de)}if(ee&&Array.isArray(Re(n.errors,I))){const de=G(Re(n.errors,I),Q.argA,Q.argB);H&&nn(n.errors,I,de),Z3(n.errors,I)}if(l.touchedFields&&ee&&Array.isArray(Re(n.touchedFields,I))){const de=G(Re(n.touchedFields,I),Q.argA,Q.argB);H&&nn(n.touchedFields,I,de)}l.dirtyFields&&(n.dirtyFields=ul(i,s)),d.state.next({name:I,isDirty:T(I,A),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else nn(s,I,A)},b=(I,A)=>{nn(n.errors,I,A),d.state.next({errors:n.errors})},E=I=>{n.errors=I,d.state.next({errors:n.errors,isValid:!1})},w=(I,A,G,Q)=>{const H=Re(r,I);if(H){const ee=Re(s,I,On(G)?Re(i,I):G);On(ee)||Q&&Q.defaultChecked||A?nn(s,I,A?ee:hy(H._f)):C(I,ee),o.mount&&g()}},x=(I,A,G,Q,H)=>{let ee=!1,de=!1;const fe={name:I};if(!e.disabled){const De=!!(Re(r,I)&&Re(r,I)._f&&Re(r,I)._f.disabled);if(!G||Q){l.isDirty&&(de=n.isDirty,n.isDirty=fe.isDirty=T(),ee=de!==fe.isDirty);const rt=De||bo(Re(i,I),A);de=!!(!De&&Re(n.dirtyFields,I)),rt||De?Ln(n.dirtyFields,I):nn(n.dirtyFields,I,!0),fe.dirtyFields=n.dirtyFields,ee=ee||l.dirtyFields&&de!==!rt}if(G){const rt=Re(n.touchedFields,I);rt||(nn(n.touchedFields,I,G),fe.touchedFields=n.touchedFields,ee=ee||l.touchedFields&&rt!==G)}ee&&H&&d.state.next(fe)}return ee?fe:{}},_=(I,A,G,Q)=>{const H=Re(n.errors,I),ee=l.isValid&&ei(A)&&n.isValid!==A;if(e.delayError&&G?(c=p(()=>b(I,G)),c(e.delayError)):(clearTimeout(u),c=null,G?nn(n.errors,I,G):Ln(n.errors,I)),(G?!bo(H,G):H)||!Er(Q)||ee){const de={...Q,...ee&&ei(A)?{isValid:A}:{},errors:n.errors,name:I};n={...n,...de},d.state.next(de)}},k=async I=>{y(I,!0);const A=await e.resolver(s,e.context,H3(I||a.mount,r,e.criteriaMode,e.shouldUseNativeValidation));return y(I),A},R=async I=>{const{errors:A}=await k(I);if(I)for(const G of I){const Q=Re(A,G);Q?nn(n.errors,G,Q):Ln(n.errors,G)}else n.errors=A;return A},F=async(I,A,G={valid:!0})=>{for(const Q in I){const H=I[Q];if(H){const{_f:ee,...de}=H;if(ee){const fe=a.array.has(ee.name),De=H._f&&W3(H._f);De&&l.validatingFields&&y([Q],!0);const rt=await eS(H,a.disabled,s,m,e.shouldUseNativeValidation&&!A,fe);if(De&&l.validatingFields&&y([Q]),rt[ee.name]&&(G.valid=!1,A))break;!A&&(Re(rt,ee.name)?fe?U3(n.errors,rt,ee.name):nn(n.errors,ee.name,rt[ee.name]):Ln(n.errors,ee.name))}!Er(de)&&await F(de,A,G)}}return G.valid},V=()=>{for(const I of a.unMount){const A=Re(r,I);A&&(A._f.refs?A._f.refs.every(G=>!fy(G)):!fy(A._f.ref))&&le(I)}a.unMount=new Set},T=(I,A)=>!e.disabled&&(I&&A&&nn(s,I,A),!bo(j(),i)),L=(I,A,G)=>X1(I,a,{...o.mount?s:On(A)?i:Xi(I)?{[I]:A}:A},G,A),S=I=>Zm(Re(o.mount?s:i,I,e.shouldUnregister?Re(i,I,[]):[])),C=(I,A,G={})=>{const Q=Re(r,I);let H=A;if(Q){const ee=Q._f;ee&&(!ee.disabled&&nn(s,I,iO(A,ee)),H=Ep(ee.ref)&&ur(A)?"":A,tO(ee.ref)?[...ee.ref.options].forEach(de=>de.selected=H.includes(de.value)):ee.refs?mf(ee.ref)?ee.refs.length>1?ee.refs.forEach(de=>(!de.defaultChecked||!de.disabled)&&(de.checked=Array.isArray(H)?!!H.find(fe=>fe===de.value):H===de.value)):ee.refs[0]&&(ee.refs[0].checked=!!H):ee.refs.forEach(de=>de.checked=de.value===H):v_(ee.ref)?ee.ref.value="":(ee.ref.value=H,ee.ref.type||d.values.next({name:I,values:{...s}})))}(G.shouldDirty||G.shouldTouch)&&x(I,H,G.shouldTouch,G.shouldDirty,!0),G.shouldValidate&&q(I)},N=(I,A,G)=>{for(const Q in A){const H=A[Q],ee=`${I}.${Q}`,de=Re(r,ee);(a.array.has(I)||kn(H)||de&&!de._f)&&!da(H)?N(ee,H,G):C(ee,H,G)}},U=(I,A,G={})=>{const Q=Re(r,I),H=a.array.has(I),ee=wr(A);nn(s,I,ee),H?(d.array.next({name:I,values:{...s}}),(l.isDirty||l.dirtyFields)&&G.shouldDirty&&d.state.next({name:I,dirtyFields:ul(i,s),isDirty:T(I,ee)})):Q&&!Q._f&&!ur(ee)?N(I,ee,G):C(I,ee,G),YE(I,a)&&d.state.next({...n}),d.values.next({name:o.mount?I:void 0,values:{...s}})},K=async I=>{o.mount=!0;const A=I.target;let G=A.name,Q=!0;const H=Re(r,G),ee=()=>A.type?hy(H._f):q1(I),de=fe=>{Q=Number.isNaN(fe)||da(fe)&&isNaN(fe.getTime())||bo(fe,Re(s,G,fe))};if(H){let fe,De;const rt=ee(),Xe=I.type===wp.BLUR||I.type===wp.FOCUS_OUT,tn=!q3(H._f)&&!e.resolver&&!Re(n.errors,G)&&!H._f.deps||G3(Xe,Re(n.touchedFields,G),n.isSubmitted,h,f),sr=YE(G,a,Xe);nn(s,G,rt),Xe?(H._f.onBlur&&H._f.onBlur(I),c&&c(0)):H._f.onChange&&H._f.onChange(I);const vn=x(G,rt,Xe,!1),Zr=!Er(vn)||sr;if(!Xe&&d.values.next({name:G,type:I.type,values:{...s}}),tn)return l.isValid&&(e.mode==="onBlur"&&Xe?g():Xe||g()),Zr&&d.state.next({name:G,...sr?{}:vn});if(!Xe&&sr&&d.state.next({...n}),e.resolver){const{errors:Rt}=await k([G]);if(de(rt),Q){const Nr=nS(n.errors,r,G),ai=nS(Rt,r,Nr.name||G);fe=ai.error,G=ai.name,De=Er(Rt)}}else y([G],!0),fe=(await eS(H,a.disabled,s,m,e.shouldUseNativeValidation))[G],y([G]),de(rt),Q&&(fe?De=!1:l.isValid&&(De=await F(r,!0)));Q&&(H._f.deps&&q(H._f.deps),_(G,De,fe,vn))}},$=(I,A)=>{if(Re(n.errors,A)&&I.focus)return I.focus(),1},q=async(I,A={})=>{let G,Q;const H=Fl(I);if(e.resolver){const ee=await R(On(I)?I:H);G=Er(ee),Q=I?!H.some(de=>Re(ee,de)):G}else I?(Q=(await Promise.all(H.map(async ee=>{const de=Re(r,ee);return await F(de&&de._f?{[ee]:de}:de)}))).every(Boolean),!(!Q&&!n.isValid)&&g()):Q=G=await F(r);return d.state.next({...!Xi(I)||l.isValid&&G!==n.isValid?{}:{name:I},...e.resolver||!I?{isValid:G}:{},errors:n.errors}),A.shouldFocus&&!Q&&$l(r,$,I?H:a.mount),Q},j=I=>{const A={...o.mount?s:i};return On(I)?A:Xi(I)?Re(A,I):I.map(G=>Re(A,G))},D=(I,A)=>({invalid:!!Re((A||n).errors,I),isDirty:!!Re((A||n).dirtyFields,I),error:Re((A||n).errors,I),isValidating:!!Re(n.validatingFields,I),isTouched:!!Re((A||n).touchedFields,I)}),X=I=>{I&&Fl(I).forEach(A=>Ln(n.errors,A)),d.state.next({errors:I?n.errors:{}})},Z=(I,A,G)=>{const Q=(Re(r,I,{_f:{}})._f||{}).ref,H=Re(n.errors,I)||{},{ref:ee,message:de,type:fe,...De}=H;nn(n.errors,I,{...De,...A,ref:Q}),d.state.next({name:I,errors:n.errors,isValid:!1}),G&&G.shouldFocus&&Q&&Q.focus&&Q.focus()},z=(I,A)=>Ki(I)?d.values.subscribe({next:G=>I(L(void 0,A),G)}):L(I,A,!0),le=(I,A={})=>{for(const G of I?Fl(I):a.mount)a.mount.delete(G),a.array.delete(G),A.keepValue||(Ln(r,G),Ln(s,G)),!A.keepError&&Ln(n.errors,G),!A.keepDirty&&Ln(n.dirtyFields,G),!A.keepTouched&&Ln(n.touchedFields,G),!A.keepIsValidating&&Ln(n.validatingFields,G),!e.shouldUnregister&&!A.keepDefaultValue&&Ln(i,G);d.values.next({values:{...s}}),d.state.next({...n,...A.keepDirty?{isDirty:T()}:{}}),!A.keepIsValid&&g()},pe=({disabled:I,name:A,field:G,fields:Q})=>{(ei(I)&&o.mount||I||a.disabled.has(A))&&(I?a.disabled.add(A):a.disabled.delete(A),x(A,hy(G?G._f:Re(Q,A)._f),!1,!1,!0))},ve=(I,A={})=>{let G=Re(r,I);const Q=ei(A.disabled)||ei(e.disabled);return nn(r,I,{...G||{},_f:{...G&&G._f?G._f:{ref:{name:I}},name:I,mount:!0,...A}}),a.mount.add(I),G?pe({field:G,disabled:ei(A.disabled)?A.disabled:e.disabled,name:I}):w(I,!0,A.value),{...Q?{disabled:A.disabled||e.disabled}:{},...e.progressive?{required:!!A.required,min:ll(A.min),max:ll(A.max),minLength:ll(A.minLength),maxLength:ll(A.maxLength),pattern:ll(A.pattern)}:{},name:I,onChange:K,onBlur:K,ref:H=>{if(H){ve(I,A),G=Re(r,I);const ee=On(H.value)&&H.querySelectorAll&&H.querySelectorAll("input,select,textarea")[0]||H,de=V3(ee),fe=G._f.refs||[];if(de?fe.find(De=>De===ee):ee===G._f.ref)return;nn(r,I,{_f:{...G._f,...de?{refs:[...fe.filter(fy),ee,...Array.isArray(Re(i,I))?[{}]:[]],ref:{type:ee.type,name:I}}:{ref:ee}}}),w(I,!1,void 0,ee)}else G=Re(r,I,{}),G._f&&(G._f.mount=!1),(e.shouldUnregister||A.shouldUnregister)&&!(G1(a.array,I)&&o.action)&&a.unMount.add(I)}}},je=()=>e.shouldFocusError&&$l(r,$,a.mount),ct=I=>{ei(I)&&(d.state.next({disabled:I}),$l(r,(A,G)=>{const Q=Re(r,G);Q&&(A.disabled=Q._f.disabled||I,Array.isArray(Q._f.refs)&&Q._f.refs.forEach(H=>{H.disabled=Q._f.disabled||I}))},0,!1))},ut=(I,A)=>async G=>{let Q;G&&(G.preventDefault&&G.preventDefault(),G.persist&&G.persist());let H=wr(s);if(a.disabled.size)for(const ee of a.disabled)nn(H,ee,void 0);if(d.state.next({isSubmitting:!0}),e.resolver){const{errors:ee,values:de}=await k();n.errors=ee,H=de}else await F(r);if(Ln(n.errors,"root"),Er(n.errors)){d.state.next({errors:{}});try{await I(H,G)}catch(ee){Q=ee}}else A&&await A({...n.errors},G),je(),setTimeout(je);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Er(n.errors)&&!Q,submitCount:n.submitCount+1,errors:n.errors}),Q)throw Q},Ye=(I,A={})=>{Re(r,I)&&(On(A.defaultValue)?U(I,wr(Re(i,I))):(U(I,A.defaultValue),nn(i,I,wr(A.defaultValue))),A.keepTouched||Ln(n.touchedFields,I),A.keepDirty||(Ln(n.dirtyFields,I),n.isDirty=A.defaultValue?T(I,wr(Re(i,I))):T()),A.keepError||(Ln(n.errors,I),l.isValid&&g()),d.state.next({...n}))},Ot=(I,A={})=>{const G=I?wr(I):i,Q=wr(G),H=Er(I),ee=H?i:Q;if(A.keepDefaultValues||(i=G),!A.keepValues){if(A.keepDirtyValues){const de=new Set([...a.mount,...Object.keys(ul(i,s))]);for(const fe of Array.from(de))Re(n.dirtyFields,fe)?nn(ee,fe,Re(s,fe)):U(fe,Re(ee,fe))}else{if(p_&&On(I))for(const de of a.mount){const fe=Re(r,de);if(fe&&fe._f){const De=Array.isArray(fe._f.refs)?fe._f.refs[0]:fe._f.ref;if(Ep(De)){const rt=De.closest("form");if(rt){rt.reset();break}}}}r={}}s=e.shouldUnregister?A.keepDefaultValues?wr(i):{}:wr(ee),d.array.next({values:{...ee}}),d.values.next({values:{...ee}})}a={mount:A.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!l.isValid||!!A.keepIsValid||!!A.keepDirtyValues,o.watch=!!e.shouldUnregister,d.state.next({submitCount:A.keepSubmitCount?n.submitCount:0,isDirty:H?!1:A.keepDirty?n.isDirty:!!(A.keepDefaultValues&&!bo(I,i)),isSubmitted:A.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:H?{}:A.keepDirtyValues?A.keepDefaultValues&&s?ul(i,s):n.dirtyFields:A.keepDefaultValues&&I?ul(i,I):A.keepDirty?n.dirtyFields:{},touchedFields:A.keepTouched?n.touchedFields:{},errors:A.keepErrors?n.errors:{},isSubmitSuccessful:A.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},O=(I,A)=>Ot(Ki(I)?I(s):I,A);return{control:{register:ve,unregister:le,getFieldState:D,handleSubmit:ut,setError:Z,_executeSchema:k,_getWatch:L,_getDirty:T,_updateValid:g,_removeUnmounted:V,_updateFieldArray:v,_updateDisabledField:pe,_getFieldArray:S,_reset:Ot,_resetDefaultValues:()=>Ki(e.defaultValues)&&e.defaultValues().then(I=>{O(I,e.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:I=>{n={...n,...I}},_disableForm:ct,_subjects:d,_proxyFormState:l,_setErrors:E,get _fields(){return r},get _formValues(){return s},get _state(){return o},set _state(I){o=I},get _defaultValues(){return i},get _names(){return a},set _names(I){a=I},get _formState(){return n},set _formState(I){n=I},get _options(){return e},set _options(I){e={...e,...I}}},trigger:q,register:ve,handleSubmit:ut,watch:z,setValue:U,getValues:j,reset:O,resetField:Ye,clearErrors:X,unregister:le,setError:Z,setFocus:(I,A={})=>{const G=Re(r,I),Q=G&&G._f;if(Q){const H=Q.refs?Q.refs[0]:Q.ref;H.focus&&(H.focus(),A.shouldSelect&&Ki(H.select)&&H.select())}},getFieldState:D}}function __(t={}){const e=$e.useRef(void 0),n=$e.useRef(void 0),[r,i]=$e.useState({isDirty:!1,isValidating:!1,isLoading:Ki(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,defaultValues:Ki(t.defaultValues)?void 0:t.defaultValues});e.current||(e.current={...K3(t),formState:r});const s=e.current.control;return s._options=t,y_({subject:s._subjects.state,next:o=>{K1(o,s._proxyFormState,s._updateFormState,!0)&&i({...s._formState})}}),$e.useEffect(()=>s._disableForm(t.disabled),[s,t.disabled]),$e.useEffect(()=>{if(s._proxyFormState.isDirty){const o=s._getDirty();o!==r.isDirty&&s._subjects.state.next({isDirty:o})}},[s,r.isDirty]),$e.useEffect(()=>{t.values&&!bo(t.values,n.current)?(s._reset(t.values,s._options.resetOptions),n.current=t.values,i(o=>({...o}))):s._resetDefaultValues()},[t.values,s]),$e.useEffect(()=>{t.errors&&s._setErrors(t.errors)},[t.errors,s]),$e.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),$e.useEffect(()=>{t.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[t.shouldUnregister,s]),e.current.formState=Y1(r,s),e.current}function Tp(t){const{children:e,className:n,...r}=t;return P("label",{...r,className:Vt("mb-3 block font-semibold text-gray-500",n),children:e})}const Aa=Qa(function(t,e){const{icon:n,errorMessage:r,isDirty:i,containerClassName:s,inputClassName:o,errorMessageClassName:a,hideErrors:c=!1,...u}=t,l=t.type??"text",d=!!r;return we("div",{children:[we("div",{className:Vt("mb-1 flex gap-2 rounded-xl border border-transparent bg-gray-100 p-3 text-gray-800 placeholder:text-gray-500",d&&"border-red-900",s),children:[n&&P("span",{className:ff((!i||d)&&"text-slate-200"),children:n}),P("input",{...u,className:Vt("w-full bg-transparent font-semibold outline-none",o),ref:e,type:l})]}),P("p",{className:Vt("hidden min-h-4 text-xs text-red-900",d&&"block",c&&"hidden",a),children:r})]})});function J3(t){return $e.forwardRef(t)}const X3=J3(function(t,e){const{items:n,value:r,id:i,onChange:s,containerClassName:o,menuClassName:a,itemClassName:c,absolutePositionMenu:u=!1,borderRadius:l="12px"}=t,[d,f]=We(!1),h=p(r)??n[0];function m(y){y.disabled||(s(y.value),f(!1))}function p(y){return n.find(v=>v.value===y)}const g=n.filter(y=>y.value!==r);return we("div",{className:Vt("bg-gray-100 transition-[border-radius]",u&&"relative",o),"data-open":d,ref:e,style:{borderRadius:d?`${l} ${l} 0 0`:l},children:[we("div",{className:Vt("flex min-w-[360px] cursor-pointer items-center justify-between pr-3 text-gray-800 outline-none",a),id:i,onClick:()=>f(!d),children:[P(rS,{...h,className:c}),P(vt,{className:ff("transition",d?"":"-rotate-90"),name:"ChevronDown"})]}),P("div",{className:Vt("max-h-0 w-full overflow-hidden bg-inherit transition-[max-height] ease-in-out",d&&"max-h-screen",u&&"absolute"),style:{borderRadius:`0 0 ${l} ${l}`},children:g.map(y=>P(rS,{...y,className:c,onItemClick:()=>m(y)},y.value))})]})});function rS(t){const{className:e,disabled:n,onItemClick:r,icon:i,displayValue:s,value:o,description:a}=t;return we("div",{className:Vt(n?"cursor-not-allowed text-gray-500":"text-gray-800","flex size-full cursor-pointer items-center gap-2 bg-inherit py-3 pl-3 text-start outline-none",e),onClick:r,children:[i,we("div",{children:[P("p",{className:"capitalize text-inherit",children:s??o.toLowerCase()}),P("p",{className:"text-xs text-inherit",children:a})]})]})}function sO(t){const{control:e,...n}=t;return P($3,{control:e,name:"sharingType",render:({field:r})=>P(X3,{...n,...r,id:"sharingType",items:dj})})}function w_(t){const{location:e,className:n,...r}=t,i=fj[e];return we("div",{...r,className:Vt("my-3 flex items-center gap-2 rounded-xl border border-gray-100 p-3 text-gray-800 shadow",n),children:[i.icon,we("div",{children:[P("p",{children:i.title}),P("p",{className:"text-xs text-slate-200",children:i.description})]})]})}const Q3=Qa(function(t,e){return we("label",{className:"relative cursor-pointer items-center",htmlFor:t.id,children:[P("input",{className:"peer sr-only",ref:e,type:"checkbox",value:"",...t}),P("div",{className:"peer h-6 w-11 rounded-full bg-gray-500 after:absolute after:start-0.5 after:top-0.5 after:size-5 after:rounded-full after:border after:border-none after:bg-gray-50 after:transition-all peer-checked:bg-blue-900 peer-checked:after:translate-x-full peer-focus:outline-none"})]})}),E_=Qa(function(t,e){return we("div",{className:"flex items-center rounded-xl bg-gray-100 p-3 text-slate-200",children:[we("div",{className:"flex-1",children:[P("label",{className:"font-semibold",htmlFor:"availableOffline",children:"Make available offline"}),we("p",{className:"text-xs text-gray-500",children:["Check this options if you keep a local backup",P("br",{}),"available at all times."]})]}),P(Q3,{id:"availableOffline",ref:e,...t})]})});function e4(t){var e;const[n,r]=We(!1),[i,s]=We(!1),{register:o,handleSubmit:a,control:c,formState:{errors:u}}=__({defaultValues:{name:"",sharingType:Lb,availableOffline:!1}});return we("form",{onSubmit:a(t.onSubmit),children:[P(Tp,{htmlFor:"driveName",children:"Drive Name"}),P(Aa,{...o("name",{required:"Drive name is required"}),errorMessage:(e=u.name)==null?void 0:e.message,icon:P(vt,{name:"Drive"}),placeholder:"Drive name"}),P(Ir,{className:"my-4"}),P(Tp,{htmlFor:"sharingType",children:"Sharing settings"}),P(sO,{control:c}),P(Ir,{className:"my-3"}),P(mu,{isOpen:i,onOpenChange:()=>s(!i),title:"Upload from device",children:P("div",{className:"mt-3 grid h-[117px] w-full place-items-center rounded-xl bg-gray-200",children:we("div",{className:"rounded-xl bg-white p-3 text-xs",children:[P(vt,{className:"mr-2 inline-block",name:"ArrowUp",size:20}),"Click or drop folder"]})})}),P(Ir,{className:"my-3"}),we(mu,{isOpen:n,onOpenChange:()=>r(!n),title:"Location",children:[P(w_,{location:op}),P(E_,{...o("availableOffline")})]}),P(Ir,{className:"my-3"}),P(zn,{className:"mb-4 w-full",type:"submit",children:"Create new drive"})]})}function t4(t){return we("div",{className:"flex gap-2 rounded-xl bg-gray-100 p-3 font-semibold text-gray-500",children:[P(vt,{className:"text-gray-600",name:"Drive"}),t.driveName]})}function n4(t){const{sharingType:e=Fb,requestPublicDrive:n}=t,[r,i]=We(),[s,o]=We(!1),[a,c]=We(!0),[u,l]=We(!1),[d,f]=We(""),[h,m]=We(""),[p,g]=BM(h,500),{register:y,handleSubmit:v,setValue:b}=__({mode:"onBlur",defaultValues:{availableOffline:(r==null?void 0:r.availableOffline)??!1}});Dt(()=>{g(h)},[h]),Dt(()=>{if(l(!1),p==="")return;w().catch(console.error);async function w(){try{const{id:x,name:_}=await n(p);i({id:x,name:_,sharingType:e,location:op,availableOffline:!0}),b("availableOffline",!0),c(!0),f("")}catch(x){i(void 0),c(!1),f(x.message)}}},[p,b,e]);function E({availableOffline:w}){r&&t.onSubmit({...r,availableOffline:w,url:p})}return we("form",{onSubmit:v(E),children:[P(Tp,{htmlFor:"url",children:"Add existing drive"}),u?we(Us,{children:[P(t4,{driveName:(r==null?void 0:r.name)??"New drive"}),P(Ir,{className:"my-3"}),we(mu,{isOpen:s,onOpenChange:()=>o(!s),title:"Location",children:[P(w_,{location:op}),P(E_,{...y("availableOffline")})]}),P(Ir,{className:"my-3"}),P(zn,{className:"mt-4 w-full",color:"dark",type:"submit",children:"Add drive"})]}):we(Us,{children:[P(Aa,{errorMessage:d,icon:P(vt,{name:"BrickGlobe"}),onChange:w=>m(w.target.value),placeholder:"Drive URL",required:!0,type:"url",value:h}),P(Ir,{className:"mb-3"}),P(zn,{className:"mt-4 w-full",color:"light",disabled:!a||h==="",onClick:w=>{w.preventDefault(),l(!0)},type:"button",children:"Confirm URL"})]})]})}const oO=Qa(function(t,e){return P(Aa,{...t,icon:t.icon??P(vt,{name:"Drive"}),id:"driveName",placeholder:"Drive name",ref:e})});function r4(t){const{uiDriveNode:e,handleDeleteDrive:n,onCancel:r}=t,[i,s]=We(""),o=i===e.name;function a(){o&&n()}return we("div",{children:[P("p",{className:"mb-2 rounded-md bg-slate-50 p-4 text-center text-slate-200",children:"Are you sure you want to delete this drive? All files and subfolders within it will be removed. Do you want to proceed?"}),P(oO,{icon:P(vt,{name:"Lock"}),onChange:c=>s(c.target.value),placeholder:"Enter drive name...",value:i}),we("div",{className:"flex gap-3",children:[P(zn,{className:"w-full",color:"light",onClick:r,children:"Cancel"}),P(zn,{className:"w-full",color:"red",disabled:!o,onClick:a,children:"Delete"})]})]})}function i4(t){const{uiDriveNode:e,onSubmit:n}=t,{name:r,sharingType:i,availableOffline:s}=e,[o,a]=We(!1),[c,u]=We(!1),[l,d]=We(!1),{register:f,handleSubmit:h,control:m}=__({mode:"onBlur",defaultValues:{name:r,sharingType:i,availableOffline:s}}),p=i===Fb?op:i;return we("form",{onSubmit:h(n),children:[P(oO,{...f("name")}),P(Ir,{className:"my-4"}),P(Tp,{htmlFor:"sharingType",children:"Sharing settings"}),P(sO,{control:m}),P(Ir,{className:"my-3"}),we(mu,{isOpen:o,onOpenChange:()=>a(!o),title:"Location",children:[P(w_,{location:p}),P(E_,{...f("availableOffline")})]}),P(Ir,{className:"my-3"}),P(mu,{isOpen:c,onOpenChange:()=>u(!c),title:"Danger zone",children:we("button",{className:"flex gap-2 py-3 font-semibold text-red-900 transition hover:brightness-125",onClick:()=>d(!0),type:"button",children:[P(vt,{name:"Trash"}),"Delete drive"]})}),l&&c?P(r4,{...t,onCancel:()=>d(!1)}):we(Us,{children:[P(Ir,{className:"my-3"}),P(zn,{className:"mb-4 w-full",type:"submit",children:"Confirm"})]})]})}var S_="Dialog",[aO,Fie]=gj(S_),[s4,Pi]=aO(S_),cO=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!0}=t,a=Y.useRef(null),c=Y.useRef(null),[u=!1,l]=vj({prop:r,defaultProp:i,onChange:s});return P(s4,{scope:e,triggerRef:a,contentRef:c,contentId:Qg(),titleId:Qg(),descriptionId:Qg(),open:u,onOpenChange:l,onOpenToggle:Y.useCallback(()=>l(d=>!d),[l]),modal:o,children:n})};cO.displayName=S_;var uO="DialogTrigger",o4=Y.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Pi(uO,n),s=nc(e,i.triggerRef);return P(ps.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":I_(i.open),...r,ref:s,onClick:Do(t.onClick,i.onOpenToggle)})});o4.displayName=uO;var x_="DialogPortal",[a4,lO]=aO(x_,{forceMount:void 0}),dO=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,s=Pi(x_,e);return P(a4,{scope:e,forceMount:n,children:Y.Children.map(r,o=>P(Vm,{present:n||s.open,children:P(o1,{asChild:!0,container:i,children:o})}))})};dO.displayName=x_;var Ip="DialogOverlay",fO=Y.forwardRef((t,e)=>{const n=lO(Ip,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,s=Pi(Ip,t.__scopeDialog);return s.modal?P(Vm,{present:r||s.open,children:P(c4,{...i,ref:e})}):null});fO.displayName=Ip;var c4=Y.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Pi(Ip,n);return P(m1,{as:o_,allowPinchZoom:!0,shards:[i.contentRef],children:P(ps.div,{"data-state":I_(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Pa="DialogContent",hO=Y.forwardRef((t,e)=>{const n=lO(Pa,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,s=Pi(Pa,t.__scopeDialog);return P(Vm,{present:r||s.open,children:s.modal?P(u4,{...i,ref:e}):P(l4,{...i,ref:e})})});hO.displayName=Pa;var u4=Y.forwardRef((t,e)=>{const n=Pi(Pa,t.__scopeDialog),r=Y.useRef(null),i=nc(e,n.contentRef,r);return Y.useEffect(()=>{const s=r.current;if(s)return Jj(s)},[]),P(pO,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Do(t.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Do(t.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:Do(t.onFocusOutside,s=>s.preventDefault())})}),l4=Y.forwardRef((t,e)=>{const n=Pi(Pa,t.__scopeDialog),r=Y.useRef(!1),i=Y.useRef(!1);return P(pO,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=t.onCloseAutoFocus)==null||o.call(t,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var c,u;(c=t.onInteractOutside)==null||c.call(t,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),pO=Y.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=t,a=Pi(Pa,n),c=Y.useRef(null),u=nc(e,c);return Pj(),we(Us,{children:[P(i1,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:P(n1,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":I_(a.open),...o,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),we(Us,{children:[P(f4,{titleId:a.titleId}),P(p4,{contentRef:c,descriptionId:a.descriptionId})]})]})}),T_="DialogTitle",mO=Y.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Pi(T_,n);return P(ps.h2,{id:i.titleId,...r,ref:e})});mO.displayName=T_;var gO="DialogDescription",yO=Y.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Pi(gO,n);return P(ps.p,{id:i.descriptionId,...r,ref:e})});yO.displayName=gO;var vO="DialogClose",d4=Y.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Pi(vO,n);return P(ps.button,{type:"button",...r,ref:e,onClick:Do(t.onClick,()=>i.onOpenChange(!1))})});d4.displayName=vO;function I_(t){return t?"open":"closed"}var bO="DialogTitleWarning",[$ie,_O]=mj(bO,{contentName:Pa,titleName:T_,docsSlug:"dialog"}),f4=({titleId:t})=>{const e=_O(bO),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
59
-
60
- If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
61
-
62
- For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return Y.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},h4="DialogDescriptionWarning",p4=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${_O(h4).contentName}}.`;return Y.useEffect(()=>{var s;const i=(s=t.current)==null?void 0:s.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},m4=cO,g4=dO,y4=fO,v4=hO,b4=mO,_4=yO,w4="VisuallyHidden",wO=Y.forwardRef((t,e)=>P(ps.span,{...t,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));wO.displayName=w4;var E4=wO;function Xs(t){const{title:e,open:n,onOpenChange:r,contentProps:i,overlayProps:s,children:o,...a}=t;return P(m4,{defaultOpen:n,onOpenChange:r,open:n,children:P(g4,{children:P(y4,{...s,className:Vt("fixed inset-0 grid place-items-center overflow-y-auto bg-slate-900/50 data-[state=closed]:animate-fade-out data-[state=open]:animate-fade-in",s==null?void 0:s.className),children:we(v4,{...a,...i,className:Vt("bg-white data-[state=closed]:animate-zoom-out data-[state=open]:animate-zoom-in",i==null?void 0:i.className),children:[we(E4,{children:[P(b4,{children:e||"Modal"}),P(_4,{children:e||"Modal"})]}),o]})})})})}function S4(t){const{open:e,onOpenChange:n,onSubmit:r,modalProps:i,containerProps:s}=t;function o(){n(!1)}return P(Xs,{...i,contentProps:{className:"rounded-2xl"},onOpenChange:n,open:e,children:we("div",{...s,className:Vt("max-w-[408px] rounded-2xl p-6",s==null?void 0:s.className),children:[we("div",{className:"flex justify-between",children:[P("h1",{className:"text-xl font-bold",children:"Create new drive "}),P("button",{className:"flex size-8 items-center justify-center rounded-md bg-gray-100 text-gray-500 outline-none hover:text-gray-900",onClick:o,tabIndex:-1,children:P(vt,{name:"XmarkLight",size:24})})]}),P(Ir,{className:"my-4"}),P(e4,{onCancel:o,onSubmit:r})]})})}function x4(t){const{open:e,onOpenChange:n,onSubmit:r,sharingType:i,modalProps:s,containerProps:o,requestPublicDrive:a}=t;function c(){n(!1)}return P(Xs,{...s,contentProps:{className:"rounded-2xl"},onOpenChange:n,open:e,children:we("div",{...o,className:Vt("min-w-[408px] max-w-[408px] rounded-2xl p-6",o==null?void 0:o.className),children:[we("div",{className:"flex justify-between",children:[P("h1",{className:"text-xl font-bold",children:"Add drive"}),P("button",{className:"flex size-8 items-center justify-center rounded-md bg-gray-100 text-gray-500 outline-none hover:text-gray-900",onClick:c,tabIndex:-1,children:P(vt,{name:"XmarkLight",size:24})})]}),P(Ir,{className:"my-4"}),P(n4,{onCancel:c,onSubmit:r,requestPublicDrive:a,sharingType:i})]})})}const iS="min-h-[48px] min-w-[142px] text-base font-semibold py-3 px-6 rounded-xl outline-none active:opacity-75 hover:scale-105 transform transition-all";function O_(t){const{body:e,header:n,children:r,onCancel:i,onOpenChange:s,onContinue:o,cancelLabel:a,continueLabel:c,overlayProps:u,contentProps:l,bodyProps:d={},headerProps:f={},containerProps:h={},cancelButtonProps:m={},continueButtonProps:p={},buttonContainerProps:g={},...y}=t;return P(Xs,{contentProps:{...l,className:Vt("rounded-3xl",l==null?void 0:l.className)},onOpenChange:s,overlayProps:{...u,className:u==null?void 0:u.className},...y,children:we("div",{...ti(h,"w-[400px] p-6 text-slate-300"),children:[P("div",{...ti(f,"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800"),children:n}),we("div",{...ti(d,"my-6 rounded-md bg-slate-50 p-4 text-center text-slate-200"),children:[e,r]}),we("div",{...ti(g,"mt-8 flex justify-between gap-3"),children:[P("button",{onClick:i,...ti(m,Vt(iS,"flex-1 bg-slate-50 text-slate-800")),children:a}),P("button",{onClick:o,...ti(p,Vt(iS,"flex-1 bg-gray-800 text-gray-50")),children:c})]})]})})}const sS="min-h-[48px] min-w-[142px] text-base font-semibold py-3 px-6 rounded-xl outline-none active:opacity-75 hover:scale-105 transform transition-all",oS=300;function T4(t){const{onOpenChange:e,onContinue:n,overlayProps:r,contentProps:i,...s}=t,[o,a]=We(""),c=()=>{e==null||e(!1),setTimeout(()=>a(""),oS)},u=()=>{n(o),setTimeout(()=>a(""),oS)};return P(Xs,{contentProps:{...i,className:Vt("rounded-3xl",i==null?void 0:i.className)},onOpenChange:e,overlayProps:{...r,className:r==null?void 0:r.className},...s,children:we("div",{className:"w-[400px] p-6 text-slate-300",children:[P("div",{className:"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800",children:"Create a new document"}),P("div",{className:"my-6",children:P(Aa,{icon:P(vt,{name:"BrickGlobe"}),onChange:l=>a(l.target.value),placeholder:"Document name",required:!0,value:o})}),we("div",{className:"mt-8 flex justify-between gap-3",children:[P("button",{className:Vt(sS,"flex-1 bg-slate-50 text-slate-800"),onClick:c,children:"Cancel"}),P(zn,{className:Vt(sS,"flex-1 bg-gray-800 text-gray-50"),onClick:u,children:"Create"})]})]})})}const I4=t=>{const{inputPlaceholder:e,body:n,driveName:r,...i}=t,[s,o]=We("");return P(O_,{bodyProps:{className:"p-0 bg-white my-0"},containerProps:{className:"w-[450px]"},continueButtonProps:{disabled:s!==r,className:s!==r?"bg-red-600 hover:scale-100 cursor-not-allowed active:opacity-100":"bg-red-900"},...i,children:we("div",{children:[P("div",{className:"my-6 rounded-md bg-slate-50 p-4 text-center text-slate-200",children:n}),P("div",{children:P(Aa,{hideErrors:!0,icon:P(vt,{name:"Lock"}),onChange:a=>o(a.target.value),placeholder:e,value:s})})]})})};function O4(t){const{onDelete:e,deleteLabel:n,...r}=t;return P(O_,{...r,containerProps:{className:"w-[450px]"},continueButtonProps:{className:"bg-red-900"},continueLabel:n,onContinue:e})}function C4(t){const{uiDriveNode:e,open:n,onOpenChange:r,onDeleteDrive:i,onRenameDrive:s,onChangeSharingType:o,onChangeAvailableOffline:a,modalProps:c,containerProps:u}=t,l=h=>{h.name!==e.name&&s(e,h.name),h.sharingType!==e.sharingType&&o(e,h.sharingType),h.availableOffline!==e.availableOffline&&a(e,h.availableOffline),r(!1)};function d(){i(e),r(!1)}function f(){r(!1)}return P(Xs,{...c,contentProps:{className:"rounded-2xl"},onOpenChange:r,open:n,children:we("div",{...u,className:Vt("max-w-[408px] rounded-2xl p-6",u==null?void 0:u.className),children:[we("div",{className:"flex justify-between",children:[P("h1",{className:"text-xl font-bold",children:"Drive settings"}),P("button",{className:"flex size-8 items-center justify-center rounded-md bg-gray-100 text-gray-500 outline-none hover:text-gray-900",onClick:f,tabIndex:-1,children:P(vt,{name:"XmarkLight",size:24})})]}),P(Ir,{className:"my-4"}),P(i4,{handleCancel:f,handleDeleteDrive:d,onSubmit:l,uiDriveNode:e})]})})}const k4="min-h-[48px] min-w-[142px] text-base font-semibold py-3 px-6 rounded-xl outline-none active:opacity-75 hover:scale-105 transform transition-all";function EO(t){const{body:e,header:n,children:r,onOpenChange:i,onContinue:s,closeLabel:o,overlayProps:a,contentProps:c,bodyProps:u={},headerProps:l={},containerProps:d={},continueButtonProps:f={},buttonContainerProps:h={},...m}=t,[p,g]=We(!0),y=qt(null);return Dt(()=>{const v=()=>{const E=y.current;E&&(E.scrollHeight>E.clientHeight?(g(!0),E.addEventListener("scroll",b)):g(!1))},b=()=>{const E=y.current;E&&E.scrollHeight-Math.ceil(E.scrollTop)===E.clientHeight&&g(!1)};return requestAnimationFrame(v),()=>{const E=y.current;E&&E.removeEventListener("scroll",b)}},[]),P(Xs,{contentProps:{...c,className:Vt("rounded-3xl outline-none",c==null?void 0:c.className)},onOpenChange:i,overlayProps:{...a,className:a==null?void 0:a.className},...m,children:we("div",{...ti(d,"w-[500px] p-6 text-slate-300"),children:[P("div",{...ti(l,"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800"),children:n}),we("div",{ref:y,...ti(u,"my-6 max-h-[245px] overflow-scroll rounded-md bg-slate-50 p-4 text-center text-slate-200"),children:[e,r]}),P("div",{...ti(h,"mt-8 flex justify-between gap-3"),children:P("button",{disabled:p,onClick:s,...ti(f,Vt(k4,"flex-1 bg-gray-800 text-gray-50",p&&"cursor-not-allowed bg-gray-300 hover:scale-100")),children:o})})]})})}const SO=t=>{const{title:e,children:n,description:r,...i}=t;return we("div",{...i,children:[e?P("h2",{className:"font-semibold",children:e}):null,we("div",{className:"flex items-center justify-between gap-x-12 text-sm font-medium",children:[P("p",{children:r}),P("div",{children:n})]})]})},D4=t=>{const{onClearStorage:e,buttonLabel:n,...r}=t;return P(SO,{...r,children:P(zn,{className:"h-auto min-h-9 rounded border border-solid border-gray-300 bg-white px-3 py-0 text-sm text-red-800 hover:border-gray-500 hover:bg-white hover:text-red-900",icon:P(vt,{name:"Trash",size:18}),iconPosition:"right",onClick:e,children:n})})};function R4(t){if(!t||typeof t!="object")throw new Error("Invalid package.json");if(!("version"in t))throw new Error("Missing version field in package.json");if(!("devDependencies"in t))throw new Error("Missing devDependencies field in package.json");if(typeof t.version!="string")throw new Error("Invalid version field in package.json");if(!t.devDependencies||typeof t.devDependencies!="object")throw new Error("Invalid devDependencies field in package.json");if(!("@powerhousedao/design-system"in t.devDependencies)||typeof t.devDependencies["@powerhousedao/design-system"]!="string")throw new Error("Invalid @powerhousedao/design-system dependency");if(!("document-drive"in t.devDependencies)||typeof t.devDependencies["document-drive"]!="string")throw new Error("Invalid document-drive dependency");if(!("document-model"in t.devDependencies)||typeof t.devDependencies["document-model"]!="string")throw new Error("Invalid document-model dependency");if(!("document-model-libs"in t.devDependencies)||typeof t.devDependencies["document-model-libs"]!="string")throw new Error("Invalid document-model-libs dependency")}function N4(t){const[e,n]=We(!1),{packageJson:r}=t;try{R4(r)}catch(i){return console.error(i),null}return P(mu,{isOpen:e,onOpenChange:()=>n(!e),title:`App version: ${r.version}`,children:we("ul",{className:"text-gray-800",children:[we("li",{className:"my-1 flex justify-between pr-1",children:[P("span",{children:"design-system:"}),P("span",{className:"font-medium",children:r.devDependencies["@powerhousedao/design-system"]})]}),we("li",{className:"my-1 flex justify-between pr-1",children:[P("span",{children:"document-drive:"})," ",P("span",{className:"font-medium",children:r.devDependencies["document-drive"]})]}),we("li",{className:"my-1 flex justify-between pr-1",children:[P("span",{children:"document-model:"})," ",P("span",{className:"font-medium",children:r.devDependencies["document-model"]})]}),we("li",{className:"my-1 flex justify-between pr-1",children:[P("span",{children:"document-model-libs:"})," ",P("span",{className:"font-medium",children:r.devDependencies["document-model-libs"]})]})]})})}function A4(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}A4(`.rmsc{--rmsc-main: #4285f4;--rmsc-hover: #f1f3f5;--rmsc-selected: #e2e6ea;--rmsc-border: #ccc;--rmsc-gray: #aaa;--rmsc-bg: #fff;--rmsc-p: 10px;--rmsc-radius: 4px;--rmsc-h: 38px}.rmsc *{box-sizing:border-box;transition:all .2s ease}.rmsc .gray{color:var(--rmsc-gray)}.rmsc .dropdown-content{position:absolute;z-index:1;top:100%;width:100%;padding-top:8px}.rmsc .dropdown-content .panel-content{overflow:hidden;border-radius:var(--rmsc-radius);background:var(--rmsc-bg);box-shadow:0 0 0 1px #0000001a,0 4px 11px #0000001a}.rmsc .dropdown-container{position:relative;outline:0;background-color:var(--rmsc-bg);border:1px solid var(--rmsc-border);border-radius:var(--rmsc-radius)}.rmsc .dropdown-container[aria-disabled=true]:focus-within{box-shadow:var(--rmsc-gray) 0 0 0 1px;border-color:var(--rmsc-gray)}.rmsc .dropdown-container:focus-within{box-shadow:var(--rmsc-main) 0 0 0 1px;border-color:var(--rmsc-main)}.rmsc .dropdown-heading{position:relative;padding:0 var(--rmsc-p);display:flex;align-items:center;width:100%;height:var(--rmsc-h);cursor:default;outline:0}.rmsc .dropdown-heading .dropdown-heading-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}.rmsc .clear-selected-button{cursor:pointer;background:none;border:0;padding:0;display:flex}.rmsc .options{max-height:260px;overflow-y:auto;margin:0;padding-left:0}.rmsc .options li{list-style:none;margin:0}.rmsc .select-item{box-sizing:border-box;cursor:pointer;display:block;padding:var(--rmsc-p);outline-offset:-1px;outline-color:var(--rmsc-primary)}.rmsc .select-item:hover{background:var(--rmsc-hover)}.rmsc .select-item.selected{background:var(--rmsc-selected)}.rmsc .no-options{padding:var(--rmsc-p);text-align:center;color:var(--rmsc-gray)}.rmsc .search{width:100%;position:relative;border-bottom:1px solid var(--rmsc-border)}.rmsc .search input{background:none;height:var(--rmsc-h);padding:0 var(--rmsc-p);width:100%;outline:0;border:0;font-size:1em}.rmsc .search input:focus{background:var(--rmsc-hover)}.rmsc .search-clear-button{cursor:pointer;position:absolute;top:0;right:0;bottom:0;background:none;border:0;padding:0 calc(var(--rmsc-p) / 2)}.rmsc .search-clear-button [hidden]{display:none}.rmsc .item-renderer{display:flex;align-items:baseline}.rmsc .item-renderer input{margin:0 5px 0 0}.rmsc .item-renderer.disabled{opacity:.5}.rmsc .spinner{animation:rotate 2s linear infinite}.rmsc .spinner .path{stroke:var(--rmsc-border);stroke-width:4px;stroke-linecap:round;animation:dash 1.5s ease-in-out infinite}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}
63
- `);var P4={allItemsAreSelected:"All items are selected.",clearSearch:"Clear Search",clearSelected:"Clear Selected",noOptions:"No options",search:"Search",selectAll:"Select All",selectAllFiltered:"Select All (Filtered)",selectSomeItems:"Select...",create:"Create"},M4={value:[],hasSelectAll:!0,className:"multi-select",debounceDuration:200,options:[]},xO=$e.createContext({}),L4=({props:t,children:e})=>{let[n,r]=We(t.options),i=s=>{var o;return((o=t.overrideStrings)==null?void 0:o[s])||P4[s]};return Dt(()=>{r(t.options)},[t.options]),P(xO.Provider,{value:{t:i,...M4,...t,options:n,setOptions:r},children:e})},Ym=()=>$e.useContext(xO);function F4(t,e){let n=qt(!1);Dt(()=>{n.current?t():n.current=!0},e)}var $4={when:!0,eventTypes:["keydown"]};function Op(t,e,n){let r=Pn(()=>Array.isArray(t)?t:[t],[t]),i=Object.assign({},$4,n),{when:s,eventTypes:o}=i,a=qt(e),{target:c}=i;Dt(()=>{a.current=e});let u=He(l=>{r.some(d=>l.key===d||l.code===d)&&a.current(l)},[r]);Dt(()=>{if(s&&typeof window<"u"){let l=c?c.current:window;return o.forEach(d=>{l&&l.addEventListener(d,u)}),()=>{o.forEach(d=>{l&&l.removeEventListener(d,u)})}}},[s,o,r,c,e])}var Tr={ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",ENTER:"Enter",ESCAPE:"Escape",SPACE:"Space"},j4=(t,e)=>{let n;return function(...r){clearTimeout(n),n=setTimeout(()=>{t.apply(null,r)},e)}};function U4(t,e){return e?t.filter(({label:n,value:r})=>n!=null&&r!=null&&n.toLowerCase().includes(e.toLowerCase())):t}var TO=()=>we("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"dropdown-search-clear-icon gray",children:[P("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),P("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),B4=({checked:t,option:e,onClick:n,disabled:r})=>we("div",{className:`item-renderer ${r?"disabled":""}`,children:[P("input",{type:"checkbox",onChange:n,checked:t,tabIndex:-1,disabled:r}),P("span",{children:e.label})]}),z4=B4,V4=({itemRenderer:t=z4,option:e,checked:n,tabIndex:r,disabled:i,onSelectionChanged:s,onClick:o})=>{let a=qt(),c=d=>{u(),d.preventDefault()},u=()=>{i||s(!n)},l=d=>{u(),o(d)};return Op([Tr.ENTER,Tr.SPACE],c,{target:a}),P("label",{className:`select-item ${n?"selected":""}`,role:"option","aria-selected":n,tabIndex:r,ref:a,children:P(t,{option:e,checked:n,onClick:l,disabled:i})})},IO=V4,H4=({options:t,onClick:e,skipIndex:n})=>{let{disabled:r,value:i,onChange:s,ItemRenderer:o}=Ym(),a=(c,u)=>{r||s(u?[...i,c]:i.filter(l=>l.value!==c.value))};return P(Us,{children:t.map((c,u)=>{let l=u+n;return P("li",{children:P(IO,{tabIndex:l,option:c,onSelectionChanged:d=>a(c,d),checked:!!i.find(d=>d.value===c.value),onClick:d=>e(d,l),itemRenderer:o,disabled:c.disabled||r})},(c==null?void 0:c.key)||u)})})},W4=H4,q4=()=>{let{t,onChange:e,options:n,setOptions:r,value:i,filterOptions:s,ItemRenderer:o,disabled:a,disableSearch:c,hasSelectAll:u,ClearIcon:l,debounceDuration:d,isCreatable:f,onCreateOption:h}=Ym(),m=qt(),p=qt(),[g,y]=We(""),[v,b]=We(n),[E,w]=We(""),[x,_]=We(0),k=He(j4(z=>w(z),d),[]),R=Pn(()=>{let z=0;return c||(z+=1),u&&(z+=1),z},[c,u]),F={label:t(g?"selectAllFiltered":"selectAll"),value:""},V=z=>{let le=v.filter(pe=>!pe.disabled).map(pe=>pe.value);if(z){let pe=[...i.map(ve=>ve.value),...le];return(s?v:n).filter(ve=>pe.includes(ve.value))}return i.filter(pe=>!le.includes(pe.value))},T=z=>{let le=V(z);e(le)},L=z=>{k(z.target.value),y(z.target.value),_(0)},S=()=>{var z;w(""),y(""),(z=p==null?void 0:p.current)==null||z.focus()},C=z=>_(z),N=z=>{switch(z.code){case Tr.ARROW_UP:q(-1);break;case Tr.ARROW_DOWN:q(1);break;default:return}z.stopPropagation(),z.preventDefault()};Op([Tr.ARROW_DOWN,Tr.ARROW_UP],N,{target:m});let U=()=>{_(0)},K=async()=>{let z={label:g,value:g,__isNew__:!0};h&&(z=await h(g)),r([z,...n]),S(),e([...i,z])},$=async()=>s?await s(n,E):U4(n,E),q=z=>{let le=x+z;le=Math.max(0,le),le=Math.min(le,n.length+Math.max(R-1,0)),_(le)};Dt(()=>{var z,le;(le=(z=m==null?void 0:m.current)==null?void 0:z.querySelector(`[tabIndex='${x}']`))==null||le.focus()},[x]);let[j,D]=Pn(()=>{let z=v.filter(le=>!le.disabled);return[z.every(le=>i.findIndex(pe=>pe.value===le.value)!==-1),z.length!==0]},[v,i]);Dt(()=>{$().then(b)},[E,n]);let X=qt();Op([Tr.ENTER],K,{target:X});let Z=f&&g&&!v.some(z=>(z==null?void 0:z.value)===g);return we("div",{className:"select-panel",role:"listbox",ref:m,children:[!c&&we("div",{className:"search",children:[P("input",{placeholder:t("search"),type:"text","aria-describedby":t("search"),onChange:L,onFocus:U,value:g,ref:p,tabIndex:0}),P("button",{type:"button",className:"search-clear-button",hidden:!g,onClick:S,"aria-label":t("clearSearch"),children:l||P(TO,{})})]}),we("ul",{className:"options",children:[u&&D&&P(IO,{tabIndex:R===1?0:1,checked:j,option:F,onSelectionChanged:T,onClick:()=>C(1),itemRenderer:o,disabled:a}),v.length?P(W4,{skipIndex:R,options:v,onClick:(z,le)=>C(le)}):Z?P("li",{onClick:K,className:"select-item creatable",tabIndex:1,ref:X,children:`${t("create")} "${g}"`}):P("li",{className:"no-options",children:t("noOptions")})]})]})},G4=q4,Z4=({expanded:t})=>P("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"dropdown-heading-dropdown-arrow gray",children:P("path",{d:t?"M18 15 12 9 6 15":"M6 9L12 15 18 9"})}),Y4=()=>{let{t,value:e,options:n,valueRenderer:r}=Ym(),i=e.length===0,s=e.length===n.length,o=r&&r(e,n);return i?P("span",{className:"gray",children:o||t("selectSomeItems")}):P("span",{children:o||(s?t("allItemsAreSelected"):e.map(a=>a.label).join(", "))})},K4=({size:t=24})=>P("span",{style:{width:t,marginRight:"0.2rem"},children:P("svg",{width:t,height:t,className:"spinner",viewBox:"0 0 50 50",style:{display:"inline",verticalAlign:"middle"},children:P("circle",{cx:"25",cy:"25",r:"20",fill:"none",className:"path"})})}),J4=()=>{let{t,onMenuToggle:e,ArrowRenderer:n,shouldToggleOnHover:r,isLoading:i,disabled:s,onChange:o,labelledBy:a,value:c,isOpen:u,defaultIsOpen:l,ClearSelectedIcon:d,closeOnChangedValue:f}=Ym();Dt(()=>{f&&g(!1)},[c]);let[h,m]=We(!0),[p,g]=We(l),[y,v]=We(!1),b=n||Z4,E=qt();F4(()=>{e&&e(p)},[p]),Dt(()=>{l===void 0&&typeof u=="boolean"&&(m(!1),g(u))},[u]);let w=L=>{var S;["text","button"].includes(L.target.type)&&[Tr.SPACE,Tr.ENTER].includes(L.code)||(h&&(L.code===Tr.ESCAPE?(g(!1),(S=E==null?void 0:E.current)==null||S.focus()):g(!0)),L.preventDefault())};Op([Tr.ENTER,Tr.ARROW_DOWN,Tr.SPACE,Tr.ESCAPE],w,{target:E});let x=L=>{h&&r&&g(L)},_=()=>!y&&v(!0),k=L=>{!L.currentTarget.contains(L.relatedTarget)&&h&&(v(!1),g(!1))},R=()=>x(!0),F=()=>x(!1),V=()=>{h&&g(i||s?!1:!p)},T=L=>{L.stopPropagation(),o([]),h&&g(!1)};return we("div",{tabIndex:0,className:"dropdown-container","aria-labelledby":a,"aria-expanded":p,"aria-readonly":!0,"aria-disabled":s,ref:E,onFocus:_,onBlur:k,onMouseEnter:R,onMouseLeave:F,children:[we("div",{className:"dropdown-heading",onClick:V,children:[P("div",{className:"dropdown-heading-value",children:P(Y4,{})}),i&&P(K4,{}),c.length>0&&d!==null&&P("button",{type:"button",className:"clear-selected-button",onClick:T,disabled:s,"aria-label":t("clearSelected"),children:d||P(TO,{})}),P(b,{expanded:p})]}),p&&P("div",{className:"dropdown-content",children:P("div",{className:"panel-content",children:P(G4,{})})})]})},X4=J4,Q4=t=>P(L4,{props:t,children:P("div",{className:`rmsc ${t.className||"multi-select"}`,children:P(X4,{})})}),eB=Q4;const tB=t=>{const{options:e,onChange:n,className:r,selected:i=[],selectProps:s={},...o}=t;return P(SO,{...o,children:P(eB,{className:Vt("checkbox-container w-[200px]",r),labelledBy:"Select",onChange:n,options:e,value:i,...s})})},nB=t=>{const{body:e,title:n,onSave:r,children:i,saveLabel:s,cancelLabel:o,overlayProps:a,contentProps:c,onOpenChange:u,...l}=t;return P(Xs,{contentProps:{...c,className:Vt("rounded-2xl",c==null?void 0:c.className)},onOpenChange:u,overlayProps:{...a,className:Vt("top-10",a==null?void 0:a.className)},...l,children:we("div",{className:"w-[432px] p-4 text-gray-900",children:[we("div",{className:"flex justify-between",children:[P("h1",{className:"text-center text-xl font-bold",children:n}),P("button",{className:"flex size-8 items-center justify-center rounded-md bg-gray-100 text-gray-500 outline-none hover:text-gray-900",onClick:()=>u==null?void 0:u(!1),children:P(vt,{name:"XmarkLight",size:24})})]}),P("div",{className:"mt-8 flex min-h-[50px] items-center justify-center rounded-md bg-slate-50 p-3 text-xs font-medium text-gray-600",children:e}),P("div",{className:"mt-4 flex flex-col gap-y-4",children:i}),we("div",{className:"mt-4 flex justify-end gap-x-4",children:[P(zn,{className:"text-gray-900",color:"light",onClick:()=>u==null?void 0:u(!1),children:o}),P(zn,{onClick:r,children:s})]})]})})},aS="min-h-[48px] min-w-[142px] text-base font-semibold py-3 px-6 rounded-xl outline-none active:opacity-75 hover:scale-105 transform transition-all";function rB(t){const{body:e,header:n,onOpenChange:r,onContinue:i,cancelLabel:s,continueLabel:o,overlayProps:a,contentProps:c,...u}=t;return P(Xs,{contentProps:{...c,className:Vt("rounded-3xl",c==null?void 0:c.className)},onOpenChange:r,overlayProps:{...a,className:a==null?void 0:a.className},...u,children:we("div",{className:"w-[400px] p-6 text-slate-300",children:[P("div",{className:"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800",children:n}),P("div",{className:"my-6 rounded-md bg-slate-50 p-4 text-center text-slate-200",children:e}),we("div",{className:"mt-8 flex justify-between gap-3",children:[P("button",{className:Vt(aS,"flex-1 bg-slate-50 text-slate-800"),onClick:()=>r==null?void 0:r(!1),children:s}),P("button",{className:Vt(aS,"flex-1 bg-gray-800 text-gray-50"),onClick:i,children:o})]})]})})}function Oo(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var OO={exports:{}};/*!
64
-
65
- JSZip v3.10.1 - A JavaScript class for generating and reading zip files
66
- <http://stuartk.com/jszip>
67
-
68
- (c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
69
- Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
70
-
71
- JSZip uses the library pako released under the MIT license :
72
- https://github.com/nodeca/pako/blob/main/LICENSE
73
- */(function(t,e){(function(n){t.exports=n()})(function(){return function n(r,i,s){function o(u,l){if(!i[u]){if(!r[u]){var d=typeof Oo=="function"&&Oo;if(!l&&d)return d(u,!0);if(a)return a(u,!0);var f=new Error("Cannot find module '"+u+"'");throw f.code="MODULE_NOT_FOUND",f}var h=i[u]={exports:{}};r[u][0].call(h.exports,function(m){var p=r[u][1][m];return o(p||m)},h,h.exports,n,r,i,s)}return i[u].exports}for(var a=typeof Oo=="function"&&Oo,c=0;c<s.length;c++)o(s[c]);return o}({1:[function(n,r,i){var s=n("./utils"),o=n("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i.encode=function(c){for(var u,l,d,f,h,m,p,g=[],y=0,v=c.length,b=v,E=s.getTypeOf(c)!=="string";y<c.length;)b=v-y,d=E?(u=c[y++],l=y<v?c[y++]:0,y<v?c[y++]:0):(u=c.charCodeAt(y++),l=y<v?c.charCodeAt(y++):0,y<v?c.charCodeAt(y++):0),f=u>>2,h=(3&u)<<4|l>>4,m=1<b?(15&l)<<2|d>>6:64,p=2<b?63&d:64,g.push(a.charAt(f)+a.charAt(h)+a.charAt(m)+a.charAt(p));return g.join("")},i.decode=function(c){var u,l,d,f,h,m,p=0,g=0,y="data:";if(c.substr(0,y.length)===y)throw new Error("Invalid base64 input, it looks like a data url.");var v,b=3*(c=c.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(c.charAt(c.length-1)===a.charAt(64)&&b--,c.charAt(c.length-2)===a.charAt(64)&&b--,b%1!=0)throw new Error("Invalid base64 input, bad content length.");for(v=o.uint8array?new Uint8Array(0|b):new Array(0|b);p<c.length;)u=a.indexOf(c.charAt(p++))<<2|(f=a.indexOf(c.charAt(p++)))>>4,l=(15&f)<<4|(h=a.indexOf(c.charAt(p++)))>>2,d=(3&h)<<6|(m=a.indexOf(c.charAt(p++))),v[g++]=u,h!==64&&(v[g++]=l),m!==64&&(v[g++]=d);return v}},{"./support":30,"./utils":32}],2:[function(n,r,i){var s=n("./external"),o=n("./stream/DataWorker"),a=n("./stream/Crc32Probe"),c=n("./stream/DataLengthProbe");function u(l,d,f,h,m){this.compressedSize=l,this.uncompressedSize=d,this.crc32=f,this.compression=h,this.compressedContent=m}u.prototype={getContentWorker:function(){var l=new o(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new c("data_length")),d=this;return l.on("end",function(){if(this.streamInfo.data_length!==d.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),l},getCompressedWorker:function(){return new o(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},u.createWorkerFrom=function(l,d,f){return l.pipe(new a).pipe(new c("uncompressedSize")).pipe(d.compressWorker(f)).pipe(new c("compressedSize")).withStreamInfo("compression",d)},r.exports=u},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,i){var s=n("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},i.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,i){var s=n("./utils"),o=function(){for(var a,c=[],u=0;u<256;u++){a=u;for(var l=0;l<8;l++)a=1&a?3988292384^a>>>1:a>>>1;c[u]=a}return c}();r.exports=function(a,c){return a!==void 0&&a.length?s.getTypeOf(a)!=="string"?function(u,l,d,f){var h=o,m=f+d;u^=-1;for(var p=f;p<m;p++)u=u>>>8^h[255&(u^l[p])];return-1^u}(0|c,a,a.length,0):function(u,l,d,f){var h=o,m=f+d;u^=-1;for(var p=f;p<m;p++)u=u>>>8^h[255&(u^l.charCodeAt(p))];return-1^u}(0|c,a,a.length,0):0}},{"./utils":32}],5:[function(n,r,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(n,r,i){var s=null;s=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:s}},{lie:37}],7:[function(n,r,i){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=n("pako"),a=n("./utils"),c=n("./stream/GenericWorker"),u=s?"uint8array":"array";function l(d,f){c.call(this,"FlateWorker/"+d),this._pako=null,this._pakoAction=d,this._pakoOptions=f,this.meta={}}i.magic="\b\0",a.inherits(l,c),l.prototype.processChunk=function(d){this.meta=d.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(u,d.data),!1)},l.prototype.flush=function(){c.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var d=this;this._pako.onData=function(f){d.push({data:f,meta:d.meta})}},i.compressWorker=function(d){return new l("Deflate",d)},i.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,i){function s(h,m){var p,g="";for(p=0;p<m;p++)g+=String.fromCharCode(255&h),h>>>=8;return g}function o(h,m,p,g,y,v){var b,E,w=h.file,x=h.compression,_=v!==u.utf8encode,k=a.transformTo("string",v(w.name)),R=a.transformTo("string",u.utf8encode(w.name)),F=w.comment,V=a.transformTo("string",v(F)),T=a.transformTo("string",u.utf8encode(F)),L=R.length!==w.name.length,S=T.length!==F.length,C="",N="",U="",K=w.dir,$=w.date,q={crc32:0,compressedSize:0,uncompressedSize:0};m&&!p||(q.crc32=h.crc32,q.compressedSize=h.compressedSize,q.uncompressedSize=h.uncompressedSize);var j=0;m&&(j|=8),_||!L&&!S||(j|=2048);var D=0,X=0;K&&(D|=16),y==="UNIX"?(X=798,D|=function(z,le){var pe=z;return z||(pe=le?16893:33204),(65535&pe)<<16}(w.unixPermissions,K)):(X=20,D|=function(z){return 63&(z||0)}(w.dosPermissions)),b=$.getUTCHours(),b<<=6,b|=$.getUTCMinutes(),b<<=5,b|=$.getUTCSeconds()/2,E=$.getUTCFullYear()-1980,E<<=4,E|=$.getUTCMonth()+1,E<<=5,E|=$.getUTCDate(),L&&(N=s(1,1)+s(l(k),4)+R,C+="up"+s(N.length,2)+N),S&&(U=s(1,1)+s(l(V),4)+T,C+="uc"+s(U.length,2)+U);var Z="";return Z+=`
74
- \0`,Z+=s(j,2),Z+=x.magic,Z+=s(b,2),Z+=s(E,2),Z+=s(q.crc32,4),Z+=s(q.compressedSize,4),Z+=s(q.uncompressedSize,4),Z+=s(k.length,2),Z+=s(C.length,2),{fileRecord:d.LOCAL_FILE_HEADER+Z+k+C,dirRecord:d.CENTRAL_FILE_HEADER+s(X,2)+Z+s(V.length,2)+"\0\0\0\0"+s(D,4)+s(g,4)+k+C+V}}var a=n("../utils"),c=n("../stream/GenericWorker"),u=n("../utf8"),l=n("../crc32"),d=n("../signature");function f(h,m,p,g){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=m,this.zipPlatform=p,this.encodeFileName=g,this.streamFiles=h,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(f,c),f.prototype.push=function(h){var m=h.meta.percent||0,p=this.entriesCount,g=this._sources.length;this.accumulate?this.contentBuffer.push(h):(this.bytesWritten+=h.data.length,c.prototype.push.call(this,{data:h.data,meta:{currentFile:this.currentFile,percent:p?(m+100*(p-g-1))/p:100}}))},f.prototype.openedSource=function(h){this.currentSourceOffset=this.bytesWritten,this.currentFile=h.file.name;var m=this.streamFiles&&!h.file.dir;if(m){var p=o(h,m,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:p.fileRecord,meta:{percent:0}})}else this.accumulate=!0},f.prototype.closedSource=function(h){this.accumulate=!1;var m=this.streamFiles&&!h.file.dir,p=o(h,m,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(p.dirRecord),m)this.push({data:function(g){return d.DATA_DESCRIPTOR+s(g.crc32,4)+s(g.compressedSize,4)+s(g.uncompressedSize,4)}(h),meta:{percent:100}});else for(this.push({data:p.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},f.prototype.flush=function(){for(var h=this.bytesWritten,m=0;m<this.dirRecords.length;m++)this.push({data:this.dirRecords[m],meta:{percent:100}});var p=this.bytesWritten-h,g=function(y,v,b,E,w){var x=a.transformTo("string",w(E));return d.CENTRAL_DIRECTORY_END+"\0\0\0\0"+s(y,2)+s(y,2)+s(v,4)+s(b,4)+s(x.length,2)+x}(this.dirRecords.length,p,h,this.zipComment,this.encodeFileName);this.push({data:g,meta:{percent:100}})},f.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},f.prototype.registerPrevious=function(h){this._sources.push(h);var m=this;return h.on("data",function(p){m.processChunk(p)}),h.on("end",function(){m.closedSource(m.previous.streamInfo),m._sources.length?m.prepareNextSource():m.end()}),h.on("error",function(p){m.error(p)}),this},f.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},f.prototype.error=function(h){var m=this._sources;if(!c.prototype.error.call(this,h))return!1;for(var p=0;p<m.length;p++)try{m[p].error(h)}catch{}return!0},f.prototype.lock=function(){c.prototype.lock.call(this);for(var h=this._sources,m=0;m<h.length;m++)h[m].lock()},r.exports=f},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(n,r,i){var s=n("../compressions"),o=n("./ZipFileWorker");i.generateWorker=function(a,c,u){var l=new o(c.streamFiles,u,c.platform,c.encodeFileName),d=0;try{a.forEach(function(f,h){d++;var m=function(v,b){var E=v||b,w=s[E];if(!w)throw new Error(E+" is not a valid compression method !");return w}(h.options.compression,c.compression),p=h.options.compressionOptions||c.compressionOptions||{},g=h.dir,y=h.date;h._compressWorker(m,p).withStreamInfo("file",{name:f,dir:g,date:y,comment:h.comment||"",unixPermissions:h.unixPermissions,dosPermissions:h.dosPermissions}).pipe(l)}),l.entriesCount=d}catch(f){l.error(f)}return l}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(n,r,i){function s(){if(!(this instanceof s))return new s;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var o=new s;for(var a in this)typeof this[a]!="function"&&(o[a]=this[a]);return o}}(s.prototype=n("./object")).loadAsync=n("./load"),s.support=n("./support"),s.defaults=n("./defaults"),s.version="3.10.1",s.loadAsync=function(o,a){return new s().loadAsync(o,a)},s.external=n("./external"),r.exports=s},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(n,r,i){var s=n("./utils"),o=n("./external"),a=n("./utf8"),c=n("./zipEntries"),u=n("./stream/Crc32Probe"),l=n("./nodejsUtils");function d(f){return new o.Promise(function(h,m){var p=f.decompressed.getContentWorker().pipe(new u);p.on("error",function(g){m(g)}).on("end",function(){p.streamInfo.crc32!==f.decompressed.crc32?m(new Error("Corrupted zip : CRC32 mismatch")):h()}).resume()})}r.exports=function(f,h){var m=this;return h=s.extend(h||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),l.isNode&&l.isStream(f)?o.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):s.prepareContent("the loaded zip file",f,!0,h.optimizedBinaryString,h.base64).then(function(p){var g=new c(h);return g.load(p),g}).then(function(p){var g=[o.Promise.resolve(p)],y=p.files;if(h.checkCRC32)for(var v=0;v<y.length;v++)g.push(d(y[v]));return o.Promise.all(g)}).then(function(p){for(var g=p.shift(),y=g.files,v=0;v<y.length;v++){var b=y[v],E=b.fileNameStr,w=s.resolve(b.fileNameStr);m.file(w,b.decompressed,{binary:!0,optimizedBinaryString:!0,date:b.date,dir:b.dir,comment:b.fileCommentStr.length?b.fileCommentStr:null,unixPermissions:b.unixPermissions,dosPermissions:b.dosPermissions,createFolders:h.createFolders}),b.dir||(m.file(w).unsafeOriginalName=E)}return g.zipComment.length&&(m.comment=g.zipComment),m})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(n,r,i){var s=n("../utils"),o=n("../stream/GenericWorker");function a(c,u){o.call(this,"Nodejs stream input adapter for "+c),this._upstreamEnded=!1,this._bindStream(u)}s.inherits(a,o),a.prototype._bindStream=function(c){var u=this;(this._stream=c).pause(),c.on("data",function(l){u.push({data:l,meta:{percent:0}})}).on("error",function(l){u.isPaused?this.generatedError=l:u.error(l)}).on("end",function(){u.isPaused?u._upstreamEnded=!0:u.end()})},a.prototype.pause=function(){return!!o.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(n,r,i){var s=n("readable-stream").Readable;function o(a,c,u){s.call(this,c),this._helper=a;var l=this;a.on("data",function(d,f){l.push(d)||l._helper.pause(),u&&u(f)}).on("error",function(d){l.emit("error",d)}).on("end",function(){l.push(null)})}n("../utils").inherits(o,s),o.prototype._read=function(){this._helper.resume()},r.exports=o},{"../utils":32,"readable-stream":16}],14:[function(n,r,i){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(s,o){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(s,o);if(typeof s=="number")throw new Error('The "data" argument must not be a number');return new Buffer(s,o)},allocBuffer:function(s){if(Buffer.alloc)return Buffer.alloc(s);var o=new Buffer(s);return o.fill(0),o},isBuffer:function(s){return Buffer.isBuffer(s)},isStream:function(s){return s&&typeof s.on=="function"&&typeof s.pause=="function"&&typeof s.resume=="function"}}},{}],15:[function(n,r,i){function s(w,x,_){var k,R=a.getTypeOf(x),F=a.extend(_||{},l);F.date=F.date||new Date,F.compression!==null&&(F.compression=F.compression.toUpperCase()),typeof F.unixPermissions=="string"&&(F.unixPermissions=parseInt(F.unixPermissions,8)),F.unixPermissions&&16384&F.unixPermissions&&(F.dir=!0),F.dosPermissions&&16&F.dosPermissions&&(F.dir=!0),F.dir&&(w=y(w)),F.createFolders&&(k=g(w))&&v.call(this,k,!0);var V=R==="string"&&F.binary===!1&&F.base64===!1;_&&_.binary!==void 0||(F.binary=!V),(x instanceof d&&x.uncompressedSize===0||F.dir||!x||x.length===0)&&(F.base64=!1,F.binary=!0,x="",F.compression="STORE",R="string");var T=null;T=x instanceof d||x instanceof c?x:m.isNode&&m.isStream(x)?new p(w,x):a.prepareContent(w,x,F.binary,F.optimizedBinaryString,F.base64);var L=new f(w,T,F);this.files[w]=L}var o=n("./utf8"),a=n("./utils"),c=n("./stream/GenericWorker"),u=n("./stream/StreamHelper"),l=n("./defaults"),d=n("./compressedObject"),f=n("./zipObject"),h=n("./generate"),m=n("./nodejsUtils"),p=n("./nodejs/NodejsStreamInputAdapter"),g=function(w){w.slice(-1)==="/"&&(w=w.substring(0,w.length-1));var x=w.lastIndexOf("/");return 0<x?w.substring(0,x):""},y=function(w){return w.slice(-1)!=="/"&&(w+="/"),w},v=function(w,x){return x=x!==void 0?x:l.createFolders,w=y(w),this.files[w]||s.call(this,w,null,{dir:!0,createFolders:x}),this.files[w]};function b(w){return Object.prototype.toString.call(w)==="[object RegExp]"}var E={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(w){var x,_,k;for(x in this.files)k=this.files[x],(_=x.slice(this.root.length,x.length))&&x.slice(0,this.root.length)===this.root&&w(_,k)},filter:function(w){var x=[];return this.forEach(function(_,k){w(_,k)&&x.push(k)}),x},file:function(w,x,_){if(arguments.length!==1)return w=this.root+w,s.call(this,w,x,_),this;if(b(w)){var k=w;return this.filter(function(F,V){return!V.dir&&k.test(F)})}var R=this.files[this.root+w];return R&&!R.dir?R:null},folder:function(w){if(!w)return this;if(b(w))return this.filter(function(R,F){return F.dir&&w.test(R)});var x=this.root+w,_=v.call(this,x),k=this.clone();return k.root=_.name,k},remove:function(w){w=this.root+w;var x=this.files[w];if(x||(w.slice(-1)!=="/"&&(w+="/"),x=this.files[w]),x&&!x.dir)delete this.files[w];else for(var _=this.filter(function(R,F){return F.name.slice(0,w.length)===w}),k=0;k<_.length;k++)delete this.files[_[k].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(w){var x,_={};try{if((_=a.extend(w||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:o.utf8encode})).type=_.type.toLowerCase(),_.compression=_.compression.toUpperCase(),_.type==="binarystring"&&(_.type="string"),!_.type)throw new Error("No output type specified.");a.checkSupport(_.type),_.platform!=="darwin"&&_.platform!=="freebsd"&&_.platform!=="linux"&&_.platform!=="sunos"||(_.platform="UNIX"),_.platform==="win32"&&(_.platform="DOS");var k=_.comment||this.comment||"";x=h.generateWorker(this,_,k)}catch(R){(x=new c("error")).error(R)}return new u(x,_.type||"string",_.mimeType)},generateAsync:function(w,x){return this.generateInternalStream(w).accumulate(x)},generateNodeStream:function(w,x){return(w=w||{}).type||(w.type="nodebuffer"),this.generateInternalStream(w).toNodejsStream(x)}};r.exports=E},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(n,r,i){r.exports=n("stream")},{stream:void 0}],17:[function(n,r,i){var s=n("./DataReader");function o(a){s.call(this,a);for(var c=0;c<this.data.length;c++)a[c]=255&a[c]}n("../utils").inherits(o,s),o.prototype.byteAt=function(a){return this.data[this.zero+a]},o.prototype.lastIndexOfSignature=function(a){for(var c=a.charCodeAt(0),u=a.charCodeAt(1),l=a.charCodeAt(2),d=a.charCodeAt(3),f=this.length-4;0<=f;--f)if(this.data[f]===c&&this.data[f+1]===u&&this.data[f+2]===l&&this.data[f+3]===d)return f-this.zero;return-1},o.prototype.readAndCheckSignature=function(a){var c=a.charCodeAt(0),u=a.charCodeAt(1),l=a.charCodeAt(2),d=a.charCodeAt(3),f=this.readData(4);return c===f[0]&&u===f[1]&&l===f[2]&&d===f[3]},o.prototype.readData=function(a){if(this.checkOffset(a),a===0)return[];var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=o},{"../utils":32,"./DataReader":18}],18:[function(n,r,i){var s=n("../utils");function o(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}o.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||a<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var c,u=0;for(this.checkOffset(a),c=this.index+a-1;c>=this.index;c--)u=(u<<8)+this.byteAt(c);return this.index+=a,u},readString:function(a){return s.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},r.exports=o},{"../utils":32}],19:[function(n,r,i){var s=n("./Uint8ArrayReader");function o(a){s.call(this,a)}n("../utils").inherits(o,s),o.prototype.readData=function(a){this.checkOffset(a);var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,i){var s=n("./DataReader");function o(a){s.call(this,a)}n("../utils").inherits(o,s),o.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},o.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},o.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},o.prototype.readData=function(a){this.checkOffset(a);var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=o},{"../utils":32,"./DataReader":18}],21:[function(n,r,i){var s=n("./ArrayReader");function o(a){s.call(this,a)}n("../utils").inherits(o,s),o.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,i){var s=n("../utils"),o=n("../support"),a=n("./ArrayReader"),c=n("./StringReader"),u=n("./NodeBufferReader"),l=n("./Uint8ArrayReader");r.exports=function(d){var f=s.getTypeOf(d);return s.checkSupport(f),f!=="string"||o.uint8array?f==="nodebuffer"?new u(d):o.uint8array?new l(s.transformTo("uint8array",d)):new a(s.transformTo("array",d)):new c(d)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,i){var s=n("./GenericWorker"),o=n("../utils");function a(c){s.call(this,"ConvertWorker to "+c),this.destType=c}o.inherits(a,s),a.prototype.processChunk=function(c){this.push({data:o.transformTo(this.destType,c.data),meta:c.meta})},r.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,i){var s=n("./GenericWorker"),o=n("../crc32");function a(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(a,s),a.prototype.processChunk=function(c){this.streamInfo.crc32=o(c.data,this.streamInfo.crc32||0),this.push(c)},r.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,i){var s=n("../utils"),o=n("./GenericWorker");function a(c){o.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}s.inherits(a,o),a.prototype.processChunk=function(c){if(c){var u=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=u+c.data.length}o.prototype.processChunk.call(this,c)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,i){var s=n("../utils"),o=n("./GenericWorker");function a(c){o.call(this,"DataWorker");var u=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(l){u.dataIsReady=!0,u.data=l,u.max=l&&l.length||0,u.type=s.getTypeOf(l),u.isPaused||u._tickAndRepeat()},function(l){u.error(l)})}s.inherits(a,o),a.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,u=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,u);break;case"uint8array":c=this.data.subarray(this.index,u);break;case"array":case"nodebuffer":c=this.data.slice(this.index,u)}return this.index=u,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,i){function s(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}s.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,a){return this._listeners[o].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,a){if(this._listeners[o])for(var c=0;c<this._listeners[o].length;c++)this._listeners[o][c].call(this,a)},pipe:function(o){return o.registerPrevious(this)},registerPrevious:function(o){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=o.streamInfo,this.mergeStreamInfo(),this.previous=o;var a=this;return o.on("data",function(c){a.processChunk(c)}),o.on("end",function(){a.end()}),o.on("error",function(c){a.error(c)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var o=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),o=!0),this.previous&&this.previous.resume(),!o},flush:function(){},processChunk:function(o){this.push(o)},withStreamInfo:function(o,a){return this.extraStreamInfo[o]=a,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var o in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,o)&&(this.streamInfo[o]=this.extraStreamInfo[o])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var o="Worker "+this.name;return this.previous?this.previous+" -> "+o:o}},r.exports=s},{}],29:[function(n,r,i){var s=n("../utils"),o=n("./ConvertWorker"),a=n("./GenericWorker"),c=n("../base64"),u=n("../support"),l=n("../external"),d=null;if(u.nodestream)try{d=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function f(m,p){return new l.Promise(function(g,y){var v=[],b=m._internalType,E=m._outputType,w=m._mimeType;m.on("data",function(x,_){v.push(x),p&&p(_)}).on("error",function(x){v=[],y(x)}).on("end",function(){try{var x=function(_,k,R){switch(_){case"blob":return s.newBlob(s.transformTo("arraybuffer",k),R);case"base64":return c.encode(k);default:return s.transformTo(_,k)}}(E,function(_,k){var R,F=0,V=null,T=0;for(R=0;R<k.length;R++)T+=k[R].length;switch(_){case"string":return k.join("");case"array":return Array.prototype.concat.apply([],k);case"uint8array":for(V=new Uint8Array(T),R=0;R<k.length;R++)V.set(k[R],F),F+=k[R].length;return V;case"nodebuffer":return Buffer.concat(k);default:throw new Error("concat : unsupported type '"+_+"'")}}(b,v),w);g(x)}catch(_){y(_)}v=[]}).resume()})}function h(m,p,g){var y=p;switch(p){case"blob":case"arraybuffer":y="uint8array";break;case"base64":y="string"}try{this._internalType=y,this._outputType=p,this._mimeType=g,s.checkSupport(y),this._worker=m.pipe(new o(y)),m.lock()}catch(v){this._worker=new a("error"),this._worker.error(v)}}h.prototype={accumulate:function(m){return f(this,m)},on:function(m,p){var g=this;return m==="data"?this._worker.on(m,function(y){p.call(g,y.data,y.meta)}):this._worker.on(m,function(){s.delay(p,arguments,g)}),this},resume:function(){return s.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(m){if(s.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new d(this,{objectMode:this._outputType!=="nodebuffer"},m)}},r.exports=h},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(n,r,i){if(i.base64=!0,i.array=!0,i.string=!0,i.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",i.nodebuffer=typeof Buffer<"u",i.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")i.blob=!1;else{var s=new ArrayBuffer(0);try{i.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(s),i.blob=o.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!n("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,i){for(var s=n("./utils"),o=n("./support"),a=n("./nodejsUtils"),c=n("./stream/GenericWorker"),u=new Array(256),l=0;l<256;l++)u[l]=252<=l?6:248<=l?5:240<=l?4:224<=l?3:192<=l?2:1;u[254]=u[254]=1;function d(){c.call(this,"utf-8 decode"),this.leftOver=null}function f(){c.call(this,"utf-8 encode")}i.utf8encode=function(h){return o.nodebuffer?a.newBufferFrom(h,"utf-8"):function(m){var p,g,y,v,b,E=m.length,w=0;for(v=0;v<E;v++)(64512&(g=m.charCodeAt(v)))==55296&&v+1<E&&(64512&(y=m.charCodeAt(v+1)))==56320&&(g=65536+(g-55296<<10)+(y-56320),v++),w+=g<128?1:g<2048?2:g<65536?3:4;for(p=o.uint8array?new Uint8Array(w):new Array(w),v=b=0;b<w;v++)(64512&(g=m.charCodeAt(v)))==55296&&v+1<E&&(64512&(y=m.charCodeAt(v+1)))==56320&&(g=65536+(g-55296<<10)+(y-56320),v++),g<128?p[b++]=g:(g<2048?p[b++]=192|g>>>6:(g<65536?p[b++]=224|g>>>12:(p[b++]=240|g>>>18,p[b++]=128|g>>>12&63),p[b++]=128|g>>>6&63),p[b++]=128|63&g);return p}(h)},i.utf8decode=function(h){return o.nodebuffer?s.transformTo("nodebuffer",h).toString("utf-8"):function(m){var p,g,y,v,b=m.length,E=new Array(2*b);for(p=g=0;p<b;)if((y=m[p++])<128)E[g++]=y;else if(4<(v=u[y]))E[g++]=65533,p+=v-1;else{for(y&=v===2?31:v===3?15:7;1<v&&p<b;)y=y<<6|63&m[p++],v--;1<v?E[g++]=65533:y<65536?E[g++]=y:(y-=65536,E[g++]=55296|y>>10&1023,E[g++]=56320|1023&y)}return E.length!==g&&(E.subarray?E=E.subarray(0,g):E.length=g),s.applyFromCharCode(E)}(h=s.transformTo(o.uint8array?"uint8array":"array",h))},s.inherits(d,c),d.prototype.processChunk=function(h){var m=s.transformTo(o.uint8array?"uint8array":"array",h.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var p=m;(m=new Uint8Array(p.length+this.leftOver.length)).set(this.leftOver,0),m.set(p,this.leftOver.length)}else m=this.leftOver.concat(m);this.leftOver=null}var g=function(v,b){var E;for((b=b||v.length)>v.length&&(b=v.length),E=b-1;0<=E&&(192&v[E])==128;)E--;return E<0||E===0?b:E+u[v[E]]>b?E:b}(m),y=m;g!==m.length&&(o.uint8array?(y=m.subarray(0,g),this.leftOver=m.subarray(g,m.length)):(y=m.slice(0,g),this.leftOver=m.slice(g,m.length))),this.push({data:i.utf8decode(y),meta:h.meta})},d.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=d,s.inherits(f,c),f.prototype.processChunk=function(h){this.push({data:i.utf8encode(h.data),meta:h.meta})},i.Utf8EncodeWorker=f},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,i){var s=n("./support"),o=n("./base64"),a=n("./nodejsUtils"),c=n("./external");function u(p){return p}function l(p,g){for(var y=0;y<p.length;++y)g[y]=255&p.charCodeAt(y);return g}n("setimmediate"),i.newBlob=function(p,g){i.checkSupport("blob");try{return new Blob([p],{type:g})}catch{try{var y=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return y.append(p),y.getBlob(g)}catch{throw new Error("Bug : can't construct the Blob.")}}};var d={stringifyByChunk:function(p,g,y){var v=[],b=0,E=p.length;if(E<=y)return String.fromCharCode.apply(null,p);for(;b<E;)g==="array"||g==="nodebuffer"?v.push(String.fromCharCode.apply(null,p.slice(b,Math.min(b+y,E)))):v.push(String.fromCharCode.apply(null,p.subarray(b,Math.min(b+y,E)))),b+=y;return v.join("")},stringifyByChar:function(p){for(var g="",y=0;y<p.length;y++)g+=String.fromCharCode(p[y]);return g},applyCanBeUsed:{uint8array:function(){try{return s.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return s.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}}()}};function f(p){var g=65536,y=i.getTypeOf(p),v=!0;if(y==="uint8array"?v=d.applyCanBeUsed.uint8array:y==="nodebuffer"&&(v=d.applyCanBeUsed.nodebuffer),v)for(;1<g;)try{return d.stringifyByChunk(p,y,g)}catch{g=Math.floor(g/2)}return d.stringifyByChar(p)}function h(p,g){for(var y=0;y<p.length;y++)g[y]=p[y];return g}i.applyFromCharCode=f;var m={};m.string={string:u,array:function(p){return l(p,new Array(p.length))},arraybuffer:function(p){return m.string.uint8array(p).buffer},uint8array:function(p){return l(p,new Uint8Array(p.length))},nodebuffer:function(p){return l(p,a.allocBuffer(p.length))}},m.array={string:f,array:u,arraybuffer:function(p){return new Uint8Array(p).buffer},uint8array:function(p){return new Uint8Array(p)},nodebuffer:function(p){return a.newBufferFrom(p)}},m.arraybuffer={string:function(p){return f(new Uint8Array(p))},array:function(p){return h(new Uint8Array(p),new Array(p.byteLength))},arraybuffer:u,uint8array:function(p){return new Uint8Array(p)},nodebuffer:function(p){return a.newBufferFrom(new Uint8Array(p))}},m.uint8array={string:f,array:function(p){return h(p,new Array(p.length))},arraybuffer:function(p){return p.buffer},uint8array:u,nodebuffer:function(p){return a.newBufferFrom(p)}},m.nodebuffer={string:f,array:function(p){return h(p,new Array(p.length))},arraybuffer:function(p){return m.nodebuffer.uint8array(p).buffer},uint8array:function(p){return h(p,new Uint8Array(p.length))},nodebuffer:u},i.transformTo=function(p,g){if(g=g||"",!p)return g;i.checkSupport(p);var y=i.getTypeOf(g);return m[y][p](g)},i.resolve=function(p){for(var g=p.split("/"),y=[],v=0;v<g.length;v++){var b=g[v];b==="."||b===""&&v!==0&&v!==g.length-1||(b===".."?y.pop():y.push(b))}return y.join("/")},i.getTypeOf=function(p){return typeof p=="string"?"string":Object.prototype.toString.call(p)==="[object Array]"?"array":s.nodebuffer&&a.isBuffer(p)?"nodebuffer":s.uint8array&&p instanceof Uint8Array?"uint8array":s.arraybuffer&&p instanceof ArrayBuffer?"arraybuffer":void 0},i.checkSupport=function(p){if(!s[p.toLowerCase()])throw new Error(p+" is not supported by this platform")},i.MAX_VALUE_16BITS=65535,i.MAX_VALUE_32BITS=-1,i.pretty=function(p){var g,y,v="";for(y=0;y<(p||"").length;y++)v+="\\x"+((g=p.charCodeAt(y))<16?"0":"")+g.toString(16).toUpperCase();return v},i.delay=function(p,g,y){setImmediate(function(){p.apply(y||null,g||[])})},i.inherits=function(p,g){function y(){}y.prototype=g.prototype,p.prototype=new y},i.extend=function(){var p,g,y={};for(p=0;p<arguments.length;p++)for(g in arguments[p])Object.prototype.hasOwnProperty.call(arguments[p],g)&&y[g]===void 0&&(y[g]=arguments[p][g]);return y},i.prepareContent=function(p,g,y,v,b){return c.Promise.resolve(g).then(function(E){return s.blob&&(E instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(E))!==-1)&&typeof FileReader<"u"?new c.Promise(function(w,x){var _=new FileReader;_.onload=function(k){w(k.target.result)},_.onerror=function(k){x(k.target.error)},_.readAsArrayBuffer(E)}):E}).then(function(E){var w=i.getTypeOf(E);return w?(w==="arraybuffer"?E=i.transformTo("uint8array",E):w==="string"&&(b?E=o.decode(E):y&&v!==!0&&(E=function(x){return l(x,s.uint8array?new Uint8Array(x.length):new Array(x.length))}(E))),E):c.Promise.reject(new Error("Can't read the data of '"+p+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(n,r,i){var s=n("./reader/readerFor"),o=n("./utils"),a=n("./signature"),c=n("./zipEntry"),u=n("./support");function l(d){this.files=[],this.loadOptions=d}l.prototype={checkSignature:function(d){if(!this.reader.readAndCheckSignature(d)){this.reader.index-=4;var f=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+o.pretty(f)+", expected "+o.pretty(d)+")")}},isSignature:function(d,f){var h=this.reader.index;this.reader.setIndex(d);var m=this.reader.readString(4)===f;return this.reader.setIndex(h),m},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var d=this.reader.readData(this.zipCommentLength),f=u.uint8array?"uint8array":"array",h=o.transformTo(f,d);this.zipComment=this.loadOptions.decodeFileName(h)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var d,f,h,m=this.zip64EndOfCentralSize-44;0<m;)d=this.reader.readInt(2),f=this.reader.readInt(4),h=this.reader.readData(f),this.zip64ExtensibleData[d]={id:d,length:f,value:h}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var d,f;for(d=0;d<this.files.length;d++)f=this.files[d],this.reader.setIndex(f.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),f.readLocalPart(this.reader),f.handleUTF8(),f.processAttributes()},readCentralDir:function(){var d;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(d=new c({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(d);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var d=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(d<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(d);var f=d;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===o.MAX_VALUE_16BITS||this.diskWithCentralDirStart===o.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===o.MAX_VALUE_16BITS||this.centralDirRecords===o.MAX_VALUE_16BITS||this.centralDirSize===o.MAX_VALUE_32BITS||this.centralDirOffset===o.MAX_VALUE_32BITS){if(this.zip64=!0,(d=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(d),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var h=this.centralDirOffset+this.centralDirSize;this.zip64&&(h+=20,h+=12+this.zip64EndOfCentralSize);var m=f-h;if(0<m)this.isSignature(f,a.CENTRAL_FILE_HEADER)||(this.reader.zero=m);else if(m<0)throw new Error("Corrupted zip: missing "+Math.abs(m)+" bytes.")},prepareReader:function(d){this.reader=s(d)},load:function(d){this.prepareReader(d),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=l},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(n,r,i){var s=n("./reader/readerFor"),o=n("./utils"),a=n("./compressedObject"),c=n("./crc32"),u=n("./utf8"),l=n("./compressions"),d=n("./support");function f(h,m){this.options=h,this.loadOptions=m}f.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(h){var m,p;if(h.skip(22),this.fileNameLength=h.readInt(2),p=h.readInt(2),this.fileName=h.readData(this.fileNameLength),h.skip(p),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((m=function(g){for(var y in l)if(Object.prototype.hasOwnProperty.call(l,y)&&l[y].magic===g)return l[y];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+o.pretty(this.compressionMethod)+" unknown (inner file : "+o.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,m,h.readData(this.compressedSize))},readCentralPart:function(h){this.versionMadeBy=h.readInt(2),h.skip(2),this.bitFlag=h.readInt(2),this.compressionMethod=h.readString(2),this.date=h.readDate(),this.crc32=h.readInt(4),this.compressedSize=h.readInt(4),this.uncompressedSize=h.readInt(4);var m=h.readInt(2);if(this.extraFieldsLength=h.readInt(2),this.fileCommentLength=h.readInt(2),this.diskNumberStart=h.readInt(2),this.internalFileAttributes=h.readInt(2),this.externalFileAttributes=h.readInt(4),this.localHeaderOffset=h.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");h.skip(m),this.readExtraFields(h),this.parseZIP64ExtraField(h),this.fileComment=h.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var h=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),h==0&&(this.dosPermissions=63&this.externalFileAttributes),h==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var h=s(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=h.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=h.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=h.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=h.readInt(4))}},readExtraFields:function(h){var m,p,g,y=h.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});h.index+4<y;)m=h.readInt(2),p=h.readInt(2),g=h.readData(p),this.extraFields[m]={id:m,length:p,value:g};h.setIndex(y)},handleUTF8:function(){var h=d.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=u.utf8decode(this.fileName),this.fileCommentStr=u.utf8decode(this.fileComment);else{var m=this.findExtraFieldUnicodePath();if(m!==null)this.fileNameStr=m;else{var p=o.transformTo(h,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(p)}var g=this.findExtraFieldUnicodeComment();if(g!==null)this.fileCommentStr=g;else{var y=o.transformTo(h,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(y)}}},findExtraFieldUnicodePath:function(){var h=this.extraFields[28789];if(h){var m=s(h.value);return m.readInt(1)!==1||c(this.fileName)!==m.readInt(4)?null:u.utf8decode(m.readData(h.length-5))}return null},findExtraFieldUnicodeComment:function(){var h=this.extraFields[25461];if(h){var m=s(h.value);return m.readInt(1)!==1||c(this.fileComment)!==m.readInt(4)?null:u.utf8decode(m.readData(h.length-5))}return null}},r.exports=f},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(n,r,i){function s(m,p,g){this.name=m,this.dir=g.dir,this.date=g.date,this.comment=g.comment,this.unixPermissions=g.unixPermissions,this.dosPermissions=g.dosPermissions,this._data=p,this._dataBinary=g.binary,this.options={compression:g.compression,compressionOptions:g.compressionOptions}}var o=n("./stream/StreamHelper"),a=n("./stream/DataWorker"),c=n("./utf8"),u=n("./compressedObject"),l=n("./stream/GenericWorker");s.prototype={internalStream:function(m){var p=null,g="string";try{if(!m)throw new Error("No output type specified.");var y=(g=m.toLowerCase())==="string"||g==="text";g!=="binarystring"&&g!=="text"||(g="string"),p=this._decompressWorker();var v=!this._dataBinary;v&&!y&&(p=p.pipe(new c.Utf8EncodeWorker)),!v&&y&&(p=p.pipe(new c.Utf8DecodeWorker))}catch(b){(p=new l("error")).error(b)}return new o(p,g,"")},async:function(m,p){return this.internalStream(m).accumulate(p)},nodeStream:function(m,p){return this.internalStream(m||"nodebuffer").toNodejsStream(p)},_compressWorker:function(m,p){if(this._data instanceof u&&this._data.compression.magic===m.magic)return this._data.getCompressedWorker();var g=this._decompressWorker();return this._dataBinary||(g=g.pipe(new c.Utf8EncodeWorker)),u.createWorkerFrom(g,m,p)},_decompressWorker:function(){return this._data instanceof u?this._data.getContentWorker():this._data instanceof l?this._data:new a(this._data)}};for(var d=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],f=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},h=0;h<d.length;h++)s.prototype[d[h]]=f;r.exports=s},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(n,r,i){(function(s){var o,a,c=s.MutationObserver||s.WebKitMutationObserver;if(c){var u=0,l=new c(m),d=s.document.createTextNode("");l.observe(d,{characterData:!0}),o=function(){d.data=u=++u%2}}else if(s.setImmediate||s.MessageChannel===void 0)o="document"in s&&"onreadystatechange"in s.document.createElement("script")?function(){var p=s.document.createElement("script");p.onreadystatechange=function(){m(),p.onreadystatechange=null,p.parentNode.removeChild(p),p=null},s.document.documentElement.appendChild(p)}:function(){setTimeout(m,0)};else{var f=new s.MessageChannel;f.port1.onmessage=m,o=function(){f.port2.postMessage(0)}}var h=[];function m(){var p,g;a=!0;for(var y=h.length;y;){for(g=h,h=[],p=-1;++p<y;)g[p]();y=h.length}a=!1}r.exports=function(p){h.push(p)!==1||a||o()}}).call(this,typeof rr<"u"?rr:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(n,r,i){var s=n("immediate");function o(){}var a={},c=["REJECTED"],u=["FULFILLED"],l=["PENDING"];function d(y){if(typeof y!="function")throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,y!==o&&p(this,y)}function f(y,v,b){this.promise=y,typeof v=="function"&&(this.onFulfilled=v,this.callFulfilled=this.otherCallFulfilled),typeof b=="function"&&(this.onRejected=b,this.callRejected=this.otherCallRejected)}function h(y,v,b){s(function(){var E;try{E=v(b)}catch(w){return a.reject(y,w)}E===y?a.reject(y,new TypeError("Cannot resolve promise with itself")):a.resolve(y,E)})}function m(y){var v=y&&y.then;if(y&&(typeof y=="object"||typeof y=="function")&&typeof v=="function")return function(){v.apply(y,arguments)}}function p(y,v){var b=!1;function E(_){b||(b=!0,a.reject(y,_))}function w(_){b||(b=!0,a.resolve(y,_))}var x=g(function(){v(w,E)});x.status==="error"&&E(x.value)}function g(y,v){var b={};try{b.value=y(v),b.status="success"}catch(E){b.status="error",b.value=E}return b}(r.exports=d).prototype.finally=function(y){if(typeof y!="function")return this;var v=this.constructor;return this.then(function(b){return v.resolve(y()).then(function(){return b})},function(b){return v.resolve(y()).then(function(){throw b})})},d.prototype.catch=function(y){return this.then(null,y)},d.prototype.then=function(y,v){if(typeof y!="function"&&this.state===u||typeof v!="function"&&this.state===c)return this;var b=new this.constructor(o);return this.state!==l?h(b,this.state===u?y:v,this.outcome):this.queue.push(new f(b,y,v)),b},f.prototype.callFulfilled=function(y){a.resolve(this.promise,y)},f.prototype.otherCallFulfilled=function(y){h(this.promise,this.onFulfilled,y)},f.prototype.callRejected=function(y){a.reject(this.promise,y)},f.prototype.otherCallRejected=function(y){h(this.promise,this.onRejected,y)},a.resolve=function(y,v){var b=g(m,v);if(b.status==="error")return a.reject(y,b.value);var E=b.value;if(E)p(y,E);else{y.state=u,y.outcome=v;for(var w=-1,x=y.queue.length;++w<x;)y.queue[w].callFulfilled(v)}return y},a.reject=function(y,v){y.state=c,y.outcome=v;for(var b=-1,E=y.queue.length;++b<E;)y.queue[b].callRejected(v);return y},d.resolve=function(y){return y instanceof this?y:a.resolve(new this(o),y)},d.reject=function(y){var v=new this(o);return a.reject(v,y)},d.all=function(y){var v=this;if(Object.prototype.toString.call(y)!=="[object Array]")return this.reject(new TypeError("must be an array"));var b=y.length,E=!1;if(!b)return this.resolve([]);for(var w=new Array(b),x=0,_=-1,k=new this(o);++_<b;)R(y[_],_);return k;function R(F,V){v.resolve(F).then(function(T){w[V]=T,++x!==b||E||(E=!0,a.resolve(k,w))},function(T){E||(E=!0,a.reject(k,T))})}},d.race=function(y){var v=this;if(Object.prototype.toString.call(y)!=="[object Array]")return this.reject(new TypeError("must be an array"));var b=y.length,E=!1;if(!b)return this.resolve([]);for(var w=-1,x=new this(o);++w<b;)_=y[w],v.resolve(_).then(function(k){E||(E=!0,a.resolve(x,k))},function(k){E||(E=!0,a.reject(x,k))});var _;return x}},{immediate:36}],38:[function(n,r,i){var s={};(0,n("./lib/utils/common").assign)(s,n("./lib/deflate"),n("./lib/inflate"),n("./lib/zlib/constants")),r.exports=s},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(n,r,i){var s=n("./zlib/deflate"),o=n("./utils/common"),a=n("./utils/strings"),c=n("./zlib/messages"),u=n("./zlib/zstream"),l=Object.prototype.toString,d=0,f=-1,h=0,m=8;function p(y){if(!(this instanceof p))return new p(y);this.options=o.assign({level:f,method:m,chunkSize:16384,windowBits:15,memLevel:8,strategy:h,to:""},y||{});var v=this.options;v.raw&&0<v.windowBits?v.windowBits=-v.windowBits:v.gzip&&0<v.windowBits&&v.windowBits<16&&(v.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var b=s.deflateInit2(this.strm,v.level,v.method,v.windowBits,v.memLevel,v.strategy);if(b!==d)throw new Error(c[b]);if(v.header&&s.deflateSetHeader(this.strm,v.header),v.dictionary){var E;if(E=typeof v.dictionary=="string"?a.string2buf(v.dictionary):l.call(v.dictionary)==="[object ArrayBuffer]"?new Uint8Array(v.dictionary):v.dictionary,(b=s.deflateSetDictionary(this.strm,E))!==d)throw new Error(c[b]);this._dict_set=!0}}function g(y,v){var b=new p(v);if(b.push(y,!0),b.err)throw b.msg||c[b.err];return b.result}p.prototype.push=function(y,v){var b,E,w=this.strm,x=this.options.chunkSize;if(this.ended)return!1;E=v===~~v?v:v===!0?4:0,typeof y=="string"?w.input=a.string2buf(y):l.call(y)==="[object ArrayBuffer]"?w.input=new Uint8Array(y):w.input=y,w.next_in=0,w.avail_in=w.input.length;do{if(w.avail_out===0&&(w.output=new o.Buf8(x),w.next_out=0,w.avail_out=x),(b=s.deflate(w,E))!==1&&b!==d)return this.onEnd(b),!(this.ended=!0);w.avail_out!==0&&(w.avail_in!==0||E!==4&&E!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(o.shrinkBuf(w.output,w.next_out))):this.onData(o.shrinkBuf(w.output,w.next_out)))}while((0<w.avail_in||w.avail_out===0)&&b!==1);return E===4?(b=s.deflateEnd(this.strm),this.onEnd(b),this.ended=!0,b===d):E!==2||(this.onEnd(d),!(w.avail_out=0))},p.prototype.onData=function(y){this.chunks.push(y)},p.prototype.onEnd=function(y){y===d&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=y,this.msg=this.strm.msg},i.Deflate=p,i.deflate=g,i.deflateRaw=function(y,v){return(v=v||{}).raw=!0,g(y,v)},i.gzip=function(y,v){return(v=v||{}).gzip=!0,g(y,v)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(n,r,i){var s=n("./zlib/inflate"),o=n("./utils/common"),a=n("./utils/strings"),c=n("./zlib/constants"),u=n("./zlib/messages"),l=n("./zlib/zstream"),d=n("./zlib/gzheader"),f=Object.prototype.toString;function h(p){if(!(this instanceof h))return new h(p);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},p||{});var g=this.options;g.raw&&0<=g.windowBits&&g.windowBits<16&&(g.windowBits=-g.windowBits,g.windowBits===0&&(g.windowBits=-15)),!(0<=g.windowBits&&g.windowBits<16)||p&&p.windowBits||(g.windowBits+=32),15<g.windowBits&&g.windowBits<48&&!(15&g.windowBits)&&(g.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var y=s.inflateInit2(this.strm,g.windowBits);if(y!==c.Z_OK)throw new Error(u[y]);this.header=new d,s.inflateGetHeader(this.strm,this.header)}function m(p,g){var y=new h(g);if(y.push(p,!0),y.err)throw y.msg||u[y.err];return y.result}h.prototype.push=function(p,g){var y,v,b,E,w,x,_=this.strm,k=this.options.chunkSize,R=this.options.dictionary,F=!1;if(this.ended)return!1;v=g===~~g?g:g===!0?c.Z_FINISH:c.Z_NO_FLUSH,typeof p=="string"?_.input=a.binstring2buf(p):f.call(p)==="[object ArrayBuffer]"?_.input=new Uint8Array(p):_.input=p,_.next_in=0,_.avail_in=_.input.length;do{if(_.avail_out===0&&(_.output=new o.Buf8(k),_.next_out=0,_.avail_out=k),(y=s.inflate(_,c.Z_NO_FLUSH))===c.Z_NEED_DICT&&R&&(x=typeof R=="string"?a.string2buf(R):f.call(R)==="[object ArrayBuffer]"?new Uint8Array(R):R,y=s.inflateSetDictionary(this.strm,x)),y===c.Z_BUF_ERROR&&F===!0&&(y=c.Z_OK,F=!1),y!==c.Z_STREAM_END&&y!==c.Z_OK)return this.onEnd(y),!(this.ended=!0);_.next_out&&(_.avail_out!==0&&y!==c.Z_STREAM_END&&(_.avail_in!==0||v!==c.Z_FINISH&&v!==c.Z_SYNC_FLUSH)||(this.options.to==="string"?(b=a.utf8border(_.output,_.next_out),E=_.next_out-b,w=a.buf2string(_.output,b),_.next_out=E,_.avail_out=k-E,E&&o.arraySet(_.output,_.output,b,E,0),this.onData(w)):this.onData(o.shrinkBuf(_.output,_.next_out)))),_.avail_in===0&&_.avail_out===0&&(F=!0)}while((0<_.avail_in||_.avail_out===0)&&y!==c.Z_STREAM_END);return y===c.Z_STREAM_END&&(v=c.Z_FINISH),v===c.Z_FINISH?(y=s.inflateEnd(this.strm),this.onEnd(y),this.ended=!0,y===c.Z_OK):v!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),!(_.avail_out=0))},h.prototype.onData=function(p){this.chunks.push(p)},h.prototype.onEnd=function(p){p===c.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=p,this.msg=this.strm.msg},i.Inflate=h,i.inflate=m,i.inflateRaw=function(p,g){return(g=g||{}).raw=!0,m(p,g)},i.ungzip=m},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(n,r,i){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";i.assign=function(c){for(var u=Array.prototype.slice.call(arguments,1);u.length;){var l=u.shift();if(l){if(typeof l!="object")throw new TypeError(l+"must be non-object");for(var d in l)l.hasOwnProperty(d)&&(c[d]=l[d])}}return c},i.shrinkBuf=function(c,u){return c.length===u?c:c.subarray?c.subarray(0,u):(c.length=u,c)};var o={arraySet:function(c,u,l,d,f){if(u.subarray&&c.subarray)c.set(u.subarray(l,l+d),f);else for(var h=0;h<d;h++)c[f+h]=u[l+h]},flattenChunks:function(c){var u,l,d,f,h,m;for(u=d=0,l=c.length;u<l;u++)d+=c[u].length;for(m=new Uint8Array(d),u=f=0,l=c.length;u<l;u++)h=c[u],m.set(h,f),f+=h.length;return m}},a={arraySet:function(c,u,l,d,f){for(var h=0;h<d;h++)c[f+h]=u[l+h]},flattenChunks:function(c){return[].concat.apply([],c)}};i.setTyped=function(c){c?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,o)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,a))},i.setTyped(s)},{}],42:[function(n,r,i){var s=n("./common"),o=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch{o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{a=!1}for(var c=new s.Buf8(256),u=0;u<256;u++)c[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;function l(d,f){if(f<65537&&(d.subarray&&a||!d.subarray&&o))return String.fromCharCode.apply(null,s.shrinkBuf(d,f));for(var h="",m=0;m<f;m++)h+=String.fromCharCode(d[m]);return h}c[254]=c[254]=1,i.string2buf=function(d){var f,h,m,p,g,y=d.length,v=0;for(p=0;p<y;p++)(64512&(h=d.charCodeAt(p)))==55296&&p+1<y&&(64512&(m=d.charCodeAt(p+1)))==56320&&(h=65536+(h-55296<<10)+(m-56320),p++),v+=h<128?1:h<2048?2:h<65536?3:4;for(f=new s.Buf8(v),p=g=0;g<v;p++)(64512&(h=d.charCodeAt(p)))==55296&&p+1<y&&(64512&(m=d.charCodeAt(p+1)))==56320&&(h=65536+(h-55296<<10)+(m-56320),p++),h<128?f[g++]=h:(h<2048?f[g++]=192|h>>>6:(h<65536?f[g++]=224|h>>>12:(f[g++]=240|h>>>18,f[g++]=128|h>>>12&63),f[g++]=128|h>>>6&63),f[g++]=128|63&h);return f},i.buf2binstring=function(d){return l(d,d.length)},i.binstring2buf=function(d){for(var f=new s.Buf8(d.length),h=0,m=f.length;h<m;h++)f[h]=d.charCodeAt(h);return f},i.buf2string=function(d,f){var h,m,p,g,y=f||d.length,v=new Array(2*y);for(h=m=0;h<y;)if((p=d[h++])<128)v[m++]=p;else if(4<(g=c[p]))v[m++]=65533,h+=g-1;else{for(p&=g===2?31:g===3?15:7;1<g&&h<y;)p=p<<6|63&d[h++],g--;1<g?v[m++]=65533:p<65536?v[m++]=p:(p-=65536,v[m++]=55296|p>>10&1023,v[m++]=56320|1023&p)}return l(v,m)},i.utf8border=function(d,f){var h;for((f=f||d.length)>d.length&&(f=d.length),h=f-1;0<=h&&(192&d[h])==128;)h--;return h<0||h===0?f:h+c[d[h]]>f?h:f}},{"./common":41}],43:[function(n,r,i){r.exports=function(s,o,a,c){for(var u=65535&s|0,l=s>>>16&65535|0,d=0;a!==0;){for(a-=d=2e3<a?2e3:a;l=l+(u=u+o[c++]|0)|0,--d;);u%=65521,l%=65521}return u|l<<16|0}},{}],44:[function(n,r,i){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(n,r,i){var s=function(){for(var o,a=[],c=0;c<256;c++){o=c;for(var u=0;u<8;u++)o=1&o?3988292384^o>>>1:o>>>1;a[c]=o}return a}();r.exports=function(o,a,c,u){var l=s,d=u+c;o^=-1;for(var f=u;f<d;f++)o=o>>>8^l[255&(o^a[f])];return-1^o}},{}],46:[function(n,r,i){var s,o=n("../utils/common"),a=n("./trees"),c=n("./adler32"),u=n("./crc32"),l=n("./messages"),d=0,f=4,h=0,m=-2,p=-1,g=4,y=2,v=8,b=9,E=286,w=30,x=19,_=2*E+1,k=15,R=3,F=258,V=F+R+1,T=42,L=113,S=1,C=2,N=3,U=4;function K(O,he){return O.msg=l[he],he}function $(O){return(O<<1)-(4<O?9:0)}function q(O){for(var he=O.length;0<=--he;)O[he]=0}function j(O){var he=O.state,ae=he.pending;ae>O.avail_out&&(ae=O.avail_out),ae!==0&&(o.arraySet(O.output,he.pending_buf,he.pending_out,ae,O.next_out),O.next_out+=ae,he.pending_out+=ae,O.total_out+=ae,O.avail_out-=ae,he.pending-=ae,he.pending===0&&(he.pending_out=0))}function D(O,he){a._tr_flush_block(O,0<=O.block_start?O.block_start:-1,O.strstart-O.block_start,he),O.block_start=O.strstart,j(O.strm)}function X(O,he){O.pending_buf[O.pending++]=he}function Z(O,he){O.pending_buf[O.pending++]=he>>>8&255,O.pending_buf[O.pending++]=255&he}function z(O,he){var ae,W,I=O.max_chain_length,A=O.strstart,G=O.prev_length,Q=O.nice_match,H=O.strstart>O.w_size-V?O.strstart-(O.w_size-V):0,ee=O.window,de=O.w_mask,fe=O.prev,De=O.strstart+F,rt=ee[A+G-1],Xe=ee[A+G];O.prev_length>=O.good_match&&(I>>=2),Q>O.lookahead&&(Q=O.lookahead);do if(ee[(ae=he)+G]===Xe&&ee[ae+G-1]===rt&&ee[ae]===ee[A]&&ee[++ae]===ee[A+1]){A+=2,ae++;do;while(ee[++A]===ee[++ae]&&ee[++A]===ee[++ae]&&ee[++A]===ee[++ae]&&ee[++A]===ee[++ae]&&ee[++A]===ee[++ae]&&ee[++A]===ee[++ae]&&ee[++A]===ee[++ae]&&ee[++A]===ee[++ae]&&A<De);if(W=F-(De-A),A=De-F,G<W){if(O.match_start=he,Q<=(G=W))break;rt=ee[A+G-1],Xe=ee[A+G]}}while((he=fe[he&de])>H&&--I!=0);return G<=O.lookahead?G:O.lookahead}function le(O){var he,ae,W,I,A,G,Q,H,ee,de,fe=O.w_size;do{if(I=O.window_size-O.lookahead-O.strstart,O.strstart>=fe+(fe-V)){for(o.arraySet(O.window,O.window,fe,fe,0),O.match_start-=fe,O.strstart-=fe,O.block_start-=fe,he=ae=O.hash_size;W=O.head[--he],O.head[he]=fe<=W?W-fe:0,--ae;);for(he=ae=fe;W=O.prev[--he],O.prev[he]=fe<=W?W-fe:0,--ae;);I+=fe}if(O.strm.avail_in===0)break;if(G=O.strm,Q=O.window,H=O.strstart+O.lookahead,ee=I,de=void 0,de=G.avail_in,ee<de&&(de=ee),ae=de===0?0:(G.avail_in-=de,o.arraySet(Q,G.input,G.next_in,de,H),G.state.wrap===1?G.adler=c(G.adler,Q,de,H):G.state.wrap===2&&(G.adler=u(G.adler,Q,de,H)),G.next_in+=de,G.total_in+=de,de),O.lookahead+=ae,O.lookahead+O.insert>=R)for(A=O.strstart-O.insert,O.ins_h=O.window[A],O.ins_h=(O.ins_h<<O.hash_shift^O.window[A+1])&O.hash_mask;O.insert&&(O.ins_h=(O.ins_h<<O.hash_shift^O.window[A+R-1])&O.hash_mask,O.prev[A&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=A,A++,O.insert--,!(O.lookahead+O.insert<R)););}while(O.lookahead<V&&O.strm.avail_in!==0)}function pe(O,he){for(var ae,W;;){if(O.lookahead<V){if(le(O),O.lookahead<V&&he===d)return S;if(O.lookahead===0)break}if(ae=0,O.lookahead>=R&&(O.ins_h=(O.ins_h<<O.hash_shift^O.window[O.strstart+R-1])&O.hash_mask,ae=O.prev[O.strstart&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=O.strstart),ae!==0&&O.strstart-ae<=O.w_size-V&&(O.match_length=z(O,ae)),O.match_length>=R)if(W=a._tr_tally(O,O.strstart-O.match_start,O.match_length-R),O.lookahead-=O.match_length,O.match_length<=O.max_lazy_match&&O.lookahead>=R){for(O.match_length--;O.strstart++,O.ins_h=(O.ins_h<<O.hash_shift^O.window[O.strstart+R-1])&O.hash_mask,ae=O.prev[O.strstart&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=O.strstart,--O.match_length!=0;);O.strstart++}else O.strstart+=O.match_length,O.match_length=0,O.ins_h=O.window[O.strstart],O.ins_h=(O.ins_h<<O.hash_shift^O.window[O.strstart+1])&O.hash_mask;else W=a._tr_tally(O,0,O.window[O.strstart]),O.lookahead--,O.strstart++;if(W&&(D(O,!1),O.strm.avail_out===0))return S}return O.insert=O.strstart<R-1?O.strstart:R-1,he===f?(D(O,!0),O.strm.avail_out===0?N:U):O.last_lit&&(D(O,!1),O.strm.avail_out===0)?S:C}function ve(O,he){for(var ae,W,I;;){if(O.lookahead<V){if(le(O),O.lookahead<V&&he===d)return S;if(O.lookahead===0)break}if(ae=0,O.lookahead>=R&&(O.ins_h=(O.ins_h<<O.hash_shift^O.window[O.strstart+R-1])&O.hash_mask,ae=O.prev[O.strstart&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=O.strstart),O.prev_length=O.match_length,O.prev_match=O.match_start,O.match_length=R-1,ae!==0&&O.prev_length<O.max_lazy_match&&O.strstart-ae<=O.w_size-V&&(O.match_length=z(O,ae),O.match_length<=5&&(O.strategy===1||O.match_length===R&&4096<O.strstart-O.match_start)&&(O.match_length=R-1)),O.prev_length>=R&&O.match_length<=O.prev_length){for(I=O.strstart+O.lookahead-R,W=a._tr_tally(O,O.strstart-1-O.prev_match,O.prev_length-R),O.lookahead-=O.prev_length-1,O.prev_length-=2;++O.strstart<=I&&(O.ins_h=(O.ins_h<<O.hash_shift^O.window[O.strstart+R-1])&O.hash_mask,ae=O.prev[O.strstart&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=O.strstart),--O.prev_length!=0;);if(O.match_available=0,O.match_length=R-1,O.strstart++,W&&(D(O,!1),O.strm.avail_out===0))return S}else if(O.match_available){if((W=a._tr_tally(O,0,O.window[O.strstart-1]))&&D(O,!1),O.strstart++,O.lookahead--,O.strm.avail_out===0)return S}else O.match_available=1,O.strstart++,O.lookahead--}return O.match_available&&(W=a._tr_tally(O,0,O.window[O.strstart-1]),O.match_available=0),O.insert=O.strstart<R-1?O.strstart:R-1,he===f?(D(O,!0),O.strm.avail_out===0?N:U):O.last_lit&&(D(O,!1),O.strm.avail_out===0)?S:C}function je(O,he,ae,W,I){this.good_length=O,this.max_lazy=he,this.nice_length=ae,this.max_chain=W,this.func=I}function ct(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=v,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new o.Buf16(2*_),this.dyn_dtree=new o.Buf16(2*(2*w+1)),this.bl_tree=new o.Buf16(2*(2*x+1)),q(this.dyn_ltree),q(this.dyn_dtree),q(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new o.Buf16(k+1),this.heap=new o.Buf16(2*E+1),q(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new o.Buf16(2*E+1),q(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ut(O){var he;return O&&O.state?(O.total_in=O.total_out=0,O.data_type=y,(he=O.state).pending=0,he.pending_out=0,he.wrap<0&&(he.wrap=-he.wrap),he.status=he.wrap?T:L,O.adler=he.wrap===2?0:1,he.last_flush=d,a._tr_init(he),h):K(O,m)}function Ye(O){var he=ut(O);return he===h&&function(ae){ae.window_size=2*ae.w_size,q(ae.head),ae.max_lazy_match=s[ae.level].max_lazy,ae.good_match=s[ae.level].good_length,ae.nice_match=s[ae.level].nice_length,ae.max_chain_length=s[ae.level].max_chain,ae.strstart=0,ae.block_start=0,ae.lookahead=0,ae.insert=0,ae.match_length=ae.prev_length=R-1,ae.match_available=0,ae.ins_h=0}(O.state),he}function Ot(O,he,ae,W,I,A){if(!O)return m;var G=1;if(he===p&&(he=6),W<0?(G=0,W=-W):15<W&&(G=2,W-=16),I<1||b<I||ae!==v||W<8||15<W||he<0||9<he||A<0||g<A)return K(O,m);W===8&&(W=9);var Q=new ct;return(O.state=Q).strm=O,Q.wrap=G,Q.gzhead=null,Q.w_bits=W,Q.w_size=1<<Q.w_bits,Q.w_mask=Q.w_size-1,Q.hash_bits=I+7,Q.hash_size=1<<Q.hash_bits,Q.hash_mask=Q.hash_size-1,Q.hash_shift=~~((Q.hash_bits+R-1)/R),Q.window=new o.Buf8(2*Q.w_size),Q.head=new o.Buf16(Q.hash_size),Q.prev=new o.Buf16(Q.w_size),Q.lit_bufsize=1<<I+6,Q.pending_buf_size=4*Q.lit_bufsize,Q.pending_buf=new o.Buf8(Q.pending_buf_size),Q.d_buf=1*Q.lit_bufsize,Q.l_buf=3*Q.lit_bufsize,Q.level=he,Q.strategy=A,Q.method=ae,Ye(O)}s=[new je(0,0,0,0,function(O,he){var ae=65535;for(ae>O.pending_buf_size-5&&(ae=O.pending_buf_size-5);;){if(O.lookahead<=1){if(le(O),O.lookahead===0&&he===d)return S;if(O.lookahead===0)break}O.strstart+=O.lookahead,O.lookahead=0;var W=O.block_start+ae;if((O.strstart===0||O.strstart>=W)&&(O.lookahead=O.strstart-W,O.strstart=W,D(O,!1),O.strm.avail_out===0)||O.strstart-O.block_start>=O.w_size-V&&(D(O,!1),O.strm.avail_out===0))return S}return O.insert=0,he===f?(D(O,!0),O.strm.avail_out===0?N:U):(O.strstart>O.block_start&&(D(O,!1),O.strm.avail_out),S)}),new je(4,4,8,4,pe),new je(4,5,16,8,pe),new je(4,6,32,32,pe),new je(4,4,16,16,ve),new je(8,16,32,32,ve),new je(8,16,128,128,ve),new je(8,32,128,256,ve),new je(32,128,258,1024,ve),new je(32,258,258,4096,ve)],i.deflateInit=function(O,he){return Ot(O,he,v,15,8,0)},i.deflateInit2=Ot,i.deflateReset=Ye,i.deflateResetKeep=ut,i.deflateSetHeader=function(O,he){return O&&O.state?O.state.wrap!==2?m:(O.state.gzhead=he,h):m},i.deflate=function(O,he){var ae,W,I,A;if(!O||!O.state||5<he||he<0)return O?K(O,m):m;if(W=O.state,!O.output||!O.input&&O.avail_in!==0||W.status===666&&he!==f)return K(O,O.avail_out===0?-5:m);if(W.strm=O,ae=W.last_flush,W.last_flush=he,W.status===T)if(W.wrap===2)O.adler=0,X(W,31),X(W,139),X(W,8),W.gzhead?(X(W,(W.gzhead.text?1:0)+(W.gzhead.hcrc?2:0)+(W.gzhead.extra?4:0)+(W.gzhead.name?8:0)+(W.gzhead.comment?16:0)),X(W,255&W.gzhead.time),X(W,W.gzhead.time>>8&255),X(W,W.gzhead.time>>16&255),X(W,W.gzhead.time>>24&255),X(W,W.level===9?2:2<=W.strategy||W.level<2?4:0),X(W,255&W.gzhead.os),W.gzhead.extra&&W.gzhead.extra.length&&(X(W,255&W.gzhead.extra.length),X(W,W.gzhead.extra.length>>8&255)),W.gzhead.hcrc&&(O.adler=u(O.adler,W.pending_buf,W.pending,0)),W.gzindex=0,W.status=69):(X(W,0),X(W,0),X(W,0),X(W,0),X(W,0),X(W,W.level===9?2:2<=W.strategy||W.level<2?4:0),X(W,3),W.status=L);else{var G=v+(W.w_bits-8<<4)<<8;G|=(2<=W.strategy||W.level<2?0:W.level<6?1:W.level===6?2:3)<<6,W.strstart!==0&&(G|=32),G+=31-G%31,W.status=L,Z(W,G),W.strstart!==0&&(Z(W,O.adler>>>16),Z(W,65535&O.adler)),O.adler=1}if(W.status===69)if(W.gzhead.extra){for(I=W.pending;W.gzindex<(65535&W.gzhead.extra.length)&&(W.pending!==W.pending_buf_size||(W.gzhead.hcrc&&W.pending>I&&(O.adler=u(O.adler,W.pending_buf,W.pending-I,I)),j(O),I=W.pending,W.pending!==W.pending_buf_size));)X(W,255&W.gzhead.extra[W.gzindex]),W.gzindex++;W.gzhead.hcrc&&W.pending>I&&(O.adler=u(O.adler,W.pending_buf,W.pending-I,I)),W.gzindex===W.gzhead.extra.length&&(W.gzindex=0,W.status=73)}else W.status=73;if(W.status===73)if(W.gzhead.name){I=W.pending;do{if(W.pending===W.pending_buf_size&&(W.gzhead.hcrc&&W.pending>I&&(O.adler=u(O.adler,W.pending_buf,W.pending-I,I)),j(O),I=W.pending,W.pending===W.pending_buf_size)){A=1;break}A=W.gzindex<W.gzhead.name.length?255&W.gzhead.name.charCodeAt(W.gzindex++):0,X(W,A)}while(A!==0);W.gzhead.hcrc&&W.pending>I&&(O.adler=u(O.adler,W.pending_buf,W.pending-I,I)),A===0&&(W.gzindex=0,W.status=91)}else W.status=91;if(W.status===91)if(W.gzhead.comment){I=W.pending;do{if(W.pending===W.pending_buf_size&&(W.gzhead.hcrc&&W.pending>I&&(O.adler=u(O.adler,W.pending_buf,W.pending-I,I)),j(O),I=W.pending,W.pending===W.pending_buf_size)){A=1;break}A=W.gzindex<W.gzhead.comment.length?255&W.gzhead.comment.charCodeAt(W.gzindex++):0,X(W,A)}while(A!==0);W.gzhead.hcrc&&W.pending>I&&(O.adler=u(O.adler,W.pending_buf,W.pending-I,I)),A===0&&(W.status=103)}else W.status=103;if(W.status===103&&(W.gzhead.hcrc?(W.pending+2>W.pending_buf_size&&j(O),W.pending+2<=W.pending_buf_size&&(X(W,255&O.adler),X(W,O.adler>>8&255),O.adler=0,W.status=L)):W.status=L),W.pending!==0){if(j(O),O.avail_out===0)return W.last_flush=-1,h}else if(O.avail_in===0&&$(he)<=$(ae)&&he!==f)return K(O,-5);if(W.status===666&&O.avail_in!==0)return K(O,-5);if(O.avail_in!==0||W.lookahead!==0||he!==d&&W.status!==666){var Q=W.strategy===2?function(H,ee){for(var de;;){if(H.lookahead===0&&(le(H),H.lookahead===0)){if(ee===d)return S;break}if(H.match_length=0,de=a._tr_tally(H,0,H.window[H.strstart]),H.lookahead--,H.strstart++,de&&(D(H,!1),H.strm.avail_out===0))return S}return H.insert=0,ee===f?(D(H,!0),H.strm.avail_out===0?N:U):H.last_lit&&(D(H,!1),H.strm.avail_out===0)?S:C}(W,he):W.strategy===3?function(H,ee){for(var de,fe,De,rt,Xe=H.window;;){if(H.lookahead<=F){if(le(H),H.lookahead<=F&&ee===d)return S;if(H.lookahead===0)break}if(H.match_length=0,H.lookahead>=R&&0<H.strstart&&(fe=Xe[De=H.strstart-1])===Xe[++De]&&fe===Xe[++De]&&fe===Xe[++De]){rt=H.strstart+F;do;while(fe===Xe[++De]&&fe===Xe[++De]&&fe===Xe[++De]&&fe===Xe[++De]&&fe===Xe[++De]&&fe===Xe[++De]&&fe===Xe[++De]&&fe===Xe[++De]&&De<rt);H.match_length=F-(rt-De),H.match_length>H.lookahead&&(H.match_length=H.lookahead)}if(H.match_length>=R?(de=a._tr_tally(H,1,H.match_length-R),H.lookahead-=H.match_length,H.strstart+=H.match_length,H.match_length=0):(de=a._tr_tally(H,0,H.window[H.strstart]),H.lookahead--,H.strstart++),de&&(D(H,!1),H.strm.avail_out===0))return S}return H.insert=0,ee===f?(D(H,!0),H.strm.avail_out===0?N:U):H.last_lit&&(D(H,!1),H.strm.avail_out===0)?S:C}(W,he):s[W.level].func(W,he);if(Q!==N&&Q!==U||(W.status=666),Q===S||Q===N)return O.avail_out===0&&(W.last_flush=-1),h;if(Q===C&&(he===1?a._tr_align(W):he!==5&&(a._tr_stored_block(W,0,0,!1),he===3&&(q(W.head),W.lookahead===0&&(W.strstart=0,W.block_start=0,W.insert=0))),j(O),O.avail_out===0))return W.last_flush=-1,h}return he!==f?h:W.wrap<=0?1:(W.wrap===2?(X(W,255&O.adler),X(W,O.adler>>8&255),X(W,O.adler>>16&255),X(W,O.adler>>24&255),X(W,255&O.total_in),X(W,O.total_in>>8&255),X(W,O.total_in>>16&255),X(W,O.total_in>>24&255)):(Z(W,O.adler>>>16),Z(W,65535&O.adler)),j(O),0<W.wrap&&(W.wrap=-W.wrap),W.pending!==0?h:1)},i.deflateEnd=function(O){var he;return O&&O.state?(he=O.state.status)!==T&&he!==69&&he!==73&&he!==91&&he!==103&&he!==L&&he!==666?K(O,m):(O.state=null,he===L?K(O,-3):h):m},i.deflateSetDictionary=function(O,he){var ae,W,I,A,G,Q,H,ee,de=he.length;if(!O||!O.state||(A=(ae=O.state).wrap)===2||A===1&&ae.status!==T||ae.lookahead)return m;for(A===1&&(O.adler=c(O.adler,he,de,0)),ae.wrap=0,de>=ae.w_size&&(A===0&&(q(ae.head),ae.strstart=0,ae.block_start=0,ae.insert=0),ee=new o.Buf8(ae.w_size),o.arraySet(ee,he,de-ae.w_size,ae.w_size,0),he=ee,de=ae.w_size),G=O.avail_in,Q=O.next_in,H=O.input,O.avail_in=de,O.next_in=0,O.input=he,le(ae);ae.lookahead>=R;){for(W=ae.strstart,I=ae.lookahead-(R-1);ae.ins_h=(ae.ins_h<<ae.hash_shift^ae.window[W+R-1])&ae.hash_mask,ae.prev[W&ae.w_mask]=ae.head[ae.ins_h],ae.head[ae.ins_h]=W,W++,--I;);ae.strstart=W,ae.lookahead=R-1,le(ae)}return ae.strstart+=ae.lookahead,ae.block_start=ae.strstart,ae.insert=ae.lookahead,ae.lookahead=0,ae.match_length=ae.prev_length=R-1,ae.match_available=0,O.next_in=Q,O.input=H,O.avail_in=G,ae.wrap=A,h},i.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(n,r,i){r.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(n,r,i){r.exports=function(s,o){var a,c,u,l,d,f,h,m,p,g,y,v,b,E,w,x,_,k,R,F,V,T,L,S,C;a=s.state,c=s.next_in,S=s.input,u=c+(s.avail_in-5),l=s.next_out,C=s.output,d=l-(o-s.avail_out),f=l+(s.avail_out-257),h=a.dmax,m=a.wsize,p=a.whave,g=a.wnext,y=a.window,v=a.hold,b=a.bits,E=a.lencode,w=a.distcode,x=(1<<a.lenbits)-1,_=(1<<a.distbits)-1;e:do{b<15&&(v+=S[c++]<<b,b+=8,v+=S[c++]<<b,b+=8),k=E[v&x];t:for(;;){if(v>>>=R=k>>>24,b-=R,(R=k>>>16&255)===0)C[l++]=65535&k;else{if(!(16&R)){if(!(64&R)){k=E[(65535&k)+(v&(1<<R)-1)];continue t}if(32&R){a.mode=12;break e}s.msg="invalid literal/length code",a.mode=30;break e}F=65535&k,(R&=15)&&(b<R&&(v+=S[c++]<<b,b+=8),F+=v&(1<<R)-1,v>>>=R,b-=R),b<15&&(v+=S[c++]<<b,b+=8,v+=S[c++]<<b,b+=8),k=w[v&_];n:for(;;){if(v>>>=R=k>>>24,b-=R,!(16&(R=k>>>16&255))){if(!(64&R)){k=w[(65535&k)+(v&(1<<R)-1)];continue n}s.msg="invalid distance code",a.mode=30;break e}if(V=65535&k,b<(R&=15)&&(v+=S[c++]<<b,(b+=8)<R&&(v+=S[c++]<<b,b+=8)),h<(V+=v&(1<<R)-1)){s.msg="invalid distance too far back",a.mode=30;break e}if(v>>>=R,b-=R,(R=l-d)<V){if(p<(R=V-R)&&a.sane){s.msg="invalid distance too far back",a.mode=30;break e}if(L=y,(T=0)===g){if(T+=m-R,R<F){for(F-=R;C[l++]=y[T++],--R;);T=l-V,L=C}}else if(g<R){if(T+=m+g-R,(R-=g)<F){for(F-=R;C[l++]=y[T++],--R;);if(T=0,g<F){for(F-=R=g;C[l++]=y[T++],--R;);T=l-V,L=C}}}else if(T+=g-R,R<F){for(F-=R;C[l++]=y[T++],--R;);T=l-V,L=C}for(;2<F;)C[l++]=L[T++],C[l++]=L[T++],C[l++]=L[T++],F-=3;F&&(C[l++]=L[T++],1<F&&(C[l++]=L[T++]))}else{for(T=l-V;C[l++]=C[T++],C[l++]=C[T++],C[l++]=C[T++],2<(F-=3););F&&(C[l++]=C[T++],1<F&&(C[l++]=C[T++]))}break}}break}}while(c<u&&l<f);c-=F=b>>3,v&=(1<<(b-=F<<3))-1,s.next_in=c,s.next_out=l,s.avail_in=c<u?u-c+5:5-(c-u),s.avail_out=l<f?f-l+257:257-(l-f),a.hold=v,a.bits=b}},{}],49:[function(n,r,i){var s=n("../utils/common"),o=n("./adler32"),a=n("./crc32"),c=n("./inffast"),u=n("./inftrees"),l=1,d=2,f=0,h=-2,m=1,p=852,g=592;function y(T){return(T>>>24&255)+(T>>>8&65280)+((65280&T)<<8)+((255&T)<<24)}function v(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function b(T){var L;return T&&T.state?(L=T.state,T.total_in=T.total_out=L.total=0,T.msg="",L.wrap&&(T.adler=1&L.wrap),L.mode=m,L.last=0,L.havedict=0,L.dmax=32768,L.head=null,L.hold=0,L.bits=0,L.lencode=L.lendyn=new s.Buf32(p),L.distcode=L.distdyn=new s.Buf32(g),L.sane=1,L.back=-1,f):h}function E(T){var L;return T&&T.state?((L=T.state).wsize=0,L.whave=0,L.wnext=0,b(T)):h}function w(T,L){var S,C;return T&&T.state?(C=T.state,L<0?(S=0,L=-L):(S=1+(L>>4),L<48&&(L&=15)),L&&(L<8||15<L)?h:(C.window!==null&&C.wbits!==L&&(C.window=null),C.wrap=S,C.wbits=L,E(T))):h}function x(T,L){var S,C;return T?(C=new v,(T.state=C).window=null,(S=w(T,L))!==f&&(T.state=null),S):h}var _,k,R=!0;function F(T){if(R){var L;for(_=new s.Buf32(512),k=new s.Buf32(32),L=0;L<144;)T.lens[L++]=8;for(;L<256;)T.lens[L++]=9;for(;L<280;)T.lens[L++]=7;for(;L<288;)T.lens[L++]=8;for(u(l,T.lens,0,288,_,0,T.work,{bits:9}),L=0;L<32;)T.lens[L++]=5;u(d,T.lens,0,32,k,0,T.work,{bits:5}),R=!1}T.lencode=_,T.lenbits=9,T.distcode=k,T.distbits=5}function V(T,L,S,C){var N,U=T.state;return U.window===null&&(U.wsize=1<<U.wbits,U.wnext=0,U.whave=0,U.window=new s.Buf8(U.wsize)),C>=U.wsize?(s.arraySet(U.window,L,S-U.wsize,U.wsize,0),U.wnext=0,U.whave=U.wsize):(C<(N=U.wsize-U.wnext)&&(N=C),s.arraySet(U.window,L,S-C,N,U.wnext),(C-=N)?(s.arraySet(U.window,L,S-C,C,0),U.wnext=C,U.whave=U.wsize):(U.wnext+=N,U.wnext===U.wsize&&(U.wnext=0),U.whave<U.wsize&&(U.whave+=N))),0}i.inflateReset=E,i.inflateReset2=w,i.inflateResetKeep=b,i.inflateInit=function(T){return x(T,15)},i.inflateInit2=x,i.inflate=function(T,L){var S,C,N,U,K,$,q,j,D,X,Z,z,le,pe,ve,je,ct,ut,Ye,Ot,O,he,ae,W,I=0,A=new s.Buf8(4),G=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!T||!T.state||!T.output||!T.input&&T.avail_in!==0)return h;(S=T.state).mode===12&&(S.mode=13),K=T.next_out,N=T.output,q=T.avail_out,U=T.next_in,C=T.input,$=T.avail_in,j=S.hold,D=S.bits,X=$,Z=q,he=f;e:for(;;)switch(S.mode){case m:if(S.wrap===0){S.mode=13;break}for(;D<16;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}if(2&S.wrap&&j===35615){A[S.check=0]=255&j,A[1]=j>>>8&255,S.check=a(S.check,A,2,0),D=j=0,S.mode=2;break}if(S.flags=0,S.head&&(S.head.done=!1),!(1&S.wrap)||(((255&j)<<8)+(j>>8))%31){T.msg="incorrect header check",S.mode=30;break}if((15&j)!=8){T.msg="unknown compression method",S.mode=30;break}if(D-=4,O=8+(15&(j>>>=4)),S.wbits===0)S.wbits=O;else if(O>S.wbits){T.msg="invalid window size",S.mode=30;break}S.dmax=1<<O,T.adler=S.check=1,S.mode=512&j?10:12,D=j=0;break;case 2:for(;D<16;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}if(S.flags=j,(255&S.flags)!=8){T.msg="unknown compression method",S.mode=30;break}if(57344&S.flags){T.msg="unknown header flags set",S.mode=30;break}S.head&&(S.head.text=j>>8&1),512&S.flags&&(A[0]=255&j,A[1]=j>>>8&255,S.check=a(S.check,A,2,0)),D=j=0,S.mode=3;case 3:for(;D<32;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}S.head&&(S.head.time=j),512&S.flags&&(A[0]=255&j,A[1]=j>>>8&255,A[2]=j>>>16&255,A[3]=j>>>24&255,S.check=a(S.check,A,4,0)),D=j=0,S.mode=4;case 4:for(;D<16;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}S.head&&(S.head.xflags=255&j,S.head.os=j>>8),512&S.flags&&(A[0]=255&j,A[1]=j>>>8&255,S.check=a(S.check,A,2,0)),D=j=0,S.mode=5;case 5:if(1024&S.flags){for(;D<16;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}S.length=j,S.head&&(S.head.extra_len=j),512&S.flags&&(A[0]=255&j,A[1]=j>>>8&255,S.check=a(S.check,A,2,0)),D=j=0}else S.head&&(S.head.extra=null);S.mode=6;case 6:if(1024&S.flags&&($<(z=S.length)&&(z=$),z&&(S.head&&(O=S.head.extra_len-S.length,S.head.extra||(S.head.extra=new Array(S.head.extra_len)),s.arraySet(S.head.extra,C,U,z,O)),512&S.flags&&(S.check=a(S.check,C,z,U)),$-=z,U+=z,S.length-=z),S.length))break e;S.length=0,S.mode=7;case 7:if(2048&S.flags){if($===0)break e;for(z=0;O=C[U+z++],S.head&&O&&S.length<65536&&(S.head.name+=String.fromCharCode(O)),O&&z<$;);if(512&S.flags&&(S.check=a(S.check,C,z,U)),$-=z,U+=z,O)break e}else S.head&&(S.head.name=null);S.length=0,S.mode=8;case 8:if(4096&S.flags){if($===0)break e;for(z=0;O=C[U+z++],S.head&&O&&S.length<65536&&(S.head.comment+=String.fromCharCode(O)),O&&z<$;);if(512&S.flags&&(S.check=a(S.check,C,z,U)),$-=z,U+=z,O)break e}else S.head&&(S.head.comment=null);S.mode=9;case 9:if(512&S.flags){for(;D<16;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}if(j!==(65535&S.check)){T.msg="header crc mismatch",S.mode=30;break}D=j=0}S.head&&(S.head.hcrc=S.flags>>9&1,S.head.done=!0),T.adler=S.check=0,S.mode=12;break;case 10:for(;D<32;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}T.adler=S.check=y(j),D=j=0,S.mode=11;case 11:if(S.havedict===0)return T.next_out=K,T.avail_out=q,T.next_in=U,T.avail_in=$,S.hold=j,S.bits=D,2;T.adler=S.check=1,S.mode=12;case 12:if(L===5||L===6)break e;case 13:if(S.last){j>>>=7&D,D-=7&D,S.mode=27;break}for(;D<3;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}switch(S.last=1&j,D-=1,3&(j>>>=1)){case 0:S.mode=14;break;case 1:if(F(S),S.mode=20,L!==6)break;j>>>=2,D-=2;break e;case 2:S.mode=17;break;case 3:T.msg="invalid block type",S.mode=30}j>>>=2,D-=2;break;case 14:for(j>>>=7&D,D-=7&D;D<32;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}if((65535&j)!=(j>>>16^65535)){T.msg="invalid stored block lengths",S.mode=30;break}if(S.length=65535&j,D=j=0,S.mode=15,L===6)break e;case 15:S.mode=16;case 16:if(z=S.length){if($<z&&(z=$),q<z&&(z=q),z===0)break e;s.arraySet(N,C,U,z,K),$-=z,U+=z,q-=z,K+=z,S.length-=z;break}S.mode=12;break;case 17:for(;D<14;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}if(S.nlen=257+(31&j),j>>>=5,D-=5,S.ndist=1+(31&j),j>>>=5,D-=5,S.ncode=4+(15&j),j>>>=4,D-=4,286<S.nlen||30<S.ndist){T.msg="too many length or distance symbols",S.mode=30;break}S.have=0,S.mode=18;case 18:for(;S.have<S.ncode;){for(;D<3;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}S.lens[G[S.have++]]=7&j,j>>>=3,D-=3}for(;S.have<19;)S.lens[G[S.have++]]=0;if(S.lencode=S.lendyn,S.lenbits=7,ae={bits:S.lenbits},he=u(0,S.lens,0,19,S.lencode,0,S.work,ae),S.lenbits=ae.bits,he){T.msg="invalid code lengths set",S.mode=30;break}S.have=0,S.mode=19;case 19:for(;S.have<S.nlen+S.ndist;){for(;je=(I=S.lencode[j&(1<<S.lenbits)-1])>>>16&255,ct=65535&I,!((ve=I>>>24)<=D);){if($===0)break e;$--,j+=C[U++]<<D,D+=8}if(ct<16)j>>>=ve,D-=ve,S.lens[S.have++]=ct;else{if(ct===16){for(W=ve+2;D<W;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}if(j>>>=ve,D-=ve,S.have===0){T.msg="invalid bit length repeat",S.mode=30;break}O=S.lens[S.have-1],z=3+(3&j),j>>>=2,D-=2}else if(ct===17){for(W=ve+3;D<W;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}D-=ve,O=0,z=3+(7&(j>>>=ve)),j>>>=3,D-=3}else{for(W=ve+7;D<W;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}D-=ve,O=0,z=11+(127&(j>>>=ve)),j>>>=7,D-=7}if(S.have+z>S.nlen+S.ndist){T.msg="invalid bit length repeat",S.mode=30;break}for(;z--;)S.lens[S.have++]=O}}if(S.mode===30)break;if(S.lens[256]===0){T.msg="invalid code -- missing end-of-block",S.mode=30;break}if(S.lenbits=9,ae={bits:S.lenbits},he=u(l,S.lens,0,S.nlen,S.lencode,0,S.work,ae),S.lenbits=ae.bits,he){T.msg="invalid literal/lengths set",S.mode=30;break}if(S.distbits=6,S.distcode=S.distdyn,ae={bits:S.distbits},he=u(d,S.lens,S.nlen,S.ndist,S.distcode,0,S.work,ae),S.distbits=ae.bits,he){T.msg="invalid distances set",S.mode=30;break}if(S.mode=20,L===6)break e;case 20:S.mode=21;case 21:if(6<=$&&258<=q){T.next_out=K,T.avail_out=q,T.next_in=U,T.avail_in=$,S.hold=j,S.bits=D,c(T,Z),K=T.next_out,N=T.output,q=T.avail_out,U=T.next_in,C=T.input,$=T.avail_in,j=S.hold,D=S.bits,S.mode===12&&(S.back=-1);break}for(S.back=0;je=(I=S.lencode[j&(1<<S.lenbits)-1])>>>16&255,ct=65535&I,!((ve=I>>>24)<=D);){if($===0)break e;$--,j+=C[U++]<<D,D+=8}if(je&&!(240&je)){for(ut=ve,Ye=je,Ot=ct;je=(I=S.lencode[Ot+((j&(1<<ut+Ye)-1)>>ut)])>>>16&255,ct=65535&I,!(ut+(ve=I>>>24)<=D);){if($===0)break e;$--,j+=C[U++]<<D,D+=8}j>>>=ut,D-=ut,S.back+=ut}if(j>>>=ve,D-=ve,S.back+=ve,S.length=ct,je===0){S.mode=26;break}if(32&je){S.back=-1,S.mode=12;break}if(64&je){T.msg="invalid literal/length code",S.mode=30;break}S.extra=15&je,S.mode=22;case 22:if(S.extra){for(W=S.extra;D<W;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}S.length+=j&(1<<S.extra)-1,j>>>=S.extra,D-=S.extra,S.back+=S.extra}S.was=S.length,S.mode=23;case 23:for(;je=(I=S.distcode[j&(1<<S.distbits)-1])>>>16&255,ct=65535&I,!((ve=I>>>24)<=D);){if($===0)break e;$--,j+=C[U++]<<D,D+=8}if(!(240&je)){for(ut=ve,Ye=je,Ot=ct;je=(I=S.distcode[Ot+((j&(1<<ut+Ye)-1)>>ut)])>>>16&255,ct=65535&I,!(ut+(ve=I>>>24)<=D);){if($===0)break e;$--,j+=C[U++]<<D,D+=8}j>>>=ut,D-=ut,S.back+=ut}if(j>>>=ve,D-=ve,S.back+=ve,64&je){T.msg="invalid distance code",S.mode=30;break}S.offset=ct,S.extra=15&je,S.mode=24;case 24:if(S.extra){for(W=S.extra;D<W;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}S.offset+=j&(1<<S.extra)-1,j>>>=S.extra,D-=S.extra,S.back+=S.extra}if(S.offset>S.dmax){T.msg="invalid distance too far back",S.mode=30;break}S.mode=25;case 25:if(q===0)break e;if(z=Z-q,S.offset>z){if((z=S.offset-z)>S.whave&&S.sane){T.msg="invalid distance too far back",S.mode=30;break}le=z>S.wnext?(z-=S.wnext,S.wsize-z):S.wnext-z,z>S.length&&(z=S.length),pe=S.window}else pe=N,le=K-S.offset,z=S.length;for(q<z&&(z=q),q-=z,S.length-=z;N[K++]=pe[le++],--z;);S.length===0&&(S.mode=21);break;case 26:if(q===0)break e;N[K++]=S.length,q--,S.mode=21;break;case 27:if(S.wrap){for(;D<32;){if($===0)break e;$--,j|=C[U++]<<D,D+=8}if(Z-=q,T.total_out+=Z,S.total+=Z,Z&&(T.adler=S.check=S.flags?a(S.check,N,Z,K-Z):o(S.check,N,Z,K-Z)),Z=q,(S.flags?j:y(j))!==S.check){T.msg="incorrect data check",S.mode=30;break}D=j=0}S.mode=28;case 28:if(S.wrap&&S.flags){for(;D<32;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}if(j!==(4294967295&S.total)){T.msg="incorrect length check",S.mode=30;break}D=j=0}S.mode=29;case 29:he=1;break e;case 30:he=-3;break e;case 31:return-4;case 32:default:return h}return T.next_out=K,T.avail_out=q,T.next_in=U,T.avail_in=$,S.hold=j,S.bits=D,(S.wsize||Z!==T.avail_out&&S.mode<30&&(S.mode<27||L!==4))&&V(T,T.output,T.next_out,Z-T.avail_out)?(S.mode=31,-4):(X-=T.avail_in,Z-=T.avail_out,T.total_in+=X,T.total_out+=Z,S.total+=Z,S.wrap&&Z&&(T.adler=S.check=S.flags?a(S.check,N,Z,T.next_out-Z):o(S.check,N,Z,T.next_out-Z)),T.data_type=S.bits+(S.last?64:0)+(S.mode===12?128:0)+(S.mode===20||S.mode===15?256:0),(X==0&&Z===0||L===4)&&he===f&&(he=-5),he)},i.inflateEnd=function(T){if(!T||!T.state)return h;var L=T.state;return L.window&&(L.window=null),T.state=null,f},i.inflateGetHeader=function(T,L){var S;return T&&T.state&&2&(S=T.state).wrap?((S.head=L).done=!1,f):h},i.inflateSetDictionary=function(T,L){var S,C=L.length;return T&&T.state?(S=T.state).wrap!==0&&S.mode!==11?h:S.mode===11&&o(1,L,C,0)!==S.check?-3:V(T,L,C,C)?(S.mode=31,-4):(S.havedict=1,f):h},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(n,r,i){var s=n("../utils/common"),o=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],c=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],u=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(l,d,f,h,m,p,g,y){var v,b,E,w,x,_,k,R,F,V=y.bits,T=0,L=0,S=0,C=0,N=0,U=0,K=0,$=0,q=0,j=0,D=null,X=0,Z=new s.Buf16(16),z=new s.Buf16(16),le=null,pe=0;for(T=0;T<=15;T++)Z[T]=0;for(L=0;L<h;L++)Z[d[f+L]]++;for(N=V,C=15;1<=C&&Z[C]===0;C--);if(C<N&&(N=C),C===0)return m[p++]=20971520,m[p++]=20971520,y.bits=1,0;for(S=1;S<C&&Z[S]===0;S++);for(N<S&&(N=S),T=$=1;T<=15;T++)if($<<=1,($-=Z[T])<0)return-1;if(0<$&&(l===0||C!==1))return-1;for(z[1]=0,T=1;T<15;T++)z[T+1]=z[T]+Z[T];for(L=0;L<h;L++)d[f+L]!==0&&(g[z[d[f+L]]++]=L);if(_=l===0?(D=le=g,19):l===1?(D=o,X-=257,le=a,pe-=257,256):(D=c,le=u,-1),T=S,x=p,K=L=j=0,E=-1,w=(q=1<<(U=N))-1,l===1&&852<q||l===2&&592<q)return 1;for(;;){for(k=T-K,F=g[L]<_?(R=0,g[L]):g[L]>_?(R=le[pe+g[L]],D[X+g[L]]):(R=96,0),v=1<<T-K,S=b=1<<U;m[x+(j>>K)+(b-=v)]=k<<24|R<<16|F|0,b!==0;);for(v=1<<T-1;j&v;)v>>=1;if(v!==0?(j&=v-1,j+=v):j=0,L++,--Z[T]==0){if(T===C)break;T=d[f+g[L]]}if(N<T&&(j&w)!==E){for(K===0&&(K=N),x+=S,$=1<<(U=T-K);U+K<C&&!(($-=Z[U+K])<=0);)U++,$<<=1;if(q+=1<<U,l===1&&852<q||l===2&&592<q)return 1;m[E=j&w]=N<<24|U<<16|x-p|0}}return j!==0&&(m[x+j]=T-K<<24|64<<16|0),y.bits=N,0}},{"../utils/common":41}],51:[function(n,r,i){r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(n,r,i){var s=n("../utils/common"),o=0,a=1;function c(I){for(var A=I.length;0<=--A;)I[A]=0}var u=0,l=29,d=256,f=d+1+l,h=30,m=19,p=2*f+1,g=15,y=16,v=7,b=256,E=16,w=17,x=18,_=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],k=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],R=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],V=new Array(2*(f+2));c(V);var T=new Array(2*h);c(T);var L=new Array(512);c(L);var S=new Array(256);c(S);var C=new Array(l);c(C);var N,U,K,$=new Array(h);function q(I,A,G,Q,H){this.static_tree=I,this.extra_bits=A,this.extra_base=G,this.elems=Q,this.max_length=H,this.has_stree=I&&I.length}function j(I,A){this.dyn_tree=I,this.max_code=0,this.stat_desc=A}function D(I){return I<256?L[I]:L[256+(I>>>7)]}function X(I,A){I.pending_buf[I.pending++]=255&A,I.pending_buf[I.pending++]=A>>>8&255}function Z(I,A,G){I.bi_valid>y-G?(I.bi_buf|=A<<I.bi_valid&65535,X(I,I.bi_buf),I.bi_buf=A>>y-I.bi_valid,I.bi_valid+=G-y):(I.bi_buf|=A<<I.bi_valid&65535,I.bi_valid+=G)}function z(I,A,G){Z(I,G[2*A],G[2*A+1])}function le(I,A){for(var G=0;G|=1&I,I>>>=1,G<<=1,0<--A;);return G>>>1}function pe(I,A,G){var Q,H,ee=new Array(g+1),de=0;for(Q=1;Q<=g;Q++)ee[Q]=de=de+G[Q-1]<<1;for(H=0;H<=A;H++){var fe=I[2*H+1];fe!==0&&(I[2*H]=le(ee[fe]++,fe))}}function ve(I){var A;for(A=0;A<f;A++)I.dyn_ltree[2*A]=0;for(A=0;A<h;A++)I.dyn_dtree[2*A]=0;for(A=0;A<m;A++)I.bl_tree[2*A]=0;I.dyn_ltree[2*b]=1,I.opt_len=I.static_len=0,I.last_lit=I.matches=0}function je(I){8<I.bi_valid?X(I,I.bi_buf):0<I.bi_valid&&(I.pending_buf[I.pending++]=I.bi_buf),I.bi_buf=0,I.bi_valid=0}function ct(I,A,G,Q){var H=2*A,ee=2*G;return I[H]<I[ee]||I[H]===I[ee]&&Q[A]<=Q[G]}function ut(I,A,G){for(var Q=I.heap[G],H=G<<1;H<=I.heap_len&&(H<I.heap_len&&ct(A,I.heap[H+1],I.heap[H],I.depth)&&H++,!ct(A,Q,I.heap[H],I.depth));)I.heap[G]=I.heap[H],G=H,H<<=1;I.heap[G]=Q}function Ye(I,A,G){var Q,H,ee,de,fe=0;if(I.last_lit!==0)for(;Q=I.pending_buf[I.d_buf+2*fe]<<8|I.pending_buf[I.d_buf+2*fe+1],H=I.pending_buf[I.l_buf+fe],fe++,Q===0?z(I,H,A):(z(I,(ee=S[H])+d+1,A),(de=_[ee])!==0&&Z(I,H-=C[ee],de),z(I,ee=D(--Q),G),(de=k[ee])!==0&&Z(I,Q-=$[ee],de)),fe<I.last_lit;);z(I,b,A)}function Ot(I,A){var G,Q,H,ee=A.dyn_tree,de=A.stat_desc.static_tree,fe=A.stat_desc.has_stree,De=A.stat_desc.elems,rt=-1;for(I.heap_len=0,I.heap_max=p,G=0;G<De;G++)ee[2*G]!==0?(I.heap[++I.heap_len]=rt=G,I.depth[G]=0):ee[2*G+1]=0;for(;I.heap_len<2;)ee[2*(H=I.heap[++I.heap_len]=rt<2?++rt:0)]=1,I.depth[H]=0,I.opt_len--,fe&&(I.static_len-=de[2*H+1]);for(A.max_code=rt,G=I.heap_len>>1;1<=G;G--)ut(I,ee,G);for(H=De;G=I.heap[1],I.heap[1]=I.heap[I.heap_len--],ut(I,ee,1),Q=I.heap[1],I.heap[--I.heap_max]=G,I.heap[--I.heap_max]=Q,ee[2*H]=ee[2*G]+ee[2*Q],I.depth[H]=(I.depth[G]>=I.depth[Q]?I.depth[G]:I.depth[Q])+1,ee[2*G+1]=ee[2*Q+1]=H,I.heap[1]=H++,ut(I,ee,1),2<=I.heap_len;);I.heap[--I.heap_max]=I.heap[1],function(Xe,tn){var sr,vn,Zr,Rt,Nr,ai,_r=tn.dyn_tree,eo=tn.max_code,ea=tn.stat_desc.static_tree,to=tn.stat_desc.has_stree,Ar=tn.stat_desc.extra_bits,no=tn.stat_desc.extra_base,ci=tn.stat_desc.max_length,vs=0;for(Rt=0;Rt<=g;Rt++)Xe.bl_count[Rt]=0;for(_r[2*Xe.heap[Xe.heap_max]+1]=0,sr=Xe.heap_max+1;sr<p;sr++)ci<(Rt=_r[2*_r[2*(vn=Xe.heap[sr])+1]+1]+1)&&(Rt=ci,vs++),_r[2*vn+1]=Rt,eo<vn||(Xe.bl_count[Rt]++,Nr=0,no<=vn&&(Nr=Ar[vn-no]),ai=_r[2*vn],Xe.opt_len+=ai*(Rt+Nr),to&&(Xe.static_len+=ai*(ea[2*vn+1]+Nr)));if(vs!==0){do{for(Rt=ci-1;Xe.bl_count[Rt]===0;)Rt--;Xe.bl_count[Rt]--,Xe.bl_count[Rt+1]+=2,Xe.bl_count[ci]--,vs-=2}while(0<vs);for(Rt=ci;Rt!==0;Rt--)for(vn=Xe.bl_count[Rt];vn!==0;)eo<(Zr=Xe.heap[--sr])||(_r[2*Zr+1]!==Rt&&(Xe.opt_len+=(Rt-_r[2*Zr+1])*_r[2*Zr],_r[2*Zr+1]=Rt),vn--)}}(I,A),pe(ee,rt,I.bl_count)}function O(I,A,G){var Q,H,ee=-1,de=A[1],fe=0,De=7,rt=4;for(de===0&&(De=138,rt=3),A[2*(G+1)+1]=65535,Q=0;Q<=G;Q++)H=de,de=A[2*(Q+1)+1],++fe<De&&H===de||(fe<rt?I.bl_tree[2*H]+=fe:H!==0?(H!==ee&&I.bl_tree[2*H]++,I.bl_tree[2*E]++):fe<=10?I.bl_tree[2*w]++:I.bl_tree[2*x]++,ee=H,rt=(fe=0)===de?(De=138,3):H===de?(De=6,3):(De=7,4))}function he(I,A,G){var Q,H,ee=-1,de=A[1],fe=0,De=7,rt=4;for(de===0&&(De=138,rt=3),Q=0;Q<=G;Q++)if(H=de,de=A[2*(Q+1)+1],!(++fe<De&&H===de)){if(fe<rt)for(;z(I,H,I.bl_tree),--fe!=0;);else H!==0?(H!==ee&&(z(I,H,I.bl_tree),fe--),z(I,E,I.bl_tree),Z(I,fe-3,2)):fe<=10?(z(I,w,I.bl_tree),Z(I,fe-3,3)):(z(I,x,I.bl_tree),Z(I,fe-11,7));ee=H,rt=(fe=0)===de?(De=138,3):H===de?(De=6,3):(De=7,4)}}c($);var ae=!1;function W(I,A,G,Q){Z(I,(u<<1)+(Q?1:0),3),function(H,ee,de,fe){je(H),X(H,de),X(H,~de),s.arraySet(H.pending_buf,H.window,ee,de,H.pending),H.pending+=de}(I,A,G)}i._tr_init=function(I){ae||(function(){var A,G,Q,H,ee,de=new Array(g+1);for(H=Q=0;H<l-1;H++)for(C[H]=Q,A=0;A<1<<_[H];A++)S[Q++]=H;for(S[Q-1]=H,H=ee=0;H<16;H++)for($[H]=ee,A=0;A<1<<k[H];A++)L[ee++]=H;for(ee>>=7;H<h;H++)for($[H]=ee<<7,A=0;A<1<<k[H]-7;A++)L[256+ee++]=H;for(G=0;G<=g;G++)de[G]=0;for(A=0;A<=143;)V[2*A+1]=8,A++,de[8]++;for(;A<=255;)V[2*A+1]=9,A++,de[9]++;for(;A<=279;)V[2*A+1]=7,A++,de[7]++;for(;A<=287;)V[2*A+1]=8,A++,de[8]++;for(pe(V,f+1,de),A=0;A<h;A++)T[2*A+1]=5,T[2*A]=le(A,5);N=new q(V,_,d+1,f,g),U=new q(T,k,0,h,g),K=new q(new Array(0),R,0,m,v)}(),ae=!0),I.l_desc=new j(I.dyn_ltree,N),I.d_desc=new j(I.dyn_dtree,U),I.bl_desc=new j(I.bl_tree,K),I.bi_buf=0,I.bi_valid=0,ve(I)},i._tr_stored_block=W,i._tr_flush_block=function(I,A,G,Q){var H,ee,de=0;0<I.level?(I.strm.data_type===2&&(I.strm.data_type=function(fe){var De,rt=4093624447;for(De=0;De<=31;De++,rt>>>=1)if(1&rt&&fe.dyn_ltree[2*De]!==0)return o;if(fe.dyn_ltree[18]!==0||fe.dyn_ltree[20]!==0||fe.dyn_ltree[26]!==0)return a;for(De=32;De<d;De++)if(fe.dyn_ltree[2*De]!==0)return a;return o}(I)),Ot(I,I.l_desc),Ot(I,I.d_desc),de=function(fe){var De;for(O(fe,fe.dyn_ltree,fe.l_desc.max_code),O(fe,fe.dyn_dtree,fe.d_desc.max_code),Ot(fe,fe.bl_desc),De=m-1;3<=De&&fe.bl_tree[2*F[De]+1]===0;De--);return fe.opt_len+=3*(De+1)+5+5+4,De}(I),H=I.opt_len+3+7>>>3,(ee=I.static_len+3+7>>>3)<=H&&(H=ee)):H=ee=G+5,G+4<=H&&A!==-1?W(I,A,G,Q):I.strategy===4||ee===H?(Z(I,2+(Q?1:0),3),Ye(I,V,T)):(Z(I,4+(Q?1:0),3),function(fe,De,rt,Xe){var tn;for(Z(fe,De-257,5),Z(fe,rt-1,5),Z(fe,Xe-4,4),tn=0;tn<Xe;tn++)Z(fe,fe.bl_tree[2*F[tn]+1],3);he(fe,fe.dyn_ltree,De-1),he(fe,fe.dyn_dtree,rt-1)}(I,I.l_desc.max_code+1,I.d_desc.max_code+1,de+1),Ye(I,I.dyn_ltree,I.dyn_dtree)),ve(I),Q&&je(I)},i._tr_tally=function(I,A,G){return I.pending_buf[I.d_buf+2*I.last_lit]=A>>>8&255,I.pending_buf[I.d_buf+2*I.last_lit+1]=255&A,I.pending_buf[I.l_buf+I.last_lit]=255&G,I.last_lit++,A===0?I.dyn_ltree[2*G]++:(I.matches++,A--,I.dyn_ltree[2*(S[G]+d+1)]++,I.dyn_dtree[2*D(A)]++),I.last_lit===I.lit_bufsize-1},i._tr_align=function(I){Z(I,2,3),z(I,b,V),function(A){A.bi_valid===16?(X(A,A.bi_buf),A.bi_buf=0,A.bi_valid=0):8<=A.bi_valid&&(A.pending_buf[A.pending++]=255&A.bi_buf,A.bi_buf>>=8,A.bi_valid-=8)}(I)}},{"../utils/common":41}],53:[function(n,r,i){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,r,i){(function(s){(function(o,a){if(!o.setImmediate){var c,u,l,d,f=1,h={},m=!1,p=o.document,g=Object.getPrototypeOf&&Object.getPrototypeOf(o);g=g&&g.setTimeout?g:o,c={}.toString.call(o.process)==="[object process]"?function(E){process.nextTick(function(){v(E)})}:function(){if(o.postMessage&&!o.importScripts){var E=!0,w=o.onmessage;return o.onmessage=function(){E=!1},o.postMessage("","*"),o.onmessage=w,E}}()?(d="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",b,!1):o.attachEvent("onmessage",b),function(E){o.postMessage(d+E,"*")}):o.MessageChannel?((l=new MessageChannel).port1.onmessage=function(E){v(E.data)},function(E){l.port2.postMessage(E)}):p&&"onreadystatechange"in p.createElement("script")?(u=p.documentElement,function(E){var w=p.createElement("script");w.onreadystatechange=function(){v(E),w.onreadystatechange=null,u.removeChild(w),w=null},u.appendChild(w)}):function(E){setTimeout(v,0,E)},g.setImmediate=function(E){typeof E!="function"&&(E=new Function(""+E));for(var w=new Array(arguments.length-1),x=0;x<w.length;x++)w[x]=arguments[x+1];var _={callback:E,args:w};return h[f]=_,c(f),f++},g.clearImmediate=y}function y(E){delete h[E]}function v(E){if(m)setTimeout(v,0,E);else{var w=h[E];if(w){m=!0;try{(function(x){var _=x.callback,k=x.args;switch(k.length){case 0:_();break;case 1:_(k[0]);break;case 2:_(k[0],k[1]);break;case 3:_(k[0],k[1],k[2]);break;default:_.apply(a,k)}})(w)}finally{y(E),m=!1}}}}function b(E){E.source===o&&typeof E.data=="string"&&E.data.indexOf(d)===0&&v(+E.data.slice(d.length))}})(typeof self>"u"?s===void 0?this:s:self)}).call(this,typeof rr<"u"?rr:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(OO);var iB=OO.exports;const CO=ec(iB);var jt;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},t.find=(i,s)=>{for(const o of i)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(jt||(jt={}));var yv;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(yv||(yv={}));const Me=jt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Cs=t=>{switch(typeof t){case"undefined":return Me.undefined;case"string":return Me.string;case"number":return isNaN(t)?Me.nan:Me.number;case"boolean":return Me.boolean;case"function":return Me.function;case"bigint":return Me.bigint;case"symbol":return Me.symbol;case"object":return Array.isArray(t)?Me.array:t===null?Me.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Me.promise:typeof Map<"u"&&t instanceof Map?Me.map:typeof Set<"u"&&t instanceof Set?Me.set:typeof Date<"u"&&t instanceof Date?Me.date:Me.object;default:return Me.unknown}},xe=jt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),sB=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Cr extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,c=0;for(;c<o.path.length;){const u=o.path[c];c===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(o))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return i(this),r}static assert(e){if(!(e instanceof Cr))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,jt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Cr.create=t=>new Cr(t);const vu=(t,e)=>{let n;switch(t.code){case xe.invalid_type:t.received===Me.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case xe.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,jt.jsonStringifyReplacer)}`;break;case xe.unrecognized_keys:n=`Unrecognized key(s) in object: ${jt.joinValues(t.keys,", ")}`;break;case xe.invalid_union:n="Invalid input";break;case xe.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${jt.joinValues(t.options)}`;break;case xe.invalid_enum_value:n=`Invalid enum value. Expected ${jt.joinValues(t.options)}, received '${t.received}'`;break;case xe.invalid_arguments:n="Invalid function arguments";break;case xe.invalid_return_type:n="Invalid function return type";break;case xe.invalid_date:n="Invalid date";break;case xe.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:jt.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case xe.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case xe.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case xe.custom:n="Invalid input";break;case xe.invalid_intersection_types:n="Intersection results could not be merged";break;case xe.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case xe.not_finite:n="Number must be finite";break;default:n=e.defaultError,jt.assertNever(t)}return{message:n}};let kO=vu;function oB(t){kO=t}function Cp(){return kO}const kp=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,s=[...n,...i.path||[]],o={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let a="";const c=r.filter(u=>!!u).slice().reverse();for(const u of c)a=u(o,{data:e,defaultError:a}).message;return{...i,path:s,message:a}},aB=[];function Ne(t,e){const n=Cp(),r=kp({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===vu?void 0:vu].filter(i=>!!i)});t.common.issues.push(r)}class ir{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return lt;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const s=await i.key,o=await i.value;r.push({key:s,value:o})}return ir.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return lt;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:e.value,value:r}}}const lt=Object.freeze({status:"aborted"}),Fc=t=>({status:"dirty",value:t}),vr=t=>({status:"valid",value:t}),vv=t=>t.status==="aborted",bv=t=>t.status==="dirty",Ma=t=>t.status==="valid",md=t=>typeof Promise<"u"&&t instanceof Promise;function Dp(t,e,n,r){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function DO(t,e,n,r,i){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var Ge;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Ge||(Ge={}));var wl,El;class us{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const cS=(t,e)=>{if(Ma(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Cr(t.common.issues);return this._error=n,this._error}}};function mt(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,a)=>{var c,u;const{message:l}=t;return o.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:(c=l??r)!==null&&c!==void 0?c:a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:(u=l??n)!==null&&u!==void 0?u:a.defaultError}},description:i}}class wt{get description(){return this._def.description}_getType(e){return Cs(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Cs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ir,ctx:{common:e.parent.common,data:e.data,parsedType:Cs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(md(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Cs(e)},s=this._parseSync({data:e,path:i.path,parent:i});return cS(i,s)}"~validate"(e){var n,r;const i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Cs(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:i});return Ma(s)?{value:s.value}:{issues:i.common.issues}}catch(s){!((r=(n=s==null?void 0:s.message)===null||n===void 0?void 0:n.toLowerCase())===null||r===void 0)&&r.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:i}).then(s=>Ma(s)?{value:s.value}:{issues:i.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Cs(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(md(i)?i:Promise.resolve(i));return cS(r,s)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const o=e(i),a=()=>s.addIssue({code:xe.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Di({schema:this,typeName:ot.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return rs.create(this,this._def)}nullable(){return Bo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Si.create(this)}promise(){return _u.create(this,this._def)}or(e){return bd.create([this,e],this._def)}and(e){return _d.create(this,e,this._def)}transform(e){return new Di({...mt(this._def),schema:this,typeName:ot.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Td({...mt(this._def),innerType:this,defaultValue:n,typeName:ot.ZodDefault})}brand(){return new C_({typeName:ot.ZodBranded,type:this,...mt(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Id({...mt(this._def),innerType:this,catchValue:n,typeName:ot.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return gf.create(this,e)}readonly(){return Od.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cB=/^c[^\s-]{8,}$/i,uB=/^[0-9a-z]+$/,lB=/^[0-9A-HJKMNP-TV-Z]{26}$/i,dB=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,fB=/^[a-z0-9_-]{21}$/i,hB=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,pB=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,mB=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,gB="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let py;const yB=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,vB=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,bB=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,_B=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,wB=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,EB=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,RO="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",SB=new RegExp(`^${RO}$`);function NO(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function xB(t){return new RegExp(`^${NO(t)}$`)}function AO(t){let e=`${RO}T${NO(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function TB(t,e){return!!((e==="v4"||!e)&&yB.test(t)||(e==="v6"||!e)&&bB.test(t))}function IB(t,e){if(!hB.test(t))return!1;try{const[n]=t.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||!i.typ||!i.alg||e&&i.alg!==e)}catch{return!1}}function OB(t,e){return!!((e==="v4"||!e)&&vB.test(t)||(e==="v6"||!e)&&_B.test(t))}class wi extends wt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Me.string){const s=this._getOrReturnCtx(e);return Ne(s,{code:xe.invalid_type,expected:Me.string,received:s.parsedType}),lt}const r=new ir;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),Ne(i,{code:xe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),Ne(i,{code:xe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,a=e.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(e,i),o?Ne(i,{code:xe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&Ne(i,{code:xe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")mB.test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"email",code:xe.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")py||(py=new RegExp(gB,"u")),py.test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"emoji",code:xe.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")dB.test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"uuid",code:xe.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")fB.test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"nanoid",code:xe.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")cB.test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"cuid",code:xe.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")uB.test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"cuid2",code:xe.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")lB.test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"ulid",code:xe.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Ne(i,{validation:"url",code:xe.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"regex",code:xe.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),Ne(i,{code:xe.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),Ne(i,{code:xe.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),Ne(i,{code:xe.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?AO(s).test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{code:xe.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?SB.test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{code:xe.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?xB(s).test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{code:xe.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?pB.test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"duration",code:xe.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?TB(e.data,s.version)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"ip",code:xe.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?IB(e.data,s.alg)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"jwt",code:xe.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?OB(e.data,s.version)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"cidr",code:xe.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?wB.test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"base64",code:xe.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?EB.test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"base64url",code:xe.invalid_string,message:s.message}),r.dirty()):jt.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:xe.invalid_string,...Ge.errToObj(r)})}_addCheck(e){return new wi({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ge.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ge.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ge.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ge.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ge.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ge.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ge.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ge.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ge.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Ge.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Ge.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ge.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Ge.errToObj(e)})}datetime(e){var n,r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(r=e==null?void 0:e.local)!==null&&r!==void 0?r:!1,...Ge.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...Ge.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Ge.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Ge.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...Ge.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Ge.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Ge.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Ge.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Ge.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Ge.errToObj(n)})}nonempty(e){return this.min(1,Ge.errToObj(e))}trim(){return new wi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new wi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new wi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}wi.create=t=>{var e;return new wi({checks:[],typeName:ot.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...mt(t)})};function CB(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,s=parseInt(t.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}class $o extends wt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Me.number){const s=this._getOrReturnCtx(e);return Ne(s,{code:xe.invalid_type,expected:Me.number,received:s.parsedType}),lt}let r;const i=new ir;for(const s of this._def.checks)s.kind==="int"?jt.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Ne(r,{code:xe.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),Ne(r,{code:xe.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),Ne(r,{code:xe.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?CB(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),Ne(r,{code:xe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Ne(r,{code:xe.not_finite,message:s.message}),i.dirty()):jt.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Ge.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ge.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ge.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ge.toString(n))}setLimit(e,n,r,i){return new $o({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ge.toString(i)}]})}_addCheck(e){return new $o({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ge.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ge.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ge.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ge.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ge.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ge.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Ge.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ge.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ge.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&jt.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}$o.create=t=>new $o({checks:[],typeName:ot.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...mt(t)});class jo extends wt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Me.bigint)return this._getInvalidInput(e);let r;const i=new ir;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),Ne(r,{code:xe.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),Ne(r,{code:xe.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Ne(r,{code:xe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):jt.assertNever(s);return{status:i.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Ne(n,{code:xe.invalid_type,expected:Me.bigint,received:n.parsedType}),lt}gte(e,n){return this.setLimit("min",e,!0,Ge.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ge.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ge.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ge.toString(n))}setLimit(e,n,r,i){return new jo({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ge.toString(i)}]})}_addCheck(e){return new jo({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ge.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ge.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ge.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ge.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ge.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}jo.create=t=>{var e;return new jo({checks:[],typeName:ot.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...mt(t)})};class gd extends wt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Me.boolean){const r=this._getOrReturnCtx(e);return Ne(r,{code:xe.invalid_type,expected:Me.boolean,received:r.parsedType}),lt}return vr(e.data)}}gd.create=t=>new gd({typeName:ot.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...mt(t)});class La extends wt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Me.date){const s=this._getOrReturnCtx(e);return Ne(s,{code:xe.invalid_type,expected:Me.date,received:s.parsedType}),lt}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return Ne(s,{code:xe.invalid_date}),lt}const r=new ir;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),Ne(i,{code:xe.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),Ne(i,{code:xe.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):jt.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new La({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Ge.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Ge.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}La.create=t=>new La({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ot.ZodDate,...mt(t)});class Rp extends wt{_parse(e){if(this._getType(e)!==Me.symbol){const r=this._getOrReturnCtx(e);return Ne(r,{code:xe.invalid_type,expected:Me.symbol,received:r.parsedType}),lt}return vr(e.data)}}Rp.create=t=>new Rp({typeName:ot.ZodSymbol,...mt(t)});class yd extends wt{_parse(e){if(this._getType(e)!==Me.undefined){const r=this._getOrReturnCtx(e);return Ne(r,{code:xe.invalid_type,expected:Me.undefined,received:r.parsedType}),lt}return vr(e.data)}}yd.create=t=>new yd({typeName:ot.ZodUndefined,...mt(t)});class vd extends wt{_parse(e){if(this._getType(e)!==Me.null){const r=this._getOrReturnCtx(e);return Ne(r,{code:xe.invalid_type,expected:Me.null,received:r.parsedType}),lt}return vr(e.data)}}vd.create=t=>new vd({typeName:ot.ZodNull,...mt(t)});class bu extends wt{constructor(){super(...arguments),this._any=!0}_parse(e){return vr(e.data)}}bu.create=t=>new bu({typeName:ot.ZodAny,...mt(t)});class xa extends wt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return vr(e.data)}}xa.create=t=>new xa({typeName:ot.ZodUnknown,...mt(t)});class Vs extends wt{_parse(e){const n=this._getOrReturnCtx(e);return Ne(n,{code:xe.invalid_type,expected:Me.never,received:n.parsedType}),lt}}Vs.create=t=>new Vs({typeName:ot.ZodNever,...mt(t)});class Np extends wt{_parse(e){if(this._getType(e)!==Me.undefined){const r=this._getOrReturnCtx(e);return Ne(r,{code:xe.invalid_type,expected:Me.void,received:r.parsedType}),lt}return vr(e.data)}}Np.create=t=>new Np({typeName:ot.ZodVoid,...mt(t)});class Si extends wt{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==Me.array)return Ne(n,{code:xe.invalid_type,expected:Me.array,received:n.parsedType}),lt;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(o||a)&&(Ne(n,{code:o?xe.too_big:xe.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Ne(n,{code:xe.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Ne(n,{code:xe.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,a)=>i.type._parseAsync(new us(n,o,n.path,a)))).then(o=>ir.mergeArray(r,o));const s=[...n.data].map((o,a)=>i.type._parseSync(new us(n,o,n.path,a)));return ir.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new Si({...this._def,minLength:{value:e,message:Ge.toString(n)}})}max(e,n){return new Si({...this._def,maxLength:{value:e,message:Ge.toString(n)}})}length(e,n){return new Si({...this._def,exactLength:{value:e,message:Ge.toString(n)}})}nonempty(e){return this.min(1,e)}}Si.create=(t,e)=>new Si({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ot.ZodArray,...mt(e)});function kc(t){if(t instanceof yn){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=rs.create(kc(r))}return new yn({...t._def,shape:()=>e})}else return t instanceof Si?new Si({...t._def,type:kc(t.element)}):t instanceof rs?rs.create(kc(t.unwrap())):t instanceof Bo?Bo.create(kc(t.unwrap())):t instanceof ls?ls.create(t.items.map(e=>kc(e))):t}class yn extends wt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=jt.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==Me.object){const u=this._getOrReturnCtx(e);return Ne(u,{code:xe.invalid_type,expected:Me.object,received:u.parsedType}),lt}const{status:r,ctx:i}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Vs&&this._def.unknownKeys==="strip"))for(const u in i.data)o.includes(u)||a.push(u);const c=[];for(const u of o){const l=s[u],d=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new us(i,d,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Vs){const u=this._def.unknownKeys;if(u==="passthrough")for(const l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:i.data[l]}});else if(u==="strict")a.length>0&&(Ne(i,{code:xe.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const l of a){const d=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new us(i,d,i.path,l)),alwaysSet:l in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const l of c){const d=await l.key,f=await l.value;u.push({key:d,value:f,alwaysSet:l.alwaysSet})}return u}).then(u=>ir.mergeObjectSync(r,u)):ir.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return Ge.errToObj,new yn({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,s,o,a;const c=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=Ge.errToObj(e).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new yn({...this._def,unknownKeys:"strip"})}passthrough(){return new yn({...this._def,unknownKeys:"passthrough"})}extend(e){return new yn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new yn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ot.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new yn({...this._def,catchall:e})}pick(e){const n={};return jt.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new yn({...this._def,shape:()=>n})}omit(e){const n={};return jt.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new yn({...this._def,shape:()=>n})}deepPartial(){return kc(this)}partial(e){const n={};return jt.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}),new yn({...this._def,shape:()=>n})}required(e){const n={};return jt.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof rs;)s=s._def.innerType;n[r]=s}}),new yn({...this._def,shape:()=>n})}keyof(){return PO(jt.objectKeys(this.shape))}}yn.create=(t,e)=>new yn({shape:()=>t,unknownKeys:"strip",catchall:Vs.create(),typeName:ot.ZodObject,...mt(e)});yn.strictCreate=(t,e)=>new yn({shape:()=>t,unknownKeys:"strict",catchall:Vs.create(),typeName:ot.ZodObject,...mt(e)});yn.lazycreate=(t,e)=>new yn({shape:t,unknownKeys:"strip",catchall:Vs.create(),typeName:ot.ZodObject,...mt(e)});class bd extends wt{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new Cr(a.ctx.common.issues));return Ne(n,{code:xe.invalid_union,unionErrors:o}),lt}if(n.common.async)return Promise.all(r.map(async s=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const c of r){const u={...n,common:{...n.common,issues:[]},parent:null},l=c._parseSync({data:n.data,path:n.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!s&&(s={result:l,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(c=>new Cr(c));return Ne(n,{code:xe.invalid_union,unionErrors:a}),lt}}get options(){return this._def.options}}bd.create=(t,e)=>new bd({options:t,typeName:ot.ZodUnion,...mt(e)});const Ts=t=>t instanceof Ed?Ts(t.schema):t instanceof Di?Ts(t.innerType()):t instanceof Sd?[t.value]:t instanceof Uo?t.options:t instanceof xd?jt.objectValues(t.enum):t instanceof Td?Ts(t._def.innerType):t instanceof yd?[void 0]:t instanceof vd?[null]:t instanceof rs?[void 0,...Ts(t.unwrap())]:t instanceof Bo?[null,...Ts(t.unwrap())]:t instanceof C_||t instanceof Od?Ts(t.unwrap()):t instanceof Id?Ts(t._def.innerType):[];class Km extends wt{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Me.object)return Ne(n,{code:xe.invalid_type,expected:Me.object,received:n.parsedType}),lt;const r=this.discriminator,i=n.data[r],s=this.optionsMap.get(i);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(Ne(n,{code:xe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),lt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const i=new Map;for(const s of n){const o=Ts(s.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new Km({typeName:ot.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...mt(r)})}}function _v(t,e){const n=Cs(t),r=Cs(e);if(t===e)return{valid:!0,data:t};if(n===Me.object&&r===Me.object){const i=jt.objectKeys(e),s=jt.objectKeys(t).filter(a=>i.indexOf(a)!==-1),o={...t,...e};for(const a of s){const c=_v(t[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(n===Me.array&&r===Me.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<t.length;s++){const o=t[s],a=e[s],c=_v(o,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return n===Me.date&&r===Me.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class _d extends wt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(s,o)=>{if(vv(s)||vv(o))return lt;const a=_v(s.value,o.value);return a.valid?((bv(s)||bv(o))&&n.dirty(),{status:n.value,value:a.data}):(Ne(r,{code:xe.invalid_intersection_types}),lt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}_d.create=(t,e,n)=>new _d({left:t,right:e,typeName:ot.ZodIntersection,...mt(n)});class ls extends wt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Me.array)return Ne(r,{code:xe.invalid_type,expected:Me.array,received:r.parsedType}),lt;if(r.data.length<this._def.items.length)return Ne(r,{code:xe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),lt;!this._def.rest&&r.data.length>this._def.items.length&&(Ne(r,{code:xe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((o,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new us(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>ir.mergeArray(n,o)):ir.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new ls({...this._def,rest:e})}}ls.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ls({items:t,typeName:ot.ZodTuple,rest:null,...mt(e)})};class wd extends wt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Me.object)return Ne(r,{code:xe.invalid_type,expected:Me.object,received:r.parsedType}),lt;const i=[],s=this._def.keyType,o=this._def.valueType;for(const a in r.data)i.push({key:s._parse(new us(r,a,r.path,a)),value:o._parse(new us(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?ir.mergeObjectAsync(n,i):ir.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof wt?new wd({keyType:e,valueType:n,typeName:ot.ZodRecord,...mt(r)}):new wd({keyType:wi.create(),valueType:e,typeName:ot.ZodRecord,...mt(n)})}}class Ap extends wt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Me.map)return Ne(r,{code:xe.invalid_type,expected:Me.map,received:r.parsedType}),lt;const i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,c],u)=>({key:i._parse(new us(r,a,r.path,[u,"key"])),value:s._parse(new us(r,c,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of o){const u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return lt;(u.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(u.value,l.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const c of o){const u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return lt;(u.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(u.value,l.value)}return{status:n.value,value:a}}}}Ap.create=(t,e,n)=>new Ap({valueType:e,keyType:t,typeName:ot.ZodMap,...mt(n)});class Fa extends wt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Me.set)return Ne(r,{code:xe.invalid_type,expected:Me.set,received:r.parsedType}),lt;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Ne(r,{code:xe.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Ne(r,{code:xe.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function o(c){const u=new Set;for(const l of c){if(l.status==="aborted")return lt;l.status==="dirty"&&n.dirty(),u.add(l.value)}return{status:n.value,value:u}}const a=[...r.data.values()].map((c,u)=>s._parse(new us(r,c,r.path,u)));return r.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(e,n){return new Fa({...this._def,minSize:{value:e,message:Ge.toString(n)}})}max(e,n){return new Fa({...this._def,maxSize:{value:e,message:Ge.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Fa.create=(t,e)=>new Fa({valueType:t,minSize:null,maxSize:null,typeName:ot.ZodSet,...mt(e)});class Zc extends wt{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Me.function)return Ne(n,{code:xe.invalid_type,expected:Me.function,received:n.parsedType}),lt;function r(a,c){return kp({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Cp(),vu].filter(u=>!!u),issueData:{code:xe.invalid_arguments,argumentsError:c}})}function i(a,c){return kp({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Cp(),vu].filter(u=>!!u),issueData:{code:xe.invalid_return_type,returnTypeError:c}})}const s={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof _u){const a=this;return vr(async function(...c){const u=new Cr([]),l=await a._def.args.parseAsync(c,s).catch(h=>{throw u.addIssue(r(c,h)),u}),d=await Reflect.apply(o,this,l);return await a._def.returns._def.type.parseAsync(d,s).catch(h=>{throw u.addIssue(i(d,h)),u})})}else{const a=this;return vr(function(...c){const u=a._def.args.safeParse(c,s);if(!u.success)throw new Cr([r(c,u.error)]);const l=Reflect.apply(o,this,u.data),d=a._def.returns.safeParse(l,s);if(!d.success)throw new Cr([i(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Zc({...this._def,args:ls.create(e).rest(xa.create())})}returns(e){return new Zc({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new Zc({args:e||ls.create([]).rest(xa.create()),returns:n||xa.create(),typeName:ot.ZodFunction,...mt(r)})}}class Ed extends wt{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Ed.create=(t,e)=>new Ed({getter:t,typeName:ot.ZodLazy,...mt(e)});class Sd extends wt{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Ne(n,{received:n.data,code:xe.invalid_literal,expected:this._def.value}),lt}return{status:"valid",value:e.data}}get value(){return this._def.value}}Sd.create=(t,e)=>new Sd({value:t,typeName:ot.ZodLiteral,...mt(e)});function PO(t,e){return new Uo({values:t,typeName:ot.ZodEnum,...mt(e)})}class Uo extends wt{constructor(){super(...arguments),wl.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Ne(n,{expected:jt.joinValues(r),received:n.parsedType,code:xe.invalid_type}),lt}if(Dp(this,wl)||DO(this,wl,new Set(this._def.values)),!Dp(this,wl).has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return Ne(n,{received:n.data,code:xe.invalid_enum_value,options:r}),lt}return vr(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Uo.create(e,{...this._def,...n})}exclude(e,n=this._def){return Uo.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}wl=new WeakMap;Uo.create=PO;class xd extends wt{constructor(){super(...arguments),El.set(this,void 0)}_parse(e){const n=jt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Me.string&&r.parsedType!==Me.number){const i=jt.objectValues(n);return Ne(r,{expected:jt.joinValues(i),received:r.parsedType,code:xe.invalid_type}),lt}if(Dp(this,El)||DO(this,El,new Set(jt.getValidEnumValues(this._def.values))),!Dp(this,El).has(e.data)){const i=jt.objectValues(n);return Ne(r,{received:r.data,code:xe.invalid_enum_value,options:i}),lt}return vr(e.data)}get enum(){return this._def.values}}El=new WeakMap;xd.create=(t,e)=>new xd({values:t,typeName:ot.ZodNativeEnum,...mt(e)});class _u extends wt{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Me.promise&&n.common.async===!1)return Ne(n,{code:xe.invalid_type,expected:Me.promise,received:n.parsedType}),lt;const r=n.parsedType===Me.promise?n.data:Promise.resolve(n.data);return vr(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}_u.create=(t,e)=>new _u({type:t,typeName:ot.ZodPromise,...mt(e)});class Di extends wt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ot.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{Ne(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(r.data,s);if(r.common.async)return Promise.resolve(o).then(async a=>{if(n.value==="aborted")return lt;const c=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return c.status==="aborted"?lt:c.status==="dirty"||n.value==="dirty"?Fc(c.value):c});{if(n.value==="aborted")return lt;const a=this._def.schema._parseSync({data:o,path:r.path,parent:r});return a.status==="aborted"?lt:a.status==="dirty"||n.value==="dirty"?Fc(a.value):a}}if(i.type==="refinement"){const o=a=>{const c=i.refinement(a,s);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?lt:(a.status==="dirty"&&n.dirty(),o(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?lt:(a.status==="dirty"&&n.dirty(),o(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Ma(o))return o;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Ma(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:n.value,value:a})):o);jt.assertNever(i)}}Di.create=(t,e,n)=>new Di({schema:t,typeName:ot.ZodEffects,effect:e,...mt(n)});Di.createWithPreprocess=(t,e,n)=>new Di({schema:e,effect:{type:"preprocess",transform:t},typeName:ot.ZodEffects,...mt(n)});class rs extends wt{_parse(e){return this._getType(e)===Me.undefined?vr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}rs.create=(t,e)=>new rs({innerType:t,typeName:ot.ZodOptional,...mt(e)});class Bo extends wt{_parse(e){return this._getType(e)===Me.null?vr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Bo.create=(t,e)=>new Bo({innerType:t,typeName:ot.ZodNullable,...mt(e)});class Td extends wt{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===Me.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Td.create=(t,e)=>new Td({innerType:t,typeName:ot.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...mt(e)});class Id extends wt{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return md(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Cr(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Cr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Id.create=(t,e)=>new Id({innerType:t,typeName:ot.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...mt(e)});class Pp extends wt{_parse(e){if(this._getType(e)!==Me.nan){const r=this._getOrReturnCtx(e);return Ne(r,{code:xe.invalid_type,expected:Me.nan,received:r.parsedType}),lt}return{status:"valid",value:e.data}}}Pp.create=t=>new Pp({typeName:ot.ZodNaN,...mt(t)});const kB=Symbol("zod_brand");class C_ extends wt{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class gf extends wt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?lt:s.status==="dirty"?(n.dirty(),Fc(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?lt:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new gf({in:e,out:n,typeName:ot.ZodPipeline})}}class Od extends wt{_parse(e){const n=this._def.innerType._parse(e),r=i=>(Ma(i)&&(i.value=Object.freeze(i.value)),i);return md(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}Od.create=(t,e)=>new Od({innerType:t,typeName:ot.ZodReadonly,...mt(e)});function MO(t,e={},n){return t?bu.create().superRefine((r,i)=>{var s,o;if(!t(r)){const a=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,c=(o=(s=a.fatal)!==null&&s!==void 0?s:n)!==null&&o!==void 0?o:!0,u=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...u,fatal:c})}}):bu.create()}const DB={object:yn.lazycreate};var ot;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ot||(ot={}));const RB=(t,e={message:`Input not instance of ${t.name}`})=>MO(n=>n instanceof t,e),LO=wi.create,FO=$o.create,NB=Pp.create,AB=jo.create,$O=gd.create,PB=La.create,MB=Rp.create,LB=yd.create,FB=vd.create,$B=bu.create,jB=xa.create,UB=Vs.create,BB=Np.create,zB=Si.create,VB=yn.create,HB=yn.strictCreate,WB=bd.create,qB=Km.create,GB=_d.create,ZB=ls.create,YB=wd.create,KB=Ap.create,JB=Fa.create,XB=Zc.create,QB=Ed.create,e6=Sd.create,t6=Uo.create,n6=xd.create,r6=_u.create,uS=Di.create,i6=rs.create,s6=Bo.create,o6=Di.createWithPreprocess,a6=gf.create,c6=()=>LO().optional(),u6=()=>FO().optional(),l6=()=>$O().optional(),d6={string:t=>wi.create({...t,coerce:!0}),number:t=>$o.create({...t,coerce:!0}),boolean:t=>gd.create({...t,coerce:!0}),bigint:t=>jo.create({...t,coerce:!0}),date:t=>La.create({...t,coerce:!0})},f6=lt;var Xt=Object.freeze({__proto__:null,defaultErrorMap:vu,setErrorMap:oB,getErrorMap:Cp,makeIssue:kp,EMPTY_PATH:aB,addIssueToContext:Ne,ParseStatus:ir,INVALID:lt,DIRTY:Fc,OK:vr,isAborted:vv,isDirty:bv,isValid:Ma,isAsync:md,get util(){return jt},get objectUtil(){return yv},ZodParsedType:Me,getParsedType:Cs,ZodType:wt,datetimeRegex:AO,ZodString:wi,ZodNumber:$o,ZodBigInt:jo,ZodBoolean:gd,ZodDate:La,ZodSymbol:Rp,ZodUndefined:yd,ZodNull:vd,ZodAny:bu,ZodUnknown:xa,ZodNever:Vs,ZodVoid:Np,ZodArray:Si,ZodObject:yn,ZodUnion:bd,ZodDiscriminatedUnion:Km,ZodIntersection:_d,ZodTuple:ls,ZodRecord:wd,ZodMap:Ap,ZodSet:Fa,ZodFunction:Zc,ZodLazy:Ed,ZodLiteral:Sd,ZodEnum:Uo,ZodNativeEnum:xd,ZodPromise:_u,ZodEffects:Di,ZodTransformer:Di,ZodOptional:rs,ZodNullable:Bo,ZodDefault:Td,ZodCatch:Id,ZodNaN:Pp,BRAND:kB,ZodBranded:C_,ZodPipeline:gf,ZodReadonly:Od,custom:MO,Schema:wt,ZodSchema:wt,late:DB,get ZodFirstPartyTypeKind(){return ot},coerce:d6,any:$B,array:zB,bigint:AB,boolean:$O,date:PB,discriminatedUnion:qB,effect:uS,enum:t6,function:XB,instanceof:RB,intersection:GB,lazy:QB,literal:e6,map:KB,nan:NB,nativeEnum:n6,never:UB,null:FB,nullable:s6,number:FO,object:VB,oboolean:l6,onumber:u6,optional:i6,ostring:c6,pipeline:a6,preprocess:o6,promise:r6,record:YB,set:JB,strictObject:HB,string:LO,symbol:MB,transformer:uS,tuple:ZB,undefined:LB,union:WB,unknown:jB,void:BB,NEVER:f6,ZodIssueCode:xe,quotelessJson:sB,ZodError:Cr});const In={Remove:"remove",Replace:"replace",Add:"add"},jO=Symbol.for("__MUTATIVE_PROXY_DRAFT__"),h6=Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"),zh=Symbol.iterator,zr={mutable:"mutable",immutable:"immutable"},k_={};function jl(t,e){return t instanceof Map?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function lS(t,e){if(e in t){let n=Reflect.getPrototypeOf(t);for(;n;){const r=Reflect.getOwnPropertyDescriptor(n,e);if(r)return r;n=Reflect.getPrototypeOf(n)}}}function D_(t){return Object.getPrototypeOf(t)===Set.prototype}function R_(t){return Object.getPrototypeOf(t)===Map.prototype}function Lr(t){var e;return(e=t.copy)!==null&&e!==void 0?e:t.original}function $a(t){return!!Pt(t)}function Pt(t){return typeof t!="object"?null:t==null?void 0:t[jO]}function N_(t){var e;const n=Pt(t);return n?(e=n.copy)!==null&&e!==void 0?e:n.original:t}function Ri(t,e){if(!t||typeof t!="object")return!1;let n;return Object.getPrototypeOf(t)===Object.prototype||Array.isArray(t)||t instanceof Map||t instanceof Set||!!(e!=null&&e.mark)&&((n=e.mark(t,zr))===zr.immutable||typeof n=="function")}function UO(t,e=[]){if(Object.hasOwnProperty.call(t,"key")){const n=t.parent.copy,r=Pt(Hs(n,t.key));if(r!==null&&(r==null?void 0:r.original)!==t.original)return null;const i=t.parent.type===3,s=i?Array.from(t.parent.setMap.keys()).indexOf(t.key):t.key;if(!(i&&n.size>s||jl(n,s)))return null;e.push(s)}if(t.parent)return UO(t.parent,e);e.reverse();try{p6(t.copy,e)}catch{return null}return e}function ic(t){return Array.isArray(t)?1:t instanceof Map?2:t instanceof Set?3:0}function Hs(t,e){return ic(t)===2?t.get(e):t[e]}function yf(t,e,n){ic(t)===2?t.set(e,n):t[e]=n}function my(t,e){const n=Pt(t);return(n?Lr(n):t)[e]}function $s(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}function wv(t){if(t)for(;t.finalities.revoke.length>0;)t.finalities.revoke.pop()()}function fa(t,e){return e?t:[""].concat(t).map(n=>{const r=`${n}`;return r.indexOf("/")===-1&&r.indexOf("~")===-1?r:r.replace(/~/g,"~0").replace(/\//g,"~1")}).join("/")}function p6(t,e){for(let n=0;n<e.length-1;n+=1){const r=e[n];if(t=Hs(ic(t)===3?Array.from(t):t,r),typeof t!="object")throw new Error(`Cannot resolve patch at '${e.join("/")}'.`)}return t}function m6(t){const e=Object.create(Object.getPrototypeOf(t));return Reflect.ownKeys(t).forEach(n=>{let r=Reflect.getOwnPropertyDescriptor(t,n);if(r.enumerable&&r.configurable&&r.writable){e[n]=t[n];return}r.writable||(r.writable=!0,r.configurable=!0),(r.get||r.set)&&(r={configurable:!0,writable:!0,enumerable:r.enumerable,value:t[n]}),Reflect.defineProperty(e,n,r)}),e}const g6=Object.prototype.propertyIsEnumerable;function BO(t,e){let n;if(Array.isArray(t))return Array.prototype.concat.call(t);if(t instanceof Set){if(!D_(t)){const r=Object.getPrototypeOf(t).constructor;return new r(t.values())}return Set.prototype.difference?Set.prototype.difference.call(t,new Set):new Set(t.values())}else if(t instanceof Map){if(!R_(t)){const r=Object.getPrototypeOf(t).constructor;return new r(t)}return new Map(t)}else if(e!=null&&e.mark&&(n=e.mark(t,zr),n!==void 0)&&n!==zr.mutable){if(n===zr.immutable)return m6(t);if(typeof n=="function"){if(e.enablePatches||e.enableAutoFreeze)throw new Error("You can't use mark and patches or auto freeze together.");return n()}throw new Error(`Unsupported mark result: ${n}`)}else if(typeof t=="object"&&Object.getPrototypeOf(t)===Object.prototype){const r={};return Object.keys(t).forEach(i=>{r[i]=t[i]}),Object.getOwnPropertySymbols(t).forEach(i=>{g6.call(t,i)&&(r[i]=t[i])}),r}else throw new Error("Please check mark() to ensure that it is a stable marker draftable function.")}function fr(t){t.copy||(t.copy=BO(t.original,t.options))}function Sl(t){if(!Ri(t))return N_(t);if(Array.isArray(t))return t.map(Sl);if(t instanceof Map){const n=Array.from(t.entries()).map(([r,i])=>[r,Sl(i)]);if(!R_(t)){const r=Object.getPrototypeOf(t).constructor;return new r(n)}return new Map(n)}if(t instanceof Set){const n=Array.from(t).map(Sl);if(!D_(t)){const r=Object.getPrototypeOf(t).constructor;return new r(n)}return new Set(n)}const e=Object.create(Object.getPrototypeOf(t));for(const n in t)e[n]=Sl(t[n]);return e}function Vh(t){return $a(t)?Sl(t):t}function is(t){var e;t.assignedMap=(e=t.assignedMap)!==null&&e!==void 0?e:new Map,t.operated||(t.operated=!0,t.parent&&is(t.parent))}function dS(){throw new Error("Cannot modify frozen object")}function Dc(t,e,n,r,i){{n=n??new WeakMap,r=r??[],i=i??[];const o=n.has(t)?n.get(t):t;if(r.length>0){const a=r.indexOf(o);if(o&&typeof o=="object"&&a!==-1)throw r[0]===o?new Error("Forbids circular reference"):new Error(`Forbids circular reference: ~/${i.slice(0,a).map((c,u)=>{if(typeof c=="symbol")return`[${c.toString()}]`;const l=r[u];return typeof c=="object"&&(l instanceof Map||l instanceof Set)?Array.from(l.keys()).indexOf(c):c}).join("/")}`);r.push(o),i.push(e)}else r.push(o)}if(Object.isFrozen(t)||$a(t)){r.pop(),i.pop();return}switch(ic(t)){case 2:for(const[a,c]of t)Dc(a,a,n,r,i),Dc(c,a,n,r,i);t.set=t.clear=t.delete=dS;break;case 3:for(const a of t)Dc(a,a,n,r,i);t.add=t.clear=t.delete=dS;break;case 1:Object.freeze(t);let o=0;for(const a of t)Dc(a,o,n,r,i),o+=1;break;default:Object.freeze(t),Object.keys(t).forEach(a=>{const c=t[a];Dc(c,a,n,r,i)})}r.pop(),i.pop()}function A_(t,e){const n=ic(t);if(n===0)Reflect.ownKeys(t).forEach(r=>{e(r,t[r],t)});else if(n===1){let r=0;for(const i of t)e(r,i,t),r+=1}else t.forEach((r,i)=>e(i,r,t))}function zO(t,e,n){if($a(t)||!Ri(t,n)||e.has(t)||Object.isFrozen(t))return;const r=t instanceof Set,i=r?new Map:void 0;if(e.add(t),A_(t,(s,o)=>{var a;if($a(o)){const c=Pt(o);fr(c);const u=!((a=c.assignedMap)===null||a===void 0)&&a.size||c.operated?c.copy:c.original;yf(r?i:t,s,u)}else zO(o,e,n)}),i){const s=t,o=Array.from(s);s.clear(),o.forEach(a=>{s.add(i.has(a)?i.get(a):a)})}}function y6(t,e){const n=t.type===3?t.setMap:t.copy;t.finalities.revoke.length>1&&t.assignedMap.get(e)&&n&&zO(Hs(n,e),t.finalities.handledSet,t.options)}function Ev(t){t.type===3&&t.copy&&(t.copy.clear(),t.setMap.forEach(e=>{t.copy.add(N_(e))}))}function Sv(t,e,n,r){if(t.operated&&t.assignedMap&&t.assignedMap.size>0&&!t.finalized){if(n&&r){const s=UO(t);s&&e(t,s,n,r)}t.finalized=!0}}function P_(t,e,n,r){const i=Pt(n);i&&(i.callbacks||(i.callbacks=[]),i.callbacks.push((s,o)=>{var a;const c=t.type===3?t.setMap:t.copy;if($s(Hs(c,e),n)){let u=i.original;i.copy&&(u=i.copy),Ev(t),Sv(t,r,s,o),t.options.enableAutoFreeze&&(t.options.updatedValues=(a=t.options.updatedValues)!==null&&a!==void 0?a:new WeakMap,t.options.updatedValues.set(u,i.original)),yf(c,e,u)}}),t.options.enableAutoFreeze&&i.finalities!==t.finalities&&(t.options.enableAutoFreeze=!1)),Ri(n,t.options)&&t.finalities.draft.push(()=>{const s=t.type===3?t.setMap:t.copy;$s(Hs(s,e),n)&&y6(t,e)})}function v6(t,e,n,r,i){let{original:s,assignedMap:o,options:a}=t,c=t.copy;c.length<s.length&&([s,c]=[c,s],[n,r]=[r,n]);for(let u=0;u<s.length;u+=1)if(o.get(u.toString())&&c[u]!==s[u]){const l=e.concat([u]),d=fa(l,i);n.push({op:In.Replace,path:d,value:Vh(c[u])}),r.push({op:In.Replace,path:d,value:Vh(s[u])})}for(let u=s.length;u<c.length;u+=1){const l=e.concat([u]),d=fa(l,i);n.push({op:In.Add,path:d,value:Vh(c[u])})}if(s.length<c.length){const{arrayLengthAssignment:u=!0}=a.enablePatches;if(u){const l=e.concat(["length"]),d=fa(l,i);r.push({op:In.Replace,path:d,value:s.length})}else for(let l=c.length;s.length<l;l-=1){const d=e.concat([l-1]),f=fa(d,i);r.push({op:In.Remove,path:f})}}}function b6({original:t,copy:e,assignedMap:n},r,i,s,o){n.forEach((a,c)=>{const u=Hs(t,c),l=Vh(Hs(e,c)),d=a?jl(t,c)?In.Replace:In.Add:In.Remove;if($s(u,l)&&d===In.Replace)return;const f=r.concat(c),h=fa(f,o);i.push(d===In.Remove?{op:d,path:h}:{op:d,path:h,value:l}),s.push(d===In.Add?{op:In.Remove,path:h}:d===In.Remove?{op:In.Add,path:h,value:u}:{op:In.Replace,path:h,value:u})})}function _6({original:t,copy:e},n,r,i,s){let o=0;t.forEach(a=>{if(!e.has(a)){const c=n.concat([o]),u=fa(c,s);r.push({op:In.Remove,path:u,value:a}),i.unshift({op:In.Add,path:u,value:a})}o+=1}),o=0,e.forEach(a=>{if(!t.has(a)){const c=n.concat([o]),u=fa(c,s);r.push({op:In.Add,path:u,value:a}),i.unshift({op:In.Remove,path:u,value:a})}o+=1})}function Cd(t,e,n,r){const{pathAsArray:i=!0}=t.options.enablePatches;switch(t.type){case 0:case 2:return b6(t,e,n,r,i);case 1:return v6(t,e,n,r,i);case 3:return _6(t,e,n,r,i)}}let xv=!1;const Mp=(t,e,n=!1)=>{if(typeof t=="object"&&t!==null&&(!Ri(t,e)||n)&&!xv)throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.")};function w6(t){xv=!0;let e;try{e=t()}finally{xv=!1}return e}const Tv={get size(){return Lr(Pt(this)).size},has(t){return Lr(Pt(this)).has(t)},set(t,e){const n=Pt(this),r=Lr(n);return(!r.has(t)||!$s(r.get(t),e))&&(fr(n),is(n),n.assignedMap.set(t,!0),n.copy.set(t,e),P_(n,t,e,Cd)),this},delete(t){if(!this.has(t))return!1;const e=Pt(this);return fr(e),is(e),e.original.has(t)?e.assignedMap.set(t,!1):e.assignedMap.delete(t),e.copy.delete(t),!0},clear(){const t=Pt(this);if(this.size){fr(t),is(t),t.assignedMap=new Map;for(const[e]of t.original)t.assignedMap.set(e,!1);t.copy.clear()}},forEach(t,e){const n=Pt(this);Lr(n).forEach((r,i)=>{t.call(e,this.get(i),i,this)})},get(t){var e,n;const r=Pt(this),i=Lr(r).get(t),s=((n=(e=r.options).mark)===null||n===void 0?void 0:n.call(e,i,zr))===zr.mutable;if(r.options.strict&&Mp(i,r.options,s),s||r.finalized||!Ri(i,r.options)||i!==r.original.get(t))return i;const o=k_.createDraft({original:i,parentDraft:r,key:t,finalities:r.finalities,options:r.options});return fr(r),r.copy.set(t,o),o},keys(){return Lr(Pt(this)).keys()},values(){const t=this.keys();return{[zh]:()=>this.values(),next:()=>{const e=t.next();return e.done?e:{done:!1,value:this.get(e.value)}}}},entries(){const t=this.keys();return{[zh]:()=>this.entries(),next:()=>{const e=t.next();if(e.done)return e;const n=this.get(e.value);return{done:!1,value:[e.value,n]}}}},[zh](){return this.entries()}},E6=Reflect.ownKeys(Tv),fS=(t,e,{isValuesIterator:n})=>()=>{var r,i;const s=e.next();if(s.done)return s;const o=s.value;let a=t.setMap.get(o);const c=Pt(a),u=((i=(r=t.options).mark)===null||i===void 0?void 0:i.call(r,a,zr))===zr.mutable;if(t.options.strict&&Mp(o,t.options,u),!u&&!c&&Ri(o,t.options)&&!t.finalized&&t.original.has(o)){const l=k_.createDraft({original:o,parentDraft:t,key:o,finalities:t.finalities,options:t.options});t.setMap.set(o,l),a=l}else c&&(a=c.proxy);return{done:!1,value:n?a:[a,a]}},Lp={get size(){return Pt(this).setMap.size},has(t){const e=Pt(this);if(e.setMap.has(t))return!0;fr(e);const n=Pt(t);return!!(n&&e.setMap.has(n.original))},add(t){const e=Pt(this);return this.has(t)||(fr(e),is(e),e.assignedMap.set(t,!0),e.setMap.set(t,t),P_(e,t,t,Cd)),this},delete(t){if(!this.has(t))return!1;const e=Pt(this);fr(e),is(e);const n=Pt(t);return n&&e.setMap.has(n.original)?(e.assignedMap.set(n.original,!1),e.setMap.delete(n.original)):(!n&&e.setMap.has(t)?e.assignedMap.set(t,!1):e.assignedMap.delete(t),e.setMap.delete(t))},clear(){if(!this.size)return;const t=Pt(this);fr(t),is(t);for(const e of t.original)t.assignedMap.set(e,!1);t.setMap.clear()},values(){const t=Pt(this);fr(t);const e=t.setMap.keys();return{[Symbol.iterator]:()=>this.values(),next:fS(t,e,{isValuesIterator:!0})}},entries(){const t=Pt(this);fr(t);const e=t.setMap.keys();return{[Symbol.iterator]:()=>this.entries(),next:fS(t,e,{isValuesIterator:!1})}},keys(){return this.values()},[zh](){return this.values()},forEach(t,e){const n=this.values();let r=n.next();for(;!r.done;)t.call(e,r.value,r.value,this),r=n.next()}};Set.prototype.difference&&Object.assign(Lp,{intersection(t){return Set.prototype.intersection.call(new Set(this.values()),t)},union(t){return Set.prototype.union.call(new Set(this.values()),t)},difference(t){return Set.prototype.difference.call(new Set(this.values()),t)},symmetricDifference(t){return Set.prototype.symmetricDifference.call(new Set(this.values()),t)},isSubsetOf(t){return Set.prototype.isSubsetOf.call(new Set(this.values()),t)},isSupersetOf(t){return Set.prototype.isSupersetOf.call(new Set(this.values()),t)},isDisjointFrom(t){return Set.prototype.isDisjointFrom.call(new Set(this.values()),t)}});const S6=Reflect.ownKeys(Lp),VO=new WeakSet,HO={get(t,e,n){var r,i;const s=(r=t.copy)===null||r===void 0?void 0:r[e];if(s&&VO.has(s))return s;if(e===jO)return t;let o;if(t.options.mark){const u=e==="size"&&(t.original instanceof Map||t.original instanceof Set)?Reflect.get(t.original,e):Reflect.get(t.original,e,n);if(o=t.options.mark(u,zr),o===zr.mutable)return t.options.strict&&Mp(u,t.options,!0),u}const a=Lr(t);if(a instanceof Map&&E6.includes(e)){if(e==="size")return Object.getOwnPropertyDescriptor(Tv,"size").get.call(t.proxy);const u=Tv[e];if(u)return u.bind(t.proxy)}if(a instanceof Set&&S6.includes(e)){if(e==="size")return Object.getOwnPropertyDescriptor(Lp,"size").get.call(t.proxy);const u=Lp[e];if(u)return u.bind(t.proxy)}if(!jl(a,e)){const u=lS(a,e);return u?"value"in u?u.value:(i=u.get)===null||i===void 0?void 0:i.call(t.proxy):void 0}const c=a[e];if(t.options.strict&&Mp(c,t.options),t.finalized||!Ri(c,t.options))return c;if(c===my(t.original,e)){if(fr(t),t.copy[e]=M_({original:t.original[e],parentDraft:t,key:t.type===1?Number(e):e,finalities:t.finalities,options:t.options}),typeof o=="function"){const u=Pt(t.copy[e]);return fr(u),is(u),u.copy}return t.copy[e]}return c},set(t,e,n){var r;if(t.type===3||t.type===2)throw new Error("Map/Set draft does not support any property assignment.");let i;if(t.type===1&&e!=="length"&&!(Number.isInteger(i=Number(e))&&i>=0&&(e===0||i===0||String(i)===String(e))))throw new Error("Only supports setting array indices and the 'length' property.");const s=lS(Lr(t),e);if(s!=null&&s.set)return s.set.call(t.proxy,n),!0;const o=my(Lr(t),e),a=Pt(o);return a&&$s(a.original,n)?(t.copy[e]=n,t.assignedMap=(r=t.assignedMap)!==null&&r!==void 0?r:new Map,t.assignedMap.set(e,!1),!0):($s(n,o)&&(n!==void 0||jl(t.original,e))||(fr(t),is(t),jl(t.original,e)&&$s(n,t.original[e])?t.assignedMap.delete(e):t.assignedMap.set(e,!0),t.copy[e]=n,P_(t,e,n,Cd)),!0)},has(t,e){return e in Lr(t)},ownKeys(t){return Reflect.ownKeys(Lr(t))},getOwnPropertyDescriptor(t,e){const n=Lr(t),r=Reflect.getOwnPropertyDescriptor(n,e);return r&&{writable:!0,configurable:t.type!==1||e!=="length",enumerable:r.enumerable,value:n[e]}},getPrototypeOf(t){return Reflect.getPrototypeOf(t.original)},setPrototypeOf(){throw new Error("Cannot call 'setPrototypeOf()' on drafts")},defineProperty(){throw new Error("Cannot call 'defineProperty()' on drafts")},deleteProperty(t,e){var n;return t.type===1?HO.set.call(this,t,e,void 0,t.proxy):(my(t.original,e)!==void 0||e in t.original?(fr(t),is(t),t.assignedMap.set(e,!1)):(t.assignedMap=(n=t.assignedMap)!==null&&n!==void 0?n:new Map,t.assignedMap.delete(e)),t.copy&&delete t.copy[e],!0)}};function M_(t){const{original:e,parentDraft:n,key:r,finalities:i,options:s}=t,o=ic(e),a={type:o,finalized:!1,parent:n,original:e,copy:null,proxy:null,finalities:i,options:s,setMap:o===3?new Map(e.entries()):void 0};(r||"key"in t)&&(a.key=r);const{proxy:c,revoke:u}=Proxy.revocable(o===1?Object.assign([],a):a,HO);if(i.revoke.push(u),VO.add(c),a.proxy=c,n){const l=n;l.finalities.draft.push((d,f)=>{var h,m;const p=Pt(c);let g=l.type===3?l.setMap:l.copy;const y=Hs(g,r),v=Pt(y);if(v){let b=v.original;v.operated&&(b=N_(y)),Ev(v),Sv(v,Cd,d,f),l.options.enableAutoFreeze&&(l.options.updatedValues=(h=l.options.updatedValues)!==null&&h!==void 0?h:new WeakMap,l.options.updatedValues.set(b,v.original)),yf(g,r,b)}(m=p.callbacks)===null||m===void 0||m.forEach(b=>{b(d,f)})})}else{const l=Pt(c);l.finalities.draft.push((d,f)=>{Ev(l),Sv(l,Cd,d,f)})}return c}k_.createDraft=M_;function x6(t,e,n,r,i){var s;const o=Pt(t),a=(s=o==null?void 0:o.original)!==null&&s!==void 0?s:t,c=!!e.length;if(o!=null&&o.operated)for(;o.finalities.draft.length>0;)o.finalities.draft.pop()(n,r);const u=c?e[0]:o?o.operated?o.copy:o.original:t;return o&&wv(o),i&&Dc(u,u,o==null?void 0:o.options.updatedValues),[u,n&&c?[{op:In.Replace,path:[],value:e[0]}]:n,r&&c?[{op:In.Replace,path:[],value:a}]:r]}function T6(t,e){var n;const r={draft:[],revoke:[],handledSet:new WeakSet};let i,s;e.enablePatches&&(i=[],s=[]);const a=((n=e.mark)===null||n===void 0?void 0:n.call(e,t,zr))===zr.mutable||!Ri(t,e)?t:M_({original:t,parentDraft:null,finalities:r,options:e});return[a,(c=[])=>{const[u,l,d]=x6(a,c,i,s,e.enableAutoFreeze);return e.enablePatches?[u,l,d]:u}]}function Iv(t){const{rootDraft:e,value:n,useRawReturn:r=!1,isRoot:i=!0}=t;A_(n,(s,o,a)=>{const c=Pt(o);if(c&&e&&c.finalities===e.finalities){t.isContainDraft=!0;const u=c.original;if(a instanceof Set){const l=Array.from(a);a.clear(),l.forEach(d=>a.add(s===d?u:d))}else yf(a,s,u)}else typeof o=="object"&&o!==null&&(t.value=o,t.isRoot=!1,Iv(t))}),i&&(t.isContainDraft||console.warn("The return value does not contain any draft, please use 'rawReturn()' to wrap the return value to improve performance."),r&&console.warn("The return value contains drafts, please don't use 'rawReturn()' to wrap the return value."))}function WO(t){var e;const n=Pt(t);if(!Ri(t,n==null?void 0:n.options))return t;const r=ic(t);if(n&&!n.operated)return n.original;let i;function s(){i=r===2?R_(t)?new Map(t):new(Object.getPrototypeOf(t)).constructor(t):r===3?Array.from(n.setMap.values()):BO(t,n==null?void 0:n.options)}if(n){n.finalized=!0;try{s()}finally{n.finalized=!1}}else i=t;if(A_(i,(o,a)=>{if(n&&$s(Hs(n.original,o),a))return;const c=WO(a);c!==a&&(i===t&&s(),yf(i,o,c))}),r===3){const o=(e=n==null?void 0:n.original)!==null&&e!==void 0?e:i;return D_(o)?new Set(i):new(Object.getPrototypeOf(o)).constructor(i)}return i}function hS(t){if(!$a(t))throw new Error(`current() is only used for Draft, parameter: ${t}`);return WO(t)}const I6=t=>function e(n,r,i){var s,o,a;if(typeof n=="function"&&typeof r!="function")return function(w,...x){return e(w,_=>n.call(this,_,...x),r)};const c=n,u=r;let l=i;if(typeof r!="function"&&(l=r),l!==void 0&&Object.prototype.toString.call(l)!=="[object Object]")throw new Error(`Invalid options: ${l}, 'options' should be an object.`);l=Object.assign(Object.assign({},t),l);const d=$a(c)?hS(c):c,f=Array.isArray(l.mark)?(w,x)=>{for(const _ of l.mark){if(typeof _!="function")throw new Error(`Invalid mark: ${_}, 'mark' should be a function.`);const k=_(w,x);if(k)return k}}:l.mark,h=(s=l.enablePatches)!==null&&s!==void 0?s:!1,m=(o=l.strict)!==null&&o!==void 0?o:!1,g={enableAutoFreeze:(a=l.enableAutoFreeze)!==null&&a!==void 0?a:!1,mark:f,strict:m,enablePatches:h};if(!Ri(d,g)&&typeof d=="object"&&d!==null)throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");const[y,v]=T6(d,g);if(typeof r!="function"){if(!Ri(d,g))throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");return[y,v]}let b;try{b=u(y)}catch(w){throw wv(Pt(y)),w}const E=w=>{const x=Pt(y);if(!$a(w)){if(w!==void 0&&!$s(w,y)&&(x!=null&&x.operated))throw new Error("Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.");const k=w==null?void 0:w[h6];if(k){const R=k[0];return g.strict&&typeof w=="object"&&w!==null&&Iv({rootDraft:x,value:w,useRawReturn:!0}),v([R])}if(w!==void 0)return typeof w=="object"&&w!==null&&Iv({rootDraft:x,value:w}),v([w])}if(w===y||w===void 0)return v([]);const _=Pt(w);if(g===_.options){if(_.operated)throw new Error("Cannot return a modified child draft.");return v([hS(w)])}return v([w])};return b instanceof Promise?b.then(E,w=>{throw wv(Pt(y)),w}):E(b)},L_=I6();Object.prototype.constructor.toString();var O6=Object.defineProperty,C6=(t,e,n)=>e in t?O6(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,qO=(t,e,n)=>C6(t,typeof e!="symbol"?e+"":e,n);const k6=t=>t!=null;Xt.any().refine(t=>k6(t));const D6=Xt.enum(["LOAD_STATE"]),R6=Xt.enum(["PRUNE"]),N6=Xt.enum(["REDO"]),A6=Xt.enum(["SET_NAME"]),P6=Xt.enum(["UNDO"]);function Jm(){return Xt.literal("global").or(Xt.literal("local"))}function M6(){return Xt.union([L6(),$6(),j6(),U6(),B6()])}function L6(){return Xt.object({input:Xt.lazy(()=>GO()),type:D6,scope:Jm()})}function GO(){return Xt.object({operations:Xt.number(),state:Xt.lazy(()=>F6())})}function F6(){return Xt.object({data:Xt.unknown().nullish(),name:Xt.string()})}function $6(){return Xt.object({input:Xt.lazy(()=>ZO()),type:R6,scope:Jm()})}function ZO(){return Xt.object({end:Xt.number().nullish(),start:Xt.number().nullish()})}const YO=Xt.number;function j6(){return Xt.object({input:YO(),type:N6,scope:Jm()})}const KO=Xt.string;function U6(){return Xt.object({input:KO(),type:A6,scope:Xt.literal("global")})}const JO=Xt.number;function B6(){return Xt.object({input:JO(),type:P6,scope:Jm()})}function z6(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ah={exports:{}},pS;function V6(){return pS||(pS=1,function(t,e){const{hasOwnProperty:n}=Object.prototype,r=y();r.configure=y,r.stringify=r,r.default=r,e.stringify=r,e.configure=y,t.exports=r;const i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function s(v){return v.length<5e3&&!i.test(v)?`"${v}"`:JSON.stringify(v)}function o(v,b){if(v.length>200||b)return v.sort(b);for(let E=1;E<v.length;E++){const w=v[E];let x=E;for(;x!==0&&v[x-1]>w;)v[x]=v[x-1],x--;v[x]=w}return v}const a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function c(v){return a.call(v)!==void 0&&v.length!==0}function u(v,b,E){v.length<E&&(E=v.length);const w=b===","?"":" ";let x=`"0":${w}${v[0]}`;for(let _=1;_<E;_++)x+=`${b}"${_}":${w}${v[_]}`;return x}function l(v){if(n.call(v,"circularValue")){const b=v.circularValue;if(typeof b=="string")return`"${b}"`;if(b==null)return b;if(b===Error||b===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function d(v){let b;if(n.call(v,"deterministic")&&(b=v.deterministic,typeof b!="boolean"&&typeof b!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return b===void 0?!0:b}function f(v,b){let E;if(n.call(v,b)&&(E=v[b],typeof E!="boolean"))throw new TypeError(`The "${b}" argument must be of type boolean`);return E===void 0?!0:E}function h(v,b){let E;if(n.call(v,b)){if(E=v[b],typeof E!="number")throw new TypeError(`The "${b}" argument must be of type number`);if(!Number.isInteger(E))throw new TypeError(`The "${b}" argument must be an integer`);if(E<1)throw new RangeError(`The "${b}" argument must be >= 1`)}return E===void 0?1/0:E}function m(v){return v===1?"1 item":`${v} items`}function p(v){const b=new Set;for(const E of v)(typeof E=="string"||typeof E=="number")&&b.add(String(E));return b}function g(v){if(n.call(v,"strict")){const b=v.strict;if(typeof b!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(b)return E=>{let w=`Object can not safely be stringified. Received type ${typeof E}`;throw typeof E!="function"&&(w+=` (${E.toString()})`),new Error(w)}}}function y(v){v={...v};const b=g(v);b&&(v.bigint===void 0&&(v.bigint=!1),"circularValue"in v||(v.circularValue=Error));const E=l(v),w=f(v,"bigint"),x=d(v),_=typeof x=="function"?x:void 0,k=h(v,"maximumDepth"),R=h(v,"maximumBreadth");function F(C,N,U,K,$,q){let j=N[C];switch(typeof j=="object"&&j!==null&&typeof j.toJSON=="function"&&(j=j.toJSON(C)),j=K.call(N,C,j),typeof j){case"string":return s(j);case"object":{if(j===null)return"null";if(U.indexOf(j)!==-1)return E;let D="",X=",";const Z=q;if(Array.isArray(j)){if(j.length===0)return"[]";if(k<U.length+1)return'"[Array]"';U.push(j),$!==""&&(q+=$,D+=`
75
- ${q}`,X=`,
76
- ${q}`);const ct=Math.min(j.length,R);let ut=0;for(;ut<ct-1;ut++){const Ot=F(String(ut),j,U,K,$,q);D+=Ot!==void 0?Ot:"null",D+=X}const Ye=F(String(ut),j,U,K,$,q);if(D+=Ye!==void 0?Ye:"null",j.length-1>R){const Ot=j.length-R-1;D+=`${X}"... ${m(Ot)} not stringified"`}return $!==""&&(D+=`
77
- ${Z}`),U.pop(),`[${D}]`}let z=Object.keys(j);const le=z.length;if(le===0)return"{}";if(k<U.length+1)return'"[Object]"';let pe="",ve="";$!==""&&(q+=$,X=`,
78
- ${q}`,pe=" ");const je=Math.min(le,R);x&&!c(j)&&(z=o(z,_)),U.push(j);for(let ct=0;ct<je;ct++){const ut=z[ct],Ye=F(ut,j,U,K,$,q);Ye!==void 0&&(D+=`${ve}${s(ut)}:${pe}${Ye}`,ve=X)}if(le>R){const ct=le-R;D+=`${ve}"...":${pe}"${m(ct)} not stringified"`,ve=X}return $!==""&&ve.length>1&&(D=`
79
- ${q}${D}
80
- ${Z}`),U.pop(),`{${D}}`}case"number":return isFinite(j)?String(j):b?b(j):"null";case"boolean":return j===!0?"true":"false";case"undefined":return;case"bigint":if(w)return String(j);default:return b?b(j):void 0}}function V(C,N,U,K,$,q){switch(typeof N=="object"&&N!==null&&typeof N.toJSON=="function"&&(N=N.toJSON(C)),typeof N){case"string":return s(N);case"object":{if(N===null)return"null";if(U.indexOf(N)!==-1)return E;const j=q;let D="",X=",";if(Array.isArray(N)){if(N.length===0)return"[]";if(k<U.length+1)return'"[Array]"';U.push(N),$!==""&&(q+=$,D+=`
81
- ${q}`,X=`,
82
- ${q}`);const le=Math.min(N.length,R);let pe=0;for(;pe<le-1;pe++){const je=V(String(pe),N[pe],U,K,$,q);D+=je!==void 0?je:"null",D+=X}const ve=V(String(pe),N[pe],U,K,$,q);if(D+=ve!==void 0?ve:"null",N.length-1>R){const je=N.length-R-1;D+=`${X}"... ${m(je)} not stringified"`}return $!==""&&(D+=`
83
- ${j}`),U.pop(),`[${D}]`}U.push(N);let Z="";$!==""&&(q+=$,X=`,
84
- ${q}`,Z=" ");let z="";for(const le of K){const pe=V(le,N[le],U,K,$,q);pe!==void 0&&(D+=`${z}${s(le)}:${Z}${pe}`,z=X)}return $!==""&&z.length>1&&(D=`
85
- ${q}${D}
86
- ${j}`),U.pop(),`{${D}}`}case"number":return isFinite(N)?String(N):b?b(N):"null";case"boolean":return N===!0?"true":"false";case"undefined":return;case"bigint":if(w)return String(N);default:return b?b(N):void 0}}function T(C,N,U,K,$){switch(typeof N){case"string":return s(N);case"object":{if(N===null)return"null";if(typeof N.toJSON=="function"){if(N=N.toJSON(C),typeof N!="object")return T(C,N,U,K,$);if(N===null)return"null"}if(U.indexOf(N)!==-1)return E;const q=$;if(Array.isArray(N)){if(N.length===0)return"[]";if(k<U.length+1)return'"[Array]"';U.push(N),$+=K;let pe=`
87
- ${$}`;const ve=`,
88
- ${$}`,je=Math.min(N.length,R);let ct=0;for(;ct<je-1;ct++){const Ye=T(String(ct),N[ct],U,K,$);pe+=Ye!==void 0?Ye:"null",pe+=ve}const ut=T(String(ct),N[ct],U,K,$);if(pe+=ut!==void 0?ut:"null",N.length-1>R){const Ye=N.length-R-1;pe+=`${ve}"... ${m(Ye)} not stringified"`}return pe+=`
89
- ${q}`,U.pop(),`[${pe}]`}let j=Object.keys(N);const D=j.length;if(D===0)return"{}";if(k<U.length+1)return'"[Object]"';$+=K;const X=`,
90
- ${$}`;let Z="",z="",le=Math.min(D,R);c(N)&&(Z+=u(N,X,R),j=j.slice(N.length),le-=N.length,z=X),x&&(j=o(j,_)),U.push(N);for(let pe=0;pe<le;pe++){const ve=j[pe],je=T(ve,N[ve],U,K,$);je!==void 0&&(Z+=`${z}${s(ve)}: ${je}`,z=X)}if(D>R){const pe=D-R;Z+=`${z}"...": "${m(pe)} not stringified"`,z=X}return z!==""&&(Z=`
91
- ${$}${Z}
92
- ${q}`),U.pop(),`{${Z}}`}case"number":return isFinite(N)?String(N):b?b(N):"null";case"boolean":return N===!0?"true":"false";case"undefined":return;case"bigint":if(w)return String(N);default:return b?b(N):void 0}}function L(C,N,U){switch(typeof N){case"string":return s(N);case"object":{if(N===null)return"null";if(typeof N.toJSON=="function"){if(N=N.toJSON(C),typeof N!="object")return L(C,N,U);if(N===null)return"null"}if(U.indexOf(N)!==-1)return E;let K="";const $=N.length!==void 0;if($&&Array.isArray(N)){if(N.length===0)return"[]";if(k<U.length+1)return'"[Array]"';U.push(N);const Z=Math.min(N.length,R);let z=0;for(;z<Z-1;z++){const pe=L(String(z),N[z],U);K+=pe!==void 0?pe:"null",K+=","}const le=L(String(z),N[z],U);if(K+=le!==void 0?le:"null",N.length-1>R){const pe=N.length-R-1;K+=`,"... ${m(pe)} not stringified"`}return U.pop(),`[${K}]`}let q=Object.keys(N);const j=q.length;if(j===0)return"{}";if(k<U.length+1)return'"[Object]"';let D="",X=Math.min(j,R);$&&c(N)&&(K+=u(N,",",R),q=q.slice(N.length),X-=N.length,D=","),x&&(q=o(q,_)),U.push(N);for(let Z=0;Z<X;Z++){const z=q[Z],le=L(z,N[z],U);le!==void 0&&(K+=`${D}${s(z)}:${le}`,D=",")}if(j>R){const Z=j-R;K+=`${D}"...":"${m(Z)} not stringified"`}return U.pop(),`{${K}}`}case"number":return isFinite(N)?String(N):b?b(N):"null";case"boolean":return N===!0?"true":"false";case"undefined":return;case"bigint":if(w)return String(N);default:return b?b(N):void 0}}function S(C,N,U){if(arguments.length>1){let K="";if(typeof U=="number"?K=" ".repeat(Math.min(U,10)):typeof U=="string"&&(K=U.slice(0,10)),N!=null){if(typeof N=="function")return F("",{"":C},[],N,K,"");if(Array.isArray(N))return V("",C,[],p(N),K,"")}if(K.length!==0)return T("",C,[],K,"")}return L("",C,[])}return S}}(ah,ah.exports)),ah.exports}var H6=V6();const ja=z6(H6);ja.configure;const W6=[1518500249,1859775393,-1894007588,-899497514];function q6(t){return new G6}class G6{constructor(){this.A=1732584193,this.B=-271733879,this.C=-1732584194,this.D=271733878,this.E=-1009589776,this._size=0,this._sp=0,(!ch||dl>=8e3)&&(ch=new ArrayBuffer(8e3),dl=0),this._byte=new Uint8Array(ch,dl,80),this._word=new Int32Array(ch,dl,20),dl+=80}update(e){if(typeof e=="string")return this._utf8(e);if(e==null)throw new TypeError("Invalid type: "+typeof e);const n=e.byteOffset,r=e.byteLength;let i=r/64|0,s=0;if(i&&!(n&3)&&!(this._size%64)){const a=new Int32Array(e.buffer,n,i*16);for(;i--;)this._int32(a,s>>2),s+=64;this._size+=s}if(e.BYTES_PER_ELEMENT!==1&&e.buffer){const a=new Uint8Array(e.buffer,n+s,r-s);return this._uint8(a)}return s===r?this:this._uint8(e,s)}_uint8(e,n){const{_byte:r,_word:i}=this,s=e.length;for(n=n|0;n<s;){const o=this._size%64;let a=o;for(;n<s&&a<64;)r[a++]=e[n++];a>=64&&this._int32(i),this._size+=a-o}return this}_utf8(e){const{_byte:n,_word:r}=this,i=e.length;let s=this._sp;for(let o=0;o<i;){const a=this._size%64;let c=a;for(;o<i&&c<64;){let u=e.charCodeAt(o++)|0;u<128?n[c++]=u:u<2048?(n[c++]=192|u>>>6,n[c++]=128|u&63):u<55296||u>57343?(n[c++]=224|u>>>12,n[c++]=128|u>>>6&63,n[c++]=128|u&63):s?(u=((s&1023)<<10)+(u&1023)+65536,n[c++]=240|u>>>18,n[c++]=128|u>>>12&63,n[c++]=128|u>>>6&63,n[c++]=128|u&63,s=0):s=u}c>=64&&(this._int32(r),r[0]=r[16]),this._size+=c-a}return this._sp=s,this}_int32(e,n){let{A:r,B:i,C:s,D:o,E:a}=this,c=0;for(n=n|0;c<16;)ra[c++]=ao(e[n++]);for(c=16;c<80;c++)ra[c]=K6(ra[c-3]^ra[c-8]^ra[c-14]^ra[c-16]);for(c=0;c<80;c++){const u=c/20|0,l=J6(r)+Q6(u,i,s,o)+a+ra[c]+W6[u]|0;a=o,o=s,s=X6(i),i=r,r=l}this.A=r+this.A|0,this.B=i+this.B|0,this.C=s+this.C|0,this.D=o+this.D|0,this.E=a+this.E|0}digest(e){const{_byte:n,_word:r}=this;let i=this._size%64|0;for(n[i++]=128;i&3;)n[i++]=0;if(i>>=2,i>14){for(;i<16;)r[i++]=0;i=0,this._int32(r)}for(;i<16;)r[i++]=0;const s=this._size*8,o=(s&4294967295)>>>0,a=(s-o)/4294967296;return a&&(r[14]=ao(a)),o&&(r[15]=ao(o)),this._int32(r),e==="hex"?this._hex():this._bin()}_hex(){const{A:e,B:n,C:r,D:i,E:s}=this;return fl(e)+fl(n)+fl(r)+fl(i)+fl(s)}_bin(){const{A:e,B:n,C:r,D:i,E:s,_byte:o,_word:a}=this;return a[0]=ao(e),a[1]=ao(n),a[2]=ao(r),a[3]=ao(i),a[4]=ao(s),o.slice(0,20)}}const ra=new Int32Array(80);let ch,dl=0;const fl=t=>(t+4294967296).toString(16).substr(-8),Z6=t=>t<<24&4278190080|t<<8&16711680|t>>8&65280|t>>24&255,Y6=t=>t,ao=e8()?Y6:Z6,K6=t=>t<<1|t>>>31,J6=t=>t<<5|t>>>27,X6=t=>t<<30|t>>>2;function Q6(t,e,n,r){return t===0?e&n|~e&r:t===2?e&n|e&r|n&r:e^n^r}function e8(){return new Uint8Array(new Uint16Array([65279]).buffer)[0]===254}const F_=new Error("File system not available.");function t8(){if(!crypto.randomUUID)throw new Error("generateUUID is not available in unsecure contexts.");return crypto.randomUUID()}function n8(t,e,n){throw F_}function XO(t){throw F_}function r8(t){throw F_}const i8=async t=>XO(),vf=(t,e="sha1")=>{if(!["sha1"].includes(e))throw new Error("Hashing algorithm not supported: Available: sha1");const n=o8(t);return s8(n)};function s8(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function o8(t,e="sha1"){if(!["sha1"].includes(e))throw new Error("Hashing algorithm not supported: Available: sha1");return q6().update(t).digest()}function $_(t){if(t&&t.toString()!=="UUIDv4")throw new Error(`Id generation method not supported: "${t.toString()}"`);return t8()}function QO(t){return(new Date(t).getTime()/1e3).toFixed(0)}function eC({documentId:t,signer:e,operation:n,previousStateHash:r}){const{timestamp:i,scope:s,id:o,type:a}=n;return[QO(i),e.app.key,vf([t,s,o,a,ja(n.input)].join("")),r]}const a8=new TextEncoder;function j_(t){const e=t.join(""),n=`Signed Operation:
93
- `+e.length.toString();return a8.encode(n+e)}function tC(t){const e=ArrayBuffer.isView(t)?t:new Uint8Array(t);return Array.prototype.map.call(e,n=>("00"+n.toString(16)).slice(-2)).join("")}function nC(t){var e;return new Uint8Array(((e=t.match(/[\da-f]{2}/gi))==null?void 0:e.map(function(n){return parseInt(n,16)}))??[])}async function rC(t,e){const n=eC(t),r=j_(n),i=await e(r);return[...n,`0x${tC(i)}`]}async function c8(t,e,n,r,i){var s,o;const a=e(n,t,void 0,{reuseHash:!0,reuseOperationResultingState:!0}),c=a.operations[t.scope].at(-1);if(!c)throw new Error("Action was not applied");const u=((s=a.operations[t.scope].at(-2))==null?void 0:s.hash)??"",l=await rC({...r,operation:c,previousStateHash:u},i);return{...c,context:{...c.context,signer:{...(o=c.context)==null?void 0:o.signer,...r.signer,signatures:[...r.signer.signatures??[],l]}}}}async function u8(t,e,n){const r=e.app.key,i=t.slice(0,4),s=nC(t[4]),o=j_(i);return n(r,s,o)}class U_ extends Error{constructor(e){super(),qO(this,"data"),this.name="InvalidActionInputError",this.data=e,this.message=this.message||`Invalid action input: ${JSON.stringify(e,null,2)}`}}class iC extends U_{constructor(e){super(e),qO(this,"issues"),this.issues=e,this.name="InvalidActionInputZodError"}}const sC={"application/andrew-inset":["ez"],"application/appinstaller":["appinstaller"],"application/applixware":["aw"],"application/appx":["appx"],"application/appxbundle":["appxbundle"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/automationml-aml+xml":["aml"],"application/automationml-amlx+zip":["amlx"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cpl+xml":["cpl"],"application/cu-seeme":["cu"],"application/cwl":["cwl"],"application/dash+xml":["mpd"],"application/dash-patch+xml":["mpp"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdf":["fdf"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["*js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/media-policy-dataset+xml":["mpf"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["*mp4","*mpg4","mp4s","m4p"],"application/msix":["msix"],"application/msixbundle":["msixbundle"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-keys":["asc"],"application/pgp-signature":["sig","*asc"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/sql":["sql"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/watcherinfo+xml":["wif"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xfdf":["xfdf"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/aac":["adts","aac"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avci":["avci"],"image/avcs":["avcs"],"image/avif":["avif"],"image/bmp":["bmp","dib"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/dpx":["dpx"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm","jpgm"],"image/jpx":["jpx","jpf"],"image/jxl":["jxl"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/jt":["jt"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/prc":["prc"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/u3d":["u3d"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js","mjs"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["md","markdown"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/wgsl":["wgsl"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","*jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts","m2t","m2ts","mts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};Object.freeze(sC);var Xr=function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},Rc,xl,oa;class l8{constructor(...e){Rc.set(this,new Map),xl.set(this,new Map),oa.set(this,new Map);for(const n of e)this.define(n)}define(e,n=!1){for(let[r,i]of Object.entries(e)){r=r.toLowerCase(),i=i.map(a=>a.toLowerCase()),Xr(this,oa,"f").has(r)||Xr(this,oa,"f").set(r,new Set);const s=Xr(this,oa,"f").get(r);let o=!0;for(let a of i){const c=a.startsWith("*");if(a=c?a.slice(1):a,s==null||s.add(a),o&&Xr(this,xl,"f").set(r,a),o=!1,c)continue;const u=Xr(this,Rc,"f").get(a);if(u&&u!=r&&!n)throw new Error(`"${r} -> ${a}" conflicts with "${u} -> ${a}". Pass \`force=true\` to override this definition.`);Xr(this,Rc,"f").set(a,r)}}return this}getType(e){if(typeof e!="string")return null;const n=e.replace(/^.*[/\\]/,"").toLowerCase(),r=n.replace(/^.*\./,"").toLowerCase(),i=n.length<e.length;return!(r.length<n.length-1)&&i?null:Xr(this,Rc,"f").get(r)??null}getExtension(e){var n;return typeof e!="string"?null:(e=(n=e==null?void 0:e.split)==null?void 0:n.call(e,";")[0],(e&&Xr(this,xl,"f").get(e.trim().toLowerCase()))??null)}getAllExtensions(e){return typeof e!="string"?null:Xr(this,oa,"f").get(e.toLowerCase())??null}_freeze(){this.define=()=>{throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances")},Object.freeze(this);for(const e of Xr(this,oa,"f").values())Object.freeze(e);return this}_getTestState(){return{types:Xr(this,Rc,"f"),extensions:Xr(this,xl,"f")}}}Rc=new WeakMap,xl=new WeakMap,oa=new WeakMap;const d8=new l8(sC)._freeze();function oC(t){const e=[],n=Object.keys(t);for(const r of n){const i=t[r].sort((o,a)=>o.index-a.index);let s=-1;for(let o=0;o<i.length;o++)s=s+1+i[o].skip,i[o].index!==s&&e.push({message:`Invalid operation index ${i[o].index} at position ${o}`,details:{position:o,operation:i[o],scope:i[o].scope}})}return e}var aC=(t=>(t.UNEXPECTED_INDEX="UNEXPECTED_INDEX",t))(aC||{}),cC=(t=>(t.DUPLICATED_INDEX="DUPLICATED_INDEX",t.MISSING_INDEX="MISSING_INDEX",t))(cC||{});function B_(t){const e=[];let n=-1;for(const r of t){const i=r.index-r.skip;i!==n+1&&e.push({operation:{index:r.index,skip:r.skip},issue:"UNEXPECTED_INDEX",category:i>n+1?"MISSING_INDEX":"DUPLICATED_INDEX",message:`Expected index ${n+1} with skip 0 or equivalent, got index ${r.index} with skip ${r.skip}`}),n=r.index}return e}function xi(t){var e,n,r;const i=[];let s=t.length-1;for(;s>-1;){i.unshift(t[s]);const o=(((e=t[s])==null?void 0:e.index)||0)-(((n=t[s])==null?void 0:n.skip)||0)-1;let a=s-1;for(;a>-1&&(((r=t[a])==null?void 0:r.index)||0)>o;)a--;s=a}return i}function f8(t){const e=[...t],n=e[e.length-1];return n&&(n.type==="NOOP"?e.push({...n,index:n.index,type:"NOOP",skip:V_(t)}):e.push({type:"NOOP",index:n.index+1,timestamp:new Date().toISOString(),input:{},skip:1,scope:n.scope,hash:n.hash})),e}function ii(t){return t.slice().sort((e,n)=>e.skip-n.skip).sort((e,n)=>e.index-n.index)}const h8=(t,e,n)=>[...e,...n].sort((r,i)=>new Date(r.timestamp).getTime()-new Date(i.timestamp).getTime()).map((r,i)=>({...r,index:t.index+i,skip:i===0?t.skip:0})),p8=(t,e,n)=>[...e,...n].sort((r,i)=>new Date(r.timestamp).getTime()-new Date(i.timestamp).getTime()).sort((r,i)=>r.index-i.index).map((r,i)=>({...r,index:t.index+i,skip:i===0?t.skip:0}));function z_(t,e){return ja(t)===ja(e)}function m8(t,e){const n=xi(ii(t.slice())),r=xi(ii(e.slice()));if(n.length<1)return[r,[]];const i=[];let s=!1;for(;r.length>0;){const o=r[0];let a=n.shift();for(;a&&uC(a,o);)i.push(a),a=n.shift();if(a?s||(z_(a,o)?(r.shift(),i.push(a)):(n.unshift(a),s=!0)):s=!0,s){let c=r.shift();for(;c;)i.push(c),c=r.shift()}}if(!s){let o=n.shift();for(;o;)i.push(o),o=n.shift()}return[xi(i),n]}function uC(t,e){return t.index<e.index||t.index===e.index&&t.id===e.id&&t.skip<e.skip}function lC(t,e){const n=[],r=[],i=[],s=Math.max(t.length,e.length);let o=!1;for(let a=0;a<s;a++){const c=t[a],u=e[a];c&&u?!o&&z_(c,u)?n.push(c):(o=!0,r.push(c),i.push(u)):c?r.push(c):u&&i.push(u)}return[n,r,i]}function g8(t,e,n){const[r,i,s]=lC(xi(t),xi(e)),o=gy(r),a=1+Math.max(o,gy(i),gy(s)),c=fC(s,i),u=n({index:a,skip:a-(o+1)},i,c);return r.concat(u)}function gy(t){const e=t[t.length-1];return e?e.index:-1}function V_(t){var e,n,r;if(t.length<1)return-1;const i=xi(t);let s=(((e=i[i.length-1])==null?void 0:e.skip)||0)+1;return i.length>1&&(s+=((n=i[i.length-2])==null?void 0:n.skip)||0),(((r=i[i.length-1])==null?void 0:r.index)||-1)<s?-1:s}const y8=t=>B_(xi(ii(t))),v8=t=>t.reduce((n,r)=>{var i;return n[r.scope]||(n[r.scope]=[]),(i=n[r.scope])==null||i.push(r),n},{}),b8=(t,e)=>{var n;const r={integrityIssues:[],validOperations:[],invalidOperations:[],duplicatedOperations:[]},i=ii(t),s=ii(e),o=B_([...i,...s]),c=(n=[...o.filter(u=>u.category==="MISSING_INDEX")].sort((u,l)=>l.operation.index-u.operation.index).pop())==null?void 0:n.operation;for(const u of s){if(c&&u.index>=c.index){r.invalidOperations.push(u);continue}if(o.some(d=>d.operation.index===u.index&&d.operation.skip===u.skip&&d.category==="DUPLICATED_INDEX")){r.duplicatedOperations.push(u);continue}r.validOperations.push(u)}return r.integrityIssues.push(...o),r};function _8(t,e){return t.filter(n=>!e.some(r=>n.type==="NOOP"&&n.skip===0&&n.index===r.index||n.index===r.index&&n.skip===r.skip&&n.scope===r.scope&&n.hash===r.hash&&n.type===r.type))}function dC(t,e){const[n]=ii(t).slice(-1),r=(n==null?void 0:n.index)??-1,i=r+1,s={...e,index:e.index??i};if(s.index<r)throw new Error(`The skip header operation index must be greater than or equal to ${r}`);return(xi(ii([...t,s]))||[]).slice(0,-1)}function kd(t){return{...Object.entries(t).reduce((n,r)=>{const[i,s]=r;return{...n,[i]:xi(ii(s))}},{})}}function fC(t,e){return t.filter(n=>n.id?!e.some(r=>r.id===n.id):!0)}function hC(t){return t?Object.entries(t).reduce((n,[r,i])=>({...n,[r]:i.map(s=>{const{resultingState:o,...a}=s;return a})}),{}):{}}function pC(t,e){return t.filter(n=>!e.some(r=>n.index===r.index))}const w8=Object.freeze(Object.defineProperty({__proto__:null,IntegrityIssueSubType:cC,IntegrityIssueType:aC,addUndo:f8,attachBranch:m8,checkCleanedOperationsIntegrity:B_,checkOperationsIntegrity:y8,diffOperations:pC,filterDocumentOperationsResultingState:hC,filterDuplicatedOperations:fC,garbageCollect:xi,garbageCollectDocumentOperations:kd,groupOperationsByScope:v8,merge:g8,nextSkipNumber:V_,operationsAreEqual:z_,precedes:uC,prepareOperations:b8,removeExistingOperations:_8,reshuffleByTimestamp:h8,reshuffleByTimestampAndIndex:p8,skipHeaderOperations:dC,sortOperations:ii,split:lC},Symbol.toStringTag,{value:"Module"})),H_=async t=>{const e=new CO,{name:n,revision:r,documentType:i,created:s,lastModified:o}=t,a={name:n,revision:r,documentType:i,created:s,lastModified:o};return e.file("header.json",JSON.stringify(a,null,2)),e.file("state.json",JSON.stringify(t.initialState||{},null,2)),e.file("current-state.json",JSON.stringify(t.state||{},null,2)),e.file("operations.json",JSON.stringify(hC(t.operations),null,2)),t.attachments&&Object.keys(t.attachments).forEach(u=>{const{data:l,...d}=t.attachments[u];e.file(u,l,{base64:!0,createFolders:!0,comment:JSON.stringify(d)})}),e},mC=async(t,e,n,r)=>{await(await H_(t)).generateAsync({type:"uint8array",streamFiles:!0});const s=r??t.name,o=`.${n}.zip`;return n8(e,s.endsWith(o)?s:`${s}${o}`)},E8=async(t,e)=>{const r=await(await H_(t)).generateAsync({type:"blob"}),i=await e.createWritable();await i.write(r),await i.close()},Ov=async(t,e,n)=>{const r=XO();return gC(r,e,n)},gC=async(t,e,n)=>{const r=new CO;return await r.loadAsync(t),S8(r,e,n)};async function S8(t,e,n){const r=t.file("state.json");if(!r)throw new Error("Initial state not found");const i=await r.async("string"),s=JSON.parse(i),o=t.file("header.json");let a;o&&(a=JSON.parse(await o.async("string")));const c=t.file("operations.json");if(!c)throw new Error("Operations history not found");const u=JSON.parse(await c.async("string")),l=kd(u),d=oC(l);if(d.length){const h=d.map(m=>m.message);throw new Error(h.join(`
94
- `))}let f=W_(s,l,e,void 0,a,{},n);return a&&(f={...f,...a}),f}function yC(t){const e=t.replace(/^.*\./,"")||void 0,n=t.replace(/^.*[/\\]/,"")||void 0;return{extension:e,fileName:n}}async function x8(t){const{buffer:e,mimeType:n="application/octet-stream"}=await r8(),r=yC(t),i=e.toString("base64");return{data:i,hash:vf(i),mimeType:n,...r}}async function T8(t){const e=await i8(),n=d8.getType(t)||"application/octet-stream",r=yC(t),i=e.toString("base64");return{data:i,hash:vf(i),mimeType:n,...r}}function I8(t,e){return{...t,name:e}}function O8(t,e,n){const{scope:r,input:i}=e;return L_({document:t,action:e,skip:n,reuseLastOperationIndex:!1},o=>{const a=[...t.operations[r]],c=ii(a);o.action=LC(r);const u=c.at(-1);let l=(u==null?void 0:u.index)??-1;const d=(u==null?void 0:u.type)!=="NOOP";d?l=l+1:o.reuseLastOperationIndex=!0;const f=d?[...c,{index:l,skip:0}]:c;if(o.skip=V_(f),u&&o.skip>u.skip+1&&(o.skip=o.skip+1),o.skip<0)throw new Error("Cannot undo: you can't undo more operations than the ones in the scope history")})}function C8(t,e,n){const{scope:r,input:i}=e;return L_({document:t,action:e,skip:n,reuseLastOperationIndex:!1},o=>{if(o.skip>0)throw new Error("Cannot redo: skip value from reducer cannot be used with REDO action");if(i>1)throw new Error("Cannot redo: you can only redo one operation at a time");if(i<1)throw new Error("Invalid REDO action: invalid redo input value");if(o.document.clipboard.length<1)throw new Error("Cannot redo: no operations in the clipboard");const a=o.document.clipboard.findLastIndex(u=>u.scope===r);if(a<0)throw new Error(`Cannot redo: no operations in clipboard for scope "${r}"`);const c=o.document.clipboard.splice(a,1)[0];o.action={type:c.type,scope:c.scope,input:c.input}})}function k8(t,e,n){const{scope:r}=e,i=t.operations[r];let{input:{start:s,end:o}}=e;s=s||0,o=o||i.length;const a=i.slice(s,o),c=i.slice(0,s),u=i.slice(o),l=Rd(t.initialState,{...t.operations,[r]:c.concat(a)},n),{name:d,state:f}=l,h=c.length,m=c.length?c[c.length-1].timestamp:u.length?u[0].timestamp:new Date().toISOString();return Rd(t.initialState,{...t.operations,[r]:[...c,{...q_({name:d,state:f},a.length),timestamp:m,index:h,hash:_f({state:f},"global")},...u.map((p,g)=>({...p,index:h+g+1}))]},n)}function D8(t,e){return{...t,name:e.name,state:e.state??{global:{},local:{}}}}const vC="SET_NAME",sc="UNDO",Vu="REDO",bf="PRUNE",bC="LOAD_STATE",R8="NOOP";function N8(t,e){let n;return"index"in e?n={...e}:n=t.operations[e.scope].at(-1),((n==null?void 0:n.index)??-1)+1}function _C(t,e){return{...t,revision:{...t.revision,[e.scope]:N8(t,e)},lastModified:RC(t)}}function A8(t,e,n=0,r=!1){if([sc,Vu,bf].includes(e.type))return t;const{scope:i}=e,s=t.operations[i].slice();let o;const a=s.at(-1),c=(a==null?void 0:a.index)??-1;let u=r?c:c+1,l=new Date().toISOString();if("index"in e){if(e.index-n>u)throw new Error(`Missing operations: expected ${u} with skip 0 or equivalent, got index ${e.index} with skip ${n}`);u=e.index,o=e.id,l=e.timestamp}else o="id"in e?e.id:$_();return s.push({...e,id:o,index:u,timestamp:l,hash:"",scope:i,skip:n,error:void 0}),{...t,operations:{...t.operations,[i]:s}}}function wC(t,e,n=0,r=!1){let i=A8(t,e,n,r);return i=_C(i,e),i}function EC(t,e,n){switch(M6().parse(e),e.type){case vC:return I8(t,e.input);case bf:return k8(t,e,n);case bC:return D8(t,e.input.state);default:return t}}function P8(t,e,n){switch(e.type){case sc:return O8(t,e,n);case Vu:return C8(t,e,n);default:return{document:t,action:e,skip:n,reuseLastOperationIndex:!1}}}function SC(t,e,n,r,i=!1,s=Xm){const o=e.scope,a=t.operations[o].at(-1);if(!a)return t;const c=kd({...t.operations,[o]:dC(t.operations[o],a)});let u;const l=c[o].at(-1);if(i&&(l!=null&&l.resultingState))u=s(l.resultingState);else{const{state:d}=Rd(t.initialState,c,n,void 0,void 0,void 0,void 0,{reuseHash:!0,reuseOperationResultingState:i,operationResultingStateParser:s});u=d[o]}return{...t,state:{...t.state,[o]:u},operations:kd({...t.operations})}}function M8(t,e,n,r=!1,i=Xm){const s=[...t.operations[e]],o=ii(s);o.pop();const a=kd({...t.operations}),c=[...a[e]],u=pC(xi(o),c),l=Rd(t.initialState,a,n,void 0,void 0,void 0,void 0,{reuseHash:!0,reuseOperationResultingState:r,operationResultingStateParser:i}),d=ii([...t.clipboard,...u].filter(f=>f.type!=="NOOP")).reverse();return{...l,clipboard:d}}function xC(t,e,n,r,i={}){const{skip:s,ignoreSkipOperations:o=!1,reuseHash:a=!1,reuseOperationResultingState:c=!1,operationResultingStateParser:u}=i;let l={...e},d=s||0,f={...t},h=!1;const m=!o&&(d>0||"index"in l&&l.skip>0);if(TC(l)){const{skip:b,action:E,document:w,reuseLastOperationIndex:x}=P8(t,l,d);l=E,d=b,f=w,h=x}else f={...f,clipboard:[]};if(Dd(l)&&(f=EC(f,l,n)),f=wC(f,l,d,h),IC(e))return M8(f,e.scope,n);if(m&&(f=SC(f,l,n,d,c,u)),f=L_(f,b=>{try{const E=n(b.state,l,r);E&&w6(()=>{b.state=E})}catch(E){const w=f.operations[l.scope].length-1;b.operations[l.scope][w].error=E.message,b.operations[l.scope][w].skip=0,m&&(b.state={...t.state},b.operations={...t.operations,[l.scope]:[...t.operations[l.scope],{...b.operations[l.scope][w]}]})}}),[sc,Vu,bf].includes(l.type))return f;const g=l.scope||"global",y=a&&Object.prototype.hasOwnProperty.call(l,"hash")?l.hash:_f(f,g),v=f.operations[g].at(-1);return v&&(v.hash=y,c&&(v.resultingState=f.state[g]),!Dd(l)&&l.attachments&&l.attachments.forEach(b=>{const{hash:E,...w}=b;f.attachments[E]={...w}})),f}function L8(t,e,n,r,i={}){const{skip:s,ignoreSkipOperations:o=!1,reuseHash:a=!1,reuseOperationResultingState:c=!1,operationResultingStateParser:u}=i,l={...e},d=s||0;let f={...t};const h=!o&&(d>0||"index"in l&&l.skip>0);Dd(l)&&(f=EC(f,l,n)),f=wC(f,l,d),h&&(f=SC(f,l,n,d,c,u));try{const y=n(f.state,l,r);y&&(f.state=y)}catch(y){const v=f.operations[l.scope].length-1;f.operations[l.scope][v].error=y.message,f.operations[l.scope][v].skip=0,h&&(f.state={...t.state},f.operations={...t.operations,[l.scope]:[...t.operations[l.scope],{...f.operations[l.scope][v]}]})}if([sc,Vu,bf].includes(l.type))return f;const m=l.scope||"global",p=a&&Object.prototype.hasOwnProperty.call(l,"hash")?l.hash:_f(f,m),g=f.operations[m].at(-1);return g&&(g.hash=p,c&&(g.resultingState=f.state[m]),!Dd(l)&&l.attachments&&l.attachments.forEach(y=>{const{hash:v,...b}=y;f.attachments[v]={...b}})),f}function F8(t){return t.type===R8&&t.skip!==void 0&&t.skip>0&&t.hash!==void 0}function TC(t){return[sc,Vu].includes(t.type)}function IC(t){return t.type===sc}function Dd(t){return[vC,sc,Vu,bf,bC].includes(t.type)}function oc(t,e,n,r,i="global"){if(!t)throw new Error("Empty action type");if(typeof t!="string")throw new Error(`Invalid action type: ${JSON.stringify(t)}`);const s={type:t,input:e,scope:i};n&&(s.attachments=n);try{r==null||r().parse(s.input)}catch(o){throw o instanceof Cr?new iC(o.issues):new U_(o)}return s}function OC(t,e=xC){return(n,r,i,s)=>e(n,r,t,i,s)}function $8(t,e=L8){return(n,r,i,s)=>e(n,r,t,i,s)}const CC=(t,e)=>({name:"",documentType:"",revision:{global:0,local:0},created:new Date().toISOString(),lastModified:new Date().toISOString(),attachments:{},...t,state:(e==null?void 0:e(t==null?void 0:t.state))??(t==null?void 0:t.state)??{global:{},local:{}}}),kC=(t,e)=>{const n=CC(t,e);return{...n,initialState:n,operations:{global:[],local:[]},clipboard:[]}},_f=(t,e="global")=>vf(ja(t.state[e]||"")),j8=(t,e=1e3)=>{const n=Math.random()*e;return vf(`${(t??new Date).toISOString()}${n}`)};function Tl(t){return Object.freeze(t)}function U8(t,e){const n=[...t];let r=e||0,i=n.length>0?n[n.length-1].index:0;const s=[];for(const o of n.reverse()){if(r>0){const u=i-o.index;r-=u}if(r<0)throw new Error("Invalid operation index, missing operations");const a={ignore:r>0,operation:o},c=o.skip>0?o.skip+1:0;if(c>0&&c>r){const u=c-r;r=r+u}i=o.index,s.push(a)}return s.reverse()}function DC(t){return Object.values(t).flatMap(e=>e).sort((e,n)=>new Date(e.timestamp).getTime()-new Date(n.timestamp).getTime())}function B8(t){return Object.values(t).flatMap(e=>e).sort((e,n)=>new Date(e.operation.timestamp).getTime()-new Date(n.operation.timestamp).getTime())}function RC(t){var e;return((e=DC(t.operations).at(-1))==null?void 0:e.timestamp)||t.initialState.lastModified}function Rd(t,e,n,r,i,s=xC,o={},a){const c=OC(n,s);return W_(t,e,c,r,i,o,a)}function W_(t,e,n,r,i,s={},o){const{checkHashes:a=!0,reuseOperationResultingState:c,operationResultingStateParser:u=Xm}=o||{};let l=t;const d=[],f={global:[],local:[]};if(c)for(const[y,v]of Object.entries(e)){const b=v.findLastIndex(w=>!!w.resultingState);if(b<0){d.push(...v);continue}const E=v[b];try{const w=u(E.resultingState);l={...l,state:{...l.state,[y]:w}},f[y].push(...v.slice(0,b+1)),d.push(...v.slice(b+1))}catch{d.push(...v)}}else d.push(...Object.values(e).flat());const h=kC(l);h.initialState=t,h.operations=f;let m=h;if(d.length)m=d.reduce((y,v)=>n(y,v,r,{skip:v.skip,ignoreSkipOperations:!0,reuseHash:!a}),h);else for(const y of Object.values(f)){const v=y.at(-1);v&&(m=_C(m,v))}if(!a)for(const y of Object.keys(m.state))for(let v=d.length-1;v>=0;v--){const b=d[v];if(b.scope===y){if(b.hash!==_f(m,y))throw new Error(`Hash mismatch for scope ${y}`);break}}const p=Object.keys(m.operations).reduce((y,v)=>{const b=v;return{...y,[b]:[...m.operations[b].map((E,w)=>{var x;return{...E,timestamp:((x=e[b][w])==null?void 0:x.timestamp)??E.timestamp}})]}},{global:[],local:[]}),g=Object.values(p).reduce((y,v)=>{const b=v.at(-1);return b&&b.timestamp>y&&(y=b.timestamp),y},t.lastModified);return{...m,operations:p,lastModified:g}}function z8(t,e){return ja(t)===ja(e)}function Xm(t){const e=typeof t;if(e==="string")return JSON.parse(t);if(e==="object")return t;throw new Error(`Providing resulting state is of type: ${e}`)}const NC=t=>oc("SET_NAME",t,void 0,KO,void 0),AC=(t=1,e="global")=>oc("UNDO",t,void 0,JO,e),PC=(t=1,e="global")=>oc("REDO",t,void 0,YO,e),MC=(t,e,n="global")=>oc("PRUNE",{start:t,end:e},void 0,ZO,n),q_=(t,e)=>oc("LOAD_STATE",{state:t,operations:e},void 0,GO),LC=(t="global")=>oc("NOOP",{},void 0,void 0,t),FC=Object.freeze(Object.defineProperty({__proto__:null,loadState:q_,noop:LC,prune:MC,redo:PC,setName:NC,undo:AC},Symbol.toStringTag,{value:"Module"}));var V8=Object.defineProperty,H8=(t,e,n)=>e in t?V8(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,yy=(t,e,n)=>H8(t,typeof e!="symbol"?e+"":e,n);class wf{constructor(e,n,r){yy(this,"_document"),yy(this,"_reducer"),yy(this,"_signalDispatch"),this._reducer=e,this._document=n,this._signalDispatch=r}dispatch(e,n){return this._document=this._reducer(this._document,e,this._signalDispatch,n),this}saveToFile(e,n,r){return mC(this._document,e,n,r)}async loadFromFile(e){this._document=await Ov(e,this._reducer)}static async stateFromFile(e,n){return await Ov(e,n)}get state(){return Tl(this._document.state)}get operations(){return Tl(this._document.operations)}get name(){return this._document.name}get documentType(){return this._document.documentType}get created(){return this._document.created}get lastModified(){return this._document.lastModified}get revision(){return this._document.revision.global}getRevision(e){return this._document.revision[e]}get initialState(){return Tl(this._document.initialState)}toDocument(){return Tl(this._document)}getAttachment(e){return this._document.attachments[e]}setName(e){return this.dispatch(NC(e)),this}undo(e){return this.dispatch(AC(e)),this}redo(e){return this.dispatch(PC(e)),this}prune(e,n){return this.dispatch(MC(e,n)),this}loadState(e,n){return this.dispatch(q_(e,n)),this}}function $C(t,e){e.forEach(n=>{Object.getOwnPropertyNames(n.prototype).forEach(r=>{Object.defineProperty(t.prototype,r,Object.getOwnPropertyDescriptor(n.prototype,r)||Object.create(null))})})}const zt=Object.freeze(Object.defineProperty({__proto__:null,InvalidActionInputError:U_,InvalidActionInputZodError:iC,ab2hex:tC,buildOperationSignature:rC,buildOperationSignatureMessage:j_,buildOperationSignatureParams:eC,buildSignedOperation:c8,createAction:oc,createDocument:kC,createExtendedState:CC,createReducer:OC,createUnsafeReducer:$8,createZip:H_,documentHelpers:w8,generateId:$_,getDocumentLastModified:RC,getLocalFile:T8,getRemoteFile:x8,getUnixTimestamp:QO,hashDocument:_f,hashKey:j8,hex2ab:nC,isBaseAction:Dd,isNoopOperation:F8,isSameDocument:z8,isUndo:IC,isUndoRedo:TC,loadFromFile:Ov,loadFromInput:gC,mapSkippedOperations:U8,parseResultingState:Xm,readOnly:Tl,replayDocument:W_,replayOperations:Rd,saveToFile:mC,saveToFileHandle:E8,sortMappedOperations:B8,sortOperations:DC,validateOperations:oC,verifyOperationSignature:u8},Symbol.toStringTag,{value:"Module"}));function jC(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=jC(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function Co(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=jC(t))&&(r&&(r+=" "),r+=e);return r}const Nd=t=>typeof t=="number"&&!isNaN(t),Ta=t=>typeof t=="string",$r=t=>typeof t=="function",Hh=t=>Ta(t)||$r(t)?t:null,Cv=t=>es(t)||Ta(t)||$r(t)||Nd(t);function W8(t,e,n){n===void 0&&(n=300);const{scrollHeight:r,style:i}=t;requestAnimationFrame(()=>{i.minHeight="initial",i.height=r+"px",i.transition=`all ${n}ms`,requestAnimationFrame(()=>{i.height="0",i.padding="0",i.margin="0",setTimeout(e,n)})})}function Qm(t){let{enter:e,exit:n,appendPosition:r=!1,collapse:i=!0,collapseDuration:s=300}=t;return function(o){let{children:a,position:c,preventExitTransition:u,done:l,nodeRef:d,isIn:f,playToast:h}=o;const m=r?`${e}--${c}`:e,p=r?`${n}--${c}`:n,g=qt(0);return Sm(()=>{const y=d.current,v=m.split(" "),b=E=>{E.target===d.current&&(h(),y.removeEventListener("animationend",b),y.removeEventListener("animationcancel",b),g.current===0&&E.type!=="animationcancel"&&y.classList.remove(...v))};y.classList.add(...v),y.addEventListener("animationend",b),y.addEventListener("animationcancel",b)},[]),Dt(()=>{const y=d.current,v=()=>{y.removeEventListener("animationend",v),i?W8(y,l,s):l()};f||(u?v():(g.current=1,y.className+=` ${p}`,y.addEventListener("animationend",v)))},[f]),$e.createElement($e.Fragment,null,a)}}function mS(t,e){return t!=null?{content:t.content,containerId:t.props.containerId,id:t.props.toastId,theme:t.props.theme,type:t.props.type,data:t.props.data||{},isLoading:t.props.isLoading,icon:t.props.icon,status:e}:{}}const hr=new Map;let Ad=[];const kv=new Set,q8=t=>kv.forEach(e=>e(t)),UC=()=>hr.size>0;function BC(t,e){var n;if(e)return!((n=hr.get(e))==null||!n.isToastActive(t));let r=!1;return hr.forEach(i=>{i.isToastActive(t)&&(r=!0)}),r}function zC(t,e){Cv(t)&&(UC()||Ad.push({content:t,options:e}),hr.forEach(n=>{n.buildToast(t,e)}))}function gS(t,e){hr.forEach(n=>{e!=null&&e!=null&&e.containerId?(e==null?void 0:e.containerId)===n.id&&n.toggle(t,e==null?void 0:e.id):n.toggle(t,e==null?void 0:e.id)})}function G8(t){const{subscribe:e,getSnapshot:n,setProps:r}=qt(function(s){const o=s.containerId||1;return{subscribe(a){const c=function(l,d,f){let h=1,m=0,p=[],g=[],y=[],v=d;const b=new Map,E=new Set,w=()=>{y=Array.from(b.values()),E.forEach(k=>k())},x=k=>{g=k==null?[]:g.filter(R=>R!==k),w()},_=k=>{const{toastId:R,onOpen:F,updateId:V,children:T}=k.props,L=V==null;k.staleId&&b.delete(k.staleId),b.set(R,k),g=[...g,k.props.toastId].filter(S=>S!==k.staleId),w(),f(mS(k,L?"added":"updated")),L&&$r(F)&&F(es(T)&&T.props)};return{id:l,props:v,observe:k=>(E.add(k),()=>E.delete(k)),toggle:(k,R)=>{b.forEach(F=>{R!=null&&R!==F.props.toastId||$r(F.toggle)&&F.toggle(k)})},removeToast:x,toasts:b,clearQueue:()=>{m-=p.length,p=[]},buildToast:(k,R)=>{if((D=>{let{containerId:X,toastId:Z,updateId:z}=D;const le=X?X!==l:l!==1,pe=b.has(Z)&&z==null;return le||pe})(R))return;const{toastId:F,updateId:V,data:T,staleId:L,delay:S}=R,C=()=>{x(F)},N=V==null;N&&m++;const U={...v,style:v.toastStyle,key:h++,...Object.fromEntries(Object.entries(R).filter(D=>{let[X,Z]=D;return Z!=null})),toastId:F,updateId:V,data:T,closeToast:C,isIn:!1,className:Hh(R.className||v.toastClassName),bodyClassName:Hh(R.bodyClassName||v.bodyClassName),progressClassName:Hh(R.progressClassName||v.progressClassName),autoClose:!R.isLoading&&(K=R.autoClose,$=v.autoClose,K===!1||Nd(K)&&K>0?K:$),deleteToast(){const D=b.get(F),{onClose:X,children:Z}=D.props;$r(X)&&X(es(Z)&&Z.props),f(mS(D,"removed")),b.delete(F),m--,m<0&&(m=0),p.length>0?_(p.shift()):w()}};var K,$;U.closeButton=v.closeButton,R.closeButton===!1||Cv(R.closeButton)?U.closeButton=R.closeButton:R.closeButton===!0&&(U.closeButton=!Cv(v.closeButton)||v.closeButton);let q=k;es(k)&&!Ta(k.type)?q=sp(k,{closeToast:C,toastProps:U,data:T}):$r(k)&&(q=k({closeToast:C,toastProps:U,data:T}));const j={content:q,props:U,staleId:L};v.limit&&v.limit>0&&m>v.limit&&N?p.push(j):Nd(S)?setTimeout(()=>{_(j)},S):_(j)},setProps(k){v=k},setToggle:(k,R)=>{b.get(k).toggle=R},isToastActive:k=>g.some(R=>R===k),getSnapshot:()=>y}}(o,s,q8);hr.set(o,c);const u=c.observe(a);return Ad.forEach(l=>zC(l.content,l.options)),Ad=[],()=>{u(),hr.delete(o)}},setProps(a){var c;(c=hr.get(o))==null||c.setProps(a)},getSnapshot(){var a;return(a=hr.get(o))==null?void 0:a.getSnapshot()}}}(t)).current;r(t);const i=vP(e,n,n);return{getToastToRender:function(s){if(!i)return[];const o=new Map;return t.newestOnTop&&i.reverse(),i.forEach(a=>{const{position:c}=a.props;o.has(c)||o.set(c,[]),o.get(c).push(a)}),Array.from(o,a=>s(a[0],a[1]))},isToastActive:BC,count:i==null?void 0:i.length}}function Z8(t){const[e,n]=We(!1),[r,i]=We(!1),s=qt(null),o=qt({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:a,pauseOnHover:c,closeToast:u,onClick:l,closeOnClick:d}=t;var f,h;function m(){n(!0)}function p(){n(!1)}function g(b){const E=s.current;o.canDrag&&E&&(o.didMove=!0,e&&p(),o.delta=t.draggableDirection==="x"?b.clientX-o.start:b.clientY-o.start,o.start!==b.clientX&&(o.canCloseOnClick=!1),E.style.transform=`translate3d(${t.draggableDirection==="x"?`${o.delta}px, var(--y)`:`0, calc(${o.delta}px + var(--y))`},0)`,E.style.opacity=""+(1-Math.abs(o.delta/o.removalDistance)))}function y(){document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",y);const b=s.current;if(o.canDrag&&o.didMove&&b){if(o.canDrag=!1,Math.abs(o.delta)>o.removalDistance)return i(!0),t.closeToast(),void t.collapseAll();b.style.transition="transform 0.2s, opacity 0.2s",b.style.removeProperty("transform"),b.style.removeProperty("opacity")}}(h=hr.get((f={id:t.toastId,containerId:t.containerId,fn:n}).containerId||1))==null||h.setToggle(f.id,f.fn),Dt(()=>{if(t.pauseOnFocusLoss)return document.hasFocus()||p(),window.addEventListener("focus",m),window.addEventListener("blur",p),()=>{window.removeEventListener("focus",m),window.removeEventListener("blur",p)}},[t.pauseOnFocusLoss]);const v={onPointerDown:function(b){if(t.draggable===!0||t.draggable===b.pointerType){o.didMove=!1,document.addEventListener("pointermove",g),document.addEventListener("pointerup",y);const E=s.current;o.canCloseOnClick=!0,o.canDrag=!0,E.style.transition="none",t.draggableDirection==="x"?(o.start=b.clientX,o.removalDistance=E.offsetWidth*(t.draggablePercent/100)):(o.start=b.clientY,o.removalDistance=E.offsetHeight*(t.draggablePercent===80?1.5*t.draggablePercent:t.draggablePercent)/100)}},onPointerUp:function(b){const{top:E,bottom:w,left:x,right:_}=s.current.getBoundingClientRect();b.nativeEvent.type!=="touchend"&&t.pauseOnHover&&b.clientX>=x&&b.clientX<=_&&b.clientY>=E&&b.clientY<=w?p():m()}};return a&&c&&(v.onMouseEnter=p,t.stacked||(v.onMouseLeave=m)),d&&(v.onClick=b=>{l&&l(b),o.canCloseOnClick&&u()}),{playToast:m,pauseToast:p,isRunning:e,preventExitTransition:r,toastRef:s,eventHandlers:v}}function Y8(t){let{delay:e,isRunning:n,closeToast:r,type:i="default",hide:s,className:o,style:a,controlledProgress:c,progress:u,rtl:l,isIn:d,theme:f}=t;const h=s||c&&u===0,m={...a,animationDuration:`${e}ms`,animationPlayState:n?"running":"paused"};c&&(m.transform=`scaleX(${u})`);const p=Co("Toastify__progress-bar",c?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${f}`,`Toastify__progress-bar--${i}`,{"Toastify__progress-bar--rtl":l}),g=$r(o)?o({rtl:l,type:i,defaultClassName:p}):Co(p,o),y={[c&&u>=1?"onTransitionEnd":"onAnimationEnd"]:c&&u<1?null:()=>{d&&r()}};return $e.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":h},$e.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${f} Toastify__progress-bar--${i}`}),$e.createElement("div",{role:"progressbar","aria-hidden":h?"true":"false","aria-label":"notification timer",className:g,style:m,...y}))}let K8=1;const VC=()=>""+K8++;function J8(t){return t&&(Ta(t.toastId)||Nd(t.toastId))?t.toastId:VC()}function Ul(t,e){return zC(t,e),e.toastId}function Fp(t,e){return{...e,type:e&&e.type||t,toastId:J8(e)}}function uh(t){return(e,n)=>Ul(e,Fp(t,n))}function an(t,e){return Ul(t,Fp("default",e))}an.loading=(t,e)=>Ul(t,Fp("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e})),an.promise=function(t,e,n){let r,{pending:i,error:s,success:o}=e;i&&(r=Ta(i)?an.loading(i,n):an.loading(i.render,{...n,...i}));const a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},c=(l,d,f)=>{if(d==null)return void an.dismiss(r);const h={type:l,...a,...n,data:f},m=Ta(d)?{render:d}:d;return r?an.update(r,{...h,...m}):an(m.render,{...h,...m}),f},u=$r(t)?t():t;return u.then(l=>c("success",o,l)).catch(l=>c("error",s,l)),u},an.success=uh("success"),an.info=uh("info"),an.error=uh("error"),an.warning=uh("warning"),an.warn=an.warning,an.dark=(t,e)=>Ul(t,Fp("default",{theme:"dark",...e})),an.dismiss=function(t){(function(e){var n;if(UC()){if(e==null||Ta(n=e)||Nd(n))hr.forEach(r=>{r.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){const r=hr.get(e.containerId);r?r.removeToast(e.id):hr.forEach(i=>{i.removeToast(e.id)})}}else Ad=Ad.filter(r=>e!=null&&r.options.toastId!==e)})(t)},an.clearWaitingQueue=function(t){t===void 0&&(t={}),hr.forEach(e=>{!e.props.limit||t.containerId&&e.id!==t.containerId||e.clearQueue()})},an.isActive=BC,an.update=function(t,e){e===void 0&&(e={});const n=((r,i)=>{var s;let{containerId:o}=i;return(s=hr.get(o||1))==null?void 0:s.toasts.get(r)})(t,e);if(n){const{props:r,content:i}=n,s={delay:100,...r,...e,toastId:e.toastId||t,updateId:VC()};s.toastId!==t&&(s.staleId=t);const o=s.render||i;delete s.render,Ul(o,s)}},an.done=t=>{an.update(t,{progress:1})},an.onChange=function(t){return kv.add(t),()=>{kv.delete(t)}},an.play=t=>gS(!0,t),an.pause=t=>gS(!1,t);const X8=typeof window<"u"?Sm:Dt,lh=t=>{let{theme:e,type:n,isLoading:r,...i}=t;return $e.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...i})},vy={info:function(t){return $e.createElement(lh,{...t},$e.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(t){return $e.createElement(lh,{...t},$e.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(t){return $e.createElement(lh,{...t},$e.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(t){return $e.createElement(lh,{...t},$e.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return $e.createElement("div",{className:"Toastify__spinner"})}},Q8=t=>{const{isRunning:e,preventExitTransition:n,toastRef:r,eventHandlers:i,playToast:s}=Z8(t),{closeButton:o,children:a,autoClose:c,onClick:u,type:l,hideProgressBar:d,closeToast:f,transition:h,position:m,className:p,style:g,bodyClassName:y,bodyStyle:v,progressClassName:b,progressStyle:E,updateId:w,role:x,progress:_,rtl:k,toastId:R,deleteToast:F,isIn:V,isLoading:T,closeOnClick:L,theme:S}=t,C=Co("Toastify__toast",`Toastify__toast-theme--${S}`,`Toastify__toast--${l}`,{"Toastify__toast--rtl":k},{"Toastify__toast--close-on-click":L}),N=$r(p)?p({rtl:k,position:m,type:l,defaultClassName:C}):Co(C,p),U=function(j){let{theme:D,type:X,isLoading:Z,icon:z}=j,le=null;const pe={theme:D,type:X};return z===!1||($r(z)?le=z({...pe,isLoading:Z}):es(z)?le=sp(z,pe):Z?le=vy.spinner():(ve=>ve in vy)(X)&&(le=vy[X](pe))),le}(t),K=!!_||!c,$={closeToast:f,type:l,theme:S};let q=null;return o===!1||(q=$r(o)?o($):es(o)?sp(o,$):function(j){let{closeToast:D,theme:X,ariaLabel:Z="close"}=j;return $e.createElement("button",{className:`Toastify__close-button Toastify__close-button--${X}`,type:"button",onClick:z=>{z.stopPropagation(),D(z)},"aria-label":Z},$e.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},$e.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}($)),$e.createElement(h,{isIn:V,done:F,position:m,preventExitTransition:n,nodeRef:r,playToast:s},$e.createElement("div",{id:R,onClick:u,"data-in":V,className:N,...i,style:g,ref:r},$e.createElement("div",{...V&&{role:x},className:$r(y)?y({type:l}):Co("Toastify__toast-body",y),style:v},U!=null&&$e.createElement("div",{className:Co("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!T})},U),$e.createElement("div",null,a)),q,$e.createElement(Y8,{...w&&!K?{key:`pb-${w}`}:{},rtl:k,theme:S,delay:c,isRunning:e,isIn:V,closeToast:f,hide:d,type:l,style:E,className:b,controlledProgress:K,progress:_||0})))},eg=function(t,e){return e===void 0&&(e=!1),{enter:`Toastify--animate Toastify__${t}-enter`,exit:`Toastify--animate Toastify__${t}-exit`,appendPosition:e}},e9=Qm(eg("bounce",!0));Qm(eg("slide",!0));Qm(eg("zoom"));Qm(eg("flip"));const t9={position:"top-right",transition:e9,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function n9(t){let e={...t9,...t};const n=t.stacked,[r,i]=We(!0),s=qt(null),{getToastToRender:o,isToastActive:a,count:c}=G8(e),{className:u,style:l,rtl:d,containerId:f}=e;function h(p){const g=Co("Toastify__toast-container",`Toastify__toast-container--${p}`,{"Toastify__toast-container--rtl":d});return $r(u)?u({position:p,rtl:d,defaultClassName:g}):Co(g,Hh(u))}function m(){n&&(i(!0),an.play())}return X8(()=>{if(n){var p;const g=s.current.querySelectorAll('[data-in="true"]'),y=12,v=(p=e.position)==null?void 0:p.includes("top");let b=0,E=0;Array.from(g).reverse().forEach((w,x)=>{const _=w;_.classList.add("Toastify__toast--stacked"),x>0&&(_.dataset.collapsed=`${r}`),_.dataset.pos||(_.dataset.pos=v?"top":"bot");const k=b*(r?.2:1)+(r?0:y*x);_.style.setProperty("--y",`${v?k:-1*k}px`),_.style.setProperty("--g",`${y}`),_.style.setProperty("--s",""+(1-(r?E:0))),b+=_.offsetHeight,E+=.025})}},[r,c,n]),$e.createElement("div",{ref:s,className:"Toastify",id:f,onMouseEnter:()=>{n&&(i(!1),an.pause())},onMouseLeave:m},o((p,g)=>{const y=g.length?{...l}:{...l,pointerEvents:"none"};return $e.createElement("div",{className:h(p),style:y,key:`container-${p}`},g.map(v=>{let{content:b,props:E}=v;return $e.createElement(Q8,{...E,stacked:n,collapseAll:m,isIn:a(E.toastId,E.containerId),style:E.style,key:`toast-${E.key}`},b)}))}))}function r9(t){return t==="connect-success"||t==="connect-warning"||t==="connect-loading"||t==="connect-deleted"}function i9(t){if(r9(t)){const e={};switch(t){case"connect-success":e.type="success",e.icon=P(vt,{className:"text-green-800",name:"CheckCircleFill",size:24});break;case"connect-warning":e.type="warning",e.icon=P(vt,{className:"text-gray-600",name:"WarningFill",size:24});break;case"connect-loading":e.type="default",e.icon=P(vt,{className:"text-gray-600",name:"ClockFill",size:24});break;case"connect-deleted":e.type="error",e.icon=P(vt,{className:"text-red-800",name:"TrashFill",size:24});break}return e}return{type:t}}function jie(t,e){const{type:n="default",...r}=e||{},i=i9(n);return an(t,{...i,...r})}const s9=({closeToast:t})=>P("button",{className:"flex items-center text-gray-500 hover:text-gray-600",onClick:t,children:P(vt,{name:"XmarkLight",size:16})}),o9=t=>P(n9,{closeButton:s9,...t}),a9={driveNodes:[],selectedNode:null,selectedNodePath:[],selectedDriveNode:null,selectedParentNode:null,setDriveNodes:()=>{},setSelectedNode:()=>{},getNodeById:()=>null,getParentNode:()=>null,getIsSelected:()=>!1,getIsInSelectedNodePath:()=>!1,getSiblings:()=>[]},HC=Lu(a9),c9=({children:t})=>{const[e,n]=We([]),[r,i]=We(null),[s,o]=We([]),[a,c]=We(null),[u,l]=We(null),d=He((_,k)=>{if(!(k!=null&&k.length))return null;for(const R of k){if(R.id===_)return R;const F=R.nodeMap[_];if(F)return F}return null},[]),f=He(_=>d(_,e),[d,e]),h=He((_,k)=>!_||!(k!=null&&k.length)?null:_.kind===Gf?_:k.find(R=>R.id===_.driveId)??null,[]),m=He((_,k)=>{if(!(k!=null&&k.length)||_.kind===Gf)return null;const R=d(_.parentFolder,k);if(!R)return null;if(R.kind===qc)throw new Error(`Parent node ${_.parentFolder} is a file, not a folder`);return R},[d]),p=He(_=>m(_,e),[m,e]),g=He((_,k)=>!_||!(k!=null&&k.length)?null:_.kind===qc?m(_,k):_,[m]),y=He((_,k)=>{const R=[],F=k.find(T=>T.id===_.driveId);let V=_;for(;V;)R.push(V),V=V.parentFolder===(F==null?void 0:F.id)?F:V.parentFolder?F==null?void 0:F.nodeMap[V.parentFolder]:void 0;return R.reverse()},[]),v=He(_=>{if(!_)return;if(i(_),c(h(_,e)),l(g(_,e)),_.kind===Gf){o([_]);return}const k=y(_,e);o(k)},[e,y,h,g]),b=He(_=>r===_,[r]),E=He(_=>_.kind===qc?!1:s.includes(_),[s]),w=He(_=>{if(_.kind===Gf)return console.warn("Drive nodes do not have siblings, as they are top-level nodes"),[];const k=m(_,e);return(k==null?void 0:k.children)??[]},[m,e]);Dt(()=>{if(!r)return;const _=d(r.id,e);_&&v(_)},[e,d,r,v]);const x=Pn(()=>({driveNodes:e,selectedNode:r,selectedNodePath:s,selectedDriveNode:a,selectedParentNode:u,getNodeById:f,getParentNode:p,setDriveNodes:n,setSelectedNode:v,getIsSelected:b,getIsInSelectedNodePath:E,getSiblings:w}),[e,r,s,a,u,f,p,v,b,E,w]);return P(HC.Provider,{value:x,children:t})},Uie=()=>Yo(HC),yS=DU({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),u9=r3({chains:[yS],transports:{[yS.id]:FU()}}),l9=new k3;function d9(t){const{children:e,wagmiProviderProps:n,queryClientProviderProps:r}=t,{config:i=u9,...s}=n??{},{client:o=l9,...a}=r??{};return P(a3,{config:i,...s,children:P(D3,{client:o,...a,children:e})})}let f9=0;function gn(t,e){const n=`atom${++f9}`,r={toString(){return n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=h9,r.write=p9),e&&(r.write=e),r}function h9(t){return t(this)}function p9(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}const vS=(t,e)=>t.unstable_is?t.unstable_is(e):e===t,bS=t=>"init"in t,_S=t=>!!t.write,$p=new WeakMap,Dv=t=>{var e;return Rv(t)&&!((e=$p.get(t))!=null&&e[1])},m9=(t,e)=>{const n=$p.get(t);n&&(n[1]=!0,n[0].forEach(r=>r(e)))},g9=t=>{if($p.has(t))return;const e=[new Set,!1];$p.set(t,e);const n=()=>{e[1]=!0};t.then(n,n),t.onCancel=r=>{e[0].add(r)}},Rv=t=>typeof(t==null?void 0:t.then)=="function",wS=t=>"v"in t||"e"in t,dh=t=>{if("e"in t)throw t.e;return t.v},WC=(t,e,n)=>{n.p.has(t)||(n.p.add(t),e.then(()=>{n.p.delete(t)},()=>{n.p.delete(t)}))},y9=(t,e,n,r)=>{var i;e.d.set(n,r.n),Dv(e.v)&&WC(t,e.v,r),(i=r.m)==null||i.t.add(t)},v9=Symbol.for("JOTAI.EXPERIMENTAL.FLUSHSTOREHOOK"),qC=(...t)=>{const[e,n,r,i,s,o]=t,a=V=>{let T=e(V);return T||(T={d:new Map,p:new Set,n:0},n(V,T),s==null||s(V,F)),T},c=new WeakMap,u=new Map,l=new Set,d=new Set,f=()=>{var V;const T=[],L=S=>{try{S()}catch(C){T.push(C)}};do{(V=F[v9])==null||V.call(F);const S=new Set,C=S.add.bind(S);u.forEach(N=>{var U;return(U=N.m)==null?void 0:U.l.forEach(C)}),u.clear(),l.forEach(C),l.clear(),d.forEach(C),d.clear(),S.forEach(L),u.size&&v()}while(u.size||l.size||d.size);if(T.length)throw T[0]},h=(V,T,L)=>{const S="v"in T,C=T.v,N=Dv(T.v)?T.v:null;if(Rv(L)){g9(L);for(const U of T.d.keys())WC(V,L,a(U));T.v=L}else T.v=L;delete T.e,(!S||!Object.is(C,T.v))&&(++T.n,N&&m9(N,L))},m=V=>{var T;const L=a(V);if(wS(L)&&(L.m&&c.get(V)!==L.n||Array.from(L.d).every(([q,j])=>m(q).n===j)))return L;L.d.clear();let S=!0;const C=()=>{L.m&&(w(V,L),v(),f())},N=q=>{if(vS(V,q)){const D=a(q);if(!wS(D))if(bS(q))h(q,D,q.init);else throw new Error("no atom init");return dh(D)}const j=m(q);try{return dh(j)}finally{y9(V,L,q,j),S||C()}};let U,K;const $={get signal(){return U||(U=new AbortController),U.signal},get setSelf(){return!K&&_S(V)&&(K=(...q)=>{if(!S)return E(V,...q)}),K}};try{const q=r(V,N,$);return h(V,L,q),Rv(q)&&((T=q.onCancel)==null||T.call(q,()=>U==null?void 0:U.abort()),q.then(C,C)),L}catch(q){return delete L.v,L.e=q,++L.n,L}finally{S=!1}},p=V=>dh(m(V)),g=V=>{var T;const L=new Map;for(const S of((T=V.m)==null?void 0:T.t)||[]){const C=a(S);C.m&&L.set(S,C)}for(const S of V.p)L.set(S,a(S));return L},y=V=>{const T=[V];for(;T.length;){const L=T.pop();for(const[S,C]of g(L))c.has(S)||(c.set(S,C.n),T.push(C))}},v=()=>{var V;const T=[],L=new WeakSet,S=new WeakSet,C=Array.from(u);for(;C.length;){const[N,U]=C[C.length-1];if(S.has(N)){C.pop();continue}if(L.has(N)){c.get(N)===U.n?T.push([N,U,U.n]):(c.delete(N),u.set(N,U)),S.add(N),C.pop();continue}L.add(N);for(const[K,$]of g(U))L.has(K)||C.push([K,$])}for(let N=T.length-1;N>=0;--N){const[U,K,$]=T[N];let q=!1;for(const j of K.d.keys())if(j!==U&&u.has(j)){q=!0;break}q&&(m(U),w(U,K),$!==K.n&&(u.set(U,K),(V=K.u)==null||V.call(K))),c.delete(U)}},b=(V,...T)=>{let L=!0;const S=N=>dh(m(N)),C=(N,...U)=>{var K;const $=a(N);try{if(vS(V,N)){if(!bS(N))throw new Error("atom not writable");const q=$.n,j=U[0];h(N,$,j),w(N,$),q!==$.n&&(u.set(N,$),(K=$.u)==null||K.call($),y($));return}else return b(N,...U)}finally{L||(v(),f())}};try{return i(V,S,C,...T)}finally{L=!1}},E=(V,...T)=>{try{return b(V,...T)}finally{v(),f()}},w=(V,T)=>{var L;if(T.m&&!Dv(T.v)){for(const[S,C]of T.d)if(!T.m.d.has(S)){const N=a(S);x(S,N).t.add(V),T.m.d.add(S),C!==N.n&&(u.set(S,N),(L=N.u)==null||L.call(N),y(N))}for(const S of T.m.d||[])if(!T.d.has(S)){T.m.d.delete(S);const C=_(S,a(S));C==null||C.t.delete(V)}}},x=(V,T)=>{var L;if(!T.m){m(V);for(const S of T.d.keys())x(S,a(S)).t.add(V);if(T.m={l:new Set,d:new Set(T.d.keys()),t:new Set},(L=T.h)==null||L.call(T),_S(V)){const S=T.m,C=()=>{let N=!0;const U=(...K)=>{try{return b(V,...K)}finally{N||(v(),f())}};try{const K=o(V,U);K&&(S.u=()=>{N=!0;try{K()}finally{N=!1}})}finally{N=!1}};d.add(C)}}return T.m},_=(V,T)=>{var L;if(T.m&&!T.m.l.size&&!Array.from(T.m.t).some(S=>{var C;return(C=a(S).m)==null?void 0:C.d.has(V)})){const S=T.m.u;S&&l.add(S),delete T.m,(L=T.h)==null||L.call(T);for(const C of T.d.keys()){const N=_(C,a(C));N==null||N.t.delete(V)}return}return T.m},F={get:p,set:E,sub:(V,T)=>{const L=a(V),C=x(V,L).l;return C.add(T),f(),()=>{C.delete(T),_(V,L),f()}},unstable_derive:V=>qC(...V(...t))};return F},G_=()=>{const t=new WeakMap;return qC(n=>t.get(n),(n,r)=>t.set(n,r).get(n),(n,...r)=>n.read(...r),(n,...r)=>n.write(...r),(n,...r)=>{var i;return(i=n.unstable_onInit)==null?void 0:i.call(n,...r)},(n,...r)=>{var i;return(i=n.onMount)==null?void 0:i.call(n,...r)})};let by;const GC=()=>(by||(by=G_()),by),ZC=Lu(void 0),YC=t=>Yo(ZC)||GC(),b9=({children:t,store:e})=>{const n=qt(void 0);return!e&&!n.current&&(n.current=G_()),Ea(ZC.Provider,{value:e||n.current},t)},KC=t=>typeof(t==null?void 0:t.then)=="function",_9=t=>{t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e})},w9=$e.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(_9(t),t)}),_y=new WeakMap,E9=t=>{let e=_y.get(t);return e||(e=new Promise((n,r)=>{let i=t;const s=c=>u=>{i===c&&n(u)},o=c=>u=>{i===c&&r(u)},a=c=>{"onCancel"in c&&typeof c.onCancel=="function"&&c.onCancel(u=>{KC(u)?(_y.set(u,e),i=u,u.then(s(u),o(u)),a(u)):n(u)})};t.then(s(t),o(t)),a(t)}),_y.set(t,e)),e};function ac(t,e){const n=YC(),[[r,i,s],o]=bP(u=>{const l=n.get(t);return Object.is(u[0],l)&&u[1]===n&&u[2]===t?u:[l,n,t]},void 0,()=>[n.get(t),n,t]);let a=r;if((i!==n||s!==t)&&(o(),a=n.get(t)),Dt(()=>{const u=n.sub(t,()=>{o()});return o(),u},[n,t,void 0]),_P(a),KC(a)){const u=E9(a);return w9(u)}return a}function S9(t,e){const n=YC();return He((...i)=>n.set(t,...i),[n,t])}function Ni(t,e){return[ac(t),S9(t)]}const x9=Symbol("");function T9(t,e){let n=null;const r=new Map,i=new Set,s=a=>{let c;if(c=r.get(a),c!==void 0)if(n!=null&&n(c[1],a))s.remove(a);else return c[0];const u=t(a);return r.set(a,[u,Date.now()]),o("CREATE",a,u),u};function o(a,c,u){for(const l of i)l({type:a,param:c,atom:u})}return s.unstable_listen=a=>(i.add(a),()=>{i.delete(a)}),s.getParams=()=>r.keys(),s.remove=a=>{{if(!r.has(a))return;const[c]=r.get(a);r.delete(a),o("REMOVE",a,c)}},s.setShouldRemove=a=>{if(n=a,!!n)for(const[c,[u,l]]of r)n(l,c)&&(r.delete(c),o("REMOVE",c,u))},s}const I9=t=>typeof(t==null?void 0:t.then)=="function";function O9(t=()=>{try{return window.localStorage}catch{return}},e){var n;let r,i;const s={getItem:(c,u)=>{var l,d;const f=m=>{if(m=m||"",r!==m){try{i=JSON.parse(m,e==null?void 0:e.reviver)}catch{return u}r=m}return i},h=(d=(l=t())==null?void 0:l.getItem(c))!=null?d:null;return I9(h)?h.then(f):f(h)},setItem:(c,u)=>{var l;return(l=t())==null?void 0:l.setItem(c,JSON.stringify(u,void 0))},removeItem:c=>{var u;return(u=t())==null?void 0:u.removeItem(c)}},o=c=>(u,l,d)=>c(u,f=>{let h;try{h=JSON.parse(f||"")}catch{h=d}l(h)});let a;try{a=(n=t())==null?void 0:n.subscribe}catch{}return!a&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(a=(c,u)=>{if(!(t()instanceof window.Storage))return()=>{};const l=d=>{d.storageArea===t()&&d.key===c&&u(d.newValue)};return window.addEventListener("storage",l),()=>{window.removeEventListener("storage",l)}}),a&&(s.subscribe=o(a)),s}const C9=O9();function JC(t,e,n=C9,r){const i=gn(e);return i.onMount=o=>{o(n.getItem(t,e));let a;return n.subscribe&&(a=n.subscribe(t,o,e)),a},gn(o=>o(i),(o,a,c)=>{const u=typeof c=="function"?c(o(i)):c;return u===x9?(a(i,e),n.removeItem(t)):u instanceof Promise?u.then(l=>(a(i,l),n.setItem(t,l))):(a(i,u),n.setItem(t,u))})}const wy=new WeakMap,k9=(t,e)=>(wy.has(e)?wy:wy.set(e,t())).get(e),D9=t=>t instanceof Promise,ES={state:"loading"};function Bie(t){return k9(()=>{const e=new WeakMap,n=gn(0),r=gn((i,{setSelf:s})=>{i(n);let o;try{o=i(t)}catch(l){return{state:"hasError",error:l}}if(!D9(o))return{state:"hasData",data:o};const a=o,c=e.get(a);if(c)return c;a.then(l=>{e.set(a,{state:"hasData",data:l}),s()},l=>{e.set(a,{state:"hasError",error:l}),s()});const u=e.get(a);return u||(e.set(a,ES),ES)},(i,s)=>{s(n,o=>o+1)});return gn(i=>i(r))},t)}const SS=(t,e,n)=>(e.has(n)?e:e.set(n,t())).get(n),R9=new WeakMap,N9=(t,e,n)=>{const r=SS(()=>new WeakMap,R9,e);return SS(t,r,n)},A9=t=>t instanceof Promise,P9=()=>{};function XC(t,e=P9){return N9(()=>{const n=new WeakMap,r=new WeakMap,i=gn(0),s=gn((o,{setSelf:a})=>{o(i);const c=o(s),u=o(t);if(!A9(u))return{v:u};if(u!==(c==null?void 0:c.p)&&u.then(l=>{r.set(u,l),a()},l=>{n.set(u,l),a()}),n.has(u))throw n.get(u);return r.has(u)?{p:u,v:r.get(u)}:c&&"v"in c?{p:u,f:e(c.v),v:c.v}:{p:u,f:e()}},(o,a)=>{a(i,c=>c+1)});return s.init=void 0,gn(o=>{const a=o(s);return"f"in a?a.f:a.v},(o,a,...c)=>a(t,...c))},t,e)}function Z_(t){const e=gn(void 0);return delete e.init,Object.defineProperty(e,"init",{get(){return t()}}),e}const Il=Ns.routerBasename,Ef=(t,e,n,r)=>JC(`${Il}:${t}`,e,void 0),M9=(t,e,n)=>JC(t,e,{getItem(r,i){const s=localStorage.getItem(`${Il}:${r}`);return s?JSON.parse(s):i},setItem(r,i){localStorage.setItem(`${Il}:${r}`,JSON.stringify(i)),n(i)},removeItem(r){localStorage.removeItem(`${Il}:${r}`)},subscribe(r,i){if(typeof window.addEventListener>"u")return()=>null;function s(o){o.storageArea===localStorage&&o.key===`${Il}:${r}`&&i(o.newValue??"")}return window.addEventListener("storage",s),()=>window.removeEventListener("storage",s)}}),L9="acceptedCookies",F9=Ef(L9,{analytics:!1,marketing:!1,functional:!1}),Y_=()=>Ni(F9),$9="display-cookie-banner",j9=Ef($9,!0),U9=()=>Ni(j9);function B9(t){const{open:e,onAddLocalDrive:n,onClose:r}=t;async function i(s){await n(s),r()}return P(S4,{open:e,onSubmit:i,onOpenChange:s=>{if(!s)return r()}})}const z9=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),V9=new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])","gu"),H9=new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d","u"),W9=/[^\p{L}\d]+/giu,xS="$1\0$2",TS="";function QC(t){let e=t.trim();e=e.replace(z9,xS).replace(V9,xS),e=e.replace(W9,"\0");let n=0,r=e.length;for(;e.charAt(n)==="\0";)n++;if(n===r)return[];for(;e.charAt(r-1)==="\0";)r--;return e.slice(n,r).split(/\0/g)}function q9(t){const e=QC(t);for(let n=0;n<e.length;n++){const r=e[n],i=H9.exec(r);if(i){const s=i.index+(i[1]??i[2]).length;e.splice(n,1,r.slice(0,s),r.slice(s))}}return e}function ek(t,e){const[n,r,i]=K9(t,e),s=G9(e==null?void 0:e.locale),o=Z9(e==null?void 0:e.locale),a=Y9(s,o);return n+r.map(a).join("")+i}function G9(t){return e=>e.toLocaleLowerCase(t)}function Z9(t){return e=>e.toLocaleUpperCase(t)}function Y9(t,e){return(n,r)=>{const i=n[0];return(r>0&&i>="0"&&i<="9"?"_"+i:e(i))+t(n.slice(1))}}function K9(t,e={}){const n=e.split??(e.separateNumbers?q9:QC),r=e.prefixCharacters??TS,i=e.suffixCharacters??TS;let s=0,o=t.length;for(;s<t.length;){const a=t.charAt(s);if(!r.includes(a))break;s++}for(;o>s;){const a=o-1,c=t.charAt(a);if(!i.includes(c))break;o=a}return[t.slice(0,s),n(t.slice(s,o)),t.slice(o)]}function Gt(t,e){if(!!!t)throw new Error(e)}function Ua(t){return typeof t=="object"&&t!==null}function Ti(t,e){if(!!!t)throw new Error(e??"Unexpected invariant triggered.")}const J9=/\r\n|[\n\r]/g;function Nv(t,e){let n=0,r=1;for(const i of t.body.matchAll(J9)){if(typeof i.index=="number"||Ti(!1),i.index>=e)break;n=i.index+i[0].length,r+=1}return{line:r,column:e+1-n}}function X9(t){return tk(t.source,Nv(t.source,t.start))}function tk(t,e){const n=t.locationOffset.column-1,r="".padStart(n)+t.body,i=e.line-1,s=t.locationOffset.line-1,o=e.line+s,a=e.line===1?n:0,c=e.column+a,u=`${t.name}:${o}:${c}
95
- `,l=r.split(/\r\n|[\n\r]/g),d=l[i];if(d.length>120){const f=Math.floor(c/80),h=c%80,m=[];for(let p=0;p<d.length;p+=80)m.push(d.slice(p,p+80));return u+IS([[`${o} |`,m[0]],...m.slice(1,f+1).map(p=>["|",p]),["|","^".padStart(h)],["|",m[f+1]]])}return u+IS([[`${o-1} |`,l[i-1]],[`${o} |`,d],["|","^".padStart(c)],[`${o+1} |`,l[i+1]]])}function IS(t){const e=t.filter(([r,i])=>i!==void 0),n=Math.max(...e.map(([r])=>r.length));return e.map(([r,i])=>r.padStart(n)+(i?" "+i:"")).join(`
96
- `)}function Q9(t){const e=t[0];return e==null||"kind"in e||"length"in e?{nodes:e,source:t[1],positions:t[2],path:t[3],originalError:t[4],extensions:t[5]}:e}class Ie extends Error{constructor(e,...n){var r,i,s;const{nodes:o,source:a,positions:c,path:u,originalError:l,extensions:d}=Q9(n);super(e),this.name="GraphQLError",this.path=u??void 0,this.originalError=l??void 0,this.nodes=OS(Array.isArray(o)?o:o?[o]:void 0);const f=OS((r=this.nodes)===null||r===void 0?void 0:r.map(m=>m.loc).filter(m=>m!=null));this.source=a??(f==null||(i=f[0])===null||i===void 0?void 0:i.source),this.positions=c??(f==null?void 0:f.map(m=>m.start)),this.locations=c&&a?c.map(m=>Nv(a,m)):f==null?void 0:f.map(m=>Nv(m.source,m.start));const h=Ua(l==null?void 0:l.extensions)?l==null?void 0:l.extensions:void 0;this.extensions=(s=d??h)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),l!=null&&l.stack?Object.defineProperty(this,"stack",{value:l.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,Ie):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(e+=`
97
-
98
- `+X9(n.loc));else if(this.source&&this.locations)for(const n of this.locations)e+=`
99
-
100
- `+tk(this.source,n);return e}toJSON(){const e={message:this.message};return this.locations!=null&&(e.locations=this.locations),this.path!=null&&(e.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function OS(t){return t===void 0||t.length===0?void 0:t}function Bn(t,e,n){return new Ie(`Syntax Error: ${n}`,{source:t,positions:[e]})}class ez{constructor(e,n,r){this.start=e.start,this.end=n.end,this.startToken=e,this.endToken=n,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class nk{constructor(e,n,r,i,s,o){this.kind=e,this.start=n,this.end=r,this.line=i,this.column=s,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const rk={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},tz=new Set(Object.keys(rk));function CS(t){const e=t==null?void 0:t.kind;return typeof e=="string"&&tz.has(e)}var ni;(function(t){t.QUERY="query",t.MUTATION="mutation",t.SUBSCRIPTION="subscription"})(ni||(ni={}));var nt;(function(t){t.QUERY="QUERY",t.MUTATION="MUTATION",t.SUBSCRIPTION="SUBSCRIPTION",t.FIELD="FIELD",t.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",t.FRAGMENT_SPREAD="FRAGMENT_SPREAD",t.INLINE_FRAGMENT="INLINE_FRAGMENT",t.VARIABLE_DEFINITION="VARIABLE_DEFINITION",t.SCHEMA="SCHEMA",t.SCALAR="SCALAR",t.OBJECT="OBJECT",t.FIELD_DEFINITION="FIELD_DEFINITION",t.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",t.INTERFACE="INTERFACE",t.UNION="UNION",t.ENUM="ENUM",t.ENUM_VALUE="ENUM_VALUE",t.INPUT_OBJECT="INPUT_OBJECT",t.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(nt||(nt={}));var ne;(function(t){t.NAME="Name",t.DOCUMENT="Document",t.OPERATION_DEFINITION="OperationDefinition",t.VARIABLE_DEFINITION="VariableDefinition",t.SELECTION_SET="SelectionSet",t.FIELD="Field",t.ARGUMENT="Argument",t.FRAGMENT_SPREAD="FragmentSpread",t.INLINE_FRAGMENT="InlineFragment",t.FRAGMENT_DEFINITION="FragmentDefinition",t.VARIABLE="Variable",t.INT="IntValue",t.FLOAT="FloatValue",t.STRING="StringValue",t.BOOLEAN="BooleanValue",t.NULL="NullValue",t.ENUM="EnumValue",t.LIST="ListValue",t.OBJECT="ObjectValue",t.OBJECT_FIELD="ObjectField",t.DIRECTIVE="Directive",t.NAMED_TYPE="NamedType",t.LIST_TYPE="ListType",t.NON_NULL_TYPE="NonNullType",t.SCHEMA_DEFINITION="SchemaDefinition",t.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",t.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",t.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",t.FIELD_DEFINITION="FieldDefinition",t.INPUT_VALUE_DEFINITION="InputValueDefinition",t.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",t.UNION_TYPE_DEFINITION="UnionTypeDefinition",t.ENUM_TYPE_DEFINITION="EnumTypeDefinition",t.ENUM_VALUE_DEFINITION="EnumValueDefinition",t.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",t.DIRECTIVE_DEFINITION="DirectiveDefinition",t.SCHEMA_EXTENSION="SchemaExtension",t.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",t.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",t.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",t.UNION_TYPE_EXTENSION="UnionTypeExtension",t.ENUM_TYPE_EXTENSION="EnumTypeExtension",t.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(ne||(ne={}));function Av(t){return t===9||t===32}function Pd(t){return t>=48&&t<=57}function ik(t){return t>=97&&t<=122||t>=65&&t<=90}function K_(t){return ik(t)||t===95}function sk(t){return ik(t)||Pd(t)||t===95}function nz(t){var e;let n=Number.MAX_SAFE_INTEGER,r=null,i=-1;for(let o=0;o<t.length;++o){var s;const a=t[o],c=rz(a);c!==a.length&&(r=(s=r)!==null&&s!==void 0?s:o,i=o,o!==0&&c<n&&(n=c))}return t.map((o,a)=>a===0?o:o.slice(n)).slice((e=r)!==null&&e!==void 0?e:0,i+1)}function rz(t){let e=0;for(;e<t.length&&Av(t.charCodeAt(e));)++e;return e}function iz(t,e){const n=t.replace(/"""/g,'\\"""'),r=n.split(/\r\n|[\n\r]/g),i=r.length===1,s=r.length>1&&r.slice(1).every(h=>h.length===0||Av(h.charCodeAt(0))),o=n.endsWith('\\"""'),a=t.endsWith('"')&&!o,c=t.endsWith("\\"),u=a||c,l=!i||t.length>70||u||s||o;let d="";const f=i&&Av(t.charCodeAt(0));return(l&&!f||s)&&(d+=`
101
- `),d+=n,(l||u)&&(d+=`
102
- `),'"""'+d+'"""'}var be;(function(t){t.SOF="<SOF>",t.EOF="<EOF>",t.BANG="!",t.DOLLAR="$",t.AMP="&",t.PAREN_L="(",t.PAREN_R=")",t.SPREAD="...",t.COLON=":",t.EQUALS="=",t.AT="@",t.BRACKET_L="[",t.BRACKET_R="]",t.BRACE_L="{",t.PIPE="|",t.BRACE_R="}",t.NAME="Name",t.INT="Int",t.FLOAT="Float",t.STRING="String",t.BLOCK_STRING="BlockString",t.COMMENT="Comment"})(be||(be={}));class sz{constructor(e){const n=new nk(be.SOF,0,0,0,0);this.source=e,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==be.EOF)do if(e.next)e=e.next;else{const n=az(this,e.end);e.next=n,n.prev=e,e=n}while(e.kind===be.COMMENT);return e}}function oz(t){return t===be.BANG||t===be.DOLLAR||t===be.AMP||t===be.PAREN_L||t===be.PAREN_R||t===be.SPREAD||t===be.COLON||t===be.EQUALS||t===be.AT||t===be.BRACKET_L||t===be.BRACKET_R||t===be.BRACE_L||t===be.PIPE||t===be.BRACE_R}function Hu(t){return t>=0&&t<=55295||t>=57344&&t<=1114111}function tg(t,e){return ok(t.charCodeAt(e))&&ak(t.charCodeAt(e+1))}function ok(t){return t>=55296&&t<=56319}function ak(t){return t>=56320&&t<=57343}function Ba(t,e){const n=t.source.body.codePointAt(e);if(n===void 0)return be.EOF;if(n>=32&&n<=126){const r=String.fromCodePoint(n);return r==='"'?`'"'`:`"${r}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function Nn(t,e,n,r,i){const s=t.line,o=1+n-t.lineStart;return new nk(e,n,r,s,o,i)}function az(t,e){const n=t.source.body,r=n.length;let i=e;for(;i<r;){const s=n.charCodeAt(i);switch(s){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++t.line,t.lineStart=i;continue;case 13:n.charCodeAt(i+1)===10?i+=2:++i,++t.line,t.lineStart=i;continue;case 35:return cz(t,i);case 33:return Nn(t,be.BANG,i,i+1);case 36:return Nn(t,be.DOLLAR,i,i+1);case 38:return Nn(t,be.AMP,i,i+1);case 40:return Nn(t,be.PAREN_L,i,i+1);case 41:return Nn(t,be.PAREN_R,i,i+1);case 46:if(n.charCodeAt(i+1)===46&&n.charCodeAt(i+2)===46)return Nn(t,be.SPREAD,i,i+3);break;case 58:return Nn(t,be.COLON,i,i+1);case 61:return Nn(t,be.EQUALS,i,i+1);case 64:return Nn(t,be.AT,i,i+1);case 91:return Nn(t,be.BRACKET_L,i,i+1);case 93:return Nn(t,be.BRACKET_R,i,i+1);case 123:return Nn(t,be.BRACE_L,i,i+1);case 124:return Nn(t,be.PIPE,i,i+1);case 125:return Nn(t,be.BRACE_R,i,i+1);case 34:return n.charCodeAt(i+1)===34&&n.charCodeAt(i+2)===34?pz(t,i):lz(t,i)}if(Pd(s)||s===45)return uz(t,i,s);if(K_(s))return mz(t,i);throw Bn(t.source,i,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:Hu(s)||tg(n,i)?`Unexpected character: ${Ba(t,i)}.`:`Invalid character: ${Ba(t,i)}.`)}return Nn(t,be.EOF,r,r)}function cz(t,e){const n=t.source.body,r=n.length;let i=e+1;for(;i<r;){const s=n.charCodeAt(i);if(s===10||s===13)break;if(Hu(s))++i;else if(tg(n,i))i+=2;else break}return Nn(t,be.COMMENT,e,i,n.slice(e+1,i))}function uz(t,e,n){const r=t.source.body;let i=e,s=n,o=!1;if(s===45&&(s=r.charCodeAt(++i)),s===48){if(s=r.charCodeAt(++i),Pd(s))throw Bn(t.source,i,`Invalid number, unexpected digit after 0: ${Ba(t,i)}.`)}else i=Ey(t,i,s),s=r.charCodeAt(i);if(s===46&&(o=!0,s=r.charCodeAt(++i),i=Ey(t,i,s),s=r.charCodeAt(i)),(s===69||s===101)&&(o=!0,s=r.charCodeAt(++i),(s===43||s===45)&&(s=r.charCodeAt(++i)),i=Ey(t,i,s),s=r.charCodeAt(i)),s===46||K_(s))throw Bn(t.source,i,`Invalid number, expected digit but got: ${Ba(t,i)}.`);return Nn(t,o?be.FLOAT:be.INT,e,i,r.slice(e,i))}function Ey(t,e,n){if(!Pd(n))throw Bn(t.source,e,`Invalid number, expected digit but got: ${Ba(t,e)}.`);const r=t.source.body;let i=e+1;for(;Pd(r.charCodeAt(i));)++i;return i}function lz(t,e){const n=t.source.body,r=n.length;let i=e+1,s=i,o="";for(;i<r;){const a=n.charCodeAt(i);if(a===34)return o+=n.slice(s,i),Nn(t,be.STRING,e,i+1,o);if(a===92){o+=n.slice(s,i);const c=n.charCodeAt(i+1)===117?n.charCodeAt(i+2)===123?dz(t,i):fz(t,i):hz(t,i);o+=c.value,i+=c.size,s=i;continue}if(a===10||a===13)break;if(Hu(a))++i;else if(tg(n,i))i+=2;else throw Bn(t.source,i,`Invalid character within String: ${Ba(t,i)}.`)}throw Bn(t.source,i,"Unterminated string.")}function dz(t,e){const n=t.source.body;let r=0,i=3;for(;i<12;){const s=n.charCodeAt(e+i++);if(s===125){if(i<5||!Hu(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|Ol(s),r<0)break}throw Bn(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+i)}".`)}function fz(t,e){const n=t.source.body,r=kS(n,e+2);if(Hu(r))return{value:String.fromCodePoint(r),size:6};if(ok(r)&&n.charCodeAt(e+6)===92&&n.charCodeAt(e+7)===117){const i=kS(n,e+8);if(ak(i))return{value:String.fromCodePoint(r,i),size:12}}throw Bn(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+6)}".`)}function kS(t,e){return Ol(t.charCodeAt(e))<<12|Ol(t.charCodeAt(e+1))<<8|Ol(t.charCodeAt(e+2))<<4|Ol(t.charCodeAt(e+3))}function Ol(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function hz(t,e){const n=t.source.body;switch(n.charCodeAt(e+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
103
- `,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw Bn(t.source,e,`Invalid character escape sequence: "${n.slice(e,e+2)}".`)}function pz(t,e){const n=t.source.body,r=n.length;let i=t.lineStart,s=e+3,o=s,a="";const c=[];for(;s<r;){const u=n.charCodeAt(s);if(u===34&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34){a+=n.slice(o,s),c.push(a);const l=Nn(t,be.BLOCK_STRING,e,s+3,nz(c).join(`
104
- `));return t.line+=c.length-1,t.lineStart=i,l}if(u===92&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34&&n.charCodeAt(s+3)===34){a+=n.slice(o,s),o=s+1,s+=4;continue}if(u===10||u===13){a+=n.slice(o,s),c.push(a),u===13&&n.charCodeAt(s+1)===10?s+=2:++s,a="",o=s,i=s;continue}if(Hu(u))++s;else if(tg(n,s))s+=2;else throw Bn(t.source,s,`Invalid character within String: ${Ba(t,s)}.`)}throw Bn(t.source,s,"Unterminated string.")}function mz(t,e){const n=t.source.body,r=n.length;let i=e+1;for(;i<r;){const s=n.charCodeAt(i);if(sk(s))++i;else break}return Nn(t,be.NAME,e,i,n.slice(e,i))}const gz=10,ck=2;function Qe(t){return ng(t,[])}function ng(t,e){switch(typeof t){case"string":return JSON.stringify(t);case"function":return t.name?`[function ${t.name}]`:"[function]";case"object":return yz(t,e);default:return String(t)}}function yz(t,e){if(t===null)return"null";if(e.includes(t))return"[Circular]";const n=[...e,t];if(vz(t)){const r=t.toJSON();if(r!==t)return typeof r=="string"?r:ng(r,n)}else if(Array.isArray(t))return _z(t,n);return bz(t,n)}function vz(t){return typeof t.toJSON=="function"}function bz(t,e){const n=Object.entries(t);return n.length===0?"{}":e.length>ck?"["+wz(t)+"]":"{ "+n.map(([i,s])=>i+": "+ng(s,e)).join(", ")+" }"}function _z(t,e){if(t.length===0)return"[]";if(e.length>ck)return"[Array]";const n=Math.min(gz,t.length),r=t.length-n,i=[];for(let s=0;s<n;++s)i.push(ng(t[s],e));return r===1?i.push("... 1 more item"):r>1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}function wz(t){const e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){const n=t.constructor.name;if(typeof n=="string"&&n!=="")return n}return e}const Ez=globalThis.process&&!0,ms=Ez?function(e,n){return e instanceof n}:function(e,n){if(e instanceof n)return!0;if(typeof e=="object"&&e!==null){var r;const i=n.prototype[Symbol.toStringTag],s=Symbol.toStringTag in e?e[Symbol.toStringTag]:(r=e.constructor)===null||r===void 0?void 0:r.name;if(i===s){const o=Qe(e);throw new Error(`Cannot use ${i} "${o}" from another module or realm.
105
-
106
- Ensure that there is only one instance of "graphql" in the node_modules
107
- directory. If different versions of "graphql" are the dependencies of other
108
- relied on modules, use "resolutions" to ensure only one version is installed.
109
-
110
- https://yarnpkg.com/en/docs/selective-version-resolutions
111
-
112
- Duplicate "graphql" modules cannot be used at the same time since different
113
- versions may have different capabilities and behavior. The data from one
114
- version used in the function from another could produce confusing and
115
- spurious results.`)}}return!1};class uk{constructor(e,n="GraphQL request",r={line:1,column:1}){typeof e=="string"||Gt(!1,`Body must be a string. Received: ${Qe(e)}.`),this.body=e,this.name=n,this.locationOffset=r,this.locationOffset.line>0||Gt(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Gt(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function Sz(t){return ms(t,uk)}function lk(t,e){const n=new xz(t,e),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:n.tokenCount}),r}class xz{constructor(e,n={}){const r=Sz(e)?e:new uk(e);this._lexer=new sz(r),this._options=n,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(be.NAME);return this.node(e,{kind:ne.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:ne.DOCUMENT,definitions:this.many(be.SOF,this.parseDefinition,be.EOF)})}parseDefinition(){if(this.peek(be.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),n=e?this._lexer.lookahead():this._lexer.token;if(n.kind===be.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw Bn(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(be.BRACE_L))return this.node(e,{kind:ne.OPERATION_DEFINITION,operation:ni.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseOperationType();let r;return this.peek(be.NAME)&&(r=this.parseName()),this.node(e,{kind:ne.OPERATION_DEFINITION,operation:n,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(be.NAME);switch(e.value){case"query":return ni.QUERY;case"mutation":return ni.MUTATION;case"subscription":return ni.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(be.PAREN_L,this.parseVariableDefinition,be.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:ne.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(be.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(be.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(be.DOLLAR),this.node(e,{kind:ne.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:ne.SELECTION_SET,selections:this.many(be.BRACE_L,this.parseSelection,be.BRACE_R)})}parseSelection(){return this.peek(be.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,n=this.parseName();let r,i;return this.expectOptionalToken(be.COLON)?(r=n,i=this.parseName()):i=n,this.node(e,{kind:ne.FIELD,alias:r,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(be.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const n=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(be.PAREN_L,n,be.PAREN_R)}parseArgument(e=!1){const n=this._lexer.token,r=this.parseName();return this.expectToken(be.COLON),this.node(n,{kind:ne.ARGUMENT,name:r,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(be.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(be.NAME)?this.node(e,{kind:ne.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:ne.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(e,{kind:ne.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:ne.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(e){const n=this._lexer.token;switch(n.kind){case be.BRACKET_L:return this.parseList(e);case be.BRACE_L:return this.parseObject(e);case be.INT:return this.advanceLexer(),this.node(n,{kind:ne.INT,value:n.value});case be.FLOAT:return this.advanceLexer(),this.node(n,{kind:ne.FLOAT,value:n.value});case be.STRING:case be.BLOCK_STRING:return this.parseStringLiteral();case be.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:ne.BOOLEAN,value:!0});case"false":return this.node(n,{kind:ne.BOOLEAN,value:!1});case"null":return this.node(n,{kind:ne.NULL});default:return this.node(n,{kind:ne.ENUM,value:n.value})}case be.DOLLAR:if(e)if(this.expectToken(be.DOLLAR),this._lexer.token.kind===be.NAME){const r=this._lexer.token.value;throw Bn(this._lexer.source,n.start,`Unexpected variable "$${r}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:ne.STRING,value:e.value,block:e.kind===be.BLOCK_STRING})}parseList(e){const n=()=>this.parseValueLiteral(e);return this.node(this._lexer.token,{kind:ne.LIST,values:this.any(be.BRACKET_L,n,be.BRACKET_R)})}parseObject(e){const n=()=>this.parseObjectField(e);return this.node(this._lexer.token,{kind:ne.OBJECT,fields:this.any(be.BRACE_L,n,be.BRACE_R)})}parseObjectField(e){const n=this._lexer.token,r=this.parseName();return this.expectToken(be.COLON),this.node(n,{kind:ne.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e)})}parseDirectives(e){const n=[];for(;this.peek(be.AT);)n.push(this.parseDirective(e));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const n=this._lexer.token;return this.expectToken(be.AT),this.node(n,{kind:ne.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let n;if(this.expectOptionalToken(be.BRACKET_L)){const r=this.parseTypeReference();this.expectToken(be.BRACKET_R),n=this.node(e,{kind:ne.LIST_TYPE,type:r})}else n=this.parseNamedType();return this.expectOptionalToken(be.BANG)?this.node(e,{kind:ne.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:ne.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(be.STRING)||this.peek(be.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const r=this.parseConstDirectives(),i=this.many(be.BRACE_L,this.parseOperationTypeDefinition,be.BRACE_R);return this.node(e,{kind:ne.SCHEMA_DEFINITION,description:n,directives:r,operationTypes:i})}parseOperationTypeDefinition(){const e=this._lexer.token,n=this.parseOperationType();this.expectToken(be.COLON);const r=this.parseNamedType();return this.node(e,{kind:ne.OPERATION_TYPE_DEFINITION,operation:n,type:r})}parseScalarTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const r=this.parseName(),i=this.parseConstDirectives();return this.node(e,{kind:ne.SCALAR_TYPE_DEFINITION,description:n,name:r,directives:i})}parseObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const r=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:ne.OBJECT_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:s,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(be.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(be.BRACE_L,this.parseFieldDefinition,be.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,n=this.parseDescription(),r=this.parseName(),i=this.parseArgumentDefs();this.expectToken(be.COLON);const s=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:ne.FIELD_DEFINITION,description:n,name:r,arguments:i,type:s,directives:o})}parseArgumentDefs(){return this.optionalMany(be.PAREN_L,this.parseInputValueDef,be.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,n=this.parseDescription(),r=this.parseName();this.expectToken(be.COLON);const i=this.parseTypeReference();let s;this.expectOptionalToken(be.EQUALS)&&(s=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:ne.INPUT_VALUE_DEFINITION,description:n,name:r,type:i,defaultValue:s,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const r=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:ne.INTERFACE_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:s,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const r=this.parseName(),i=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(e,{kind:ne.UNION_TYPE_DEFINITION,description:n,name:r,directives:i,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(be.EQUALS)?this.delimitedMany(be.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const r=this.parseName(),i=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(e,{kind:ne.ENUM_TYPE_DEFINITION,description:n,name:r,directives:i,values:s})}parseEnumValuesDefinition(){return this.optionalMany(be.BRACE_L,this.parseEnumValueDefinition,be.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,n=this.parseDescription(),r=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(e,{kind:ne.ENUM_VALUE_DEFINITION,description:n,name:r,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw Bn(this._lexer.source,this._lexer.token.start,`${fh(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const r=this.parseName(),i=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(e,{kind:ne.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:r,directives:i,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(be.BRACE_L,this.parseInputValueDef,be.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===be.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.optionalMany(be.BRACE_L,this.parseOperationTypeDefinition,be.BRACE_R);if(n.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:ne.SCHEMA_EXTENSION,directives:n,operationTypes:r})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();if(r.length===0)throw this.unexpected();return this.node(e,{kind:ne.SCALAR_TYPE_EXTENSION,name:n,directives:r})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:ne.OBJECT_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:s})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:ne.INTERFACE_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:s})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:ne.UNION_TYPE_EXTENSION,name:n,directives:r,types:i})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:ne.ENUM_TYPE_EXTENSION,name:n,directives:r,values:i})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:ne.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:r,fields:i})}parseDirectiveDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(be.AT);const r=this.parseName(),i=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:ne.DIRECTIVE_DEFINITION,description:n,name:r,arguments:i,repeatable:s,locations:o})}parseDirectiveLocations(){return this.delimitedMany(be.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(nt,n.value))return n;throw this.unexpected(e)}node(e,n){return this._options.noLocation!==!0&&(n.loc=new ez(e,this._lexer.lastToken,this._lexer.source)),n}peek(e){return this._lexer.token.kind===e}expectToken(e){const n=this._lexer.token;if(n.kind===e)return this.advanceLexer(),n;throw Bn(this._lexer.source,n.start,`Expected ${dk(e)}, found ${fh(n)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e?(this.advanceLexer(),!0):!1}expectKeyword(e){const n=this._lexer.token;if(n.kind===be.NAME&&n.value===e)this.advanceLexer();else throw Bn(this._lexer.source,n.start,`Expected "${e}", found ${fh(n)}.`)}expectOptionalKeyword(e){const n=this._lexer.token;return n.kind===be.NAME&&n.value===e?(this.advanceLexer(),!0):!1}unexpected(e){const n=e??this._lexer.token;return Bn(this._lexer.source,n.start,`Unexpected ${fh(n)}.`)}any(e,n,r){this.expectToken(e);const i=[];for(;!this.expectOptionalToken(r);)i.push(n.call(this));return i}optionalMany(e,n,r){if(this.expectOptionalToken(e)){const i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}return[]}many(e,n,r){this.expectToken(e);const i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}delimitedMany(e,n){this.expectOptionalToken(e);const r=[];do r.push(n.call(this));while(this.expectOptionalToken(e));return r}advanceLexer(){const{maxTokens:e}=this._options,n=this._lexer.advance();if(n.kind!==be.EOF&&(++this._tokenCounter,e!==void 0&&this._tokenCounter>e))throw Bn(this._lexer.source,n.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function fh(t){const e=t.value;return dk(t.kind)+(e!=null?` "${e}"`:"")}function dk(t){return oz(t)?`"${t}"`:t}const Tz=5;function zo(t,e){const[n,r]=e?[t,e]:[void 0,t];let i=" Did you mean ";n&&(i+=n+" ");const s=r.map(c=>`"${c}"`);switch(s.length){case 0:return"";case 1:return i+s[0]+"?";case 2:return i+s[0]+" or "+s[1]+"?"}const o=s.slice(0,Tz),a=o.pop();return i+o.join(", ")+", or "+a+"?"}function DS(t){return t}function za(t,e){const n=Object.create(null);for(const r of t)n[e(r)]=r;return n}function J_(t,e,n){const r=Object.create(null);for(const i of t)r[e(i)]=n(i);return r}function As(t,e){const n=Object.create(null);for(const r of Object.keys(t))n[r]=e(t[r],r);return n}function X_(t,e){let n=0,r=0;for(;n<t.length&&r<e.length;){let i=t.charCodeAt(n),s=e.charCodeAt(r);if(hh(i)&&hh(s)){let o=0;do++n,o=o*10+i-Pv,i=t.charCodeAt(n);while(hh(i)&&o>0);let a=0;do++r,a=a*10+s-Pv,s=e.charCodeAt(r);while(hh(s)&&a>0);if(o<a)return-1;if(o>a)return 1}else{if(i<s)return-1;if(i>s)return 1;++n,++r}}return t.length-e.length}const Pv=48,Iz=57;function hh(t){return!isNaN(t)&&Pv<=t&&t<=Iz}function cc(t,e){const n=Object.create(null),r=new Oz(t),i=Math.floor(t.length*.4)+1;for(const s of e){const o=r.measure(s,i);o!==void 0&&(n[s]=o)}return Object.keys(n).sort((s,o)=>{const a=n[s]-n[o];return a!==0?a:X_(s,o)})}class Oz{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=RS(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,n){if(this._input===e)return 0;const r=e.toLowerCase();if(this._inputLowerCase===r)return 1;let i=RS(r),s=this._inputArray;if(i.length<s.length){const l=i;i=s,s=l}const o=i.length,a=s.length;if(o-a>n)return;const c=this._rows;for(let l=0;l<=a;l++)c[0][l]=l;for(let l=1;l<=o;l++){const d=c[(l-1)%3],f=c[l%3];let h=f[0]=l;for(let m=1;m<=a;m++){const p=i[l-1]===s[m-1]?0:1;let g=Math.min(d[m]+1,f[m-1]+1,d[m-1]+p);if(l>1&&m>1&&i[l-1]===s[m-2]&&i[l-2]===s[m-1]){const y=c[(l-2)%3][m-2];g=Math.min(g,y+1)}g<h&&(h=g),f[m]=g}if(h>n)return}const u=c[o%3][a];return u<=n?u:void 0}}function RS(t){const e=t.length,n=new Array(e);for(let r=0;r<e;++r)n[r]=t.charCodeAt(r);return n}function oi(t){if(t==null)return Object.create(null);if(Object.getPrototypeOf(t)===null)return t;const e=Object.create(null);for(const[n,r]of Object.entries(t))e[n]=r;return e}function Cz(t){return`"${t.replace(kz,Dz)}"`}const kz=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Dz(t){return Rz[t.charCodeAt(0)]}const Rz=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],Cl=Object.freeze({});function fk(t,e,n=rk){const r=new Map;for(const y of Object.values(ne))r.set(y,hk(e,y));let i,s=Array.isArray(t),o=[t],a=-1,c=[],u=t,l,d;const f=[],h=[];do{a++;const y=a===o.length,v=y&&c.length!==0;if(y){if(l=h.length===0?void 0:f[f.length-1],u=d,d=h.pop(),v)if(s){u=u.slice();let E=0;for(const[w,x]of c){const _=w-E;x===null?(u.splice(_,1),E++):u[_]=x}}else{u=Object.defineProperties({},Object.getOwnPropertyDescriptors(u));for(const[E,w]of c)u[E]=w}a=i.index,o=i.keys,c=i.edits,s=i.inArray,i=i.prev}else if(d){if(l=s?a:o[a],u=d[l],u==null)continue;f.push(l)}let b;if(!Array.isArray(u)){var m,p;CS(u)||Gt(!1,`Invalid AST Node: ${Qe(u)}.`);const E=y?(m=r.get(u.kind))===null||m===void 0?void 0:m.leave:(p=r.get(u.kind))===null||p===void 0?void 0:p.enter;if(b=E==null?void 0:E.call(e,u,l,d,f,h),b===Cl)break;if(b===!1){if(!y){f.pop();continue}}else if(b!==void 0&&(c.push([l,b]),!y))if(CS(b))u=b;else{f.pop();continue}}if(b===void 0&&v&&c.push([l,u]),y)f.pop();else{var g;i={inArray:s,index:a,keys:o,edits:c,prev:i},s=Array.isArray(u),o=s?u:(g=n[u.kind])!==null&&g!==void 0?g:[],a=-1,c=[],d&&h.push(d),d=u}}while(i!==void 0);return c.length!==0?c[c.length-1][1]:t}function Nz(t){const e=new Array(t.length).fill(null),n=Object.create(null);for(const r of Object.values(ne)){let i=!1;const s=new Array(t.length).fill(void 0),o=new Array(t.length).fill(void 0);for(let c=0;c<t.length;++c){const{enter:u,leave:l}=hk(t[c],r);i||(i=u!=null||l!=null),s[c]=u,o[c]=l}if(!i)continue;const a={enter(...c){const u=c[0];for(let d=0;d<t.length;d++)if(e[d]===null){var l;const f=(l=s[d])===null||l===void 0?void 0:l.apply(t[d],c);if(f===!1)e[d]=u;else if(f===Cl)e[d]=Cl;else if(f!==void 0)return f}},leave(...c){const u=c[0];for(let d=0;d<t.length;d++)if(e[d]===null){var l;const f=(l=o[d])===null||l===void 0?void 0:l.apply(t[d],c);if(f===Cl)e[d]=Cl;else if(f!==void 0&&f!==!1)return f}else e[d]===u&&(e[d]=null)}};n[r]=a}return n}function hk(t,e){const n=t[e];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:t.enter,leave:t.leave}}function jn(t){return fk(t,Pz)}const Az=80,Pz={Name:{leave:t=>t.value},Variable:{leave:t=>"$"+t.name},Document:{leave:t=>ze(t.definitions,`
116
-
117
- `)},OperationDefinition:{leave(t){const e=At("(",ze(t.variableDefinitions,", "),")"),n=ze([t.operation,ze([t.name,e]),ze(t.directives," ")]," ");return(n==="query"?"":n+" ")+t.selectionSet}},VariableDefinition:{leave:({variable:t,type:e,defaultValue:n,directives:r})=>t+": "+e+At(" = ",n)+At(" ",ze(r," "))},SelectionSet:{leave:({selections:t})=>ui(t)},Field:{leave({alias:t,name:e,arguments:n,directives:r,selectionSet:i}){const s=At("",t,": ")+e;let o=s+At("(",ze(n,", "),")");return o.length>Az&&(o=s+At(`(
118
- `,Wh(ze(n,`
119
- `)),`
120
- )`)),ze([o,ze(r," "),i]," ")}},Argument:{leave:({name:t,value:e})=>t+": "+e},FragmentSpread:{leave:({name:t,directives:e})=>"..."+t+At(" ",ze(e," "))},InlineFragment:{leave:({typeCondition:t,directives:e,selectionSet:n})=>ze(["...",At("on ",t),ze(e," "),n]," ")},FragmentDefinition:{leave:({name:t,typeCondition:e,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${t}${At("(",ze(n,", "),")")} on ${e} ${At("",ze(r," ")," ")}`+i},IntValue:{leave:({value:t})=>t},FloatValue:{leave:({value:t})=>t},StringValue:{leave:({value:t,block:e})=>e?iz(t):Cz(t)},BooleanValue:{leave:({value:t})=>t?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:t})=>t},ListValue:{leave:({values:t})=>"["+ze(t,", ")+"]"},ObjectValue:{leave:({fields:t})=>"{"+ze(t,", ")+"}"},ObjectField:{leave:({name:t,value:e})=>t+": "+e},Directive:{leave:({name:t,arguments:e})=>"@"+t+At("(",ze(e,", "),")")},NamedType:{leave:({name:t})=>t},ListType:{leave:({type:t})=>"["+t+"]"},NonNullType:{leave:({type:t})=>t+"!"},SchemaDefinition:{leave:({description:t,directives:e,operationTypes:n})=>At("",t,`
121
- `)+ze(["schema",ze(e," "),ui(n)]," ")},OperationTypeDefinition:{leave:({operation:t,type:e})=>t+": "+e},ScalarTypeDefinition:{leave:({description:t,name:e,directives:n})=>At("",t,`
122
- `)+ze(["scalar",e,ze(n," ")]," ")},ObjectTypeDefinition:{leave:({description:t,name:e,interfaces:n,directives:r,fields:i})=>At("",t,`
123
- `)+ze(["type",e,At("implements ",ze(n," & ")),ze(r," "),ui(i)]," ")},FieldDefinition:{leave:({description:t,name:e,arguments:n,type:r,directives:i})=>At("",t,`
124
- `)+e+(NS(n)?At(`(
125
- `,Wh(ze(n,`
126
- `)),`
127
- )`):At("(",ze(n,", "),")"))+": "+r+At(" ",ze(i," "))},InputValueDefinition:{leave:({description:t,name:e,type:n,defaultValue:r,directives:i})=>At("",t,`
128
- `)+ze([e+": "+n,At("= ",r),ze(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:t,name:e,interfaces:n,directives:r,fields:i})=>At("",t,`
129
- `)+ze(["interface",e,At("implements ",ze(n," & ")),ze(r," "),ui(i)]," ")},UnionTypeDefinition:{leave:({description:t,name:e,directives:n,types:r})=>At("",t,`
130
- `)+ze(["union",e,ze(n," "),At("= ",ze(r," | "))]," ")},EnumTypeDefinition:{leave:({description:t,name:e,directives:n,values:r})=>At("",t,`
131
- `)+ze(["enum",e,ze(n," "),ui(r)]," ")},EnumValueDefinition:{leave:({description:t,name:e,directives:n})=>At("",t,`
132
- `)+ze([e,ze(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:t,name:e,directives:n,fields:r})=>At("",t,`
133
- `)+ze(["input",e,ze(n," "),ui(r)]," ")},DirectiveDefinition:{leave:({description:t,name:e,arguments:n,repeatable:r,locations:i})=>At("",t,`
134
- `)+"directive @"+e+(NS(n)?At(`(
135
- `,Wh(ze(n,`
136
- `)),`
137
- )`):At("(",ze(n,", "),")"))+(r?" repeatable":"")+" on "+ze(i," | ")},SchemaExtension:{leave:({directives:t,operationTypes:e})=>ze(["extend schema",ze(t," "),ui(e)]," ")},ScalarTypeExtension:{leave:({name:t,directives:e})=>ze(["extend scalar",t,ze(e," ")]," ")},ObjectTypeExtension:{leave:({name:t,interfaces:e,directives:n,fields:r})=>ze(["extend type",t,At("implements ",ze(e," & ")),ze(n," "),ui(r)]," ")},InterfaceTypeExtension:{leave:({name:t,interfaces:e,directives:n,fields:r})=>ze(["extend interface",t,At("implements ",ze(e," & ")),ze(n," "),ui(r)]," ")},UnionTypeExtension:{leave:({name:t,directives:e,types:n})=>ze(["extend union",t,ze(e," "),At("= ",ze(n," | "))]," ")},EnumTypeExtension:{leave:({name:t,directives:e,values:n})=>ze(["extend enum",t,ze(e," "),ui(n)]," ")},InputObjectTypeExtension:{leave:({name:t,directives:e,fields:n})=>ze(["extend input",t,ze(e," "),ui(n)]," ")}};function ze(t,e=""){var n;return(n=t==null?void 0:t.filter(r=>r).join(e))!==null&&n!==void 0?n:""}function ui(t){return At(`{
138
- `,Wh(ze(t,`
139
- `)),`
140
- }`)}function At(t,e,n=""){return e!=null&&e!==""?t+e+n:""}function Wh(t){return At(" ",t.replace(/\n/g,`
141
- `))}function NS(t){var e;return(e=t==null?void 0:t.some(n=>n.includes(`
142
- `)))!==null&&e!==void 0?e:!1}function Mv(t,e){switch(t.kind){case ne.NULL:return null;case ne.INT:return parseInt(t.value,10);case ne.FLOAT:return parseFloat(t.value);case ne.STRING:case ne.ENUM:case ne.BOOLEAN:return t.value;case ne.LIST:return t.values.map(n=>Mv(n,e));case ne.OBJECT:return J_(t.fields,n=>n.name.value,n=>Mv(n.value,e));case ne.VARIABLE:return e==null?void 0:e[t.name.value]}}function Mi(t){if(t!=null||Gt(!1,"Must provide name."),typeof t=="string"||Gt(!1,"Expected name to be a string."),t.length===0)throw new Ie("Expected name to be a non-empty string.");for(let e=1;e<t.length;++e)if(!sk(t.charCodeAt(e)))throw new Ie(`Names must only contain [_a-zA-Z0-9] but "${t}" does not.`);if(!K_(t.charCodeAt(0)))throw new Ie(`Names must start with [_a-zA-Z] but "${t}" does not.`);return t}function Mz(t){if(t==="true"||t==="false"||t==="null")throw new Ie(`Enum values cannot be named: ${t}`);return Mi(t)}function Q_(t){return Wu(t)||yr(t)||Wn(t)||Ws(t)||qs(t)||Vr(t)||Hr(t)||ln(t)}function Wu(t){return ms(t,Gs)}function yr(t){return ms(t,ri)}function Wn(t){return ms(t,Lv)}function Ws(t){return ms(t,Kc)}function qs(t){return ms(t,Ld)}function Vr(t){return ms(t,Fv)}function Hr(t){return ms(t,pr)}function ln(t){return ms(t,It)}function pk(t){return Wu(t)||qs(t)||Vr(t)||mk(t)&&pk(t.ofType)}function wu(t){return Wu(t)||qs(t)}function Md(t){return yr(t)||Wn(t)||Ws(t)}function Ia(t){return Wn(t)||Ws(t)}class pr{constructor(e){Q_(e)||Gt(!1,`Expected ${Qe(e)} to be a GraphQL type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class It{constructor(e){Lz(e)||Gt(!1,`Expected ${Qe(e)} to be a GraphQL nullable type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function mk(t){return Hr(t)||ln(t)}function Lz(t){return Q_(t)&&!ln(t)}function Fz(t){if(t)return ln(t)?t.ofType:t}function Va(t){if(t){let e=t;for(;mk(e);)e=e.ofType;return e}}function gk(t){return typeof t=="function"?t():t}function yk(t){return typeof t=="function"?t():t}class Gs{constructor(e){var n,r,i,s;const o=(n=e.parseValue)!==null&&n!==void 0?n:DS;this.name=Mi(e.name),this.description=e.description,this.specifiedByURL=e.specifiedByURL,this.serialize=(r=e.serialize)!==null&&r!==void 0?r:DS,this.parseValue=o,this.parseLiteral=(i=e.parseLiteral)!==null&&i!==void 0?i:(a,c)=>o(Mv(a,c)),this.extensions=oi(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(s=e.extensionASTNodes)!==null&&s!==void 0?s:[],e.specifiedByURL==null||typeof e.specifiedByURL=="string"||Gt(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${Qe(e.specifiedByURL)}.`),e.serialize==null||typeof e.serialize=="function"||Gt(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),e.parseLiteral&&(typeof e.parseValue=="function"&&typeof e.parseLiteral=="function"||Gt(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class ri{constructor(e){var n;this.name=Mi(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=oi(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=()=>bk(e),this._interfaces=()=>vk(e),e.isTypeOf==null||typeof e.isTypeOf=="function"||Gt(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${Qe(e.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:wk(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function vk(t){var e;const n=gk((e=t.interfaces)!==null&&e!==void 0?e:[]);return Array.isArray(n)||Gt(!1,`${t.name} interfaces must be an Array or a function which returns an Array.`),n}function bk(t){const e=yk(t.fields);return Yc(e)||Gt(!1,`${t.name} fields must be an object with field names as keys or a function which returns such an object.`),As(e,(n,r)=>{var i;Yc(n)||Gt(!1,`${t.name}.${r} field config must be an object.`),n.resolve==null||typeof n.resolve=="function"||Gt(!1,`${t.name}.${r} field resolver must be a function if provided, but got: ${Qe(n.resolve)}.`);const s=(i=n.args)!==null&&i!==void 0?i:{};return Yc(s)||Gt(!1,`${t.name}.${r} args must be an object with argument names as keys.`),{name:Mi(r),description:n.description,type:n.type,args:_k(s),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:oi(n.extensions),astNode:n.astNode}})}function _k(t){return Object.entries(t).map(([e,n])=>({name:Mi(e),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:oi(n.extensions),astNode:n.astNode}))}function Yc(t){return Ua(t)&&!Array.isArray(t)}function wk(t){return As(t,e=>({description:e.description,type:e.type,args:Ek(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function Ek(t){return J_(t,e=>e.name,e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function Sk(t){return ln(t.type)&&t.defaultValue===void 0}class Lv{constructor(e){var n;this.name=Mi(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=oi(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=bk.bind(void 0,e),this._interfaces=vk.bind(void 0,e),e.resolveType==null||typeof e.resolveType=="function"||Gt(!1,`${this.name} must provide "resolveType" as a function, but got: ${Qe(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:wk(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class Kc{constructor(e){var n;this.name=Mi(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=oi(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._types=$z.bind(void 0,e),e.resolveType==null||typeof e.resolveType=="function"||Gt(!1,`${this.name} must provide "resolveType" as a function, but got: ${Qe(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function $z(t){const e=gk(t.types);return Array.isArray(e)||Gt(!1,`Must provide Array of types or a function which returns such an array for Union ${t.name}.`),e}class Ld{constructor(e){var n;this.name=Mi(e.name),this.description=e.description,this.extensions=oi(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._values=typeof e.values=="function"?e.values:AS(this.name,e.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return typeof this._values=="function"&&(this._values=AS(this.name,this._values())),this._values}getValue(e){return this._nameLookup===null&&(this._nameLookup=za(this.getValues(),n=>n.name)),this._nameLookup[e]}serialize(e){this._valueLookup===null&&(this._valueLookup=new Map(this.getValues().map(r=>[r.value,r])));const n=this._valueLookup.get(e);if(n===void 0)throw new Ie(`Enum "${this.name}" cannot represent value: ${Qe(e)}`);return n.name}parseValue(e){if(typeof e!="string"){const r=Qe(e);throw new Ie(`Enum "${this.name}" cannot represent non-string value: ${r}.`+ph(this,r))}const n=this.getValue(e);if(n==null)throw new Ie(`Value "${e}" does not exist in "${this.name}" enum.`+ph(this,e));return n.value}parseLiteral(e,n){if(e.kind!==ne.ENUM){const i=jn(e);throw new Ie(`Enum "${this.name}" cannot represent non-enum value: ${i}.`+ph(this,i),{nodes:e})}const r=this.getValue(e.value);if(r==null){const i=jn(e);throw new Ie(`Value "${i}" does not exist in "${this.name}" enum.`+ph(this,i),{nodes:e})}return r.value}toConfig(){const e=J_(this.getValues(),n=>n.name,n=>({description:n.description,value:n.value,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function ph(t,e){const n=t.getValues().map(i=>i.name),r=cc(e,n);return zo("the enum value",r)}function AS(t,e){return Yc(e)||Gt(!1,`${t} values must be an object with value names as keys.`),Object.entries(e).map(([n,r])=>(Yc(r)||Gt(!1,`${t}.${n} must refer to an object with a "value" key representing an internal value but got: ${Qe(r)}.`),{name:Mz(n),description:r.description,value:r.value!==void 0?r.value:n,deprecationReason:r.deprecationReason,extensions:oi(r.extensions),astNode:r.astNode}))}class Fv{constructor(e){var n,r;this.name=Mi(e.name),this.description=e.description,this.extensions=oi(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this.isOneOf=(r=e.isOneOf)!==null&&r!==void 0?r:!1,this._fields=jz.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){const e=As(this.getFields(),n=>({description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function jz(t){const e=yk(t.fields);return Yc(e)||Gt(!1,`${t.name} fields must be an object with field names as keys or a function which returns such an object.`),As(e,(n,r)=>(!("resolve"in n)||Gt(!1,`${t.name}.${r} field has a resolve property, but Input Types cannot define resolvers.`),{name:Mi(r),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:oi(n.extensions),astNode:n.astNode}))}function Uz(t){return ln(t.type)&&t.defaultValue===void 0}function Bl(t,e,n){return e===n?!0:ln(n)?ln(e)?Bl(t,e.ofType,n.ofType):!1:ln(e)?Bl(t,e.ofType,n):Hr(n)?Hr(e)?Bl(t,e.ofType,n.ofType):!1:Hr(e)?!1:Ia(n)&&(Wn(e)||yr(e))&&t.isSubType(n,e)}function PS(t,e,n){return e===n?!0:Ia(e)?Ia(n)?t.getPossibleTypes(e).some(r=>t.isSubType(n,r)):t.isSubType(e,n):Ia(n)?t.isSubType(n,e):!1}const Sy=2147483647,xy=-2147483648,Bz=new Gs({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(t){const e=Sf(t);if(typeof e=="boolean")return e?1:0;let n=e;if(typeof e=="string"&&e!==""&&(n=Number(e)),typeof n!="number"||!Number.isInteger(n))throw new Ie(`Int cannot represent non-integer value: ${Qe(e)}`);if(n>Sy||n<xy)throw new Ie("Int cannot represent non 32-bit signed integer value: "+Qe(e));return n},parseValue(t){if(typeof t!="number"||!Number.isInteger(t))throw new Ie(`Int cannot represent non-integer value: ${Qe(t)}`);if(t>Sy||t<xy)throw new Ie(`Int cannot represent non 32-bit signed integer value: ${t}`);return t},parseLiteral(t){if(t.kind!==ne.INT)throw new Ie(`Int cannot represent non-integer value: ${jn(t)}`,{nodes:t});const e=parseInt(t.value,10);if(e>Sy||e<xy)throw new Ie(`Int cannot represent non 32-bit signed integer value: ${t.value}`,{nodes:t});return e}}),zz=new Gs({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(t){const e=Sf(t);if(typeof e=="boolean")return e?1:0;let n=e;if(typeof e=="string"&&e!==""&&(n=Number(e)),typeof n!="number"||!Number.isFinite(n))throw new Ie(`Float cannot represent non numeric value: ${Qe(e)}`);return n},parseValue(t){if(typeof t!="number"||!Number.isFinite(t))throw new Ie(`Float cannot represent non numeric value: ${Qe(t)}`);return t},parseLiteral(t){if(t.kind!==ne.FLOAT&&t.kind!==ne.INT)throw new Ie(`Float cannot represent non numeric value: ${jn(t)}`,t);return parseFloat(t.value)}}),Cn=new Gs({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(t){const e=Sf(t);if(typeof e=="string")return e;if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number"&&Number.isFinite(e))return e.toString();throw new Ie(`String cannot represent value: ${Qe(t)}`)},parseValue(t){if(typeof t!="string")throw new Ie(`String cannot represent a non string value: ${Qe(t)}`);return t},parseLiteral(t){if(t.kind!==ne.STRING)throw new Ie(`String cannot represent a non string value: ${jn(t)}`,{nodes:t});return t.value}}),jr=new Gs({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(t){const e=Sf(t);if(typeof e=="boolean")return e;if(Number.isFinite(e))return e!==0;throw new Ie(`Boolean cannot represent a non boolean value: ${Qe(e)}`)},parseValue(t){if(typeof t!="boolean")throw new Ie(`Boolean cannot represent a non boolean value: ${Qe(t)}`);return t},parseLiteral(t){if(t.kind!==ne.BOOLEAN)throw new Ie(`Boolean cannot represent a non boolean value: ${jn(t)}`,{nodes:t});return t.value}}),xk=new Gs({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(t){const e=Sf(t);if(typeof e=="string")return e;if(Number.isInteger(e))return String(e);throw new Ie(`ID cannot represent value: ${Qe(t)}`)},parseValue(t){if(typeof t=="string")return t;if(typeof t=="number"&&Number.isInteger(t))return t.toString();throw new Ie(`ID cannot represent value: ${Qe(t)}`)},parseLiteral(t){if(t.kind!==ne.STRING&&t.kind!==ne.INT)throw new Ie("ID cannot represent a non-string and non-integer value: "+jn(t),{nodes:t});return t.value}}),ew=Object.freeze([Cn,Bz,zz,jr,xk]);function Vz(t){return ew.some(({name:e})=>t.name===e)}function Sf(t){if(Ua(t)){if(typeof t.valueOf=="function"){const e=t.valueOf();if(!Ua(e))return e}if(typeof t.toJSON=="function")return t.toJSON()}return t}function Hz(t){return ms(t,Vo)}class Vo{constructor(e){var n,r;this.name=Mi(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=(n=e.isRepeatable)!==null&&n!==void 0?n:!1,this.extensions=oi(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||Gt(!1,`@${e.name} locations must be an Array.`);const i=(r=e.args)!==null&&r!==void 0?r:{};Ua(i)&&!Array.isArray(i)||Gt(!1,`@${e.name} args must be an object with argument names as keys.`),this.args=_k(i)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:Ek(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const Tk=new Vo({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[nt.FIELD,nt.FRAGMENT_SPREAD,nt.INLINE_FRAGMENT],args:{if:{type:new It(jr),description:"Included when true."}}}),Ik=new Vo({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[nt.FIELD,nt.FRAGMENT_SPREAD,nt.INLINE_FRAGMENT],args:{if:{type:new It(jr),description:"Skipped when true."}}}),Wz="No longer supported",Ok=new Vo({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[nt.FIELD_DEFINITION,nt.ARGUMENT_DEFINITION,nt.INPUT_FIELD_DEFINITION,nt.ENUM_VALUE],args:{reason:{type:Cn,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:Wz}}}),Ck=new Vo({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[nt.SCALAR],args:{url:{type:new It(Cn),description:"The URL that specifies the behavior of this scalar."}}}),kk=new Vo({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[nt.INPUT_OBJECT],args:{}}),qu=Object.freeze([Tk,Ik,Ok,Ck,kk]);function qz(t){return typeof t=="object"&&typeof(t==null?void 0:t[Symbol.iterator])=="function"}function kl(t,e){if(ln(e)){const n=kl(t,e.ofType);return(n==null?void 0:n.kind)===ne.NULL?null:n}if(t===null)return{kind:ne.NULL};if(t===void 0)return null;if(Hr(e)){const n=e.ofType;if(qz(t)){const r=[];for(const i of t){const s=kl(i,n);s!=null&&r.push(s)}return{kind:ne.LIST,values:r}}return kl(t,n)}if(Vr(e)){if(!Ua(t))return null;const n=[];for(const r of Object.values(e.getFields())){const i=kl(t[r.name],r.type);i&&n.push({kind:ne.OBJECT_FIELD,name:{kind:ne.NAME,value:r.name},value:i})}return{kind:ne.OBJECT,fields:n}}if(wu(e)){const n=e.serialize(t);if(n==null)return null;if(typeof n=="boolean")return{kind:ne.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){const r=String(n);return MS.test(r)?{kind:ne.INT,value:r}:{kind:ne.FLOAT,value:r}}if(typeof n=="string")return qs(e)?{kind:ne.ENUM,value:n}:e===xk&&MS.test(n)?{kind:ne.INT,value:n}:{kind:ne.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${Qe(n)}.`)}Ti(!1,"Unexpected input type: "+Qe(e))}const MS=/^-?(?:0|[1-9][0-9]*)$/,tw=new ri({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:Cn,resolve:t=>t.description},types:{description:"A list of all types supported by this server.",type:new It(new pr(new It(Ei))),resolve(t){return Object.values(t.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new It(Ei),resolve:t=>t.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Ei,resolve:t=>t.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Ei,resolve:t=>t.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new It(new pr(new It(Dk))),resolve:t=>t.getDirectives()}})}),Dk=new ri({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
143
-
144
- In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new It(Cn),resolve:t=>t.name},description:{type:Cn,resolve:t=>t.description},isRepeatable:{type:new It(jr),resolve:t=>t.isRepeatable},locations:{type:new It(new pr(new It(Rk))),resolve:t=>t.locations},args:{type:new It(new pr(new It(rg))),args:{includeDeprecated:{type:jr,defaultValue:!1}},resolve(t,{includeDeprecated:e}){return e?t.args:t.args.filter(n=>n.deprecationReason==null)}}})}),Rk=new Ld({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:nt.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:nt.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:nt.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:nt.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:nt.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:nt.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:nt.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:nt.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:nt.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:nt.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:nt.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:nt.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:nt.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:nt.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:nt.UNION,description:"Location adjacent to a union definition."},ENUM:{value:nt.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:nt.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:nt.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:nt.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),Ei=new ri({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new It(Pk),resolve(t){if(Wu(t))return Un.SCALAR;if(yr(t))return Un.OBJECT;if(Wn(t))return Un.INTERFACE;if(Ws(t))return Un.UNION;if(qs(t))return Un.ENUM;if(Vr(t))return Un.INPUT_OBJECT;if(Hr(t))return Un.LIST;if(ln(t))return Un.NON_NULL;Ti(!1,`Unexpected type: "${Qe(t)}".`)}},name:{type:Cn,resolve:t=>"name"in t?t.name:void 0},description:{type:Cn,resolve:t=>"description"in t?t.description:void 0},specifiedByURL:{type:Cn,resolve:t=>"specifiedByURL"in t?t.specifiedByURL:void 0},fields:{type:new pr(new It(Nk)),args:{includeDeprecated:{type:jr,defaultValue:!1}},resolve(t,{includeDeprecated:e}){if(yr(t)||Wn(t)){const n=Object.values(t.getFields());return e?n:n.filter(r=>r.deprecationReason==null)}}},interfaces:{type:new pr(new It(Ei)),resolve(t){if(yr(t)||Wn(t))return t.getInterfaces()}},possibleTypes:{type:new pr(new It(Ei)),resolve(t,e,n,{schema:r}){if(Ia(t))return r.getPossibleTypes(t)}},enumValues:{type:new pr(new It(Ak)),args:{includeDeprecated:{type:jr,defaultValue:!1}},resolve(t,{includeDeprecated:e}){if(qs(t)){const n=t.getValues();return e?n:n.filter(r=>r.deprecationReason==null)}}},inputFields:{type:new pr(new It(rg)),args:{includeDeprecated:{type:jr,defaultValue:!1}},resolve(t,{includeDeprecated:e}){if(Vr(t)){const n=Object.values(t.getFields());return e?n:n.filter(r=>r.deprecationReason==null)}}},ofType:{type:Ei,resolve:t=>"ofType"in t?t.ofType:void 0},isOneOf:{type:jr,resolve:t=>{if(Vr(t))return t.isOneOf}}})}),Nk=new ri({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new It(Cn),resolve:t=>t.name},description:{type:Cn,resolve:t=>t.description},args:{type:new It(new pr(new It(rg))),args:{includeDeprecated:{type:jr,defaultValue:!1}},resolve(t,{includeDeprecated:e}){return e?t.args:t.args.filter(n=>n.deprecationReason==null)}},type:{type:new It(Ei),resolve:t=>t.type},isDeprecated:{type:new It(jr),resolve:t=>t.deprecationReason!=null},deprecationReason:{type:Cn,resolve:t=>t.deprecationReason}})}),rg=new ri({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new It(Cn),resolve:t=>t.name},description:{type:Cn,resolve:t=>t.description},type:{type:new It(Ei),resolve:t=>t.type},defaultValue:{type:Cn,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(t){const{type:e,defaultValue:n}=t,r=kl(n,e);return r?jn(r):null}},isDeprecated:{type:new It(jr),resolve:t=>t.deprecationReason!=null},deprecationReason:{type:Cn,resolve:t=>t.deprecationReason}})}),Ak=new ri({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new It(Cn),resolve:t=>t.name},description:{type:Cn,resolve:t=>t.description},isDeprecated:{type:new It(jr),resolve:t=>t.deprecationReason!=null},deprecationReason:{type:Cn,resolve:t=>t.deprecationReason}})});var Un;(function(t){t.SCALAR="SCALAR",t.OBJECT="OBJECT",t.INTERFACE="INTERFACE",t.UNION="UNION",t.ENUM="ENUM",t.INPUT_OBJECT="INPUT_OBJECT",t.LIST="LIST",t.NON_NULL="NON_NULL"})(Un||(Un={}));const Pk=new Ld({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:Un.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:Un.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:Un.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:Un.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:Un.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:Un.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:Un.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:Un.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});new It(tw);new It(Cn);new It(Cn);const nw=Object.freeze([tw,Dk,Rk,Ei,Nk,rg,Ak,Pk]);function Gz(t){return nw.some(({name:e})=>t.name===e)}class Zz{constructor(e){var n,r;this.__validationErrors=e.assumeValid===!0?[]:void 0,Ua(e)||Gt(!1,"Must provide configuration object."),!e.types||Array.isArray(e.types)||Gt(!1,`"types" must be Array if provided but got: ${Qe(e.types)}.`),!e.directives||Array.isArray(e.directives)||Gt(!1,`"directives" must be Array if provided but got: ${Qe(e.directives)}.`),this.description=e.description,this.extensions=oi(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=(r=e.directives)!==null&&r!==void 0?r:qu;const i=new Set(e.types);if(e.types!=null)for(const s of e.types)i.delete(s),yi(s,i);this._queryType!=null&&yi(this._queryType,i),this._mutationType!=null&&yi(this._mutationType,i),this._subscriptionType!=null&&yi(this._subscriptionType,i);for(const s of this._directives)if(Hz(s))for(const o of s.args)yi(o.type,i);yi(tw,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(const s of i){if(s==null)continue;const o=s.name;if(o||Gt(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[o]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${o}".`);if(this._typeMap[o]=s,Wn(s)){for(const a of s.getInterfaces())if(Wn(a)){let c=this._implementationsMap[a.name];c===void 0&&(c=this._implementationsMap[a.name]={objects:[],interfaces:[]}),c.interfaces.push(s)}}else if(yr(s)){for(const a of s.getInterfaces())if(Wn(a)){let c=this._implementationsMap[a.name];c===void 0&&(c=this._implementationsMap[a.name]={objects:[],interfaces:[]}),c.objects.push(s)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case ni.QUERY:return this.getQueryType();case ni.MUTATION:return this.getMutationType();case ni.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return Ws(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){const n=this._implementationsMap[e.name];return n??{objects:[],interfaces:[]}}isSubType(e,n){let r=this._subTypeMap[e.name];if(r===void 0){if(r=Object.create(null),Ws(e))for(const i of e.getTypes())r[i.name]=!0;else{const i=this.getImplementations(e);for(const s of i.objects)r[s.name]=!0;for(const s of i.interfaces)r[s.name]=!0}this._subTypeMap[e.name]=r}return r[n.name]!==void 0}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find(n=>n.name===e)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}}function yi(t,e){const n=Va(t);if(!e.has(n)){if(e.add(n),Ws(n))for(const r of n.getTypes())yi(r,e);else if(yr(n)||Wn(n)){for(const r of n.getInterfaces())yi(r,e);for(const r of Object.values(n.getFields())){yi(r.type,e);for(const i of r.args)yi(i.type,e)}}else if(Vr(n))for(const r of Object.values(n.getFields()))yi(r.type,e)}return e}function ds(t,e){switch(e.kind){case ne.LIST_TYPE:{const n=ds(t,e.type);return n&&new pr(n)}case ne.NON_NULL_TYPE:{const n=ds(t,e.type);return n&&new It(n)}case ne.NAMED_TYPE:return t.getType(e.name.value)}}function Yz(t){return t.kind===ne.OPERATION_DEFINITION||t.kind===ne.FRAGMENT_DEFINITION}function Kz(t){return t.kind===ne.SCHEMA_DEFINITION||xf(t)||t.kind===ne.DIRECTIVE_DEFINITION}function xf(t){return t.kind===ne.SCALAR_TYPE_DEFINITION||t.kind===ne.OBJECT_TYPE_DEFINITION||t.kind===ne.INTERFACE_TYPE_DEFINITION||t.kind===ne.UNION_TYPE_DEFINITION||t.kind===ne.ENUM_TYPE_DEFINITION||t.kind===ne.INPUT_OBJECT_TYPE_DEFINITION}function Jz(t){return t.kind===ne.SCHEMA_EXTENSION||rw(t)}function rw(t){return t.kind===ne.SCALAR_TYPE_EXTENSION||t.kind===ne.OBJECT_TYPE_EXTENSION||t.kind===ne.INTERFACE_TYPE_EXTENSION||t.kind===ne.UNION_TYPE_EXTENSION||t.kind===ne.ENUM_TYPE_EXTENSION||t.kind===ne.INPUT_OBJECT_TYPE_EXTENSION}function Xz(t){return{Document(e){for(const n of e.definitions)if(!Yz(n)){const r=n.kind===ne.SCHEMA_DEFINITION||n.kind===ne.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';t.reportError(new Ie(`The ${r} definition is not executable.`,{nodes:n}))}return!1}}}function Qz(t){return{Field(e){const n=t.getParentType();if(n&&!t.getFieldDef()){const i=t.getSchema(),s=e.name.value;let o=zo("to use an inline fragment on",eV(i,n,s));o===""&&(o=zo(tV(n,s))),t.reportError(new Ie(`Cannot query field "${s}" on type "${n.name}".`+o,{nodes:e}))}}}}function eV(t,e,n){if(!Ia(e))return[];const r=new Set,i=Object.create(null);for(const o of t.getPossibleTypes(e))if(o.getFields()[n]){r.add(o),i[o.name]=1;for(const a of o.getInterfaces()){var s;a.getFields()[n]&&(r.add(a),i[a.name]=((s=i[a.name])!==null&&s!==void 0?s:0)+1)}}return[...r].sort((o,a)=>{const c=i[a.name]-i[o.name];return c!==0?c:Wn(o)&&t.isSubType(o,a)?-1:Wn(a)&&t.isSubType(a,o)?1:X_(o.name,a.name)}).map(o=>o.name)}function tV(t,e){if(yr(t)||Wn(t)){const n=Object.keys(t.getFields());return cc(e,n)}return[]}function nV(t){return{InlineFragment(e){const n=e.typeCondition;if(n){const r=ds(t.getSchema(),n);if(r&&!Md(r)){const i=jn(n);t.reportError(new Ie(`Fragment cannot condition on non composite type "${i}".`,{nodes:n}))}}},FragmentDefinition(e){const n=ds(t.getSchema(),e.typeCondition);if(n&&!Md(n)){const r=jn(e.typeCondition);t.reportError(new Ie(`Fragment "${e.name.value}" cannot condition on non composite type "${r}".`,{nodes:e.typeCondition}))}}}}function rV(t){return{...Mk(t),Argument(e){const n=t.getArgument(),r=t.getFieldDef(),i=t.getParentType();if(!n&&r&&i){const s=e.name.value,o=r.args.map(c=>c.name),a=cc(s,o);t.reportError(new Ie(`Unknown argument "${s}" on field "${i.name}.${r.name}".`+zo(a),{nodes:e}))}}}}function Mk(t){const e=Object.create(null),n=t.getSchema(),r=n?n.getDirectives():qu;for(const o of r)e[o.name]=o.args.map(a=>a.name);const i=t.getDocument().definitions;for(const o of i)if(o.kind===ne.DIRECTIVE_DEFINITION){var s;const a=(s=o.arguments)!==null&&s!==void 0?s:[];e[o.name.value]=a.map(c=>c.name.value)}return{Directive(o){const a=o.name.value,c=e[a];if(o.arguments&&c)for(const u of o.arguments){const l=u.name.value;if(!c.includes(l)){const d=cc(l,c);t.reportError(new Ie(`Unknown argument "${l}" on directive "@${a}".`+zo(d),{nodes:u}))}}return!1}}}function Lk(t){const e=Object.create(null),n=t.getSchema(),r=n?n.getDirectives():qu;for(const s of r)e[s.name]=s.locations;const i=t.getDocument().definitions;for(const s of i)s.kind===ne.DIRECTIVE_DEFINITION&&(e[s.name.value]=s.locations.map(o=>o.value));return{Directive(s,o,a,c,u){const l=s.name.value,d=e[l];if(!d){t.reportError(new Ie(`Unknown directive "@${l}".`,{nodes:s}));return}const f=iV(u);f&&!d.includes(f)&&t.reportError(new Ie(`Directive "@${l}" may not be used on ${f}.`,{nodes:s}))}}}function iV(t){const e=t[t.length-1];switch("kind"in e||Ti(!1),e.kind){case ne.OPERATION_DEFINITION:return sV(e.operation);case ne.FIELD:return nt.FIELD;case ne.FRAGMENT_SPREAD:return nt.FRAGMENT_SPREAD;case ne.INLINE_FRAGMENT:return nt.INLINE_FRAGMENT;case ne.FRAGMENT_DEFINITION:return nt.FRAGMENT_DEFINITION;case ne.VARIABLE_DEFINITION:return nt.VARIABLE_DEFINITION;case ne.SCHEMA_DEFINITION:case ne.SCHEMA_EXTENSION:return nt.SCHEMA;case ne.SCALAR_TYPE_DEFINITION:case ne.SCALAR_TYPE_EXTENSION:return nt.SCALAR;case ne.OBJECT_TYPE_DEFINITION:case ne.OBJECT_TYPE_EXTENSION:return nt.OBJECT;case ne.FIELD_DEFINITION:return nt.FIELD_DEFINITION;case ne.INTERFACE_TYPE_DEFINITION:case ne.INTERFACE_TYPE_EXTENSION:return nt.INTERFACE;case ne.UNION_TYPE_DEFINITION:case ne.UNION_TYPE_EXTENSION:return nt.UNION;case ne.ENUM_TYPE_DEFINITION:case ne.ENUM_TYPE_EXTENSION:return nt.ENUM;case ne.ENUM_VALUE_DEFINITION:return nt.ENUM_VALUE;case ne.INPUT_OBJECT_TYPE_DEFINITION:case ne.INPUT_OBJECT_TYPE_EXTENSION:return nt.INPUT_OBJECT;case ne.INPUT_VALUE_DEFINITION:{const n=t[t.length-3];return"kind"in n||Ti(!1),n.kind===ne.INPUT_OBJECT_TYPE_DEFINITION?nt.INPUT_FIELD_DEFINITION:nt.ARGUMENT_DEFINITION}default:Ti(!1,"Unexpected kind: "+Qe(e.kind))}}function sV(t){switch(t){case ni.QUERY:return nt.QUERY;case ni.MUTATION:return nt.MUTATION;case ni.SUBSCRIPTION:return nt.SUBSCRIPTION}}function oV(t){return{FragmentSpread(e){const n=e.name.value;t.getFragment(n)||t.reportError(new Ie(`Unknown fragment "${n}".`,{nodes:e.name}))}}}function Fk(t){const e=t.getSchema(),n=e?e.getTypeMap():Object.create(null),r=Object.create(null);for(const s of t.getDocument().definitions)xf(s)&&(r[s.name.value]=!0);const i=[...Object.keys(n),...Object.keys(r)];return{NamedType(s,o,a,c,u){const l=s.name.value;if(!n[l]&&!r[l]){var d;const f=(d=u[2])!==null&&d!==void 0?d:a,h=f!=null&&aV(f);if(h&&LS.includes(l))return;const m=cc(l,h?LS.concat(i):i);t.reportError(new Ie(`Unknown type "${l}".`+zo(m),{nodes:s}))}}}}const LS=[...ew,...nw].map(t=>t.name);function aV(t){return"kind"in t&&(Kz(t)||Jz(t))}function cV(t){let e=0;return{Document(n){e=n.definitions.filter(r=>r.kind===ne.OPERATION_DEFINITION).length},OperationDefinition(n){!n.name&&e>1&&t.reportError(new Ie("This anonymous operation must be the only defined operation.",{nodes:n}))}}}function uV(t){var e,n,r;const i=t.getSchema(),s=(e=(n=(r=i==null?void 0:i.astNode)!==null&&r!==void 0?r:i==null?void 0:i.getQueryType())!==null&&n!==void 0?n:i==null?void 0:i.getMutationType())!==null&&e!==void 0?e:i==null?void 0:i.getSubscriptionType();let o=0;return{SchemaDefinition(a){if(s){t.reportError(new Ie("Cannot define a new schema within a schema extension.",{nodes:a}));return}o>0&&t.reportError(new Ie("Must provide only one schema definition.",{nodes:a})),++o}}}const lV=3;function dV(t){function e(n,r=Object.create(null),i=0){if(n.kind===ne.FRAGMENT_SPREAD){const s=n.name.value;if(r[s]===!0)return!1;const o=t.getFragment(s);if(!o)return!1;try{return r[s]=!0,e(o,r,i)}finally{r[s]=void 0}}if(n.kind===ne.FIELD&&(n.name.value==="fields"||n.name.value==="interfaces"||n.name.value==="possibleTypes"||n.name.value==="inputFields")&&(i++,i>=lV))return!0;if("selectionSet"in n&&n.selectionSet){for(const s of n.selectionSet.selections)if(e(s,r,i))return!0}return!1}return{Field(n){if((n.name.value==="__schema"||n.name.value==="__type")&&e(n))return t.reportError(new Ie("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}function fV(t){const e=Object.create(null),n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(s){return i(s),!1}};function i(s){if(e[s.name.value])return;const o=s.name.value;e[o]=!0;const a=t.getFragmentSpreads(s.selectionSet);if(a.length!==0){r[o]=n.length;for(const c of a){const u=c.name.value,l=r[u];if(n.push(c),l===void 0){const d=t.getFragment(u);d&&i(d)}else{const d=n.slice(l),f=d.slice(0,-1).map(h=>'"'+h.name.value+'"').join(", ");t.reportError(new Ie(`Cannot spread fragment "${u}" within itself`+(f!==""?` via ${f}.`:"."),{nodes:d}))}n.pop()}r[o]=void 0}}}function hV(t){let e=Object.create(null);return{OperationDefinition:{enter(){e=Object.create(null)},leave(n){const r=t.getRecursiveVariableUsages(n);for(const{node:i}of r){const s=i.name.value;e[s]!==!0&&t.reportError(new Ie(n.name?`Variable "$${s}" is not defined by operation "${n.name.value}".`:`Variable "$${s}" is not defined.`,{nodes:[i,n]}))}}},VariableDefinition(n){e[n.variable.name.value]=!0}}}function pV(t){const e=[],n=[];return{OperationDefinition(r){return e.push(r),!1},FragmentDefinition(r){return n.push(r),!1},Document:{leave(){const r=Object.create(null);for(const i of e)for(const s of t.getRecursivelyReferencedFragments(i))r[s.name.value]=!0;for(const i of n){const s=i.name.value;r[s]!==!0&&t.reportError(new Ie(`Fragment "${s}" is never used.`,{nodes:i}))}}}}}function mV(t){let e=[];return{OperationDefinition:{enter(){e=[]},leave(n){const r=Object.create(null),i=t.getRecursiveVariableUsages(n);for(const{node:s}of i)r[s.name.value]=!0;for(const s of e){const o=s.variable.name.value;r[o]!==!0&&t.reportError(new Ie(n.name?`Variable "$${o}" is never used in operation "${n.name.value}".`:`Variable "$${o}" is never used.`,{nodes:s}))}}},VariableDefinition(n){e.push(n)}}}function iw(t){switch(t.kind){case ne.OBJECT:return{...t,fields:gV(t.fields)};case ne.LIST:return{...t,values:t.values.map(iw)};case ne.INT:case ne.FLOAT:case ne.STRING:case ne.BOOLEAN:case ne.NULL:case ne.ENUM:case ne.VARIABLE:return t}}function gV(t){return t.map(e=>({...e,value:iw(e.value)})).sort((e,n)=>X_(e.name.value,n.name.value))}function $k(t){return Array.isArray(t)?t.map(([e,n])=>`subfields "${e}" conflict because `+$k(n)).join(" and "):t}function yV(t){const e=new Bk,n=new SV,r=new Map;return{SelectionSet(i){const s=vV(t,r,e,n,t.getParentType(),i);for(const[[o,a],c,u]of s){const l=$k(a);t.reportError(new Ie(`Fields "${o}" conflict because ${l}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:c.concat(u)}))}}}}function vV(t,e,n,r,i,s){const o=[],[a,c]=Bp(t,e,i,s);if(_V(t,o,e,n,r,a),c.length!==0)for(let u=0;u<c.length;u++){jp(t,o,e,n,r,!1,a,c[u]);for(let l=u+1;l<c.length;l++)Up(t,o,e,n,r,!1,c[u],c[l])}return o}function jp(t,e,n,r,i,s,o,a){if(r.has(o,a,s))return;r.add(o,a,s);const c=t.getFragment(a);if(!c)return;const[u,l]=jv(t,n,c);if(o!==u){sw(t,e,n,r,i,s,o,u);for(const d of l)jp(t,e,n,r,i,s,o,d)}}function Up(t,e,n,r,i,s,o,a){if(o===a||i.has(o,a,s))return;i.add(o,a,s);const c=t.getFragment(o),u=t.getFragment(a);if(!c||!u)return;const[l,d]=jv(t,n,c),[f,h]=jv(t,n,u);sw(t,e,n,r,i,s,l,f);for(const m of h)Up(t,e,n,r,i,s,o,m);for(const m of d)Up(t,e,n,r,i,s,m,a)}function bV(t,e,n,r,i,s,o,a,c){const u=[],[l,d]=Bp(t,e,s,o),[f,h]=Bp(t,e,a,c);sw(t,u,e,n,r,i,l,f);for(const m of h)jp(t,u,e,n,r,i,l,m);for(const m of d)jp(t,u,e,n,r,i,f,m);for(const m of d)for(const p of h)Up(t,u,e,n,r,i,m,p);return u}function _V(t,e,n,r,i,s){for(const[o,a]of Object.entries(s))if(a.length>1)for(let c=0;c<a.length;c++)for(let u=c+1;u<a.length;u++){const l=jk(t,n,r,i,!1,o,a[c],a[u]);l&&e.push(l)}}function sw(t,e,n,r,i,s,o,a){for(const[c,u]of Object.entries(o)){const l=a[c];if(l)for(const d of u)for(const f of l){const h=jk(t,n,r,i,s,c,d,f);h&&e.push(h)}}}function jk(t,e,n,r,i,s,o,a){const[c,u,l]=o,[d,f,h]=a,m=i||c!==d&&yr(c)&&yr(d);if(!m){const b=u.name.value,E=f.name.value;if(b!==E)return[[s,`"${b}" and "${E}" are different fields`],[u],[f]];if(!wV(u,f))return[[s,"they have differing arguments"],[u],[f]]}const p=l==null?void 0:l.type,g=h==null?void 0:h.type;if(p&&g&&$v(p,g))return[[s,`they return conflicting types "${Qe(p)}" and "${Qe(g)}"`],[u],[f]];const y=u.selectionSet,v=f.selectionSet;if(y&&v){const b=bV(t,e,n,r,m,Va(p),y,Va(g),v);return EV(b,s,u,f)}}function wV(t,e){const n=t.arguments,r=e.arguments;if(n===void 0||n.length===0)return r===void 0||r.length===0;if(r===void 0||r.length===0||n.length!==r.length)return!1;const i=new Map(r.map(({name:s,value:o})=>[s.value,o]));return n.every(s=>{const o=s.value,a=i.get(s.name.value);return a===void 0?!1:FS(o)===FS(a)})}function FS(t){return jn(iw(t))}function $v(t,e){return Hr(t)?Hr(e)?$v(t.ofType,e.ofType):!0:Hr(e)?!0:ln(t)?ln(e)?$v(t.ofType,e.ofType):!0:ln(e)?!0:wu(t)||wu(e)?t!==e:!1}function Bp(t,e,n,r){const i=e.get(r);if(i)return i;const s=Object.create(null),o=Object.create(null);Uk(t,n,r,s,o);const a=[s,Object.keys(o)];return e.set(r,a),a}function jv(t,e,n){const r=e.get(n.selectionSet);if(r)return r;const i=ds(t.getSchema(),n.typeCondition);return Bp(t,e,i,n.selectionSet)}function Uk(t,e,n,r,i){for(const s of n.selections)switch(s.kind){case ne.FIELD:{const o=s.name.value;let a;(yr(e)||Wn(e))&&(a=e.getFields()[o]);const c=s.alias?s.alias.value:o;r[c]||(r[c]=[]),r[c].push([e,s,a]);break}case ne.FRAGMENT_SPREAD:i[s.name.value]=!0;break;case ne.INLINE_FRAGMENT:{const o=s.typeCondition,a=o?ds(t.getSchema(),o):e;Uk(t,a,s.selectionSet,r,i);break}}}function EV(t,e,n,r){if(t.length>0)return[[e,t.map(([i])=>i)],[n,...t.map(([,i])=>i).flat()],[r,...t.map(([,,i])=>i).flat()]]}class Bk{constructor(){this._data=new Map}has(e,n,r){var i;const s=(i=this._data.get(e))===null||i===void 0?void 0:i.get(n);return s===void 0?!1:r?!0:r===s}add(e,n,r){const i=this._data.get(e);i===void 0?this._data.set(e,new Map([[n,r]])):i.set(n,r)}}class SV{constructor(){this._orderedPairSet=new Bk}has(e,n,r){return e<n?this._orderedPairSet.has(e,n,r):this._orderedPairSet.has(n,e,r)}add(e,n,r){e<n?this._orderedPairSet.add(e,n,r):this._orderedPairSet.add(n,e,r)}}function xV(t){return{InlineFragment(e){const n=t.getType(),r=t.getParentType();if(Md(n)&&Md(r)&&!PS(t.getSchema(),n,r)){const i=Qe(r),s=Qe(n);t.reportError(new Ie(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${s}".`,{nodes:e}))}},FragmentSpread(e){const n=e.name.value,r=TV(t,n),i=t.getParentType();if(r&&i&&!PS(t.getSchema(),r,i)){const s=Qe(i),o=Qe(r);t.reportError(new Ie(`Fragment "${n}" cannot be spread here as objects of type "${s}" can never be of type "${o}".`,{nodes:e}))}}}}function TV(t,e){const n=t.getFragment(e);if(n){const r=ds(t.getSchema(),n.typeCondition);if(Md(r))return r}}function IV(t){const e=t.getSchema(),n=Object.create(null);for(const i of t.getDocument().definitions)xf(i)&&(n[i.name.value]=i);return{ScalarTypeExtension:r,ObjectTypeExtension:r,InterfaceTypeExtension:r,UnionTypeExtension:r,EnumTypeExtension:r,InputObjectTypeExtension:r};function r(i){const s=i.name.value,o=n[s],a=e==null?void 0:e.getType(s);let c;if(o?c=OV[o.kind]:a&&(c=CV(a)),c){if(c!==i.kind){const u=kV(i.kind);t.reportError(new Ie(`Cannot extend non-${u} type "${s}".`,{nodes:o?[o,i]:i}))}}else{const u=Object.keys({...n,...e==null?void 0:e.getTypeMap()}),l=cc(s,u);t.reportError(new Ie(`Cannot extend type "${s}" because it is not defined.`+zo(l),{nodes:i.name}))}}}const OV={[ne.SCALAR_TYPE_DEFINITION]:ne.SCALAR_TYPE_EXTENSION,[ne.OBJECT_TYPE_DEFINITION]:ne.OBJECT_TYPE_EXTENSION,[ne.INTERFACE_TYPE_DEFINITION]:ne.INTERFACE_TYPE_EXTENSION,[ne.UNION_TYPE_DEFINITION]:ne.UNION_TYPE_EXTENSION,[ne.ENUM_TYPE_DEFINITION]:ne.ENUM_TYPE_EXTENSION,[ne.INPUT_OBJECT_TYPE_DEFINITION]:ne.INPUT_OBJECT_TYPE_EXTENSION};function CV(t){if(Wu(t))return ne.SCALAR_TYPE_EXTENSION;if(yr(t))return ne.OBJECT_TYPE_EXTENSION;if(Wn(t))return ne.INTERFACE_TYPE_EXTENSION;if(Ws(t))return ne.UNION_TYPE_EXTENSION;if(qs(t))return ne.ENUM_TYPE_EXTENSION;if(Vr(t))return ne.INPUT_OBJECT_TYPE_EXTENSION;Ti(!1,"Unexpected type: "+Qe(t))}function kV(t){switch(t){case ne.SCALAR_TYPE_EXTENSION:return"scalar";case ne.OBJECT_TYPE_EXTENSION:return"object";case ne.INTERFACE_TYPE_EXTENSION:return"interface";case ne.UNION_TYPE_EXTENSION:return"union";case ne.ENUM_TYPE_EXTENSION:return"enum";case ne.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:Ti(!1,"Unexpected kind: "+Qe(t))}}function DV(t){return{...zk(t),Field:{leave(e){var n;const r=t.getFieldDef();if(!r)return!1;const i=new Set((n=e.arguments)===null||n===void 0?void 0:n.map(s=>s.name.value));for(const s of r.args)if(!i.has(s.name)&&Sk(s)){const o=Qe(s.type);t.reportError(new Ie(`Field "${r.name}" argument "${s.name}" of type "${o}" is required, but it was not provided.`,{nodes:e}))}}}}}function zk(t){var e;const n=Object.create(null),r=t.getSchema(),i=(e=r==null?void 0:r.getDirectives())!==null&&e!==void 0?e:qu;for(const a of i)n[a.name]=za(a.args.filter(Sk),c=>c.name);const s=t.getDocument().definitions;for(const a of s)if(a.kind===ne.DIRECTIVE_DEFINITION){var o;const c=(o=a.arguments)!==null&&o!==void 0?o:[];n[a.name.value]=za(c.filter(RV),u=>u.name.value)}return{Directive:{leave(a){const c=a.name.value,u=n[c];if(u){var l;const d=(l=a.arguments)!==null&&l!==void 0?l:[],f=new Set(d.map(h=>h.name.value));for(const[h,m]of Object.entries(u))if(!f.has(h)){const p=Q_(m.type)?Qe(m.type):jn(m.type);t.reportError(new Ie(`Directive "@${c}" argument "${h}" of type "${p}" is required, but it was not provided.`,{nodes:a}))}}}}}}function RV(t){return t.type.kind===ne.NON_NULL_TYPE&&t.defaultValue==null}function NV(t){return{Field(e){const n=t.getType(),r=e.selectionSet;if(n)if(wu(Va(n))){if(r){const i=e.name.value,s=Qe(n);t.reportError(new Ie(`Field "${i}" must not have a selection since type "${s}" has no subfields.`,{nodes:r}))}}else if(r){if(r.selections.length===0){const i=e.name.value,s=Qe(n);t.reportError(new Ie(`Field "${i}" of type "${s}" must have at least one field selected.`,{nodes:e}))}}else{const i=e.name.value,s=Qe(n);t.reportError(new Ie(`Field "${i}" of type "${s}" must have a selection of subfields. Did you mean "${i} { ... }"?`,{nodes:e}))}}}}function ha(t,e,n){if(t){if(t.kind===ne.VARIABLE){const r=t.name.value;if(n==null||n[r]===void 0)return;const i=n[r];return i===null&&ln(e)?void 0:i}if(ln(e))return t.kind===ne.NULL?void 0:ha(t,e.ofType,n);if(t.kind===ne.NULL)return null;if(Hr(e)){const r=e.ofType;if(t.kind===ne.LIST){const s=[];for(const o of t.values)if($S(o,n)){if(ln(r))return;s.push(null)}else{const a=ha(o,r,n);if(a===void 0)return;s.push(a)}return s}const i=ha(t,r,n);return i===void 0?void 0:[i]}if(Vr(e)){if(t.kind!==ne.OBJECT)return;const r=Object.create(null),i=za(t.fields,s=>s.name.value);for(const s of Object.values(e.getFields())){const o=i[s.name];if(!o||$S(o.value,n)){if(s.defaultValue!==void 0)r[s.name]=s.defaultValue;else if(ln(s.type))return;continue}const a=ha(o.value,s.type,n);if(a===void 0)return;r[s.name]=a}if(e.isOneOf){const s=Object.keys(r);if(s.length!==1||r[s[0]]===null)return}return r}if(wu(e)){let r;try{r=e.parseLiteral(t,n)}catch{return}return r===void 0?void 0:r}Ti(!1,"Unexpected input type: "+Qe(e))}}function $S(t,e){return t.kind===ne.VARIABLE&&(e==null||e[t.name.value]===void 0)}function AV(t,e,n){var r;const i={},s=(r=e.arguments)!==null&&r!==void 0?r:[],o=za(s,a=>a.name.value);for(const a of t.args){const c=a.name,u=a.type,l=o[c];if(!l){if(a.defaultValue!==void 0)i[c]=a.defaultValue;else if(ln(u))throw new Ie(`Argument "${c}" of required type "${Qe(u)}" was not provided.`,{nodes:e});continue}const d=l.value;let f=d.kind===ne.NULL;if(d.kind===ne.VARIABLE){const m=d.name.value;if(n==null||!PV(n,m)){if(a.defaultValue!==void 0)i[c]=a.defaultValue;else if(ln(u))throw new Ie(`Argument "${c}" of required type "${Qe(u)}" was provided the variable "$${m}" which was not provided a runtime value.`,{nodes:d});continue}f=n[m]==null}if(f&&ln(u))throw new Ie(`Argument "${c}" of non-null type "${Qe(u)}" must not be null.`,{nodes:d});const h=ha(d,u,n);if(h===void 0)throw new Ie(`Argument "${c}" has invalid value ${jn(d)}.`,{nodes:d});i[c]=h}return i}function Fd(t,e,n){var r;const i=(r=e.directives)===null||r===void 0?void 0:r.find(s=>s.name.value===t.name);if(i)return AV(t,i,n)}function PV(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function MV(t,e,n,r,i){const s=new Map;return Uv(t,e,n,r,i,s,new Set),s}function Uv(t,e,n,r,i,s,o){for(const a of i.selections)switch(a.kind){case ne.FIELD:{if(!Ty(n,a))continue;const c=LV(a),u=s.get(c);u!==void 0?u.push(a):s.set(c,[a]);break}case ne.INLINE_FRAGMENT:{if(!Ty(n,a)||!jS(t,a,r))continue;Uv(t,e,n,r,a.selectionSet,s,o);break}case ne.FRAGMENT_SPREAD:{const c=a.name.value;if(o.has(c)||!Ty(n,a))continue;o.add(c);const u=e[c];if(!u||!jS(t,u,r))continue;Uv(t,e,n,r,u.selectionSet,s,o);break}}}function Ty(t,e){const n=Fd(Ik,e,t);if((n==null?void 0:n.if)===!0)return!1;const r=Fd(Tk,e,t);return(r==null?void 0:r.if)!==!1}function jS(t,e,n){const r=e.typeCondition;if(!r)return!0;const i=ds(t,r);return i===n?!0:Ia(i)?t.isSubType(i,n):!1}function LV(t){return t.alias?t.alias.value:t.name.value}function FV(t){return{OperationDefinition(e){if(e.operation==="subscription"){const n=t.getSchema(),r=n.getSubscriptionType();if(r){const i=e.name?e.name.value:null,s=Object.create(null),o=t.getDocument(),a=Object.create(null);for(const u of o.definitions)u.kind===ne.FRAGMENT_DEFINITION&&(a[u.name.value]=u);const c=MV(n,a,s,r,e.selectionSet);if(c.size>1){const d=[...c.values()].slice(1).flat();t.reportError(new Ie(i!=null?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:d}))}for(const u of c.values())u[0].name.value.startsWith("__")&&t.reportError(new Ie(i!=null?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:u}))}}}}}function ow(t,e){const n=new Map;for(const r of t){const i=e(r),s=n.get(i);s===void 0?n.set(i,[r]):s.push(r)}return n}function $V(t){return{DirectiveDefinition(r){var i;const s=(i=r.arguments)!==null&&i!==void 0?i:[];return n(`@${r.name.value}`,s)},InterfaceTypeDefinition:e,InterfaceTypeExtension:e,ObjectTypeDefinition:e,ObjectTypeExtension:e};function e(r){var i;const s=r.name.value,o=(i=r.fields)!==null&&i!==void 0?i:[];for(const c of o){var a;const u=c.name.value,l=(a=c.arguments)!==null&&a!==void 0?a:[];n(`${s}.${u}`,l)}return!1}function n(r,i){const s=ow(i,o=>o.name.value);for(const[o,a]of s)a.length>1&&t.reportError(new Ie(`Argument "${r}(${o}:)" can only be defined once.`,{nodes:a.map(c=>c.name)}));return!1}}function Vk(t){return{Field:e,Directive:e};function e(n){var r;const i=(r=n.arguments)!==null&&r!==void 0?r:[],s=ow(i,o=>o.name.value);for(const[o,a]of s)a.length>1&&t.reportError(new Ie(`There can be only one argument named "${o}".`,{nodes:a.map(c=>c.name)}))}}function jV(t){const e=Object.create(null),n=t.getSchema();return{DirectiveDefinition(r){const i=r.name.value;if(n!=null&&n.getDirective(i)){t.reportError(new Ie(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));return}return e[i]?t.reportError(new Ie(`There can be only one directive named "@${i}".`,{nodes:[e[i],r.name]})):e[i]=r.name,!1}}}function Hk(t){const e=Object.create(null),n=t.getSchema(),r=n?n.getDirectives():qu;for(const a of r)e[a.name]=!a.isRepeatable;const i=t.getDocument().definitions;for(const a of i)a.kind===ne.DIRECTIVE_DEFINITION&&(e[a.name.value]=!a.repeatable);const s=Object.create(null),o=Object.create(null);return{enter(a){if(!("directives"in a)||!a.directives)return;let c;if(a.kind===ne.SCHEMA_DEFINITION||a.kind===ne.SCHEMA_EXTENSION)c=s;else if(xf(a)||rw(a)){const u=a.name.value;c=o[u],c===void 0&&(o[u]=c=Object.create(null))}else c=Object.create(null);for(const u of a.directives){const l=u.name.value;e[l]&&(c[l]?t.reportError(new Ie(`The directive "@${l}" can only be used once at this location.`,{nodes:[c[l],u]})):c[l]=u)}}}}function UV(t){const e=t.getSchema(),n=e?e.getTypeMap():Object.create(null),r=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(s){var o;const a=s.name.value;r[a]||(r[a]=Object.create(null));const c=(o=s.values)!==null&&o!==void 0?o:[],u=r[a];for(const l of c){const d=l.name.value,f=n[a];qs(f)&&f.getValue(d)?t.reportError(new Ie(`Enum value "${a}.${d}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name})):u[d]?t.reportError(new Ie(`Enum value "${a}.${d}" can only be defined once.`,{nodes:[u[d],l.name]})):u[d]=l.name}return!1}}function BV(t){const e=t.getSchema(),n=e?e.getTypeMap():Object.create(null),r=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(s){var o;const a=s.name.value;r[a]||(r[a]=Object.create(null));const c=(o=s.fields)!==null&&o!==void 0?o:[],u=r[a];for(const l of c){const d=l.name.value;zV(n[a],d)?t.reportError(new Ie(`Field "${a}.${d}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name})):u[d]?t.reportError(new Ie(`Field "${a}.${d}" can only be defined once.`,{nodes:[u[d],l.name]})):u[d]=l.name}return!1}}function zV(t,e){return yr(t)||Wn(t)||Vr(t)?t.getFields()[e]!=null:!1}function VV(t){const e=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(n){const r=n.name.value;return e[r]?t.reportError(new Ie(`There can be only one fragment named "${r}".`,{nodes:[e[r],n.name]})):e[r]=n.name,!1}}}function Wk(t){const e=[];let n=Object.create(null);return{ObjectValue:{enter(){e.push(n),n=Object.create(null)},leave(){const r=e.pop();r||Ti(!1),n=r}},ObjectField(r){const i=r.name.value;n[i]?t.reportError(new Ie(`There can be only one input field named "${i}".`,{nodes:[n[i],r.name]})):n[i]=r.name}}}function HV(t){const e=Object.create(null);return{OperationDefinition(n){const r=n.name;return r&&(e[r.value]?t.reportError(new Ie(`There can be only one operation named "${r.value}".`,{nodes:[e[r.value],r]})):e[r.value]=r),!1},FragmentDefinition:()=>!1}}function WV(t){const e=t.getSchema(),n=Object.create(null),r=e?{query:e.getQueryType(),mutation:e.getMutationType(),subscription:e.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(s){var o;const a=(o=s.operationTypes)!==null&&o!==void 0?o:[];for(const c of a){const u=c.operation,l=n[u];r[u]?t.reportError(new Ie(`Type for ${u} already defined in the schema. It cannot be redefined.`,{nodes:c})):l?t.reportError(new Ie(`There can be only one ${u} type in schema.`,{nodes:[l,c]})):n[u]=c}return!1}}function qV(t){const e=Object.create(null),n=t.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(i){const s=i.name.value;if(n!=null&&n.getType(s)){t.reportError(new Ie(`Type "${s}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name}));return}return e[s]?t.reportError(new Ie(`There can be only one type named "${s}".`,{nodes:[e[s],i.name]})):e[s]=i.name,!1}}function GV(t){return{OperationDefinition(e){var n;const r=(n=e.variableDefinitions)!==null&&n!==void 0?n:[],i=ow(r,s=>s.variable.name.value);for(const[s,o]of i)o.length>1&&t.reportError(new Ie(`There can be only one variable named "$${s}".`,{nodes:o.map(a=>a.variable.name)}))}}}function ZV(t){let e={};return{OperationDefinition:{enter(){e={}}},VariableDefinition(n){e[n.variable.name.value]=n},ListValue(n){const r=Fz(t.getParentInputType());if(!Hr(r))return ia(t,n),!1},ObjectValue(n){const r=Va(t.getInputType());if(!Vr(r))return ia(t,n),!1;const i=za(n.fields,s=>s.name.value);for(const s of Object.values(r.getFields()))if(!i[s.name]&&Uz(s)){const a=Qe(s.type);t.reportError(new Ie(`Field "${r.name}.${s.name}" of required type "${a}" was not provided.`,{nodes:n}))}r.isOneOf&&YV(t,n,r,i,e)},ObjectField(n){const r=Va(t.getParentInputType());if(!t.getInputType()&&Vr(r)){const s=cc(n.name.value,Object.keys(r.getFields()));t.reportError(new Ie(`Field "${n.name.value}" is not defined by type "${r.name}".`+zo(s),{nodes:n}))}},NullValue(n){const r=t.getInputType();ln(r)&&t.reportError(new Ie(`Expected value of type "${Qe(r)}", found ${jn(n)}.`,{nodes:n}))},EnumValue:n=>ia(t,n),IntValue:n=>ia(t,n),FloatValue:n=>ia(t,n),StringValue:n=>ia(t,n),BooleanValue:n=>ia(t,n)}}function ia(t,e){const n=t.getInputType();if(!n)return;const r=Va(n);if(!wu(r)){const i=Qe(n);t.reportError(new Ie(`Expected value of type "${i}", found ${jn(e)}.`,{nodes:e}));return}try{if(r.parseLiteral(e,void 0)===void 0){const s=Qe(n);t.reportError(new Ie(`Expected value of type "${s}", found ${jn(e)}.`,{nodes:e}))}}catch(i){const s=Qe(n);i instanceof Ie?t.reportError(i):t.reportError(new Ie(`Expected value of type "${s}", found ${jn(e)}; `+i.message,{nodes:e,originalError:i}))}}function YV(t,e,n,r,i){var s;const o=Object.keys(r);if(o.length!==1){t.reportError(new Ie(`OneOf Input Object "${n.name}" must specify exactly one key.`,{nodes:[e]}));return}const c=(s=r[o[0]])===null||s===void 0?void 0:s.value,u=!c||c.kind===ne.NULL,l=(c==null?void 0:c.kind)===ne.VARIABLE;if(u){t.reportError(new Ie(`Field "${n.name}.${o[0]}" must be non-null.`,{nodes:[e]}));return}if(l){const d=c.name.value;i[d].type.kind!==ne.NON_NULL_TYPE&&t.reportError(new Ie(`Variable "${d}" must be non-nullable to be used for OneOf Input Object "${n.name}".`,{nodes:[e]}))}}function KV(t){return{VariableDefinition(e){const n=ds(t.getSchema(),e.type);if(n!==void 0&&!pk(n)){const r=e.variable.name.value,i=jn(e.type);t.reportError(new Ie(`Variable "$${r}" cannot be non-input type "${i}".`,{nodes:e.type}))}}}}function JV(t){let e=Object.create(null);return{OperationDefinition:{enter(){e=Object.create(null)},leave(n){const r=t.getRecursiveVariableUsages(n);for(const{node:i,type:s,defaultValue:o}of r){const a=i.name.value,c=e[a];if(c&&s){const u=t.getSchema(),l=ds(u,c.type);if(l&&!XV(u,l,c.defaultValue,s,o)){const d=Qe(l),f=Qe(s);t.reportError(new Ie(`Variable "$${a}" of type "${d}" used in position expecting type "${f}".`,{nodes:[c,i]}))}}}}},VariableDefinition(n){e[n.variable.name.value]=n}}}function XV(t,e,n,r,i){if(ln(r)&&!ln(e)){if(!(n!=null&&n.kind!==ne.NULL)&&!(i!==void 0))return!1;const a=r.ofType;return Bl(t,e,a)}return Bl(t,e,r)}const QV=Object.freeze([dV]);Object.freeze([Xz,HV,cV,FV,Fk,nV,KV,NV,Qz,VV,oV,pV,xV,fV,GV,hV,mV,Lk,Hk,rV,Vk,ZV,DV,JV,yV,Wk,...QV]);const eH=Object.freeze([uV,WV,qV,UV,BV,$V,jV,Fk,Lk,Hk,IV,Mk,Vk,Wk,zk]);class tH{constructor(e,n){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let n;if(this._fragments)n=this._fragments;else{n=Object.create(null);for(const r of this.getDocument().definitions)r.kind===ne.FRAGMENT_DEFINITION&&(n[r.name.value]=r);this._fragments=n}return n[e]}getFragmentSpreads(e){let n=this._fragmentSpreads.get(e);if(!n){n=[];const r=[e];let i;for(;i=r.pop();)for(const s of i.selections)s.kind===ne.FRAGMENT_SPREAD?n.push(s):s.selectionSet&&r.push(s.selectionSet);this._fragmentSpreads.set(e,n)}return n}getRecursivelyReferencedFragments(e){let n=this._recursivelyReferencedFragments.get(e);if(!n){n=[];const r=Object.create(null),i=[e.selectionSet];let s;for(;s=i.pop();)for(const o of this.getFragmentSpreads(s)){const a=o.name.value;if(r[a]!==!0){r[a]=!0;const c=this.getFragment(a);c&&(n.push(c),i.push(c.selectionSet))}}this._recursivelyReferencedFragments.set(e,n)}return n}}class nH extends tH{constructor(e,n,r){super(e,r),this._schema=n}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}function rH(t,e,n=eH){const r=[],i=new nH(t,e,o=>{r.push(o)}),s=n.map(o=>o(i));return fk(t,Nz(s)),r}function iH(t){const e=rH(t);if(e.length!==0)throw new Error(e.map(n=>n.message).join(`
145
-
146
- `))}function sH(t,e,n){var r,i,s,o;const a=[],c=Object.create(null),u=[];let l;const d=[];for(const D of e.definitions)if(D.kind===ne.SCHEMA_DEFINITION)l=D;else if(D.kind===ne.SCHEMA_EXTENSION)d.push(D);else if(xf(D))a.push(D);else if(rw(D)){const X=D.name.value,Z=c[X];c[X]=Z?Z.concat([D]):[D]}else D.kind===ne.DIRECTIVE_DEFINITION&&u.push(D);if(Object.keys(c).length===0&&a.length===0&&u.length===0&&d.length===0&&l==null)return t;const f=Object.create(null);for(const D of t.types)f[D.name]=v(D);for(const D of a){var h;const X=D.name.value;f[X]=(h=US[X])!==null&&h!==void 0?h:j(D)}const m={query:t.query&&g(t.query),mutation:t.mutation&&g(t.mutation),subscription:t.subscription&&g(t.subscription),...l&&V([l]),...V(d)};return{description:(r=l)===null||r===void 0||(i=r.description)===null||i===void 0?void 0:i.value,...m,types:Object.values(f),directives:[...t.directives.map(y),...u.map(S)],extensions:Object.create(null),astNode:(s=l)!==null&&s!==void 0?s:t.astNode,extensionASTNodes:t.extensionASTNodes.concat(d),assumeValid:(o=n==null?void 0:n.assumeValid)!==null&&o!==void 0?o:!1};function p(D){return Hr(D)?new pr(p(D.ofType)):ln(D)?new It(p(D.ofType)):g(D)}function g(D){return f[D.name]}function y(D){const X=D.toConfig();return new Vo({...X,args:As(X.args,F)})}function v(D){if(Gz(D)||Vz(D))return D;if(Wu(D))return w(D);if(yr(D))return x(D);if(Wn(D))return _(D);if(Ws(D))return k(D);if(qs(D))return E(D);if(Vr(D))return b(D);Ti(!1,"Unexpected type: "+Qe(D))}function b(D){var X;const Z=D.toConfig(),z=(X=c[Z.name])!==null&&X!==void 0?X:[];return new Fv({...Z,fields:()=>({...As(Z.fields,le=>({...le,type:p(le.type)})),...U(z)}),extensionASTNodes:Z.extensionASTNodes.concat(z)})}function E(D){var X;const Z=D.toConfig(),z=(X=c[D.name])!==null&&X!==void 0?X:[];return new Ld({...Z,values:{...Z.values,...K(z)},extensionASTNodes:Z.extensionASTNodes.concat(z)})}function w(D){var X;const Z=D.toConfig(),z=(X=c[Z.name])!==null&&X!==void 0?X:[];let le=Z.specifiedByURL;for(const ve of z){var pe;le=(pe=BS(ve))!==null&&pe!==void 0?pe:le}return new Gs({...Z,specifiedByURL:le,extensionASTNodes:Z.extensionASTNodes.concat(z)})}function x(D){var X;const Z=D.toConfig(),z=(X=c[Z.name])!==null&&X!==void 0?X:[];return new ri({...Z,interfaces:()=>[...D.getInterfaces().map(g),...$(z)],fields:()=>({...As(Z.fields,R),...C(z)}),extensionASTNodes:Z.extensionASTNodes.concat(z)})}function _(D){var X;const Z=D.toConfig(),z=(X=c[Z.name])!==null&&X!==void 0?X:[];return new Lv({...Z,interfaces:()=>[...D.getInterfaces().map(g),...$(z)],fields:()=>({...As(Z.fields,R),...C(z)}),extensionASTNodes:Z.extensionASTNodes.concat(z)})}function k(D){var X;const Z=D.toConfig(),z=(X=c[Z.name])!==null&&X!==void 0?X:[];return new Kc({...Z,types:()=>[...D.getTypes().map(g),...q(z)],extensionASTNodes:Z.extensionASTNodes.concat(z)})}function R(D){return{...D,type:p(D.type),args:D.args&&As(D.args,F)}}function F(D){return{...D,type:p(D.type)}}function V(D){const X={};for(const z of D){var Z;const le=(Z=z.operationTypes)!==null&&Z!==void 0?Z:[];for(const pe of le)X[pe.operation]=T(pe.type)}return X}function T(D){var X;const Z=D.name.value,z=(X=US[Z])!==null&&X!==void 0?X:f[Z];if(z===void 0)throw new Error(`Unknown type: "${Z}".`);return z}function L(D){return D.kind===ne.LIST_TYPE?new pr(L(D.type)):D.kind===ne.NON_NULL_TYPE?new It(L(D.type)):T(D)}function S(D){var X;return new Vo({name:D.name.value,description:(X=D.description)===null||X===void 0?void 0:X.value,locations:D.locations.map(({value:Z})=>Z),isRepeatable:D.repeatable,args:N(D.arguments),astNode:D})}function C(D){const X=Object.create(null);for(const le of D){var Z;const pe=(Z=le.fields)!==null&&Z!==void 0?Z:[];for(const ve of pe){var z;X[ve.name.value]={type:L(ve.type),description:(z=ve.description)===null||z===void 0?void 0:z.value,args:N(ve.arguments),deprecationReason:mh(ve),astNode:ve}}}return X}function N(D){const X=D??[],Z=Object.create(null);for(const le of X){var z;const pe=L(le.type);Z[le.name.value]={type:pe,description:(z=le.description)===null||z===void 0?void 0:z.value,defaultValue:ha(le.defaultValue,pe),deprecationReason:mh(le),astNode:le}}return Z}function U(D){const X=Object.create(null);for(const le of D){var Z;const pe=(Z=le.fields)!==null&&Z!==void 0?Z:[];for(const ve of pe){var z;const je=L(ve.type);X[ve.name.value]={type:je,description:(z=ve.description)===null||z===void 0?void 0:z.value,defaultValue:ha(ve.defaultValue,je),deprecationReason:mh(ve),astNode:ve}}}return X}function K(D){const X=Object.create(null);for(const le of D){var Z;const pe=(Z=le.values)!==null&&Z!==void 0?Z:[];for(const ve of pe){var z;X[ve.name.value]={description:(z=ve.description)===null||z===void 0?void 0:z.value,deprecationReason:mh(ve),astNode:ve}}}return X}function $(D){return D.flatMap(X=>{var Z,z;return(Z=(z=X.interfaces)===null||z===void 0?void 0:z.map(T))!==null&&Z!==void 0?Z:[]})}function q(D){return D.flatMap(X=>{var Z,z;return(Z=(z=X.types)===null||z===void 0?void 0:z.map(T))!==null&&Z!==void 0?Z:[]})}function j(D){var X;const Z=D.name.value,z=(X=c[Z])!==null&&X!==void 0?X:[];switch(D.kind){case ne.OBJECT_TYPE_DEFINITION:{var le;const Ye=[D,...z];return new ri({name:Z,description:(le=D.description)===null||le===void 0?void 0:le.value,interfaces:()=>$(Ye),fields:()=>C(Ye),astNode:D,extensionASTNodes:z})}case ne.INTERFACE_TYPE_DEFINITION:{var pe;const Ye=[D,...z];return new Lv({name:Z,description:(pe=D.description)===null||pe===void 0?void 0:pe.value,interfaces:()=>$(Ye),fields:()=>C(Ye),astNode:D,extensionASTNodes:z})}case ne.ENUM_TYPE_DEFINITION:{var ve;const Ye=[D,...z];return new Ld({name:Z,description:(ve=D.description)===null||ve===void 0?void 0:ve.value,values:K(Ye),astNode:D,extensionASTNodes:z})}case ne.UNION_TYPE_DEFINITION:{var je;const Ye=[D,...z];return new Kc({name:Z,description:(je=D.description)===null||je===void 0?void 0:je.value,types:()=>q(Ye),astNode:D,extensionASTNodes:z})}case ne.SCALAR_TYPE_DEFINITION:{var ct;return new Gs({name:Z,description:(ct=D.description)===null||ct===void 0?void 0:ct.value,specifiedByURL:BS(D),astNode:D,extensionASTNodes:z})}case ne.INPUT_OBJECT_TYPE_DEFINITION:{var ut;const Ye=[D,...z];return new Fv({name:Z,description:(ut=D.description)===null||ut===void 0?void 0:ut.value,fields:()=>U(Ye),astNode:D,extensionASTNodes:z,isOneOf:oH(D)})}}}}const US=za([...ew,...nw],t=>t.name);function mh(t){const e=Fd(Ok,t);return e==null?void 0:e.reason}function BS(t){const e=Fd(Ck,t);return e==null?void 0:e.url}function oH(t){return!!Fd(kk,t)}function aH(t,e){t!=null&&t.kind===ne.DOCUMENT||Gt(!1,"Must provide valid Document AST."),(e==null?void 0:e.assumeValid)!==!0&&(e==null?void 0:e.assumeValidSDL)!==!0&&iH(t);const r=sH({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},t,e);if(r.astNode==null)for(const s of r.types)switch(s.name){case"Query":r.query=s;break;case"Mutation":r.mutation=s;break;case"Subscription":r.subscription=s;break}const i=[...r.directives,...qu.filter(s=>r.directives.every(o=>o.name!==s.name))];return new Zz({...r,directives:i})}function cH(t,e){const n=lk(t,{noLocation:void 0,allowLegacyFragmentVariables:void 0});return aH(n,{assumeValidSDL:void 0,assumeValid:void 0})}const aw=JSON,uH=t=>t.toUpperCase(),lH=t=>{const e={};return t.forEach((n,r)=>{e[r]=n}),e},dH=(t,e,n)=>t.document?t:{document:t,variables:e,requestHeaders:n,signal:void 0},fH=(t,e,n)=>t.query?t:{query:t,variables:e,requestHeaders:n,signal:void 0},hH=(t,e)=>t.documents?t:{documents:t,requestHeaders:e,signal:void 0},zS=t=>{var r,i;let e;const n=t.definitions.filter(s=>s.kind==="OperationDefinition");return n.length===1&&(e=(i=(r=n[0])==null?void 0:r.name)==null?void 0:i.value),e},Iy=t=>{if(typeof t=="string"){let n;try{const r=lk(t);n=zS(r)}catch{}return{query:t,operationName:n}}const e=zS(t);return{query:jn(t),operationName:e}};class Jc extends Error{constructor(e,n){const r=`${Jc.extractMessage(e)}: ${JSON.stringify({response:e,request:n})}`;super(r),Object.setPrototypeOf(this,Jc.prototype),this.response=e,this.request=n,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Jc)}static extractMessage(e){var n,r;return((r=(n=e.errors)==null?void 0:n[0])==null?void 0:r.message)??`GraphQL Error (Code: ${e.status})`}}var Bv={exports:{}};(function(t,e){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof rr<"u"&&rr,r=function(){function s(){this.fetch=!1,this.DOMException=n.DOMException}return s.prototype=n,new s}();(function(s){(function(o){var a=typeof s<"u"&&s||typeof self<"u"&&self||typeof rr<"u"&&rr||{},c={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function u(C){return C&&DataView.prototype.isPrototypeOf(C)}if(c.arrayBuffer)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function(C){return C&&l.indexOf(Object.prototype.toString.call(C))>-1};function f(C){if(typeof C!="string"&&(C=String(C)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(C)||C==="")throw new TypeError('Invalid character in header field name: "'+C+'"');return C.toLowerCase()}function h(C){return typeof C!="string"&&(C=String(C)),C}function m(C){var N={next:function(){var U=C.shift();return{done:U===void 0,value:U}}};return c.iterable&&(N[Symbol.iterator]=function(){return N}),N}function p(C){this.map={},C instanceof p?C.forEach(function(N,U){this.append(U,N)},this):Array.isArray(C)?C.forEach(function(N){if(N.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+N.length);this.append(N[0],N[1])},this):C&&Object.getOwnPropertyNames(C).forEach(function(N){this.append(N,C[N])},this)}p.prototype.append=function(C,N){C=f(C),N=h(N);var U=this.map[C];this.map[C]=U?U+", "+N:N},p.prototype.delete=function(C){delete this.map[f(C)]},p.prototype.get=function(C){return C=f(C),this.has(C)?this.map[C]:null},p.prototype.has=function(C){return this.map.hasOwnProperty(f(C))},p.prototype.set=function(C,N){this.map[f(C)]=h(N)},p.prototype.forEach=function(C,N){for(var U in this.map)this.map.hasOwnProperty(U)&&C.call(N,this.map[U],U,this)},p.prototype.keys=function(){var C=[];return this.forEach(function(N,U){C.push(U)}),m(C)},p.prototype.values=function(){var C=[];return this.forEach(function(N){C.push(N)}),m(C)},p.prototype.entries=function(){var C=[];return this.forEach(function(N,U){C.push([U,N])}),m(C)},c.iterable&&(p.prototype[Symbol.iterator]=p.prototype.entries);function g(C){if(!C._noBody){if(C.bodyUsed)return Promise.reject(new TypeError("Already read"));C.bodyUsed=!0}}function y(C){return new Promise(function(N,U){C.onload=function(){N(C.result)},C.onerror=function(){U(C.error)}})}function v(C){var N=new FileReader,U=y(N);return N.readAsArrayBuffer(C),U}function b(C){var N=new FileReader,U=y(N),K=/charset=([A-Za-z0-9_-]+)/.exec(C.type),$=K?K[1]:"utf-8";return N.readAsText(C,$),U}function E(C){for(var N=new Uint8Array(C),U=new Array(N.length),K=0;K<N.length;K++)U[K]=String.fromCharCode(N[K]);return U.join("")}function w(C){if(C.slice)return C.slice(0);var N=new Uint8Array(C.byteLength);return N.set(new Uint8Array(C)),N.buffer}function x(){return this.bodyUsed=!1,this._initBody=function(C){this.bodyUsed=this.bodyUsed,this._bodyInit=C,C?typeof C=="string"?this._bodyText=C:c.blob&&Blob.prototype.isPrototypeOf(C)?this._bodyBlob=C:c.formData&&FormData.prototype.isPrototypeOf(C)?this._bodyFormData=C:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(C)?this._bodyText=C.toString():c.arrayBuffer&&c.blob&&u(C)?(this._bodyArrayBuffer=w(C.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(C)||d(C))?this._bodyArrayBuffer=w(C):this._bodyText=C=Object.prototype.toString.call(C):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof C=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c.searchParams&&URLSearchParams.prototype.isPrototypeOf(C)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var C=g(this);if(C)return C;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var C=g(this);return C||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(c.blob)return this.blob().then(v);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var C=g(this);if(C)return C;if(this._bodyBlob)return b(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(E(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},c.formData&&(this.formData=function(){return this.text().then(F)}),this.json=function(){return this.text().then(JSON.parse)},this}var _=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function k(C){var N=C.toUpperCase();return _.indexOf(N)>-1?N:C}function R(C,N){if(!(this instanceof R))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');N=N||{};var U=N.body;if(C instanceof R){if(C.bodyUsed)throw new TypeError("Already read");this.url=C.url,this.credentials=C.credentials,N.headers||(this.headers=new p(C.headers)),this.method=C.method,this.mode=C.mode,this.signal=C.signal,!U&&C._bodyInit!=null&&(U=C._bodyInit,C.bodyUsed=!0)}else this.url=String(C);if(this.credentials=N.credentials||this.credentials||"same-origin",(N.headers||!this.headers)&&(this.headers=new p(N.headers)),this.method=k(N.method||this.method||"GET"),this.mode=N.mode||this.mode||null,this.signal=N.signal||this.signal||function(){if("AbortController"in a){var q=new AbortController;return q.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&U)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(U),(this.method==="GET"||this.method==="HEAD")&&(N.cache==="no-store"||N.cache==="no-cache")){var K=/([?&])_=[^&]*/;if(K.test(this.url))this.url=this.url.replace(K,"$1_="+new Date().getTime());else{var $=/\?/;this.url+=($.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}R.prototype.clone=function(){return new R(this,{body:this._bodyInit})};function F(C){var N=new FormData;return C.trim().split("&").forEach(function(U){if(U){var K=U.split("="),$=K.shift().replace(/\+/g," "),q=K.join("=").replace(/\+/g," ");N.append(decodeURIComponent($),decodeURIComponent(q))}}),N}function V(C){var N=new p,U=C.replace(/\r?\n[\t ]+/g," ");return U.split("\r").map(function(K){return K.indexOf(`
147
- `)===0?K.substr(1,K.length):K}).forEach(function(K){var $=K.split(":"),q=$.shift().trim();if(q){var j=$.join(":").trim();try{N.append(q,j)}catch(D){console.warn("Response "+D.message)}}}),N}x.call(R.prototype);function T(C,N){if(!(this instanceof T))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(N||(N={}),this.type="default",this.status=N.status===void 0?200:N.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=N.statusText===void 0?"":""+N.statusText,this.headers=new p(N.headers),this.url=N.url||"",this._initBody(C)}x.call(T.prototype),T.prototype.clone=function(){return new T(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},T.error=function(){var C=new T(null,{status:200,statusText:""});return C.ok=!1,C.status=0,C.type="error",C};var L=[301,302,303,307,308];T.redirect=function(C,N){if(L.indexOf(N)===-1)throw new RangeError("Invalid status code");return new T(null,{status:N,headers:{location:C}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(N,U){this.message=N,this.name=U;var K=Error(N);this.stack=K.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function S(C,N){return new Promise(function(U,K){var $=new R(C,N);if($.signal&&$.signal.aborted)return K(new o.DOMException("Aborted","AbortError"));var q=new XMLHttpRequest;function j(){q.abort()}q.onload=function(){var Z={statusText:q.statusText,headers:V(q.getAllResponseHeaders()||"")};$.url.indexOf("file://")===0&&(q.status<200||q.status>599)?Z.status=200:Z.status=q.status,Z.url="responseURL"in q?q.responseURL:Z.headers.get("X-Request-URL");var z="response"in q?q.response:q.responseText;setTimeout(function(){U(new T(z,Z))},0)},q.onerror=function(){setTimeout(function(){K(new TypeError("Network request failed"))},0)},q.ontimeout=function(){setTimeout(function(){K(new TypeError("Network request timed out"))},0)},q.onabort=function(){setTimeout(function(){K(new o.DOMException("Aborted","AbortError"))},0)};function D(Z){try{return Z===""&&a.location.href?a.location.href:Z}catch{return Z}}if(q.open($.method,D($.url),!0),$.credentials==="include"?q.withCredentials=!0:$.credentials==="omit"&&(q.withCredentials=!1),"responseType"in q&&(c.blob?q.responseType="blob":c.arrayBuffer&&(q.responseType="arraybuffer")),N&&typeof N.headers=="object"&&!(N.headers instanceof p||a.Headers&&N.headers instanceof a.Headers)){var X=[];Object.getOwnPropertyNames(N.headers).forEach(function(Z){X.push(f(Z)),q.setRequestHeader(Z,h(N.headers[Z]))}),$.headers.forEach(function(Z,z){X.indexOf(z)===-1&&q.setRequestHeader(z,Z)})}else $.headers.forEach(function(Z,z){q.setRequestHeader(z,Z)});$.signal&&($.signal.addEventListener("abort",j),q.onreadystatechange=function(){q.readyState===4&&$.signal.removeEventListener("abort",j)}),q.send(typeof $._bodyInit>"u"?null:$._bodyInit)})}return S.polyfill=!0,a.fetch||(a.fetch=S,a.Headers=p,a.Request=R,a.Response=T),o.Headers=p,o.Request=R,o.Response=T,o.fetch=S,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=n.fetch?n:r;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(Bv,Bv.exports);var zp=Bv.exports;const qh=ec(zp),pH=IP({__proto__:null,default:qh},[zp]),xc=t=>{let e={};return t&&(typeof Headers<"u"&&t instanceof Headers||pH&&zp.Headers&&t instanceof zp.Headers?e=lH(t):Array.isArray(t)?t.forEach(([n,r])=>{n&&r!==void 0&&(e[n]=r)}):e=t),e},VS=t=>t.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),mH=t=>{if(!Array.isArray(t.query)){const r=t,i=[`query=${encodeURIComponent(VS(r.query))}`];return t.variables&&i.push(`variables=${encodeURIComponent(r.jsonSerializer.stringify(r.variables))}`),r.operationName&&i.push(`operationName=${encodeURIComponent(r.operationName)}`),i.join("&")}if(typeof t.variables<"u"&&!Array.isArray(t.variables))throw new Error("Cannot create query with given variable type, array expected");const e=t,n=t.query.reduce((r,i,s)=>(r.push({query:VS(i),variables:e.variables?e.jsonSerializer.stringify(e.variables[s]):void 0}),r),[]);return`query=${encodeURIComponent(e.jsonSerializer.stringify(n))}`},gH=t=>async e=>{const{url:n,query:r,variables:i,operationName:s,fetch:o,fetchOptions:a,middleware:c}=e,u={...e.headers};let l="",d;t==="POST"?(d=vH(r,i,s,a.jsonSerializer),typeof d=="string"&&(u["Content-Type"]="application/json")):l=mH({query:r,variables:i,operationName:s,jsonSerializer:a.jsonSerializer??aw});const f={method:t,headers:u,body:d,...a};let h=n,m=f;if(c){const p=await Promise.resolve(c({...f,url:n,operationName:s,variables:i})),{url:g,...y}=p;h=g,m=y}return l&&(h=`${h}?${l}`),await o(h,m)};class yH{constructor(e,n={}){this.url=e,this.requestConfig=n,this.rawRequest=async(...r)=>{const[i,s,o]=r,a=fH(i,s,o),{headers:c,fetch:u=qh,method:l="POST",requestMiddleware:d,responseMiddleware:f,...h}=this.requestConfig,{url:m}=this;a.signal!==void 0&&(h.signal=a.signal);const{operationName:p}=Iy(a.query);return Oy({url:m,query:a.query,variables:a.variables,headers:{...xc(Cy(c)),...xc(a.requestHeaders)},operationName:p,fetch:u,method:l,fetchOptions:h,middleware:d}).then(g=>(f&&f(g),g)).catch(g=>{throw f&&f(g),g})}}async request(e,...n){const[r,i]=n,s=dH(e,r,i),{headers:o,fetch:a=qh,method:c="POST",requestMiddleware:u,responseMiddleware:l,...d}=this.requestConfig,{url:f}=this;s.signal!==void 0&&(d.signal=s.signal);const{query:h,operationName:m}=Iy(s.document);return Oy({url:f,query:h,variables:s.variables,headers:{...xc(Cy(o)),...xc(s.requestHeaders)},operationName:m,fetch:a,method:c,fetchOptions:d,middleware:u}).then(p=>(l&&l(p),p.data)).catch(p=>{throw l&&l(p),p})}batchRequests(e,n){const r=hH(e,n),{headers:i,...s}=this.requestConfig;r.signal!==void 0&&(s.signal=r.signal);const o=r.documents.map(({document:c})=>Iy(c).query),a=r.documents.map(({variables:c})=>c);return Oy({url:this.url,query:o,variables:a,headers:{...xc(Cy(i)),...xc(r.requestHeaders)},operationName:void 0,fetch:this.requestConfig.fetch??qh,method:this.requestConfig.method||"POST",fetchOptions:s,middleware:this.requestConfig.requestMiddleware}).then(c=>(this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(c),c.data)).catch(c=>{throw this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(c),c})}setHeaders(e){return this.requestConfig.headers=e,this}setHeader(e,n){const{headers:r}=this.requestConfig;return r?r[e]=n:this.requestConfig.headers={[e]:n},this}setEndpoint(e){return this.url=e,this}}const Oy=async t=>{const{query:e,variables:n,fetchOptions:r}=t,i=gH(uH(t.method??"post")),s=Array.isArray(t.query),o=await i(t),a=await bH(o,r.jsonSerializer??aw),c=Array.isArray(a)?!a.some(({data:l})=>!l):!!a.data,u=Array.isArray(a)||!a.errors||Array.isArray(a.errors)&&!a.errors.length||r.errorPolicy==="all"||r.errorPolicy==="ignore";if(o.ok&&u&&c){const{errors:l,...d}=(Array.isArray(a),a),f=r.errorPolicy==="ignore"?d:a;return{...s?{data:f}:f,headers:o.headers,status:o.status}}else{const l=typeof a=="string"?{error:a}:a;throw new Jc({...l,status:o.status,headers:o.headers},{query:e,variables:n})}},vH=(t,e,n,r)=>{const i=r??aw;if(!Array.isArray(t))return i.stringify({query:t,variables:e,operationName:n});if(typeof e<"u"&&!Array.isArray(e))throw new Error("Cannot create request body with given variable type, array expected");const s=t.reduce((o,a,c)=>(o.push({query:a,variables:e?e[c]:void 0}),o),[]);return i.stringify(s)},bH=async(t,e)=>{let n;return t.headers.forEach((r,i)=>{i.toLowerCase()==="content-type"&&(n=r)}),n&&(n.toLowerCase().startsWith("application/json")||n.toLowerCase().startsWith("application/graphql+json")||n.toLowerCase().startsWith("application/graphql-response+json"))?e.parse(await t.text()):t.text()},Cy=t=>typeof t=="function"?t():t,Xc=(t,...e)=>t.reduce((n,r,i)=>`${n}${r}${i in e?String(e[i]):""}`,"");var Hi;class _H{constructor(){bt(this,Hi,console);Ve(this,"log",(...e)=>ce(this,Hi).log(...e));Ve(this,"info",(...e)=>ce(this,Hi).info(...e));Ve(this,"warn",(...e)=>ce(this,Hi).warn(...e));Ve(this,"error",(...e)=>ce(this,Hi).error(...e));Ve(this,"debug",(...e)=>ce(this,Hi).debug(...e));Ve(this,"trace",(...e)=>ce(this,Hi).trace(...e));this.log=this.log.bind(this),this.info=this.info.bind(this),this.warn=this.warn.bind(this),this.error=this.error.bind(this),this.debug=this.debug.bind(this),this.trace=this.trace.bind(this)}set logger(e){ht(this,Hi,e)}}Hi=new WeakMap;const qk=new _H,_t=qk,wH=t=>qk.logger=t;async function Qc(...t){const[e,...n]=t,r=new yH(e,{fetch}),{errors:i,...s}=await r.request(...n),o={...s};return i!=null&&i.length&&(o.errors=i.map(({message:a,...c})=>new Ie(a,c))),o}function Gh(t){return t instanceof ri?Object.entries(t.getFields()).map(([e,n])=>{const r=n.type instanceof It?n.type.ofType:n.type;if(r instanceof ri||r instanceof Kc)return`${e} { ${Gh(r)} }`;if(r instanceof pr){const i=r.ofType instanceof It?r.ofType.ofType:r.ofType;if(i instanceof Gs)return e;if(i instanceof ri||i instanceof Kc)return`${e} { ${Gh(i)} }`;throw new Error(`List item type ${i.toString()} is not handled`)}return e}).join(" "):t instanceof Kc?t.getTypes().map(e=>`... on ${e.name} { ${Gh(e)} }`).join(" "):""}function EH(t,e){const n=ek(t.name),r=t.specifications.at(-1);if(!r)throw new Error("No document model specification found");const i=`${r.state.global.schema} type Query { ${n}: ${n}State }`,o=cH(i).getQueryType();if(!o)throw new Error("No query type found");const c=o.getFields()[n];if(!c)throw new Error("No state query found");return Gh(c.type)}async function pa(t){var n,r;let e;try{const i=await Qc(t,Xc`
148
- query getDrive {
149
- drive {
150
- id
151
- name
152
- icon
153
- slug
154
- }
155
- }
156
- `);if((n=i.errors)!=null&&n.length||!i.drive)throw((r=i.errors)==null?void 0:r.at(0))??new Error("Drive not found");e=i.drive}catch(i){throw _t.error(i),new Error("Couldn't find drive info")}return e}async function HS(t,e,n){const{documentModel:r,utils:i}=n,s=EH(r),o=ek(r.name),a=await Qc(t,Xc`
157
- query ($id: String!) {
158
- document(id: $id) {
159
- id
160
- name
161
- created
162
- documentType
163
- lastModified
164
- revision
165
- operations {
166
- id
167
- error
168
- hash
169
- index
170
- skip
171
- timestamp
172
- type
173
- inputText
174
- context {
175
- signer {
176
- user {
177
- address
178
- networkId
179
- chainId
180
- }
181
- app {
182
- name
183
- key
184
- }
185
- signatures
186
- }
187
- }
188
- }
189
- ... on ${o} {
190
- state {
191
- ${s}
192
- }
193
- initialState {
194
- ${s}
195
- }
196
- }
197
- }
198
- }
199
- `,{id:e}),c=a.document?{...a.document,revision:{global:a.document.revision,local:0},state:i.createState({global:a.document.state}),operations:{global:a.document.operations.map(({inputText:u,...l})=>({...l,error:l.error??void 0,scope:"global",input:JSON.parse(u)})),local:[]},attachments:{},initialState:i.createExtendedState({created:a.document.created,lastModified:a.document.created,state:i.createState({global:a.document.initialState})}),clipboard:[]}:null;return{...a,document:c}}function SH(t){const{open:e,groupSharingType:n,onAddRemoteDrive:r,onClose:i}=t;async function s(o){await r(o),i()}return P(x4,{open:e,onSubmit:s,sharingType:n,onOpenChange:o=>{if(!o)return i()},requestPublicDrive:pa})}const xH=t=>{const{open:e,onClose:n,onCancel:r,title:i,body:s,cancelLabel:o,continueLabel:a,onContinue:c}=t;return P(O_,{open:e,onCancel:()=>r(n),header:i,body:s,cancelLabel:o,continueLabel:a,onContinue:()=>c(n),onOpenChange:u=>{if(!u)return n()}})},TH=t=>{const{open:e,onClose:n}=t,{t:r}=tc();return P(EO,{open:e,header:r("modals.cookiesPolicy.title"),body:P(YT,{i18nKey:"modals.cookiesPolicy.body",components:{subtitle:P("h2",{className:"mb-4 text-lg font-bold"}),p:P("p",{className:"mb-2"}),list:P("ul",{className:"mb-4 list-disc pl-6"}),bullet:P("li",{})}}),bodyProps:{className:"text-left"},closeLabel:"Close",onContinue:()=>n(),overlayProps:{style:{zIndex:1e4}}})};var IH=Object.defineProperty,OH=(t,e,n)=>e in t?IH(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,CH=(t,e,n)=>OH(t,e+"",n),Ut;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},t.find=(i,s)=>{for(const o of i)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Ut||(Ut={}));var zv;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(zv||(zv={}));const Le=Ut.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ks=t=>{switch(typeof t){case"undefined":return Le.undefined;case"string":return Le.string;case"number":return isNaN(t)?Le.nan:Le.number;case"boolean":return Le.boolean;case"function":return Le.function;case"bigint":return Le.bigint;case"symbol":return Le.symbol;case"object":return Array.isArray(t)?Le.array:t===null?Le.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Le.promise:typeof Map<"u"&&t instanceof Map?Le.map:typeof Set<"u"&&t instanceof Set?Le.set:typeof Date<"u"&&t instanceof Date?Le.date:Le.object;default:return Le.unknown}},Te=Ut.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),kH=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");let Ii=class Gk extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,c=0;for(;c<o.path.length;){const u=o.path[c];c===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(o))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return i(this),r}static assert(e){if(!(e instanceof Gk))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ut.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};Ii.create=t=>new Ii(t);const Eu=(t,e)=>{let n;switch(t.code){case Te.invalid_type:t.received===Le.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Te.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ut.jsonStringifyReplacer)}`;break;case Te.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ut.joinValues(t.keys,", ")}`;break;case Te.invalid_union:n="Invalid input";break;case Te.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ut.joinValues(t.options)}`;break;case Te.invalid_enum_value:n=`Invalid enum value. Expected ${Ut.joinValues(t.options)}, received '${t.received}'`;break;case Te.invalid_arguments:n="Invalid function arguments";break;case Te.invalid_return_type:n="Invalid function return type";break;case Te.invalid_date:n="Invalid date";break;case Te.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Ut.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Te.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case Te.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case Te.custom:n="Invalid input";break;case Te.invalid_intersection_types:n="Intersection results could not be merged";break;case Te.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Te.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ut.assertNever(t)}return{message:n}};let Zk=Eu;function DH(t){Zk=t}function Vp(){return Zk}const Hp=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,s=[...n,...i.path||[]],o={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let a="";const c=r.filter(u=>!!u).slice().reverse();for(const u of c)a=u(o,{data:e,defaultError:a}).message;return{...i,path:s,message:a}},RH=[];function Ae(t,e){const n=Vp(),r=Hp({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Eu?void 0:Eu].filter(i=>!!i)});t.common.issues.push(r)}let Dr=class Yk{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return dt;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const s=await i.key,o=await i.value;r.push({key:s,value:o})}return Yk.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return dt;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:e.value,value:r}}};const dt=Object.freeze({status:"aborted"}),Wp=t=>({status:"dirty",value:t}),br=t=>({status:"valid",value:t}),Vv=t=>t.status==="aborted",Hv=t=>t.status==="dirty",Ha=t=>t.status==="valid",$d=t=>typeof Promise<"u"&&t instanceof Promise;function qp(t,e,n,r){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function Kk(t,e,n,r,i){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var Ze;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Ze||(Ze={}));var Dl,Rl;let fs=class{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};const WS=(t,e)=>{if(Ha(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ii(t.common.issues);return this._error=n,this._error}}};function gt(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,o)=>{var a,c;const{message:u}=t;return s.code==="invalid_enum_value"?{message:u??o.defaultError}:typeof o.data>"u"?{message:(a=u??r)!==null&&a!==void 0?a:o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:(c=u??n)!==null&&c!==void 0?c:o.defaultError}},description:i}}class Et{get description(){return this._def.description}_getType(e){return ks(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:ks(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Dr,ctx:{common:e.parent.common,data:e.data,parsedType:ks(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if($d(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ks(e)},s=this._parseSync({data:e,path:i.path,parent:i});return WS(i,s)}"~validate"(e){var n,r;const i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ks(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:i});return Ha(s)?{value:s.value}:{issues:i.common.issues}}catch(s){!((r=(n=s==null?void 0:s.message)===null||n===void 0?void 0:n.toLowerCase())===null||r===void 0)&&r.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:i}).then(s=>Ha(s)?{value:s.value}:{issues:i.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ks(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await($d(i)?i:Promise.resolve(i));return WS(r,s)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const o=e(i),a=()=>s.addIssue({code:Te.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Ai({schema:this,typeName:at.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return ss.create(this,this._def)}nullable(){return Wo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Wa.create(this)}promise(){return Tu.create(this,this._def)}or(e){return Wd.create([this,e],this._def)}and(e){return qd.create(this,e,this._def)}transform(e){return new Ai({...gt(this._def),schema:this,typeName:at.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Kd({...gt(this._def),innerType:this,defaultValue:n,typeName:at.ZodDefault})}brand(){return new cw({typeName:at.ZodBranded,type:this,...gt(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Jd({...gt(this._def),innerType:this,catchValue:n,typeName:at.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return uw.create(this,e)}readonly(){return Xd.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const NH=/^c[^\s-]{8,}$/i,AH=/^[0-9a-z]+$/,PH=/^[0-9A-HJKMNP-TV-Z]{26}$/i,MH=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,LH=/^[a-z0-9_-]{21}$/i,FH=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$H=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,jH=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,UH="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ky;const BH=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,zH=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,VH=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,HH=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,WH=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,qH=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Jk="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",GH=new RegExp(`^${Jk}$`);function Xk(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function ZH(t){return new RegExp(`^${Xk(t)}$`)}function Qk(t){let e=`${Jk}T${Xk(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function YH(t,e){return!!((e==="v4"||!e)&&BH.test(t)||(e==="v6"||!e)&&VH.test(t))}function KH(t,e){if(!FH.test(t))return!1;try{const[n]=t.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||!i.typ||!i.alg||e&&i.alg!==e)}catch{return!1}}function JH(t,e){return!!((e==="v4"||!e)&&zH.test(t)||(e==="v6"||!e)&&HH.test(t))}let Su=class Nl extends Et{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Le.string){const i=this._getOrReturnCtx(e);return Ae(i,{code:Te.invalid_type,expected:Le.string,received:i.parsedType}),dt}const n=new Dr;let r;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(r=this._getOrReturnCtx(e,r),Ae(r,{code:Te.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(r=this._getOrReturnCtx(e,r),Ae(r,{code:Te.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const s=e.data.length>i.value,o=e.data.length<i.value;(s||o)&&(r=this._getOrReturnCtx(e,r),s?Ae(r,{code:Te.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&Ae(r,{code:Te.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")jH.test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"email",code:Te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")ky||(ky=new RegExp(UH,"u")),ky.test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"emoji",code:Te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")MH.test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"uuid",code:Te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")LH.test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"nanoid",code:Te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")NH.test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"cuid",code:Te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")AH.test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"cuid2",code:Te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")PH.test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"ulid",code:Te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),Ae(r,{validation:"url",code:Te.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"regex",code:Te.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(r=this._getOrReturnCtx(e,r),Ae(r,{code:Te.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(r=this._getOrReturnCtx(e,r),Ae(r,{code:Te.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(r=this._getOrReturnCtx(e,r),Ae(r,{code:Te.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Qk(i).test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{code:Te.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?GH.test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{code:Te.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?ZH(i).test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{code:Te.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?$H.test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"duration",code:Te.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?YH(e.data,i.version)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"ip",code:Te.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?KH(e.data,i.alg)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"jwt",code:Te.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?JH(e.data,i.version)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"cidr",code:Te.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?WH.test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"base64",code:Te.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?qH.test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"base64url",code:Te.invalid_string,message:i.message}),n.dirty()):Ut.assertNever(i);return{status:n.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:Te.invalid_string,...Ze.errToObj(r)})}_addCheck(e){return new Nl({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ze.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ze.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ze.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ze.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ze.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ze.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ze.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ze.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ze.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Ze.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Ze.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ze.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Ze.errToObj(e)})}datetime(e){var n,r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(r=e==null?void 0:e.local)!==null&&r!==void 0?r:!1,...Ze.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...Ze.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Ze.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Ze.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...Ze.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Ze.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Ze.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Ze.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Ze.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Ze.errToObj(n)})}nonempty(e){return this.min(1,Ze.errToObj(e))}trim(){return new Nl({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Nl({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Nl({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Su.create=t=>{var e;return new Su({checks:[],typeName:at.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...gt(t)})};function XH(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,s=parseInt(t.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}let jd=class Wv extends Et{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Le.number){const i=this._getOrReturnCtx(e);return Ae(i,{code:Te.invalid_type,expected:Le.number,received:i.parsedType}),dt}let n;const r=new Dr;for(const i of this._def.checks)i.kind==="int"?Ut.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),Ae(n,{code:Te.invalid_type,expected:"integer",received:"float",message:i.message}),r.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),Ae(n,{code:Te.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),Ae(n,{code:Te.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="multipleOf"?XH(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),Ae(n,{code:Te.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),Ae(n,{code:Te.not_finite,message:i.message}),r.dirty()):Ut.assertNever(i);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Ze.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ze.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ze.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ze.toString(n))}setLimit(e,n,r,i){return new Wv({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ze.toString(i)}]})}_addCheck(e){return new Wv({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ze.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ze.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ze.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ze.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ze.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ze.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Ze.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ze.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ze.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ut.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};jd.create=t=>new jd({checks:[],typeName:at.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...gt(t)});let Ud=class qv extends Et{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Le.bigint)return this._getInvalidInput(e);let n;const r=new Dr;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),Ae(n,{code:Te.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),Ae(n,{code:Te.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),Ae(n,{code:Te.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):Ut.assertNever(i);return{status:r.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Ae(n,{code:Te.invalid_type,expected:Le.bigint,received:n.parsedType}),dt}gte(e,n){return this.setLimit("min",e,!0,Ze.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ze.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ze.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ze.toString(n))}setLimit(e,n,r,i){return new qv({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ze.toString(i)}]})}_addCheck(e){return new qv({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ze.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ze.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ze.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ze.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ze.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Ud.create=t=>{var e;return new Ud({checks:[],typeName:at.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...gt(t)})};let Bd=class extends Et{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Le.boolean){const n=this._getOrReturnCtx(e);return Ae(n,{code:Te.invalid_type,expected:Le.boolean,received:n.parsedType}),dt}return br(e.data)}};Bd.create=t=>new Bd({typeName:at.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...gt(t)});let zd=class eD extends Et{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Le.date){const i=this._getOrReturnCtx(e);return Ae(i,{code:Te.invalid_type,expected:Le.date,received:i.parsedType}),dt}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return Ae(i,{code:Te.invalid_date}),dt}const n=new Dr;let r;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(r=this._getOrReturnCtx(e,r),Ae(r,{code:Te.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(r=this._getOrReturnCtx(e,r),Ae(r,{code:Te.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Ut.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new eD({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Ze.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Ze.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};zd.create=t=>new zd({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:at.ZodDate,...gt(t)});let Gp=class extends Et{_parse(e){if(this._getType(e)!==Le.symbol){const n=this._getOrReturnCtx(e);return Ae(n,{code:Te.invalid_type,expected:Le.symbol,received:n.parsedType}),dt}return br(e.data)}};Gp.create=t=>new Gp({typeName:at.ZodSymbol,...gt(t)});let Vd=class extends Et{_parse(e){if(this._getType(e)!==Le.undefined){const n=this._getOrReturnCtx(e);return Ae(n,{code:Te.invalid_type,expected:Le.undefined,received:n.parsedType}),dt}return br(e.data)}};Vd.create=t=>new Vd({typeName:at.ZodUndefined,...gt(t)});let Hd=class extends Et{_parse(e){if(this._getType(e)!==Le.null){const n=this._getOrReturnCtx(e);return Ae(n,{code:Te.invalid_type,expected:Le.null,received:n.parsedType}),dt}return br(e.data)}};Hd.create=t=>new Hd({typeName:at.ZodNull,...gt(t)});class xu extends Et{constructor(){super(...arguments),this._any=!0}_parse(e){return br(e.data)}}xu.create=t=>new xu({typeName:at.ZodAny,...gt(t)});let Oa=class extends Et{constructor(){super(...arguments),this._unknown=!0}_parse(e){return br(e.data)}};Oa.create=t=>new Oa({typeName:at.ZodUnknown,...gt(t)});let Zs=class extends Et{_parse(e){const n=this._getOrReturnCtx(e);return Ae(n,{code:Te.invalid_type,expected:Le.never,received:n.parsedType}),dt}};Zs.create=t=>new Zs({typeName:at.ZodNever,...gt(t)});let Zp=class extends Et{_parse(e){if(this._getType(e)!==Le.undefined){const n=this._getOrReturnCtx(e);return Ae(n,{code:Te.invalid_type,expected:Le.void,received:n.parsedType}),dt}return br(e.data)}};Zp.create=t=>new Zp({typeName:at.ZodVoid,...gt(t)});let Wa=class Zh extends Et{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==Le.array)return Ae(n,{code:Te.invalid_type,expected:Le.array,received:n.parsedType}),dt;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(o||a)&&(Ae(n,{code:o?Te.too_big:Te.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Ae(n,{code:Te.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Ae(n,{code:Te.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,a)=>i.type._parseAsync(new fs(n,o,n.path,a)))).then(o=>Dr.mergeArray(r,o));const s=[...n.data].map((o,a)=>i.type._parseSync(new fs(n,o,n.path,a)));return Dr.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new Zh({...this._def,minLength:{value:e,message:Ze.toString(n)}})}max(e,n){return new Zh({...this._def,maxLength:{value:e,message:Ze.toString(n)}})}length(e,n){return new Zh({...this._def,exactLength:{value:e,message:Ze.toString(n)}})}nonempty(e){return this.min(1,e)}};Wa.create=(t,e)=>new Wa({type:t,minLength:null,maxLength:null,exactLength:null,typeName:at.ZodArray,...gt(e)});function Nc(t){if(t instanceof si){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=ss.create(Nc(r))}return new si({...t._def,shape:()=>e})}else return t instanceof Wa?new Wa({...t._def,type:Nc(t.element)}):t instanceof ss?ss.create(Nc(t.unwrap())):t instanceof Wo?Wo.create(Nc(t.unwrap())):t instanceof Ho?Ho.create(t.items.map(e=>Nc(e))):t}let si=class li extends Et{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Ut.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==Le.object){const c=this._getOrReturnCtx(e);return Ae(c,{code:Te.invalid_type,expected:Le.object,received:c.parsedType}),dt}const{status:n,ctx:r}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof Zs&&this._def.unknownKeys==="strip"))for(const c in r.data)s.includes(c)||o.push(c);const a=[];for(const c of s){const u=i[c],l=r.data[c];a.push({key:{status:"valid",value:c},value:u._parse(new fs(r,l,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof Zs){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of o)a.push({key:{status:"valid",value:u},value:{status:"valid",value:r.data[u]}});else if(c==="strict")o.length>0&&(Ae(r,{code:Te.unrecognized_keys,keys:o}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of o){const l=r.data[u];a.push({key:{status:"valid",value:u},value:c._parse(new fs(r,l,r.path,u)),alwaysSet:u in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of a){const l=await u.key,d=await u.value;c.push({key:l,value:d,alwaysSet:u.alwaysSet})}return c}).then(c=>Dr.mergeObjectSync(n,c)):Dr.mergeObjectSync(n,a)}get shape(){return this._def.shape()}strict(e){return Ze.errToObj,new li({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,s,o,a;const c=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=Ze.errToObj(e).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new li({...this._def,unknownKeys:"strip"})}passthrough(){return new li({...this._def,unknownKeys:"passthrough"})}extend(e){return new li({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new li({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:at.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new li({...this._def,catchall:e})}pick(e){const n={};return Ut.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new li({...this._def,shape:()=>n})}omit(e){const n={};return Ut.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new li({...this._def,shape:()=>n})}deepPartial(){return Nc(this)}partial(e){const n={};return Ut.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}),new li({...this._def,shape:()=>n})}required(e){const n={};return Ut.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof ss;)i=i._def.innerType;n[r]=i}}),new li({...this._def,shape:()=>n})}keyof(){return oD(Ut.objectKeys(this.shape))}};si.create=(t,e)=>new si({shape:()=>t,unknownKeys:"strip",catchall:Zs.create(),typeName:at.ZodObject,...gt(e)});si.strictCreate=(t,e)=>new si({shape:()=>t,unknownKeys:"strict",catchall:Zs.create(),typeName:at.ZodObject,...gt(e)});si.lazycreate=(t,e)=>new si({shape:t,unknownKeys:"strip",catchall:Zs.create(),typeName:at.ZodObject,...gt(e)});let Wd=class extends Et{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new Ii(a.ctx.common.issues));return Ae(n,{code:Te.invalid_union,unionErrors:o}),dt}if(n.common.async)return Promise.all(r.map(async s=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const c of r){const u={...n,common:{...n.common,issues:[]},parent:null},l=c._parseSync({data:n.data,path:n.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!s&&(s={result:l,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(c=>new Ii(c));return Ae(n,{code:Te.invalid_union,unionErrors:a}),dt}}get options(){return this._def.options}};Wd.create=(t,e)=>new Wd({options:t,typeName:at.ZodUnion,...gt(e)});const fo=t=>t instanceof Gd?fo(t.schema):t instanceof Ai?fo(t.innerType()):t instanceof Zd?[t.value]:t instanceof Tf?t.options:t instanceof Yd?Ut.objectValues(t.enum):t instanceof Kd?fo(t._def.innerType):t instanceof Vd?[void 0]:t instanceof Hd?[null]:t instanceof ss?[void 0,...fo(t.unwrap())]:t instanceof Wo?[null,...fo(t.unwrap())]:t instanceof cw||t instanceof Xd?fo(t.unwrap()):t instanceof Jd?fo(t._def.innerType):[];let tD=class nD extends Et{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Le.object)return Ae(n,{code:Te.invalid_type,expected:Le.object,received:n.parsedType}),dt;const r=this.discriminator,i=n.data[r],s=this.optionsMap.get(i);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(Ae(n,{code:Te.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),dt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const i=new Map;for(const s of n){const o=fo(s.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new nD({typeName:at.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...gt(r)})}};function Gv(t,e){const n=ks(t),r=ks(e);if(t===e)return{valid:!0,data:t};if(n===Le.object&&r===Le.object){const i=Ut.objectKeys(e),s=Ut.objectKeys(t).filter(a=>i.indexOf(a)!==-1),o={...t,...e};for(const a of s){const c=Gv(t[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(n===Le.array&&r===Le.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<t.length;s++){const o=t[s],a=e[s],c=Gv(o,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return n===Le.date&&r===Le.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}let qd=class extends Et{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(s,o)=>{if(Vv(s)||Vv(o))return dt;const a=Gv(s.value,o.value);return a.valid?((Hv(s)||Hv(o))&&n.dirty(),{status:n.value,value:a.data}):(Ae(r,{code:Te.invalid_intersection_types}),dt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};qd.create=(t,e,n)=>new qd({left:t,right:e,typeName:at.ZodIntersection,...gt(n)});let Ho=class rD extends Et{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Le.array)return Ae(r,{code:Te.invalid_type,expected:Le.array,received:r.parsedType}),dt;if(r.data.length<this._def.items.length)return Ae(r,{code:Te.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),dt;!this._def.rest&&r.data.length>this._def.items.length&&(Ae(r,{code:Te.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((s,o)=>{const a=this._def.items[o]||this._def.rest;return a?a._parse(new fs(r,s,r.path,o)):null}).filter(s=>!!s);return r.common.async?Promise.all(i).then(s=>Dr.mergeArray(n,s)):Dr.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new rD({...this._def,rest:e})}};Ho.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ho({items:t,typeName:at.ZodTuple,rest:null,...gt(e)})};let iD=class Zv extends Et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Le.object)return Ae(r,{code:Te.invalid_type,expected:Le.object,received:r.parsedType}),dt;const i=[],s=this._def.keyType,o=this._def.valueType;for(const a in r.data)i.push({key:s._parse(new fs(r,a,r.path,a)),value:o._parse(new fs(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?Dr.mergeObjectAsync(n,i):Dr.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof Et?new Zv({keyType:e,valueType:n,typeName:at.ZodRecord,...gt(r)}):new Zv({keyType:Su.create(),valueType:e,typeName:at.ZodRecord,...gt(n)})}},Yp=class extends Et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Le.map)return Ae(r,{code:Te.invalid_type,expected:Le.map,received:r.parsedType}),dt;const i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,c],u)=>({key:i._parse(new fs(r,a,r.path,[u,"key"])),value:s._parse(new fs(r,c,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of o){const u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return dt;(u.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(u.value,l.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const c of o){const u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return dt;(u.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(u.value,l.value)}return{status:n.value,value:a}}}};Yp.create=(t,e,n)=>new Yp({valueType:e,keyType:t,typeName:at.ZodMap,...gt(n)});let Kp=class Yv extends Et{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Le.set)return Ae(r,{code:Te.invalid_type,expected:Le.set,received:r.parsedType}),dt;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Ae(r,{code:Te.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Ae(r,{code:Te.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function o(c){const u=new Set;for(const l of c){if(l.status==="aborted")return dt;l.status==="dirty"&&n.dirty(),u.add(l.value)}return{status:n.value,value:u}}const a=[...r.data.values()].map((c,u)=>s._parse(new fs(r,c,r.path,u)));return r.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(e,n){return new Yv({...this._def,minSize:{value:e,message:Ze.toString(n)}})}max(e,n){return new Yv({...this._def,maxSize:{value:e,message:Ze.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};Kp.create=(t,e)=>new Kp({valueType:t,minSize:null,maxSize:null,typeName:at.ZodSet,...gt(e)});let sD=class Yh extends Et{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Le.function)return Ae(n,{code:Te.invalid_type,expected:Le.function,received:n.parsedType}),dt;function r(a,c){return Hp({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Vp(),Eu].filter(u=>!!u),issueData:{code:Te.invalid_arguments,argumentsError:c}})}function i(a,c){return Hp({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Vp(),Eu].filter(u=>!!u),issueData:{code:Te.invalid_return_type,returnTypeError:c}})}const s={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof Tu){const a=this;return br(async function(...c){const u=new Ii([]),l=await a._def.args.parseAsync(c,s).catch(f=>{throw u.addIssue(r(c,f)),u}),d=await Reflect.apply(o,this,l);return await a._def.returns._def.type.parseAsync(d,s).catch(f=>{throw u.addIssue(i(d,f)),u})})}else{const a=this;return br(function(...c){const u=a._def.args.safeParse(c,s);if(!u.success)throw new Ii([r(c,u.error)]);const l=Reflect.apply(o,this,u.data),d=a._def.returns.safeParse(l,s);if(!d.success)throw new Ii([i(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Yh({...this._def,args:Ho.create(e).rest(Oa.create())})}returns(e){return new Yh({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new Yh({args:e||Ho.create([]).rest(Oa.create()),returns:n||Oa.create(),typeName:at.ZodFunction,...gt(r)})}},Gd=class extends Et{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Gd.create=(t,e)=>new Gd({getter:t,typeName:at.ZodLazy,...gt(e)});let Zd=class extends Et{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Ae(n,{received:n.data,code:Te.invalid_literal,expected:this._def.value}),dt}return{status:"valid",value:e.data}}get value(){return this._def.value}};Zd.create=(t,e)=>new Zd({value:t,typeName:at.ZodLiteral,...gt(e)});function oD(t,e){return new Tf({values:t,typeName:at.ZodEnum,...gt(e)})}let Tf=class Kv extends Et{constructor(){super(...arguments),Dl.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Ae(n,{expected:Ut.joinValues(r),received:n.parsedType,code:Te.invalid_type}),dt}if(qp(this,Dl)||Kk(this,Dl,new Set(this._def.values)),!qp(this,Dl).has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return Ae(n,{received:n.data,code:Te.invalid_enum_value,options:r}),dt}return br(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Kv.create(e,{...this._def,...n})}exclude(e,n=this._def){return Kv.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};Dl=new WeakMap;Tf.create=oD;let Yd=class extends Et{constructor(){super(...arguments),Rl.set(this,void 0)}_parse(e){const n=Ut.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Le.string&&r.parsedType!==Le.number){const i=Ut.objectValues(n);return Ae(r,{expected:Ut.joinValues(i),received:r.parsedType,code:Te.invalid_type}),dt}if(qp(this,Rl)||Kk(this,Rl,new Set(Ut.getValidEnumValues(this._def.values))),!qp(this,Rl).has(e.data)){const i=Ut.objectValues(n);return Ae(r,{received:r.data,code:Te.invalid_enum_value,options:i}),dt}return br(e.data)}get enum(){return this._def.values}};Rl=new WeakMap;Yd.create=(t,e)=>new Yd({values:t,typeName:at.ZodNativeEnum,...gt(e)});let Tu=class extends Et{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Le.promise&&n.common.async===!1)return Ae(n,{code:Te.invalid_type,expected:Le.promise,received:n.parsedType}),dt;const r=n.parsedType===Le.promise?n.data:Promise.resolve(n.data);return br(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Tu.create=(t,e)=>new Tu({type:t,typeName:at.ZodPromise,...gt(e)});let Ai=class extends Et{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===at.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{Ae(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(r.data,s);if(r.common.async)return Promise.resolve(o).then(async a=>{if(n.value==="aborted")return dt;const c=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return c.status==="aborted"?dt:c.status==="dirty"||n.value==="dirty"?Wp(c.value):c});{if(n.value==="aborted")return dt;const a=this._def.schema._parseSync({data:o,path:r.path,parent:r});return a.status==="aborted"?dt:a.status==="dirty"||n.value==="dirty"?Wp(a.value):a}}if(i.type==="refinement"){const o=a=>{const c=i.refinement(a,s);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?dt:(a.status==="dirty"&&n.dirty(),o(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?dt:(a.status==="dirty"&&n.dirty(),o(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Ha(o))return o;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Ha(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:n.value,value:a})):o);Ut.assertNever(i)}};Ai.create=(t,e,n)=>new Ai({schema:t,typeName:at.ZodEffects,effect:e,...gt(n)});Ai.createWithPreprocess=(t,e,n)=>new Ai({schema:e,effect:{type:"preprocess",transform:t},typeName:at.ZodEffects,...gt(n)});let ss=class extends Et{_parse(e){return this._getType(e)===Le.undefined?br(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ss.create=(t,e)=>new ss({innerType:t,typeName:at.ZodOptional,...gt(e)});let Wo=class extends Et{_parse(e){return this._getType(e)===Le.null?br(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Wo.create=(t,e)=>new Wo({innerType:t,typeName:at.ZodNullable,...gt(e)});let Kd=class extends Et{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===Le.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Kd.create=(t,e)=>new Kd({innerType:t,typeName:at.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...gt(e)});let Jd=class extends Et{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return $d(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ii(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ii(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Jd.create=(t,e)=>new Jd({innerType:t,typeName:at.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...gt(e)});let Jp=class extends Et{_parse(e){if(this._getType(e)!==Le.nan){const n=this._getOrReturnCtx(e);return Ae(n,{code:Te.invalid_type,expected:Le.nan,received:n.parsedType}),dt}return{status:"valid",value:e.data}}};Jp.create=t=>new Jp({typeName:at.ZodNaN,...gt(t)});const QH=Symbol("zod_brand");let cw=class extends Et{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},uw=class aD extends Et{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?dt:i.status==="dirty"?(n.dirty(),Wp(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?dt:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new aD({in:e,out:n,typeName:at.ZodPipeline})}},Xd=class extends Et{_parse(e){const n=this._def.innerType._parse(e),r=i=>(Ha(i)&&(i.value=Object.freeze(i.value)),i);return $d(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}};Xd.create=(t,e)=>new Xd({innerType:t,typeName:at.ZodReadonly,...gt(e)});function cD(t,e={},n){return t?xu.create().superRefine((r,i)=>{var s,o;if(!t(r)){const a=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,c=(o=(s=a.fatal)!==null&&s!==void 0?s:n)!==null&&o!==void 0?o:!0,u=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...u,fatal:c})}}):xu.create()}const e7={object:si.lazycreate};var at;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(at||(at={}));const t7=(t,e={message:`Input not instance of ${t.name}`})=>cD(n=>n instanceof t,e),uD=Su.create,lD=jd.create,n7=Jp.create,r7=Ud.create,dD=Bd.create,i7=zd.create,s7=Gp.create,o7=Vd.create,a7=Hd.create,c7=xu.create,u7=Oa.create,l7=Zs.create,d7=Zp.create,f7=Wa.create,h7=si.create,p7=si.strictCreate,m7=Wd.create,g7=tD.create,y7=qd.create,v7=Ho.create,b7=iD.create,_7=Yp.create,w7=Kp.create,E7=sD.create,S7=Gd.create,x7=Zd.create,T7=Tf.create,I7=Yd.create,O7=Tu.create,qS=Ai.create,C7=ss.create,k7=Wo.create,D7=Ai.createWithPreprocess,R7=uw.create,N7=()=>uD().optional(),A7=()=>lD().optional(),P7=()=>dD().optional(),M7={string:t=>Su.create({...t,coerce:!0}),number:t=>jd.create({...t,coerce:!0}),boolean:t=>Bd.create({...t,coerce:!0}),bigint:t=>Ud.create({...t,coerce:!0}),date:t=>zd.create({...t,coerce:!0})},L7=dt;var ge=Object.freeze({__proto__:null,defaultErrorMap:Eu,setErrorMap:DH,getErrorMap:Vp,makeIssue:Hp,EMPTY_PATH:RH,addIssueToContext:Ae,ParseStatus:Dr,INVALID:dt,DIRTY:Wp,OK:br,isAborted:Vv,isDirty:Hv,isValid:Ha,isAsync:$d,get util(){return Ut},get objectUtil(){return zv},ZodParsedType:Le,getParsedType:ks,ZodType:Et,datetimeRegex:Qk,ZodString:Su,ZodNumber:jd,ZodBigInt:Ud,ZodBoolean:Bd,ZodDate:zd,ZodSymbol:Gp,ZodUndefined:Vd,ZodNull:Hd,ZodAny:xu,ZodUnknown:Oa,ZodNever:Zs,ZodVoid:Zp,ZodArray:Wa,ZodObject:si,ZodUnion:Wd,ZodDiscriminatedUnion:tD,ZodIntersection:qd,ZodTuple:Ho,ZodRecord:iD,ZodMap:Yp,ZodSet:Kp,ZodFunction:sD,ZodLazy:Gd,ZodLiteral:Zd,ZodEnum:Tf,ZodNativeEnum:Yd,ZodPromise:Tu,ZodEffects:Ai,ZodTransformer:Ai,ZodOptional:ss,ZodNullable:Wo,ZodDefault:Kd,ZodCatch:Jd,ZodNaN:Jp,BRAND:QH,ZodBranded:cw,ZodPipeline:uw,ZodReadonly:Xd,custom:cD,Schema:Et,ZodSchema:Et,late:e7,get ZodFirstPartyTypeKind(){return at},coerce:M7,any:c7,array:f7,bigint:r7,boolean:dD,date:i7,discriminatedUnion:g7,effect:qS,enum:T7,function:E7,instanceof:t7,intersection:y7,lazy:S7,literal:x7,map:_7,nan:n7,nativeEnum:I7,never:l7,null:a7,nullable:k7,number:lD,object:h7,oboolean:P7,onumber:A7,optional:C7,ostring:N7,pipeline:R7,preprocess:D7,promise:O7,record:b7,set:w7,strictObject:p7,string:uD,symbol:s7,transformer:qS,tuple:v7,undefined:o7,union:m7,unknown:u7,void:d7,NEVER:L7,ZodIssueCode:Te,quotelessJson:kH,ZodError:Ii});const F7=t=>t!=null;ge.any().refine(t=>F7(t));function fD(){return ge.object({end:ge.string()})}function hD(){return ge.object({id:ge.string()})}function pD(){return ge.object({ownerId:ge.string()})}function mD(){return ge.object({ownerType:ge.string()})}function gD(){return ge.object({period:ge.string()})}function yD(){return ge.object({start:ge.string()})}const Tc={setIdOperation(t,e){t.id=e.input.id},setOwnerIdOperation(t,e){t.ownerId=e.input.ownerId},setOwnerTypeOperation(t,e){t.ownerType=e.input.ownerType},setPeriodOperation(t,e){t.period=e.input.period},setStartOperation(t,e){t.start=e.input.start},setEndOperation(t,e){t.end=e.input.end}},$7=(t,e,n)=>{if(zt.isBaseAction(e))return t;switch(e.type){case"SET_ID":hD().parse(e.input),Tc.setIdOperation(t[e.scope],e,n);break;case"SET_OWNER_ID":pD().parse(e.input),Tc.setOwnerIdOperation(t[e.scope],e,n);break;case"SET_OWNER_TYPE":mD().parse(e.input),Tc.setOwnerTypeOperation(t[e.scope],e,n);break;case"SET_PERIOD":gD().parse(e.input),Tc.setPeriodOperation(t[e.scope],e,n);break;case"SET_START":yD().parse(e.input),Tc.setStartOperation(t[e.scope],e,n);break;case"SET_END":fD().parse(e.input),Tc.setEndOperation(t[e.scope],e,n);break;default:return t}},Jv=zt.createReducer($7),j7={id:"",ownerId:"",ownerType:"",period:"",start:"",end:"",actualsComparison:[],snapshotAccount:[]},U7={},zl={fileExtension:"phas",createState(t){return{global:{...j7,...t==null?void 0:t.global},local:{...U7,...t==null?void 0:t.local}}},createExtendedState(t){return zt.createExtendedState({...t,documentType:"powerhouse/account-snapshot"},zl.createState)},createDocument(t){return zt.createDocument(zl.createExtendedState(t),zl.createState)},saveToFile(t,e,n){return zt.saveToFile(t,e,"phas",n)},saveToFileHandle(t,e){return zt.saveToFileHandle(t,e)},loadFromFile(t){return zt.loadFromFile(t,Jv)},loadFromInput(t){return zt.loadFromInput(t,Jv)}},{createAction:Gu}=zt,vD=t=>Gu("SET_ID",{...t},void 0,hD,"global"),bD=t=>Gu("SET_OWNER_ID",{...t},void 0,pD,"global"),_D=t=>Gu("SET_OWNER_TYPE",{...t},void 0,mD,"global"),wD=t=>Gu("SET_PERIOD",{...t},void 0,gD,"global"),ED=t=>Gu("SET_START",{...t},void 0,yD,"global"),SD=t=>Gu("SET_END",{...t},void 0,fD,"global");class B7 extends wf{setId(e){return this.dispatch(vD(e))}setOwnerId(e){return this.dispatch(bD(e))}setOwnerType(e){return this.dispatch(_D(e))}setPeriod(e){return this.dispatch(wD(e))}setStart(e){return this.dispatch(ED(e))}setEnd(e){return this.dispatch(SD(e))}}const xD=class TD extends wf{constructor(e,n){super(Jv,zl.createDocument(e),n)}saveToFile(e,n){return super.saveToFile(e,TD.fileExtension,n)}loadFromFile(e){return super.loadFromFile(e)}static async fromFile(e){const n=new this;return await n.loadFromFile(e),n}};CH(xD,"fileExtension","phas");let z7=xD;$C(z7,[B7]);const V7=Object.freeze(Object.defineProperty({__proto__:null,setEnd:SD,setId:vD,setOwnerId:bD,setOwnerType:_D,setPeriod:wD,setStart:ED},Symbol.toStringTag,{value:"Module"})),H7=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));({...zl,...H7});({...FC,...V7});var W7=Object.defineProperty,q7=(t,e,n)=>e in t?W7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,G7=(t,e,n)=>q7(t,e+"",n);const ig={id:"powerhouse/document-drive",name:"DocumentDrive",extension:"phdd",description:"",author:{name:"Powerhouse Inc",website:"https://www.powerhouse.inc/"},specifications:[{version:1,changeLog:[],state:{global:{schema:`type FolderNode {
200
- id: String!
201
- name: String!
202
- kind: String!
203
- parentFolder: String
204
- }
205
-
206
- type SynchronizationUnit {
207
- syncId: ID!
208
- scope: String!
209
- branch: String!
210
- }
211
-
212
- type FileNode {
213
- id: String!
214
- name: String!
215
- kind: String!
216
- documentType: String!
217
- parentFolder: String
218
- synchronizationUnits: [SynchronizationUnit!]!
219
- }
220
-
221
- union Node = FolderNode | FileNode
222
-
223
- type DocumentDriveState {
224
- id: ID!
225
- name: String!
226
- nodes: [Node!]!
227
- icon: String
228
- slug: String
229
- }`,initialValue:'"{\\"id\\":\\"\\",\\"name\\":\\"\\",\\"nodes\\":[],\\"icon\\":null,\\"slug\\":null}"',examples:[]},local:{schema:`type ListenerFilter {
230
- documentType: [String!]!
231
- documentId: [ID!]
232
- scope: [String!]
233
- branch: [String!]
234
- }
235
-
236
- enum TransmitterType {
237
- Internal,
238
- SwitchboardPush,
239
- PullResponder,
240
- SecureConnect,
241
- MatrixConnect,
242
- RESTWebhook
243
- }
244
-
245
- type ListenerCallInfo {
246
- transmitterType: TransmitterType
247
- name: String
248
- data: String
249
- }
250
-
251
- type Listener {
252
- listenerId: ID!
253
- label: String
254
- block: Boolean!
255
- system: Boolean!
256
- filter: ListenerFilter!
257
- callInfo: ListenerCallInfo
258
- }
259
-
260
- enum TriggerType {
261
- PullResponder
262
- }
263
-
264
- type PullResponderTriggerData {
265
- listenerId: ID!
266
- url: String!
267
- interval: String!
268
- }
269
-
270
- union TriggerData = PullResponderTriggerData
271
-
272
- type Trigger {
273
- id: ID!
274
- type: TriggerType!
275
- data: TriggerData
276
- }
277
-
278
- type DocumentDriveLocalState{
279
- sharingType: String
280
- listeners: [Listener!]!
281
- triggers: [Trigger!]!
282
- availableOffline: Boolean!
283
- }`,initialValue:'"{ \\"listeners\\": [], \\"triggers\\": [], \\"sharingType\\": \\"private\\", \\"availableOffline\\": false}"',examples:[]}},modules:[{id:"GRzuvv78tBvmB6ciitokLfonNHA=",name:"Node",description:"",operations:[{id:"7xiTdxonc9yEASR8sfV/KnbSV10=",name:"ADD_FILE",description:"",schema:`input AddFileInput {
284
- id: ID!
285
- name: String!
286
- documentType: String!
287
- parentFolder: ID
288
- synchronizationUnits: [SynchronizationUnit!]!
289
- }`,template:"",reducer:"",errors:[],examples:[],scope:"global"},{id:"4lzNMMKKdIAtEU6i12xLgi9hp+U=",name:"ADD_FOLDER",description:"",schema:`input AddFolderInput {
290
- id: ID!
291
- name: String!
292
- parentFolder: ID
293
- }`,template:"",reducer:"",errors:[],examples:[],scope:"global"},{id:"53jH2/3TWTTcgCJiv2C+BmuC6i0=",name:"DELETE_NODE",description:"",schema:`input DeleteNodeInput {
294
- id: ID!
295
- }`,template:"",reducer:"",errors:[],examples:[],scope:"global"},{id:"pNn+Y1/HVq/GNMk7t0u3g3gtMLE=",name:"UPDATE_FILE",description:"",schema:`input UpdateFileInput {
296
- id: ID!
297
- parentFolder: ID
298
- name: String
299
- documentType: String
300
- }`,template:"",reducer:"",errors:[],examples:[],scope:"global"},{id:"P0x1M8Mnt+Q/+9nggkwgVbfybsc=",name:"UPDATE_NODE",description:"",schema:`input UpdateNodeInput {
301
- id: ID!
302
- parentFolder: ID
303
- name: String
304
- }`,template:"",reducer:"",errors:[],examples:[],scope:"global"},{id:"vnQ7OB5b3wGLgjhbgJqAIpA+JLE=",name:"COPY_NODE",description:"",schema:`input CopyNodeInput {
305
- srcId: ID!
306
- targetId: ID!
307
- targetName: String
308
- targetParentFolder: ID
309
- synchronizationUnits: [SynchronizationUnit!]
310
- }`,template:"",reducer:"",errors:[],examples:[],scope:"global"},{id:"VNyiD/sNGzk6k9A1Qe7s8dmrJxA=",name:"MOVE_NODE",description:"",schema:`input MoveNodeInput {
311
- srcFolder: ID!
312
- targetParentFolder: ID
313
- }`,template:"",reducer:"",errors:[],examples:[],scope:"global"}]},{id:"0dHwHlxOM9x0vMZ+gLnKxf2qTEo=",name:"Drive",description:"",operations:[{id:"qGCiPGpTt/cyz3HzyrBn92z1dsU=",name:"SET_DRIVE_NAME",description:"",schema:`input SetDriveNameInput {
314
- name: String!
315
- }`,template:"",reducer:"",errors:[],examples:[],scope:"global"},{id:"qGCiPGpTt/cyz3HzyrBn92z30dsU=",name:"SET_DRIVE_ICON",description:"",schema:`input SetDriveIconInput {
316
- icon: String!
317
- }`,template:"",reducer:"",errors:[],examples:[],scope:"global"},{id:"qGCiPGpTt/cyz3HzyrBn92z2dsU=",name:"SET_SHARING_TYPE",description:"",schema:`input SetSharingTypeInput {
318
- type: String!
319
- }`,template:"",reducer:"",errors:[],examples:[],scope:"local"},{id:"qGCiPGpTt/cyz3HzyrBn92z3dsU=",name:"SET_AVAILABLE_OFFLINE",description:"",schema:`input SetAvailableOfflineInput {
320
- availableOffline: Boolean!
321
- }`,template:"",reducer:"",errors:[],examples:[],scope:"local"},{id:"qGCiPGpTt/cyz3HzyrBn92z9dsU=",name:"ADD_LISTENER",description:"",schema:`input AddListenerInput {
322
- listener: Listener!
323
- }`,template:"",reducer:"",errors:[],examples:[],scope:"local"},{id:"qGCiPGpTt/cyz3HzyrBn92z10dsU=",name:"REMOVE_LISTENER",description:"",schema:`input RemoveListenerInput {
324
- listenerId: String!
325
- }`,template:"",reducer:"",errors:[],examples:[],scope:"local"},{id:"qGCiPGpTt/cyz3HzyrBn92z20dsU=",name:"ADD_TRIGGER",description:"",schema:`input AddTriggerInput {
326
- trigger: Trigger!
327
- }`,template:"",reducer:"",errors:[],examples:[],scope:"local"},{id:"qGCiPGpTt/cyz3HzyrBn92z30dsU=",name:"REMOVE_TRIGGER",description:"",schema:`input RemoveTriggerInput {
328
- triggerId: String!
329
- }`,template:"",reducer:"",errors:[],examples:[],scope:"local"}]}]}]},ID=t=>t!=null,Z7=ge.any().refine(t=>ID(t)),OD=ge.enum(["Internal","MatrixConnect","PullResponder","RESTWebhook","SecureConnect","SwitchboardPush"]),CD=ge.enum(["PullResponder"]);function lw(){return ge.object({document:ge.unknown().nullish(),documentType:ge.string(),id:ge.string(),name:ge.string(),parentFolder:ge.string().nullish(),synchronizationUnits:ge.array(sg())})}function dw(){return ge.object({id:ge.string(),name:ge.string(),parentFolder:ge.string().nullish()})}function fw(){return ge.object({listener:gw()})}function hw(){return ge.object({trigger:xw()})}function pw(){return ge.object({srcId:ge.string(),synchronizationUnits:ge.array(sg()).nullish(),targetId:ge.string(),targetName:ge.string().nullish(),targetParentFolder:ge.string().nullish()})}function mw(){return ge.object({id:ge.string()})}function Y7(){return ge.object({__typename:ge.literal("DocumentDriveLocalState").optional(),availableOffline:ge.boolean(),listeners:ge.array(gw()),sharingType:ge.string().nullable(),triggers:ge.array(xw())})}function K7(){return ge.object({__typename:ge.literal("DocumentDriveState").optional(),icon:ge.string().nullable(),id:ge.string(),name:ge.string(),nodes:ge.array(AD()),slug:ge.string().nullable()})}function kD(){return ge.object({__typename:ge.literal("FileNode").optional(),documentType:ge.string(),id:ge.string(),kind:ge.string(),name:ge.string(),parentFolder:ge.string().nullable(),synchronizationUnits:ge.array(sg())})}function DD(){return ge.object({__typename:ge.literal("FolderNode").optional(),id:ge.string(),kind:ge.string(),name:ge.string(),parentFolder:ge.string().nullable()})}function gw(){return ge.object({__typename:ge.literal("Listener").optional(),block:ge.boolean(),callInfo:RD().nullable(),filter:ND(),label:ge.string().nullable(),listenerId:ge.string(),system:ge.boolean()})}function RD(){return ge.object({__typename:ge.literal("ListenerCallInfo").optional(),data:ge.string().nullable(),name:ge.string().nullable(),transmitterType:OD.nullable()})}function ND(){return ge.object({__typename:ge.literal("ListenerFilter").optional(),branch:ge.array(ge.string()).nullable(),documentId:ge.array(ge.string()).nullable(),documentType:ge.array(ge.string()),scope:ge.array(ge.string()).nullable()})}function yw(){return ge.object({srcFolder:ge.string(),targetParentFolder:ge.string().nullish()})}function AD(){return ge.union([kD(),DD()])}function PD(){return ge.object({__typename:ge.literal("PullResponderTriggerData").optional(),interval:ge.string(),listenerId:ge.string(),url:ge.string()})}function vw(){return ge.object({listenerId:ge.string()})}function bw(){return ge.object({triggerId:ge.string()})}function _w(){return ge.object({availableOffline:ge.boolean()})}function ww(){return ge.object({icon:ge.string()})}function Ew(){return ge.object({name:ge.string()})}function Sw(){return ge.object({type:ge.string()})}function sg(){return ge.object({__typename:ge.literal("SynchronizationUnit").optional(),branch:ge.string(),scope:ge.string(),syncId:ge.string()})}function xw(){return ge.object({__typename:ge.literal("Trigger").optional(),data:MD().nullable(),id:ge.string(),type:CD})}function MD(){return PD()}function Tw(){return ge.object({documentType:ge.string().nullish(),id:ge.string(),name:ge.string().nullish(),parentFolder:ge.string().nullish()})}function Iw(){return ge.object({id:ge.string(),name:ge.string().nullish(),parentFolder:ge.string().nullish()})}const J7=Object.freeze(Object.defineProperty({__proto__:null,AddFileInputSchema:lw,AddFolderInputSchema:dw,AddListenerInputSchema:fw,AddTriggerInputSchema:hw,CopyNodeInputSchema:pw,DeleteNodeInputSchema:mw,DocumentDriveLocalStateSchema:Y7,DocumentDriveStateSchema:K7,FileNodeSchema:kD,FolderNodeSchema:DD,ListenerCallInfoSchema:RD,ListenerFilterSchema:ND,ListenerSchema:gw,MoveNodeInputSchema:yw,NodeSchema:AD,PullResponderTriggerDataSchema:PD,RemoveListenerInputSchema:vw,RemoveTriggerInputSchema:bw,SetAvailableOfflineInputSchema:_w,SetDriveIconInputSchema:ww,SetDriveNameInputSchema:Ew,SetSharingTypeInputSchema:Sw,SynchronizationUnitSchema:sg,TransmitterTypeSchema:OD,TriggerDataSchema:MD,TriggerSchema:xw,TriggerTypeSchema:CD,UpdateFileInputSchema:Tw,UpdateNodeInputSchema:Iw,definedNonNullAnySchema:Z7,isDefinedNonNullAny:ID},Symbol.toStringTag,{value:"Module"})),sa={addFileOperation(t,e,n){if(t.nodes.find(a=>a.id===e.input.id))throw new Error(`Node with id ${e.input.id} already exists!`);const r=po({nodes:t.nodes,srcName:e.input.name,targetParentFolder:e.input.parentFolder||null}),i=e.input.synchronizationUnits,s=i.find(a=>!!t.nodes.find(c=>Or(c)&&c.synchronizationUnits.find(u=>u.syncId===a.syncId)));if(s)throw new Error(`A synchronization unit with Id ${s.syncId} already exists`);const o={id:e.input.id,name:r,kind:"file",parentFolder:e.input.parentFolder??null,synchronizationUnits:i,documentType:e.input.documentType};t.nodes.push(o),n==null||n({type:"CREATE_CHILD_DOCUMENT",input:{id:e.input.id,documentType:e.input.documentType,synchronizationUnits:i,document:e.input.document}})},addFolderOperation(t,e){if(t.nodes.find(r=>r.id===e.input.id))throw new Error(`Node with id ${e.input.id} already exists!`);const n=po({nodes:t.nodes,srcName:e.input.name,targetParentFolder:e.input.parentFolder||null});t.nodes.push({...e.input,name:n,kind:"folder",parentFolder:e.input.parentFolder??null})},deleteNodeOperation(t,e,n){const r=t.nodes.find(s=>s.id===e.input.id);if(!r)throw new Error(`Node with id ${e.input.id} not found`);const i=Iu(r,t.nodes);t.nodes=t.nodes.filter(s=>s.id!==e.input.id&&!i.find(o=>o.id===s.id)),[r,...i].filter(s=>Or(s)).forEach(s=>{n==null||n({type:"DELETE_CHILD_DOCUMENT",input:{id:s.id}})})},updateFileOperation(t,e){t.nodes=t.nodes.map(n=>n.id===e.input.id?{...n,name:po({nodes:t.nodes,srcName:e.input.name??n.name,targetParentFolder:e.input.parentFolder||null}),documentType:e.input.documentType??n.documentType}:n)},updateNodeOperation(t,e){t.nodes=t.nodes.map(n=>n.id===e.input.id?{...n,name:po({nodes:t.nodes,srcName:e.input.name??n.name,targetParentFolder:e.input.parentFolder||null}),parentFolder:e.input.parentFolder===null?null:n.parentFolder}:n)},copyNodeOperation(t,e,n){const r=t.nodes.find(a=>a.id===e.input.srcId);if(!r)throw new Error(`Node with id ${e.input.srcId} not found`);if(t.nodes.find(a=>a.id===e.input.targetId))throw new Error(`Node with id ${e.input.targetId} already exists`);const i=po({nodes:t.nodes,srcName:e.input.targetName||r.name,targetParentFolder:e.input.targetParentFolder||null}),s={...r,name:i,id:e.input.targetId,parentFolder:e.input.targetParentFolder||null},o=Or(s);if(o){const a=e.input.synchronizationUnits;if(!e.input.synchronizationUnits)throw new Error("Synchronization units were not provided");const c=a.find(u=>!!t.nodes.find(l=>Or(l)&&l.synchronizationUnits.find(d=>d.syncId===u.syncId)));if(c)throw new Error(`A synchronization unit with Id ${c.syncId} already exists`);s.synchronizationUnits=a}t.nodes.push(s),o&&(n==null||n({type:"COPY_CHILD_DOCUMENT",input:{id:e.input.srcId,newId:e.input.targetId,synchronizationUnits:s.synchronizationUnits}}))},moveNodeOperation(t,e){if(e.input.srcFolder===e.input.targetParentFolder)throw new Error("Circular Reference Error: Attempting to move a node to its current parent folder");const n=t.nodes.find(i=>i.id===e.input.srcFolder);if(!n)throw new Error(`Node with id ${e.input.srcFolder} not found`);const r=po({nodes:t.nodes,srcName:n.name,targetParentFolder:e.input.targetParentFolder||null});if(og(n)&&Iu(n,t.nodes).find(i=>i.id===e.input.targetParentFolder))throw new Error("Circular Reference Error: Cannot move a folder to one of its descendants");t.nodes=t.nodes.map(i=>i.id===e.input.srcFolder?{...i,name:r,parentFolder:e.input.targetParentFolder||null}:i)}},co={setDriveNameOperation(t,e,n){t.name=e.input.name},setDriveIconOperation(t,e,n){t.icon=e.input.icon},setSharingTypeOperation(t,e,n){t.sharingType=e.input.type},setAvailableOfflineOperation(t,e,n){t.availableOffline=e.input.availableOffline},addListenerOperation(t,e,n){if(t.listeners.find(r=>r.listenerId===e.input.listener.listenerId))throw new Error(`A listener with Id: ${e.input.listener.listenerId} already exists`);t.listeners.push(e.input.listener)},removeListenerOperation(t,e,n){t.listeners=t.listeners.filter(r=>r.listenerId!==e.input.listenerId)},addTriggerOperation(t,e,n){if(t.triggers.find(r=>r.id===e.input.trigger.id))throw new Error(`A trigger with Id: ${e.input.trigger.id} already exists`);t.triggers.push(e.input.trigger)},removeTriggerOperation(t,e,n){t.triggers=t.triggers.filter(r=>r.id!==e.input.triggerId)}},X7=(t,e,n)=>{if(zt.isBaseAction(e))return t;switch(e.type){case"ADD_FILE":lw().parse(e.input),sa.addFileOperation(t[e.scope],e,n);break;case"ADD_FOLDER":dw().parse(e.input),sa.addFolderOperation(t[e.scope],e,n);break;case"DELETE_NODE":mw().parse(e.input),sa.deleteNodeOperation(t[e.scope],e,n);break;case"UPDATE_FILE":Tw().parse(e.input),sa.updateFileOperation(t[e.scope],e,n);break;case"UPDATE_NODE":Iw().parse(e.input),sa.updateNodeOperation(t[e.scope],e,n);break;case"COPY_NODE":pw().parse(e.input),sa.copyNodeOperation(t[e.scope],e,n);break;case"MOVE_NODE":yw().parse(e.input),sa.moveNodeOperation(t[e.scope],e,n);break;case"SET_DRIVE_NAME":Ew().parse(e.input),co.setDriveNameOperation(t[e.scope],e,n);break;case"SET_DRIVE_ICON":ww().parse(e.input),co.setDriveIconOperation(t[e.scope],e,n);break;case"SET_SHARING_TYPE":Sw().parse(e.input),co.setSharingTypeOperation(t[e.scope],e,n);break;case"SET_AVAILABLE_OFFLINE":_w().parse(e.input),co.setAvailableOfflineOperation(t[e.scope],e,n);break;case"ADD_LISTENER":fw().parse(e.input),co.addListenerOperation(t[e.scope],e,n);break;case"REMOVE_LISTENER":vw().parse(e.input),co.removeListenerOperation(t[e.scope],e,n);break;case"ADD_TRIGGER":hw().parse(e.input),co.addTriggerOperation(t[e.scope],e,n);break;case"REMOVE_TRIGGER":bw().parse(e.input),co.removeTriggerOperation(t[e.scope],e,n);break;default:return t}},qa=zt.createReducer(X7),Q7={id:"",name:"",nodes:[],icon:null,slug:null},eW={listeners:[],triggers:[],sharingType:"private",availableOffline:!1},Vl={fileExtension:"phdd",createState(t){return{global:{...Q7,...t==null?void 0:t.global},local:{...eW,...t==null?void 0:t.local}}},createExtendedState(t){return zt.createExtendedState({...t,documentType:"powerhouse/document-drive"},Vl.createState)},createDocument(t){return zt.createDocument(Vl.createExtendedState(t),Vl.createState)},saveToFile(t,e,n){return zt.saveToFile(t,e,"phdd",n)},saveToFileHandle(t,e){return zt.saveToFileHandle(t,e)},loadFromFile(t){return zt.loadFromFile(t,qa)},loadFromInput(t){return zt.loadFromInput(t,qa)}},{createAction:uc}=zt,Ow=t=>uc("ADD_FILE",{...t},void 0,lw,"global"),LD=t=>uc("ADD_FOLDER",{...t},void 0,dw,"global"),FD=t=>uc("DELETE_NODE",{...t},void 0,mw,"global"),$D=t=>uc("UPDATE_FILE",{...t},void 0,Tw,"global"),jD=t=>uc("UPDATE_NODE",{...t},void 0,Iw,"global"),Cw=t=>uc("COPY_NODE",{...t},void 0,pw,"global"),UD=t=>uc("MOVE_NODE",{...t},void 0,yw,"global");class tW extends wf{addFile(e){return this.dispatch(Ow(e))}addFolder(e){return this.dispatch(LD(e))}deleteNode(e){return this.dispatch(FD(e))}updateFile(e){return this.dispatch($D(e))}updateNode(e){return this.dispatch(jD(e))}copyNode(e){return this.dispatch(Cw(e))}moveNode(e){return this.dispatch(UD(e))}}const{createAction:Ko}=zt,BD=t=>Ko("SET_DRIVE_NAME",{...t},void 0,Ew,"global"),zD=t=>Ko("SET_DRIVE_ICON",{...t},void 0,ww,"global"),VD=t=>Ko("SET_SHARING_TYPE",{...t},void 0,Sw,"local"),HD=t=>Ko("SET_AVAILABLE_OFFLINE",{...t},void 0,_w,"local"),WD=t=>Ko("ADD_LISTENER",{...t},void 0,fw,"local"),qD=t=>Ko("REMOVE_LISTENER",{...t},void 0,vw,"local"),GD=t=>Ko("ADD_TRIGGER",{...t},void 0,hw,"local"),ZD=t=>Ko("REMOVE_TRIGGER",{...t},void 0,bw,"local");class nW extends wf{setDriveName(e){return this.dispatch(BD(e))}setDriveIcon(e){return this.dispatch(zD(e))}setSharingType(e){return this.dispatch(VD(e))}setAvailableOffline(e){return this.dispatch(HD(e))}addListener(e){return this.dispatch(WD(e))}removeListener(e){return this.dispatch(qD(e))}addTrigger(e){return this.dispatch(GD(e))}removeTrigger(e){return this.dispatch(ZD(e))}}const YD=class KD extends wf{constructor(e,n){super(qa,Vl.createDocument(e),n)}saveToFile(e,n){return super.saveToFile(e,KD.fileExtension,n)}loadFromFile(e){return super.loadFromFile(e)}static async fromFile(e){const n=new this;return await n.loadFromFile(e),n}};G7(YD,"fileExtension","phdd");let kw=YD;$C(kw,[tW,nW]);const rW=Object.freeze(Object.defineProperty({__proto__:null,addFile:Ow,addFolder:LD,addListener:WD,addTrigger:GD,copyNode:Cw,deleteNode:FD,moveNode:UD,removeListener:qD,removeTrigger:ZD,setAvailableOffline:HD,setDriveIcon:zD,setDriveName:BD,setSharingType:VD,updateFile:$D,updateNode:jD},Symbol.toStringTag,{value:"Module"}));var Zn=[];for(var Dy=0;Dy<256;++Dy)Zn.push((Dy+256).toString(16).slice(1));function iW(t,e=0){return(Zn[t[e+0]]+Zn[t[e+1]]+Zn[t[e+2]]+Zn[t[e+3]]+"-"+Zn[t[e+4]]+Zn[t[e+5]]+"-"+Zn[t[e+6]]+Zn[t[e+7]]+"-"+Zn[t[e+8]]+Zn[t[e+9]]+"-"+Zn[t[e+10]]+Zn[t[e+11]]+Zn[t[e+12]]+Zn[t[e+13]]+Zn[t[e+14]]+Zn[t[e+15]]).toLowerCase()}var gh,sW=new Uint8Array(16);function oW(){if(!gh&&(gh=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!gh))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return gh(sW)}var aW=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const GS={randomUUID:aW};function cW(t,e,n){if(GS.randomUUID&&!t)return GS.randomUUID();t=t||{};var r=t.random||(t.rng||oW)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,iW(r)}function Or(t){return t.kind==="file"}function og(t){return t.kind==="folder"}function Dw(t,e){if(t.parentFolder){const n=e.find(r=>r.id===t.parentFolder);if(!n)throw new Error(`Parent node with id ${t.parentFolder} not found`);return[n,...Dw(n,e)]}else return[]}function Iu(t,e){const n=e.filter(i=>i.parentFolder===t.id),r=n.map(i=>Iu(i,e));return[...n,...r.flat()]}function JD(t,e,n){const r=n.find(a=>a.id===t.srcId);if(!r)throw new Error(`Node with id ${t.srcId} not found`);const i=[{...r,name:t.targetName||r.name,parentFolder:t.targetParentFolder||null},...Iu(r,n)],s={};t.targetParentFolder&&(s[t.targetParentFolder]=t.targetParentFolder);const o=a=>{let c=s[a];if(!c){const u=a;c=e(a),s[u]=c}return c};return i.map(a=>({srcId:a.id,targetId:o(a.id),targetName:a.name,targetParentFolder:a.parentFolder?o(a.parentFolder):null,synchronizationUnits:Or(a)?a.synchronizationUnits.map(c=>({...c,syncId:If(n)})):void 0}))}function If(t){let e="";for(;!e||t.find(n=>Or(n)&&n.synchronizationUnits.find(r=>r.syncId===e));)e=cW();return e}function Rw(t,e,n="main"){return e.map(r=>({scope:r,branch:n,syncId:If(t.nodes)}))}function Nw(t,e,n){return Ow({...e,synchronizationUnits:Rw(t,n)})}function XD(t,e){const n=t.nodes.find(i=>i.id===e.srcId);if(!n)throw new Error(`Node with id ${e.srcId} not found`);let r;return Or(n)&&(r=n.synchronizationUnits.map(i=>({...i,syncId:If(t.nodes)}))),Cw({...e,synchronizationUnits:r})}function Aw(t,e){let n=0;const r=new RegExp(`^${Pw(e)} \\(copy\\)(?: (\\d+))?$`);for(const i of t){const s=i.match(r);if(s){const o=s[1]?parseInt(s[1],10):1;o>n&&(n=o)}}return n+1}function Pw(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function po(t){const{nodes:e,targetParentFolder:n,srcName:r}=t,i=e.filter(s=>n===""?s.parentFolder===null:s.parentFolder===n).map(s=>s.name);return i.includes(r)?`${r} (copy) ${Aw(i,r)}`:r}const uW=Object.freeze(Object.defineProperty({__proto__:null,escapeRegExp:Pw,generateAddNodeAction:Nw,generateCopyNodeAction:XD,generateNodesCopy:JD,generateSynchronizationUnitId:If,generateSynchronizationUnits:Rw,getAncestors:Dw,getDescendants:Iu,getNextCopyNumber:Aw,handleTargetNameCollisions:po,isFileNode:Or,isFolderNode:og},Symbol.toStringTag,{value:"Module"})),QD=kw,Qd={...Vl,...uW},Jn={...FC,...rW},eR={Document:QD,reducer:qa,actions:Jn,utils:Qd,documentModel:ig},lW=Object.freeze(Object.defineProperty({__proto__:null,Document:QD,DocumentDrive:kw,actions:Jn,documentModel:ig,escapeRegExp:Pw,generateAddNodeAction:Nw,generateCopyNodeAction:XD,generateNodesCopy:JD,generateSynchronizationUnitId:If,generateSynchronizationUnits:Rw,getAncestors:Dw,getDescendants:Iu,getNextCopyNumber:Aw,handleTargetNameCollisions:po,isFileNode:Or,isFolderNode:og,module:eR,reducer:qa,utils:Qd,z:J7},Symbol.toStringTag,{value:"Module"}));let tR=()=>({emit(t,...e){for(let n=this.events[t]||[],r=0,i=n.length;r<i;r++)n[r](...e)},events:{},on(t,e){var n;return((n=this.events)[t]||(n[t]=[])).push(e),()=>{var r;this.events[t]=(r=this.events[t])==null?void 0:r.filter(i=>e!==i)}}});class nR{constructor(){Ve(this,"cache",new Map)}async setDocument(e,n,r){var a;const i=r.operations.global.map(c=>(delete c.resultingState,c)),s=r.operations.local.map(c=>(delete c.resultingState,c)),o={...r,operations:{global:i,local:s}};return this.cache.has(e)||this.cache.set(e,new Map),(a=this.cache.get(e))==null||a.set(n,o),!0}async deleteDocument(e,n){var r;return((r=this.cache.get(e))==null?void 0:r.delete(n))??!1}async getDocument(e,n){var r;return(r=this.cache.get(e))==null?void 0:r.get(n)}}class dW extends Error{constructor(e,n){super(`Document model "${e}" not found`,{cause:n}),this.id=e}}class xr extends Error{constructor(n,r,i,s){super(i,{cause:s??r});Ve(this,"status");Ve(this,"operation");this.status=n,this.operation=r}}class fW extends xr{constructor(e,n){super("CONFLICT",n,`Conflicting operation on index ${n.index}`,{existingOperation:e,newOperation:n})}}class hW extends Error{constructor(n){super(`Drive already exists. ID: ${n}`);Ve(this,"driveId");this.driveId=n}}class Hl extends Error{constructor(n){super(`Drive with id ${n} not found`);Ve(this,"driveId");this.driveId=n}}class rR extends Error{constructor(n,r){super(n);Ve(this,"syncUnitId");this.syncUnitId=r}}var ef;(t=>{t.useMessageChannel=typeof MessageChannel>"u"?new Error("MessageChannel is not supported"):r=>{const i=new AbortController,s=i.signal,o=new MessageChannel;return o.port1.postMessage(null),o.port2.addEventListener("message",()=>{r(),o.port1.close(),o.port2.close()},{once:!0,signal:s}),o.port2.start(),()=>i.abort()},t.usePostMessage=(()=>{const r=typeof window=="object"&&window||typeof global=="object"&&global||typeof self=="object"&&self;if(!r)return new Error("No global object found");const i=r;if(!i.postMessage||!i.addEventListener||i.importScripts)return new Error("postMessage is not supported");let s=0;const o=new Map;function a(){return s===9007199254740991?0:++s}const c="com.usePostMessage"+Math.random();return i.addEventListener("message",u=>{const l=u;if(typeof l.data!="string"||l.source!==i||!l.data.startsWith(c))return;const d=l.data.split(":").at(1);if(d===void 0)return;const f=+d,h=o.get(f);h&&(h(),o.delete(f))},!1),u=>{const l=a();return o.set(l,u),i.postMessage(c+":"+l,{targetOrigin:"*"}),()=>{o.delete(l)}}})(),t.useSetImmediate=typeof window<"u"?new Error("setImmediate is not supported on the browser"):typeof setImmediate>"u"?new Error("setImmediate is not supported"):r=>{const i=setImmediate(r);return()=>clearImmediate(i)},t.useSetTimeout=r=>{const i=setTimeout(r,0);return()=>clearTimeout(i)};function e(r){return t.useSetImmediate instanceof Error?t.useMessageChannel instanceof Error?t.usePostMessage instanceof Error?(0,t.useSetTimeout)(r):(0,t.usePostMessage)(r):(0,t.useMessageChannel)(r):(0,t.useSetImmediate)(r)}t.runAsap=e;function n(r,i=e){if(i instanceof Error)throw new Error("queueMethod is not supported",{cause:i});return new Promise((s,o)=>{i(()=>{r().then(s).catch(o)})})}t.runAsapAsync=n})(ef||(ef={}));const pW=ef.runAsap,mW=ef.runAsapAsync;function aa(t){return t.documentType===ig.id}function Xp(t,e){const n=Object.keys(t).reduce((i,s)=>{var a;const o=s;return i[o]=((a=t[o].at(-1))==null?void 0:a.index)??0,i},{}),r=e.find(i=>i.index<(n[i.scope]??0));if(r)throw new xr("ERROR",r,`Tried to add operation with index ${r.index} and document is at index ${n[r.scope]}`);return e.sort((i,s)=>i.index-s.index).reduce((i,s)=>{const o=i[s.scope]||[];return{...i,[s.scope]:[...o,s]}},t)}function Mw(){return $_()}function gW(t,e){return new Date(t)<new Date(e)}function Kh(t){return"operations"in t}function yW(t){return"actions"in t}class vW{constructor(e){Ve(this,"id");Ve(this,"blocked",!1);Ve(this,"deleted",!1);Ve(this,"items",[]);Ve(this,"dependencies",new Array);this.id=e}async setDeleted(e){this.deleted=e}async isDeleted(){return this.deleted}async addJob(e){return this.items.push(e),Promise.resolve()}async getNextJob(){const e=this.items.shift();return Promise.resolve(e)}async amountOfJobs(){return Promise.resolve(this.items.length)}getId(){return this.id}async setBlocked(e){this.blocked=e}async isBlocked(){return this.blocked}async getJobs(){return this.items}async addDependencies(e){this.dependencies.find(n=>n.jobId===e.jobId)||this.dependencies.push(e),this.isBlocked()||this.setBlocked(!0)}async removeDependencies(e){this.dependencies=this.dependencies.filter(n=>n.jobId!==e.jobId&&n.driveId!==e.driveId),this.dependencies.length===0&&await this.setBlocked(!1)}}class iR{constructor(e=3,n=0){Ve(this,"emitter",tR());Ve(this,"ticker",0);Ve(this,"queues",[]);Ve(this,"workers");Ve(this,"timeout");Ve(this,"delegate");this.workers=e,this.timeout=n}async init(e,n){this.delegate=e;for(let r=0;r<this.workers;r++)setTimeout(()=>this.processNextJob.bind(this)().catch(n),100*r);return Promise.resolve()}async addJob(e){if(!this.delegate)throw new Error("No server delegate defined");const n=Mw(),r=this.getQueue(e.driveId,e.documentId);if(await r.isDeleted())throw new Error("Queue is deleted");if(e.documentId&&!await this.delegate.checkDocumentExists(e.driveId,e.documentId)&&!await r.isBlocked()){await r.setBlocked(!0);const u=await this.getQueue(e.driveId).getJobs();for(const l of u)(Kh(l)?l.operations:l.actions).find(h=>{const m=h.input;return h.type==="ADD_FILE"&&m.id===e.documentId})&&await r.addDependencies(l)}const s=Kh(e)?e.operations:e.actions,o=s.filter(c=>c.type==="ADD_FILE");for(const c of o){const u=c.input;await this.getQueue(e.driveId,u.id).addDependencies({jobId:n,...e})}const a=s.filter(c=>c.type==="DELETE_NODE");for(const c of a){const u=c.input;await this.getQueue(e.driveId,u.id).setDeleted(!0)}return await r.addJob({jobId:n,...e}),n}getQueue(e,n){const r=this.getQueueId(e,n);let i=this.queues.find(s=>s.getId()===r);return i||(i=new vW(r),this.queues.push(i)),i}removeQueue(e,n){const r=this.getQueueId(e,n);this.queues=this.queues.filter(i=>i.getId()!==r),this.emit("queueRemoved",r)}getQueueByIndex(e){const n=this.queues[e];return n||null}getQueues(){return this.queues.map(e=>e.getId())}retryNextJob(e){const n=e!==void 0?e:this.timeout;(n>0?i=>setTimeout(i,n):pW)(()=>this.processNextJob())}async findFirstNonEmptyQueue(e){const n=this.queues.length;for(let r=0;r<n;r++){const i=(e+r)%n,s=this.queues[i];if(s&&await s.amountOfJobs()>0)return i}return null}async processNextJob(){if(!this.delegate)throw new Error("No server delegate defined");if(this.queues.length===0){this.retryNextJob();return}const e=this.queues[this.ticker];if(!e){this.ticker=0,this.retryNextJob();return}if(await e.amountOfJobs()===0){const s=await this.findFirstNonEmptyQueue(this.ticker);s!==null?(this.ticker=s,this.retryNextJob(0)):this.retryNextJob();return}if(this.ticker=this.ticker===this.queues.length-1?0:this.ticker+1,await e.isBlocked()){this.retryNextJob();return}await e.setBlocked(!0);const i=await e.getNextJob();if(!i){this.retryNextJob();return}try{const s=await this.delegate.processJob(i),a=(Kh(i)?i.operations:i.actions).filter(c=>c.type==="ADD_FILE");if(a.length>0)for(const c of a)await this.getQueue(i.driveId,c.input.id).removeDependencies(i);this.emit("jobCompleted",i,s)}catch(s){_t.error("job failed",s),this.emit("jobFailed",i,s)}finally{await e.setBlocked(!1),this.retryNextJob(0)}}emit(e,...n){this.emitter.emit(e,...n)}on(e,n){return this.emitter.on(e,n)}getQueueId(e,n){return`queue:${e}${n?`:${n}`:""}`}}class ag extends Error{}class ca extends ag{constructor(e){super(`Read drive ${e} not found.`)}}class bW extends ag{constructor(e){super(`Read drive with slug ${e} not found.`)}}class ZS extends ag{constructor(e,n){super(`Document with id ${n} not found on read drive ${e}.`)}}var df,mi,Xa,Xv,sR;class _W{constructor(e){bt(this,Xa);bt(this,df);bt(this,mi,new Map);ht(this,df,e)}async fetchDrive(e){const n=ce(this,mi).get(e);if(!n)return new ca(e);const r=await this.fetchDocument(e,e,ig.id);if(r instanceof Error)return r;const i={...r,readContext:n.context};return n.drive=i,i}async fetchDocument(e,n,r){const i=ce(this,mi).get(e);if(!i)return new ca(e);let s;try{s=ce(this,df).call(this,r)}catch(u){return new dW(r,u)}const{url:o}=i.context,{errors:a,document:c}=await HS(o,n,s);if(a){const u=sn(this,Xa,Xv).call(this,a,e,n);if(u instanceof ag)return u;if(u)throw u}return c||new ZS(e,n)}async addReadDrive(e,n){const{id:r}=(n==null?void 0:n.expectedDriveInfo)??await pa(e),i=await sn(this,Xa,sR).call(this,r,e);if(i instanceof Error)throw i;if(!i)throw new Error(`Drive "${r}" not found at ${e}`);ce(this,mi).set(r,{drive:i,context:{...n,url:e}})}async getReadDrives(){return Promise.resolve([...ce(this,mi).keys()])}async getReadDrive(e){const n=ce(this,mi).get(e);return Promise.resolve(n?{...n.drive,readContext:n.context}:new ca(e))}async getReadDriveBySlug(e){const n=[...ce(this,mi).values()].find(({drive:r})=>r.state.global.slug===e);return Promise.resolve(n?{...n.drive,readContext:n.context}:new bW(e))}getReadDriveContext(e){var n;return Promise.resolve(((n=ce(this,mi).get(e))==null?void 0:n.context)??new ca(e))}deleteReadDrive(e){const n=ce(this,mi).delete(e);return Promise.resolve(n?void 0:new ca(e))}}df=new WeakMap,mi=new WeakMap,Xa=new WeakSet,Xv=function(e,n,r){for(const s of e){if(s.message===`Drive with id ${n} not found`)return new ca(n);if(r&&s.message===`Document with id ${r} not found`)return new ZS(n,r)}const i=e.at(0);if(i)return i},sR=async function(e,n){const{errors:r,document:i}=await HS(n,e,lW);return(r?sn(this,Xa,Xv).call(this,r,e):void 0)||i};function wW(t){var e,n,r,Jh,Xh,o;return o=class extends t{constructor(...u){super(...u);bt(this,r);bt(this,e);bt(this,n,new Set);ht(this,e,new _W(this.getDocumentModel.bind(this))),sn(this,r,Jh).call(this).then(l=>{l.length&&sn(this,r,Xh).call(this,l,"add")}).catch(_t.error)}getReadDrives(){return ce(this,e).getReadDrives()}getReadDrive(u){return ce(this,e).getReadDrive(u)}getReadDriveBySlug(u){return ce(this,e).getReadDriveBySlug(u)}getReadDriveContext(u){return ce(this,e).getReadDriveContext(u)}async addReadDrive(u,l){await ce(this,e).addReadDrive(u,l),sn(this,r,Xh).call(this,await sn(this,r,Jh).call(this),"add")}fetchDrive(u){return ce(this,e).fetchDrive(u)}fetchDocument(u,l,d){return ce(this,e).fetchDocument(u,l,d)}async deleteReadDrive(u){const l=await ce(this,e).deleteReadDrive(u);if(l)return l;sn(this,r,Xh).call(this,await sn(this,r,Jh).call(this),"delete")}async migrateReadDrive(u,l){const d=await this.getReadDriveContext(u);if(d instanceof Error)return d;const{url:f,...h}=d;try{return await this.addRemoteDrive(f,l)}catch(m){throw _t.error(m),await this.addReadDrive(d.url,h),m}}onReadDrivesUpdate(u){return ce(this,n).add(u),Promise.resolve(()=>ce(this,n).delete(u))}},e=new WeakMap,n=new WeakMap,r=new WeakSet,Jh=async function(){const u=await this.getReadDrives();return(await Promise.all(u.map(d=>this.getReadDrive(d)))).filter(d=>!(d instanceof Error))},Xh=function(u,l){ce(this,n).forEach(d=>d(u,l))},o}class EW{constructor(){Ve(this,"documents");Ve(this,"drives");Ve(this,"slugToDriveId",{});this.documents={},this.drives={}}checkDocumentExists(e,n){var r;return Promise.resolve(((r=this.documents[e])==null?void 0:r[n])!==void 0)}async getDocuments(e){return Object.keys(this.documents[e]??{})}async getDocument(e,n){const r=this.documents[e];if(!r)throw new Hl(e);const i=r[n];if(!i)throw new Error(`Document with id ${n} not found`);return i}async saveDocument(e,n,r){this.documents[e]=this.documents[e]??{},this.documents[e][n]=r}async clearStorage(){this.documents={},this.drives={}}async createDocument(e,n,r){this.documents[e]=this.documents[e]??{};const{operations:i,initialState:s,name:o,revision:a,documentType:c,created:u,lastModified:l,clipboard:d,state:f}=r;this.documents[e][n]={operations:i,initialState:s,name:o,revision:a,documentType:c,created:u,lastModified:l,clipboard:d,state:f}}async addDocumentOperations(e,n,r,i){const s=await this.getDocument(e,n);if(!s)throw new Error(`Document with id ${n} not found`);const o=Xp(s.operations,r);this.documents[e][n]={...s,...i,operations:o}}async deleteDocument(e,n){if(!this.documents[e])throw new Hl(e);delete this.documents[e][n]}async getDrives(){return Object.keys(this.drives)}async getDrive(e){const n=this.drives[e];if(!n)throw new Hl(e);return n}async getDriveBySlug(e){const n=this.slugToDriveId[e];if(!n)throw new Error(`Drive with slug ${e} not found`);return this.getDrive(n)}async createDrive(e,n){this.drives[e]=n,this.documents[e]={};const{slug:r}=n.initialState.state.global;r&&(this.slugToDriveId[r]=e)}async addDriveOperations(e,n,r){const i=await this.getDrive(e),s=Xp(i.operations,n);this.drives[e]={...i,...r,operations:s}}async deleteDrive(e){delete this.documents[e],delete this.drives[e]}async getSynchronizationUnitsRevision(e){return(await Promise.allSettled(e.map(async r=>{try{const i=await(r.documentId?this.getDocument(r.driveId,r.documentId):this.getDrive(r.driveId));if(!i)return;const s=i.operations[r.scope].at(-1);if(s)return{driveId:r.driveId,documentId:r.documentId,scope:r.scope,branch:r.branch,lastUpdated:s.timestamp,revision:s.index}}catch{return}}))).reduce((r,i)=>(i.status==="fulfilled"&&i.value!==void 0&&r.push(i.value),r),[])}}function SW(t){return typeof t.getReadDrives=="function"}class xW{constructor(e,n,r){Ve(this,"defaultRemoteDrives",new Map);Ve(this,"removeOldRemoteDrivesConfig");if(this.server=e,this.delegate=n,r!=null&&r.defaultDrives.remoteDrives)for(const i of r.defaultDrives.remoteDrives)this.defaultRemoteDrives.set(i.url,{...i,status:"PENDING"});this.removeOldRemoteDrivesConfig=(r==null?void 0:r.defaultDrives.removeOldRemoteDrives)||{strategy:"preserve-all"}}getDefaultRemoteDrives(){return new Map(JSON.parse(JSON.stringify(Array.from(this.defaultRemoteDrives))))}async deleteDriveById(e){try{await this.server.deleteDrive(e)}catch(n){n instanceof Hl||_t.error(n)}}async preserveDrivesById(e,n,r="detach"){const i=n.map(a=>this.server.getDrive(a)),o=(await Promise.all(i)).filter(a=>a.state.local.listeners.length>0||a.state.local.triggers.length>0).filter(a=>!e.includes(a.state.global.id)).map(a=>a.state.global.id);r==="detach"?await this.detachDrivesById(o):await this.removeDrivesById(o)}async removeDrivesById(e){for(const n of e)await this.deleteDriveById(n)}async detachDrivesById(e){const n=e.map(r=>this.delegate.detachDrive(r));await Promise.all(n)}async removeOldremoteDrives(){const e=await this.server.getDrives();switch(this.removeOldRemoteDrivesConfig.strategy){case"preserve-by-id-and-detach":case"preserve-by-id":{const n=this.removeOldRemoteDrivesConfig.strategy==="preserve-by-id-and-detach"?"detach":"remove";await this.preserveDrivesById(this.removeOldRemoteDrivesConfig.ids,e,n);break}case"preserve-by-url-and-detach":case"preserve-by-url":{const n=this.removeOldRemoteDrivesConfig.strategy==="preserve-by-url-and-detach"?"detach":"remove",r=this.removeOldRemoteDrivesConfig.urls.map(s=>pa(s)),i=(await Promise.all(r)).map(s=>s.id);await this.preserveDrivesById(i,e,n);break}case"remove-by-id":{const n=this.removeOldRemoteDrivesConfig.ids.filter(r=>e.includes(r));await this.removeDrivesById(n);break}case"remove-by-url":{const n=this.removeOldRemoteDrivesConfig.urls.map(s=>pa(s)),i=(await Promise.all(n)).map(s=>s.id).filter(s=>e.includes(s));await this.removeDrivesById(i);break}case"remove-all":{const n=e.map(s=>this.server.getDrive(s)),i=(await Promise.all(n)).filter(s=>s.state.local.listeners.length>0||s.state.local.triggers.length>0).map(s=>s.state.global.id);await this.removeDrivesById(i);break}case"detach-by-id":{const r=this.removeOldRemoteDrivesConfig.ids.filter(i=>e.includes(i)).map(i=>this.delegate.detachDrive(i));await Promise.all(r);break}case"detach-by-url":{const n=this.removeOldRemoteDrivesConfig.urls.map(o=>pa(o)),s=(await Promise.all(n)).map(o=>o.id).filter(o=>e.includes(o)).map(o=>this.delegate.detachDrive(o));await Promise.all(s);break}}}async setAllDefaultDrivesAccessLevel(e){const n=this.defaultRemoteDrives.values();for(const r of n)await this.setDefaultDriveAccessLevel(r.url,e)}async setDefaultDriveAccessLevel(e,n){const r=this.defaultRemoteDrives.get(e);if(r&&r.options.accessLevel!==n){const i={...r,options:{...r.options,accessLevel:n}};this.defaultRemoteDrives.set(e,i),await this.initializeDefaultRemoteDrives([i])}}async initializeDefaultRemoteDrives(e=Array.from(this.defaultRemoteDrives.values())){const n=await this.server.getDrives(),r=SW(this.server)?this.server:void 0,i=await(r==null?void 0:r.getReadDrives());for(const s of e){let o={...s};try{const a=s.metadata??await pa(s.url);o={...s,metadata:a},this.defaultRemoteDrives.set(s.url,o);const c=n.includes(a.id),u=i==null?void 0:i.includes(a.id),l=s.options.accessLevel!==void 0,d=r&&s.options.accessLevel==="READ",f=d?u:c;if(l&&(d?c:u))try{await(d?this.server.deleteDrive(a.id):r==null?void 0:r.deleteReadDrive(a.id))}catch(m){_t.error(m)}if(f){o.status="ALREADY_ADDED",this.defaultRemoteDrives.set(s.url,o),this.delegate.emit("ALREADY_ADDED",this.defaultRemoteDrives,o,a.id,a.name);continue}o.status="ADDING",this.defaultRemoteDrives.set(s.url,o),this.delegate.emit("ADDING",this.defaultRemoteDrives,o),!l&&r||d?await r.addReadDrive(s.url,{...s.options,expectedDriveInfo:a}):await this.server.addRemoteDrive(s.url,{...s.options,expectedDriveInfo:a}),o.status="SUCCESS",this.defaultRemoteDrives.set(s.url,o),this.delegate.emit("SUCCESS",this.defaultRemoteDrives,o,a.id,a.name)}catch(a){o.status="ERROR",this.defaultRemoteDrives.set(s.url,o),this.delegate.emit("ERROR",this.defaultRemoteDrives,o,void 0,void 0,a)}}}}const{attachBranch:TW,garbageCollect:IW,groupOperationsByScope:OW,merge:CW,split:fse,precedes:kW,removeExistingOperations:DW,reshuffleByTimestamp:RW,sortOperations:NW,addUndo:hse,checkOperationsIntegrity:pse,checkCleanedOperationsIntegrity:mse,reshuffleByTimestampAndIndex:gse,nextSkipNumber:yse,prepareOperations:vse,IntegrityIssueSubType:bse,IntegrityIssueType:_se}=zt.documentHelpers;class AW{}const Qv={sequentialUpdates:!0};class PW{constructor(e,n=new Map,r=Qv){Ve(this,"drive");Ve(this,"listenerState",new Map);Ve(this,"options");Ve(this,"transmitters",{});this.drive=e,this.listenerState=n,this.options={...Qv,...r}}}var wm,aR;class oR{constructor(e,n){bt(this,wm);Ve(this,"drive");Ve(this,"listener");Ve(this,"receiver");this.listener=e,this.drive=n}async transmit(e,n){var i;if(!this.receiver)return[];const r=[];for(const s of e){const o=await sn(this,wm,aR).call(this,s),a=((i=o.at(-1))==null?void 0:i.state)??{};r.push({...s,operations:o,state:a})}try{return await this.receiver.onStrands(r),e.map(({operations:s,...o})=>{var a;return{...o,status:"SUCCESS",revision:((a=s.at(s.length-1))==null?void 0:a.index)??-1}})}catch(s){return _t.error(s),e.map(({operations:o,...a})=>{var c;return{...a,status:"ERROR",revision:(((c=o.at(0))==null?void 0:c.index)??0)-1}})}}setReceiver(e){this.receiver=e}async disconnect(){var e;await((e=this.receiver)==null?void 0:e.onDisconnect())}getListener(){return this.listener}}wm=new WeakSet,aR=async function(e){const n=[],r=new Map,i=async s=>{const o=r.get(s);if(o)return o;const a={revisions:{[e.scope]:s},checkHashes:!1},c=await(e.documentId?this.drive.getDocument(e.driveId,e.documentId,a):this.drive.getDrive(e.driveId,a));return s<0?r.set(s,c.initialState.state[e.scope]):r.set(s,c.state[e.scope]),r.get(s)};for(const s of e.operations)n.push({...s,state:await i(s.index),previousState:await i(s.index-1)});return n};class Ps{constructor(e,n,r){Ve(this,"drive");Ve(this,"listener");Ve(this,"manager");this.listener=e,this.drive=n,this.manager=r}getStrands(e){return this.manager.getStrands(this.listener.driveId,this.listener.listenerId,e)}disconnect(){return Promise.resolve()}async processAcknowledge(e,n,r){const i=await this.manager.getListenerSyncUnitIds(e,n);let s=!0;for(const o of r){const a=i.find(c=>c.scope===o.scope&&c.branch===o.branch&&c.driveId===o.driveId&&c.documentId==o.documentId);if(!a){_t.warn("Unknown sync unit was acknowledged",o),s=!1;continue}await this.manager.updateListenerRevision(n,e,a.syncId,o.revision)}return s}static async registerPullResponder(e,n,r){var o;const i=await Qc(n,Xc`
330
- mutation registerPullResponderListener($filter: InputListenerFilter!) {
331
- registerPullResponderListener(filter: $filter) {
332
- listenerId
333
- }
334
- }
335
- `,{filter:r}),s=(o=i.errors)==null?void 0:o.at(0);if(s)throw s;if(!i.registerPullResponderListener)throw new Error("Error registering listener");return i.registerPullResponderListener.listenerId}static async pullStrands(e,n,r,i){var a;const s=await Qc(n,Xc`
336
- query strands($listenerId: ID!) {
337
- system {
338
- sync {
339
- strands(listenerId: $listenerId) {
340
- driveId
341
- documentId
342
- scope
343
- branch
344
- operations {
345
- id
346
- timestamp
347
- skip
348
- type
349
- input
350
- hash
351
- index
352
- context {
353
- signer {
354
- user {
355
- address
356
- networkId
357
- chainId
358
- }
359
- app {
360
- name
361
- key
362
- }
363
- signatures
364
- }
365
- }
366
- }
367
- }
368
- }
369
- }
370
- }
371
- `,{listenerId:r}),o=(a=s.errors)==null?void 0:a.at(0);if(o)throw o;return s.system?s.system.sync.strands.map(c=>({...c,operations:c.operations.map(u=>({...u,input:JSON.parse(u.input)}))})):[]}static async acknowledgeStrands(e,n,r,i){var a;const s=await Qc(n,Xc`
372
- mutation acknowledge(
373
- $listenerId: String!
374
- $revisions: [ListenerRevisionInput]
375
- ) {
376
- acknowledge(listenerId: $listenerId, revisions: $revisions)
377
- }
378
- `,{listenerId:r,revisions:i}),o=(a=s.errors)==null?void 0:a.at(0);if(o)throw o;if(s.acknowledge===null)throw new Error("Error acknowledging strands");return s.acknowledge}static async executePull(e,n,r,i,s,o){var a;try{const{url:c,listenerId:u}=n.data,l=await Ps.pullStrands(e,c,u);if(!l.length){s==null||s([]);return}const d=[];for(const f of l){const h=f.operations.map(p=>({...p,scope:f.scope,branch:f.branch}));let m;try{const p=await r(f,{type:"trigger",trigger:n});if(p.error)throw p.error}catch(p){m=p,i(m)}d.push({branch:f.branch,documentId:f.documentId||"",driveId:f.driveId,revision:((a=h.pop())==null?void 0:a.index)??-1,scope:f.scope,status:m?m instanceof xr?m.status:"ERROR":"SUCCESS",error:m})}s==null||s(d),await Ps.acknowledgeStrands(e,c,u,d.map(f=>{const{error:h,...m}=f;return m})).then(f=>o==null?void 0:o(f)).catch(f=>_t.error("ACK error",f))}catch(c){i(c)}}static setupPull(e,n,r,i,s,o){const{interval:a}=n.data;let c=YW;if(a)try{const f=parseInt(a);f&&(c=f)}catch{}let u=!1,l;return(async()=>{for(;!u;)await this.executePull(e,n,r,i,s,o),await new Promise(f=>{l=setTimeout(f,c)})})().catch(_t.error),()=>{u=!0,l!==void 0&&clearTimeout(l)}}static async createPullResponderTrigger(e,n,r){const{pullFilter:i,pullInterval:s}=r,o=await Ps.registerPullResponder(e,n,i??{documentId:["*"],documentType:["*"],branch:["*"],scope:["*"]});return{id:Mw(),type:"PullResponder",data:{url:n,listenerId:o,interval:(s==null?void 0:s.toString())??""}}}static isPullResponderTrigger(e){return e.type==="PullResponder"}}var MW={space:"",cycles:!1,replacer:(t,e)=>e,stringify:JSON.stringify},lc={isArray:Array.isArray,assign:Object.assign,isObject:t=>typeof t=="object",isFunction:t=>typeof t=="function",isBoolean:t=>typeof t=="boolean",isRegex:t=>t instanceof RegExp,keys:Object.keys};const hl=MW,LW=lc.isFunction,FW=lc.isBoolean,$W=lc.isObject,jW=lc.isArray,UW=lc.isRegex,BW=lc.assign,zW=lc.keys;function VW(t){return t==null?t:UW(t)?t.toString():t.toJSON?t.toJSON():t}function HW(t,e){e=e||BW({},hl),LW(e)&&(e={compare:e});const n=e.space||hl.space,r=FW(e.cycles)?e.cycles:hl.cycles,i=e.replacer||hl.replacer,s=e.stringify||hl.stringify,o=e.compare&&function(c){return function(u){return function(l,d){const f={key:l,value:u[l]},h={key:d,value:u[d]};return c(f,h)}}}(e.compare);r||s(t);const a=[];return function c(u,l,d,f){const h=n?`
379
- `+new Array(f+1).join(n):"",m=n?": ":":";if(d=VW(d),d=i.call(u,l,d),d!==void 0){if(!$W(d)||d===null)return s(d);if(jW(d)){const p=[];for(let g=0;g<d.length;g++){const y=c(d,g,d[g],f+1)||s(null);p.push(h+n+y)}return"["+p.join(",")+h+"]"}else{if(r){if(a.indexOf(d)!==-1)return s("[Circular]");a.push(d)}const p=zW(d).sort(o&&o(d)),g=[];for(let y=0;y<p.length;y++){const v=p[y],b=c(d,v,d[v],f+1);if(!b)continue;const E=s(v)+m+b;g.push(h+n+E)}return a.splice(a.indexOf(d),1),"{"+g.join(",")+h+"}"}}}({"":t},"",t,0)}var WW=HW;const qW=ec(WW);class GW{constructor(e,n){Ve(this,"drive");Ve(this,"listener");Ve(this,"targetURL");this.listener=e,this.drive=n,this.targetURL=e.callInfo.data}async transmit(e,n){var r;if(n.type==="trigger"&&((r=n.trigger.data)==null?void 0:r.url)===this.targetURL)return e.map(i=>{var s;return{driveId:i.driveId,documentId:i.documentId,scope:i.scope,branch:i.branch,status:"SUCCESS",revision:((s=i.operations.at(-1))==null?void 0:s.index)??-1}});try{const{pushUpdates:i}=await Qc(this.targetURL,Xc`
380
- mutation pushUpdates($strands: [InputStrandUpdate!]) {
381
- pushUpdates(strands: $strands) {
382
- driveId
383
- documentId
384
- scope
385
- branch
386
- status
387
- revision
388
- error
389
- }
390
- }
391
- `,{strands:e.map(s=>({...s,operations:s.operations.map(o=>({...o,input:qW(o.input)}))}))});if(!i)throw new Error("Couldn't update listener revision");return i}catch(i){throw _t.error(i),i}return[]}}function ZW(t,e=250){let n;return(r,...i)=>(n&&clearTimeout(n),new Promise((s,o)=>{r?t(...i).then(s).catch(o):n=setTimeout(()=>{t(...i).then(s).catch(o)},e)}))}const Em=class Em extends PW{constructor(){super(...arguments);Ve(this,"triggerUpdate",ZW(this._triggerUpdate.bind(this),Em.LISTENER_UPDATE_DELAY))}async getTransmitter(n,r){var i;return Promise.resolve((i=this.transmitters[n])==null?void 0:i[r])}driveHasListeners(n){return this.listenerState.has(n)}async addListener(n){var a;const r=n.driveId;this.listenerState.has(r)||this.listenerState.set(r,new Map),this.listenerState.get(r).set(n.listenerId,{block:n.block,driveId:n.driveId,pendingTimeout:"0",listener:n,listenerStatus:"CREATED",syncUnits:new Map});let s;switch((a=n.callInfo)==null?void 0:a.transmitterType){case"SwitchboardPush":{s=new GW(n,this.drive);break}case"PullResponder":{s=new Ps(n,this.drive,this);break}case"Internal":{s=new oR(n,this.drive);break}}if(!s)throw new Error("Transmitter not found");const o=this.transmitters[r]||{};return o[n.listenerId]=s,this.transmitters[r]=o,this.triggerUpdate(!0,{type:"local"}),Promise.resolve(s)}async removeListener(n,r){const i=this.listenerState.get(n);return i?Promise.resolve(i.delete(r)):!1}async removeSyncUnits(n,r){const i=this.listenerState.get(n);if(i){for(const[,s]of i)for(const o of r)s.syncUnits.delete(o.syncId);return Promise.resolve()}}async updateSynchronizationRevisions(n,r,i,s,o,a=!1){const c=this.listenerState.get(n);if(!c)return[];const u=[];for(const[,l]of c){if(u.find(f=>f.listenerId===l.listener.listenerId))continue;const d=await this.getTransmitter(n,l.listener.listenerId);if(d!=null&&d.transmit)for(const f of r){if(!this._checkFilter(l.listener.filter,f))continue;const h=l.syncUnits.get(f.syncId);if(!h||h.listenerRev<f.revision){u.push(l.listener);break}}}return u.length?(s==null||s(u),this.triggerUpdate(a,i,o)):[]}async updateListenerRevision(n,r,i,s){const o=this.listenerState.get(r);if(!o)return;const a=o.get(n);if(!a)return;const c=new Date().toISOString(),u=a.syncUnits.get(i);return u?(u.listenerRev=s,u.lastUpdated=c):a.syncUnits.set(i,{listenerRev:s,lastUpdated:c}),Promise.resolve()}async _triggerUpdate(n,r){var s;const i=[];for(const[o,a]of this.listenerState)for(const[c,u]of a){const l=await this.getTransmitter(o,c);if(!(l!=null&&l.transmit))continue;const d=await this.getListenerSyncUnits(o,u.listener.listenerId),f=[],h=d.map(m=>async()=>{const p=u.syncUnits.get(m.syncId);if(p&&p.listenerRev>=m.revision)return;const g=[];try{const y=await this.drive.getOperationData(o,m.syncId,{fromRevision:p==null?void 0:p.listenerRev});g.push(...y)}catch(y){_t.error(y)}g.length&&f.push({driveId:o,documentId:m.documentId,branch:m.branch,operations:g,scope:m.scope})});if(this.options.sequentialUpdates)for(const m of h)await m();else await Promise.all(h.map(m=>m()));if(f.length!=0){u.pendingTimeout=new Date(new Date().getTime()/1e3+300).toISOString(),u.listenerStatus="PENDING";try{const m=await l.transmit(f,n);u.pendingTimeout="0",u.listenerStatus="PENDING";const p=new Date().toISOString();for(const g of m){const y=d.find(v=>g.documentId===v.documentId&&g.scope===v.scope&&g.branch===v.branch);y?u.syncUnits.set(y.syncId,{lastUpdated:p,listenerRev:g.revision}):_t.warn(`Received revision for untracked unit for listener ${u.listener.listenerId}`,g)}for(const g of m){const y=g.status==="ERROR";if((s=g.error)!=null&&s.includes("Missing operations")){const v=await this._triggerUpdate(n,r);i.push(...v)}else if(i.push({listenerId:u.listener.listenerId,listenerRevisions:m}),y)throw new xr(g.status,void 0,g.error,g.error)}u.listenerStatus="SUCCESS"}catch(m){r==null||r(m,o,u),u.listenerStatus=m instanceof xr?m.status:"ERROR"}}}return i}_checkFilter(n,r){const{branch:i,documentId:s,scope:o,documentType:a}=r;return!!((!n.branch||n.branch.includes(i)||n.branch.includes("*"))&&(!n.documentId||n.documentId.includes(s)||n.documentId.includes("*"))&&(!n.scope||n.scope.includes(o)||n.scope.includes("*"))&&(!n.documentType||n.documentType.includes(a)||n.documentType.includes("*")))}getListenerSyncUnits(n,r,i){var a;const s=(a=this.listenerState.get(n))==null?void 0:a.get(r);if(!s)return[];const o=s.listener.filter;return this.drive.getSynchronizationUnits(n,o.documentId??["*"],o.scope??["*"],o.branch??["*"],o.documentType??["*"],i)}getListenerSyncUnitIds(n,r){var o;const i=(o=this.listenerState.get(n))==null?void 0:o.get(r);if(!i)return[];const s=i.listener.filter;return this.drive.getSynchronizationUnitsIds(n,s.documentId??["*"],s.scope??["*"],s.branch??["*"],s.documentType??["*"])}async initDrive(n){const{state:{local:{listeners:r}}}=n;for(const i of r)await this.addListener({block:i.block,driveId:n.state.global.id,filter:{branch:i.filter.branch??[],documentId:i.filter.documentId??[],documentType:i.filter.documentType,scope:i.filter.scope??[]},listenerId:i.listenerId,system:i.system,callInfo:i.callInfo??void 0,label:i.label??""})}async removeDrive(n){this.listenerState.delete(n);const r=this.transmitters[n];r&&await Promise.all(Object.values(r).map(i=>{var s;return(s=i.disconnect)==null?void 0:s.call(i)}))}getListener(n,r){const i=this.listenerState.get(n);if(!i)throw new Error("Drive not found");const s=i.get(r);if(!s)throw new Error("Listener not found");return Promise.resolve(s)}async getStrands(n,r,i){const s=await this.getListener(n,r),o=[],a=await this.drive.getDrive(n),c=await this.getListenerSyncUnits(n,r,a),u=i==null?void 0:i.limit;let l=0;const d=c.map(f=>async()=>{if(u&&l>=u||f.revision<0)return;const h=s.syncUnits.get(f.syncId);if(h&&h.listenerRev>=f.revision)return;const{documentId:m,driveId:p,scope:g,branch:y}=f;try{const v=await this.drive.getOperationData(p,f.syncId,{since:i==null?void 0:i.since,fromRevision:(i==null?void 0:i.fromRevision)??(h==null?void 0:h.listenerRev),limit:u?u-l:void 0},a);if(!v.length)return;l+=v.length,o.push({driveId:p,documentId:m,scope:g,branch:y,operations:v})}catch(v){_t.error(v);return}});if(this.options.sequentialUpdates)for(const f of d)await f();else await Promise.all(d.map(f=>f()));return o}};Ve(Em,"LISTENER_UPDATE_DELAY",250);let eb=Em;function YS(t,e){return e?Object.keys(t).reduce((n,r)=>{const i=e[r];return i!==void 0&&(n[r]=t[r].filter(s=>s.index<=i)),n},{global:[],local:[]}):t}function Ry(t,e){return!e||Object.entries(e).find(([n,r])=>{const i=t.operations[n].at(-1);return r===-1?i!==void 0:(i==null?void 0:i.index)!==r})===void 0}const YW=5e3;class KW extends AW{constructor(n,r=new EW,i=new nR,s=new iR,o){var a,c;super();Ve(this,"emitter",tR());Ve(this,"cache");Ve(this,"documentModels");Ve(this,"storage");Ve(this,"listenerStateManager");Ve(this,"triggerMap",new Map);Ve(this,"syncStatus",new Map);Ve(this,"queueManager");Ve(this,"initializePromise");Ve(this,"defaultDrivesManager");Ve(this,"options");Ve(this,"defaultDrivesManagerDelegate",{detachDrive:this.detachDrive.bind(this),emit:(...n)=>this.emit("defaultRemoteDrive",...n)});Ve(this,"queueDelegate",{checkDocumentExists:(n,r)=>this.storage.checkDocumentExists(n,r),processOperationJob:async({driveId:n,documentId:r,operations:i,options:s})=>r?this.addOperations(n,r,i,s):this.addDriveOperations(n,i,s),processActionJob:async({driveId:n,documentId:r,actions:i,options:s})=>r?this.addActions(n,r,i,s):this.addDriveActions(n,i,s),processJob:async n=>{if(Kh(n))return this.queueDelegate.processOperationJob(n);if(yW(n))return this.queueDelegate.processActionJob(n);throw new Error("Unknown job type",n)}});this.options={...o,defaultDrives:{...o==null?void 0:o.defaultDrives},listenerManager:{...Qv,...o==null?void 0:o.listenerManager},taskQueueMethod:(o==null?void 0:o.taskQueueMethod)===void 0?ef.runAsap:o.taskQueueMethod},this.listenerStateManager=new eb(this,void 0,o==null?void 0:o.listenerManager),this.documentModels=n,this.storage=r,this.cache=i,this.queueManager=s,this.defaultDrivesManager=new xW(this,this.defaultDrivesManagerDelegate,o),(c=(a=this.storage).setStorageDelegate)==null||c.call(a,{getCachedOperations:async(u,l)=>{try{const d=await this.cache.getDocument(u,l);return d==null?void 0:d.operations}catch(d){_t.error(d);return}}}),this.initializePromise=this._initialize()}setDocumentModels(n){this.documentModels=[...n],this.emit("documentModels",[...n])}initializeDefaultRemoteDrives(){return this.defaultDrivesManager.initializeDefaultRemoteDrives()}getDefaultRemoteDrives(){return this.defaultDrivesManager.getDefaultRemoteDrives()}setDefaultDriveAccessLevel(n,r){return this.defaultDrivesManager.setDefaultDriveAccessLevel(n,r)}setAllDefaultDrivesAccessLevel(n){return this.defaultDrivesManager.setAllDefaultDrivesAccessLevel(n)}getOperationSource(n){return n.type==="local"?"push":"pull"}getCombinedSyncUnitStatus(n){if(!n.pull&&!n.push||n.pull==="INITIAL_SYNC")return"INITIAL_SYNC";if(n.push==="INITIAL_SYNC")return n.pull||"INITIAL_SYNC";const r=["ERROR","MISSING","CONFLICT","SYNCING","SUCCESS"];return Object.values(n).sort((s,o)=>r.indexOf(s)-r.indexOf(o))[0]}initSyncStatus(n,r){const i=Object.entries(r).reduce((s,[o,a])=>({...s,[o]:a!=="SYNCING"?a:"INITIAL_SYNC"}),{});this.syncStatus.set(n,i),this.emit("syncStatus",n,this.getCombinedSyncUnitStatus(i),void 0,i)}async initializeDriveSyncStatus(n,r){const i=await this.getSynchronizationUnitsIds(n),s={pull:r.state.local.triggers.length>0?"INITIAL_SYNC":void 0,push:r.state.local.listeners.length>0?"SUCCESS":void 0};if(!s.pull&&!s.push)return;const o=[n,...i.map(a=>a.syncId)];for(const a of o)this.initSyncStatus(a,s)}updateSyncUnitStatus(n,r,i){if(r===null){this.syncStatus.delete(n);return}const s=this.syncStatus.get(n);if(!s){this.initSyncStatus(n,r);return}if(Object.entries(r).some(([a,c])=>s[a]!==c)){const a=Object.entries(r).reduce((l,[d,f])=>({...l,[d]:l[d]==="INITIAL_SYNC"&&f==="SYNCING"?"INITIAL_SYNC":f}),s),c=this.getCombinedSyncUnitStatus(s),u=this.getCombinedSyncUnitStatus(a);this.syncStatus.set(n,a),c!==u&&this.emit("syncStatus",n,this.getCombinedSyncUnitStatus(a),i,a)}}async saveStrand(n,r){const i=n.operations.map(o=>({...o,scope:n.scope,branch:n.branch})),s=await(n.documentId?this.queueOperations(n.driveId,n.documentId,i,{source:r}):this.queueDriveOperations(n.driveId,i,{source:r}));if(s.status==="ERROR"){const o=n.documentId!==""?(await this.getSynchronizationUnitsIds(n.driveId,[n.documentId],[n.scope],[n.branch])).map(c=>c.syncId):[n.driveId],a=this.getOperationSource(r);for(const c of o)this.updateSyncUnitStatus(c,{[a]:s.status},s.error)}return this.emit("strandUpdate",n),s}handleListenerError(n,r,i){_t.error(`Listener ${i.listener.label??i.listener.listenerId} error:`,n);const s=n instanceof xr?n.status:"ERROR";this.updateSyncUnitStatus(r,{push:s},n)}shouldSyncRemoteDrive(n){return n.state.local.availableOffline&&n.state.local.triggers.length>0}async startSyncRemoteDrive(n){const r=await this.getDrive(n);let i=this.triggerMap.get(n);const s=await this.getSynchronizationUnitsIds(n,void 0,void 0,void 0,void 0,r);for(const o of r.state.local.triggers)if(!(i!=null&&i.get(o.id))){i||(i=new Map),this.updateSyncUnitStatus(n,{pull:"SYNCING"});for(const a of s)this.updateSyncUnitStatus(a.syncId,{pull:"SYNCING"});if(Ps.isPullResponderTrigger(o)){let a=!0;const c=Ps.setupPull(n,o,this.saveStrand.bind(this),u=>{const l=u instanceof xr?u.status:"ERROR";this.updateSyncUnitStatus(n,{pull:l},u),u instanceof Jc&&this.emit("clientStrandsError",n,o,u.response.status,u.message)},u=>{const l=u.filter(f=>f.status!=="SUCCESS");l.length<1&&this.updateSyncUnitStatus(n,{pull:"SUCCESS"});const d=u.filter(f=>f.documentId!=="").map(f=>f.documentId);if(this.getSynchronizationUnitsIds(n,d).then(f=>{for(const h of f){const m=l.find(p=>p.documentId===h.documentId);m?this.updateSyncUnitStatus(h.syncId,{pull:m.status},m.error):this.updateSyncUnitStatus(h.syncId,{pull:"SUCCESS"})}}).catch(console.error),a){a=!1;const f=r.state.local.listeners.find(h=>{var m;return o.data.url===((m=h.callInfo)==null?void 0:m.data)});f&&this.getSynchronizationUnitsRevision(n,s).then(h=>{for(const m of h)this.listenerStateManager.updateListenerRevision(f.listenerId,n,m.syncId,m.revision).catch(_t.error)}).catch(_t.error)}});i.set(o.id,c),this.triggerMap.set(n,i)}}}async stopSyncRemoteDrive(n){const i=(await this.getSynchronizationUnitsIds(n)).filter(o=>o.documentId!=="").map(o=>o.syncId),s=this.triggerMap.get(n);s==null||s.forEach(o=>o()),this.updateSyncUnitStatus(n,null);for(const o of i)this.updateSyncUnitStatus(o,null);return this.triggerMap.delete(n)}initialize(){return this.initializePromise}async _initialize(){await this.queueManager.init(this.queueDelegate,i=>{_t.error("Error initializing queue manager",i),n.push(i)});try{await this.defaultDrivesManager.removeOldremoteDrives()}catch(i){_t.error(i)}const n=[],r=await this.getDrives();for(const i of r)await this._initializeDrive(i).catch(s=>{_t.error(`Error initializing drive ${i}`,s),n.push(s)});return this.options.defaultDrives.loadOnInit!==!1&&await this.defaultDrivesManager.initializeDefaultRemoteDrives(),typeof window<"u"&&window.addEventListener("online",()=>{this.listenerStateManager.triggerUpdate(!1,{type:"local"},this.handleListenerError.bind(this)).catch(i=>{_t.error("Non handled error updating listeners",i)})}),n.length===0?null:n}async _initializeDrive(n){const r=await this.getDrive(n);await this.initializeDriveSyncStatus(n,r),this.shouldSyncRemoteDrive(r)&&await this.startSyncRemoteDrive(n),await this.listenerStateManager.initDrive(r)}async getSynchronizationUnits(n,r,i,s,o,a){const c=a||await this.getDrive(n),u=await this.getSynchronizationUnitsIds(n,r,i,s,o,c);return this.getSynchronizationUnitsRevision(n,u,c)}async getSynchronizationUnitsRevision(n,r,i){const s=i||await this.getDrive(n),o=await this.storage.getSynchronizationUnitsRevision(r),a=r.map(c=>({...c,lastUpdated:s.created,revision:-1}));for(const c of o){const u=a.find(l=>c.driveId===l.driveId&&c.documentId===l.documentId&&c.scope===l.scope&&c.branch===l.branch);u&&(u.revision=c.revision,u.lastUpdated=c.lastUpdated)}return a}async getSynchronizationUnitsIds(n,r,i,s,o,a){const u=(a??await this.getDrive(n)).state.global.nodes.filter(d=>Or(d)&&(!(r!=null&&r.length)||r.includes(d.id)||r.includes("*"))&&(!(o!=null&&o.length)||o.includes(d.documentType)||o.includes("*")));(!r||r.includes("*")||r.includes(""))&&(!(o!=null&&o.length)||o.includes("powerhouse/document-drive")||o.includes("*"))&&u.unshift({id:"",documentType:"powerhouse/document-drive",synchronizationUnits:[{syncId:"0",scope:"global",branch:"main"}]});const l=[];for(const d of u){const f=i!=null&&i.length||s!=null&&s.length?d.synchronizationUnits.filter(h=>(!(i!=null&&i.length)||i.includes(h.scope)||i.includes("*"))&&(!(s!=null&&s.length)||s.includes(h.branch)||s.includes("*"))):d.synchronizationUnits;f.length&&l.push(...f.map(h=>({driveId:n,documentId:d.id,syncId:h.syncId,documentType:d.documentType,scope:h.scope,branch:h.branch})))}return l}async getSynchronizationUnitIdInfo(n,r,i){const o=(i||await this.getDrive(n)).state.global.nodes.find(c=>Or(c)&&c.synchronizationUnits.find(u=>u.syncId===r));if(!o||!Or(o))return;const a=o.synchronizationUnits.find(c=>c.syncId===r);if(a)return{syncId:r,scope:a.scope,branch:a.branch,driveId:n,documentId:o.id,documentType:o.documentType}}async getSynchronizationUnit(n,r,i){const s=await this.getSynchronizationUnitIdInfo(n,r,i);if(!s)return;const{scope:o,branch:a,documentId:c,documentType:u}=s,l=await this.getDocument(n,c),d=l.operations[o]??[],f=d[d.length-1];return{syncId:r,scope:o,branch:a,driveId:n,documentId:c,documentType:u,lastUpdated:(f==null?void 0:f.timestamp)??l.lastModified,revision:(f==null?void 0:f.index)??0}}async getOperationData(n,r,i,s){const o=r==="0"?{documentId:"",scope:"global"}:await this.getSynchronizationUnitIdInfo(n,r,s);if(!o)throw new Error(`Invalid Sync Id ${r} in drive ${n}`);const u=((r==="0"?s||await this.getDrive(n):await this.getDocument(n,o.documentId)).operations[o.scope]??[]).filter(d=>Object.keys(i).length===0||(i.since===void 0||gW(i.since,d.timestamp))&&(i.fromRevision===void 0||d.index>i.fromRevision));return(i.limit?u.slice(0,i.limit):u).map(d=>({hash:d.hash,index:d.index,timestamp:d.timestamp,type:d.type,input:d.input,skip:d.skip,context:d.context,id:d.id}))}getDocumentModel(n){const r=this.documentModels.find(i=>i.documentModel.id===n);if(!r)throw new Error(`Document type ${n} not supported`);return r}getDocumentModels(){return[...this.documentModels]}async addDrive(n){const r=n.global.id||Mw();if(!r)throw new Error("Invalid Drive Id");if((await this.storage.getDrives()).includes(r))throw new hW(r);const s=Qd.createDocument({state:n});return await this.storage.createDrive(r,s),n.global.slug&&await this.cache.deleteDocument("drives-slug",n.global.slug),await this._initializeDrive(r),this.emit("driveAdded",s),s}async addRemoteDrive(n,r){const{id:i,name:s,slug:o,icon:a}=r.expectedDriveInfo||await pa(n),{pullFilter:c,pullInterval:u,availableOffline:l,sharingType:d,listeners:f,triggers:h}=r,m=await Ps.createPullResponderTrigger(i,n,{pullFilter:c,pullInterval:u});return await this.addDrive({global:{id:i,name:s,slug:o,icon:a??null},local:{triggers:[...h,m],listeners:f,availableOffline:l,sharingType:d}})}async registerPullResponderTrigger(n,r,i){return await Ps.createPullResponderTrigger(n,r,i)}async deleteDrive(n){(await Promise.allSettled([this.stopSyncRemoteDrive(n),this.listenerStateManager.removeDrive(n),this.cache.deleteDocument("drives",n),this.storage.deleteDrive(n)])).forEach(i=>{if(i.status==="rejected")throw i.reason})}getDrives(){return this.storage.getDrives()}async getDrive(n,r){let i;try{const a=await this.cache.getDocument("drives",n);if(a&&aa(a)&&(i=a,Ry(i,r==null?void 0:r.revisions)))return i}catch(a){_t.error("Error getting drive from cache",a)}const s=i??await this.storage.getDrive(n),o=this._buildDocument(s,r);if(aa(o))return r!=null&&r.revisions||this.cache.setDocument("drives",n,o).catch(_t.error),o;throw new Error(`Document with id ${n} is not a Document Drive`)}async getDriveBySlug(n,r){try{const o=await this.cache.getDocument("drives-slug",n);if(o&&aa(o))return o}catch(o){_t.error("Error getting drive from cache",o)}const i=await this.storage.getDriveBySlug(n),s=this._buildDocument(i,r);if(aa(s))return this.cache.setDocument("drives-slug",n,s).catch(_t.error),s;throw new Error(`Document with slug ${n} is not a Document Drive`)}async getDocument(n,r,i){let s;try{if(s=await this.cache.getDocument(n,r),s&&Ry(s,i==null?void 0:i.revisions))return s}catch(c){_t.error("Error getting document from cache",c)}const o=s??await this.storage.getDocument(n,r),a=this._buildDocument(o,i);return i!=null&&i.revisions||this.cache.setDocument(n,r,a).catch(_t.error),a}getDocuments(n){return this.storage.getDocuments(n)}async createDocument(n,r){let i;if(r.document){if(r.documentType!==r.document.documentType)throw new Error(`Provided document is not ${r.documentType}`);i=this._buildDocument(r.document).state}const s=r.document??this.getDocumentModel(r.documentType).utils.createDocument(),o={name:s.name,revision:s.revision,documentType:s.documentType,created:s.created,lastModified:s.lastModified,operations:{global:[],local:[]},initialState:s.initialState,clipboard:[],state:i??s.state};await this.storage.createDocument(n,r.id,o);for(const c of r.synchronizationUnits)this.initSyncStatus(c.syncId,{pull:this.triggerMap.get(n)?"INITIAL_SYNC":void 0,push:this.listenerStateManager.driveHasListeners(n)?"SUCCESS":void 0});const a=Object.values(s.operations).flat();return a.length&&(aa(s)?await this.storage.addDriveOperations(n,a,s):await this.storage.addDocumentOperations(n,r.id,a,s)),s}async deleteDocument(n,r){try{const i=await this.getSynchronizationUnitsIds(n,[r]);for(const s of i)this.updateSyncUnitStatus(s.syncId,null);await this.listenerStateManager.removeSyncUnits(n,i)}catch(i){_t.warn("Error deleting document",i)}return await this.cache.deleteDocument(n,r),this.storage.deleteDocument(n,r)}async _processOperations(n,r,i,s){const o=[],a=[],c=await this._addDocumentResultingStage(i,n,r);let u=this._buildDocument(c),l;const d=OW(s);for(const f of Object.keys(d)){const h=i.operations[f],m=DW(d[f]||[],h);if(m.length<1)continue;const p=IW(NW(h)),[g,y]=TW(p,m),b=(y.length<1?g:CW(p,g,RW)).filter(E=>p.length<1||kW(p[p.length-1],E));for(const E of b){let w=!1;if(y.length>0){const x=s.find(_=>_.hash===E.hash);w=!x||x.index!==E.index||x.skip!==E.skip}try{const x=this.options.taskQueueMethod,_=()=>this._performOperation(n,r,u,E,w),k=await(x?mW(_,x):_());u=k.document,a.push(...k.signals),o.push(k.operation)}catch(x){l=x instanceof xr?x:new xr("ERROR",E,x.message,x.cause);break}}}return{document:u,operationsApplied:o,signals:a,error:l}}async _addDocumentResultingStage(n,r,i,s){var c,u,l,d;const o=(s==null?void 0:s.revisions)!==void 0?YS(n.operations,s.revisions):n.operations,a=zt.documentHelpers.garbageCollectDocumentOperations(o);for(const f of Object.keys(a)){const h=a[f].at(-1);h&&!h.resultingState&&(h.resultingState=await(i?(u=(c=this.storage).getOperationResultingState)==null?void 0:u.call(c,r,i,h.index,h.scope,"main"):(d=(l=this.storage).getDriveOperationResultingState)==null?void 0:d.call(l,r,h.index,h.scope,"main")))}return{...n,operations:a}}_buildDocument(n,r){if(n.state&&(!r||r.checkHashes===!1)&&Ry(n,r==null?void 0:r.revisions))return n;const i=this.getDocumentModel(n.documentType),s=(r==null?void 0:r.revisions)!==void 0?YS(n.operations,r.revisions):n.operations,o=zt.documentHelpers.garbageCollectDocumentOperations(s);return zt.replayDocument(n.initialState,o,i.reducer,void 0,n,void 0,{...r,checkHashes:(r==null?void 0:r.checkHashes)??!0,reuseOperationResultingState:(r==null?void 0:r.checkHashes)??!0})}async _performOperation(n,r,i,s,o=!1){var g,y,v,b;const a=this.getDocumentModel(i.documentType),c=[];let u=i;const l=s.scope,f=zt.documentHelpers.garbageCollectDocumentOperations({...i.operations,[l]:zt.documentHelpers.skipHeaderOperations(i.operations[l],s)})[l].at(-1);f&&!f.resultingState&&(f.resultingState=await(r?(y=(g=this.storage).getOperationResultingState)==null?void 0:y.call(g,n,r,f.index,f.scope,"main"):(b=(v=this.storage).getDriveOperationResultingState)==null?void 0:b.call(v,n,f.index,f.scope,"main")));const h=[];u=a.reducer(u,s,E=>{let w;switch(E.type){case"CREATE_CHILD_DOCUMENT":w=()=>this.createDocument(n,E.input);break;case"DELETE_CHILD_DOCUMENT":w=()=>this.deleteDocument(n,E.input.id);break;case"COPY_CHILD_DOCUMENT":w=()=>this.getDocument(n,E.input.id).then(x=>this.createDocument(n,{id:E.input.newId,documentType:x.documentType,document:x,synchronizationUnits:E.input.synchronizationUnits}));break}w&&h.push(()=>w().then(x=>({signal:E,result:x})))},{skip:s.skip,reuseOperationResultingState:!0});const p=u.operations[s.scope].filter(E=>E.index==s.index&&E.skip==s.skip).at(0);if(!p)throw new xr("ERROR",s,`Operation with index ${s.index}:${s.skip} was not applied.`);if(!p.error&&p.hash!==s.hash&&!o)throw new fW(s,p);for(const E of h){const w=await E();c.push(w)}return{document:u,signals:c,operation:p}}addOperation(n,r,i,s){return this.addOperations(n,r,[i],s)}async _addOperations(n,r,i){if(this.storage.addDocumentOperationsWithTransaction)await this.storage.addDocumentOperationsWithTransaction(n,r,i);else{const s=await this.storage.getDocument(n,r),o=await i(s);o.operations.length>0&&await this.storage.addDocumentOperations(n,r,o.operations,o.header)}}queueOperation(n,r,i,s){return this.queueOperations(n,r,[i],s)}async resultIfExistingOperations(n,r,i){try{const s=await this.getDocument(n,r);return i.find(a=>!a.id||!s.operations[a.scope].find(c=>c.id===a.id&&c.index===a.index&&c.type===a.type&&c.hash===a.hash))?void 0:{status:"SUCCESS",document:s,operations:i,signals:[]}}catch(s){s.message.includes(`Document with id ${r} not found`)||console.error(s);return}}async queueOperations(n,r,i,s){const o=await this.resultIfExistingOperations(n,r,i);if(o)return o;try{const a=await this.queueManager.addJob({driveId:n,documentId:r,operations:i,options:s});return new Promise((c,u)=>{const l=this.queueManager.on("jobCompleted",(f,h)=>{f.jobId===a&&(l(),d(),c(h))}),d=this.queueManager.on("jobFailed",(f,h)=>{f.jobId===a&&(l(),d(),u(h))})})}catch(a){throw _t.error("Error adding job",a),a}}async queueAction(n,r,i,s){return this.queueActions(n,r,[i],s)}async queueActions(n,r,i,s){try{const o=await this.queueManager.addJob({driveId:n,documentId:r,actions:i,options:s});return new Promise((a,c)=>{const u=this.queueManager.on("jobCompleted",(d,f)=>{d.jobId===o&&(u(),l(),a(f))}),l=this.queueManager.on("jobFailed",(d,f)=>{d.jobId===o&&(u(),l(),c(f))})})}catch(o){throw _t.error("Error adding job",o),o}}async queueDriveAction(n,r,i){return this.queueDriveActions(n,[r],i)}async queueDriveActions(n,r,i){try{const s=await this.queueManager.addJob({driveId:n,actions:r,options:i});return new Promise((o,a)=>{const c=this.queueManager.on("jobCompleted",(l,d)=>{l.jobId===s&&(c(),u(),o(d))}),u=this.queueManager.on("jobFailed",(l,d)=>{l.jobId===s&&(c(),u(),a(d))})})}catch(s){throw _t.error("Error adding drive job",s),s}}async addOperations(n,r,i,s){const o=await this.resultIfExistingOperations(n,r,i);if(o)return o;let a;const c=[],u=[];let l;try{await this._addOperations(n,r,async y=>{const v=await this._processOperations(n,r,y,i);if(!v.document)throw _t.error("Invalid document"),v.error??new Error("Invalid document");return a=v.document,l=v.error,u.push(...v.signals),c.push(...v.operationsApplied),{operations:v.operationsApplied,header:v.document,newState:a.state}}),a&&this.cache.setDocument(n,r,a).catch(_t.error);const{scopes:d,branches:f}=c.reduce((y,v)=>(y.scopes.includes(v.scope)||y.scopes.push(v.scope),y),{scopes:[],branches:["main"]}),h=await this.getSynchronizationUnits(n,[r],d,f),p=c.find(y=>!i.find(v=>v.id===y.id&&v.index===y.index&&v.skip===y.skip&&v.hash===y.hash))?{type:"local"}:(s==null?void 0:s.source)??{type:"local"},g=this.getOperationSource(p);if(this.listenerStateManager.updateSynchronizationRevisions(n,h,p,()=>{this.updateSyncUnitStatus(n,{[g]:"SYNCING"});for(const y of h)this.updateSyncUnitStatus(y.syncId,{[g]:"SYNCING"})},this.handleListenerError.bind(this),(s==null?void 0:s.forceSync)??p.type==="local").then(y=>{y.length&&this.updateSyncUnitStatus(n,{[g]:"SUCCESS"});for(const v of h)this.updateSyncUnitStatus(v.syncId,{[g]:"SUCCESS"})}).catch(y=>{_t.error("Non handled error updating sync revision",y),this.updateSyncUnitStatus(n,{[g]:"ERROR"},y);for(const v of h)this.updateSyncUnitStatus(v.syncId,{[g]:"ERROR"},y)}),l)throw l;return{status:"SUCCESS",document:a,operations:c,signals:u}}catch(d){const f=d instanceof xr?d:new xr("ERROR",void 0,d.message,d.cause);return{status:f.status,error:f,document:a,operations:c,signals:u}}}addDriveOperation(n,r,i){return this.addDriveOperations(n,[r],i)}async clearStorage(){var n,r;for(const i of await this.getDrives())await this.deleteDrive(i);await((r=(n=this.storage).clearStorage)==null?void 0:r.call(n))}async _addDriveOperations(n,r){if(this.storage.addDriveOperationsWithTransaction)return this.storage.addDriveOperationsWithTransaction(n,r);{const i=await this.storage.getDrive(n),s=await r(i);return s.operations.length>0&&await this.storage.addDriveOperations(n,s.operations,s.header),s}}queueDriveOperation(n,r,i){return this.queueDriveOperations(n,[r],i)}async resultIfExistingDriveOperations(n,r){try{const i=await this.getDrive(n);return r.find(o=>!o.id||!i.operations[o.scope].find(a=>a.id===o.id&&a.index===o.index&&a.type===o.type&&a.hash===o.hash))?void 0:{status:"SUCCESS",document:i,operations:r,signals:[]}}catch(i){console.error(i);return}}async queueDriveOperations(n,r,i){const s=await this.resultIfExistingDriveOperations(n,r);if(s)return s;try{const o=await this.queueManager.addJob({driveId:n,operations:r,options:i});return new Promise((a,c)=>{const u=this.queueManager.on("jobCompleted",(d,f)=>{d.jobId===o&&(u(),l(),a(f))}),l=this.queueManager.on("jobFailed",(d,f)=>{d.jobId===o&&(u(),l(),c(f))})})}catch(o){throw _t.error("Error adding drive job",o),o}}async addDriveOperations(n,r,i){let s;const o=[],a=[];let c;const u=await this.resultIfExistingDriveOperations(n,r);if(u)return u;try{if(await this._addDriveOperations(n,async d=>{const f=await this._processOperations(n,void 0,d,r.slice());return s=f.document,o.push(...f.operationsApplied),a.push(...f.signals),c=f.error,{operations:f.operationsApplied,header:f.document}}),!s||!aa(s))throw c??new Error("Invalid Document Drive document");this.cache.setDocument("drives",n,s).catch(_t.error);for(const d of o)switch(d.type){case"ADD_LISTENER":{await this.addListener(n,d);break}case"REMOVE_LISTENER":{await this.removeListener(n,d);break}}const l=o.filter(d=>d.scope==="global").slice().pop();if(l){const f=o.find(m=>!r.find(p=>p.id===m.id&&p.index===m.index&&p.skip===m.skip&&p.hash===m.hash))?{type:"local"}:(i==null?void 0:i.source)??{type:"local"},h=this.getOperationSource(f);this.listenerStateManager.updateSynchronizationRevisions(n,[{syncId:"0",driveId:n,documentId:"",scope:"global",branch:"main",documentType:"powerhouse/document-drive",lastUpdated:l.timestamp,revision:l.index}],f,()=>{this.updateSyncUnitStatus(n,{[h]:"SYNCING"})},this.handleListenerError.bind(this),(i==null?void 0:i.forceSync)??f.type==="local").then(m=>{m.length&&this.updateSyncUnitStatus(n,{[h]:"SUCCESS"})}).catch(m=>{_t.error("Non handled error updating sync revision",m),this.updateSyncUnitStatus(n,{[h]:"ERROR"},m)})}if(this.shouldSyncRemoteDrive(s)?this.startSyncRemoteDrive(s.state.global.id):this.stopSyncRemoteDrive(s.state.global.id),c)throw c;return{status:"SUCCESS",document:s,operations:o,signals:a}}catch(l){const d=l instanceof xr?l:new xr("ERROR",void 0,l.message,l.cause);return{status:d.status,error:d,document:s,operations:o,signals:a}}}_buildOperations(n,r){const i=[],{reducer:s}=this.getDocumentModel(n.documentType);for(const o of r){n=s(n,o);const a=n.operations[o.scope].slice().pop();if(!a)throw new Error("Error creating operations");i.push(a)}return i}async addAction(n,r,i,s){return this.addActions(n,r,[i],s)}async addActions(n,r,i,s){const o=await this.getDocument(n,r),a=this._buildOperations(o,i);return this.addOperations(n,r,a,s)}async addDriveAction(n,r,i){return this.addDriveActions(n,[r],i)}async addDriveActions(n,r,i){const s=await this.getDrive(n),o=this._buildOperations(s,r);return await this.addDriveOperations(n,o,i)}async addInternalListener(n,r,i){const s={callInfo:{data:"",name:"Interal",transmitterType:"Internal"},system:!0,...i};await this.addDriveAction(n,Jn.addListener({listener:s}));const o=await this.getTransmitter(n,i.listenerId);if(!o)throw _t.error("Internal listener not found"),new Error("Internal listener not found");if(!(o instanceof oR))throw _t.error("Listener is not an internal transmitter"),new Error("Listener is not an internal transmitter");return o.setReceiver(r),o}async detachDrive(n){const r=await this.getDrive(n),i=r.state.local.listeners||[],s=r.state.local.triggers||[];for(const o of i)await this.addDriveAction(n,Jn.removeListener({listenerId:o.listenerId}));for(const o of s)await this.addDriveAction(n,Jn.removeTrigger({triggerId:o.id}));await this.addDriveAction(n,Jn.setSharingType({type:"LOCAL"}))}async addListener(n,r){var s,o,a;const{listener:i}=r.input;await this.listenerStateManager.addListener({...i,driveId:n,label:i.label??"",system:i.system??!1,filter:{branch:i.filter.branch??[],documentId:i.filter.documentId??[],documentType:i.filter.documentType??[],scope:i.filter.scope??[]},callInfo:{data:((s=i.callInfo)==null?void 0:s.data)??"",name:((o=i.callInfo)==null?void 0:o.name)??"PullResponder",transmitterType:((a=i.callInfo)==null?void 0:a.transmitterType)??"PullResponder"}})}async removeListener(n,r){const{listenerId:i}=r.input;await this.listenerStateManager.removeListener(n,i)}getTransmitter(n,r){return this.listenerStateManager.getTransmitter(n,r)}getListener(n,r){return this.listenerStateManager.getListener(n,r)}getSyncStatus(n){const r=this.syncStatus.get(n);return r?this.getCombinedSyncUnitStatus(r):new rR(`Sync status not found for syncUnitId: ${n}`,n)}on(n,r){return this.emitter.on(n,r)}emit(n,...r){return this.emitter.emit(n,...r)}}const JW=wW(KW),cR=Object.prototype.toString;function eu(t){switch(cR.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Ys(t,Error)}}function Zu(t,e){return cR.call(t)===`[object ${e}]`}function Lw(t){return Zu(t,"ErrorEvent")}function KS(t){return Zu(t,"DOMError")}function XW(t){return Zu(t,"DOMException")}function os(t){return Zu(t,"String")}function Fw(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function $w(t){return t===null||Fw(t)||typeof t!="object"&&typeof t!="function"}function Ga(t){return Zu(t,"Object")}function cg(t){return typeof Event<"u"&&Ys(t,Event)}function QW(t){return typeof Element<"u"&&Ys(t,Element)}function eq(t){return Zu(t,"RegExp")}function ug(t){return!!(t&&t.then&&typeof t.then=="function")}function tq(t){return Ga(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function uR(t){return typeof t=="number"&&t!==t}function Ys(t,e){try{return t instanceof e}catch{return!1}}function lR(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue))}function tu(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function Qp(t,e){if(!Array.isArray(t))return"";const n=[];for(let r=0;r<t.length;r++){const i=t[r];try{lR(i)?n.push("[VueViewModel]"):n.push(String(i))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function nq(t,e,n=!1){return os(t)?eq(e)?e.test(t):os(e)?n?t===e:t.includes(e):!1:!1}function Yu(t,e=[],n=!1){return e.some(r=>nq(t,r,n))}function rq(t,e,n=250,r,i,s,o){if(!s.exception||!s.exception.values||!o||!Ys(o.originalException,Error))return;const a=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;a&&(s.exception.values=iq(tb(t,e,i,o.originalException,r,s.exception.values,a,0),n))}function tb(t,e,n,r,i,s,o,a){if(s.length>=n+1)return s;let c=[...s];if(Ys(r[i],Error)){JS(o,a);const u=t(e,r[i]),l=c.length;XS(u,i,l,a),c=tb(t,e,n,r[i],i,[u,...c],u,l)}return Array.isArray(r.errors)&&r.errors.forEach((u,l)=>{if(Ys(u,Error)){JS(o,a);const d=t(e,u),f=c.length;XS(d,`errors[${l}]`,f,a),c=tb(t,e,n,u,i,[d,...c],d,f)}}),c}function JS(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,...t.type==="AggregateError"&&{is_exception_group:!0},exception_id:e}}function XS(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function iq(t,e){return t.map(n=>(n.value&&(n.value=tu(n.value,e)),n))}function yh(t){return t&&t.Math==Math?t:void 0}const Mt=typeof globalThis=="object"&&yh(globalThis)||typeof window=="object"&&yh(window)||typeof self=="object"&&yh(self)||typeof global=="object"&&yh(global)||function(){return this}()||{};function jw(){return Mt}function dR(t,e,n){const r=n||Mt,i=r.__SENTRY__=r.__SENTRY__||{};return i[t]||(i[t]=e())}const nu=jw(),sq=80;function qo(t,e={}){if(!t)return"<unknown>";try{let n=t;const r=5,i=[];let s=0,o=0;const a=" > ",c=a.length;let u;const l=Array.isArray(e)?e:e.keyAttrs,d=!Array.isArray(e)&&e.maxStringLength||sq;for(;n&&s++<r&&(u=oq(n,l),!(u==="html"||s>1&&o+i.length*c+u.length>=d));)i.push(u),o+=u.length,n=n.parentNode;return i.reverse().join(a)}catch{return"<unknown>"}}function oq(t,e){const n=t,r=[];let i,s,o,a,c;if(!n||!n.tagName)return"";if(nu.HTMLElement&&n instanceof HTMLElement&&n.dataset&&n.dataset.sentryComponent)return n.dataset.sentryComponent;r.push(n.tagName.toLowerCase());const u=e&&e.length?e.filter(d=>n.getAttribute(d)).map(d=>[d,n.getAttribute(d)]):null;if(u&&u.length)u.forEach(d=>{r.push(`[${d[0]}="${d[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),i=n.className,i&&os(i))for(s=i.split(/\s+/),c=0;c<s.length;c++)r.push(`.${s[c]}`);const l=["aria-label","type","name","title","alt"];for(c=0;c<l.length;c++)o=l[c],a=n.getAttribute(o),a&&r.push(`[${o}="${a}"]`);return r.join("")}function aq(){try{return nu.document.location.href}catch{return""}}function cq(t){return nu.document&&nu.document.querySelector?nu.document.querySelector(t):null}function fR(t){if(!nu.HTMLElement)return null;let e=t;const n=5;for(let r=0;r<n;r++){if(!e)return null;if(e instanceof HTMLElement&&e.dataset.sentryComponent)return e.dataset.sentryComponent;e=e.parentNode}return null}const Ku=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,uq="Sentry Logger ",em=["debug","info","warn","error","log","assert","trace"],tm={};function Za(t){if(!("console"in Mt))return t();const e=Mt.console,n={},r=Object.keys(tm);r.forEach(i=>{const s=tm[i];n[i]=e[i],e[i]=s});try{return t()}finally{r.forEach(i=>{e[i]=n[i]})}}function lq(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return Ku?em.forEach(n=>{e[n]=(...r)=>{t&&Za(()=>{Mt.console[n](`${uq}[${n}]:`,...r)})}}):em.forEach(n=>{e[n]=()=>{}}),e}const me=lq(),dq=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function fq(t){return t==="http"||t==="https"}function Ju(t,e=!1){const{host:n,path:r,pass:i,port:s,projectId:o,protocol:a,publicKey:c}=t;return`${a}://${c}${e&&i?`:${i}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${o}`}function hq(t){const e=dq.exec(t);if(!e){Za(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}const[n,r,i="",s,o="",a]=e.slice(1);let c="",u=a;const l=u.split("/");if(l.length>1&&(c=l.slice(0,-1).join("/"),u=l.pop()),u){const d=u.match(/^\d+/);d&&(u=d[0])}return hR({host:s,pass:i,path:c,projectId:u,port:o,protocol:n,publicKey:r})}function hR(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function pq(t){if(!Ku)return!0;const{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(o=>t[o]?!1:(me.error(`Invalid Sentry Dsn: ${o} missing`),!0))?!1:n.match(/^\d+$/)?fq(r)?e&&isNaN(parseInt(e,10))?(me.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(me.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(me.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function mq(t){const e=typeof t=="string"?hq(t):hR(t);if(!(!e||!pq(e)))return e}class Ji extends Error{constructor(e,n="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}}function Vn(t,e,n){if(!(e in t))return;const r=t[e],i=n(r);typeof i=="function"&&pR(i,r),t[e]=i}function Go(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{Ku&&me.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function pR(t,e){try{const n=e.prototype||{};t.prototype=e.prototype=n,Go(t,"__sentry_original__",e)}catch{}}function Uw(t){return t.__sentry_original__}function gq(t){return Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&")}function mR(t){if(eu(t))return{message:t.message,name:t.name,stack:t.stack,...ex(t)};if(cg(t)){const e={type:t.type,target:QS(t.target),currentTarget:QS(t.currentTarget),...ex(t)};return typeof CustomEvent<"u"&&Ys(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function QS(t){try{return QW(t)?qo(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}}function ex(t){if(typeof t=="object"&&t!==null){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}else return{}}function yq(t,e=40){const n=Object.keys(mR(t));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=e)return tu(n[0],e);for(let r=n.length;r>0;r--){const i=n.slice(0,r).join(", ");if(!(i.length>e))return r===n.length?i:tu(i,e)}return""}function gr(t){return nb(t,new Map)}function nb(t,e){if(vq(t)){const n=e.get(t);if(n!==void 0)return n;const r={};e.set(t,r);for(const i of Object.keys(t))typeof t[i]<"u"&&(r[i]=nb(t[i],e));return r}if(Array.isArray(t)){const n=e.get(t);if(n!==void 0)return n;const r=[];return e.set(t,r),t.forEach(i=>{r.push(nb(i,e))}),r}return t}function vq(t){if(!Ga(t))return!1;try{const e=Object.getPrototypeOf(t).constructor.name;return!e||e==="Object"}catch{return!0}}const gR=50,tx=/\(error: (.*)\)/,nx=/captureMessage|captureException/;function yR(...t){const e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0)=>{const i=[],s=n.split(`
392
- `);for(let o=r;o<s.length;o++){const a=s[o];if(a.length>1024)continue;const c=tx.test(a)?a.replace(tx,"$1"):a;if(!c.match(/\S*Error: /)){for(const u of e){const l=u(c);if(l){i.push(l);break}}if(i.length>=gR)break}}return _q(i)}}function bq(t){return Array.isArray(t)?yR(...t):t}function _q(t){if(!t.length)return[];const e=Array.from(t);return/sentryWrapped/.test(e[e.length-1].function||"")&&e.pop(),e.reverse(),nx.test(e[e.length-1].function||"")&&(e.pop(),nx.test(e[e.length-1].function||"")&&e.pop()),e.slice(0,gR).map(n=>({...n,filename:n.filename||e[e.length-1].filename,function:n.function||"?"}))}const Ny="<anonymous>";function Ks(t){try{return!t||typeof t!="function"?Ny:t.name||Ny}catch{return Ny}}const Qh={},rx={};function dc(t,e){Qh[t]=Qh[t]||[],Qh[t].push(e)}function fc(t,e){rx[t]||(e(),rx[t]=!0)}function Oi(t,e){const n=t&&Qh[t];if(n)for(const r of n)try{r(e)}catch(i){Ku&&me.error(`Error while triggering instrumentation handler.
393
- Type: ${t}
394
- Name: ${Ks(r)}
395
- Error:`,i)}}function vR(t){const e="console";dc(e,t),fc(e,wq)}function wq(){"console"in Mt&&em.forEach(function(t){t in Mt.console&&Vn(Mt.console,t,function(e){return tm[t]=e,function(...n){Oi("console",{args:n,level:t});const i=tm[t];i&&i.apply(Mt.console,n)}})})}function Sn(){const t=Mt,e=t.crypto||t.msCrypto;let n=()=>Math.random()*16;try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(n=()=>{const r=new Uint8Array(1);return e.getRandomValues(r),r[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(n()&15)>>r/4).toString(16))}function bR(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function _o(t){const{message:e,event_id:n}=t;if(e)return e;const r=bR(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function rb(t,e,n){const r=t.exception=t.exception||{},i=r.values=r.values||[],s=i[0]=i[0]||{};s.value||(s.value=e||""),s.type||(s.type="Error")}function Ya(t,e){const n=bR(t);if(!n)return;const r={type:"generic",handled:!0},i=n.mechanism;if(n.mechanism={...r,...i,...e},e&&"data"in e){const s={...i&&i.data,...e.data};n.mechanism.data=s}}function ix(t){if(t&&t.__sentry_captured__)return!0;try{Go(t,"__sentry_captured__",!0)}catch{}return!1}function _R(t){return Array.isArray(t)?t:[t]}const Ac=Mt,Eq=1e3;let sx,ib,sb;function wR(t){const e="dom";dc(e,t),fc(e,Sq)}function Sq(){if(!Ac.document)return;const t=Oi.bind(null,"dom"),e=ox(t,!0);Ac.document.addEventListener("click",e,!1),Ac.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{const r=Ac[n]&&Ac[n].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Vn(r,"addEventListener",function(i){return function(s,o,a){if(s==="click"||s=="keypress")try{const c=this,u=c.__sentry_instrumentation_handlers__=c.__sentry_instrumentation_handlers__||{},l=u[s]=u[s]||{refCount:0};if(!l.handler){const d=ox(t);l.handler=d,i.call(this,s,d,a)}l.refCount++}catch{}return i.call(this,s,o,a)}}),Vn(r,"removeEventListener",function(i){return function(s,o,a){if(s==="click"||s=="keypress")try{const c=this,u=c.__sentry_instrumentation_handlers__||{},l=u[s];l&&(l.refCount--,l.refCount<=0&&(i.call(this,s,l.handler,a),l.handler=void 0,delete u[s]),Object.keys(u).length===0&&delete c.__sentry_instrumentation_handlers__)}catch{}return i.call(this,s,o,a)}}))})}function xq(t){if(t.type!==ib)return!1;try{if(!t.target||t.target._sentryId!==sb)return!1}catch{}return!0}function Tq(t,e){return t!=="keypress"?!1:!e||!e.tagName?!0:!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)}function ox(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;const r=Iq(n);if(Tq(n.type,r))return;Go(n,"_sentryCaptured",!0),r&&!r._sentryId&&Go(r,"_sentryId",Sn());const i=n.type==="keypress"?"input":n.type;xq(n)||(t({event:n,name:i,global:e}),ib=n.type,sb=r?r._sentryId:void 0),clearTimeout(sx),sx=Ac.setTimeout(()=>{sb=void 0,ib=void 0},Eq)}}function Iq(t){try{return t.target}catch{return null}}const ob=jw();function ER(){if(!("fetch"in ob))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function ab(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function SR(){if(typeof EdgeRuntime=="string")return!0;if(!ER())return!1;if(ab(ob.fetch))return!0;let t=!1;const e=ob.document;if(e&&typeof e.createElement=="function")try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(t=ab(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){Ku&&me.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}function lg(t){const e="fetch";dc(e,t),fc(e,Oq)}function Oq(){SR()&&Vn(Mt,"fetch",function(t){return function(...e){const{method:n,url:r}=Cq(e),i={args:e,fetchData:{method:n,url:r},startTimestamp:Date.now()};return Oi("fetch",{...i}),t.apply(Mt,e).then(s=>{const o={...i,endTimestamp:Date.now(),response:s};return Oi("fetch",o),s},s=>{const o={...i,endTimestamp:Date.now(),error:s};throw Oi("fetch",o),s})}})}function cb(t,e){return!!t&&typeof t=="object"&&!!t[e]}function ax(t){return typeof t=="string"?t:t?cb(t,"url")?t.url:t.toString?t.toString():"":""}function Cq(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){const[n,r]=t;return{url:ax(n),method:cb(r,"method")?String(r.method).toUpperCase():"GET"}}const e=t[0];return{url:ax(e),method:cb(e,"method")?String(e.method).toUpperCase():"GET"}}let vh=null;function xR(t){const e="error";dc(e,t),fc(e,kq)}function kq(){vh=Mt.onerror,Mt.onerror=function(t,e,n,r,i){return Oi("error",{column:r,error:i,line:n,msg:t,url:e}),vh&&!vh.__SENTRY_LOADER__?vh.apply(this,arguments):!1},Mt.onerror.__SENTRY_INSTRUMENTED__=!0}let bh=null;function TR(t){const e="unhandledrejection";dc(e,t),fc(e,Dq)}function Dq(){bh=Mt.onunhandledrejection,Mt.onunhandledrejection=function(t){return Oi("unhandledrejection",t),bh&&!bh.__SENTRY_LOADER__?bh.apply(this,arguments):!0},Mt.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const _h=jw();function Rq(){const t=_h.chrome,e=t&&t.app&&t.app.runtime,n="history"in _h&&!!_h.history.pushState&&!!_h.history.replaceState;return!e&&n}const pl=Mt;let wh;function dg(t){const e="history";dc(e,t),fc(e,Nq)}function Nq(){if(!Rq())return;const t=pl.onpopstate;pl.onpopstate=function(...n){const r=pl.location.href,i=wh;if(wh=r,Oi("history",{from:i,to:r}),t)try{return t.apply(this,n)}catch{}};function e(n){return function(...r){const i=r.length>2?r[2]:void 0;if(i){const s=wh,o=String(i);wh=o,Oi("history",{from:s,to:o})}return n.apply(this,r)}}Vn(pl.history,"pushState",e),Vn(pl.history,"replaceState",e)}const Aq=Mt,Ms="__sentry_xhr_v3__";function fg(t){const e="xhr";dc(e,t),fc(e,Pq)}function Pq(){if(!Aq.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;Vn(t,"open",function(e){return function(...n){const r=Date.now(),i=os(n[0])?n[0].toUpperCase():void 0,s=Mq(n[1]);if(!i||!s)return e.apply(this,n);this[Ms]={method:i,url:s,request_headers:{}},i==="POST"&&s.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const o=()=>{const a=this[Ms];if(a&&this.readyState===4){try{a.status_code=this.status}catch{}const c={args:[i,s],endTimestamp:Date.now(),startTimestamp:r,xhr:this};Oi("xhr",c)}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?Vn(this,"onreadystatechange",function(a){return function(...c){return o(),a.apply(this,c)}}):this.addEventListener("readystatechange",o),Vn(this,"setRequestHeader",function(a){return function(...c){const[u,l]=c,d=this[Ms];return d&&os(u)&&os(l)&&(d.request_headers[u.toLowerCase()]=l),a.apply(this,c)}}),e.apply(this,n)}}),Vn(t,"send",function(e){return function(...n){const r=this[Ms];if(!r)return e.apply(this,n);n[0]!==void 0&&(r.body=n[0]);const i={args:[r.method,r.url],startTimestamp:Date.now(),xhr:this};return Oi("xhr",i),e.apply(this,n)}})}function Mq(t){if(os(t))return t;try{return t.toString()}catch{}}function Lq(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Fq(){return"npm"}function $q(){return!Lq()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function cx(){return typeof window<"u"&&(!$q()||jq())}function jq(){return Mt.process!==void 0&&Mt.process.type==="renderer"}function Uq(){const t=typeof WeakSet=="function",e=t?new WeakSet:[];function n(i){if(t)return e.has(i)?!0:(e.add(i),!1);for(let s=0;s<e.length;s++)if(e[s]===i)return!0;return e.push(i),!1}function r(i){if(t)e.delete(i);else for(let s=0;s<e.length;s++)if(e[s]===i){e.splice(s,1);break}}return[n,r]}function vi(t,e=100,n=1/0){try{return ub("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function IR(t,e=3,n=100*1024){const r=vi(t,e);return Hq(r)>n?IR(t,e-1,n):r}function ub(t,e,n=1/0,r=1/0,i=Uq()){const[s,o]=i;if(e==null||["number","boolean","string"].includes(typeof e)&&!uR(e))return e;const a=Bq(t,e);if(!a.startsWith("[object "))return a;if(e.__sentry_skip_normalization__)return e;const c=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:n;if(c===0)return a.replace("object ","");if(s(e))return"[Circular ~]";const u=e;if(u&&typeof u.toJSON=="function")try{const h=u.toJSON();return ub("",h,c-1,r,i)}catch{}const l=Array.isArray(e)?[]:{};let d=0;const f=mR(e);for(const h in f){if(!Object.prototype.hasOwnProperty.call(f,h))continue;if(d>=r){l[h]="[MaxProperties ~]";break}const m=f[h];l[h]=ub(h,m,c-1,r,i),d++}return o(e),l}function Bq(t,e){try{if(t==="domain"&&e&&typeof e=="object"&&e._events)return"[Domain]";if(t==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&e===global)return"[Global]";if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(lR(e))return"[VueViewModel]";if(tq(e))return"[SyntheticEvent]";if(typeof e=="number"&&e!==e)return"[NaN]";if(typeof e=="function")return`[Function: ${Ks(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;const n=zq(e);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function zq(t){const e=Object.getPrototypeOf(t);return e?e.constructor.name:"null prototype"}function Vq(t){return~-encodeURI(t).split(/%..|./).length}function Hq(t){return Vq(JSON.stringify(t))}var Os;(function(t){t[t.PENDING=0]="PENDING";const n=1;t[t.RESOLVED=n]="RESOLVED";const r=2;t[t.REJECTED=r]="REJECTED"})(Os||(Os={}));function Ou(t){return new Fr(e=>{e(t)})}function Bw(t){return new Fr((e,n)=>{n(t)})}class Fr{constructor(e){Fr.prototype.__init.call(this),Fr.prototype.__init2.call(this),Fr.prototype.__init3.call(this),Fr.prototype.__init4.call(this),this._state=Os.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(n){this._reject(n)}}then(e,n){return new Fr((r,i)=>{this._handlers.push([!1,s=>{if(!e)r(s);else try{r(e(s))}catch(o){i(o)}},s=>{if(!n)i(s);else try{r(n(s))}catch(o){i(o)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new Fr((n,r)=>{let i,s;return this.then(o=>{s=!1,i=o,e&&e()},o=>{s=!0,i=o,e&&e()}).then(()=>{if(s){r(i);return}n(i)})})}__init(){this._resolve=e=>{this._setResult(Os.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(Os.REJECTED,e)}}__init3(){this._setResult=(e,n)=>{if(this._state===Os.PENDING){if(ug(n)){n.then(this._resolve,this._reject);return}this._state=e,this._value=n,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===Os.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===Os.RESOLVED&&n[1](this._value),this._state===Os.REJECTED&&n[2](this._value),n[0]=!0)})}}}function Wq(t){const e=[];function n(){return t===void 0||e.length<t}function r(o){return e.splice(e.indexOf(o),1)[0]}function i(o){if(!n())return Bw(new Ji("Not adding Promise because buffer limit was reached."));const a=o();return e.indexOf(a)===-1&&e.push(a),a.then(()=>r(a)).then(null,()=>r(a).then(null,()=>{})),a}function s(o){return new Fr((a,c)=>{let u=e.length;if(!u)return a(!0);const l=setTimeout(()=>{o&&o>0&&a(!1)},o);e.forEach(d=>{Ou(d).then(()=>{--u||(clearTimeout(l),a(!0))},c)})})}return{$:e,add:i,drain:s}}function Ca(t){if(!t)return{};const e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}const qq=["fatal","error","warning","log","info","debug"];function OR(t){return t==="warn"?"warning":qq.includes(t)?t:"log"}const CR=1e3;function Of(){return Date.now()/CR}function Gq(){const{performance:t}=Mt;if(!t||!t.now)return Of;const e=Date.now()-t.now(),n=t.timeOrigin==null?e:t.timeOrigin;return()=>(n+t.now())/CR}const Cf=Gq(),Wr=(()=>{const{performance:t}=Mt;if(!t||!t.now)return;const e=3600*1e3,n=t.now(),r=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,s=i<e,o=t.timing&&t.timing.navigationStart,c=typeof o=="number"?Math.abs(o+n-r):e,u=c<e;return s||u?i<=c?t.timeOrigin:o:r})(),lb="baggage",kR="sentry-",Zq=/^sentry-/,Yq=8192;function Kq(t){if(!os(t)&&!Array.isArray(t))return;let e={};if(Array.isArray(t))e=t.reduce((r,i)=>{const s=ux(i);for(const o of Object.keys(s))r[o]=s[o];return r},{});else{if(!t)return;e=ux(t)}const n=Object.entries(e).reduce((r,[i,s])=>{if(i.match(Zq)){const o=i.slice(kR.length);r[o]=s}return r},{});if(Object.keys(n).length>0)return n}function DR(t){if(!t)return;const e=Object.entries(t).reduce((n,[r,i])=>(i&&(n[`${kR}${r}`]=i),n),{});return Jq(e)}function ux(t){return t.split(",").map(e=>e.split("=").map(n=>decodeURIComponent(n.trim()))).reduce((e,[n,r])=>(e[n]=r,e),{})}function Jq(t){if(Object.keys(t).length!==0)return Object.entries(t).reduce((e,[n,r],i)=>{const s=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,o=i===0?s:`${e},${s}`;return o.length>Yq?(Ku&&me.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),e):o},"")}const Xq=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function Qq(t){if(!t)return;const e=t.match(Xq);if(!e)return;let n;return e[3]==="1"?n=!0:e[3]==="0"&&(n=!1),{traceId:e[1],parentSampled:n,parentSpanId:e[2]}}function eG(t,e){const n=Qq(t),r=Kq(e),{traceId:i,parentSpanId:s,parentSampled:o}=n||{};return n?{traceId:i||Sn(),parentSpanId:s||Sn().substring(16),spanId:Sn().substring(16),sampled:o,dsc:r||{}}:{traceId:i||Sn(),spanId:Sn().substring(16)}}function zw(t=Sn(),e=Sn().substring(16),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${t}-${e}${r}`}function Jo(t,e=[]){return[t,e]}function tG(t,e){const[n,r]=t;return[n,[...r,e]]}function lx(t,e){const n=t[1];for(const r of n){const i=r[0].type;if(e(r,i))return!0}return!1}function db(t,e){return(e||new TextEncoder).encode(t)}function nG(t,e){const[n,r]=t;let i=JSON.stringify(n);function s(o){typeof i=="string"?i=typeof o=="string"?i+o:[db(i,e),o]:i.push(typeof o=="string"?db(o,e):o)}for(const o of r){const[a,c]=o;if(s(`
396
- ${JSON.stringify(a)}
397
- `),typeof c=="string"||c instanceof Uint8Array)s(c);else{let u;try{u=JSON.stringify(c)}catch{u=JSON.stringify(vi(c))}s(u)}}return typeof i=="string"?i:rG(i)}function rG(t){const e=t.reduce((i,s)=>i+s.length,0),n=new Uint8Array(e);let r=0;for(const i of t)n.set(i,r),r+=i.length;return n}function iG(t,e){const n=typeof t.data=="string"?db(t.data,e):t.data;return[gr({type:"attachment",length:n.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),n]}const sG={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket"};function dx(t){return sG[t]}function Vw(t){if(!t||!t.sdk)return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}function RR(t,e,n,r){const i=t.sdkProcessingMetadata&&t.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:t.event_id,sent_at:new Date().toISOString(),...e&&{sdk:e},...!!n&&r&&{dsn:Ju(r)},...i&&{trace:gr({...i})}}}function oG(t,e,n){const r=[{type:"client_report"},{timestamp:Of(),discarded_events:t}];return Jo(e?{dsn:e}:{},[r])}const aG=60*1e3;function cG(t,e=Date.now()){const n=parseInt(`${t}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${t}`);return isNaN(r)?aG:r-e}function uG(t,e){return t[e]||t.all||0}function NR(t,e,n=Date.now()){return uG(t,e)>n}function AR(t,{statusCode:e,headers:n},r=Date.now()){const i={...t},s=n&&n["x-sentry-rate-limits"],o=n&&n["retry-after"];if(s)for(const a of s.trim().split(",")){const[c,u,,,l]=a.split(":",5),d=parseInt(c,10),f=(isNaN(d)?60:d)*1e3;if(!u)i.all=r+f;else for(const h of u.split(";"))h==="metric_bucket"?(!l||l.split(";").includes("custom"))&&(i[h]=r+f):i[h]=r+f}else o?i.all=r+cG(o,r):e===429&&(i.all=r+60*1e3);return i}function lG(t,e){return t??e()}function Ay(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}const et=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,hg="production";function Hw(){return dR("globalEventProcessors",()=>[])}function dG(t){Hw().push(t)}function nm(t,e,n,r=0){return new Fr((i,s)=>{const o=t[r];if(e===null||typeof o!="function")i(e);else{const a=o({...e},n);et&&o.id&&a===null&&me.log(`Event processor "${o.id}" dropped event`),ug(a)?a.then(c=>nm(t,c,n,r+1).then(i)).then(null,s):nm(t,a,n,r+1).then(i).then(null,s)}})}function PR(t){const e=Cf(),n={sid:Sn(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>fG(n)};return t&&Ka(n,t),n}function Ka(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||Cf(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:Sn()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function MR(t,e){let n={};t.status==="ok"&&(n={status:"exited"}),Ka(t,n)}function fG(t){return gr({sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}})}const hG=0,LR=1;function Ww(t){const{spanId:e,traceId:n}=t.spanContext(),{data:r,op:i,parent_span_id:s,status:o,tags:a,origin:c}=Dn(t);return gr({data:r,op:i,parent_span_id:s,span_id:e,status:o,tags:a,trace_id:n,origin:c})}function pg(t){const{traceId:e,spanId:n}=t.spanContext(),r=qw(t);return zw(e,n,r)}function mg(t){return typeof t=="number"?fx(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?fx(t.getTime()):Cf()}function fx(t){return t>9999999999?t/1e3:t}function Dn(t){return pG(t)?t.getSpanJSON():typeof t.toJSON=="function"?t.toJSON():{}}function pG(t){return typeof t.getSpanJSON=="function"}function qw(t){const{traceFlags:e}=t.spanContext();return!!(e&LR)}function FR(t,e,n,r,i,s){const{normalizeDepth:o=3,normalizeMaxBreadth:a=1e3}=t,c={...e,event_id:e.event_id||n.event_id||Sn(),timestamp:e.timestamp||Of()},u=n.integrations||t.integrations.map(g=>g.name);mG(c,t),vG(c,u),e.type===void 0&&gG(c,t.stackParser);const l=_G(r,n.captureContext);n.mechanism&&Ya(c,n.mechanism);const d=i&&i.getEventProcessors?i.getEventProcessors():[],f=AG().getScopeData();if(s){const g=s.getScopeData();yx(f,g)}if(l){const g=l.getScopeData();yx(f,g)}const h=[...n.attachments||[],...f.attachments];h.length&&(n.attachments=h),BR(c,f);const m=[...d,...Hw(),...f.eventProcessors];return nm(m,c,n).then(g=>(g&&yG(g),typeof o=="number"&&o>0?bG(g,o,a):g))}function mG(t,e){const{environment:n,release:r,dist:i,maxValueLength:s=250}=e;"environment"in t||(t.environment="environment"in e?n:hg),t.release===void 0&&r!==void 0&&(t.release=r),t.dist===void 0&&i!==void 0&&(t.dist=i),t.message&&(t.message=tu(t.message,s));const o=t.exception&&t.exception.values&&t.exception.values[0];o&&o.value&&(o.value=tu(o.value,s));const a=t.request;a&&a.url&&(a.url=tu(a.url,s))}const hx=new WeakMap;function gG(t,e){const n=Mt._sentryDebugIds;if(!n)return;let r;const i=hx.get(e);i?r=i:(r=new Map,hx.set(e,r));const s=Object.keys(n).reduce((o,a)=>{let c;const u=r.get(a);u?c=u:(c=e(a),r.set(a,c));for(let l=c.length-1;l>=0;l--){const d=c[l];if(d.filename){o[d.filename]=n[a];break}}return o},{});try{t.exception.values.forEach(o=>{o.stacktrace.frames.forEach(a=>{a.filename&&(a.debug_id=s[a.filename])})})}catch{}}function yG(t){const e={};try{t.exception.values.forEach(r=>{r.stacktrace.frames.forEach(i=>{i.debug_id&&(i.abs_path?e[i.abs_path]=i.debug_id:i.filename&&(e[i.filename]=i.debug_id),delete i.debug_id)})})}catch{}if(Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];const n=t.debug_meta.images;Object.keys(e).forEach(r=>{n.push({type:"sourcemap",code_file:r,debug_id:e[r]})})}function vG(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function bG(t,e,n){if(!t)return null;const r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(i=>({...i,...i.data&&{data:vi(i.data,e,n)}}))},...t.user&&{user:vi(t.user,e,n)},...t.contexts&&{contexts:vi(t.contexts,e,n)},...t.extra&&{extra:vi(t.extra,e,n)}};return t.contexts&&t.contexts.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=vi(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(i=>{const s=Dn(i).data;return s&&(i.data=vi(s,e,n)),i})),r}function _G(t,e){if(!e)return t;const n=t?t.clone():new js;return n.update(e),n}function wG(t){if(t)return EG(t)?{captureContext:t}:xG(t)?{captureContext:t}:t}function EG(t){return t instanceof js||typeof t=="function"}const SG=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"];function xG(t){return Object.keys(t).some(e=>SG.includes(e))}function kf(t,e){return Qn().captureException(t,wG(e))}function px(t,e){const n=typeof e=="string"?e:void 0,r=typeof e!="string"?{captureContext:e}:void 0;return Qn().captureMessage(t,n,r)}function gg(t,e){return Qn().captureEvent(t,e)}function Zo(t,e){Qn().addBreadcrumb(t,e)}function TG(t,e){Qn().setContext(t,e)}function IG(t){Qn().setUser(t)}function $R(...t){const e=Qn();if(t.length===2){const[n,r]=t;return n?e.withScope(()=>(e.getStackTop().scope=n,r(n))):e.withScope(r)}return e.withScope(t[0])}function Lt(){return Qn().getClient()}function Gr(){return Qn().getScope()}function mx(t){const e=Lt(),n=Xo(),r=Gr(),{release:i,environment:s=hg}=e&&e.getOptions()||{},{userAgent:o}=Mt.navigator||{},a=PR({release:i,environment:s,user:r.getUser()||n.getUser(),...o&&{userAgent:o},...t}),c=n.getSession();return c&&c.status==="ok"&&Ka(c,{status:"exited"}),jR(),n.setSession(a),r.setSession(a),a}function jR(){const t=Xo(),e=Gr(),n=e.getSession()||t.getSession();n&&MR(n),UR(),t.setSession(),e.setSession()}function UR(){const t=Xo(),e=Gr(),n=Lt(),r=e.getSession()||t.getSession();r&&n&&n.captureSession&&n.captureSession(r)}function gx(t=!1){if(t){jR();return}UR()}function rm(t){return t.transaction}function yg(t,e,n){const r=e.getOptions(),{publicKey:i}=e.getDsn()||{},{segment:s}=n&&n.getUser()||{},o=gr({environment:r.environment||hg,release:r.release,user_segment:s,public_key:i,trace_id:t});return e.emit&&e.emit("createDsc",o),o}function Cu(t){const e=Lt();if(!e)return{};const n=yg(Dn(t).trace_id||"",e,Gr()),r=rm(t);if(!r)return n;const i=r&&r._frozenDynamicSamplingContext;if(i)return i;const{sampleRate:s,source:o}=r.metadata;s!=null&&(n.sample_rate=`${s}`);const a=Dn(r);return o&&o!=="url"&&(n.transaction=a.description),n.sampled=String(qw(r)),e.emit&&e.emit("createDsc",n),n}function BR(t,e){const{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:s}=e;OG(t,e),r&&DG(t,r),RG(t,n),CG(t,i),kG(t,s)}function yx(t,e){const{extra:n,tags:r,user:i,contexts:s,level:o,sdkProcessingMetadata:a,breadcrumbs:c,fingerprint:u,eventProcessors:l,attachments:d,propagationContext:f,transactionName:h,span:m}=e;ml(t,"extra",n),ml(t,"tags",r),ml(t,"user",i),ml(t,"contexts",s),ml(t,"sdkProcessingMetadata",a),o&&(t.level=o),h&&(t.transactionName=h),m&&(t.span=m),c.length&&(t.breadcrumbs=[...t.breadcrumbs,...c]),u.length&&(t.fingerprint=[...t.fingerprint,...u]),l.length&&(t.eventProcessors=[...t.eventProcessors,...l]),d.length&&(t.attachments=[...t.attachments,...d]),t.propagationContext={...t.propagationContext,...f}}function ml(t,e,n){if(n&&Object.keys(n).length){t[e]={...t[e]};for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[e][r]=n[r])}}function OG(t,e){const{extra:n,tags:r,user:i,contexts:s,level:o,transactionName:a}=e,c=gr(n);c&&Object.keys(c).length&&(t.extra={...c,...t.extra});const u=gr(r);u&&Object.keys(u).length&&(t.tags={...u,...t.tags});const l=gr(i);l&&Object.keys(l).length&&(t.user={...l,...t.user});const d=gr(s);d&&Object.keys(d).length&&(t.contexts={...d,...t.contexts}),o&&(t.level=o),a&&(t.transaction=a)}function CG(t,e){const n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}function kG(t,e){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...e}}function DG(t,e){t.contexts={trace:Ww(e),...t.contexts};const n=rm(e);if(n){t.sdkProcessingMetadata={dynamicSamplingContext:Cu(e),...t.sdkProcessingMetadata};const r=Dn(n).description;r&&(t.tags={transaction:r,...t.tags})}}function RG(t,e){t.fingerprint=t.fingerprint?_R(t.fingerprint):[],e&&(t.fingerprint=t.fingerprint.concat(e)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}const NG=100;let Py;class js{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=vx()}static clone(e){return e?e.clone():new js}clone(){const e=new js;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},e._user=this._user,e._level=this._level,e._span=this._span,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e}setClient(e){this._client=e}getClient(){return this._client}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,segment:void 0,username:void 0},this._session&&Ka(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,n){return this._tags={...this._tags,[e]:n},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...this._extra,[e]:n},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this._span;return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const n=typeof e=="function"?e(this):e;if(n instanceof js){const r=n.getScopeData();this._tags={...this._tags,...r.tags},this._extra={...this._extra,...r.extra},this._contexts={...this._contexts,...r.contexts},r.user&&Object.keys(r.user).length&&(this._user=r.user),r.level&&(this._level=r.level),r.fingerprint.length&&(this._fingerprint=r.fingerprint),n.getRequestSession()&&(this._requestSession=n.getRequestSession()),r.propagationContext&&(this._propagationContext=r.propagationContext)}else if(Ga(n)){const r=e;this._tags={...this._tags,...r.tags},this._extra={...this._extra,...r.extra},this._contexts={...this._contexts,...r.contexts},r.user&&(this._user=r.user),r.level&&(this._level=r.level),r.fingerprint&&(this._fingerprint=r.fingerprint),r.requestSession&&(this._requestSession=r.requestSession),r.propagationContext&&(this._propagationContext=r.propagationContext)}return this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=vx(),this}addBreadcrumb(e,n){const r=typeof n=="number"?n:NG;if(r<=0)return this;const i={timestamp:Of(),...e},s=this._breadcrumbs;return s.push(i),this._breadcrumbs=s.length>r?s.slice(-r):s,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this.getScopeData().attachments}clearAttachments(){return this._attachments=[],this}getScopeData(){const{_breadcrumbs:e,_attachments:n,_contexts:r,_tags:i,_extra:s,_user:o,_level:a,_fingerprint:c,_eventProcessors:u,_propagationContext:l,_sdkProcessingMetadata:d,_transactionName:f,_span:h}=this;return{breadcrumbs:e,attachments:n,contexts:r,tags:i,extra:s,user:o,level:a,fingerprint:c||[],eventProcessors:u,propagationContext:l,sdkProcessingMetadata:d,transactionName:f,span:h}}applyToEvent(e,n={},r=[]){BR(e,this.getScopeData());const i=[...r,...Hw(),...this._eventProcessors];return nm(i,e,n)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,n){const r=n&&n.event_id?n.event_id:Sn();if(!this._client)return me.warn("No client configured on scope - will not capture exception!"),r;const i=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureMessage(e,n,r){const i=r&&r.event_id?r.event_id:Sn();if(!this._client)return me.warn("No client configured on scope - will not capture message!"),i;const s=new Error(e);return this._client.captureMessage(e,n,{originalException:e,syntheticException:s,...r,event_id:i},this),i}captureEvent(e,n){const r=n&&n.event_id?n.event_id:Sn();return this._client?(this._client.captureEvent(e,{...n,event_id:r},this),r):(me.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}function AG(){return Py||(Py=new js),Py}function vx(){return{traceId:Sn(),spanId:Sn().substring(16)}}const fb="7.120.3",zR=parseFloat(fb),PG=100;class VR{constructor(e,n,r,i=zR){this._version=i;let s;n?s=n:(s=new js,s.setClient(e));let o;r?o=r:(o=new js,o.setClient(e)),this._stack=[{scope:s}],e&&this.bindClient(e),this._isolationScope=o}isOlderThan(e){return this._version<e}bindClient(e){const n=this.getStackTop();n.client=e,n.scope.setClient(e),e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=this.getScope().clone();return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return this.getStack().length<=1?!1:!!this.getStack().pop()}withScope(e){const n=this.pushScope();let r;try{r=e(n)}catch(i){throw this.popScope(),i}return ug(r)?r.then(i=>(this.popScope(),i),i=>{throw this.popScope(),i}):(this.popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,n){const r=this._lastEventId=n&&n.event_id?n.event_id:Sn(),i=new Error("Sentry syntheticException");return this.getScope().captureException(e,{originalException:e,syntheticException:i,...n,event_id:r}),r}captureMessage(e,n,r){const i=this._lastEventId=r&&r.event_id?r.event_id:Sn(),s=new Error(e);return this.getScope().captureMessage(e,n,{originalException:e,syntheticException:s,...r,event_id:i}),i}captureEvent(e,n){const r=n&&n.event_id?n.event_id:Sn();return e.type||(this._lastEventId=r),this.getScope().captureEvent(e,{...n,event_id:r}),r}lastEventId(){return this._lastEventId}addBreadcrumb(e,n){const{scope:r,client:i}=this.getStackTop();if(!i)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:o=PG}=i.getOptions&&i.getOptions()||{};if(o<=0)return;const c={timestamp:Of(),...e},u=s?Za(()=>s(c,n)):c;u!==null&&(i.emit&&i.emit("beforeAddBreadcrumb",u,n),r.addBreadcrumb(u,o))}setUser(e){this.getScope().setUser(e),this.getIsolationScope().setUser(e)}setTags(e){this.getScope().setTags(e),this.getIsolationScope().setTags(e)}setExtras(e){this.getScope().setExtras(e),this.getIsolationScope().setExtras(e)}setTag(e,n){this.getScope().setTag(e,n),this.getIsolationScope().setTag(e,n)}setExtra(e,n){this.getScope().setExtra(e,n),this.getIsolationScope().setExtra(e,n)}setContext(e,n){this.getScope().setContext(e,n),this.getIsolationScope().setContext(e,n)}configureScope(e){const{scope:n,client:r}=this.getStackTop();r&&e(n)}run(e){const n=bx(this);try{e(this)}finally{bx(n)}}getIntegration(e){const n=this.getClient();if(!n)return null;try{return n.getIntegration(e)}catch{return et&&me.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,n){const r=this._callExtensionMethod("startTransaction",e,n);return et&&!r&&(this.getClient()?me.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
398
- Sentry.addTracingExtensions();
399
- Sentry.init({...});
400
- `):me.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")),r}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const n=this.getStackTop().scope,r=n.getSession();r&&MR(r),this._sendSessionUpdate(),n.setSession()}startSession(e){const{scope:n,client:r}=this.getStackTop(),{release:i,environment:s=hg}=r&&r.getOptions()||{},{userAgent:o}=Mt.navigator||{},a=PR({release:i,environment:s,user:n.getUser(),...o&&{userAgent:o},...e}),c=n.getSession&&n.getSession();return c&&c.status==="ok"&&Ka(c,{status:"exited"}),this.endSession(),n.setSession(a),a}shouldSendDefaultPii(){const e=this.getClient(),n=e&&e.getOptions();return!!(n&&n.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:n}=this.getStackTop(),r=e.getSession();r&&n&&n.captureSession&&n.captureSession(r)}_callExtensionMethod(e,...n){const i=Df().__SENTRY__;if(i&&i.extensions&&typeof i.extensions[e]=="function")return i.extensions[e].apply(this,n);et&&me.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function Df(){return Mt.__SENTRY__=Mt.__SENTRY__||{extensions:{},hub:void 0},Mt}function bx(t){const e=Df(),n=hb(e);return HR(e,t),n}function Qn(){const t=Df();if(t.__SENTRY__&&t.__SENTRY__.acs){const e=t.__SENTRY__.acs.getCurrentHub();if(e)return e}return MG(t)}function Xo(){return Qn().getIsolationScope()}function MG(t=Df()){return(!LG(t)||hb(t).isOlderThan(zR))&&HR(t,new VR),hb(t)}function LG(t){return!!(t&&t.__SENTRY__&&t.__SENTRY__.hub)}function hb(t){return dR("hub",()=>new VR,t)}function HR(t,e){if(!t)return!1;const n=t.__SENTRY__=t.__SENTRY__||{};return n.hub=e,!0}function hc(t){return Qn().getScope().getTransaction()}let _x=!1;function FG(){_x||(_x=!0,xR(pb),TR(pb))}function pb(){const t=hc();if(t){const e="internal_error";et&&me.log(`[Tracing] Transaction: ${e} -> Global error occured`),t.setStatus(e)}}pb.tag="sentry_tracingErrorCallback";var wx;(function(t){const e="ok";t.Ok=e;const n="deadline_exceeded";t.DeadlineExceeded=n;const r="unauthenticated";t.Unauthenticated=r;const i="permission_denied";t.PermissionDenied=i;const s="not_found";t.NotFound=s;const o="resource_exhausted";t.ResourceExhausted=o;const a="invalid_argument";t.InvalidArgument=a;const c="unimplemented";t.Unimplemented=c;const u="unavailable";t.Unavailable=u;const l="internal_error";t.InternalError=l;const d="unknown_error";t.UnknownError=d;const f="cancelled";t.Cancelled=f;const h="already_exists";t.AlreadyExists=h;const m="failed_precondition";t.FailedPrecondition=m;const p="aborted";t.Aborted=p;const g="out_of_range";t.OutOfRange=g;const y="data_loss";t.DataLoss=y})(wx||(wx={}));function $G(t){if(t<400&&t>=100)return"ok";if(t>=400&&t<500)switch(t){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(t>=500&&t<600)switch(t){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}function Gw(t,e){t.setTag("http.status_code",String(e)),t.setData("http.response.status_code",e);const n=$G(e);n!=="unknown_error"&&t.setStatus(n)}function Xu(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const e=Lt(),n=t||e&&e.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}function WR(t){if(!Xu())return;const e=UG(t),n=Qn(),r=t.scope?t.scope.getSpan():Zw();if(t.onlyIfParent&&!r)return;const o=(t.scope||Gr()).clone();return jG(n,{parentSpan:r,spanContext:e,forceTransaction:t.forceTransaction,scope:o})}function Zw(){return Gr().getSpan()}function jG(t,{parentSpan:e,spanContext:n,forceTransaction:r,scope:i}){if(!Xu())return;const s=Xo();let o;if(e&&!r)o=e.startChild(n);else if(e){const a=Cu(e),{traceId:c,spanId:u}=e.spanContext(),l=qw(e);o=t.startTransaction({traceId:c,parentSpanId:u,parentSampled:l,...n,metadata:{dynamicSamplingContext:a,...n.metadata}})}else{const{traceId:a,dsc:c,parentSpanId:u,sampled:l}={...s.getPropagationContext(),...i.getPropagationContext()};o=t.startTransaction({traceId:a,parentSpanId:u,parentSampled:l,...n,metadata:{dynamicSamplingContext:c,...n.metadata}})}return i.setSpan(o),BG(o,i,s),o}function UG(t){if(t.startTime){const e={...t};return e.startTimestamp=mg(t.startTime),delete e.startTime,e}return t}const qR="_sentryScope",GR="_sentryIsolationScope";function BG(t,e,n){t&&(Go(t,GR,n),Go(t,qR,e))}function zG(t){return{scope:t[qR],isolationScope:t[GR]}}const as="sentry.source",$c="sentry.sample_rate",Al="sentry.op",ma="sentry.origin",VG="profile_id";class ZR{constructor(e=1e3){this._maxlen=e,this.spans=[]}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}}class vg{constructor(e={}){this._traceId=e.traceId||Sn(),this._spanId=e.spanId||Sn().substring(16),this._startTime=e.startTimestamp||Cf(),this.tags=e.tags?{...e.tags}:{},this.data=e.data?{...e.data}:{},this.instrumenter=e.instrumenter||"sentry",this._attributes={},this.setAttributes({[ma]:e.origin||"manual",[Al]:e.op,...e.attributes}),this._name=e.name||e.description,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),"sampled"in e&&(this._sampled=e.sampled),e.status&&(this._status=e.status),e.endTimestamp&&(this._endTime=e.endTimestamp),e.exclusiveTime!==void 0&&(this._exclusiveTime=e.exclusiveTime),this._measurements=e.measurements?{...e.measurements}:{}}get name(){return this._name||""}set name(e){this.updateName(e)}get description(){return this._name}set description(e){this._name=e}get traceId(){return this._traceId}set traceId(e){this._traceId=e}get spanId(){return this._spanId}set spanId(e){this._spanId=e}set parentSpanId(e){this._parentSpanId=e}get parentSpanId(){return this._parentSpanId}get sampled(){return this._sampled}set sampled(e){this._sampled=e}get attributes(){return this._attributes}set attributes(e){this._attributes=e}get startTimestamp(){return this._startTime}set startTimestamp(e){this._startTime=e}get endTimestamp(){return this._endTime}set endTimestamp(e){this._endTime=e}get status(){return this._status}set status(e){this._status=e}get op(){return this._attributes[Al]}set op(e){this.setAttribute(Al,e)}get origin(){return this._attributes[ma]}set origin(e){this.setAttribute(ma,e)}spanContext(){const{_spanId:e,_traceId:n,_sampled:r}=this;return{spanId:e,traceId:n,traceFlags:r?LR:hG}}startChild(e){const n=new vg({...e,parentSpanId:this._spanId,sampled:this._sampled,traceId:this._traceId});n.spanRecorder=this.spanRecorder,n.spanRecorder&&n.spanRecorder.add(n);const r=rm(this);if(n.transaction=r,et&&r){const i=e&&e.op||"< unknown op >",s=Dn(n).description||"< unknown name >",o=r.spanContext().spanId,a=`[Tracing] Starting '${i}' span on transaction '${s}' (${o}).`;me.log(a),this._logMessage=a}return n}setTag(e,n){return this.tags={...this.tags,[e]:n},this}setData(e,n){return this.data={...this.data,[e]:n},this}setAttribute(e,n){n===void 0?delete this._attributes[e]:this._attributes[e]=n}setAttributes(e){Object.keys(e).forEach(n=>this.setAttribute(n,e[n]))}setStatus(e){return this._status=e,this}setHttpStatus(e){return Gw(this,e),this}setName(e){this.updateName(e)}updateName(e){return this._name=e,this}isSuccess(){return this._status==="ok"}finish(e){return this.end(e)}end(e){if(this._endTime)return;const n=rm(this);if(et&&n&&n.spanContext().spanId!==this._spanId){const r=this._logMessage;r&&me.log(r.replace("Starting","Finishing"))}this._endTime=mg(e)}toTraceparent(){return pg(this)}toContext(){return gr({data:this._getData(),description:this._name,endTimestamp:this._endTime,op:this.op,parentSpanId:this._parentSpanId,sampled:this._sampled,spanId:this._spanId,startTimestamp:this._startTime,status:this._status,tags:this.tags,traceId:this._traceId})}updateWithContext(e){return this.data=e.data||{},this._name=e.name||e.description,this._endTime=e.endTimestamp,this.op=e.op,this._parentSpanId=e.parentSpanId,this._sampled=e.sampled,this._spanId=e.spanId||this._spanId,this._startTime=e.startTimestamp||this._startTime,this._status=e.status,this.tags=e.tags||{},this._traceId=e.traceId||this._traceId,this}getTraceContext(){return Ww(this)}getSpanJSON(){return gr({data:this._getData(),description:this._name,op:this._attributes[Al],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:this._status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[ma],_metrics_summary:void 0,profile_id:this._attributes[VG],exclusive_time:this._exclusiveTime,measurements:Object.keys(this._measurements).length>0?this._measurements:void 0})}isRecording(){return!this._endTime&&!!this._sampled}toJSON(){return this.getSpanJSON()}_getData(){const{data:e,_attributes:n}=this,r=Object.keys(e).length>0,i=Object.keys(n).length>0;if(!(!r&&!i))return r&&i?{...e,...n}:r?e:n}}class YR extends vg{constructor(e,n){super(e),this._contexts={},this._hub=n||Qn(),this._name=e.name||"",this._metadata={...e.metadata},this._trimEnd=e.trimEnd,this.transaction=this;const r=this._metadata.dynamicSamplingContext;r&&(this._frozenDynamicSamplingContext={...r})}get name(){return this._name}set name(e){this.setName(e)}get metadata(){return{source:"custom",spanMetadata:{},...this._metadata,...this._attributes[as]&&{source:this._attributes[as]},...this._attributes[$c]&&{sampleRate:this._attributes[$c]}}}set metadata(e){this._metadata=e}setName(e,n="custom"){this._name=e,this.setAttribute(as,n)}updateName(e){return this._name=e,this}initSpanRecorder(e=1e3){this.spanRecorder||(this.spanRecorder=new ZR(e)),this.spanRecorder.add(this)}setContext(e,n){n===null?delete this._contexts[e]:this._contexts[e]=n}setMeasurement(e,n,r=""){this._measurements[e]={value:n,unit:r}}setMetadata(e){this._metadata={...this._metadata,...e}}end(e){const n=mg(e),r=this._finishTransaction(n);if(r)return this._hub.captureEvent(r)}toContext(){const e=super.toContext();return gr({...e,name:this._name,trimEnd:this._trimEnd})}updateWithContext(e){return super.updateWithContext(e),this._name=e.name||"",this._trimEnd=e.trimEnd,this}getDynamicSamplingContext(){return Cu(this)}setHub(e){this._hub=e}getProfileId(){if(this._contexts!==void 0&&this._contexts.profile!==void 0)return this._contexts.profile.profile_id}_finishTransaction(e){if(this._endTime!==void 0)return;this._name||(et&&me.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>"),super.end(e);const n=this._hub.getClient();if(n&&n.emit&&n.emit("finishTransaction",this),this._sampled!==!0){et&&me.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),n&&n.recordDroppedEvent("sample_rate","transaction");return}const r=this.spanRecorder?this.spanRecorder.spans.filter(l=>l!==this&&Dn(l).timestamp):[];if(this._trimEnd&&r.length>0){const l=r.map(d=>Dn(d).timestamp).filter(Boolean);this._endTime=l.reduce((d,f)=>d>f?d:f)}const{scope:i,isolationScope:s}=zG(this),{metadata:o}=this,{source:a}=o,c={contexts:{...this._contexts,trace:Ww(this)},spans:r,start_timestamp:this._startTime,tags:this.tags,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{...o,capturedSpanScope:i,capturedSpanIsolationScope:s,...gr({dynamicSamplingContext:Cu(this)})},_metrics_summary:void 0,...a&&{transaction_info:{source:a}}};return Object.keys(this._measurements).length>0&&(et&&me.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),c.measurements=this._measurements),et&&me.log(`[Tracing] Finishing ${this.op} transaction: ${this._name}.`),c}}const ep={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},HG="finishReason",Ic=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"];class WG extends ZR{constructor(e,n,r,i){super(i),this._pushActivity=e,this._popActivity=n,this.transactionSpanId=r}add(e){if(e.spanContext().spanId!==this.transactionSpanId){const n=e.end;e.end=(...r)=>(this._popActivity(e.spanContext().spanId),n.apply(e,r)),Dn(e).timestamp===void 0&&this._pushActivity(e.spanContext().spanId)}super.add(e)}}class qG extends YR{constructor(e,n,r=ep.idleTimeout,i=ep.finalTimeout,s=ep.heartbeatInterval,o=!1,a=!1){super(e,n),this._idleHub=n,this._idleTimeout=r,this._finalTimeout=i,this._heartbeatInterval=s,this._onScope=o,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=Ic[4],this._autoFinishAllowed=!a,o&&(et&&me.log(`Setting idle transaction on scope. Span ID: ${this.spanContext().spanId}`),n.getScope().setSpan(this)),a||this._restartIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=Ic[3],this.end())},this._finalTimeout)}end(e){const n=mg(e);if(this._finished=!0,this.activities={},this.op==="ui.action.click"&&this.setAttribute(HG,this._finishReason),this.spanRecorder){et&&me.log("[Tracing] finishing IdleTransaction",new Date(n*1e3).toISOString(),this.op);for(const r of this._beforeFinishCallbacks)r(this,n);this.spanRecorder.spans=this.spanRecorder.spans.filter(r=>{if(r.spanContext().spanId===this.spanContext().spanId)return!0;Dn(r).timestamp||(r.setStatus("cancelled"),r.end(n),et&&me.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(r,void 0,2)));const{start_timestamp:i,timestamp:s}=Dn(r),o=i&&i<n,a=(this._finalTimeout+this._idleTimeout)/1e3,c=s&&i&&s-i<a;if(et){const u=JSON.stringify(r,void 0,2);o?c||me.log("[Tracing] discarding Span since it finished after Transaction final timeout",u):me.log("[Tracing] discarding Span since it happened after Transaction was finished",u)}return o&&c}),et&&me.log("[Tracing] flushing IdleTransaction")}else et&&me.log("[Tracing] No active IdleTransaction");if(this._onScope){const r=this._idleHub.getScope();r.getTransaction()===this&&r.setSpan(void 0)}return super.end(e)}registerBeforeFinishCallback(e){this._beforeFinishCallbacks.push(e)}initSpanRecorder(e){if(!this.spanRecorder){const n=i=>{this._finished||this._pushActivity(i)},r=i=>{this._finished||this._popActivity(i)};this.spanRecorder=new WG(n,r,this.spanContext().spanId,e),et&&me.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(e,{restartOnChildSpanChange:n}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=n===!1,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,Object.keys(this.activities).length===0&&this._idleTimeoutCanceledPermanently&&(this._finishReason=Ic[5],this.end(e)))}setFinishReason(e){this._finishReason=e}sendAutoFinishSignal(){this._autoFinishAllowed||(et&&me.log("[Tracing] Received finish signal for idle transaction."),this._restartIdleTimeout(),this._autoFinishAllowed=!0)}_restartIdleTimeout(e){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout(()=>{!this._finished&&Object.keys(this.activities).length===0&&(this._finishReason=Ic[1],this.end(e))},this._idleTimeout)}_pushActivity(e){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),et&&me.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,et&&me.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&(et&&me.log(`[Tracing] popActivity ${e}`),delete this.activities[e],et&&me.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){const n=Cf();this._idleTimeoutCanceledPermanently?this._autoFinishAllowed&&(this._finishReason=Ic[5],this.end(n)):this._restartIdleTimeout(n+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;const e=Object.keys(this.activities).join("");e===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=e,this._heartbeatCounter>=3?this._autoFinishAllowed&&(et&&me.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=Ic[0],this.end()):this._pingHeartbeat()}_pingHeartbeat(){et&&me.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}}function KR(t,e,n){if(!Xu(e))return t.sampled=!1,t;if(t.sampled!==void 0)return t.setAttribute($c,Number(t.sampled)),t;let r;return typeof e.tracesSampler=="function"?(r=e.tracesSampler(n),t.setAttribute($c,Number(r))):n.parentSampled!==void 0?r=n.parentSampled:typeof e.tracesSampleRate<"u"?(r=e.tracesSampleRate,t.setAttribute($c,Number(r))):(r=1,t.setAttribute($c,r)),JR(r)?r?(t.sampled=Math.random()<r,t.sampled?(et&&me.log(`[Tracing] starting ${t.op} transaction - ${Dn(t).description}`),t):(et&&me.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(r)})`),t)):(et&&me.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),t.sampled=!1,t):(et&&me.warn("[Tracing] Discarding transaction because of invalid sample rate."),t.sampled=!1,t)}function JR(t){return uR(t)||!(typeof t=="number"||typeof t=="boolean")?(et&&me.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`),!1):t<0||t>1?(et&&me.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${t}.`),!1):!0}function GG(){const e=this.getScope().getSpan();return e?{"sentry-trace":pg(e)}:{}}function ZG(t,e){const n=this.getClient(),r=n&&n.getOptions()||{},i=r.instrumenter||"sentry",s=t.instrumenter||"sentry";i!==s&&(et&&me.error(`A transaction was started with instrumenter=\`${s}\`, but the SDK is configured with the \`${i}\` instrumenter.
401
- The transaction will not be sampled. Please use the ${i} instrumentation to start transactions.`),t.sampled=!1);let o=new YR(t,this);return o=KR(o,r,{name:t.name,parentSampled:t.parentSampled,transactionContext:t,attributes:{...t.data,...t.attributes},...e}),o.isRecording()&&o.initSpanRecorder(r._experiments&&r._experiments.maxSpans),n&&n.emit&&n.emit("startTransaction",o),o}function XR(t,e,n,r,i,s,o,a=!1){const c=t.getClient(),u=c&&c.getOptions()||{};let l=new qG(e,t,n,r,o,i,a);return l=KR(l,u,{name:e.name,parentSampled:e.parentSampled,transactionContext:e,attributes:{...e.data,...e.attributes},...s}),l.isRecording()&&l.initSpanRecorder(u._experiments&&u._experiments.maxSpans),c&&c.emit&&c.emit("startTransaction",l),l}function YG(){const t=Df();t.__SENTRY__&&(t.__SENTRY__.extensions=t.__SENTRY__.extensions||{},t.__SENTRY__.extensions.startTransaction||(t.__SENTRY__.extensions.startTransaction=ZG),t.__SENTRY__.extensions.traceHeaders||(t.__SENTRY__.extensions.traceHeaders=GG),FG())}function KG(t,e,n){const r=hc();r&&r.setMeasurement(t,e,n)}function JG(t,e){return e&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=[...t.sdk.integrations||[],...e.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...e.packages||[]]),t}function XG(t,e,n,r){const i=Vw(n),s={sent_at:new Date().toISOString(),...i&&{sdk:i},...!!r&&e&&{dsn:Ju(e)}},o="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return Jo(s,[o])}function QG(t,e,n,r){const i=Vw(n),s=t.type&&t.type!=="replay_event"?t.type:"event";JG(t,n&&n.sdk);const o=RR(t,i,r,e);return delete t.sdkProcessingMetadata,Jo(o,[[{type:s},t]])}const eZ="7";function tZ(t){const e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function nZ(t){return`${tZ(t)}${t.projectId}/envelope/`}function rZ(t,e){return gq({sentry_key:t.publicKey,sentry_version:eZ,...e&&{sentry_client:`${e.name}/${e.version}`}})}function iZ(t,e={}){const n=typeof e=="string"?e:e.tunnel,r=typeof e=="string"||!e._metadata?void 0:e._metadata.sdk;return n||`${nZ(t)}?${rZ(t,r)}`}const Ex=[];function sZ(t){const e={};return t.forEach(n=>{const{name:r}=n,i=e[r];i&&!i.isDefaultInstance&&n.isDefaultInstance||(e[r]=n)}),Object.keys(e).map(n=>e[n])}function oZ(t){const e=t.defaultIntegrations||[],n=t.integrations;e.forEach(o=>{o.isDefaultInstance=!0});let r;Array.isArray(n)?r=[...e,...n]:typeof n=="function"?r=_R(n(e)):r=e;const i=sZ(r),s=cZ(i,o=>o.name==="Debug");if(s!==-1){const[o]=i.splice(s,1);i.push(o)}return i}function aZ(t,e){const n={};return e.forEach(r=>{r&&QR(t,r,n)}),n}function Sx(t,e){for(const n of e)n&&n.afterAllSetup&&n.afterAllSetup(t)}function QR(t,e,n){if(n[e.name]){et&&me.log(`Integration skipped because it was already installed: ${e.name}`);return}if(n[e.name]=e,Ex.indexOf(e.name)===-1&&(e.setupOnce(dG,Qn),Ex.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(t),t.on&&typeof e.preprocessEvent=="function"){const r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(i,s)=>r(i,s,t))}if(t.addEventProcessor&&typeof e.processEvent=="function"){const r=e.processEvent.bind(e),i=Object.assign((s,o)=>r(s,o,t),{id:e.name});t.addEventProcessor(i)}et&&me.log(`Integration installed: ${e.name}`)}function cZ(t,e){for(let n=0;n<t.length;n++)if(e(t[n])===!0)return n;return-1}function Li(t,e){return Object.assign(function(...r){return e(...r)},{id:t})}function uZ(t){let e="";for(const n of t){const r=Object.entries(n.tags),i=r.length>0?`|#${r.map(([s,o])=>`${s}:${o}`).join(",")}`:"";e+=`${n.name}@${n.unit}:${n.metric}|${n.metricType}${i}|T${n.timestamp}
402
- `}return e}function lZ(t,e,n,r){const i={sent_at:new Date().toISOString()};n&&n.sdk&&(i.sdk={name:n.sdk.name,version:n.sdk.version}),r&&e&&(i.dsn=Ju(e));const s=dZ(t);return Jo(i,[s])}function dZ(t){const e=uZ(t);return[{type:"statsd",length:e.length},e]}const xx="Not capturing exception because it's already been captured.";class fZ{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=mq(e.dsn):et&&me.warn("No DSN provided, client will not send events."),this._dsn){const n=iZ(this._dsn,e);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:n})}}captureException(e,n,r){if(ix(e)){et&&me.log(xx);return}let i=n&&n.event_id;return this._process(this.eventFromException(e,n).then(s=>this._captureEvent(s,n,r)).then(s=>{i=s})),i}captureMessage(e,n,r,i){let s=r&&r.event_id;const o=Fw(e)?e:String(e),a=$w(e)?this.eventFromMessage(o,n,r):this.eventFromException(e,r);return this._process(a.then(c=>this._captureEvent(c,r,i)).then(c=>{s=c})),s}captureEvent(e,n,r){if(n&&n.originalException&&ix(n.originalException)){et&&me.log(xx);return}let i=n&&n.event_id;const o=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,n,o||r).then(a=>{i=a})),i}captureSession(e){typeof e.release!="string"?et&&me.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),Ka(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const n=this._transport;return n?(this.metricsAggregator&&this.metricsAggregator.flush(),this._isClientDoneProcessing(e).then(r=>n.flush(e).then(i=>r&&i))):Ou(!0)}close(e){return this.flush(e).then(n=>(this.getOptions().enabled=!1,this.metricsAggregator&&this.metricsAggregator.close(),n))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){(e&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&this._setupIntegrations()}init(){this._isEnabled()&&this._setupIntegrations()}getIntegrationById(e){return this.getIntegrationByName(e)}getIntegrationByName(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return et&&me.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){const n=this._integrations[e.name];QR(this,e,this._integrations),n||Sx(this,[e])}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);let r=QG(e,this._dsn,this._options._metadata,this._options.tunnel);for(const s of n.attachments||[])r=tG(r,iG(s,this._options.transportOptions&&this._options.transportOptions.textEncoder));const i=this._sendEnvelope(r);i&&i.then(s=>this.emit("afterSendEvent",e,s),null)}sendSession(e){const n=XG(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(n)}recordDroppedEvent(e,n,r){if(this._options.sendClientReports){const i=typeof r=="number"?r:1,s=`${e}:${n}`;et&&me.log(`Recording outcome: "${s}"${i>1?` (${i} times)`:""}`),this._outcomes[s]=(this._outcomes[s]||0)+i}}captureAggregateMetrics(e){et&&me.log(`Flushing aggregated metrics, number of metrics: ${e.length}`);const n=lZ(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(n)}on(e,n){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(n)}emit(e,...n){this._hooks[e]&&this._hooks[e].forEach(r=>r(...n))}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=aZ(this,e),Sx(this,e),this._integrationsInitialized=!0}_updateSessionFromEvent(e,n){let r=!1,i=!1;const s=n.exception&&n.exception.values;if(s){i=!0;for(const c of s){const u=c.mechanism;if(u&&u.handled===!1){r=!0;break}}}const o=e.status==="ok";(o&&e.errors===0||o&&r)&&(Ka(e,{...r&&{status:"crashed"},errors:e.errors||Number(i||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new Fr(n=>{let r=0;const i=1,s=setInterval(()=>{this._numProcessing==0?(clearInterval(s),n(!0)):(r+=i,e&&r>=e&&(clearInterval(s),n(!1)))},i)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,n,r,i=Xo()){const s=this.getOptions(),o=Object.keys(this._integrations);return!n.integrations&&o.length>0&&(n.integrations=o),this.emit("preprocessEvent",e,n),FR(s,e,n,r,this,i).then(a=>{if(a===null)return a;const c={...i.getPropagationContext(),...r?r.getPropagationContext():void 0};if(!(a.contexts&&a.contexts.trace)&&c){const{traceId:l,spanId:d,parentSpanId:f,dsc:h}=c;a.contexts={trace:{trace_id:l,span_id:d,parent_span_id:f},...a.contexts};const m=h||yg(l,this,r);a.sdkProcessingMetadata={dynamicSamplingContext:m,...a.sdkProcessingMetadata}}return a})}_captureEvent(e,n={},r){return this._processEvent(e,n,r).then(i=>i.event_id,i=>{if(et){const s=i;s.logLevel==="log"?me.log(s.message):me.warn(s)}})}_processEvent(e,n,r){const i=this.getOptions(),{sampleRate:s}=i,o=tN(e),a=eN(e),c=e.type||"error",u=`before send for type \`${c}\``;if(a&&typeof s=="number"&&Math.random()>s)return this.recordDroppedEvent("sample_rate","error",e),Bw(new Ji(`Discarding event because it's not included in the random sample (sampling rate = ${s})`,"log"));const l=c==="replay_event"?"replay":c,f=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,n,r,f).then(h=>{if(h===null)throw this.recordDroppedEvent("event_processor",l,e),new Ji("An event processor returned `null`, will not send event.","log");if(n.data&&n.data.__sentry__===!0)return h;const p=pZ(i,h,n);return hZ(p,u)}).then(h=>{if(h===null){if(this.recordDroppedEvent("before_send",l,e),o){const y=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",y)}throw new Ji(`${u} returned \`null\`, will not send event.`,"log")}const m=r&&r.getSession();if(!o&&m&&this._updateSessionFromEvent(m,h),o){const g=h.sdkProcessingMetadata&&h.sdkProcessingMetadata.spanCountBeforeProcessing||0,y=h.spans?h.spans.length:0,v=g-y;v>0&&this.recordDroppedEvent("before_send","span",v)}const p=h.transaction_info;if(o&&p&&h.transaction!==e.transaction){const g="custom";h.transaction_info={...p,source:g}}return this.sendEvent(h,n),h}).then(null,h=>{throw h instanceof Ji?h:(this.captureException(h,{data:{__sentry__:!0},originalException:h}),new Ji(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
403
- Reason: ${h}`))})}_process(e){this._numProcessing++,e.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)return this._transport.send(e).then(null,n=>{et&&me.error("Error while sending event:",n)});et&&me.error("Transport disabled")}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.keys(e).map(n=>{const[r,i]=n.split(":");return{reason:r,category:i,quantity:e[n]}})}}function hZ(t,e){const n=`${e} must return \`null\` or a valid event.`;if(ug(t))return t.then(r=>{if(!Ga(r)&&r!==null)throw new Ji(n);return r},r=>{throw new Ji(`${e} rejected with ${r}`)});if(!Ga(t)&&t!==null)throw new Ji(n);return t}function pZ(t,e,n){const{beforeSend:r,beforeSendTransaction:i}=t;if(eN(e)&&r)return r(e,n);if(tN(e)&&i){if(e.spans){const s=e.spans.length;e.sdkProcessingMetadata={...e.sdkProcessingMetadata,spanCountBeforeProcessing:s}}return i(e,n)}return e}function eN(t){return t.type===void 0}function tN(t){return t.type==="transaction"}function mZ(t){const e=Lt();!e||!e.addEventProcessor||e.addEventProcessor(t)}function gZ(t,e){e.debug===!0&&(et?me.enable():Za(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),Gr().update(e.initialScope);const r=new t(e);yZ(r),vZ(r)}function yZ(t){const n=Qn().getStackTop();n.client=t,n.scope.setClient(t)}function vZ(t){t.init?t.init():t.setupIntegrations&&t.setupIntegrations()}const bZ=30;function nN(t,e,n=Wq(t.bufferSize||bZ)){let r={};const i=o=>n.drain(o);function s(o){const a=[];if(lx(o,(d,f)=>{const h=dx(f);if(NR(r,h)){const m=Tx(d,f);t.recordDroppedEvent("ratelimit_backoff",h,m)}else a.push(d)}),a.length===0)return Ou();const c=Jo(o[0],a),u=d=>{lx(c,(f,h)=>{const m=Tx(f,h);t.recordDroppedEvent(d,dx(h),m)})},l=()=>e({body:nG(c,t.textEncoder)}).then(d=>(d.statusCode!==void 0&&(d.statusCode<200||d.statusCode>=300)&&et&&me.warn(`Sentry responded with status code ${d.statusCode} to sent event.`),r=AR(r,d),d),d=>{throw u("network_error"),d});return n.add(l).then(d=>d,d=>{if(d instanceof Ji)return et&&me.error("Skipped sending event because buffer is full."),u("queue_overflow"),Ou();throw d})}return s.__sentry__baseTransport__=!0,{send:s,flush:i}}function Tx(t,e){if(!(e!=="event"&&e!=="transaction"))return Array.isArray(t)?t[1]:void 0}function _Z(t,e){const n={sent_at:new Date().toISOString()};e&&(n.dsn=Ju(e));const r=t.map(wZ);return Jo(n,r)}function wZ(t){return[{type:"span"},t]}function rN(t,e){const n=e&&xZ(e)?e.getClient():e,r=n&&n.getDsn(),i=n&&n.getOptions().tunnel;return SZ(t,r)||EZ(t,i)}function EZ(t,e){return e?Ix(t)===Ix(e):!1}function SZ(t,e){return e?t.includes(e.host):!1}function Ix(t){return t[t.length-1]==="/"?t.slice(0,-1):t}function xZ(t){return t.getClient!==void 0}function iN(t,e,n=[e],r="npm"){const i=t._metadata||{};i.sdk||(i.sdk={name:`sentry.javascript.${e}`,packages:n.map(s=>({name:`${r}:@sentry/${s}`,version:fb})),version:fb}),t._metadata=i}const TZ=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/],IZ=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],sN="InboundFilters",OZ=(t={})=>({name:sN,setupOnce(){},processEvent(e,n,r){const i=r.getOptions(),s=CZ(t,i);return kZ(e,s)?null:e}}),oN=OZ;Li(sN,oN);function CZ(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:TZ],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[],...t.disableTransactionDefaults?[]:IZ],ignoreInternal:t.ignoreInternal!==void 0?t.ignoreInternal:!0}}function kZ(t,e){return e.ignoreInternal&&MZ(t)?(et&&me.warn(`Event dropped due to being internal Sentry Error.
404
- Event: ${_o(t)}`),!0):DZ(t,e.ignoreErrors)?(et&&me.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
405
- Event: ${_o(t)}`),!0):RZ(t,e.ignoreTransactions)?(et&&me.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
406
- Event: ${_o(t)}`),!0):NZ(t,e.denyUrls)?(et&&me.warn(`Event dropped due to being matched by \`denyUrls\` option.
407
- Event: ${_o(t)}.
408
- Url: ${im(t)}`),!0):AZ(t,e.allowUrls)?!1:(et&&me.warn(`Event dropped due to not being matched by \`allowUrls\` option.
409
- Event: ${_o(t)}.
410
- Url: ${im(t)}`),!0)}function DZ(t,e){return t.type||!e||!e.length?!1:PZ(t).some(n=>Yu(n,e))}function RZ(t,e){if(t.type!=="transaction"||!e||!e.length)return!1;const n=t.transaction;return n?Yu(n,e):!1}function NZ(t,e){if(!e||!e.length)return!1;const n=im(t);return n?Yu(n,e):!1}function AZ(t,e){if(!e||!e.length)return!0;const n=im(t);return n?Yu(n,e):!0}function PZ(t){const e=[];t.message&&e.push(t.message);let n;try{n=t.exception.values[t.exception.values.length-1]}catch{}return n&&n.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`)),et&&e.length===0&&me.error(`Could not extract message for event ${_o(t)}`),e}function MZ(t){try{return t.exception.values[0].type==="SentryError"}catch{}return!1}function LZ(t=[]){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function im(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?LZ(e):null}catch{return et&&me.error(`Cannot extract url for event ${_o(t)}`),null}}let Ox;const aN="FunctionToString",Cx=new WeakMap,FZ=()=>({name:aN,setupOnce(){Ox=Function.prototype.toString;try{Function.prototype.toString=function(...t){const e=Uw(this),n=Cx.has(Lt())&&e!==void 0?e:this;return Ox.apply(n,t)}}catch{}},setup(t){Cx.set(t,!0)}}),cN=FZ;Li(aN,cN);const mn=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,pt=Mt;function $Z(){pt.document?pt.document.addEventListener("visibilitychange",()=>{const t=hc();if(pt.document.hidden&&t){const e="cancelled",{op:n,status:r}=Dn(t);mn&&me.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${n}`),r||t.setStatus(e),t.setTag("visibilitychange","document.hidden"),t.end()}}):mn&&me.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const Rf=(t,e,n)=>{let r,i;return s=>{e.value>=0&&(s||n)&&(i=e.value-(r||0),(i||r===void 0)&&(r=e.value,e.delta=i,t(e)))}},jZ=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,UZ=()=>{const t=pt.performance.timing,e=pt.performance.navigation.type,n={entryType:"navigation",startTime:0,type:e==2?"back_forward":e===1?"reload":"navigate"};for(const r in t)r!=="navigationStart"&&r!=="toJSON"&&(n[r]=Math.max(t[r]-t.navigationStart,0));return n},bg=()=>pt.__WEB_VITALS_POLYFILL__?pt.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||UZ()):pt.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],Yw=()=>{const t=bg();return t&&t.activationStart||0},Nf=(t,e)=>{const n=bg();let r="navigate";return n&&(pt.document&&pt.document.prerendering||Yw()>0?r="prerender":r=n.type.replace(/_/g,"-")),{name:t,value:typeof e>"u"?-1:e,rating:"good",delta:0,entries:[],id:jZ(),navigationType:r}},Qu=(t,e,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const r=new PerformanceObserver(i=>{e(i.getEntries())});return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch{}},Af=(t,e)=>{const n=r=>{(r.type==="pagehide"||pt.document.visibilityState==="hidden")&&(t(r),e&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};pt.document&&(addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0))},BZ=(t,e={})=>{const n=Nf("CLS",0);let r,i=0,s=[];const o=c=>{c.forEach(u=>{if(!u.hadRecentInput){const l=s[0],d=s[s.length-1];i&&s.length!==0&&u.startTime-d.startTime<1e3&&u.startTime-l.startTime<5e3?(i+=u.value,s.push(u)):(i=u.value,s=[u]),i>n.value&&(n.value=i,n.entries=s,r&&r())}})},a=Qu("layout-shift",o);if(a){r=Rf(t,n,e.reportAllChanges);const c=()=>{o(a.takeRecords()),r(!0)};return Af(c),c}};let sm=-1;const zZ=()=>{pt.document&&pt.document.visibilityState&&(sm=pt.document.visibilityState==="hidden"&&!pt.document.prerendering?0:1/0)},VZ=()=>{Af(({timeStamp:t})=>{sm=t},!0)},Kw=()=>(sm<0&&(zZ(),VZ()),{get firstHiddenTime(){return sm}}),HZ=t=>{const e=Kw(),n=Nf("FID");let r;const i=a=>{a.startTime<e.firstHiddenTime&&(n.value=a.processingStart-a.startTime,n.entries.push(a),r(!0))},s=a=>{a.forEach(i)},o=Qu("first-input",s);r=Rf(t,n),o&&Af(()=>{s(o.takeRecords()),o.disconnect()},!0)};let uN=0,My=1/0,Eh=0;const WZ=t=>{t.forEach(e=>{e.interactionId&&(My=Math.min(My,e.interactionId),Eh=Math.max(Eh,e.interactionId),uN=Eh?(Eh-My)/7+1:0)})};let mb;const qZ=()=>mb?uN:performance.interactionCount||0,GZ=()=>{"interactionCount"in performance||mb||(mb=Qu("event",WZ,{type:"event",buffered:!0,durationThreshold:0}))},lN=()=>qZ(),kx=10,Ds=[],Ly={},Dx=t=>{const e=Ds[Ds.length-1],n=Ly[t.interactionId];if(n||Ds.length<kx||t.duration>e.latency){if(n)n.entries.push(t),n.latency=Math.max(n.latency,t.duration);else{const r={id:t.interactionId,latency:t.duration,entries:[t]};Ly[r.id]=r,Ds.push(r)}Ds.sort((r,i)=>i.latency-r.latency),Ds.splice(kx).forEach(r=>{delete Ly[r.id]})}},ZZ=()=>{const t=Math.min(Ds.length-1,Math.floor(lN()/50));return Ds[t]},YZ=(t,e)=>{e=e||{},GZ();const n=Nf("INP");let r;const i=o=>{o.forEach(c=>{c.interactionId&&Dx(c),c.entryType==="first-input"&&!Ds.some(l=>l.entries.some(d=>c.duration===d.duration&&c.startTime===d.startTime))&&Dx(c)});const a=ZZ();a&&a.latency!==n.value&&(n.value=a.latency,n.entries=a.entries,r())},s=Qu("event",i,{durationThreshold:e.durationThreshold||40});r=Rf(t,n,e.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),Af(()=>{i(s.takeRecords()),n.value<0&&lN()>0&&(n.value=0,n.entries=[]),r(!0)}))},Rx={},KZ=t=>{const e=Kw(),n=Nf("LCP");let r;const i=o=>{const a=o[o.length-1];if(a){const c=Math.max(a.startTime-Yw(),0);c<e.firstHiddenTime&&(n.value=c,n.entries=[a],r())}},s=Qu("largest-contentful-paint",i);if(s){r=Rf(t,n);const o=()=>{Rx[n.id]||(i(s.takeRecords()),s.disconnect(),Rx[n.id]=!0,r(!0))};return["keydown","click"].forEach(a=>{pt.document&&addEventListener(a,o,{once:!0,capture:!0})}),Af(o,!0),o}},gb=t=>{pt.document&&(pt.document.prerendering?addEventListener("prerenderingchange",()=>gb(t),!0):pt.document.readyState!=="complete"?addEventListener("load",()=>gb(t),!0):setTimeout(t,0))},JZ=(t,e)=>{e=e||{};const n=Nf("TTFB"),r=Rf(t,n,e.reportAllChanges);gb(()=>{const i=bg();if(i){if(n.value=Math.max(i.responseStart-Yw(),0),n.value<0||n.value>performance.now())return;n.entries=[i],r(!0)}})},Wl={},om={};let dN,fN,hN,pN,mN;function XZ(t,e=!1){return Pf("cls",t,nY,dN,e)}function gN(t,e=!1){return Pf("lcp",t,iY,hN,e)}function QZ(t){return Pf("ttfb",t,sY,pN)}function eY(t){return Pf("fid",t,rY,fN)}function tY(t){return Pf("inp",t,oY,mN)}function ku(t,e){return yN(t,e),om[t]||(aY(t),om[t]=!0),vN(t,e)}function el(t,e){const n=Wl[t];if(!(!n||!n.length))for(const r of n)try{r(e)}catch(i){mn&&me.error(`Error while triggering instrumentation handler.
411
- Type: ${t}
412
- Name: ${Ks(r)}
413
- Error:`,i)}}function nY(){return BZ(t=>{el("cls",{metric:t}),dN=t},{reportAllChanges:!0})}function rY(){return HZ(t=>{el("fid",{metric:t}),fN=t})}function iY(){return KZ(t=>{el("lcp",{metric:t}),hN=t})}function sY(){return JZ(t=>{el("ttfb",{metric:t}),pN=t})}function oY(){return YZ(t=>{el("inp",{metric:t}),mN=t})}function Pf(t,e,n,r,i=!1){yN(t,e);let s;return om[t]||(s=n(),om[t]=!0),r&&e({metric:r}),vN(t,e,i?s:void 0)}function aY(t){const e={};t==="event"&&(e.durationThreshold=0),Qu(t,n=>{el(t,{entries:n})},e)}function yN(t,e){Wl[t]=Wl[t]||[],Wl[t].push(e)}function vN(t,e,n){return()=>{n&&n();const r=Wl[t];if(!r)return;const i=r.indexOf(e);i!==-1&&r.splice(i,1)}}function Fy(t){return typeof t=="number"&&isFinite(t)}function Du(t,{startTimestamp:e,...n}){return e&&t.startTimestamp>e&&(t.startTimestamp=e),t.startChild({startTimestamp:e,...n})}const cY=2147483647;function $n(t){return t/1e3}function Jw(){return pt.addEventListener&&pt.performance}let Nx=0,En={},Ui,ql;function uY(){const t=Jw();if(t&&Wr){t.mark&&pt.performance.mark("sentry-tracing-init");const e=mY(),n=hY(),r=pY(),i=gY();return()=>{e(),n(),r(),i()}}return()=>{}}function lY(){ku("longtask",({entries:t})=>{for(const e of t){const n=hc();if(!n)return;const r=$n(Wr+e.startTime),i=$n(e.duration);n.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:r,endTimestamp:r+i})}})}function dY(){ku("event",({entries:t})=>{for(const e of t){const n=hc();if(!n)return;if(e.name==="click"){const r=$n(Wr+e.startTime),i=$n(e.duration),s={description:qo(e.target),op:`ui.interaction.${e.name}`,origin:"auto.ui.browser.metrics",startTimestamp:r,endTimestamp:r+i},o=fR(e.target);o&&(s.attributes={"ui.component_name":o}),n.startChild(s)}}})}function fY(t,e){if(Jw()&&Wr){const r=yY(t,e);return()=>{r()}}return()=>{}}function hY(){return XZ(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(mn&&me.log("[Measurements] Adding CLS"),En.cls={value:t.value,unit:""},ql=e)},!0)}function pY(){return gN(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(mn&&me.log("[Measurements] Adding LCP"),En.lcp={value:t.value,unit:"millisecond"},Ui=e)},!0)}function mY(){return eY(({metric:t})=>{const e=t.entries[t.entries.length-1];if(!e)return;const n=$n(Wr),r=$n(e.startTime);mn&&me.log("[Measurements] Adding FID"),En.fid={value:t.value,unit:"millisecond"},En["mark.fid"]={value:n+r,unit:"second"}})}function gY(){return QZ(({metric:t})=>{t.entries[t.entries.length-1]&&(mn&&me.log("[Measurements] Adding TTFB"),En.ttfb={value:t.value,unit:"millisecond"})})}const Ax={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function yY(t,e){return tY(({metric:n})=>{if(n.value===void 0)return;const r=n.entries.find(b=>b.duration===n.value&&Ax[b.name]!==void 0),i=Lt();if(!r||!i)return;const s=Ax[r.name],o=i.getOptions(),a=$n(Wr+r.startTime),c=$n(n.value),u=r.interactionId!==void 0?t[r.interactionId]:void 0;if(u===void 0)return;const{routeName:l,parentContext:d,activeTransaction:f,user:h,replayId:m}=u,p=h!==void 0?h.email||h.id||h.ip_address:void 0,g=f!==void 0?f.getProfileId():void 0,y=new vg({startTimestamp:a,endTimestamp:a+c,op:`ui.interaction.${s}`,name:qo(r.target),attributes:{release:o.release,environment:o.environment,transaction:l,...p!==void 0&&p!==""?{user:p}:{},...g!==void 0?{profile_id:g}:{},...m!==void 0?{replay_id:m}:{}},exclusiveTime:n.value,measurements:{inp:{value:n.value,unit:"millisecond"}}}),v=IY(d,o,e);if(v&&Math.random()<v){const b=y?_Z([y],i.getDsn()):void 0,E=i&&i.getTransport();E&&b&&E.send(b).then(null,w=>{mn&&me.error("Error while sending interaction:",w)});return}})}function vY(t){const e=Jw();if(!e||!pt.performance.getEntries||!Wr)return;mn&&me.log("[Tracing] Adding & adjusting spans using Performance API");const n=$n(Wr),r=e.getEntries(),{op:i,start_timestamp:s}=Dn(t);if(r.slice(Nx).forEach(o=>{const a=$n(o.startTime),c=$n(o.duration);if(!(t.op==="navigation"&&s&&n+a<s))switch(o.entryType){case"navigation":{_Y(t,o,n);break}case"mark":case"paint":case"measure":{bY(t,o,a,c,n);const u=Kw(),l=o.startTime<u.firstHiddenTime;o.name==="first-paint"&&l&&(mn&&me.log("[Measurements] Adding FP"),En.fp={value:o.startTime,unit:"millisecond"}),o.name==="first-contentful-paint"&&l&&(mn&&me.log("[Measurements] Adding FCP"),En.fcp={value:o.startTime,unit:"millisecond"});break}case"resource":{EY(t,o,o.name,a,c,n);break}}}),Nx=Math.max(r.length-1,0),SY(t),i==="pageload"){TY(En),["fcp","fp","lcp"].forEach(a=>{if(!En[a]||!s||n>=s)return;const c=En[a].value,u=n+$n(c),l=Math.abs((u-s)*1e3),d=l-c;mn&&me.log(`[Measurements] Normalized ${a} from ${c} to ${l} (${d})`),En[a].value=l});const o=En["mark.fid"];o&&En.fid&&(Du(t,{description:"first input delay",endTimestamp:o.value+$n(En.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:o.value}),delete En["mark.fid"]),"fcp"in En||delete En.cls,Object.keys(En).forEach(a=>{KG(a,En[a].value,En[a].unit)}),xY(t)}Ui=void 0,ql=void 0,En={}}function bY(t,e,n,r,i){const s=i+n,o=s+r;return Du(t,{description:e.name,endTimestamp:o,op:e.entryType,origin:"auto.resource.browser.metrics",startTimestamp:s}),s}function _Y(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{Sh(t,e,r,n)}),Sh(t,e,"secureConnection",n,"TLS/SSL","connectEnd"),Sh(t,e,"fetch",n,"cache","domainLookupStart"),Sh(t,e,"domainLookup",n,"DNS"),wY(t,e,n)}function Sh(t,e,n,r,i,s){const o=s?e[s]:e[`${n}End`],a=e[`${n}Start`];!a||!o||Du(t,{op:"browser",origin:"auto.browser.browser.metrics",description:i||n,startTimestamp:r+$n(a),endTimestamp:r+$n(o)})}function wY(t,e,n){e.responseEnd&&(Du(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:n+$n(e.requestStart),endTimestamp:n+$n(e.responseEnd)}),Du(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:n+$n(e.responseStart),endTimestamp:n+$n(e.responseEnd)}))}function EY(t,e,n,r,i,s){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;const o=Ca(n),a={};$y(a,e,"transferSize","http.response_transfer_size"),$y(a,e,"encodedBodySize","http.response_content_length"),$y(a,e,"decodedBodySize","http.decoded_response_content_length"),"renderBlockingStatus"in e&&(a["resource.render_blocking_status"]=e.renderBlockingStatus),o.protocol&&(a["url.scheme"]=o.protocol.split(":").pop()),o.host&&(a["server.address"]=o.host),a["url.same_origin"]=n.includes(pt.location.origin);const c=s+r,u=c+i;Du(t,{description:n.replace(pt.location.origin,""),endTimestamp:u,op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:c,data:a})}function SY(t){const e=pt.navigator;if(!e)return;const n=e.connection;n&&(n.effectiveType&&t.setTag("effectiveConnectionType",n.effectiveType),n.type&&t.setTag("connectionType",n.type),Fy(n.rtt)&&(En["connection.rtt"]={value:n.rtt,unit:"millisecond"})),Fy(e.deviceMemory)&&t.setTag("deviceMemory",`${e.deviceMemory} GB`),Fy(e.hardwareConcurrency)&&t.setTag("hardwareConcurrency",String(e.hardwareConcurrency))}function xY(t){Ui&&(mn&&me.log("[Measurements] Adding LCP Data"),Ui.element&&t.setTag("lcp.element",qo(Ui.element)),Ui.id&&t.setTag("lcp.id",Ui.id),Ui.url&&t.setTag("lcp.url",Ui.url.trim().slice(0,200)),t.setTag("lcp.size",Ui.size)),ql&&ql.sources&&(mn&&me.log("[Measurements] Adding CLS Data"),ql.sources.forEach((e,n)=>t.setTag(`cls.source.${n+1}`,qo(e.node))))}function $y(t,e,n,r){const i=e[n];i!=null&&i<cY&&(t[r]=i)}function TY(t){const e=bg();if(!e)return;const{responseStart:n,requestStart:r}=e;r<=n&&(mn&&me.log("[Measurements] Adding TTFB Request Time"),t["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}function IY(t,e,n){if(!Xu(e))return!1;let r;return t!==void 0&&typeof e.tracesSampler=="function"?r=e.tracesSampler({transactionContext:t,name:t.name,parentSampled:t.parentSampled,attributes:{...t.data,...t.attributes},location:pt.location}):t!==void 0&&t.sampled!==void 0?r=t.sampled:typeof e.tracesSampleRate<"u"?r=e.tracesSampleRate:r=1,JR(r)?r===!0?n:r===!1?0:r*n:(mn&&me.warn("[Tracing] Discarding interaction span because of invalid sample rate."),!1)}function OY(t,e,n,r,i="auto.http.browser"){if(!Xu()||!t.fetchData)return;const s=e(t.fetchData.url);if(t.endTimestamp&&s){const h=t.fetchData.__span;if(!h)return;const m=r[h];m&&(DY(m,t),delete r[h]);return}const o=Gr(),a=Lt(),{method:c,url:u}=t.fetchData,l=kY(u),d=l?Ca(l).host:void 0,f=s?WR({name:`${c} ${u}`,onlyIfParent:!0,attributes:{url:u,type:"fetch","http.method":c,"http.url":l,"server.address":d,[ma]:i},op:"http.client"}):void 0;if(f&&(t.fetchData.__span=f.spanContext().spanId,r[f.spanContext().spanId]=f),n(t.fetchData.url)&&a){const h=t.args[0];t.args[1]=t.args[1]||{};const m=t.args[1];m.headers=CY(h,a,o,m,f)}return f}function CY(t,e,n,r,i){const s=i||n.getSpan(),o=Xo(),{traceId:a,spanId:c,sampled:u,dsc:l}={...o.getPropagationContext(),...n.getPropagationContext()},d=s?pg(s):zw(a,c,u),f=DR(l||(s?Cu(s):yg(a,e,n))),h=r.headers||(typeof Request<"u"&&Ys(t,Request)?t.headers:void 0);if(h)if(typeof Headers<"u"&&Ys(h,Headers)){const m=new Headers(h);return m.append("sentry-trace",d),f&&m.append(lb,f),m}else if(Array.isArray(h)){const m=[...h,["sentry-trace",d]];return f&&m.push([lb,f]),m}else{const m="baggage"in h?h.baggage:void 0,p=[];return Array.isArray(m)?p.push(...m):m&&p.push(m),f&&p.push(f),{...h,"sentry-trace":d,baggage:p.length>0?p.join(","):void 0}}else return{"sentry-trace":d,baggage:f}}function kY(t){try{return new URL(t).href}catch{return}}function DY(t,e){if(e.response){Gw(t,e.response.status);const n=e.response&&e.response.headers&&e.response.headers.get("content-length");if(n){const r=parseInt(n);r>0&&t.setAttribute("http.response_content_length",r)}}else e.error&&t.setStatus("internal_error");t.end()}const yb=["localhost",/^\/(?!\/)/],vb={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:yb,tracePropagationTargets:yb};function RY(t){const{traceFetch:e,traceXHR:n,tracePropagationTargets:r,tracingOrigins:i,shouldCreateSpanForRequest:s,enableHTTPTimings:o}={traceFetch:vb.traceFetch,traceXHR:vb.traceXHR,...t},a=typeof s=="function"?s:l=>!0,c=l=>MY(l,r||i),u={};e&&lg(l=>{const d=OY(l,a,c,u);if(d){const f=bN(l.fetchData.url),h=f?Ca(f).host:void 0;d.setAttributes({"http.url":f,"server.address":h})}o&&d&&Px(d)}),n&&fg(l=>{const d=LY(l,a,c,u);o&&d&&Px(d)})}function NY(t){return t.entryType==="resource"&&"initiatorType"in t&&typeof t.nextHopProtocol=="string"&&(t.initiatorType==="fetch"||t.initiatorType==="xmlhttprequest")}function Px(t){const{url:e}=Dn(t).data||{};if(!e||typeof e!="string")return;const n=ku("resource",({entries:r})=>{r.forEach(i=>{NY(i)&&i.name.endsWith(e)&&(PY(i).forEach(o=>t.setAttribute(...o)),setTimeout(n))})})}function AY(t){let e="unknown",n="unknown",r="";for(const i of t){if(i==="/"){[e,n]=t.split("/");break}if(!isNaN(Number(i))){e=r==="h"?"http":r,n=t.split(r)[1];break}r+=i}return r===t&&(e=r),{name:e,version:n}}function ji(t=0){return((Wr||performance.timeOrigin)+t)/1e3}function PY(t){const{name:e,version:n}=AY(t.nextHopProtocol),r=[];return r.push(["network.protocol.version",n],["network.protocol.name",e]),Wr?[...r,["http.request.redirect_start",ji(t.redirectStart)],["http.request.fetch_start",ji(t.fetchStart)],["http.request.domain_lookup_start",ji(t.domainLookupStart)],["http.request.domain_lookup_end",ji(t.domainLookupEnd)],["http.request.connect_start",ji(t.connectStart)],["http.request.secure_connection_start",ji(t.secureConnectionStart)],["http.request.connection_end",ji(t.connectEnd)],["http.request.request_start",ji(t.requestStart)],["http.request.response_start",ji(t.responseStart)],["http.request.response_end",ji(t.responseEnd)]]:r}function MY(t,e){return Yu(t,e||yb)}function LY(t,e,n,r){const i=t.xhr,s=i&&i[Ms];if(!Xu()||!i||i.__sentry_own_request__||!s)return;const o=e(s.url);if(t.endTimestamp&&o){const h=i.__sentry_xhr_span_id__;if(!h)return;const m=r[h];m&&s.status_code!==void 0&&(Gw(m,s.status_code),m.end(),delete r[h]);return}const a=Gr(),c=Xo(),u=bN(s.url),l=u?Ca(u).host:void 0,d=o?WR({name:`${s.method} ${s.url}`,onlyIfParent:!0,attributes:{type:"xhr","http.method":s.method,"http.url":u,url:s.url,"server.address":l,[ma]:"auto.http.browser"},op:"http.client"}):void 0;d&&(i.__sentry_xhr_span_id__=d.spanContext().spanId,r[i.__sentry_xhr_span_id__]=d);const f=Lt();if(i.setRequestHeader&&n(s.url)&&f){const{traceId:h,spanId:m,sampled:p,dsc:g}={...c.getPropagationContext(),...a.getPropagationContext()},y=d?pg(d):zw(h,m,p),v=DR(g||(d?Cu(d):yg(h,f,a)));FY(i,y,v)}return d}function FY(t,e,n){try{t.setRequestHeader("sentry-trace",e),n&&t.setRequestHeader(lb,n)}catch{}}function bN(t){try{return new URL(t,pt.location.origin).href}catch{return}}const $Y="BrowserTracing",jY={...ep,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableInp:!1,interactionsSampleRate:1,_experiments:{},...vb},UY=(t={})=>{const e=mn?!!(t.tracePropagationTargets||t.tracingOrigins):!1;YG(),!t.tracePropagationTargets&&t.tracingOrigins&&(t.tracePropagationTargets=t.tracingOrigins);const n={...jY,...t},r=uY(),i={};n.enableInp&&fY(i,n.interactionsSampleRate),n.enableLongTask&&lY(),n._experiments.enableInteractions&&dY();const s={name:void 0,context:void 0};function o(a){const c=Qn(),{beforeStartSpan:u,idleTimeout:l,finalTimeout:d,heartbeatInterval:f}=n,h=a.op==="pageload";let m;if(h){const v=h?Mx("sentry-trace"):"",b=h?Mx("baggage"):void 0,{traceId:E,dsc:w,parentSpanId:x,sampled:_}=eG(v,b);m={traceId:E,parentSpanId:x,parentSampled:_,...a,metadata:{...a.metadata,dynamicSamplingContext:w},trimEnd:!0}}else m={trimEnd:!0,...a};const p=u?u(m):m;p.metadata=p.name!==m.name?{...p.metadata,source:"custom"}:p.metadata,s.name=p.name,s.context=p,p.sampled===!1&&mn&&me.log(`[Tracing] Will not send ${p.op} transaction because of beforeNavigate.`),mn&&me.log(`[Tracing] Starting ${p.op} transaction on scope`);const{location:g}=pt,y=XR(c,p,l,d,!0,{location:g},f,h);return h&&pt.document&&(pt.document.addEventListener("readystatechange",()=>{["interactive","complete"].includes(pt.document.readyState)&&y.sendAutoFinishSignal()}),["interactive","complete"].includes(pt.document.readyState)&&y.sendAutoFinishSignal()),y.registerBeforeFinishCallback(v=>{r(),vY(v)}),y}return{name:$Y,setupOnce:()=>{},afterAllSetup(a){const c=a.getOptions(),{markBackgroundSpan:u,traceFetch:l,traceXHR:d,shouldCreateSpanForRequest:f,enableHTTPTimings:h,_experiments:m}=n,p=c&&c.tracePropagationTargets,g=p||n.tracePropagationTargets;mn&&e&&p&&me.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used.");let y,v=pt.location&&pt.location.href;if(a.on&&(a.on("startNavigationSpan",b=>{y&&(mn&&me.log(`[Tracing] Finishing current transaction with op: ${Dn(y).op}`),y.end()),y=o({op:"navigation",...b})}),a.on("startPageLoadSpan",b=>{y&&(mn&&me.log(`[Tracing] Finishing current transaction with op: ${Dn(y).op}`),y.end()),y=o({op:"pageload",...b})})),n.instrumentPageLoad&&a.emit&&pt.location){const b={name:pt.location.pathname,startTimestamp:Wr?Wr/1e3:void 0,origin:"auto.pageload.browser",attributes:{[as]:"url"}};_N(a,b)}n.instrumentNavigation&&a.emit&&pt.location&&dg(({to:b,from:E})=>{if(E===void 0&&v&&v.indexOf(b)!==-1){v=void 0;return}if(E!==b){v=void 0;const w={name:pt.location.pathname,origin:"auto.navigation.browser",attributes:{[as]:"url"}};BY(a,w)}}),u&&$Z(),m.enableInteractions&&zY(n,s),n.enableInp&&HY(i,s),RY({traceFetch:l,traceXHR:d,tracePropagationTargets:g,shouldCreateSpanForRequest:f,enableHTTPTimings:h})},options:n}};function _N(t,e){if(!t.emit)return;t.emit("startPageLoadSpan",e);const n=Zw();return(n&&Dn(n).op)==="pageload"?n:void 0}function BY(t,e){if(!t.emit)return;t.emit("startNavigationSpan",e);const n=Zw();return(n&&Dn(n).op)==="navigation"?n:void 0}function Mx(t){const e=cq(`meta[name=${t}]`);return e?e.getAttribute("content"):void 0}function zY(t,e){let n;const r=()=>{const{idleTimeout:i,finalTimeout:s,heartbeatInterval:o}=t,a="ui.action.click",c=hc();if(c&&c.op&&["navigation","pageload"].includes(c.op)){mn&&me.warn(`[Tracing] Did not create ${a} transaction because a pageload or navigation transaction is in progress.`);return}if(n&&(n.setFinishReason("interactionInterrupted"),n.end(),n=void 0),!e.name){mn&&me.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}const{location:u}=pt,l={name:e.name,op:a,trimEnd:!0,data:{[as]:e.context?WY(e.context):"url"}};n=XR(Qn(),l,i,s,!0,{location:u},o)};["click"].forEach(i=>{pt.document&&addEventListener(i,r,{once:!1,capture:!0})})}function VY(t){return"duration"in t}const Lx=10;function HY(t,e){const n=({entries:r})=>{const i=Lt(),s=i!==void 0&&i.getIntegrationByName!==void 0?i.getIntegrationByName("Replay"):void 0,o=s!==void 0?s.getReplayId():void 0,a=hc(),c=Gr(),u=c!==void 0?c.getUser():void 0;r.forEach(l=>{if(VY(l)){const d=l.interactionId;if(d===void 0)return;const f=t[d],h=l.duration,m=l.startTime,p=Object.keys(t),g=p.length>0?p.reduce((y,v)=>t[y].duration<t[v].duration?y:v):void 0;if(l.entryType==="first-input"&&p.map(v=>t[v]).some(v=>v.duration===h&&v.startTime===m)||!d)return;if(f)f.duration=Math.max(f.duration,h);else if(p.length<Lx||g===void 0||h>t[g].duration){const y=e.name,v=e.context;y&&v&&(g&&Object.keys(t).length>=Lx&&delete t[g],t[d]={routeName:y,duration:h,parentContext:v,user:u,activeTransaction:a,replayId:o,startTime:m})}}})};ku("event",n),ku("first-input",n)}function WY(t){const e=t.attributes&&t.attributes[as],n=t.data&&t.data[as],r=t.metadata&&t.metadata.source;return e||n||r}const Jt=Mt;let bb=0;function wN(){return bb>0}function qY(){bb++,setTimeout(()=>{bb--})}function Ru(t,e={},n){if(typeof t!="function")return t;try{const i=t.__sentry_wrapped__;if(i)return typeof i=="function"?i:t;if(Uw(t))return t}catch{return t}const r=function(){const i=Array.prototype.slice.call(arguments);try{const s=i.map(o=>Ru(o,e));return t.apply(this,s)}catch(s){throw qY(),$R(o=>{o.addEventProcessor(a=>(e.mechanism&&(rb(a,void 0),Ya(a,e.mechanism)),a.extra={...a.extra,arguments:i},a)),kf(s)}),s}};try{for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}catch{}pR(r,t),Go(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return t.name}})}catch{}return r}const Ls=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function EN(t,e){const n=Xw(t,e),r={type:e&&e.name,value:KY(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function GY(t,e,n,r){const i=Lt(),s=i&&i.getOptions().normalizeDepth,o={exception:{values:[{type:cg(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:QY(e,{isUnhandledRejection:r})}]},extra:{__serialized__:IR(e,s)}};if(n){const a=Xw(t,n);a.length&&(o.exception.values[0].stacktrace={frames:a})}return o}function jy(t,e){return{exception:{values:[EN(t,e)]}}}function Xw(t,e){const n=e.stacktrace||e.stack||"",r=YY(e);try{return t(n,r)}catch{}return[]}const ZY=/Minified React error #\d+;/i;function YY(t){if(t){if(typeof t.framesToPop=="number")return t.framesToPop;if(ZY.test(t.message))return 1}return 0}function KY(t){const e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function JY(t,e,n,r){const i=n&&n.syntheticException||void 0,s=Qw(t,e,i,r);return Ya(s),s.level="error",n&&n.event_id&&(s.event_id=n.event_id),Ou(s)}function XY(t,e,n="info",r,i){const s=r&&r.syntheticException||void 0,o=_b(t,e,s,i);return o.level=n,r&&r.event_id&&(o.event_id=r.event_id),Ou(o)}function Qw(t,e,n,r,i){let s;if(Lw(e)&&e.error)return jy(t,e.error);if(KS(e)||XW(e)){const o=e;if("stack"in e)s=jy(t,e);else{const a=o.name||(KS(o)?"DOMError":"DOMException"),c=o.message?`${a}: ${o.message}`:a;s=_b(t,c,n,r),rb(s,c)}return"code"in o&&(s.tags={...s.tags,"DOMException.code":`${o.code}`}),s}return eu(e)?jy(t,e):Ga(e)||cg(e)?(s=GY(t,e,n,i),Ya(s,{synthetic:!0}),s):(s=_b(t,e,n,r),rb(s,`${e}`),Ya(s,{synthetic:!0}),s)}function _b(t,e,n,r){const i={};if(r&&n){const s=Xw(t,n);s.length&&(i.exception={values:[{value:e,stacktrace:{frames:s}}]})}if(Fw(e)){const{__sentry_template_string__:s,__sentry_template_values__:o}=e;return i.logentry={message:s,params:o},i}return i.message=e,i}function QY(t,{isUnhandledRejection:e}){const n=yq(t),r=e?"promise rejection":"exception";return Lw(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:cg(t)?`Event \`${eK(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function eK(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function tK(t,{metadata:e,tunnel:n,dsn:r}){const i={event_id:t.event_id,sent_at:new Date().toISOString(),...e&&e.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}},...!!n&&!!r&&{dsn:Ju(r)}},s=nK(t);return Jo(i,[s])}function nK(t){return[{type:"user_report"},t]}class rK extends fZ{constructor(e){const n=Jt.SENTRY_SDK_SOURCE||Fq();iN(e,"browser",["browser"],n),super(e),e.sendClientReports&&Jt.document&&Jt.document.addEventListener("visibilitychange",()=>{Jt.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,n){return JY(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return XY(this._options.stackParser,e,n,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled()){Ls&&me.warn("SDK not enabled, will not capture user feedback.");return}const n=tK(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(n)}_prepareEvent(e,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r)}_flushOutcomes(){const e=this._clearOutcomes();if(e.length===0){Ls&&me.log("No outcomes to send");return}if(!this._dsn){Ls&&me.log("No dsn provided, will not send outcomes");return}Ls&&me.log("Sending outcomes:",e);const n=oG(e,this._options.tunnel&&Ju(this._dsn));this._sendEnvelope(n)}}let Pl;function iK(){if(Pl)return Pl;if(ab(Jt.fetch))return Pl=Jt.fetch.bind(Jt);const t=Jt.document;let e=Jt.fetch;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n);const r=n.contentWindow;r&&r.fetch&&(e=r.fetch),t.head.removeChild(n)}catch(n){Ls&&me.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return Pl=e.bind(Jt)}function sK(){Pl=void 0}function oK(t,e=iK()){let n=0,r=0;function i(s){const o=s.body.length;n+=o,r++;const a={body:s.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:n<=6e4&&r<15,...t.fetchOptions};try{return e(t.url,a).then(c=>(n-=o,r--,{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}))}catch(c){return sK(),n-=o,r--,Bw(c)}}return nN(t,i)}const aK=4;function cK(t){function e(n){return new Fr((r,i)=>{const s=new XMLHttpRequest;s.onerror=i,s.onreadystatechange=()=>{s.readyState===aK&&r({statusCode:s.status,headers:{"x-sentry-rate-limits":s.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":s.getResponseHeader("Retry-After")}})},s.open("POST",t.url);for(const o in t.headers)Object.prototype.hasOwnProperty.call(t.headers,o)&&s.setRequestHeader(o,t.headers[o]);s.send(n.body)})}return nN(t,e)}const _g="?",uK=30,lK=40,dK=50;function e0(t,e,n,r){const i={filename:t,function:e,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}const fK=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,hK=/\((\S*)(?::(\d+))(?::(\d+))\)/,pK=t=>{const e=fK.exec(t);if(e){if(e[2]&&e[2].indexOf("eval")===0){const s=hK.exec(e[2]);s&&(e[2]=s[1],e[3]=s[2],e[4]=s[3])}const[r,i]=SN(e[1]||_g,e[2]);return e0(i,r,e[3]?+e[3]:void 0,e[4]?+e[4]:void 0)}},mK=[uK,pK],gK=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,yK=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,vK=t=>{const e=gK.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const s=yK.exec(e[3]);s&&(e[1]=e[1]||"eval",e[3]=s[1],e[4]=s[2],e[5]="")}let r=e[3],i=e[1]||_g;return[i,r]=SN(i,r),e0(r,i,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},bK=[dK,vK],_K=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,wK=t=>{const e=_K.exec(t);return e?e0(e[2],e[1]||_g,+e[3],e[4]?+e[4]:void 0):void 0},EK=[lK,wK],SK=[mK,bK,EK],xK=yR(...SK),SN=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:_g,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},xh=1024,xN="Breadcrumbs",TK=(t={})=>{const e={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:xN,setupOnce(){},setup(n){e.console&&vR(CK(n)),e.dom&&wR(OK(n,e.dom)),e.xhr&&fg(kK(n)),e.fetch&&lg(DK(n)),e.history&&dg(RK(n)),e.sentry&&n.on&&n.on("beforeSendEvent",IK(n))}}},TN=TK;Li(xN,TN);function IK(t){return function(n){Lt()===t&&Zo({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:_o(n)},{event:n})}}function OK(t,e){return function(r){if(Lt()!==t)return;let i,s,o=typeof e=="object"?e.serializeAttribute:void 0,a=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;a&&a>xh&&(Ls&&me.warn(`\`dom.maxStringLength\` cannot exceed ${xh}, but a value of ${a} was configured. Sentry will use ${xh} instead.`),a=xh),typeof o=="string"&&(o=[o]);try{const u=r.event,l=NK(u)?u.target:u;i=qo(l,{keyAttrs:o,maxStringLength:a}),s=fR(l)}catch{i="<unknown>"}if(i.length===0)return;const c={category:`ui.${r.name}`,message:i};s&&(c.data={"ui.component_name":s}),Zo(c,{event:r.event,name:r.name,global:r.global})}}function CK(t){return function(n){if(Lt()!==t)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:OR(n.level),message:Qp(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${Qp(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;Zo(r,{input:n.args,level:n.level})}}function kK(t){return function(n){if(Lt()!==t)return;const{startTimestamp:r,endTimestamp:i}=n,s=n.xhr[Ms];if(!r||!i||!s)return;const{method:o,url:a,status_code:c,body:u}=s,l={method:o,url:a,status_code:c},d={xhr:n.xhr,input:u,startTimestamp:r,endTimestamp:i};Zo({category:"xhr",data:l,type:"http"},d)}}function DK(t){return function(n){if(Lt()!==t)return;const{startTimestamp:r,endTimestamp:i}=n;if(i&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const s=n.fetchData,o={data:n.error,input:n.args,startTimestamp:r,endTimestamp:i};Zo({category:"fetch",data:s,level:"error",type:"http"},o)}else{const s=n.response,o={...n.fetchData,status_code:s&&s.status},a={input:n.args,response:s,startTimestamp:r,endTimestamp:i};Zo({category:"fetch",data:o,type:"http"},a)}}}function RK(t){return function(n){if(Lt()!==t)return;let r=n.from,i=n.to;const s=Ca(Jt.location.href);let o=r?Ca(r):void 0;const a=Ca(i);(!o||!o.path)&&(o=s),s.protocol===a.protocol&&s.host===a.host&&(i=a.relative),s.protocol===o.protocol&&s.host===o.host&&(r=o.relative),Zo({category:"navigation",data:{from:r,to:i}})}}function NK(t){return!!t&&!!t.target}const IN="Dedupe",AK=()=>{let t;return{name:IN,setupOnce(){},processEvent(e){if(e.type)return e;try{if(PK(e,t))return Ls&&me.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}},ON=AK;Li(IN,ON);function PK(t,e){return e?!!(MK(t,e)||LK(t,e)):!1}function MK(t,e){const n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!kN(t,e)||!CN(t,e))}function LK(t,e){const n=Fx(e),r=Fx(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!kN(t,e)||!CN(t,e))}function CN(t,e){let n=$x(t),r=$x(e);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let i=0;i<r.length;i++){const s=r[i],o=n[i];if(s.filename!==o.filename||s.lineno!==o.lineno||s.colno!==o.colno||s.function!==o.function)return!1}return!0}function kN(t,e){let n=t.fingerprint,r=e.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function Fx(t){return t.exception&&t.exception.values&&t.exception.values[0]}function $x(t){const e=t.exception;if(e)try{return e.values[0].stacktrace.frames}catch{return}}const DN="GlobalHandlers",FK=(t={})=>{const e={onerror:!0,onunhandledrejection:!0,...t};return{name:DN,setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&($K(n),jx("onerror")),e.onunhandledrejection&&(jK(n),jx("onunhandledrejection"))}}},RN=FK;Li(DN,RN);function $K(t){xR(e=>{const{stackParser:n,attachStacktrace:r}=AN();if(Lt()!==t||wN())return;const{msg:i,url:s,line:o,column:a,error:c}=e,u=c===void 0&&os(i)?zK(i,s,o,a):NN(Qw(n,c||i,void 0,r,!1),s,o,a);u.level="error",gg(u,{originalException:c,mechanism:{handled:!1,type:"onerror"}})})}function jK(t){TR(e=>{const{stackParser:n,attachStacktrace:r}=AN();if(Lt()!==t||wN())return;const i=UK(e),s=$w(i)?BK(i):Qw(n,i,void 0,r,!0);s.level="error",gg(s,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function UK(t){if($w(t))return t;const e=t;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return t}function BK(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function zK(t,e,n,r){const i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let s=Lw(t)?t.message:t,o="Error";const a=s.match(i);return a&&(o=a[1],s=a[2]),NN({exception:{values:[{type:o,value:s}]}},e,n,r)}function NN(t,e,n,r){const i=t.exception=t.exception||{},s=i.values=i.values||[],o=s[0]=s[0]||{},a=o.stacktrace=o.stacktrace||{},c=a.frames=a.frames||[],u=isNaN(parseInt(r,10))?void 0:r,l=isNaN(parseInt(n,10))?void 0:n,d=os(e)&&e.length>0?e:aq();return c.length===0&&c.push({colno:u,filename:d,function:"?",in_app:!0,lineno:l}),t}function jx(t){Ls&&me.log(`Global Handler attached: ${t}`)}function AN(){const t=Lt();return t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const PN="HttpContext",VK=()=>({name:PN,setupOnce(){},preprocessEvent(t){if(!Jt.navigator&&!Jt.location&&!Jt.document)return;const e=t.request&&t.request.url||Jt.location&&Jt.location.href,{referrer:n}=Jt.document||{},{userAgent:r}=Jt.navigator||{},i={...t.request&&t.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},s={...t.request,...e&&{url:e},headers:i};t.request=s}}),MN=VK;Li(PN,MN);const HK="cause",WK=5,LN="LinkedErrors",qK=(t={})=>{const e=t.limit||WK,n=t.key||HK;return{name:LN,setupOnce(){},preprocessEvent(r,i,s){const o=s.getOptions();rq(EN,o.stackParser,o.maxValueLength,n,e,r,i)}}},FN=qK;Li(LN,FN);const GK=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],$N="TryCatch",ZK=(t={})=>{const e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...t};return{name:$N,setupOnce(){e.setTimeout&&Vn(Jt,"setTimeout",Ux),e.setInterval&&Vn(Jt,"setInterval",Ux),e.requestAnimationFrame&&Vn(Jt,"requestAnimationFrame",YK),e.XMLHttpRequest&&"XMLHttpRequest"in Jt&&Vn(XMLHttpRequest.prototype,"send",KK);const n=e.eventTarget;n&&(Array.isArray(n)?n:GK).forEach(JK)}}},jN=ZK;Li($N,jN);function Ux(t){return function(...e){const n=e[0];return e[0]=Ru(n,{mechanism:{data:{function:Ks(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function YK(t){return function(e){return t.apply(this,[Ru(e,{mechanism:{data:{function:"requestAnimationFrame",handler:Ks(t)},handled:!1,type:"instrument"}})])}}function KK(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(i=>{i in n&&typeof n[i]=="function"&&Vn(n,i,function(s){const o={mechanism:{data:{function:i,handler:Ks(s)},handled:!1,type:"instrument"}},a=Uw(s);return a&&(o.mechanism.data.handler=Ks(a)),Ru(s,o)})}),t.apply(this,e)}}function JK(t){const e=Jt,n=e[t]&&e[t].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(Vn(n,"addEventListener",function(r){return function(i,s,o){try{typeof s.handleEvent=="function"&&(s.handleEvent=Ru(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Ks(s),target:t},handled:!1,type:"instrument"}}))}catch{}return r.apply(this,[i,Ru(s,{mechanism:{data:{function:"addEventListener",handler:Ks(s),target:t},handled:!1,type:"instrument"}}),o])}}),Vn(n,"removeEventListener",function(r){return function(i,s,o){const a=s;try{const c=a&&a.__sentry_wrapped__;c&&r.call(this,i,c,o)}catch{}return r.call(this,i,a,o)}}))}const XK=[oN(),cN(),jN(),TN(),RN(),FN(),ON(),MN()];function QK(t){return[...XK]}function eJ(t={}){t.defaultIntegrations===void 0&&(t.defaultIntegrations=QK()),t.release===void 0&&(typeof __SENTRY_RELEASE__=="string"&&(t.release=__SENTRY_RELEASE__),Jt.SENTRY_RELEASE&&Jt.SENTRY_RELEASE.id&&(t.release=Jt.SENTRY_RELEASE.id)),t.autoSessionTracking===void 0&&(t.autoSessionTracking=!0),t.sendClientReports===void 0&&(t.sendClientReports=!0);const e={...t,stackParser:bq(t.stackParser||xK),integrations:oZ(t),transport:t.transport||(ER()?oK:cK)};gZ(rK,e),t.autoSessionTracking&&tJ()}function tJ(){if(typeof Jt.document>"u"){Ls&&me.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");return}mx({ignoreDuration:!0}),gx(),dg(({from:t,to:e})=>{t!==void 0&&t!==e&&(mx({ignoreDuration:!0}),gx())})}const cn=Mt,t0="sentryReplaySession",nJ="replay_event",n0="Unable to send Replay",rJ=3e5,iJ=9e5,sJ=5e3,oJ=5500,aJ=6e4,cJ=5e3,uJ=3,Bx=15e4,Th=5e3,lJ=3e3,dJ=300,r0=2e7,fJ=4999,hJ=15e3,zx=36e5;function pJ(t,e){return t??e()}function am(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}var Fn;(function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"})(Fn||(Fn={}));function mJ(t){return t.nodeType===t.ELEMENT_NODE}function Gl(t){const e=am([t,"optionalAccess",n=>n.host]);return am([e,"optionalAccess",n=>n.shadowRoot])===t}function Zl(t){return Object.prototype.toString.call(t)==="[object ShadowRoot]"}function gJ(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),t}function yJ(t){const{cssText:e}=t;if(e.split('"').length<3)return e;const n=["@import",`url(${JSON.stringify(t.href)})`];return t.layerName===""?n.push("layer"):t.layerName&&n.push(`layer(${t.layerName})`),t.supportsText&&n.push(`supports(${t.supportsText})`),t.media.length&&n.push(t.media.mediaText),n.join(" ")+";"}function cm(t){try{const e=t.rules||t.cssRules;return e?gJ(Array.from(e,UN).join("")):null}catch{return null}}function UN(t){let e;if(bJ(t))try{e=cm(t.styleSheet)||yJ(t)}catch{}else if(_J(t)&&t.selectorText.includes(":"))return vJ(t.cssText);return e||t.cssText}function vJ(t){const e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return t.replace(e,"$1\\$2")}function bJ(t){return"styleSheet"in t}function _J(t){return"selectorText"in t}class BN{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){if(!e)return-1;const n=am([this,"access",r=>r.getMeta,"call",r=>r(e),"optionalAccess",r=>r.id]);return pJ(n,()=>-1)}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,n){const r=n.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,n)}replace(e,n){const r=this.getNode(e);if(r){const i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(n,i)}this.idNodeMap.set(e,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function wJ(){return new BN}function wg({maskInputOptions:t,tagName:e,type:n}){return e==="OPTION"&&(e="SELECT"),!!(t[e.toLowerCase()]||n&&t[n]||n==="password"||e==="INPUT"&&!n&&t.text)}function tf({isMasked:t,element:e,value:n,maskInputFn:r}){let i=n||"";return t?(r&&(i=r(i,e)),"*".repeat(i.length)):i}function Nu(t){return t.toLowerCase()}function wb(t){return t.toUpperCase()}const Vx="__rrweb_original__";function EJ(t){const e=t.getContext("2d");if(!e)return!0;const n=50;for(let r=0;r<t.width;r+=n)for(let i=0;i<t.height;i+=n){const s=e.getImageData,o=Vx in s?s[Vx]:s;if(new Uint32Array(o.call(e,r,i,Math.min(n,t.width-r),Math.min(n,t.height-i)).data.buffer).some(c=>c!==0))return!1}return!0}function i0(t){const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Nu(e):null}function um(t,e,n){return e==="INPUT"&&(n==="radio"||n==="checkbox")?t.getAttribute("value")||"":t.value}let SJ=1;const xJ=new RegExp("[^a-z0-9-_:]"),nf=-2;function s0(){return SJ++}function TJ(t){if(t instanceof HTMLFormElement)return"form";const e=Nu(t.tagName);return xJ.test(e)?"div":e}function IJ(t){let e="";return t.indexOf("//")>-1?e=t.split("/").slice(0,3).join("/"):e=t.split("/")[0],e=e.split("?")[0],e}let Oc,Hx;const OJ=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,CJ=/^(?:[a-z+]+:)?\/\//i,kJ=/^www\..*/i,DJ=/^(data:)([^,]*),(.*)/i;function lm(t,e){return(t||"").replace(OJ,(n,r,i,s,o,a)=>{const c=i||o||a,u=r||s||"";if(!c)return n;if(CJ.test(c)||kJ.test(c))return`url(${u}${c}${u})`;if(DJ.test(c))return`url(${u}${c}${u})`;if(c[0]==="/")return`url(${u}${IJ(e)+c}${u})`;const l=e.split("/"),d=c.split("/");l.pop();for(const f of d)f!=="."&&(f===".."?l.pop():l.push(f));return`url(${u}${l.join("/")}${u})`})}const RJ=/^[^ \t\n\r\u000c]+/,NJ=/^[, \t\n\r\u000c]+/;function AJ(t,e){if(e.trim()==="")return e;let n=0;function r(s){let o;const a=s.exec(e.substring(n));return a?(o=a[0],n+=o.length,o):""}const i=[];for(;r(NJ),!(n>=e.length);){let s=r(RJ);if(s.slice(-1)===",")s=jc(t,s.substring(0,s.length-1)),i.push(s);else{let o="";s=jc(t,s);let a=!1;for(;;){const c=e.charAt(n);if(c===""){i.push((s+o).trim());break}else if(a)c===")"&&(a=!1);else if(c===","){n+=1,i.push((s+o).trim());break}else c==="("&&(a=!0);o+=c,n+=1}}}return i.join(", ")}function jc(t,e){if(!e||e.trim()==="")return e;const n=t.createElement("a");return n.href=e,n.href}function PJ(t){return!!(t.tagName==="svg"||t.ownerSVGElement)}function o0(){const t=document.createElement("a");return t.href="",t.href}function zN(t,e,n,r,i,s){return r&&(n==="src"||n==="href"&&!(e==="use"&&r[0]==="#")||n==="xlink:href"&&r[0]!=="#"||n==="background"&&(e==="table"||e==="td"||e==="th")?jc(t,r):n==="srcset"?AJ(t,r):n==="style"?lm(r,o0()):e==="object"&&n==="data"?jc(t,r):typeof s=="function"?s(n,r,i):r)}function VN(t,e,n){return(t==="video"||t==="audio")&&e==="autoplay"}function MJ(t,e,n,r){try{if(r&&t.matches(r))return!1;if(typeof e=="string"){if(t.classList.contains(e))return!0}else for(let i=t.classList.length;i--;){const s=t.classList[i];if(e.test(s))return!0}if(n)return t.matches(n)}catch{}return!1}function LJ(t,e){for(let n=t.classList.length;n--;){const r=t.classList[n];if(e.test(r))return!0}return!1}function ga(t,e,n=1/0,r=0){return!t||t.nodeType!==t.ELEMENT_NODE||r>n?-1:e(t)?r:ga(t.parentNode,e,n,r+1)}function Uc(t,e){return n=>{const r=n;if(r===null)return!1;try{if(t){if(typeof t=="string"){if(r.matches(`.${t}`))return!0}else if(LJ(r,t))return!0}return!!(e&&r.matches(e))}catch{return!1}}}function Au(t,e,n,r,i,s){try{const o=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(o===null)return!1;if(o.tagName==="INPUT"){const u=o.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(u))return!0}let a=-1,c=-1;if(s){if(c=ga(o,Uc(r,i)),c<0)return!0;a=ga(o,Uc(e,n),c>=0?c:1/0)}else{if(a=ga(o,Uc(e,n)),a<0)return!1;c=ga(o,Uc(r,i),a>=0?a:1/0)}return a>=0?c>=0?a<=c:!0:c>=0?!1:!!s}catch{}return!!s}function FJ(t,e,n){const r=t.contentWindow;if(!r)return;let i=!1,s;try{s=r.document.readyState}catch{return}if(s!=="complete"){const a=setTimeout(()=>{i||(e(),i=!0)},n);t.addEventListener("load",()=>{clearTimeout(a),i=!0,e()});return}const o="about:blank";if(r.location.href!==o||t.src===o||t.src==="")return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}function $J(t,e,n){let r=!1,i;try{i=t.sheet}catch{return}if(i)return;const s=setTimeout(()=>{r||(e(),r=!0)},n);t.addEventListener("load",()=>{clearTimeout(s),r=!0,e()})}function jJ(t,e){const{doc:n,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:a,maskAttributeFn:c,maskTextClass:u,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:f,inlineStylesheet:h,maskInputOptions:m={},maskTextFn:p,maskInputFn:g,dataURLOptions:y={},inlineImages:v,recordCanvas:b,keepIframeSrcFn:E,newlyAddedElement:w=!1}=e,x=UJ(n,r);switch(t.nodeType){case t.DOCUMENT_NODE:return t.compatMode!=="CSS1Compat"?{type:Fn.Document,childNodes:[],compatMode:t.compatMode}:{type:Fn.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Fn.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:x};case t.ELEMENT_NODE:return zJ(t,{doc:n,blockClass:i,blockSelector:s,unblockSelector:o,inlineStylesheet:h,maskAttributeFn:c,maskInputOptions:m,maskInputFn:g,dataURLOptions:y,inlineImages:v,recordCanvas:b,keepIframeSrcFn:E,newlyAddedElement:w,rootId:x,maskAllText:a,maskTextClass:u,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:f});case t.TEXT_NODE:return BJ(t,{maskAllText:a,maskTextClass:u,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:f,maskTextFn:p,maskInputOptions:m,maskInputFn:g,rootId:x});case t.CDATA_SECTION_NODE:return{type:Fn.CDATA,textContent:"",rootId:x};case t.COMMENT_NODE:return{type:Fn.Comment,textContent:t.textContent||"",rootId:x};default:return!1}}function UJ(t,e){if(!e.hasNode(t))return;const n=e.getId(t);return n===1?void 0:n}function BJ(t,e){const{maskAllText:n,maskTextClass:r,unmaskTextClass:i,maskTextSelector:s,unmaskTextSelector:o,maskTextFn:a,maskInputOptions:c,maskInputFn:u,rootId:l}=e,d=t.parentNode&&t.parentNode.tagName;let f=t.textContent;const h=d==="STYLE"?!0:void 0,m=d==="SCRIPT"?!0:void 0,p=d==="TEXTAREA"?!0:void 0;if(h&&f){try{t.nextSibling||t.previousSibling||am([t,"access",y=>y.parentNode,"access",y=>y.sheet,"optionalAccess",y=>y.cssRules])&&(f=cm(t.parentNode.sheet))}catch(y){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${y}`,t)}f=lm(f,o0())}m&&(f="SCRIPT_PLACEHOLDER");const g=Au(t,r,s,i,o,n);if(!h&&!m&&!p&&f&&g&&(f=a?a(f,t.parentElement):f.replace(/[\S]/g,"*")),p&&f&&(c.textarea||g)&&(f=u?u(f,t.parentNode):f.replace(/[\S]/g,"*")),d==="OPTION"&&f){const y=wg({type:null,tagName:d,maskInputOptions:c});f=tf({isMasked:Au(t,r,s,i,o,y),element:t,value:f,maskInputFn:u})}return{type:Fn.Text,textContent:f||"",isStyle:h,rootId:l}}function zJ(t,e){const{doc:n,blockClass:r,blockSelector:i,unblockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskAttributeFn:c,maskInputFn:u,dataURLOptions:l={},inlineImages:d,recordCanvas:f,keepIframeSrcFn:h,newlyAddedElement:m=!1,rootId:p,maskAllText:g,maskTextClass:y,unmaskTextClass:v,maskTextSelector:b,unmaskTextSelector:E}=e,w=MJ(t,r,i,s),x=TJ(t);let _={};const k=t.attributes.length;for(let F=0;F<k;F++){const V=t.attributes[F];V.name&&!VN(x,V.name,V.value)&&(_[V.name]=zN(n,x,Nu(V.name),V.value,t,c))}if(x==="link"&&o){const F=Array.from(n.styleSheets).find(T=>T.href===t.href);let V=null;F&&(V=cm(F)),V&&(delete _.rel,delete _.href,_._cssText=lm(V,F.href))}if(x==="style"&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){const F=cm(t.sheet);F&&(_._cssText=lm(F,o0()))}if(x==="input"||x==="textarea"||x==="select"||x==="option"){const F=t,V=i0(F),T=um(F,wb(x),V),L=F.checked;if(V!=="submit"&&V!=="button"&&T){const S=Au(F,y,b,v,E,wg({type:V,tagName:wb(x),maskInputOptions:a}));_.value=tf({isMasked:S,element:F,value:T,maskInputFn:u})}L&&(_.checked=L)}if(x==="option"&&(t.selected&&!a.select?_.selected=!0:delete _.selected),x==="canvas"&&f){if(t.__context==="2d")EJ(t)||(_.rr_dataURL=t.toDataURL(l.type,l.quality));else if(!("__context"in t)){const F=t.toDataURL(l.type,l.quality),V=document.createElement("canvas");V.width=t.width,V.height=t.height;const T=V.toDataURL(l.type,l.quality);F!==T&&(_.rr_dataURL=F)}}if(x==="img"&&d){Oc||(Oc=n.createElement("canvas"),Hx=Oc.getContext("2d"));const F=t,V=F.crossOrigin;F.crossOrigin="anonymous";const T=()=>{F.removeEventListener("load",T);try{Oc.width=F.naturalWidth,Oc.height=F.naturalHeight,Hx.drawImage(F,0,0),_.rr_dataURL=Oc.toDataURL(l.type,l.quality)}catch(L){console.warn(`Cannot inline img src=${F.currentSrc}! Error: ${L}`)}V?_.crossOrigin=V:F.removeAttribute("crossorigin")};F.complete&&F.naturalWidth!==0?T():F.addEventListener("load",T)}if((x==="audio"||x==="video")&&(_.rr_mediaState=t.paused?"paused":"played",_.rr_mediaCurrentTime=t.currentTime),m||(t.scrollLeft&&(_.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(_.rr_scrollTop=t.scrollTop)),w){const{width:F,height:V}=t.getBoundingClientRect();_={class:_.class,rr_width:`${F}px`,rr_height:`${V}px`}}x==="iframe"&&!h(_.src)&&(t.contentDocument||(_.rr_src=_.src),delete _.src);let R;try{customElements.get(x)&&(R=!0)}catch{}return{type:Fn.Element,tagName:x,attributes:_,childNodes:[],isSVG:PJ(t)||void 0,needBlock:w,rootId:p,isCustom:R}}function on(t){return t==null?"":t.toLowerCase()}function VJ(t,e){if(e.comment&&t.type===Fn.Comment)return!0;if(t.type===Fn.Element){if(e.script&&(t.tagName==="script"||t.tagName==="link"&&(t.attributes.rel==="preload"||t.attributes.rel==="modulepreload")&&t.attributes.as==="script"||t.tagName==="link"&&t.attributes.rel==="prefetch"&&typeof t.attributes.href=="string"&&t.attributes.href.endsWith(".js")))return!0;if(e.headFavicon&&(t.tagName==="link"&&t.attributes.rel==="shortcut icon"||t.tagName==="meta"&&(on(t.attributes.name).match(/^msapplication-tile(image|color)$/)||on(t.attributes.name)==="application-name"||on(t.attributes.rel)==="icon"||on(t.attributes.rel)==="apple-touch-icon"||on(t.attributes.rel)==="shortcut icon")))return!0;if(t.tagName==="meta"){if(e.headMetaDescKeywords&&on(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(on(t.attributes.property).match(/^(og|twitter|fb):/)||on(t.attributes.name).match(/^(og|twitter):/)||on(t.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(on(t.attributes.name)==="robots"||on(t.attributes.name)==="googlebot"||on(t.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&t.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(on(t.attributes.name)==="author"||on(t.attributes.name)==="generator"||on(t.attributes.name)==="framework"||on(t.attributes.name)==="publisher"||on(t.attributes.name)==="progid"||on(t.attributes.property).match(/^article:/)||on(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(on(t.attributes.name)==="google-site-verification"||on(t.attributes.name)==="yandex-verification"||on(t.attributes.name)==="csrf-token"||on(t.attributes.name)==="p:domain_verify"||on(t.attributes.name)==="verify-v1"||on(t.attributes.name)==="verification"||on(t.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Bc(t,e){const{doc:n,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:d,skipChild:f=!1,inlineStylesheet:h=!0,maskInputOptions:m={},maskAttributeFn:p,maskTextFn:g,maskInputFn:y,slimDOMOptions:v,dataURLOptions:b={},inlineImages:E=!1,recordCanvas:w=!1,onSerialize:x,onIframeLoad:_,iframeLoadTimeout:k=5e3,onStylesheetLoad:R,stylesheetLoadTimeout:F=5e3,keepIframeSrcFn:V=()=>!1,newlyAddedElement:T=!1}=e;let{preserveWhiteSpace:L=!0}=e;const S=jJ(t,{doc:n,mirror:r,blockClass:i,blockSelector:s,maskAllText:a,unblockSelector:o,maskTextClass:c,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:d,inlineStylesheet:h,maskInputOptions:m,maskAttributeFn:p,maskTextFn:g,maskInputFn:y,dataURLOptions:b,inlineImages:E,recordCanvas:w,keepIframeSrcFn:V,newlyAddedElement:T});if(!S)return console.warn(t,"not serialized"),null;let C;r.hasNode(t)?C=r.getId(t):VJ(S,v)||!L&&S.type===Fn.Text&&!S.isStyle&&!S.textContent.replace(/^\s+|\s+$/gm,"").length?C=nf:C=s0();const N=Object.assign(S,{id:C});if(r.add(t,N),C===nf)return null;x&&x(t);let U=!f;if(N.type===Fn.Element){U=U&&!N.needBlock,delete N.needBlock;const K=t.shadowRoot;K&&Zl(K)&&(N.isShadowHost=!0)}if((N.type===Fn.Document||N.type===Fn.Element)&&U){v.headWhitespace&&N.type===Fn.Element&&N.tagName==="head"&&(L=!1);const K={doc:n,mirror:r,blockClass:i,blockSelector:s,maskAllText:a,unblockSelector:o,maskTextClass:c,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:d,skipChild:f,inlineStylesheet:h,maskInputOptions:m,maskAttributeFn:p,maskTextFn:g,maskInputFn:y,slimDOMOptions:v,dataURLOptions:b,inlineImages:E,recordCanvas:w,preserveWhiteSpace:L,onSerialize:x,onIframeLoad:_,iframeLoadTimeout:k,onStylesheetLoad:R,stylesheetLoadTimeout:F,keepIframeSrcFn:V};for(const $ of Array.from(t.childNodes)){const q=Bc($,K);q&&N.childNodes.push(q)}if(mJ(t)&&t.shadowRoot)for(const $ of Array.from(t.shadowRoot.childNodes)){const q=Bc($,K);q&&(Zl(t.shadowRoot)&&(q.isShadow=!0),N.childNodes.push(q))}}return t.parentNode&&Gl(t.parentNode)&&Zl(t.parentNode)&&(N.isShadow=!0),N.type===Fn.Element&&N.tagName==="iframe"&&FJ(t,()=>{const K=t.contentDocument;if(K&&_){const $=Bc(K,{doc:K,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:m,maskAttributeFn:p,maskTextFn:g,maskInputFn:y,slimDOMOptions:v,dataURLOptions:b,inlineImages:E,recordCanvas:w,preserveWhiteSpace:L,onSerialize:x,onIframeLoad:_,iframeLoadTimeout:k,onStylesheetLoad:R,stylesheetLoadTimeout:F,keepIframeSrcFn:V});$&&_(t,$)}},k),N.type===Fn.Element&&N.tagName==="link"&&N.attributes.rel==="stylesheet"&&$J(t,()=>{if(R){const K=Bc(t,{doc:n,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:m,maskAttributeFn:p,maskTextFn:g,maskInputFn:y,slimDOMOptions:v,dataURLOptions:b,inlineImages:E,recordCanvas:w,preserveWhiteSpace:L,onSerialize:x,onIframeLoad:_,iframeLoadTimeout:k,onStylesheetLoad:R,stylesheetLoadTimeout:F,keepIframeSrcFn:V});K&&R(t,K)}},F),N}function HJ(t,e){const{mirror:n=new BN,blockClass:r="rr-block",blockSelector:i=null,unblockSelector:s=null,maskAllText:o=!1,maskTextClass:a="rr-mask",unmaskTextClass:c=null,maskTextSelector:u=null,unmaskTextSelector:l=null,inlineStylesheet:d=!0,inlineImages:f=!1,recordCanvas:h=!1,maskAllInputs:m=!1,maskAttributeFn:p,maskTextFn:g,maskInputFn:y,slimDOM:v=!1,dataURLOptions:b,preserveWhiteSpace:E,onSerialize:w,onIframeLoad:x,iframeLoadTimeout:_,onStylesheetLoad:k,stylesheetLoadTimeout:R,keepIframeSrcFn:F=()=>!1}=e;return Bc(t,{doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,maskAllText:o,maskTextClass:a,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:m===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:m===!1?{}:m,maskAttributeFn:p,maskTextFn:g,maskInputFn:y,slimDOMOptions:v===!0||v==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:v==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:v===!1?{}:v,dataURLOptions:b,inlineImages:f,recordCanvas:h,preserveWhiteSpace:E,onSerialize:w,onIframeLoad:x,iframeLoadTimeout:_,onStylesheetLoad:k,stylesheetLoadTimeout:R,keepIframeSrcFn:F,newlyAddedElement:!1})}function mo(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}function mr(t,e,n=document){const r={capture:!0,passive:!0};return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)}const Pc=`Please stop import mirror directly. Instead of that,\r
414
- now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
415
- or you can use record.mirror to access the mirror instance during recording.`;let Wx={map:{},getId(){return console.error(Pc),-1},getNode(){return console.error(Pc),null},removeNodeFromMap(){console.error(Pc)},has(){return console.error(Pc),!1},reset(){console.error(Pc)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Wx=new Proxy(Wx,{get(t,e,n){return e==="map"&&console.error(Pc),Reflect.get(t,e,n)}}));function rf(t,e,n={}){let r=null,i=0;return function(...s){const o=Date.now();!i&&n.leading===!1&&(i=o);const a=e-(o-i),c=this;a<=0||a>e?(r&&(JJ(r),r=null),i=o,t.apply(c,s)):!r&&n.trailing!==!1&&(r=Eg(()=>{i=n.leading===!1?0:Date.now(),r=null,t.apply(c,s)},a))}}function HN(t,e,n,r,i=window){const s=i.Object.getOwnPropertyDescriptor(t,e);return i.Object.defineProperty(t,e,r?n:{set(o){Eg(()=>{n.set.call(this,o)},0),s&&s.set&&s.set.call(this,o)}}),()=>HN(t,e,s||{},!0)}function a0(t,e,n){try{if(!(e in t))return()=>{};const r=t[e],i=n(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),t[e]=i,()=>{t[e]=r}}catch{return()=>{}}}let dm=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(dm=()=>new Date().getTime());function WN(t){const e=t.document;return{left:e.scrollingElement?e.scrollingElement.scrollLeft:t.pageXOffset!==void 0?t.pageXOffset:mo([e,"optionalAccess",n=>n.documentElement,"access",n=>n.scrollLeft])||mo([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.parentElement,"optionalAccess",n=>n.scrollLeft])||mo([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.scrollLeft])||0,top:e.scrollingElement?e.scrollingElement.scrollTop:t.pageYOffset!==void 0?t.pageYOffset:mo([e,"optionalAccess",n=>n.documentElement,"access",n=>n.scrollTop])||mo([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.parentElement,"optionalAccess",n=>n.scrollTop])||mo([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.scrollTop])||0}}function qN(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function GN(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ZN(t){return t?t.nodeType===t.ELEMENT_NODE?t:t.parentElement:null}function _i(t,e,n,r,i){if(!t)return!1;const s=ZN(t);if(!s)return!1;const o=Uc(e,n);if(!i){const u=r&&s.matches(r);return o(s)&&!u}const a=ga(s,o);let c=-1;return a<0?!1:(r&&(c=ga(s,Uc(null,r))),a>-1&&c<0?!0:a<c)}function WJ(t,e){return e.getId(t)!==-1}function Uy(t,e){return e.getId(t)===nf}function YN(t,e){if(Gl(t))return!1;const n=e.getId(t);return e.has(n)?t.parentNode&&t.parentNode.nodeType===t.DOCUMENT_NODE?!1:t.parentNode?YN(t.parentNode,e):!0:!0}function Eb(t){return!!t.changedTouches}function qJ(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let n=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function KN(t,e){return!!(t.nodeName==="IFRAME"&&e.getMeta(t))}function JN(t,e){return!!(t.nodeName==="LINK"&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&t.getAttribute("rel")==="stylesheet"&&e.getMeta(t))}function Sb(t){return!!mo([t,"optionalAccess",e=>e.shadowRoot])}class GJ{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){return lG(this.styleIDMap.get(e),()=>-1)}has(e){return this.styleIDMap.has(e)}add(e,n){if(this.has(e))return this.getId(e);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function XN(t){let e=null;return mo([t,"access",n=>n.getRootNode,"optionalCall",n=>n(),"optionalAccess",n=>n.nodeType])===Node.DOCUMENT_FRAGMENT_NODE&&t.getRootNode().host&&(e=t.getRootNode().host),e}function ZJ(t){let e=t,n;for(;n=XN(e);)e=n;return e}function YJ(t){const e=t.ownerDocument;if(!e)return!1;const n=ZJ(t);return e.contains(n)}function QN(t){const e=t.ownerDocument;return e?e.contains(t)||YJ(t):!1}const qx={};function c0(t){const e=qx[t];if(e)return e;const n=window.document;let r=window[t];if(n&&typeof n.createElement=="function")try{const i=n.createElement("iframe");i.hidden=!0,n.head.appendChild(i);const s=i.contentWindow;s&&s[t]&&(r=s[t]),n.head.removeChild(i)}catch{}return qx[t]=r.bind(window)}function KJ(...t){return c0("requestAnimationFrame")(...t)}function Eg(...t){return c0("setTimeout")(...t)}function JJ(...t){return c0("clearTimeout")(...t)}var xt=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(xt||{}),Tt=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(Tt||{}),or=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(or||{}),Is=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(Is||{});function XJ(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}function Gx(t){return"__ln"in t}class QJ{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<e;r++)n=XJ([n,"optionalAccess",i=>i.next])||null;return n}addNode(e){const n={value:e,previous:null,next:null};if(e.__ln=n,e.previousSibling&&Gx(e.previousSibling)){const r=e.previousSibling.__ln.next;n.next=r,n.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(e.nextSibling&&Gx(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;n.previous=r,n.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(e){const n=e.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const Zx=(t,e)=>`${t}@${e}`;class eX{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],n=new Set,r=new QJ,i=c=>{let u=c,l=nf;for(;l===nf;)u=u&&u.nextSibling,l=u&&this.mirror.getId(u);return l},s=c=>{if(!c.parentNode||!QN(c))return;const u=Gl(c.parentNode)?this.mirror.getId(XN(c)):this.mirror.getId(c.parentNode),l=i(c);if(u===-1||l===-1)return r.addNode(c);const d=Bc(c,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:f=>{KN(f,this.mirror)&&this.iframeManager.addIframe(f),JN(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),Sb(c)&&this.shadowDomManager.addShadowRoot(c.shadowRoot,this.doc)},onIframeLoad:(f,h)=>{this.iframeManager.attachIframe(f,h),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,h)=>{this.stylesheetManager.attachLinkElement(f,h)}});d&&(e.push({parentId:u,nextId:l,node:d}),n.add(d.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const c of this.movedSet)Yx(this.removes,c,this.mirror)&&!this.movedSet.has(c.parentNode)||s(c);for(const c of this.addedSet)!Kx(this.droppedSet,c)&&!Yx(this.removes,c,this.mirror)||Kx(this.movedSet,c)?s(c):this.droppedSet.add(c);let o=null;for(;r.length;){let c=null;if(o){const u=this.mirror.getId(o.value.parentNode),l=i(o.value);u!==-1&&l!==-1&&(c=o)}if(!c){let u=r.tail;for(;u;){const l=u;if(u=u.previous,l){const d=this.mirror.getId(l.value.parentNode);if(i(l.value)===-1)continue;if(d!==-1){c=l;break}else{const h=l.value;if(h.parentNode&&h.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const m=h.parentNode.host;if(this.mirror.getId(m)!==-1){c=l;break}}}}}}if(!c){for(;r.head;)r.removeNode(r.head.value);break}o=c.previous,r.removeNode(c.value),s(c.value)}const a={texts:this.texts.map(c=>({id:this.mirror.getId(c.node),value:c.value})).filter(c=>!n.has(c.id)).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>{const{attributes:u}=c;if(typeof u.style=="string"){const l=JSON.stringify(c.styleDiff),d=JSON.stringify(c._unchangedStyles);l.length<u.style.length&&(l+d).split("var(").length===u.style.split("var(").length&&(u.style=c.styleDiff)}return{id:this.mirror.getId(c.node),attributes:u}}).filter(c=>!n.has(c.id)).filter(c=>this.mirror.has(c.id)),removes:this.removes,adds:e};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=e=>{if(!Uy(e.target,this.mirror))switch(e.type){case"characterData":{const n=e.target.textContent;!_i(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==e.oldValue&&this.texts.push({value:Au(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,ZN(e.target)):n.replace(/[\S]/g,"*"):n,node:e.target});break}case"attributes":{const n=e.target;let r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){const o=i0(n),a=n.tagName;i=um(n,a,o);const c=wg({maskInputOptions:this.maskInputOptions,tagName:a,type:o}),u=Au(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,c);i=tf({isMasked:u,element:n,value:i,maskInputFn:this.maskInputFn})}if(_i(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||i===e.oldValue)return;let s=this.attributeMap.get(e.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!n.contentDocument)r="rr_src";else return;if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(e.target,s)),r==="type"&&n.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!VN(n.tagName,r)&&(s.attributes[r]=zN(this.doc,Nu(n.tagName),Nu(r),i,n,this.maskAttributeFn),r==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const o=this.unattachedDoc.createElement("span");e.oldValue&&o.setAttribute("style",e.oldValue);for(const a of Array.from(n.style)){const c=n.style.getPropertyValue(a),u=n.style.getPropertyPriority(a);c!==o.style.getPropertyValue(a)||u!==o.style.getPropertyPriority(a)?u===""?s.styleDiff[a]=c:s.styleDiff[a]=[c,u]:s._unchangedStyles[a]=[c,u]}for(const a of Array.from(o.style))n.style.getPropertyValue(a)===""&&(s.styleDiff[a]=!1)}break}case"childList":{if(_i(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;e.addedNodes.forEach(n=>this.genAdds(n,e.target)),e.removedNodes.forEach(n=>{const r=this.mirror.getId(n),i=Gl(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);_i(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||Uy(n,this.mirror)||!WJ(n,this.mirror)||(this.addedSet.has(n)?(xb(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(e.target)&&r===-1||YN(e.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[Zx(r,i)]?xb(this.movedSet,n):this.removes.push({parentId:i,id:r,isShadow:Gl(e.target)&&Zl(e.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(e,n)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Uy(e,this.mirror))return;this.movedSet.add(e);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[Zx(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);_i(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(e.childNodes.forEach(r=>this.genAdds(r)),Sb(e)&&e.shadowRoot.childNodes.forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}}}init(e){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(n=>{this[n]=e[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function xb(t,e){t.delete(e),e.childNodes.forEach(n=>xb(t,n))}function Yx(t,e,n){return t.length===0?!1:eA(t,e,n)}function eA(t,e,n){const{parentNode:r}=e;if(!r)return!1;const i=n.getId(r);return t.some(s=>s.id===i)?!0:eA(t,r,n)}function Kx(t,e){return t.size===0?!1:tA(t,e)}function tA(t,e){const{parentNode:n}=e;return n?t.has(n)?!0:tA(t,n):!1}let Yl;function tX(t){Yl=t}function nX(){Yl=void 0}const $t=t=>Yl?(...n)=>{try{return t(...n)}catch(r){if(Yl&&Yl(r)===!0)return()=>{};throw r}}:t;function Zi(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}const zc=[];function Mf(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch{}return t&&t.target}function nA(t,e){const n=new eX;zc.push(n),n.init(t);let r=window.MutationObserver||window.__rrMutationObserver;const i=Zi([window,"optionalAccess",o=>o.Zone,"optionalAccess",o=>o.__symbol__,"optionalCall",o=>o("MutationObserver")]);i&&window[i]&&(r=window[i]);const s=new r($t(o=>{t.onMutation&&t.onMutation(o)===!1||n.processMutations.bind(n)(o)}));return s.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function rX({mousemoveCb:t,sampling:e,doc:n,mirror:r}){if(e.mousemove===!1)return()=>{};const i=typeof e.mousemove=="number"?e.mousemove:50,s=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let o=[],a;const c=rf($t(d=>{const f=Date.now()-a;t(o.map(h=>(h.timeOffset-=f,h)),d),o=[],a=null}),s),u=$t(rf($t(d=>{const f=Mf(d),{clientX:h,clientY:m}=Eb(d)?d.changedTouches[0]:d;a||(a=dm()),o.push({x:h,y:m,id:r.getId(f),timeOffset:dm()-a}),c(typeof DragEvent<"u"&&d instanceof DragEvent?Tt.Drag:d instanceof MouseEvent?Tt.MouseMove:Tt.TouchMove)}),i,{trailing:!1})),l=[mr("mousemove",u,n),mr("touchmove",u,n),mr("drag",u,n)];return $t(()=>{l.forEach(d=>d())})}function iX({mouseInteractionCb:t,doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const a=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,c=[];let u=null;const l=d=>f=>{const h=Mf(f);if(_i(h,r,i,s,!0))return;let m=null,p=d;if("pointerType"in f){switch(f.pointerType){case"mouse":m=Is.Mouse;break;case"touch":m=Is.Touch;break;case"pen":m=Is.Pen;break}m===Is.Touch?or[d]===or.MouseDown?p="TouchStart":or[d]===or.MouseUp&&(p="TouchEnd"):Is.Pen}else Eb(f)&&(m=Is.Touch);m!==null?(u=m,(p.startsWith("Touch")&&m===Is.Touch||p.startsWith("Mouse")&&m===Is.Mouse)&&(m=null)):or[d]===or.Click&&(m=u,u=null);const g=Eb(f)?f.changedTouches[0]:f;if(!g)return;const y=n.getId(h),{clientX:v,clientY:b}=g;$t(t)({type:or[p],id:y,x:v,y:b,...m!==null&&{pointerType:m}})};return Object.keys(or).filter(d=>Number.isNaN(Number(d))&&!d.endsWith("_Departed")&&a[d]!==!1).forEach(d=>{let f=Nu(d);const h=l(d);if(window.PointerEvent)switch(or[d]){case or.MouseDown:case or.MouseUp:f=f.replace("mouse","pointer");break;case or.TouchStart:case or.TouchEnd:return}c.push(mr(f,h,e))}),$t(()=>{c.forEach(d=>d())})}function rA({scrollCb:t,doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,sampling:o}){const a=$t(rf($t(c=>{const u=Mf(c);if(!u||_i(u,r,i,s,!0))return;const l=n.getId(u);if(u===e&&e.defaultView){const d=WN(e.defaultView);t({id:l,x:d.left,y:d.top})}else t({id:l,x:u.scrollLeft,y:u.scrollTop})}),o.scroll||100));return mr("scroll",a,e)}function sX({viewportResizeCb:t},{win:e}){let n=-1,r=-1;const i=$t(rf($t(()=>{const s=qN(),o=GN();(n!==s||r!==o)&&(t({width:Number(o),height:Number(s)}),n=s,r=o)}),200));return mr("resize",i,e)}const oX=["INPUT","TEXTAREA","SELECT"],Jx=new WeakMap;function aX({inputCb:t,doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,ignoreClass:o,ignoreSelector:a,maskInputOptions:c,maskInputFn:u,sampling:l,userTriggeredOnInput:d,maskTextClass:f,unmaskTextClass:h,maskTextSelector:m,unmaskTextSelector:p}){function g(_){let k=Mf(_);const R=_.isTrusted,F=k&&wb(k.tagName);if(F==="OPTION"&&(k=k.parentElement),!k||!F||oX.indexOf(F)<0||_i(k,r,i,s,!0))return;const V=k;if(V.classList.contains(o)||a&&V.matches(a))return;const T=i0(k);let L=um(V,F,T),S=!1;const C=wg({maskInputOptions:c,tagName:F,type:T}),N=Au(k,f,m,h,p,C);(T==="radio"||T==="checkbox")&&(S=k.checked),L=tf({isMasked:N,element:k,value:L,maskInputFn:u}),y(k,d?{text:L,isChecked:S,userTriggered:R}:{text:L,isChecked:S});const U=k.name;T==="radio"&&U&&S&&e.querySelectorAll(`input[type="radio"][name="${U}"]`).forEach(K=>{if(K!==k){const $=tf({isMasked:N,element:K,value:um(K,F,T),maskInputFn:u});y(K,d?{text:$,isChecked:!S,userTriggered:!1}:{text:$,isChecked:!S})}})}function y(_,k){const R=Jx.get(_);if(!R||R.text!==k.text||R.isChecked!==k.isChecked){Jx.set(_,k);const F=n.getId(_);$t(t)({...k,id:F})}}const b=(l.input==="last"?["change"]:["input","change"]).map(_=>mr(_,$t(g),e)),E=e.defaultView;if(!E)return()=>{b.forEach(_=>_())};const w=E.Object.getOwnPropertyDescriptor(E.HTMLInputElement.prototype,"value"),x=[[E.HTMLInputElement.prototype,"value"],[E.HTMLInputElement.prototype,"checked"],[E.HTMLSelectElement.prototype,"value"],[E.HTMLTextAreaElement.prototype,"value"],[E.HTMLSelectElement.prototype,"selectedIndex"],[E.HTMLOptionElement.prototype,"selected"]];return w&&w.set&&b.push(...x.map(_=>HN(_[0],_[1],{set(){$t(g)({target:this,isTrusted:!1})}},!1,E))),$t(()=>{b.forEach(_=>_())})}function fm(t){const e=[];function n(r,i){if(Ih("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Ih("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Ih("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Ih("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const o=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(o)}else if(r.parentStyleSheet){const o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(o)}return i}return n(t,e)}function go(t,e,n){let r,i;return t?(t.ownerNode?r=e.getId(t.ownerNode):i=n.getId(t),{styleId:i,id:r}):{}}function cX({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:$t((l,d,f)=>{const[h,m]=f,{id:p,styleId:g}=go(d,e,n.styleMirror);return(p&&p!==-1||g&&g!==-1)&&t({id:p,styleId:g,adds:[{rule:h,index:m}]}),l.apply(d,f)})});const s=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(s,{apply:$t((l,d,f)=>{const[h]=f,{id:m,styleId:p}=go(d,e,n.styleMirror);return(m&&m!==-1||p&&p!==-1)&&t({id:m,styleId:p,removes:[{index:h}]}),l.apply(d,f)})});let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:$t((l,d,f)=>{const[h]=f,{id:m,styleId:p}=go(d,e,n.styleMirror);return(m&&m!==-1||p&&p!==-1)&&t({id:m,styleId:p,replace:h}),l.apply(d,f)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:$t((l,d,f)=>{const[h]=f,{id:m,styleId:p}=go(d,e,n.styleMirror);return(m&&m!==-1||p&&p!==-1)&&t({id:m,styleId:p,replaceSync:h}),l.apply(d,f)})}));const c={};Oh("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(Oh("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),Oh("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),Oh("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(c).forEach(([l,d])=>{u[l]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(u[l].insertRule,{apply:$t((f,h,m)=>{const[p,g]=m,{id:y,styleId:v}=go(h.parentStyleSheet,e,n.styleMirror);return(y&&y!==-1||v&&v!==-1)&&t({id:y,styleId:v,adds:[{rule:p,index:[...fm(h),g||0]}]}),f.apply(h,m)})}),d.prototype.deleteRule=new Proxy(u[l].deleteRule,{apply:$t((f,h,m)=>{const[p]=m,{id:g,styleId:y}=go(h.parentStyleSheet,e,n.styleMirror);return(g&&g!==-1||y&&y!==-1)&&t({id:g,styleId:y,removes:[{index:[...fm(h),p]}]}),f.apply(h,m)})})}),$t(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=s,o&&(r.CSSStyleSheet.prototype.replace=o),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach(([l,d])=>{d.prototype.insertRule=u[l].insertRule,d.prototype.deleteRule=u[l].deleteRule})})}function iA({mirror:t,stylesheetManager:e},n){let r=null;n.nodeName==="#document"?r=t.getId(n):r=t.getId(n.host);const i=n.nodeName==="#document"?Zi([n,"access",o=>o.defaultView,"optionalAccess",o=>o.Document]):Zi([n,"access",o=>o.ownerDocument,"optionalAccess",o=>o.defaultView,"optionalAccess",o=>o.ShadowRoot]),s=Zi([i,"optionalAccess",o=>o.prototype])?Object.getOwnPropertyDescriptor(Zi([i,"optionalAccess",o=>o.prototype]),"adoptedStyleSheets"):void 0;return r===null||r===-1||!i||!s?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){return Zi([s,"access",o=>o.get,"optionalAccess",o=>o.call,"call",o=>o(this)])},set(o){const a=Zi([s,"access",c=>c.set,"optionalAccess",c=>c.call,"call",c=>c(this,o)]);if(r!==null&&r!==-1)try{e.adoptStyleSheets(o,r)}catch{}return a}}),$t(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})}))}function uX({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){const s=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:$t((a,c,u)=>{const[l,d,f]=u;if(n.has(l))return s.apply(c,[l,d,f]);const{id:h,styleId:m}=go(Zi([c,"access",p=>p.parentRule,"optionalAccess",p=>p.parentStyleSheet]),e,r.styleMirror);return(h&&h!==-1||m&&m!==-1)&&t({id:h,styleId:m,set:{property:l,value:d,priority:f},index:fm(c.parentRule)}),a.apply(c,u)})});const o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:$t((a,c,u)=>{const[l]=u;if(n.has(l))return o.apply(c,[l]);const{id:d,styleId:f}=go(Zi([c,"access",h=>h.parentRule,"optionalAccess",h=>h.parentStyleSheet]),e,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&t({id:d,styleId:f,remove:{property:l},index:fm(c.parentRule)}),a.apply(c,u)})}),$t(()=>{i.CSSStyleDeclaration.prototype.setProperty=s,i.CSSStyleDeclaration.prototype.removeProperty=o})}function lX({mediaInteractionCb:t,blockClass:e,blockSelector:n,unblockSelector:r,mirror:i,sampling:s,doc:o}){const a=$t(u=>rf($t(l=>{const d=Mf(l);if(!d||_i(d,e,n,r,!0))return;const{currentTime:f,volume:h,muted:m,playbackRate:p}=d;t({type:u,id:i.getId(d),currentTime:f,volume:h,muted:m,playbackRate:p})}),s.media||500)),c=[mr("play",a(0),o),mr("pause",a(1),o),mr("seeked",a(2),o),mr("volumechange",a(3),o),mr("ratechange",a(4),o)];return $t(()=>{c.forEach(u=>u())})}function dX({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const r=[],i=new WeakMap,s=n.FontFace;n.FontFace=function(c,u,l){const d=new s(c,u,l);return i.set(d,{family:c,buffer:typeof u!="string",descriptors:l,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),d};const o=a0(e.fonts,"add",function(a){return function(c){return Eg($t(()=>{const u=i.get(c);u&&(t(u),i.delete(c))}),0),a.apply(this,[c])}});return r.push(()=>{n.FontFace=s}),r.push(o),$t(()=>{r.forEach(a=>a())})}function fX(t){const{doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,selectionCb:o}=t;let a=!0;const c=$t(()=>{const u=e.getSelection();if(!u||a&&Zi([u,"optionalAccess",f=>f.isCollapsed]))return;a=u.isCollapsed||!1;const l=[],d=u.rangeCount||0;for(let f=0;f<d;f++){const h=u.getRangeAt(f),{startContainer:m,startOffset:p,endContainer:g,endOffset:y}=h;_i(m,r,i,s,!0)||_i(g,r,i,s,!0)||l.push({start:n.getId(m),startOffset:p,end:n.getId(g),endOffset:y})}o({ranges:l})});return c(),mr("selectionchange",c)}function hX({doc:t,customElementCb:e}){const n=t.defaultView;return!n||!n.customElements?()=>{}:a0(n.customElements,"define",function(i){return function(s,o,a){try{e({define:{name:s}})}catch{}return i.apply(this,[s,o,a])}})}function pX(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};const r=nA(t,t.doc),i=rX(t),s=iX(t),o=rA(t),a=sX(t,{win:n}),c=aX(t),u=lX(t),l=cX(t,{win:n}),d=iA(t,t.doc),f=uX(t,{win:n}),h=t.collectFonts?dX(t):()=>{},m=fX(t),p=hX(t),g=[];for(const y of t.plugins)g.push(y.observer(y.callback,n,y.options));return $t(()=>{zc.forEach(y=>y.reset()),r.disconnect(),i(),s(),o(),a(),c(),u(),l(),d(),f(),h(),m(),p(),g.forEach(y=>y())})}function Ih(t){return typeof window[t]<"u"}function Oh(t){return!!(typeof window[t]<"u"&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Tb{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,n,r,i){const s=r||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e);let a=s.get(n);return a||(a=this.generateIdFn(),s.set(n,a),o.set(a,n)),a}getIds(e,n){const r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return n.map(s=>this.getId(e,s,r,i))}getRemoteId(e,n,r){const i=r||this.getRemoteIdToIdMap(e);if(typeof n!="number")return n;const s=i.get(n);return s||-1}getRemoteIds(e,n){const r=this.getRemoteIdToIdMap(e);return n.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let n=this.iframeIdToRemoteIdMap.get(e);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(e,n)),n}getRemoteIdToIdMap(e){let n=this.iframeRemoteIdToIdMap.get(e);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(e,n)),n}}function Xx(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}class mX{constructor(){this.crossOriginIframeMirror=new Tb(s0),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class gX{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Tb(s0),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Tb(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,n){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),Xx([this,"access",r=>r.loadListener,"optionalCall",r=>r(e)]),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const n=e;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!e.source)return;const i=this.crossOriginIframeMap.get(e.source);if(!i)return;const s=this.transformCrossOriginEvent(i,n.data.event);s&&this.wrappedEmit(s,n.data.isCheckout)}transformCrossOriginEvent(e,n){switch(n.type){case xt.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(n.data.node,e);const r=n.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(n.data.node,r),{timestamp:n.timestamp,type:xt.IncrementalSnapshot,data:{source:Tt.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case xt.Meta:case xt.Load:case xt.DomContentLoaded:return!1;case xt.Plugin:return n;case xt.Custom:return this.replaceIds(n.data.payload,e,["id","parentId","previousId","nextId"]),n;case xt.IncrementalSnapshot:switch(n.data.source){case Tt.Mutation:return n.data.adds.forEach(r=>{this.replaceIds(r,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,e);const i=this.crossOriginIframeRootIdMap.get(e);i&&this.patchRootIdOnNode(r.node,i)}),n.data.removes.forEach(r=>{this.replaceIds(r,e,["parentId","id"])}),n.data.attributes.forEach(r=>{this.replaceIds(r,e,["id"])}),n.data.texts.forEach(r=>{this.replaceIds(r,e,["id"])}),n;case Tt.Drag:case Tt.TouchMove:case Tt.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,e,["id"])}),n;case Tt.ViewportResize:return!1;case Tt.MediaInteraction:case Tt.MouseInteraction:case Tt.Scroll:case Tt.CanvasMutation:case Tt.Input:return this.replaceIds(n.data,e,["id"]),n;case Tt.StyleSheetRule:case Tt.StyleDeclaration:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleId"]),n;case Tt.Font:return n;case Tt.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,e,["start","end"])}),n;case Tt.AdoptedStyleSheet:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleIds"]),Xx([n,"access",r=>r.data,"access",r=>r.styles,"optionalAccess",r=>r.forEach,"call",r=>r(i=>{this.replaceStyleIds(i,e,["styleId"])})]),n}}return!1}replace(e,n,r,i){for(const s of i)!Array.isArray(n[s])&&typeof n[s]!="number"||(Array.isArray(n[s])?n[s]=e.getIds(r,n[s]):n[s]=e.getId(r,n[s]));return n}replaceIds(e,n,r){return this.replace(this.crossOriginIframeMirror,e,n,r)}replaceStyleIds(e,n,r){return this.replace(this.crossOriginIframeStyleMirror,e,n,r)}replaceIdOnNode(e,n){this.replaceIds(e,n,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(e,n){e.type!==Fn.Document&&!e.rootId&&(e.rootId=n),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class yX{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class vX{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,n){if(!Zl(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=nA({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(rA({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),Eg(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(iA({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,n){const r=this;this.restoreHandlers.push(a0(e.prototype,"attachShadow",function(i){return function(s){const o=i.call(this,s);return this.shadowRoot&&QN(this)&&r.addShadowRoot(this.shadowRoot,n),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}class Qx{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}}class bX{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new GJ,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,n){if(e.length===0)return;const r={id:n,styleIds:[]},i=[];for(const s of e){let o;this.styleMirror.has(s)?o=this.styleMirror.getId(s):(o=this.styleMirror.add(s),i.push({styleId:o,rules:Array.from(s.rules||CSSRule,(a,c)=>({rule:UN(a),index:c}))})),r.styleIds.push(o)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class _X{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){KJ(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(e,n){const r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==n)}add(e,n){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(n))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}let _n,hm;const di=wJ();function No(t={}){const{emit:e,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:s=null,unblockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskAllText:u=!1,maskTextClass:l="rr-mask",unmaskTextClass:d=null,maskTextSelector:f=null,unmaskTextSelector:h=null,inlineStylesheet:m=!0,maskAllInputs:p,maskInputOptions:g,slimDOMOptions:y,maskAttributeFn:v,maskInputFn:b,maskTextFn:E,maxCanvasSize:w=null,packFn:x,sampling:_={},dataURLOptions:k={},mousemoveWait:R,recordCanvas:F=!1,recordCrossOriginIframes:V=!1,recordAfter:T=t.recordAfter==="DOMContentLoaded"?t.recordAfter:"load",userTriggeredOnInput:L=!1,collectFonts:S=!1,inlineImages:C=!1,plugins:N,keepIframeSrcFn:U=()=>!1,ignoreCSSAttributes:K=new Set([]),errorHandler:$,onMutation:q,getCanvasManager:j}=t;tX($);const D=V?window.parent===window:!0;let X=!1;if(!D)try{window.parent.document&&(X=!1)}catch{X=!0}if(D&&!e)throw new Error("emit function is required");R!==void 0&&_.mousemove===void 0&&(_.mousemove=R),di.reset();const Z=p===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:g!==void 0?g:{},z=y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:y==="all",headMetaDescKeywords:y==="all"}:y||{};qJ();let le,pe=0;const ve=A=>{for(const G of N||[])G.eventProcessor&&(A=G.eventProcessor(A));return x&&!X&&(A=x(A)),A};_n=(A,G)=>{const Q=A;if(Q.timestamp=dm(),Ay([zc,"access",H=>H[0],"optionalAccess",H=>H.isFrozen,"call",H=>H()])&&Q.type!==xt.FullSnapshot&&!(Q.type===xt.IncrementalSnapshot&&Q.data.source===Tt.Mutation)&&zc.forEach(H=>H.unfreeze()),D)Ay([e,"optionalCall",H=>H(ve(Q),G)]);else if(X){const H={type:"rrweb",event:ve(Q),origin:window.location.origin,isCheckout:G};window.parent.postMessage(H,"*")}if(Q.type===xt.FullSnapshot)le=Q,pe=0;else if(Q.type===xt.IncrementalSnapshot){if(Q.data.source===Tt.Mutation&&Q.data.isAttachIframe)return;pe++;const H=r&&pe>=r,ee=n&&le&&Q.timestamp-le.timestamp>n;(H||ee)&&I(!0)}};const je=A=>{_n({type:xt.IncrementalSnapshot,data:{source:Tt.Mutation,...A}})},ct=A=>_n({type:xt.IncrementalSnapshot,data:{source:Tt.Scroll,...A}}),ut=A=>_n({type:xt.IncrementalSnapshot,data:{source:Tt.CanvasMutation,...A}}),Ye=A=>_n({type:xt.IncrementalSnapshot,data:{source:Tt.AdoptedStyleSheet,...A}}),Ot=new bX({mutationCb:je,adoptedStyleSheetCb:Ye}),O=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new mX:new gX({mirror:di,mutationCb:je,stylesheetManager:Ot,recordCrossOriginIframes:V,wrappedEmit:_n});for(const A of N||[])A.getMirror&&A.getMirror({nodeMirror:di,crossOriginIframeMirror:O.crossOriginIframeMirror,crossOriginIframeStyleMirror:O.crossOriginIframeStyleMirror});const he=new _X,ae=EX(j,{mirror:di,win:window,mutationCb:A=>_n({type:xt.IncrementalSnapshot,data:{source:Tt.CanvasMutation,...A}}),recordCanvas:F,blockClass:i,blockSelector:s,unblockSelector:o,maxCanvasSize:w,sampling:_.canvas,dataURLOptions:k,errorHandler:$}),W=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new yX:new vX({mutationCb:je,scrollCb:ct,bypassOptions:{onMutation:q,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:u,maskTextClass:l,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:h,inlineStylesheet:m,maskInputOptions:Z,dataURLOptions:k,maskAttributeFn:v,maskTextFn:E,maskInputFn:b,recordCanvas:F,inlineImages:C,sampling:_,slimDOMOptions:z,iframeManager:O,stylesheetManager:Ot,canvasManager:ae,keepIframeSrcFn:U,processedNodeManager:he},mirror:di}),I=(A=!1)=>{_n({type:xt.Meta,data:{href:window.location.href,width:GN(),height:qN()}},A),Ot.reset(),W.init(),zc.forEach(Q=>Q.lock());const G=HJ(document,{mirror:di,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:u,maskTextClass:l,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:h,inlineStylesheet:m,maskAllInputs:Z,maskAttributeFn:v,maskInputFn:b,maskTextFn:E,slimDOM:z,dataURLOptions:k,recordCanvas:F,inlineImages:C,onSerialize:Q=>{KN(Q,di)&&O.addIframe(Q),JN(Q,di)&&Ot.trackLinkElement(Q),Sb(Q)&&W.addShadowRoot(Q.shadowRoot,document)},onIframeLoad:(Q,H)=>{O.attachIframe(Q,H),W.observeAttachShadow(Q)},onStylesheetLoad:(Q,H)=>{Ot.attachLinkElement(Q,H)},keepIframeSrcFn:U});if(!G)return console.warn("Failed to snapshot the document");_n({type:xt.FullSnapshot,data:{node:G,initialOffset:WN(window)}}),zc.forEach(Q=>Q.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Ot.adoptStyleSheets(document.adoptedStyleSheets,di.getId(document))};hm=I;try{const A=[],G=H=>$t(pX)({onMutation:q,mutationCb:je,mousemoveCb:(ee,de)=>_n({type:xt.IncrementalSnapshot,data:{source:de,positions:ee}}),mouseInteractionCb:ee=>_n({type:xt.IncrementalSnapshot,data:{source:Tt.MouseInteraction,...ee}}),scrollCb:ct,viewportResizeCb:ee=>_n({type:xt.IncrementalSnapshot,data:{source:Tt.ViewportResize,...ee}}),inputCb:ee=>_n({type:xt.IncrementalSnapshot,data:{source:Tt.Input,...ee}}),mediaInteractionCb:ee=>_n({type:xt.IncrementalSnapshot,data:{source:Tt.MediaInteraction,...ee}}),styleSheetRuleCb:ee=>_n({type:xt.IncrementalSnapshot,data:{source:Tt.StyleSheetRule,...ee}}),styleDeclarationCb:ee=>_n({type:xt.IncrementalSnapshot,data:{source:Tt.StyleDeclaration,...ee}}),canvasMutationCb:ut,fontCb:ee=>_n({type:xt.IncrementalSnapshot,data:{source:Tt.Font,...ee}}),selectionCb:ee=>{_n({type:xt.IncrementalSnapshot,data:{source:Tt.Selection,...ee}})},customElementCb:ee=>{_n({type:xt.IncrementalSnapshot,data:{source:Tt.CustomElement,...ee}})},blockClass:i,ignoreClass:a,ignoreSelector:c,maskAllText:u,maskTextClass:l,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:h,maskInputOptions:Z,inlineStylesheet:m,sampling:_,recordCanvas:F,inlineImages:C,userTriggeredOnInput:L,collectFonts:S,doc:H,maskAttributeFn:v,maskInputFn:b,maskTextFn:E,keepIframeSrcFn:U,blockSelector:s,unblockSelector:o,slimDOMOptions:z,dataURLOptions:k,mirror:di,iframeManager:O,stylesheetManager:Ot,shadowDomManager:W,processedNodeManager:he,canvasManager:ae,ignoreCSSAttributes:K,plugins:Ay([N,"optionalAccess",ee=>ee.filter,"call",ee=>ee(de=>de.observer),"optionalAccess",ee=>ee.map,"call",ee=>ee(de=>({observer:de.observer,options:de.options,callback:fe=>_n({type:xt.Plugin,data:{plugin:de.name,payload:fe}})}))])||[]},{});O.addLoadListener(H=>{try{A.push(G(H.contentDocument))}catch(ee){console.warn(ee)}});const Q=()=>{I(),A.push(G(document))};return document.readyState==="interactive"||document.readyState==="complete"?Q():(A.push(mr("DOMContentLoaded",()=>{_n({type:xt.DomContentLoaded,data:{}}),T==="DOMContentLoaded"&&Q()})),A.push(mr("load",()=>{_n({type:xt.Load,data:{}}),T==="load"&&Q()},window))),()=>{A.forEach(H=>H()),he.destroy(),hm=void 0,nX()}}catch(A){console.warn(A)}}function wX(t){if(!hm)throw new Error("please take full snapshot after start recording");hm(t)}No.mirror=di;No.takeFullSnapshot=wX;function EX(t,e){try{return t?t(e):new Qx}catch{return console.warn("Unable to initialize CanvasManager"),new Qx}}const SX=3,xX=5;function u0(t){return t>9999999999?t:t*1e3}function By(t){return t>9999999999?t/1e3:t}function Lf(t,e){e.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(e.category)?t.triggerUserActivity():t.checkAndHandleExpiredSession(),t.addUpdate(()=>(t.throttledAddEvent({type:xt.Custom,timestamp:(e.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:vi(e,10,1e3)}}),e.category==="console")))}const TX="button,a";function sA(t){return t.closest(TX)||t}function oA(t){const e=aA(t);return!e||!(e instanceof Element)?e:sA(e)}function aA(t){return IX(t)?t.target:t}function IX(t){return typeof t=="object"&&!!t&&"target"in t}let yo;function OX(t){return yo||(yo=[],CX()),yo.push(t),()=>{const e=yo?yo.indexOf(t):-1;e>-1&&yo.splice(e,1)}}function CX(){Vn(cn,"open",function(t){return function(...e){if(yo)try{yo.forEach(n=>n())}catch{}return t.apply(cn,e)}})}function kX(t,e,n){t.handleClick(e,n)}class DX{constructor(e,n,r=Lf){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=n.timeout/1e3,this._threshold=n.threshold/1e3,this._scollTimeout=n.scrollTimeout/1e3,this._replay=e,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){const e=OX(()=>{this._lastMutation=eT()});this._teardown=()=>{e(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(e,n){if(NX(n,this._ignoreSelector)||!AX(e))return;const r={timestamp:By(e.timestamp),clickBreadcrumb:e,clickCount:0,node:n};this._clicks.some(i=>i.node===r.node&&Math.abs(i.timestamp-r.timestamp)<1)||(this._clicks.push(r),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(e=Date.now()){this._lastMutation=By(e)}registerScroll(e=Date.now()){this._lastScroll=By(e)}registerClick(e){const n=sA(e);this._handleMultiClick(n)}_handleMultiClick(e){this._getClicks(e).forEach(n=>{n.clickCount++})}_getClicks(e){return this._clicks.filter(n=>n.node===e)}_checkClicks(){const e=[],n=eT();this._clicks.forEach(r=>{!r.mutationAfter&&this._lastMutation&&(r.mutationAfter=r.timestamp<=this._lastMutation?this._lastMutation-r.timestamp:void 0),!r.scrollAfter&&this._lastScroll&&(r.scrollAfter=r.timestamp<=this._lastScroll?this._lastScroll-r.timestamp:void 0),r.timestamp+this._timeout<=n&&e.push(r)});for(const r of e){const i=this._clicks.indexOf(r);i>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(i,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(e){const n=this._replay,r=e.scrollAfter&&e.scrollAfter<=this._scollTimeout,i=e.mutationAfter&&e.mutationAfter<=this._threshold,s=!r&&!i,{clickCount:o,clickBreadcrumb:a}=e;if(s){const c=Math.min(e.mutationAfter||this._timeout,this._timeout)*1e3,u=c<this._timeout*1e3?"mutation":"timeout",l={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.slowClickDetected",data:{...a.data,url:cn.location.href,route:n.getCurrentRoute(),timeAfterClickMs:c,endReason:u,clickCount:o||1}};this._addBreadcrumbEvent(n,l);return}if(o>1){const c={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.multiClick",data:{...a.data,url:cn.location.href,route:n.getCurrentRoute(),clickCount:o,metric:!0}};this._addBreadcrumbEvent(n,c)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=setTimeout(()=>this._checkClicks(),1e3)}}const RX=["A","BUTTON","INPUT"];function NX(t,e){return!!(!RX.includes(t.tagName)||t.tagName==="INPUT"&&!["submit","button"].includes(t.getAttribute("type")||"")||t.tagName==="A"&&(t.hasAttribute("download")||t.hasAttribute("target")&&t.getAttribute("target")!=="_self")||e&&t.matches(e))}function AX(t){return!!(t.data&&typeof t.data.nodeId=="number"&&t.timestamp)}function eT(){return Date.now()/1e3}function PX(t,e){try{if(!MX(e))return;const{source:n}=e.data;if(n===Tt.Mutation&&t.registerMutation(e.timestamp),n===Tt.Scroll&&t.registerScroll(e.timestamp),LX(e)){const{type:r,id:i}=e.data,s=No.mirror.getNode(i);s instanceof HTMLElement&&r===or.Click&&t.registerClick(s)}}catch{}}function MX(t){return t.type===SX}function LX(t){return t.data.source===Tt.MouseInteraction}function Qi(t){return{timestamp:Date.now()/1e3,type:"default",...t}}var pm;(function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"})(pm||(pm={}));const FX=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function $X(t){const e={};for(const n in t)if(FX.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),e[r]=t[n]}return e}const jX=t=>e=>{if(!t.isEnabled())return;const n=UX(e);if(!n)return;const r=e.name==="click",i=r?e.event:void 0;r&&t.clickDetector&&i&&i.target&&!i.altKey&&!i.metaKey&&!i.ctrlKey&&!i.shiftKey&&kX(t.clickDetector,n,oA(e.event)),Lf(t,n)};function cA(t,e){const n=No.mirror.getId(t),r=n&&No.mirror.getNode(n),i=r&&No.mirror.getMeta(r),s=i&&zX(i)?i:null;return{message:e,data:s?{nodeId:n,node:{id:n,tagName:s.tagName,textContent:Array.from(s.childNodes).map(o=>o.type===pm.Text&&o.textContent).filter(Boolean).map(o=>o.trim()).join(""),attributes:$X(s.attributes)}}:{}}}function UX(t){const{target:e,message:n}=BX(t);return Qi({category:`ui.${t.name}`,...cA(e,n)})}function BX(t){const e=t.name==="click";let n,r=null;try{r=e?oA(t.event):aA(t.event),n=qo(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function zX(t){return t.type===pm.Element}function VX(t,e){if(!t.isEnabled())return;t.updateUserActivity();const n=HX(e);n&&Lf(t,n)}function HX(t){const{metaKey:e,shiftKey:n,ctrlKey:r,altKey:i,key:s,target:o}=t;if(!o||WX(o)||!s)return null;const a=e||r||i,c=s.length===1;if(!a&&c)return null;const u=qo(o,{maxStringLength:200})||"<unknown>",l=cA(o,u);return Qi({category:"ui.keyDown",message:u,data:{...l.data,metaKey:e,shiftKey:n,ctrlKey:r,altKey:i,key:s}})}function WX(t){return t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable}const tT={resource:KX,paint:ZX,navigation:YX};function qX(t){return t.map(GX).filter(Boolean)}function GX(t){return tT[t.entryType]?tT[t.entryType](t):null}function Pu(t){return((Wr||cn.performance.timeOrigin)+t)/1e3}function ZX(t){const{duration:e,entryType:n,name:r,startTime:i}=t,s=Pu(i);return{type:n,name:r,start:s,end:s+e,data:void 0}}function YX(t){const{entryType:e,name:n,decodedBodySize:r,duration:i,domComplete:s,encodedBodySize:o,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,domInteractive:u,loadEventStart:l,loadEventEnd:d,redirectCount:f,startTime:h,transferSize:m,type:p}=t;return i===0?null:{type:`${e}.${p}`,start:Pu(h),end:Pu(s),name:n,data:{size:m,decodedBodySize:r,encodedBodySize:o,duration:i,domInteractive:u,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,loadEventStart:l,loadEventEnd:d,domComplete:s,redirectCount:f}}}function KX(t){const{entryType:e,initiatorType:n,name:r,responseEnd:i,startTime:s,decodedBodySize:o,encodedBodySize:a,responseStatus:c,transferSize:u}=t;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${e}.${n}`,start:Pu(s),end:Pu(i),name:r,data:{size:u,statusCode:c,decodedBodySize:o,encodedBodySize:a}}}function JX(t){const e=t.entries,n=e[e.length-1],r=n?n.element:void 0,i=t.value,s=Pu(i);return{type:"largest-contentful-paint",name:"largest-contentful-paint",start:s,end:s,data:{value:i,size:i,nodeId:r?No.mirror.getId(r):void 0}}}function XX(t){function e(i){t.performanceEntries.includes(i)||t.performanceEntries.push(i)}function n({entries:i}){i.forEach(e)}const r=[];return["navigation","paint","resource"].forEach(i=>{r.push(ku(i,n))}),r.push(gN(({metric:i})=>{t.replayPerformanceEntries.push(JX(i))})),()=>{r.forEach(i=>i())}}const rn=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,QX='var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),a=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(t,e){for(var i=new n(31),a=0;a<31;++a)i[a]=e+=1<<t[a-1];var s=new r(i[30]);for(a=1;a<30;++a)for(var o=i[a];o<i[a+1];++o)s[o]=o-i[a]<<5|a;return{b:i,r:s}},o=s(e,2),f=o.b,h=o.r;f[28]=258,h[258]=28;for(var l=s(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,a=0,s=new n(r);a<i;++a)t[a]&&++s[t[a]-1];var o,f=new n(r);for(a=1;a<r;++a)f[a]=f[a-1]+s[a-1]<<1;if(e){o=new n(1<<r);var h=15-r;for(a=0;a<i;++a)if(t[a])for(var l=a<<4|t[a],c=r-t[a],v=f[t[a]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>h]=l}else for(o=new n(i),a=0;a<i;++a)t[a]&&(o[a]=u[f[t[a]-1]++]>>15-t[a]);return o},g=new t(288);for(c=0;c<144;++c)g[c]=8;for(c=144;c<256;++c)g[c]=9;for(c=256;c<280;++c)g[c]=7;for(c=280;c<288;++c)g[c]=8;var w=new t(32);for(c=0;c<32;++c)w[c]=5;var p=d(g,9,0),y=d(w,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==r||r<0)&&(r=0),(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},A=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},_=function(r,e){for(var i=[],a=0;a<r.length;++a)r[a]&&i.push({s:a,f:r[a]});var s=i.length,o=i.slice();if(!s)return{t:F,l:0};if(1==s){var f=new t(i[0].s+1);return f[i[0].s]=1,{t:f,l:1}}i.sort((function(t,n){return t.f-n.f})),i.push({s:-1,f:25001});var h=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:h.f+l.f,l:h,r:l};c!=s-1;)h=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:h.f+l.f,l:h,r:l};var d=o[0].s;for(a=1;a<s;++a)o[a].s>d&&(d=o[a].s);var g=new n(d+1),w=x(i[c-1],g,0);if(w>e){a=0;var p=0,y=w-e,m=1<<y;for(o.sort((function(t,n){return g[n.s]-g[t.s]||t.f-n.f}));a<s;++a){var b=o[a].s;if(!(g[b]>e))break;p+=m-(1<<w-g[b]),g[b]=e}for(p>>=y;p>0;){var M=o[a].s;g[M]<e?p-=1<<e-g[M]++-1:++a}for(;a>=0&&p;--a){var E=o[a].s;g[E]==e&&(--g[E],++p)}w=e}return{t:new t(g),l:w}},x=function(t,n,r){return-1==t.s?Math.max(x(t.l,n,r+1),x(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,a=t[0],s=1,o=function(t){e[i++]=t},f=1;f<=r;++f)if(t[f]==a&&f!=r)++s;else{if(!a&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(a),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(a);s=1,a=t[f]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var a=0;a<e;++a)t[i+a+4]=r[a];return 8*(i+4+e)},C=function(t,r,s,o,f,h,l,u,c,v,m){z(r,m++,s),++f[256];for(var b=_(f,15),M=b.t,E=b.l,x=_(h,15),C=x.t,U=x.l,F=D(M),I=F.c,S=F.n,L=D(C),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=_(q,7),H=G.t,J=G.l,K=19;K>4&&!H[a[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(f,g)+T(h,w)+l,X=T(f,M)+T(h,C)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(C,U,0),R=C;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[a[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=p,P=g,Q=y,R=w;for(B=0;B<u;++B){var rt=o[B];if(rt>255){A(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;A(r,m,Q[et]),m+=R[et],et>3&&(A(r,m,rt>>5&8191),m+=i[et])}else A(r,m,N[rt]),m+=P[rt]}return A(r,m,N[256]),m+P[256]},U=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,a=0|r.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s<o;++s)i+=e+=r[s];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(a,s,o,f,u){if(!u&&(u={l:1},s.dictionary)){var c=s.dictionary.subarray(-32768),v=new t(c.length+a.length);v.set(c),v.set(a,c.length),a=v,u.w=c.length}return function(a,s,o,f,u,c){var v=c.z||a.length,d=new t(f+v+5*(1+Math.ceil(v/7e3))+u),g=d.subarray(f,d.length-u),w=c.l,p=7&(c.r||0);if(s){p&&(g[0]=c.r>>3);for(var y=U[s-1],M=y>>13,E=8191&y,z=(1<<o)-1,A=c.p||new n(32768),_=c.h||new n(z+1),x=Math.ceil(o/3),D=2*x,T=function(t){return(a[t]^a[t+1]<<x^a[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=_[H];if(A[J]=K,_[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!w)){p=C(a,g,0,F,I,S,O,q,G,j-G,p),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(a[j+Q]==a[j+Q-W]){for(var $=0;$<Z&&a[j+$]==a[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-A[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=A[J])&32767}if(R){F[q++]=268435456|h[Q]<<18|l[R];var it=31&h[Q],at=31&l[R];O+=e[it]+i[at],++I[257+it],++S[at],B=j+Q,++L}else F[q++]=a[j],++I[a[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=a[j],++I[a[j]];p=C(a,g,w,F,I,S,O,q,G,j-G,p),w||(c.r=7&p|g[p/8|0]<<3,p-=7,c.h=_,c.p=A,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+w;j+=65535){var st=j+65535;st>=v&&(g[p/8|0]=w,st=v),p=k(g,p+1,a.subarray(j,st))}c.i=v}return b(d,0,f+m(p)+u)}(a,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+s.mem,o,f,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var a=this.b.length-this.s.z;a&&(this.b.set(n.subarray(0,a),this.s.z),this.s.z=this.b.length,this.p(this.b,!1)),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(a),32768),this.s.z=n.length-a+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,a=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),s=a.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(a,n),O(a,s-8,r.d()),O(a,s-4,e),a}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(r){for(var e=new t(n.length),i=0;i<n.length;++i)e[i]=n.charCodeAt(i);return e}if(G)return G.encode(n);var a=n.length,s=new t(n.length+(n.length>>1)),o=0,f=function(t){s[o++]=t};for(i=0;i<a;++i){if(o+5>s.length){var h=new t(o+8+(a-i<<1));h.set(s),s=h}var l=n.charCodeAt(i);l<128||r?f(l):l<2048?(f(192|l>>6),f(128|63&l)):l>55295&&l<57344?(f(240|(l=65536+(1047552&l)|1023&n.charCodeAt(++i))>>18),f(128|l>>12&63),f(128|l>>6&63),f(128|63&l)):(f(224|l>>12),f(128|l>>6&63),f(128|63&l))}return b(s,0,o)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(let r=0,e=t.length;r<e;r++)n+=t[r].length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J(((t,n)=>{this.deflate.push(t,n)})),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",(function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:"init",success:!0,response:void 0});';function eQ(){const t=new Blob([QX]);return URL.createObjectURL(t)}function lr(t,e){rn&&(me.info(t),e&&uA(t))}function ru(t,e){rn&&(me.info(t),e&&setTimeout(()=>{uA(t)},0))}function uA(t){Zo({category:"console",data:{logger:"replay"},level:"info",message:t},{level:"info"})}class l0 extends Error{constructor(){super(`Event buffer exceeded maximum size of ${r0}.`)}}class lA{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(e){const n=JSON.stringify(e).length;if(this._totalSize+=n,this._totalSize>r0)throw new l0;this.events.push(e)}finish(){return new Promise(e=>{const n=this.events;this.clear(),e(JSON.stringify(n))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){const e=this.events.map(n=>n.timestamp).sort()[0];return e?u0(e):null}}class tQ{constructor(e){this._worker=e,this._id=0}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((e,n)=>{this._worker.addEventListener("message",({data:r})=>{r.success?e():n()},{once:!0}),this._worker.addEventListener("error",r=>{n(r)},{once:!0})}),this._ensureReadyPromise)}destroy(){lr("[Replay] Destroying compression worker"),this._worker.terminate()}postMessage(e,n){const r=this._getAndIncrementId();return new Promise((i,s)=>{const o=({data:a})=>{const c=a;if(c.method===e&&c.id===r){if(this._worker.removeEventListener("message",o),!c.success){rn&&me.error("[Replay]",c.response),s(new Error("Error in compression worker"));return}i(c.response)}};this._worker.addEventListener("message",o),this._worker.postMessage({id:r,method:e,arg:n})})}_getAndIncrementId(){return this._id++}}class nQ{constructor(e){this._worker=new tQ(e),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(e){const n=u0(e.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);const r=JSON.stringify(e);return this._totalSize+=r.length,this._totalSize>r0?Promise.reject(new l0):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,e=>{rn&&me.warn('[Replay] Sending "clear" message to worker failed',e)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(e){return this._worker.postMessage("addEvent",e)}async _finishRequest(){const e=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,e}}class rQ{constructor(e){this._fallback=new lA,this._compression=new nQ(e),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(e){this._used.hasCheckout=e}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(e){return this._used.addEvent(e)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch{lr("[Replay] Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:e,hasCheckout:n}=this._fallback,r=[];for(const i of e)r.push(this._compression.addEvent(i));this._compression.hasCheckout=n,this._used=this._compression;try{await Promise.all(r)}catch(i){rn&&me.warn("[Replay] Failed to add events when switching buffers.",i)}}}function iQ({useCompression:t,workerUrl:e}){if(t&&window.Worker){const n=sQ(e);if(n)return n}return lr("[Replay] Using simple buffer"),new lA}function sQ(t){try{const e=t||oQ();if(!e)return;lr(`[Replay] Using compression worker${t?` from ${t}`:""}`);const n=new Worker(e);return new rQ(n)}catch{lr("[Replay] Failed to create compression worker")}}function oQ(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?eQ():""}function d0(){try{return"sessionStorage"in cn&&!!cn.sessionStorage}catch{return!1}}function aQ(t){cQ(),t.session=void 0}function cQ(){if(d0())try{cn.sessionStorage.removeItem(t0)}catch{}}function dA(t){return t===void 0?!1:Math.random()<t}function fA(t){const e=Date.now(),n=t.id||Sn(),r=t.started||e,i=t.lastActivity||e,s=t.segmentId||0,o=t.sampled,a=t.previousSessionId;return{id:n,started:r,lastActivity:i,segmentId:s,sampled:o,previousSessionId:a}}function f0(t){if(d0())try{cn.sessionStorage.setItem(t0,JSON.stringify(t))}catch{}}function uQ(t,e){return dA(t)?"session":e?"buffer":!1}function nT({sessionSampleRate:t,allowBuffering:e,stickySession:n=!1},{previousSessionId:r}={}){const i=uQ(t,e),s=fA({sampled:i,previousSessionId:r});return n&&f0(s),s}function lQ(t){if(!d0())return null;try{const e=cn.sessionStorage.getItem(t0);if(!e)return null;const n=JSON.parse(e);return ru("[Replay] Loading existing session",t),fA(n)}catch{return null}}function Ib(t,e,n=+new Date){return t===null||e===void 0||e<0?!0:e===0?!1:t+e<=n}function hA(t,{maxReplayDuration:e,sessionIdleExpire:n,targetTime:r=Date.now()}){return Ib(t.started,e,r)||Ib(t.lastActivity,n,r)}function pA(t,{sessionIdleExpire:e,maxReplayDuration:n}){return!(!hA(t,{sessionIdleExpire:e,maxReplayDuration:n})||t.sampled==="buffer"&&t.segmentId===0)}function zy({traceInternals:t,sessionIdleExpire:e,maxReplayDuration:n,previousSessionId:r},i){const s=i.stickySession&&lQ(t);return s?pA(s,{sessionIdleExpire:e,maxReplayDuration:n})?(ru("[Replay] Session in sessionStorage is expired, creating new one..."),nT(i,{previousSessionId:s.id})):s:(ru("[Replay] Creating new session",t),nT(i,{previousSessionId:r}))}function dQ(t){return t.type===xt.Custom}function h0(t,e,n){return gA(t,e)?(mA(t,e,n),!0):!1}function fQ(t,e,n){return gA(t,e)?mA(t,e,n):Promise.resolve(null)}async function mA(t,e,n){if(!t.eventBuffer)return null;try{n&&t.recordingMode==="buffer"&&t.eventBuffer.clear(),n&&(t.eventBuffer.hasCheckout=!0);const r=t.getOptions(),i=hQ(e,r.beforeAddRecordingEvent);return i?await t.eventBuffer.addEvent(i):void 0}catch(r){const i=r&&r instanceof l0?"addEventSizeExceeded":"addEvent";rn&&me.error(r),await t.stop({reason:i});const s=Lt();s&&s.recordDroppedEvent("internal_sdk_error","replay")}}function gA(t,e){if(!t.eventBuffer||t.isPaused()||!t.isEnabled())return!1;const n=u0(e.timestamp);return n+t.timeouts.sessionIdlePause<Date.now()?!1:n>t.getContext().initialTimestamp+t.getOptions().maxReplayDuration?(lr(`[Replay] Skipping event with timestamp ${n} because it is after maxReplayDuration`,t.getOptions()._experiments.traceInternals),!1):!0}function hQ(t,e){try{if(typeof e=="function"&&dQ(t))return e(t)}catch(n){return rn&&me.error("[Replay] An error occured in the `beforeAddRecordingEvent` callback, skipping the event...",n),null}return t}function p0(t){return!t.type}function Ob(t){return t.type==="transaction"}function pQ(t){return t.type==="replay_event"}function rT(t){return t.type==="feedback"}function yA(t){const e=yQ();return(n,r)=>{if(!t.isEnabled()||!p0(n)&&!Ob(n))return;const i=r&&r.statusCode;if(!(e&&(!i||i<200||i>=300))){if(Ob(n)){mQ(t,n);return}gQ(t,n)}}}function mQ(t,e){const n=t.getContext();e.contexts&&e.contexts.trace&&e.contexts.trace.trace_id&&n.traceIds.size<100&&n.traceIds.add(e.contexts.trace.trace_id)}function gQ(t,e){const n=t.getContext();if(e.event_id&&n.errorIds.size<100&&n.errorIds.add(e.event_id),t.recordingMode!=="buffer"||!e.tags||!e.tags.replayId)return;const{beforeErrorSampling:r}=t.getOptions();typeof r=="function"&&!r(e)||setTimeout(()=>{t.sendBufferedReplayOrFlush()})}function yQ(){const t=Lt();if(!t)return!1;const e=t.getTransport();return e&&e.send.__sentry__baseTransport__||!1}function vQ(t){return e=>{!t.isEnabled()||!p0(e)||bQ(t,e)}}function bQ(t,e){const n=e.exception&&e.exception.values&&e.exception.values[0].value;if(typeof n=="string"&&(n.match(/reactjs\.org\/docs\/error-decoder\.html\?invariant=(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))){const r=Qi({category:"replay.hydrate-error"});Lf(t,r)}}function _Q(t,e){return t.type||!t.exception||!t.exception.values||!t.exception.values.length?!1:!!(e.originalException&&e.originalException.__rrweb__)}function wQ(t,e){t.triggerUserActivity(),t.addUpdate(()=>e.timestamp?(t.throttledAddEvent({type:xt.Custom,timestamp:e.timestamp*1e3,data:{tag:"breadcrumb",payload:{timestamp:e.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:e.event_id}}}}),!1):!0)}function EQ(t,e){return t.recordingMode!=="buffer"||e.message===n0||!e.exception||e.type?!1:dA(t.getOptions().errorSampleRate)}function SQ(t,e=!1){const n=e?yA(t):void 0;return Object.assign((r,i)=>t.isEnabled()?pQ(r)?(delete r.breadcrumbs,r):!p0(r)&&!Ob(r)&&!rT(r)||!t.checkAndHandleExpiredSession()?r:rT(r)?(t.flush(),r.contexts.feedback.replay_id=t.getSessionId(),wQ(t,r),r):_Q(r,i)&&!t.getOptions()._experiments.captureExceptions?(rn&&me.log("[Replay] Ignoring error from rrweb internals",r),null):((EQ(t,r)||t.recordingMode==="session")&&(r.tags={...r.tags,replayId:t.getSessionId()}),n&&n(r,{statusCode:200}),r):r,{id:"Replay"})}function Sg(t,e){return e.map(({type:n,start:r,end:i,name:s,data:o})=>{const a=t.throttledAddEvent({type:xt.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:s,startTimestamp:r,endTimestamp:i,data:o}}});return typeof a=="string"?Promise.resolve(null):a})}function xQ(t){const{from:e,to:n}=t,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:e}}}function TQ(t){return e=>{if(!t.isEnabled())return;const n=xQ(e);n!==null&&(t.getContext().urls.push(n.name),t.triggerUserActivity(),t.addUpdate(()=>(Sg(t,[n]),!1)))}}function IQ(t,e){return rn&&t.getOptions()._experiments.traceInternals?!1:rN(e,Lt())}function xg(t,e){t.isEnabled()&&e!==null&&(IQ(t,e.name)||t.addUpdate(()=>(Sg(t,[e]),!0)))}function OQ(t){const{startTimestamp:e,endTimestamp:n,fetchData:r,response:i}=t;if(!n)return null;const{method:s,url:o}=r;return{type:"resource.fetch",start:e/1e3,end:n/1e3,name:o,data:{method:s,statusCode:i?i.status:void 0}}}function CQ(t){return e=>{if(!t.isEnabled())return;const n=OQ(e);xg(t,n)}}function kQ(t){const{startTimestamp:e,endTimestamp:n,xhr:r}=t,i=r[Ms];if(!e||!n||!i)return null;const{method:s,url:o,status_code:a}=i;return o===void 0?null:{type:"resource.xhr",name:o,start:e/1e3,end:n/1e3,data:{method:s,statusCode:a}}}function DQ(t){return e=>{if(!t.isEnabled())return;const n=kQ(e);xg(t,n)}}function Tg(t,e){if(t)try{if(typeof t=="string")return e.encode(t).length;if(t instanceof URLSearchParams)return e.encode(t.toString()).length;if(t instanceof FormData){const n=wA(t);return e.encode(n).length}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength}catch{}}function vA(t){if(!t)return;const e=parseInt(t,10);return isNaN(e)?void 0:e}function bA(t){try{if(typeof t=="string")return[t];if(t instanceof URLSearchParams)return[t.toString()];if(t instanceof FormData)return[wA(t)];if(!t)return[void 0]}catch{return rn&&me.warn("[Replay] Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return rn&&me.info("[Replay] Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}function mm(t,e){if(!t)return{headers:{},size:void 0,_meta:{warnings:[e]}};const n={...t._meta},r=n.warnings||[];return n.warnings=[...r,e],t._meta=n,t}function _A(t,e){if(!e)return null;const{startTimestamp:n,endTimestamp:r,url:i,method:s,statusCode:o,request:a,response:c}=e;return{type:t,start:n/1e3,end:r/1e3,name:i,data:gr({method:s,statusCode:o,request:a,response:c})}}function sf(t){return{headers:{},size:t,_meta:{warnings:["URL_SKIPPED"]}}}function Ao(t,e,n){if(!e&&Object.keys(t).length===0)return;if(!e)return{headers:t};if(!n)return{headers:t,size:e};const r={headers:t,size:e},{body:i,warnings:s}=RQ(n);return r.body=i,s&&s.length>0&&(r._meta={warnings:s}),r}function Cb(t,e){return Object.keys(t).reduce((n,r)=>{const i=r.toLowerCase();return e.includes(i)&&t[r]&&(n[i]=t[r]),n},{})}function wA(t){return new URLSearchParams(t).toString()}function RQ(t){if(!t||typeof t!="string")return{body:t};const e=t.length>Bx,n=NQ(t);if(e){const r=t.slice(0,Bx);return n?{body:r,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${r}…`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(t)}}catch{}return{body:t}}function NQ(t){const e=t[0],n=t[t.length-1];return e==="["&&n==="]"||e==="{"&&n==="}"}function gm(t,e){const n=AQ(t);return Yu(n,e)}function AQ(t,e=cn.document.baseURI){if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith(cn.location.origin))return t;const n=new URL(t,e);if(n.origin!==new URL(e).origin)return t;const r=n.href;return!t.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}async function PQ(t,e,n){try{const r=await LQ(t,e,n),i=_A("resource.fetch",r);xg(n.replay,i)}catch(r){rn&&me.error("[Replay] Failed to capture fetch breadcrumb",r)}}function MQ(t,e,n){const{input:r,response:i}=e,s=r?EA(r):void 0,o=Tg(s,n.textEncoder),a=i?vA(i.headers.get("content-length")):void 0;o!==void 0&&(t.data.request_body_size=o),a!==void 0&&(t.data.response_body_size=a)}async function LQ(t,e,n){const r=Date.now(),{startTimestamp:i=r,endTimestamp:s=r}=e,{url:o,method:a,status_code:c=0,request_body_size:u,response_body_size:l}=t.data,d=gm(o,n.networkDetailAllowUrls)&&!gm(o,n.networkDetailDenyUrls),f=d?FQ(n,e.input,u):sf(u),h=await $Q(d,n,e.response,l);return{startTimestamp:i,endTimestamp:s,url:o,method:a,statusCode:c,request:f,response:h}}function FQ({networkCaptureBodies:t,networkRequestHeaders:e},n,r){const i=n?BQ(n,e):{};if(!t)return Ao(i,r,void 0);const s=EA(n),[o,a]=bA(s),c=Ao(i,r,o);return a?mm(c,a):c}async function $Q(t,{networkCaptureBodies:e,textEncoder:n,networkResponseHeaders:r},i,s){if(!t&&s!==void 0)return sf(s);const o=i?SA(i.headers,r):{};if(!i||!e&&s!==void 0)return Ao(o,s,void 0);const[a,c]=await UQ(i),u=jQ(a,{networkCaptureBodies:e,textEncoder:n,responseBodySize:s,captureDetails:t,headers:o});return c?mm(u,c):u}function jQ(t,{networkCaptureBodies:e,textEncoder:n,responseBodySize:r,captureDetails:i,headers:s}){try{const o=t&&t.length&&r===void 0?Tg(t,n):r;return i?e?Ao(s,o,t):Ao(s,o,void 0):sf(o)}catch(o){return rn&&me.warn("[Replay] Failed to serialize response body",o),Ao(s,r,void 0)}}async function UQ(t){const e=zQ(t);if(!e)return[void 0,"BODY_PARSE_ERROR"];try{return[await VQ(e)]}catch(n){return rn&&me.warn("[Replay] Failed to get text body from response",n),[void 0,"BODY_PARSE_ERROR"]}}function EA(t=[]){if(!(t.length!==2||typeof t[1]!="object"))return t[1].body}function SA(t,e){const n={};return e.forEach(r=>{t.get(r)&&(n[r]=t.get(r))}),n}function BQ(t,e){return t.length===1&&typeof t[0]!="string"?iT(t[0],e):t.length===2?iT(t[1],e):{}}function iT(t,e){if(!t)return{};const n=t.headers;return n?n instanceof Headers?SA(n,e):Array.isArray(n)?{}:Cb(n,e):{}}function zQ(t){try{return t.clone()}catch(e){rn&&me.warn("[Replay] Failed to clone response body",e)}}function VQ(t){return new Promise((e,n)=>{const r=setTimeout(()=>n(new Error("Timeout while trying to read response body")),500);HQ(t).then(i=>e(i),i=>n(i)).finally(()=>clearTimeout(r))})}async function HQ(t){return await t.text()}async function WQ(t,e,n){try{const r=GQ(t,e,n),i=_A("resource.xhr",r);xg(n.replay,i)}catch(r){rn&&me.error("[Replay] Failed to capture xhr breadcrumb",r)}}function qQ(t,e,n){const{xhr:r,input:i}=e;if(!r)return;const s=Tg(i,n.textEncoder),o=r.getResponseHeader("content-length")?vA(r.getResponseHeader("content-length")):JQ(r.response,r.responseType,n.textEncoder);s!==void 0&&(t.data.request_body_size=s),o!==void 0&&(t.data.response_body_size=o)}function GQ(t,e,n){const r=Date.now(),{startTimestamp:i=r,endTimestamp:s=r,input:o,xhr:a}=e,{url:c,method:u,status_code:l=0,request_body_size:d,response_body_size:f}=t.data;if(!c)return null;if(!a||!gm(c,n.networkDetailAllowUrls)||gm(c,n.networkDetailDenyUrls)){const x=sf(d),_=sf(f);return{startTimestamp:i,endTimestamp:s,url:c,method:u,statusCode:l,request:x,response:_}}const h=a[Ms],m=h?Cb(h.request_headers,n.networkRequestHeaders):{},p=Cb(ZQ(a),n.networkResponseHeaders),[g,y]=n.networkCaptureBodies?bA(o):[void 0],[v,b]=n.networkCaptureBodies?YQ(a):[void 0],E=Ao(m,d,g),w=Ao(p,f,v);return{startTimestamp:i,endTimestamp:s,url:c,method:u,statusCode:l,request:y?mm(E,y):E,response:b?mm(w,b):w}}function ZQ(t){const e=t.getAllResponseHeaders();return e?e.split(`\r
416
- `).reduce((n,r)=>{const[i,s]=r.split(": ");return n[i.toLowerCase()]=s,n},{}):{}}function YQ(t){const e=[];try{return[t.responseText]}catch(n){e.push(n)}try{return KQ(t.response,t.responseType)}catch(n){e.push(n)}return rn&&me.warn("[Replay] Failed to get xhr response body",...e),[void 0]}function KQ(t,e){try{if(typeof t=="string")return[t];if(t instanceof Document)return[t.body.outerHTML];if(e==="json"&&t&&typeof t=="object")return[JSON.stringify(t)];if(!t)return[void 0]}catch{return rn&&me.warn("[Replay] Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return rn&&me.info("[Replay] Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}function JQ(t,e,n){try{const r=e==="json"&&t&&typeof t=="object"?JSON.stringify(t):t;return Tg(r,n)}catch{return}}function XQ(t){const e=Lt();try{const n=new TextEncoder,{networkDetailAllowUrls:r,networkDetailDenyUrls:i,networkCaptureBodies:s,networkRequestHeaders:o,networkResponseHeaders:a}=t.getOptions(),c={replay:t,textEncoder:n,networkDetailAllowUrls:r,networkDetailDenyUrls:i,networkCaptureBodies:s,networkRequestHeaders:o,networkResponseHeaders:a};e&&e.on?e.on("beforeAddBreadcrumb",(u,l)=>QQ(c,u,l)):(lg(CQ(t)),fg(DQ(t)))}catch{}}function QQ(t,e,n){if(e.data)try{eee(e)&&nee(n)&&(qQ(e,n,t),WQ(e,n,t)),tee(e)&&ree(n)&&(MQ(e,n,t),PQ(e,n,t))}catch{rn&&me.warn("Error when enriching network breadcrumb")}}function eee(t){return t.category==="xhr"}function tee(t){return t.category==="fetch"}function nee(t){return t&&t.xhr}function ree(t){return t&&t.response}let sT=null;function iee(t){return!!t.category}const see=t=>e=>{if(!t.isEnabled())return;const n=oee(e);n&&Lf(t,n)};function oee(t){const e=t.getLastBreadcrumb&&t.getLastBreadcrumb();return sT===e||!e||(sT=e,!iee(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui."))?null:e.category==="console"?aee(e):Qi(e)}function aee(t){const e=t.data&&t.data.arguments;if(!Array.isArray(e)||e.length===0)return Qi(t);let n=!1;const r=e.map(i=>{if(!i)return i;if(typeof i=="string")return i.length>Th?(n=!0,`${i.slice(0,Th)}…`):i;if(typeof i=="object")try{const s=vi(i,7);return JSON.stringify(s).length>Th?(n=!0,`${JSON.stringify(s,null,2).slice(0,Th)}…`):s}catch{}return i});return Qi({...t,data:{...t.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function cee(t){const e=Gr(),n=Lt();e.addScopeListener(see(t)),wR(jX(t)),dg(TQ(t)),XQ(t);const r=SQ(t,!oT(n));n&&n.addEventProcessor?n.addEventProcessor(r):mZ(r),oT(n)&&(n.on("beforeSendEvent",vQ(t)),n.on("afterSendEvent",yA(t)),n.on("createDsc",i=>{const s=t.getSessionId();s&&t.isEnabled()&&t.recordingMode==="session"&&t.checkAndHandleExpiredSession()&&(i.replay_id=s)}),n.on("startTransaction",i=>{t.lastTransaction=i}),n.on("finishTransaction",i=>{t.lastTransaction=i}),n.on("beforeSendFeedback",(i,s)=>{const o=t.getSessionId();s&&s.includeReplay&&t.isEnabled()&&o&&i.contexts&&i.contexts.feedback&&(i.contexts.feedback.replay_id=o)}))}function oT(t){return!!(t&&t.on)}async function uee(t){try{return Promise.all(Sg(t,[lee(cn.performance.memory)]))}catch{return[]}}function lee(t){const{jsHeapSizeLimit:e,totalJSHeapSize:n,usedJSHeapSize:r}=t,i=Date.now()/1e3;return{type:"memory",name:"memory",start:i,end:i,data:{memory:{jsHeapSizeLimit:e,totalJSHeapSize:n,usedJSHeapSize:r}}}}function dee(t,e,n){let r,i,s;const o=n.maxWait?Math.max(n.maxWait,e):0;function a(){return c(),r=t(),r}function c(){i!==void 0&&clearTimeout(i),s!==void 0&&clearTimeout(s),i=s=void 0}function u(){return i!==void 0||s!==void 0?a():r}function l(){return i&&clearTimeout(i),i=setTimeout(a,e),o&&s===void 0&&(s=setTimeout(a,o)),r}return l.cancel=c,l.flush=u,l}function fee(t){let e=!1;return(n,r)=>{if(!t.checkAndHandleExpiredSession()){rn&&me.warn("[Replay] Received replay event after session expired.");return}const i=r||!e;e=!0,t.clickDetector&&PX(t.clickDetector,n),t.addUpdate(()=>{if(t.recordingMode==="buffer"&&i&&t.setInitialState(),!h0(t,n,i))return!0;if(!i)return!1;if(pee(t,i),t.session&&t.session.previousSessionId)return!0;if(t.recordingMode==="buffer"&&t.session&&t.eventBuffer){const s=t.eventBuffer.getEarliestTimestamp();s&&(lr(`[Replay] Updating session start time to earliest event in buffer to ${new Date(s)}`,t.getOptions()._experiments.traceInternals),t.session.started=s,t.getOptions().stickySession&&f0(t.session))}return t.recordingMode==="session"&&t.flush(),!0})}}function hee(t){const e=t.getOptions();return{type:xt.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:t.isRecordingCanvas(),sessionSampleRate:e.sessionSampleRate,errorSampleRate:e.errorSampleRate,useCompressionOption:e.useCompression,blockAllMedia:e.blockAllMedia,maskAllText:e.maskAllText,maskAllInputs:e.maskAllInputs,useCompression:t.eventBuffer?t.eventBuffer.type==="worker":!1,networkDetailHasUrls:e.networkDetailAllowUrls.length>0,networkCaptureBodies:e.networkCaptureBodies,networkRequestHasHeaders:e.networkRequestHeaders.length>0,networkResponseHasHeaders:e.networkResponseHeaders.length>0}}}}function pee(t,e){!e||!t.session||t.session.segmentId!==0||h0(t,hee(t),!1)}function mee(t,e,n,r){return Jo(RR(t,Vw(t),r,n),[[{type:"replay_event"},t],[{type:"replay_recording",length:typeof e=="string"?new TextEncoder().encode(e).length:e.length},e]])}function gee({recordingData:t,headers:e}){let n;const r=`${JSON.stringify(e)}
417
- `;if(typeof t=="string")n=`${r}${t}`;else{const s=new TextEncoder().encode(r);n=new Uint8Array(s.length+t.length),n.set(s),n.set(t,s.length)}return n}async function yee({client:t,scope:e,replayId:n,event:r}){const i=typeof t._integrations=="object"&&t._integrations!==null&&!Array.isArray(t._integrations)?Object.keys(t._integrations):void 0,s={event_id:n,integrations:i};t.emit&&t.emit("preprocessEvent",r,s);const o=await FR(t.getOptions(),r,s,e,t,Xo());if(!o)return null;o.platform=o.platform||"javascript";const a=t.getSdkMetadata&&t.getSdkMetadata(),{name:c,version:u}=a&&a.sdk||{};return o.sdk={...o.sdk,name:c||"sentry.javascript.unknown",version:u||"0.0.0"},o}async function vee({recordingData:t,replayId:e,segmentId:n,eventContext:r,timestamp:i,session:s}){const o=gee({recordingData:t,headers:{segment_id:n}}),{urls:a,errorIds:c,traceIds:u,initialTimestamp:l}=r,d=Lt(),f=Gr(),h=d&&d.getTransport(),m=d&&d.getDsn();if(!d||!h||!m||!s.sampled)return;const p={type:nJ,replay_start_timestamp:l/1e3,timestamp:i/1e3,error_ids:c,trace_ids:u,urls:a,replay_id:e,segment_id:n,replay_type:s.sampled},g=await yee({scope:f,client:d,replayId:e,event:p});if(!g){d.recordDroppedEvent("event_processor","replay",p),lr("An event processor returned `null`, will not send event.");return}delete g.sdkProcessingMetadata;const y=mee(g,o,m,d.getOptions().tunnel);let v;try{v=await h.send(y)}catch(E){const w=new Error(n0);try{w.cause=E}catch{}throw w}if(!v)return v;if(typeof v.statusCode=="number"&&(v.statusCode<200||v.statusCode>=300))throw new xA(v.statusCode);const b=AR({},v);if(NR(b,"replay"))throw new TA(b);return v}class xA extends Error{constructor(e){super(`Transport returned status code ${e}`)}}class TA extends Error{constructor(e){super("Rate limit hit"),this.rateLimits=e}}async function IA(t,e={count:0,interval:cJ}){const{recordingData:n,options:r}=t;if(n.length)try{return await vee(t),!0}catch(i){if(i instanceof xA||i instanceof TA)throw i;if(TG("Replays",{_retryCount:e.count}),rn&&r._experiments&&r._experiments.captureExceptions&&kf(i),e.count>=uJ){const s=new Error(`${n0} - max retries exceeded`);try{s.cause=i}catch{}throw s}return e.interval*=++e.count,new Promise((s,o)=>{setTimeout(async()=>{try{await IA(t,e),s(!0)}catch(a){o(a)}},e.interval)})}}const OA="__THROTTLED",bee="__SKIPPED";function _ee(t,e,n){const r=new Map,i=a=>{const c=a-n;r.forEach((u,l)=>{l<c&&r.delete(l)})},s=()=>[...r.values()].reduce((a,c)=>a+c,0);let o=!1;return(...a)=>{const c=Math.floor(Date.now()/1e3);if(i(c),s()>=e){const l=o;return o=!0,l?bee:OA}o=!1;const u=r.get(c)||0;return r.set(c,u+1),t(...a)}}class vo{constructor({options:e,recordingOptions:n}){vo.prototype.__init.call(this),vo.prototype.__init2.call(this),vo.prototype.__init3.call(this),vo.prototype.__init4.call(this),vo.prototype.__init5.call(this),vo.prototype.__init6.call(this),this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:rJ,sessionIdleExpire:iJ},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=n,this._options=e,this._debouncedFlush=dee(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=_ee((o,a)=>fQ(this,o,a),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:i}=this.getOptions(),s=r?{threshold:Math.min(lJ,r),timeout:r,scrollTimeout:dJ,ignoreSelector:i?i.join(","):""}:void 0;s&&(this.clickDetector=new DX(this,s))}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}initializeSampling(e){const{errorSampleRate:n,sessionSampleRate:r}=this._options;if(!(n<=0&&r<=0)){if(this._initializeSessionForSampling(e),!this.session){this._handleException(new Error("Unable to initialize and create session"));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled==="buffer"&&this.session.segmentId===0?"buffer":"session",ru(`[Replay] Starting replay in ${this.recordingMode} mode`,this._options._experiments.traceInternals),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session")throw new Error("Replay recording is already in progress");if(this._isEnabled&&this.recordingMode==="buffer")throw new Error("Replay buffering is in progress, call `flush()` to save the replay");ru("[Replay] Starting replay in session mode",this._options._experiments.traceInternals),this._updateUserActivity();const e=zy({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=e,this._initializeRecording()}startBuffering(){if(this._isEnabled)throw new Error("Replay recording is already in progress");ru("[Replay] Starting replay in buffer mode",this._options._experiments.traceInternals);const e=zy({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=e,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const e=this._canvas;this._stopRecording=No({...this._recordingOptions,...this.recordingMode==="buffer"&&{checkoutEveryNms:aJ},emit:fee(this),onMutation:this._onMutationHandler,...e?{recordCanvas:e.recordCanvas,getCanvasManager:e.getCanvasManager,sampling:e.sampling,dataURLOptions:e.dataURLOptions}:{}})}catch(e){this._handleException(e)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(e){return this._handleException(e),!1}}async stop({forceFlush:e=!1,reason:n}={}){if(this._isEnabled){this._isEnabled=!1;try{lr(`[Replay] Stopping Replay${n?` triggered by ${n}`:""}`,this._options._experiments.traceInternals),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,aQ(this)}catch(r){this._handleException(r)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),lr("[Replay] Pausing replay",this._options._experiments.traceInternals))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),lr("[Replay] Resuming replay",this._options._experiments.traceInternals))}async sendBufferedReplayOrFlush({continueRecording:e=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const n=Date.now();lr("[Replay] Converting buffer to session",this._options._experiments.traceInternals),await this.flushImmediate();const r=this.stopRecording();!e||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this._updateUserActivity(n),this._updateSessionActivity(n),this._maybeSaveSession()),this.startRecording())}addUpdate(e){const n=e();this.recordingMode!=="buffer"&&n!==!0&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return this.recordingMode==="buffer"?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(){return this.session&&this.session.id}checkAndHandleExpiredSession(){if(this._lastActivity&&Ib(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&this.session.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const e=`${cn.location.pathname}${cn.location.hash}${cn.location.search}`,n=`${cn.location.origin}${e}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=n,this._context.initialTimestamp=Date.now(),this._context.urls.push(n)}throttledAddEvent(e,n){const r=this._throttledAddEvent(e,n);if(r===OA){const i=Qi({category:"replay.throttled"});this.addUpdate(()=>!h0(this,{type:xX,timestamp:i.timestamp||0,data:{tag:"breadcrumb",payload:i,metric:!0}}))}return r}getCurrentRoute(){const e=this.lastTransaction||Gr().getTransaction(),r=(e&&Dn(e).data||{})[as];if(!(!e||!r||!["route","custom"].includes(r)))return Dn(e).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=iQ({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_handleException(e){rn&&me.error("[Replay]",e),rn&&this._options._experiments&&this._options._experiments.captureExceptions&&kf(e)}_initializeSessionForSampling(e){const n=this._options.errorSampleRate>0,r=zy({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals,previousSessionId:e},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:n});this.session=r}_checkSession(){if(!this.session)return!1;const e=this.session;return pA(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(e),!1):!0}async _refreshSession(e){this._isEnabled&&(await this.stop({reason:"refresh session"}),this.initializeSampling(e.id))}_addListeners(){try{cn.document.addEventListener("visibilitychange",this._handleVisibilityChange),cn.addEventListener("blur",this._handleWindowBlur),cn.addEventListener("focus",this._handleWindowFocus),cn.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(cee(this),this._hasInitializedCoreListeners=!0)}catch(e){this._handleException(e)}this._performanceCleanupCallback=XX(this)}_removeListeners(){try{cn.document.removeEventListener("visibilitychange",this._handleVisibilityChange),cn.removeEventListener("blur",this._handleWindowBlur),cn.removeEventListener("focus",this._handleWindowFocus),cn.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(e){this._handleException(e)}}__init(){this._handleVisibilityChange=()=>{cn.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()}}__init2(){this._handleWindowBlur=()=>{const e=Qi({category:"ui.blur"});this._doChangeToBackgroundTasks(e)}}__init3(){this._handleWindowFocus=()=>{const e=Qi({category:"ui.focus"});this._doChangeToForegroundTasks(e)}}__init4(){this._handleKeyboardEvent=e=>{VX(this,e)}}_doChangeToBackgroundTasks(e){!this.session||hA(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(e&&this._createCustomBreadcrumb(e),this.conditionalFlush())}_doChangeToForegroundTasks(e){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){lr("[Replay] Document has become active, but session has expired");return}e&&this._createCustomBreadcrumb(e)}_updateUserActivity(e=Date.now()){this._lastActivity=e}_updateSessionActivity(e=Date.now()){this.session&&(this.session.lastActivity=e,this._maybeSaveSession())}_createCustomBreadcrumb(e){this.addUpdate(()=>{this.throttledAddEvent({type:xt.Custom,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e}})})}_addPerformanceEntries(){const e=qX(this.performanceEntries).concat(this.replayPerformanceEntries);return this.performanceEntries=[],this.replayPerformanceEntries=[],Promise.all(Sg(this,e))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:e,eventBuffer:n}=this;if(!e||!n||e.segmentId)return;const r=n.getEarliestTimestamp();r&&r<this._context.initialTimestamp&&(this._context.initialTimestamp=r)}_popEventContext(){const e={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),e}async _runFlush(){const e=this.getSessionId();if(!this.session||!this.eventBuffer||!e){rn&&me.error("[Replay] No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!(!this.eventBuffer||!this.eventBuffer.hasEvents)&&(await uee(this),!!this.eventBuffer&&e===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const n=Date.now();if(n-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new Error("Session is too long, not sending replay");const r=this._popEventContext(),i=this.session.segmentId++;this._maybeSaveSession();const s=await this.eventBuffer.finish();await IA({replayId:e,recordingData:s,segmentId:i,eventContext:r,session:this.session,options:this.getOptions(),timestamp:n})}catch(n){this._handleException(n),this.stop({reason:"sendReplay"});const r=Lt();r&&r.recordDroppedEvent("send_error","replay")}}__init5(){this._flush=async({force:e=!1}={})=>{if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession()){rn&&me.error("[Replay] Attempting to finish replay event after session expired.");return}if(!this.session)return;const n=this.session.started,i=Date.now()-n;this._debouncedFlush.cancel();const s=i<this._options.minReplayDuration,o=i>this._options.maxReplayDuration+5e3;if(s||o){lr(`[Replay] Session duration (${Math.floor(i/1e3)}s) is too ${s?"short":"long"}, not sending replay.`,this._options._experiments.traceInternals),s&&this._debouncedFlush();return}const a=this.eventBuffer;if(a&&this.session.segmentId===0&&!a.hasCheckout&&lr("[Replay] Flushing initial segment without checkout.",this._options._experiments.traceInternals),!this._flushLock){this._flushLock=this._runFlush(),await this._flushLock,this._flushLock=void 0;return}try{await this._flushLock}catch(c){rn&&me.error(c)}finally{this._debouncedFlush()}}}_maybeSaveSession(){this.session&&this._options.stickySession&&f0(this.session)}__init6(){this._onMutationHandler=e=>{const n=e.length,r=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,s=r&&n>r;if(n>i||s){const o=Qi({category:"replay.mutations",data:{count:n,limit:s}});this._createCustomBreadcrumb(o)}return s?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}}function gl(t,e,n,r){const i=typeof r=="string"?r.split(","):[],s=[...t,...i,...e];return typeof n<"u"&&(typeof n=="string"&&s.push(`.${n}`),Za(()=>{console.warn("[Replay] You are using a deprecated configuration item for privacy. Read the documentation on how to use the new privacy configuration.")})),s.join(",")}function wee({mask:t,unmask:e,block:n,unblock:r,ignore:i,blockClass:s,blockSelector:o,maskTextClass:a,maskTextSelector:c,ignoreClass:u}){const l=['base[href="/"]'],d=gl(t,[".sentry-mask","[data-sentry-mask]"],a,c),f=gl(e,[".sentry-unmask","[data-sentry-unmask]"]),h={maskTextSelector:d,unmaskTextSelector:f,blockSelector:gl(n,[".sentry-block","[data-sentry-block]",...l],s,o),unblockSelector:gl(r,[".sentry-unblock","[data-sentry-unblock]"]),ignoreSelector:gl(i,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'],u)};return s instanceof RegExp&&(h.blockClass=s),a instanceof RegExp&&(h.maskTextClass=a),h}function Eee({el:t,key:e,maskAttributes:n,maskAllText:r,privacyOptions:i,value:s}){return!r||i.unmaskTextSelector&&t.matches(i.unmaskTextSelector)?s:n.includes(e)||e==="value"&&t.tagName==="INPUT"&&["submit","button"].includes(t.getAttribute("type")||"")?s.replace(/[\S]/g,"*"):s}const aT='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',See=["content-length","content-type","accept"];let cT=!1;const xee=t=>new Ig(t);class Ig{static __initStatic(){this.id="Replay"}constructor({flushMinDelay:e=sJ,flushMaxDelay:n=oJ,minReplayDuration:r=fJ,maxReplayDuration:i=zx,stickySession:s=!0,useCompression:o=!0,workerUrl:a,_experiments:c={},sessionSampleRate:u,errorSampleRate:l,maskAllText:d=!0,maskAllInputs:f=!0,blockAllMedia:h=!0,mutationBreadcrumbLimit:m=750,mutationLimit:p=1e4,slowClickTimeout:g=7e3,slowClickIgnoreSelectors:y=[],networkDetailAllowUrls:v=[],networkDetailDenyUrls:b=[],networkCaptureBodies:E=!0,networkRequestHeaders:w=[],networkResponseHeaders:x=[],mask:_=[],maskAttributes:k=["title","placeholder"],unmask:R=[],block:F=[],unblock:V=[],ignore:T=[],maskFn:L,beforeAddRecordingEvent:S,beforeErrorSampling:C,blockClass:N,blockSelector:U,maskInputOptions:K,maskTextClass:$,maskTextSelector:q,ignoreClass:j}={}){this.name=Ig.id;const D=wee({mask:_,unmask:R,block:F,unblock:V,ignore:T,blockClass:N,blockSelector:U,maskTextClass:$,maskTextSelector:q,ignoreClass:j});if(this._recordingOptions={maskAllInputs:f,maskAllText:d,maskInputOptions:{...K||{},password:!0},maskTextFn:L,maskInputFn:L,maskAttributeFn:(X,Z,z)=>Eee({maskAttributes:k,maskAllText:d,privacyOptions:D,key:X,value:Z,el:z}),...D,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:X=>{try{X.__rrweb__=!0}catch{}}},this._initialOptions={flushMinDelay:e,flushMaxDelay:n,minReplayDuration:Math.min(r,hJ),maxReplayDuration:Math.min(i,zx),stickySession:s,sessionSampleRate:u,errorSampleRate:l,useCompression:o,workerUrl:a,blockAllMedia:h,maskAllInputs:f,maskAllText:d,mutationBreadcrumbLimit:m,mutationLimit:p,slowClickTimeout:g,slowClickIgnoreSelectors:y,networkDetailAllowUrls:v,networkDetailDenyUrls:b,networkCaptureBodies:E,networkRequestHeaders:uT(w),networkResponseHeaders:uT(x),beforeAddRecordingEvent:S,beforeErrorSampling:C,_experiments:c},typeof u=="number"&&(console.warn(`[Replay] You are passing \`sessionSampleRate\` to the Replay integration.
418
- This option is deprecated and will be removed soon.
419
- Instead, configure \`replaysSessionSampleRate\` directly in the SDK init options, e.g.:
420
- Sentry.init({ replaysSessionSampleRate: ${u} })`),this._initialOptions.sessionSampleRate=u),typeof l=="number"&&(console.warn(`[Replay] You are passing \`errorSampleRate\` to the Replay integration.
421
- This option is deprecated and will be removed soon.
422
- Instead, configure \`replaysOnErrorSampleRate\` directly in the SDK init options, e.g.:
423
- Sentry.init({ replaysOnErrorSampleRate: ${l} })`),this._initialOptions.errorSampleRate=l),this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${aT}`:aT),this._isInitialized&&cx())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return cT}set _isInitialized(e){cT=e}setupOnce(){cx()&&(this._setup(),setTimeout(()=>this._initialize()))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:this._replay.recordingMode==="session"}):Promise.resolve()}flush(e){return!this._replay||!this._replay.isEnabled()?Promise.resolve():this._replay.sendBufferedReplayOrFlush(e)}getReplayId(){if(!(!this._replay||!this._replay.isEnabled()))return this._replay.getSessionId()}_initialize(){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(),this._replay.initializeSampling())}_setup(){const e=Tee(this._initialOptions);this._replay=new vo({options:e,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(){try{const n=Lt().getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}}Ig.__initStatic();function Tee(t){const e=Lt(),n=e&&e.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...gr(t)};return n?(t.sessionSampleRate==null&&t.errorSampleRate==null&&n.replaysSessionSampleRate==null&&n.replaysOnErrorSampleRate==null&&Za(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),typeof n.replaysSessionSampleRate=="number"&&(r.sessionSampleRate=n.replaysSessionSampleRate),typeof n.replaysOnErrorSampleRate=="number"&&(r.errorSampleRate=n.replaysOnErrorSampleRate),r):(Za(()=>{console.warn("SDK client is not available.")}),r)}function uT(t){return[...See,...t.map(e=>e.toLowerCase())]}const CA="CaptureConsole",Iee=(t={})=>{const e=t.levels||em;return{name:CA,setupOnce(){},setup(n){"console"in Mt&&vR(({args:r,level:i})=>{Lt()!==n||!e.includes(i)||Oee(r,i)})}}},kA=Iee;Li(CA,kA);function Oee(t,e){const n={level:OR(e),extra:{arguments:t}};$R(r=>{if(r.addEventProcessor(o=>(o.logger="console",Ya(o,{handled:!1,type:"console"}),o)),e==="assert"&&t[0]===!1){const o=`Assertion failed: ${Qp(t.slice(1)," ")||"console.assert"}`;r.setExtra("arguments",t.slice(1)),px(o,n);return}const i=t.find(o=>o instanceof Error);if(e==="error"&&i){kf(i,n);return}const s=Qp(t," ");px(s,n)})}const of=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,DA="ExtraErrorData",Cee=(t={})=>{const e=t.depth||3,n=t.captureErrorCause||!1;return{name:DA,setupOnce(){},processEvent(r,i){return kee(r,i,e,n)}}},RA=Cee;Li(DA,RA);function kee(t,e={},n,r){if(!e.originalException||!eu(e.originalException))return t;const i=e.originalException.name||e.originalException.constructor.name,s=Dee(e.originalException,r);if(s){const o={...t.contexts},a=vi(s,n);return Ga(a)&&(Go(a,"__sentry_skip_normalization__",!0),o[i]=a),{...t,contexts:o}}return t}function Dee(t,e){try{const n=["name","message","stack","line","column","fileName","lineNumber","columnNumber","toJSON"],r={};for(const i of Object.keys(t)){if(n.indexOf(i)!==-1)continue;const s=t[i];r[i]=eu(s)?s.toString():s}if(e&&t.cause!==void 0&&(r.cause=eu(t.cause)?t.cause.toString():t.cause),typeof t.toJSON=="function"){const i=t.toJSON();for(const s of Object.keys(i)){const o=i[s];r[s]=eu(o)?o.toString():o}}return r}catch(n){of&&me.error("Unable to extract extra data from the Error object:",n)}return null}var NA={exports:{}};/*!
424
- localForage -- Offline Storage, Improved
425
- Version 1.10.0
426
- https://localforage.github.io/localForage
427
- (c) 2013-2017 Mozilla, Apache License 2.0
428
- */(function(t,e){(function(n){t.exports=n()})(function(){return function n(r,i,s){function o(u,l){if(!i[u]){if(!r[u]){var d=typeof Oo=="function"&&Oo;if(!l&&d)return d(u,!0);if(a)return a(u,!0);var f=new Error("Cannot find module '"+u+"'");throw f.code="MODULE_NOT_FOUND",f}var h=i[u]={exports:{}};r[u][0].call(h.exports,function(m){var p=r[u][1][m];return o(p||m)},h,h.exports,n,r,i,s)}return i[u].exports}for(var a=typeof Oo=="function"&&Oo,c=0;c<s.length;c++)o(s[c]);return o}({1:[function(n,r,i){(function(s){var o=s.MutationObserver||s.WebKitMutationObserver,a;if(o){var c=0,u=new o(m),l=s.document.createTextNode("");u.observe(l,{characterData:!0}),a=function(){l.data=c=++c%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var d=new s.MessageChannel;d.port1.onmessage=m,a=function(){d.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?a=function(){var g=s.document.createElement("script");g.onreadystatechange=function(){m(),g.onreadystatechange=null,g.parentNode.removeChild(g),g=null},s.document.documentElement.appendChild(g)}:a=function(){setTimeout(m,0)};var f,h=[];function m(){f=!0;for(var g,y,v=h.length;v;){for(y=h,h=[],g=-1;++g<v;)y[g]();v=h.length}f=!1}r.exports=p;function p(g){h.push(g)===1&&!f&&a()}}).call(this,typeof rr<"u"?rr:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(n,r,i){var s=n(1);function o(){}var a={},c=["REJECTED"],u=["FULFILLED"],l=["PENDING"];r.exports=d;function d(w){if(typeof w!="function")throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,w!==o&&p(this,w)}d.prototype.catch=function(w){return this.then(null,w)},d.prototype.then=function(w,x){if(typeof w!="function"&&this.state===u||typeof x!="function"&&this.state===c)return this;var _=new this.constructor(o);if(this.state!==l){var k=this.state===u?w:x;h(_,k,this.outcome)}else this.queue.push(new f(_,w,x));return _};function f(w,x,_){this.promise=w,typeof x=="function"&&(this.onFulfilled=x,this.callFulfilled=this.otherCallFulfilled),typeof _=="function"&&(this.onRejected=_,this.callRejected=this.otherCallRejected)}f.prototype.callFulfilled=function(w){a.resolve(this.promise,w)},f.prototype.otherCallFulfilled=function(w){h(this.promise,this.onFulfilled,w)},f.prototype.callRejected=function(w){a.reject(this.promise,w)},f.prototype.otherCallRejected=function(w){h(this.promise,this.onRejected,w)};function h(w,x,_){s(function(){var k;try{k=x(_)}catch(R){return a.reject(w,R)}k===w?a.reject(w,new TypeError("Cannot resolve promise with itself")):a.resolve(w,k)})}a.resolve=function(w,x){var _=g(m,x);if(_.status==="error")return a.reject(w,_.value);var k=_.value;if(k)p(w,k);else{w.state=u,w.outcome=x;for(var R=-1,F=w.queue.length;++R<F;)w.queue[R].callFulfilled(x)}return w},a.reject=function(w,x){w.state=c,w.outcome=x;for(var _=-1,k=w.queue.length;++_<k;)w.queue[_].callRejected(x);return w};function m(w){var x=w&&w.then;if(w&&(typeof w=="object"||typeof w=="function")&&typeof x=="function")return function(){x.apply(w,arguments)}}function p(w,x){var _=!1;function k(T){_||(_=!0,a.reject(w,T))}function R(T){_||(_=!0,a.resolve(w,T))}function F(){x(R,k)}var V=g(F);V.status==="error"&&k(V.value)}function g(w,x){var _={};try{_.value=w(x),_.status="success"}catch(k){_.status="error",_.value=k}return _}d.resolve=y;function y(w){return w instanceof this?w:a.resolve(new this(o),w)}d.reject=v;function v(w){var x=new this(o);return a.reject(x,w)}d.all=b;function b(w){var x=this;if(Object.prototype.toString.call(w)!=="[object Array]")return this.reject(new TypeError("must be an array"));var _=w.length,k=!1;if(!_)return this.resolve([]);for(var R=new Array(_),F=0,V=-1,T=new this(o);++V<_;)L(w[V],V);return T;function L(S,C){x.resolve(S).then(N,function(U){k||(k=!0,a.reject(T,U))});function N(U){R[C]=U,++F===_&&!k&&(k=!0,a.resolve(T,R))}}}d.race=E;function E(w){var x=this;if(Object.prototype.toString.call(w)!=="[object Array]")return this.reject(new TypeError("must be an array"));var _=w.length,k=!1;if(!_)return this.resolve([]);for(var R=-1,F=new this(o);++R<_;)V(w[R]);return F;function V(T){x.resolve(T).then(function(L){k||(k=!0,a.resolve(F,L))},function(L){k||(k=!0,a.reject(F,L))})}}},{1:1}],3:[function(n,r,i){(function(s){typeof s.Promise!="function"&&(s.Promise=n(2))}).call(this,typeof rr<"u"?rr:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(n,r,i){var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(M){return typeof M}:function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M};function o(M,J){if(!(M instanceof J))throw new TypeError("Cannot call a class as a function")}function a(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var c=a();function u(){try{if(!c||!c.open)return!1;var M=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),J=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!M||J)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function l(M,J){M=M||[],J=J||{};try{return new Blob(M,J)}catch(re){if(re.name!=="TypeError")throw re;for(var B=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,ie=new B,oe=0;oe<M.length;oe+=1)ie.append(M[oe]);return ie.getBlob(J.type)}}typeof Promise>"u"&&n(3);var d=Promise;function f(M,J){J&&M.then(function(B){J(null,B)},function(B){J(B)})}function h(M,J,B){typeof J=="function"&&M.then(J),typeof B=="function"&&M.catch(B)}function m(M){return typeof M!="string"&&(console.warn(M+" used as a key, but it is not a string."),M=String(M)),M}function p(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var g="local-forage-detect-blob-support",y=void 0,v={},b=Object.prototype.toString,E="readonly",w="readwrite";function x(M){for(var J=M.length,B=new ArrayBuffer(J),ie=new Uint8Array(B),oe=0;oe<J;oe++)ie[oe]=M.charCodeAt(oe);return B}function _(M){return new d(function(J){var B=M.transaction(g,w),ie=l([""]);B.objectStore(g).put(ie,"key"),B.onabort=function(oe){oe.preventDefault(),oe.stopPropagation(),J(!1)},B.oncomplete=function(){var oe=navigator.userAgent.match(/Chrome\/(\d+)/),re=navigator.userAgent.match(/Edge\//);J(re||!oe||parseInt(oe[1],10)>=43)}}).catch(function(){return!1})}function k(M){return typeof y=="boolean"?d.resolve(y):_(M).then(function(J){return y=J,y})}function R(M){var J=v[M.name],B={};B.promise=new d(function(ie,oe){B.resolve=ie,B.reject=oe}),J.deferredOperations.push(B),J.dbReady?J.dbReady=J.dbReady.then(function(){return B.promise}):J.dbReady=B.promise}function F(M){var J=v[M.name],B=J.deferredOperations.pop();if(B)return B.resolve(),B.promise}function V(M,J){var B=v[M.name],ie=B.deferredOperations.pop();if(ie)return ie.reject(J),ie.promise}function T(M,J){return new d(function(B,ie){if(v[M.name]=v[M.name]||D(),M.db)if(J)R(M),M.db.close();else return B(M.db);var oe=[M.name];J&&oe.push(M.version);var re=c.open.apply(c,oe);J&&(re.onupgradeneeded=function(ye){var Ee=re.result;try{Ee.createObjectStore(M.storeName),ye.oldVersion<=1&&Ee.createObjectStore(g)}catch(Oe){if(Oe.name==="ConstraintError")console.warn('The database "'+M.name+'" has been upgraded from version '+ye.oldVersion+" to version "+ye.newVersion+', but the storage "'+M.storeName+'" already exists.');else throw Oe}}),re.onerror=function(ye){ye.preventDefault(),ie(re.error)},re.onsuccess=function(){var ye=re.result;ye.onversionchange=function(Ee){Ee.target.close()},B(ye),F(M)}})}function L(M){return T(M,!1)}function S(M){return T(M,!0)}function C(M,J){if(!M.db)return!0;var B=!M.db.objectStoreNames.contains(M.storeName),ie=M.version<M.db.version,oe=M.version>M.db.version;if(ie&&(M.version!==J&&console.warn('The database "'+M.name+`" can't be downgraded from version `+M.db.version+" to version "+M.version+"."),M.version=M.db.version),oe||B){if(B){var re=M.db.version+1;re>M.version&&(M.version=re)}return!0}return!1}function N(M){return new d(function(J,B){var ie=new FileReader;ie.onerror=B,ie.onloadend=function(oe){var re=btoa(oe.target.result||"");J({__local_forage_encoded_blob:!0,data:re,type:M.type})},ie.readAsBinaryString(M)})}function U(M){var J=x(atob(M.data));return l([J],{type:M.type})}function K(M){return M&&M.__local_forage_encoded_blob}function $(M){var J=this,B=J._initReady().then(function(){var ie=v[J._dbInfo.name];if(ie&&ie.dbReady)return ie.dbReady});return h(B,M,M),B}function q(M){R(M);for(var J=v[M.name],B=J.forages,ie=0;ie<B.length;ie++){var oe=B[ie];oe._dbInfo.db&&(oe._dbInfo.db.close(),oe._dbInfo.db=null)}return M.db=null,L(M).then(function(re){return M.db=re,C(M)?S(M):re}).then(function(re){M.db=J.db=re;for(var ye=0;ye<B.length;ye++)B[ye]._dbInfo.db=re}).catch(function(re){throw V(M,re),re})}function j(M,J,B,ie){ie===void 0&&(ie=1);try{var oe=M.db.transaction(M.storeName,J);B(null,oe)}catch(re){if(ie>0&&(!M.db||re.name==="InvalidStateError"||re.name==="NotFoundError"))return d.resolve().then(function(){if(!M.db||re.name==="NotFoundError"&&!M.db.objectStoreNames.contains(M.storeName)&&M.version<=M.db.version)return M.db&&(M.version=M.db.version+1),S(M)}).then(function(){return q(M).then(function(){j(M,J,B,ie-1)})}).catch(B);B(re)}}function D(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function X(M){var J=this,B={db:null};if(M)for(var ie in M)B[ie]=M[ie];var oe=v[B.name];oe||(oe=D(),v[B.name]=oe),oe.forages.push(J),J._initReady||(J._initReady=J.ready,J.ready=$);var re=[];function ye(){return d.resolve()}for(var Ee=0;Ee<oe.forages.length;Ee++){var Oe=oe.forages[Ee];Oe!==J&&re.push(Oe._initReady().catch(ye))}var Ce=oe.forages.slice(0);return d.all(re).then(function(){return B.db=oe.db,L(B)}).then(function(ke){return B.db=ke,C(B,J._defaultConfig.version)?S(B):ke}).then(function(ke){B.db=oe.db=ke,J._dbInfo=B;for(var qe=0;qe<Ce.length;qe++){var Ct=Ce[qe];Ct!==J&&(Ct._dbInfo.db=B.db,Ct._dbInfo.version=B.version)}})}function Z(M,J){var B=this;M=m(M);var ie=new d(function(oe,re){B.ready().then(function(){j(B._dbInfo,E,function(ye,Ee){if(ye)return re(ye);try{var Oe=Ee.objectStore(B._dbInfo.storeName),Ce=Oe.get(M);Ce.onsuccess=function(){var ke=Ce.result;ke===void 0&&(ke=null),K(ke)&&(ke=U(ke)),oe(ke)},Ce.onerror=function(){re(Ce.error)}}catch(ke){re(ke)}})}).catch(re)});return f(ie,J),ie}function z(M,J){var B=this,ie=new d(function(oe,re){B.ready().then(function(){j(B._dbInfo,E,function(ye,Ee){if(ye)return re(ye);try{var Oe=Ee.objectStore(B._dbInfo.storeName),Ce=Oe.openCursor(),ke=1;Ce.onsuccess=function(){var qe=Ce.result;if(qe){var Ct=qe.value;K(Ct)&&(Ct=U(Ct));var Zt=M(Ct,qe.key,ke++);Zt!==void 0?oe(Zt):qe.continue()}else oe()},Ce.onerror=function(){re(Ce.error)}}catch(qe){re(qe)}})}).catch(re)});return f(ie,J),ie}function le(M,J,B){var ie=this;M=m(M);var oe=new d(function(re,ye){var Ee;ie.ready().then(function(){return Ee=ie._dbInfo,b.call(J)==="[object Blob]"?k(Ee.db).then(function(Oe){return Oe?J:N(J)}):J}).then(function(Oe){j(ie._dbInfo,w,function(Ce,ke){if(Ce)return ye(Ce);try{var qe=ke.objectStore(ie._dbInfo.storeName);Oe===null&&(Oe=void 0);var Ct=qe.put(Oe,M);ke.oncomplete=function(){Oe===void 0&&(Oe=null),re(Oe)},ke.onabort=ke.onerror=function(){var Zt=Ct.error?Ct.error:Ct.transaction.error;ye(Zt)}}catch(Zt){ye(Zt)}})}).catch(ye)});return f(oe,B),oe}function pe(M,J){var B=this;M=m(M);var ie=new d(function(oe,re){B.ready().then(function(){j(B._dbInfo,w,function(ye,Ee){if(ye)return re(ye);try{var Oe=Ee.objectStore(B._dbInfo.storeName),Ce=Oe.delete(M);Ee.oncomplete=function(){oe()},Ee.onerror=function(){re(Ce.error)},Ee.onabort=function(){var ke=Ce.error?Ce.error:Ce.transaction.error;re(ke)}}catch(ke){re(ke)}})}).catch(re)});return f(ie,J),ie}function ve(M){var J=this,B=new d(function(ie,oe){J.ready().then(function(){j(J._dbInfo,w,function(re,ye){if(re)return oe(re);try{var Ee=ye.objectStore(J._dbInfo.storeName),Oe=Ee.clear();ye.oncomplete=function(){ie()},ye.onabort=ye.onerror=function(){var Ce=Oe.error?Oe.error:Oe.transaction.error;oe(Ce)}}catch(Ce){oe(Ce)}})}).catch(oe)});return f(B,M),B}function je(M){var J=this,B=new d(function(ie,oe){J.ready().then(function(){j(J._dbInfo,E,function(re,ye){if(re)return oe(re);try{var Ee=ye.objectStore(J._dbInfo.storeName),Oe=Ee.count();Oe.onsuccess=function(){ie(Oe.result)},Oe.onerror=function(){oe(Oe.error)}}catch(Ce){oe(Ce)}})}).catch(oe)});return f(B,M),B}function ct(M,J){var B=this,ie=new d(function(oe,re){if(M<0){oe(null);return}B.ready().then(function(){j(B._dbInfo,E,function(ye,Ee){if(ye)return re(ye);try{var Oe=Ee.objectStore(B._dbInfo.storeName),Ce=!1,ke=Oe.openKeyCursor();ke.onsuccess=function(){var qe=ke.result;if(!qe){oe(null);return}M===0||Ce?oe(qe.key):(Ce=!0,qe.advance(M))},ke.onerror=function(){re(ke.error)}}catch(qe){re(qe)}})}).catch(re)});return f(ie,J),ie}function ut(M){var J=this,B=new d(function(ie,oe){J.ready().then(function(){j(J._dbInfo,E,function(re,ye){if(re)return oe(re);try{var Ee=ye.objectStore(J._dbInfo.storeName),Oe=Ee.openKeyCursor(),Ce=[];Oe.onsuccess=function(){var ke=Oe.result;if(!ke){ie(Ce);return}Ce.push(ke.key),ke.continue()},Oe.onerror=function(){oe(Oe.error)}}catch(ke){oe(ke)}})}).catch(oe)});return f(B,M),B}function Ye(M,J){J=p.apply(this,arguments);var B=this.config();M=typeof M!="function"&&M||{},M.name||(M.name=M.name||B.name,M.storeName=M.storeName||B.storeName);var ie=this,oe;if(!M.name)oe=d.reject("Invalid arguments");else{var re=M.name===B.name&&ie._dbInfo.db,ye=re?d.resolve(ie._dbInfo.db):L(M).then(function(Ee){var Oe=v[M.name],Ce=Oe.forages;Oe.db=Ee;for(var ke=0;ke<Ce.length;ke++)Ce[ke]._dbInfo.db=Ee;return Ee});M.storeName?oe=ye.then(function(Ee){if(Ee.objectStoreNames.contains(M.storeName)){var Oe=Ee.version+1;R(M);var Ce=v[M.name],ke=Ce.forages;Ee.close();for(var qe=0;qe<ke.length;qe++){var Ct=ke[qe];Ct._dbInfo.db=null,Ct._dbInfo.version=Oe}var Zt=new d(function(Yt,Rn){var Tn=c.open(M.name,Oe);Tn.onerror=function(Jr){var nl=Tn.result;nl.close(),Rn(Jr)},Tn.onupgradeneeded=function(){var Jr=Tn.result;Jr.deleteObjectStore(M.storeName)},Tn.onsuccess=function(){var Jr=Tn.result;Jr.close(),Yt(Jr)}});return Zt.then(function(Yt){Ce.db=Yt;for(var Rn=0;Rn<ke.length;Rn++){var Tn=ke[Rn];Tn._dbInfo.db=Yt,F(Tn._dbInfo)}}).catch(function(Yt){throw(V(M,Yt)||d.resolve()).catch(function(){}),Yt})}}):oe=ye.then(function(Ee){R(M);var Oe=v[M.name],Ce=Oe.forages;Ee.close();for(var ke=0;ke<Ce.length;ke++){var qe=Ce[ke];qe._dbInfo.db=null}var Ct=new d(function(Zt,Yt){var Rn=c.deleteDatabase(M.name);Rn.onerror=function(){var Tn=Rn.result;Tn&&Tn.close(),Yt(Rn.error)},Rn.onblocked=function(){console.warn('dropInstance blocked for database "'+M.name+'" until all open connections are closed')},Rn.onsuccess=function(){var Tn=Rn.result;Tn&&Tn.close(),Zt(Tn)}});return Ct.then(function(Zt){Oe.db=Zt;for(var Yt=0;Yt<Ce.length;Yt++){var Rn=Ce[Yt];F(Rn._dbInfo)}}).catch(function(Zt){throw(V(M,Zt)||d.resolve()).catch(function(){}),Zt})})}return f(oe,J),oe}var Ot={_driver:"asyncStorage",_initStorage:X,_support:u(),iterate:z,getItem:Z,setItem:le,removeItem:pe,clear:ve,length:je,key:ct,keys:ut,dropInstance:Ye};function O(){return typeof openDatabase=="function"}var he="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ae="~~local_forage_type~",W=/^~~local_forage_type~([^~]+)~/,I="__lfsc__:",A=I.length,G="arbf",Q="blob",H="si08",ee="ui08",de="uic8",fe="si16",De="si32",rt="ur16",Xe="ui32",tn="fl32",sr="fl64",vn=A+G.length,Zr=Object.prototype.toString;function Rt(M){var J=M.length*.75,B=M.length,ie,oe=0,re,ye,Ee,Oe;M[M.length-1]==="="&&(J--,M[M.length-2]==="="&&J--);var Ce=new ArrayBuffer(J),ke=new Uint8Array(Ce);for(ie=0;ie<B;ie+=4)re=he.indexOf(M[ie]),ye=he.indexOf(M[ie+1]),Ee=he.indexOf(M[ie+2]),Oe=he.indexOf(M[ie+3]),ke[oe++]=re<<2|ye>>4,ke[oe++]=(ye&15)<<4|Ee>>2,ke[oe++]=(Ee&3)<<6|Oe&63;return Ce}function Nr(M){var J=new Uint8Array(M),B="",ie;for(ie=0;ie<J.length;ie+=3)B+=he[J[ie]>>2],B+=he[(J[ie]&3)<<4|J[ie+1]>>4],B+=he[(J[ie+1]&15)<<2|J[ie+2]>>6],B+=he[J[ie+2]&63];return J.length%3===2?B=B.substring(0,B.length-1)+"=":J.length%3===1&&(B=B.substring(0,B.length-2)+"=="),B}function ai(M,J){var B="";if(M&&(B=Zr.call(M)),M&&(B==="[object ArrayBuffer]"||M.buffer&&Zr.call(M.buffer)==="[object ArrayBuffer]")){var ie,oe=I;M instanceof ArrayBuffer?(ie=M,oe+=G):(ie=M.buffer,B==="[object Int8Array]"?oe+=H:B==="[object Uint8Array]"?oe+=ee:B==="[object Uint8ClampedArray]"?oe+=de:B==="[object Int16Array]"?oe+=fe:B==="[object Uint16Array]"?oe+=rt:B==="[object Int32Array]"?oe+=De:B==="[object Uint32Array]"?oe+=Xe:B==="[object Float32Array]"?oe+=tn:B==="[object Float64Array]"?oe+=sr:J(new Error("Failed to get type for BinaryArray"))),J(oe+Nr(ie))}else if(B==="[object Blob]"){var re=new FileReader;re.onload=function(){var ye=ae+M.type+"~"+Nr(this.result);J(I+Q+ye)},re.readAsArrayBuffer(M)}else try{J(JSON.stringify(M))}catch(ye){console.error("Couldn't convert value into a JSON string: ",M),J(null,ye)}}function _r(M){if(M.substring(0,A)!==I)return JSON.parse(M);var J=M.substring(vn),B=M.substring(A,vn),ie;if(B===Q&&W.test(J)){var oe=J.match(W);ie=oe[1],J=J.substring(oe[0].length)}var re=Rt(J);switch(B){case G:return re;case Q:return l([re],{type:ie});case H:return new Int8Array(re);case ee:return new Uint8Array(re);case de:return new Uint8ClampedArray(re);case fe:return new Int16Array(re);case rt:return new Uint16Array(re);case De:return new Int32Array(re);case Xe:return new Uint32Array(re);case tn:return new Float32Array(re);case sr:return new Float64Array(re);default:throw new Error("Unkown type: "+B)}}var eo={serialize:ai,deserialize:_r,stringToBuffer:Rt,bufferToString:Nr};function ea(M,J,B,ie){M.executeSql("CREATE TABLE IF NOT EXISTS "+J.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],B,ie)}function to(M){var J=this,B={db:null};if(M)for(var ie in M)B[ie]=typeof M[ie]!="string"?M[ie].toString():M[ie];var oe=new d(function(re,ye){try{B.db=openDatabase(B.name,String(B.version),B.description,B.size)}catch(Ee){return ye(Ee)}B.db.transaction(function(Ee){ea(Ee,B,function(){J._dbInfo=B,re()},function(Oe,Ce){ye(Ce)})},ye)});return B.serializer=eo,oe}function Ar(M,J,B,ie,oe,re){M.executeSql(B,ie,oe,function(ye,Ee){Ee.code===Ee.SYNTAX_ERR?ye.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[J.storeName],function(Oe,Ce){Ce.rows.length?re(Oe,Ee):ea(Oe,J,function(){Oe.executeSql(B,ie,oe,re)},re)},re):re(ye,Ee)},re)}function no(M,J){var B=this;M=m(M);var ie=new d(function(oe,re){B.ready().then(function(){var ye=B._dbInfo;ye.db.transaction(function(Ee){Ar(Ee,ye,"SELECT * FROM "+ye.storeName+" WHERE key = ? LIMIT 1",[M],function(Oe,Ce){var ke=Ce.rows.length?Ce.rows.item(0).value:null;ke&&(ke=ye.serializer.deserialize(ke)),oe(ke)},function(Oe,Ce){re(Ce)})})}).catch(re)});return f(ie,J),ie}function ci(M,J){var B=this,ie=new d(function(oe,re){B.ready().then(function(){var ye=B._dbInfo;ye.db.transaction(function(Ee){Ar(Ee,ye,"SELECT * FROM "+ye.storeName,[],function(Oe,Ce){for(var ke=Ce.rows,qe=ke.length,Ct=0;Ct<qe;Ct++){var Zt=ke.item(Ct),Yt=Zt.value;if(Yt&&(Yt=ye.serializer.deserialize(Yt)),Yt=M(Yt,Zt.key,Ct+1),Yt!==void 0){oe(Yt);return}}oe()},function(Oe,Ce){re(Ce)})})}).catch(re)});return f(ie,J),ie}function vs(M,J,B,ie){var oe=this;M=m(M);var re=new d(function(ye,Ee){oe.ready().then(function(){J===void 0&&(J=null);var Oe=J,Ce=oe._dbInfo;Ce.serializer.serialize(J,function(ke,qe){qe?Ee(qe):Ce.db.transaction(function(Ct){Ar(Ct,Ce,"INSERT OR REPLACE INTO "+Ce.storeName+" (key, value) VALUES (?, ?)",[M,ke],function(){ye(Oe)},function(Zt,Yt){Ee(Yt)})},function(Ct){if(Ct.code===Ct.QUOTA_ERR){if(ie>0){ye(vs.apply(oe,[M,Oe,B,ie-1]));return}Ee(Ct)}})})}).catch(Ee)});return f(re,B),re}function $f(M,J,B){return vs.apply(this,[M,J,B,1])}function Ng(M,J){var B=this;M=m(M);var ie=new d(function(oe,re){B.ready().then(function(){var ye=B._dbInfo;ye.db.transaction(function(Ee){Ar(Ee,ye,"DELETE FROM "+ye.storeName+" WHERE key = ?",[M],function(){oe()},function(Oe,Ce){re(Ce)})})}).catch(re)});return f(ie,J),ie}function jf(M){var J=this,B=new d(function(ie,oe){J.ready().then(function(){var re=J._dbInfo;re.db.transaction(function(ye){Ar(ye,re,"DELETE FROM "+re.storeName,[],function(){ie()},function(Ee,Oe){oe(Oe)})})}).catch(oe)});return f(B,M),B}function pc(M){var J=this,B=new d(function(ie,oe){J.ready().then(function(){var re=J._dbInfo;re.db.transaction(function(ye){Ar(ye,re,"SELECT COUNT(key) as c FROM "+re.storeName,[],function(Ee,Oe){var Ce=Oe.rows.item(0).c;ie(Ce)},function(Ee,Oe){oe(Oe)})})}).catch(oe)});return f(B,M),B}function mc(M,J){var B=this,ie=new d(function(oe,re){B.ready().then(function(){var ye=B._dbInfo;ye.db.transaction(function(Ee){Ar(Ee,ye,"SELECT key FROM "+ye.storeName+" WHERE id = ? LIMIT 1",[M+1],function(Oe,Ce){var ke=Ce.rows.length?Ce.rows.item(0).key:null;oe(ke)},function(Oe,Ce){re(Ce)})})}).catch(re)});return f(ie,J),ie}function Ag(M){var J=this,B=new d(function(ie,oe){J.ready().then(function(){var re=J._dbInfo;re.db.transaction(function(ye){Ar(ye,re,"SELECT key FROM "+re.storeName,[],function(Ee,Oe){for(var Ce=[],ke=0;ke<Oe.rows.length;ke++)Ce.push(Oe.rows.item(ke).key);ie(Ce)},function(Ee,Oe){oe(Oe)})})}).catch(oe)});return f(B,M),B}function Pg(M){return new d(function(J,B){M.transaction(function(ie){ie.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(oe,re){for(var ye=[],Ee=0;Ee<re.rows.length;Ee++)ye.push(re.rows.item(Ee).name);J({db:M,storeNames:ye})},function(oe,re){B(re)})},function(ie){B(ie)})})}function te(M,J){J=p.apply(this,arguments);var B=this.config();M=typeof M!="function"&&M||{},M.name||(M.name=M.name||B.name,M.storeName=M.storeName||B.storeName);var ie=this,oe;return M.name?oe=new d(function(re){var ye;M.name===B.name?ye=ie._dbInfo.db:ye=openDatabase(M.name,"","",0),M.storeName?re({db:ye,storeNames:[M.storeName]}):re(Pg(ye))}).then(function(re){return new d(function(ye,Ee){re.db.transaction(function(Oe){function Ce(Zt){return new d(function(Yt,Rn){Oe.executeSql("DROP TABLE IF EXISTS "+Zt,[],function(){Yt()},function(Tn,Jr){Rn(Jr)})})}for(var ke=[],qe=0,Ct=re.storeNames.length;qe<Ct;qe++)ke.push(Ce(re.storeNames[qe]));d.all(ke).then(function(){ye()}).catch(function(Zt){Ee(Zt)})},function(Oe){Ee(Oe)})})}):oe=d.reject("Invalid arguments"),f(oe,J),oe}var se={_driver:"webSQLStorage",_initStorage:to,_support:O(),iterate:ci,getItem:no,setItem:$f,removeItem:Ng,clear:jf,length:pc,key:mc,keys:Ag,dropInstance:te};function ue(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function _e(M,J){var B=M.name+"/";return M.storeName!==J.storeName&&(B+=M.storeName+"/"),B}function Pe(){var M="_localforage_support_test";try{return localStorage.setItem(M,!0),localStorage.removeItem(M),!1}catch{return!0}}function Ke(){return!Pe()||localStorage.length>0}function ft(M){var J=this,B={};if(M)for(var ie in M)B[ie]=M[ie];return B.keyPrefix=_e(M,J._defaultConfig),Ke()?(J._dbInfo=B,B.serializer=eo,d.resolve()):d.reject()}function Ue(M){var J=this,B=J.ready().then(function(){for(var ie=J._dbInfo.keyPrefix,oe=localStorage.length-1;oe>=0;oe--){var re=localStorage.key(oe);re.indexOf(ie)===0&&localStorage.removeItem(re)}});return f(B,M),B}function Be(M,J){var B=this;M=m(M);var ie=B.ready().then(function(){var oe=B._dbInfo,re=localStorage.getItem(oe.keyPrefix+M);return re&&(re=oe.serializer.deserialize(re)),re});return f(ie,J),ie}function Fe(M,J){var B=this,ie=B.ready().then(function(){for(var oe=B._dbInfo,re=oe.keyPrefix,ye=re.length,Ee=localStorage.length,Oe=1,Ce=0;Ce<Ee;Ce++){var ke=localStorage.key(Ce);if(ke.indexOf(re)===0){var qe=localStorage.getItem(ke);if(qe&&(qe=oe.serializer.deserialize(qe)),qe=M(qe,ke.substring(ye),Oe++),qe!==void 0)return qe}}});return f(ie,J),ie}function Je(M,J){var B=this,ie=B.ready().then(function(){var oe=B._dbInfo,re;try{re=localStorage.key(M)}catch{re=null}return re&&(re=re.substring(oe.keyPrefix.length)),re});return f(ie,J),ie}function St(M){var J=this,B=J.ready().then(function(){for(var ie=J._dbInfo,oe=localStorage.length,re=[],ye=0;ye<oe;ye++){var Ee=localStorage.key(ye);Ee.indexOf(ie.keyPrefix)===0&&re.push(Ee.substring(ie.keyPrefix.length))}return re});return f(B,M),B}function Nt(M){var J=this,B=J.keys().then(function(ie){return ie.length});return f(B,M),B}function Mn(M,J){var B=this;M=m(M);var ie=B.ready().then(function(){var oe=B._dbInfo;localStorage.removeItem(oe.keyPrefix+M)});return f(ie,J),ie}function en(M,J,B){var ie=this;M=m(M);var oe=ie.ready().then(function(){J===void 0&&(J=null);var re=J;return new d(function(ye,Ee){var Oe=ie._dbInfo;Oe.serializer.serialize(J,function(Ce,ke){if(ke)Ee(ke);else try{localStorage.setItem(Oe.keyPrefix+M,Ce),ye(re)}catch(qe){(qe.name==="QuotaExceededError"||qe.name==="NS_ERROR_DOM_QUOTA_REACHED")&&Ee(qe),Ee(qe)}})})});return f(oe,B),oe}function Bt(M,J){if(J=p.apply(this,arguments),M=typeof M!="function"&&M||{},!M.name){var B=this.config();M.name=M.name||B.name,M.storeName=M.storeName||B.storeName}var ie=this,oe;return M.name?oe=new d(function(re){M.storeName?re(_e(M,ie._defaultConfig)):re(M.name+"/")}).then(function(re){for(var ye=localStorage.length-1;ye>=0;ye--){var Ee=localStorage.key(ye);Ee.indexOf(re)===0&&localStorage.removeItem(Ee)}}):oe=d.reject("Invalid arguments"),f(oe,J),oe}var dn={_driver:"localStorageWrapper",_initStorage:ft,_support:ue(),iterate:Fe,getItem:Be,setItem:en,removeItem:Mn,clear:Ue,length:Nt,key:Je,keys:St,dropInstance:Bt},ro=function(J,B){return J===B||typeof J=="number"&&typeof B=="number"&&isNaN(J)&&isNaN(B)},ta=function(J,B){for(var ie=J.length,oe=0;oe<ie;){if(ro(J[oe],B))return!0;oe++}return!1},Yr=Array.isArray||function(M){return Object.prototype.toString.call(M)==="[object Array]"},er={},gc={},Kr={INDEXEDDB:Ot,WEBSQL:se,LOCALSTORAGE:dn},bs=[Kr.INDEXEDDB._driver,Kr.WEBSQL._driver,Kr.LOCALSTORAGE._driver],_s=["dropInstance"],io=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(_s),Ft={description:"",driver:bs.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function fn(M,J){M[J]=function(){var B=arguments;return M.ready().then(function(){return M[J].apply(M,B)})}}function $i(){for(var M=1;M<arguments.length;M++){var J=arguments[M];if(J)for(var B in J)J.hasOwnProperty(B)&&(Yr(J[B])?arguments[0][B]=J[B].slice():arguments[0][B]=J[B])}return arguments[0]}var na=function(){function M(J){o(this,M);for(var B in Kr)if(Kr.hasOwnProperty(B)){var ie=Kr[B],oe=ie._driver;this[B]=oe,er[oe]||this.defineDriver(ie)}this._defaultConfig=$i({},Ft),this._config=$i({},this._defaultConfig,J),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return M.prototype.config=function(B){if((typeof B>"u"?"undefined":s(B))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var ie in B){if(ie==="storeName"&&(B[ie]=B[ie].replace(/\W/g,"_")),ie==="version"&&typeof B[ie]!="number")return new Error("Database version must be a number.");this._config[ie]=B[ie]}return"driver"in B&&B.driver?this.setDriver(this._config.driver):!0}else return typeof B=="string"?this._config[B]:this._config},M.prototype.defineDriver=function(B,ie,oe){var re=new d(function(ye,Ee){try{var Oe=B._driver,Ce=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!B._driver){Ee(Ce);return}for(var ke=io.concat("_initStorage"),qe=0,Ct=ke.length;qe<Ct;qe++){var Zt=ke[qe],Yt=!ta(_s,Zt);if((Yt||B[Zt])&&typeof B[Zt]!="function"){Ee(Ce);return}}var Rn=function(){for(var nl=function(dP){return function(){var fP=new Error("Method "+dP+" is not implemented by the current driver"),O0=d.reject(fP);return f(O0,arguments[arguments.length-1]),O0}},Mg=0,lP=_s.length;Mg<lP;Mg++){var Lg=_s[Mg];B[Lg]||(B[Lg]=nl(Lg))}};Rn();var Tn=function(nl){er[Oe]&&console.info("Redefining LocalForage driver: "+Oe),er[Oe]=B,gc[Oe]=nl,ye()};"_support"in B?B._support&&typeof B._support=="function"?B._support().then(Tn,Ee):Tn(!!B._support):Tn(!0)}catch(Jr){Ee(Jr)}});return h(re,ie,oe),re},M.prototype.driver=function(){return this._driver||null},M.prototype.getDriver=function(B,ie,oe){var re=er[B]?d.resolve(er[B]):d.reject(new Error("Driver not found."));return h(re,ie,oe),re},M.prototype.getSerializer=function(B){var ie=d.resolve(eo);return h(ie,B),ie},M.prototype.ready=function(B){var ie=this,oe=ie._driverSet.then(function(){return ie._ready===null&&(ie._ready=ie._initDriver()),ie._ready});return h(oe,B,B),oe},M.prototype.setDriver=function(B,ie,oe){var re=this;Yr(B)||(B=[B]);var ye=this._getSupportedDrivers(B);function Ee(){re._config.driver=re.driver()}function Oe(qe){return re._extend(qe),Ee(),re._ready=re._initStorage(re._config),re._ready}function Ce(qe){return function(){var Ct=0;function Zt(){for(;Ct<qe.length;){var Yt=qe[Ct];return Ct++,re._dbInfo=null,re._ready=null,re.getDriver(Yt).then(Oe).catch(Zt)}Ee();var Rn=new Error("No available storage method found.");return re._driverSet=d.reject(Rn),re._driverSet}return Zt()}}var ke=this._driverSet!==null?this._driverSet.catch(function(){return d.resolve()}):d.resolve();return this._driverSet=ke.then(function(){var qe=ye[0];return re._dbInfo=null,re._ready=null,re.getDriver(qe).then(function(Ct){re._driver=Ct._driver,Ee(),re._wrapLibraryMethodsWithReady(),re._initDriver=Ce(ye)})}).catch(function(){Ee();var qe=new Error("No available storage method found.");return re._driverSet=d.reject(qe),re._driverSet}),h(this._driverSet,ie,oe),this._driverSet},M.prototype.supports=function(B){return!!gc[B]},M.prototype._extend=function(B){$i(this,B)},M.prototype._getSupportedDrivers=function(B){for(var ie=[],oe=0,re=B.length;oe<re;oe++){var ye=B[oe];this.supports(ye)&&ie.push(ye)}return ie},M.prototype._wrapLibraryMethodsWithReady=function(){for(var B=0,ie=io.length;B<ie;B++)fn(this,io[B])},M.prototype.createInstance=function(B){return new M(B)},M}(),bn=new na;r.exports=bn},{3:3}]},{},[4])(4)})})(NA);var Ree=NA.exports;const lT=ec(Ree),AA="HttpClient",Nee=(t={})=>{const e={failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/],...t};return{name:AA,setupOnce(){},setup(n){Uee(n,e),Bee(n,e)}}},PA=Nee;Li(AA,PA);function Aee(t,e,n,r){if(LA(t,n.status,n.url)){const i=zee(e,r);let s,o,a,c;$A()&&([{headers:s,cookies:a},{headers:o,cookies:c}]=[{cookieHeader:"Cookie",obj:i},{cookieHeader:"Set-Cookie",obj:n}].map(({cookieHeader:l,obj:d})=>{const f=Lee(d.headers);let h;try{const m=f[l]||f[l.toLowerCase()]||void 0;m&&(h=MA(m))}catch{of&&me.log(`Could not extract cookies from header ${l}`)}return{headers:f,cookies:h}}));const u=FA({url:i.url,method:i.method,status:n.status,requestHeaders:s,responseHeaders:o,requestCookies:a,responseCookies:c});gg(u)}}function Pee(t,e,n,r){if(LA(t,e.status,e.responseURL)){let i,s,o;if($A()){try{const c=e.getResponseHeader("Set-Cookie")||e.getResponseHeader("set-cookie")||void 0;c&&(s=MA(c))}catch{of&&me.log("Could not extract cookies from response headers")}try{o=Fee(e)}catch{of&&me.log("Could not extract headers from response")}i=r}const a=FA({url:e.responseURL,method:n,status:e.status,requestHeaders:i,responseHeaders:o,responseCookies:s});gg(a)}}function Mee(t){if(t){const e=t["Content-Length"]||t["content-length"];if(e)return parseInt(e,10)}}function MA(t){return t.split("; ").reduce((e,n)=>{const[r,i]=n.split("=");return e[r]=i,e},{})}function Lee(t){const e={};return t.forEach((n,r)=>{e[r]=n}),e}function Fee(t){const e=t.getAllResponseHeaders();return e?e.split(`\r
429
- `).reduce((n,r)=>{const[i,s]=r.split(": ");return n[i]=s,n},{}):{}}function $ee(t,e){return t.some(n=>typeof n=="string"?e.includes(n):n.test(e))}function jee(t,e){return t.some(n=>typeof n=="number"?n===e:e>=n[0]&&e<=n[1])}function Uee(t,e){SR()&&lg(n=>{if(Lt()!==t)return;const{response:r,args:i}=n,[s,o]=i;r&&Aee(e,s,r,o)})}function Bee(t,e){"XMLHttpRequest"in Mt&&fg(n=>{if(Lt()!==t)return;const r=n.xhr,i=r[Ms];if(!i)return;const{method:s,request_headers:o}=i;try{Pee(e,r,s,o)}catch(a){of&&me.warn("Error while extracting response event form XHR response",a)}})}function LA(t,e,n){return jee(t.failedRequestStatusCodes,e)&&$ee(t.failedRequestTargets,n)&&!rN(n,Lt())}function FA(t){const e=`HTTP Client Error with status code: ${t.status}`,n={message:e,exception:{values:[{type:"Error",value:e}]},request:{url:t.url,method:t.method,headers:t.requestHeaders,cookies:t.requestCookies},contexts:{response:{status_code:t.status,headers:t.responseHeaders,cookies:t.responseCookies,body_size:Mee(t.responseHeaders)}}};return Ya(n,{type:"http.client",handled:!1}),n}function zee(t,e){return!e&&t instanceof Request||t instanceof Request&&t.bodyUsed?t:new Request(t,e)}function $A(){const t=Lt();return t?!!t.getOptions().sendDefaultPii:!1}function Vee(t){const e={...t};iN(e,"react"),eJ(e)}function Hee(t){const e=UY({...t,instrumentPageLoad:!1,instrumentNavigation:!1}),{useEffect:n,useLocation:r,useNavigationType:i,createRoutesFromChildren:s,matchRoutes:o,stripBasename:a,instrumentPageLoad:c=!0,instrumentNavigation:u=!0}=t;return{...e,afterAllSetup(l){e.afterAllSetup(l);const d=Jt.location&&Jt.location.pathname;c&&d&&_N(l,{name:d,attributes:{[as]:"url",[Al]:"pageload",[ma]:"auto.pageload.react.reactrouter_v6"}})}}}function Wee(...t){let e,n;const r=t.findIndex(i=>i instanceof Error);r?(e=t.at(r),n=t.slice(0,r).concat(t.slice(r+1))):t.length===1?e=t:t.length>1&&(e=t[0],n=t.slice(1)),!(e instanceof TypeError&&e.message==="Failed to fetch"&&!navigator.onLine)&&kf(e,n?{data:n}:void 0)}var Wi;class qee{constructor(){bt(this,Wi,console);this.log=this.log.bind(this),this.info=this.info.bind(this),this.warn=this.warn.bind(this),this.error=this.error.bind(this),this.debug=this.debug.bind(this),this.trace=this.trace.bind(this)}set logger(e){ht(this,Wi,e)}log(...e){return ce(this,Wi).log(...e)}info(...e){return ce(this,Wi).info(...e)}warn(...e){return ce(this,Wi).warn(...e)}error(...e){return Wee(...e),ce(this,Wi).error(...e)}debug(...e){return ce(this,Wi).debug(...e)}trace(...e){return ce(this,Wi).trace(...e)}}Wi=new WeakMap;const Hn=new qee;wH(Hn);function Gee(t){const e=gn(0),n=gn(()=>({i:0}),(c,u)=>{const l=c(n);return Object.assign(l,{m:!0,peek:c,set:u}),u(e,d=>d+1),()=>{l.m=!1,o(l),a(l)}});n.onMount=c=>c();const r=gn(c=>{c(e);const u=c(n);if(!u.m||u.irc||u.i&&!u.irf)return u.p;a(u);const l=new Map,d=p=>{const g=c(p);return l.set(p,g),g};d.peek=u.peek;const f=(...p)=>{try{return++u.i,u.set(...p)}finally{Array.from(l.keys(),c),--u.i}};f.recurse=(p,...g)=>{if(!u.fc)try{return u.irc=!0,u.set(p,...g)}finally{u.irc=!1,Array.from(l).some(h)&&s(u)}};function h([p,g]){return c(p)!==g}++u.i;function m(){try{if(u.irf=!1,!u.m)return;o(u),u.c=i.effect(d,f)}catch(p){u.e=p,s(u)}finally{u.p=void 0,--u.i}}return u.irf?m():u.p=Promise.resolve().then(m)}),i=gn(c=>void c(r));return i.effect=t,i;function s(c){try{c.irf=!0,c.set(e,u=>u+1)}finally{c.irf=!1}}function o(c){if(typeof c.c=="function")try{c.fc=!0,c.c()}finally{c.fc=!1,c.c=void 0}}function a(c){if("e"in c){const u=c.e;throw delete c.e,u}}}const Ch=new WeakMap;function Zee(t,e=GC()){Ch.has(e)||Ch.set(e,new Map);const n=Ch.get(e);let r=n.get(t);if(!r){const i=Gee(t);let s=e.sub(i,()=>{});r=()=>{s&&(n.delete(t),n.size===0&&Ch.delete(e),s=void s())},n.set(t,r)}return r}const Yee="feature-flags-config",tp=window.__VITE_ENVS.PH_CONNECT_ENABLED_EDITORS||void 0,Kee=tp==null?void 0:tp.split(","),np=window.__VITE_ENVS.PH_CONNECT_DISABLED_EDITORS||void 0,Jee=np==null?void 0:np.split(","),jA={editors:{enabledEditors:tp==="*"?"*":Kee,disabledEditors:np==="*"?"*":Jee}},Xee=Ef(Yee,jA),UA=()=>{const[t,e]=Ni(Xee);return{config:{...jA,...t},setConfig:e}},Qee=M9("theme","light",t=>{var e;typeof window<"u"&&((e=window.electronAPI)==null||e.setTheme(t))}),m0=G_(),ete=Ef("sidebar-collapsed",!1);gn(!1);const tte={sidebarCollapsedAtom:ete,themeAtom:Qee};async function g0(){try{return(await Se(()=>import("PH:HMR_MODULE"),[])).default}catch{return}}const nte=window.__VITE_ENVS.LOAD_EXTERNAL_PACKAGES,rte=nte==="true";function ite(){return rte?Se(()=>import("PH:EXTERNAL_PACKAGES"),[]).then(t=>t.default):Promise.resolve([])}async function ste(t){const e=await g0(),n=r=>{const i=Se(()=>import(`${r.url}?t=${r.timestamp}`),[]);t(i.then(s=>s.default))};return e==null||e.on("studio:external-packages-updated",n),()=>{e==null||e.off("studio:external-packages-updated",n)}}const y0=Z_(ite);let dT;y0.onMount=t=>{dT||(dT=ste(e=>{t(e)}))};const ote=()=>ac(y0),ate=window.__VITE_ENVS.LOCAL_DOCUMENT_MODELS,cte=[eR];function ute(...t){const e=new Map;for(const n of t)for(const r of n)e.set(r.documentModel.id,r);return Array.from(e.values())}function lte(t){return t.map(e=>e.documentModels).reduce((e,n)=>e.concat(n),[])}async function dte(){if(!ate)return[];try{const t=await Se(()=>import("LOCAL_DOCUMENT_MODELS"),[]);return console.log("Loaded local document models:",t),Object.values(t)}catch(t){return console.error("Error loading local document models",t),[]}}const fte=Z_(dte),Og=gn(async t=>{const e=await t(fte),n=await t(y0),r=lte(n);return ute(cte,r,e)}),hte=()=>ac(Og),pte=XC(Og),BA=()=>ac(pte),mte=function(t){const e=Zee(n=>{n(Og).then(t).catch(i=>{throw i})},m0);return()=>e()};function gte(t,e){return e==null?void 0:e.find(n=>n.documentModel.id===t)}const yte=()=>{const t=BA();return e=>gte(e,t)},vte=()=>{const t=BA(),{config:e}=UA(),{enabledEditors:n,disabledEditors:r}=e.editors;if(!t)return;const i=t.filter(s=>s.documentModel.id!=="powerhouse/document-drive");return n==="*"?t:r==="*"?[]:r?i.filter(s=>!r.includes(s.documentModel.id)):n?i.filter(s=>n.includes(s.documentModel.id)):i};function bte(t){let e=!1;const n=Object.entries(t.operations).reduce((r,[i,s])=>{const o=i;for(const a of s){const c=_te(a);r[o].push(c),c!==a&&(e=!0)}return r},{global:[],local:[]});return e?{...t,operations:n}:t}function _te(t){var n;if(!((n=t.context)!=null&&n.signer)||t.context.signer.signatures)return t;const{signer:e}=t.context;if("signature"in e){const r=e.signature;return{...t,context:{...t.context,signer:{user:e.user,app:e.app,signatures:r!=null&&r.length?[r]:[]}}}}else return t}const Kn=class Kn{constructor(e){Ve(this,"db");this.db=lT.ready().then(()=>lT.createInstance({name:e?`${e}:${Kn.DBName}`:Kn.DBName}))}buildKey(...e){return e.join(Kn.SEP)}async checkDocumentExists(e,n){return!!await(await this.db).getItem(this.buildKey(e,n))}async getDocuments(e){const r=await(await this.db).keys(),i=`${e}${Kn.SEP}`;return r.filter(s=>s.startsWith(i)).map(s=>s.slice(i.length))}async getDocument(e,n){const r=await(await this.db).getItem(this.buildKey(e,n));if(!r)throw new Error(`Document with id ${n} not found`);return r}async createDocument(e,n,r){await(await this.db).setItem(this.buildKey(e,n),r)}async deleteDocument(e,n){await(await this.db).removeItem(this.buildKey(e,n))}async clearStorage(){return(await this.db).clear()}async addDocumentOperations(e,n,r,i){const s=await this.getDocument(e,n);if(!s)throw new Error(`Document with id ${n} not found`);const o=Xp(s.operations,r);await(await this.db).setItem(this.buildKey(e,n),{...s,...i,operations:o})}async getDrives(){return(await(await this.db).keys()).filter(r=>r.startsWith(Kn.DRIVES_KEY)).map(r=>r.slice(Kn.DRIVES_KEY.length+Kn.SEP.length))}async getDrive(e){const r=await(await this.db).getItem(this.buildKey(Kn.DRIVES_KEY,e));if(!r)throw new Hl(e);return r}async getDriveBySlug(e){const n=(await this.getDrives()).reverse();for(const r of n)if((await this.getDrive(r)).initialState.state.global.slug===e)return this.getDrive(r);throw new Error(`Drive with slug ${e} not found`)}async createDrive(e,n){await(await this.db).setItem(this.buildKey(Kn.DRIVES_KEY,e),n)}async deleteDrive(e){const n=await this.getDocuments(e);return await Promise.all(n.map(r=>this.deleteDocument(e,r))),(await this.db).removeItem(this.buildKey(Kn.DRIVES_KEY,e))}async addDriveOperations(e,n,r){const i=await this.getDrive(e),s=Xp(i.operations,n);await(await this.db).setItem(this.buildKey(Kn.DRIVES_KEY,e),{...i,...r,operations:s})}async getSynchronizationUnitsRevision(e){return(await Promise.allSettled(e.map(async r=>{try{const i=await(r.documentId?this.getDocument(r.driveId,r.documentId):this.getDrive(r.driveId));if(!i)return;const s=i.operations[r.scope].at(-1);if(s)return{driveId:r.driveId,documentId:r.documentId,scope:r.scope,branch:r.branch,lastUpdated:s.timestamp,revision:s.index}}catch{return}}))).reduce((r,i)=>(i.status==="fulfilled"&&i.value!==void 0&&r.push(i.value),r),[])}async migrateOperationSignatures(){const e=await this.getDrives();for(const n of e){await this.migrateDocument(Kn.DRIVES_KEY,n);const r=await this.getDocuments(n);await Promise.all(r.map(async i=>this.migrateDocument(n,i)))}}async migrateDocument(e,n){const r=await this.getDocument(e,n),i=bte(r);if(i!==r)return(await this.db).setItem(this.buildKey(e,n),i)}};Ve(Kn,"DBName","DOCUMENT_DRIVES"),Ve(Kn,"SEP",":"),Ve(Kn,"DRIVES_KEY","DRIVES");let kb=Kn;const fT=window.__VITE_ENVS.PH_CONNECT_DEFAULT_DRIVES_URL||void 0,Vy=fT?fT.split(","):[],wte=()=>({defaultDrives:{remoteDrives:Vy.map(e=>({url:e,options:{sharingType:"PUBLIC",availableOffline:!0,listeners:[{block:!0,callInfo:{data:e,name:"switchboard-push",transmitterType:"SwitchboardPush"},filter:{branch:["main"],documentId:["*"],documentType:["*"],scope:["global"]},label:"Switchboard Sync",listenerId:"1",system:!0}],triggers:[],pullInterval:3e3}})),removeOldRemoteDrives:Vy.length>0?{strategy:"preserve-by-url-and-detach",urls:Vy}:{strategy:"preserve-all"}}});function Ete(t,e){return new JW(t,new kb(e),new nR,new iR(1,10),{...wte()})}async function Ste(t){const e=await t.initialize(),n=e==null?void 0:e.at(0);if(n)throw n;!(await t.getDrives()).length&&Ns.drives.sections.LOCAL.enabled&&t.addDrive({global:{id:zt.hashKey(),name:"My Local Drive",icon:null,slug:"my-local-drive"},local:{availableOffline:!1,sharingType:"private",listeners:[],triggers:[]}}).catch(Hn.error)}async function xte(){var n;const t=await m0.get(Og),e=((n=window.electronAPI)==null?void 0:n.documentDrive)??Ete(t,Ns.routerBasename);return await Ste(e),e}const ym=Z_(xte),Tte=XC(ym),zA=()=>ac(Tte),Ite=()=>ac(VA),VA=gn(void 0);VA.onMount=t=>{const e=ym.onMount;ym.onMount=n=>(n(r=>(r.then(i=>t(i)).catch(console.error),r)),e==null?void 0:e(n))};let Hy;ym.onMount=t=>{Hy||t(async e=>{const n=await e;return Hy||(Hy=mte(r=>{n.setDocumentModels(r)})),n})};const rp=(async()=>{if(window.connectCrypto)return window.connectCrypto;const{ConnectCrypto:t}=await Se(async()=>{const{ConnectCrypto:r}=await import("./index-q_KV5Ymp.js");return{ConnectCrypto:r}},__vite__mapDeps([0,1,2,3])),{BrowserKeyStorage:e}=await Se(async()=>{const{BrowserKeyStorage:r}=await import("./browser-BbIPlSaA.js");return{BrowserKeyStorage:r}},[]),n=new t(new e);return await n.did(),n})();function v0(){return Pn(()=>({async regenerateDid(){return(await rp).regenerateDid()},async did(){return(await rp).did()},sign:async t=>await(await rp).sign(t)}),[])}const Ote=gn(void 0);function Cte(){const[t,e]=Ni(Ote);return Dt(()=>{t||rp.then(n=>n.did()).then(n=>e(n)).catch(Hn.error)}),t}const kte=gn(window.renown?Promise.resolve(window.renown):void 0);function HA(){const[t,e]=Ni(kte),{did:n}=v0();async function r(i){const s=await i();if(!s)return;const{initRenownBrowser:o}=await Se(async()=>{const{initRenownBrowser:u}=await import("./browser-DtMtdCgJ.js");return{initRenownBrowser:u}},__vite__mapDeps([4,5,1,6,2,3])),a=o(s);return{user:function(){return Promise.resolve(a.user)},login:function(u){return a.login(u)},logout(){return Promise.resolve(a.logout())},on:{user(u){return a.on("user",u)}}}}return t||e(r(n)),t}let kh=!1;const Dte=gn(void 0),Cg=()=>{const[t,e]=Ni(Dte),n=HA();return Dt(()=>{var i;let r=null;if(t){const{credential:s,...o}=t;r={id:o.did,username:(i=o.ens)==null?void 0:i.name,...o}}IG(r)},[t]),Dt(()=>{if(kh)return;kh=!0,n==null||n.user().then(i=>{e(i||null)}).catch(()=>{e(null)});const r=n==null?void 0:n.on.user(i=>{e(i||null)});return()=>{r==null||r(),kh=!1}},[n,kh]),t},Rte=parseInt("50");function wse(t,e,n=Hn.error){const[r,i]=We(e),[s,o]=We(),a=u=>{o(u),n(u)};return Dt(()=>{i(e)},[e]),[r,(u,l,d)=>{o(void 0),i(f=>{if(!t||!f)return f;try{const h=t(f,u),m=u.scope??"global",p=h.operations[m],g=p[p.length-1];if(g.error){const y=new Error(g.error);a(y),d==null||d(y)}return l==null||l(g,{prevState:{...f},newState:{...h}}),h}catch(h){return a(h),d==null||d(h),f}})},s]}async function Nte(t,e,n,r,i){let s;const o=new Promise(u=>{s=i.on("strandUpdate",l=>{var h;if(!(l.documentId===e&&l.scope==n))return;const f=(h=l.operations.at(-1))==null?void 0:h.index;f&&f>=r&&u()})}),a=new Promise((u,l)=>setTimeout(()=>l(new Error(`Timed out waiting for operation ${r} for document ${e}`)),t)),c=Promise.race([o,a]);return c.finally(()=>{s==null||s()}),c}async function Ate(t,e,n,r,i,s){const o=(s==null?void 0:s.operationsLimit)||Rte;for(const a of Object.values(n.operations))for(let c=0;c<a.length;c+=o){const u=a.slice(c,c+o),l=u.at(-1);if(!l)break;const{scope:d}=l;await i(t,e,u),s!=null&&s.waitForSync&&await Nte(1e4,e,d,l.index,r)}}const Pte=async t=>{(await zt.createZip(t)).generateAsync({type:"blob"}).then(n=>{const r=window.document.createElement("a");r.style.display="none",r.href=URL.createObjectURL(n),r.download=`${t.name||"Untitled"}.zip`,window.document.body.appendChild(r),r.click(),window.document.body.removeChild(r)}).catch(Hn.error)};async function Ese(t,e){var i,s;const n=e(t.documentType);if(!n)throw new Error(`Document model not supported: ${t.documentType}`);const r=n.utils.fileExtension;if(!window.showSaveFilePicker){await Pte(t);return}try{const o=await window.showSaveFilePicker({suggestedName:`${t.name||((i=t.state.global)==null?void 0:i.name)||"Untitled"}.${r?`${r}.`:""}zip`});await n.utils.saveToFileHandle(t,o);const a=(await o.getFile()).path;return typeof window<"u"&&((s=window.electronAPI)==null||s.fileSaved(t,a)),a}catch(o){if(!(o instanceof DOMException&&o.name==="AbortError"))throw o}}async function Mte(t,e){const n=await zt.loadFromInput(t,i=>i,{checkHashes:!0}),r=e(n.documentType);if(!r)throw new Error(`Document "${n.documentType}" is not supported`);return r.utils.loadFromInput(t)}async function Lte(t,e,n,r,i,s){if(!s||!t.context||!t.context.signer)return t;if(!i)return Hn.error(`Document model '${r.documentType}' does not have a reducer`),t;const o={documentId:n,signer:t.context.signer};return await zt.buildSignedOperation(t,i,r,o,e)}function Fte(t,e,n){return n?{context:{signer:{app:{name:"Connect",key:e||""},user:{address:n.address,networkId:n.networkId,chainId:n.chainId},signatures:[]}},...t}:t}const hT=gn(new Map);function $te(t){return Object.keys(t.operations).map(e=>{var n;return`${e}:${t.operations[e].length}:${(n=t.operations[e].at(-1))==null?void 0:n.hash}`}).join(":")}function vm(t){return t.map($te).join("&")}const jte=t=>()=>gn(e=>t?e(hT).get(t)??[]:[],(e,n,r)=>{n(hT,i=>{if(!t)return new Map;const s=i.get(t)??[];return s.length!==r.length||vm(s)!==vm(r)?new Map(i).set(t,r):i})}),Ute=T9(()=>gn("INITIAL"));function Bte(){const t=zA(),[e,n]=Ni(Pn(jte(t),[t])),r=He(async()=>{if(!t)return;const a=[];try{const c=await t.getDrives();for(const u of c)try{const l=await t.getDrive(u);a.push(l)}catch(l){Hn.error(l)}}catch(c){Hn.error(c)}finally{n(a)}},[t]),[i,s]=Ni(Ute(t));i==="INITIAL"&&(s("LOADING"),r().then(()=>s("LOADED")).catch(()=>s("ERROR")));const o=He(a=>{if(!t)return;const c=t.on("syncStatus",async(f,h,m)=>{m&&Hn.error(m),await r()}),u=t.on("strandUpdate",()=>r()),l=t.on("clientStrandsError",a.strandsErrorHandler),d=t.on("defaultRemoteDrive",()=>r());return()=>{c(),u(),l(),d()}},[t,r]);return Pn(()=>[e,r,o,i],[e,i])}const zte=window.__VITE_ENVS.PH_CONNECT_RENOWN_URL||"https://www.renown.id",Vte=window.__VITE_ENVS.PH_CONNECT_RENOWN_NETWORK_ID||"eip155",Hte=window.__VITE_ENVS.PH_CONNECT_RENOWN_CHAIN_ID||"1",Wte=gn("initial"),b0=()=>{const[t,e]=Ni(Wte),n=Cg(),r=HA(),{did:i}=v0(),s=He(async()=>{var l;const c=await i(),u=new URL(zte);if(u.searchParams.set("connect",c),u.searchParams.set("network",Vte),u.searchParams.set("chain",Hte),window.electronAPI){const d=await window.electronAPI.protocol();u.searchParams.set("deeplink",d),await window.electronAPI.openURL(u.toString())}else{const d=new URL(window.location.pathname,window.location.origin);u.searchParams.set("returnUrl",d.toJSON()),(l=window.open(u,"_self"))==null||l.focus()}},[i]),o=He(async c=>{if(r)try{e("checking");const u=await r.user();if((u==null?void 0:u.did)===c)return e("authorized"),u;const l=await r.login(c);if(l)return e("authorized"),l;e("not-authorized")}catch(u){e("not-authorized"),Hn.error(u)}},[r]);Dt(()=>{n&&t!=="authorized"&&e("authorized")},[n,t]);const a=He(async()=>{e("initial"),await(r==null?void 0:r.logout())},[r]);return Pn(()=>({openRenown:s,user:n,status:n?"authorized":t,login:r?o:void 0,logout:a}),[r,s,n,t,o,a])};function qte(){const{user:t,status:e}=b0(),n=window.__VITE_ENVS.PH_CONNECT_ARBITRUM_ALLOW_LIST,r=window.__VITE_ENVS.PH_CONNECT_RWA_ALLOW_LIST,i=!!n&&n!=="",s=!!r&&r!=="";if(i&&s)throw new Error("Both Arbitrum and RWA allow lists are defined. Please only define one.");if(!i&&!s)return{isAllowed:!0,allowListType:"none"};if(t!==void 0){if(i){const o=n.split(",");return e!=="authorized"||!t?{isAllowed:!1,allowListType:"arbitrum"}:o.includes(t.address)?{isAllowed:!0,allowListType:"arbitrum"}:{isAllowed:!1,allowListType:"arbitrum"}}if(s){const o=r.split(",");return e!=="authorized"||!t?{isAllowed:!1,allowListType:"rwa"}:o.includes(t.address)?{isAllowed:!0,allowListType:"rwa"}:{isAllowed:!1,allowListType:"rwa"}}return{isAllowed:!0,allowListType:"none"}}}function WA(){const t=qte();if(!t)return;const{allowListType:e,isAllowed:n}=t;return e==="arbitrum"?{isAllowedToCreateDocuments:n,isAllowedToEditDocuments:!0}:e==="rwa"?{isAllowedToCreateDocuments:n,isAllowedToEditDocuments:n}:{isAllowedToCreateDocuments:!0,isAllowedToEditDocuments:!0}}function _0(){const{isAllowedToCreateDocuments:t,isAllowedToEditDocuments:e}=WA()||{isAllowedToCreateDocuments:!1,isAllowedToEditDocuments:!1},n=Cg()||void 0,r=Cte(),{sign:i}=v0(),s=zA(),o=yte(),[a,c,,u]=Bte(),l=He(async($,q)=>{if(!s)throw new Error("Reactor is not loaded");const j=await s.getDocument($,q);if(!j)throw new Error(`There was an error opening file with id ${q} on drive ${$}`);return j},[s]),d=He(async($,q)=>{if(!s)throw new Error("Reactor is not loaded");let j=a.find(pe=>pe.state.global.id===$);if(!j)throw new Error(`Drive with id ${$} not found`);const D={...j};j=qa(j,Fte(q,r,n));const X=q.scope??"global",z=j.operations[X].findLast(pe=>pe.type===q.type);if(!z)throw new Error("There was an error applying the operation");const le=await Lte(z,i,$,D,qa,n);try{const pe=await s.queueDriveOperation($,le);if(pe.status!=="SUCCESS"&&Hn.error(pe.error),pe.operations.length&&await c(),pe.document&&!aa(pe.document))throw new Error("Received document is not a Document Drive");return pe.document}catch(pe){return Hn.error(pe),j}},[a,c,s,i,n,r]),f=He(async($,q,j,D,X)=>{if(!t)throw new Error("User is not allowed to create documents");const Z=zt.hashKey();let z=a.find(ve=>ve.state.global.id===$);if(!z)throw new Error(`Drive with id ${$} not found`);const le=Nw(z.state.global,{id:Z,name:q,parentFolder:D??null,documentType:j,document:X},["global"]);z=await d($,le);const pe=z==null?void 0:z.state.global.nodes.find(ve=>ve.id===Z);if(!pe||!Or(pe))throw new Error("There was an error adding document");return pe},[d,a,t]),h=He(async($,q,j)=>{if(!e)throw new Error("User is not allowed to edit documents");if(!s)throw new Error("Reactor is not loaded");if(!a.find(Z=>Z.state.global.id===$))throw new Error(`Drive with id ${$} not found`);return(await s.queueOperations($,q,j)).document},[a,e,s]),m=He(async($,q,j,D)=>{if(!s)throw new Error("Reactor is not loaded");if(!t)throw new Error("User is not allowed to create files");const X=await Mte($,o),Z={...X.initialState,initialState:X.initialState,operations:{global:[],local:[]},clipboard:[]},z=await f(q,j||(typeof $=="string"?X.name:$.name),X.documentType,D,Z),le=a.find(ve=>ve.state.global.id===q),pe=le&&le.state.local.listeners.length>0;Ate(q,z.id,X,s,h,{waitForSync:pe}).catch(ve=>{throw ve})},[f,h,o,t,s]),p=He(async($,q,j,D,X)=>{if(!t)throw new Error("User is not allowed to update files");const Z=await d($,Jn.updateFile({id:q,name:D||void 0,parentFolder:X,documentType:j})),z=Z==null?void 0:Z.state.global.nodes.find(le=>le.id===q);if(!z||!Or(z))throw new Error("There was an error updating document");return z},[d,t]),g=He(async($,q,j)=>{if(!t)throw new Error("User is not allowed to create folders");const D=zt.hashKey(),X=await d($,Jn.addFolder({id:D,name:q,parentFolder:j})),Z=X==null?void 0:X.state.global.nodes.find(z=>z.id===D);if(!Z||!og(Z))throw new Error("There was an error adding folder");return Z},[d,t]),y=He(async($,q)=>{if(!t)throw new Error("User is not allowed to delete documents");await d($,Jn.deleteNode({id:q}))},[d,t]),v=He(async($,q,j)=>{if(!t)throw new Error("User is not allowed to rename documents");const D=await d($,Jn.updateNode({id:q,name:j})),X=D==null?void 0:D.state.global.nodes.find(Z=>Z.id===q);if(!X)throw new Error("There was an error renaming node");return X},[d,t]),b=He(async($,q)=>{if(!t)throw new Error("User is not allowed to move documents");q.kind===qc||$.parentFolder===q.id||await d(q.driveId,Jn.moveNode({srcFolder:$.id,targetParentFolder:q.id}))},[d,t]),E=He(async($,q)=>{if(!s)throw new Error("Reactor is not loaded");if(!t)throw new Error("User is not allowed to copy documents");if(q.kind===qc)return;const j=a.find(le=>le.state.global.id===$.driveId);if(!j)return;const D=()=>zt.hashKey(),Z=Qd.generateNodesCopy({srcId:$.id,targetParentFolder:q.id,targetName:$.name},D,j.state.global.nodes).map(le=>Jn.copyNode(le)),z=await s.addDriveActions($.driveId,Z);z.operations.length?await c():z.status!=="SUCCESS"&&Hn.error(`Error copying files: ${z.status}`,z.error)},[a,t,c,s]),w=He(async($,q,j)=>{if(!e)throw new Error("User is not allowed to edit documents");if(!s)throw new Error("Reactor is not loaded");if(!a.find(Z=>Z.state.global.id===$))throw new Error(`Drive with id ${$} not found`);return(await s.addOperation($,q,j)).document},[a,e,s]),x=He(async $=>{if(!s)throw new Error("Reactor is not loaded");if(!t)throw new Error("User is not allowed to create drives");const q=$.global.id||zt.hashKey();$=Qd.createState($);const j=await s.addDrive({global:{...$.global,id:q},local:$.local});return await c(),j},[t,c,s]),_=He(async($,q)=>{if(!s)throw new Error("Reactor is not loaded");const j=await s.addRemoteDrive($,q);return await c(),j},[c,s]),k=He(async $=>{if(!t)throw new Error("User is not allowed to delete drives");if(!s)throw new Error("Reactor is not loaded");if(!a.find(j=>j.state.global.id===$))throw new Error(`Drive with id ${$} not found`);return await s.deleteDrive($),c()},[a,t,c,s]),R=He(async($,q)=>{if(!t)throw new Error("User is not allowed to rename drives");return d($,Jn.setDriveName({name:q}))},[d,t]),F=He(async($,q)=>{if(!t)throw new Error("User is not allowed to change drive availability");return d($,Jn.setAvailableOffline({availableOffline:q}))},[d,t]),V=He(async($,q)=>{if(!t)throw new Error("User is not allowed to change drive availability");return d($,Jn.setSharingType({type:q}))},[d,t]),T=He(async($,q)=>{if(q!==Lb){if(!s)throw new Error("Reactor is not loaded");try{const j=s.getSyncStatus($);return j instanceof rR?"INITIAL_SYNC":j}catch(j){return console.error(j),R3}}},[s]),L=He($=>{if(!s)throw new Error("Reactor is not loaded");return s.on("strandUpdate",$)},[s]),S=He($=>{if(!s)throw new Error("Reactor is not loaded");return s.on("syncStatus",$)},[s]),C=He(async()=>{s&&(await s.clearStorage(),await c())},[c,s]),N=He(async($,q)=>{const j=await d($,Jn.removeTrigger({triggerId:q}));if(j==null?void 0:j.state.local.triggers.find(X=>X.id===q))throw new Error(`There was an error removing trigger ${q}`)},[d]),U=He(async($,q,j)=>{if(!s)throw new Error("Reactor is not loaded");return await s.registerPullResponderTrigger($,q,j)},[s]),K=He(async($,q)=>{const j=await d($,Jn.addTrigger({trigger:q}));if(!(j==null?void 0:j.state.local.triggers.find(X=>X.id===X.id)))throw new Error(`There was an error adding the trigger ${q.id}`)},[d]);return Pn(()=>({documentDrives:a,documentDrivesStatus:u,addDocument:f,openFile:l,addFile:m,updateFile:p,addFolder:g,deleteNode:y,renameNode:v,moveNode:b,copyNode:E,addOperation:w,addOperations:h,addDrive:x,addRemoteDrive:_,deleteDrive:k,renameDrive:R,setDriveAvailableOffline:F,setDriveSharingType:V,getSyncStatus:T,onStrandUpdate:L,onSyncStatus:S,clearStorage:C,removeTrigger:N,addTrigger:K,registerNewPullResponderTrigger:U}),[f,x,m,g,w,h,_,K,C,E,k,y,a,u,T,b,L,S,l,U,N,R,v,F,V,p])}function Gte(t){return t.replaceAll(/\s/g,"-")}const Zte=t=>{const{open:e,onClose:n,selectedParentNode:r,setSelectedNode:i,documentModel:s}=t,{addDocument:o}=_0();return P(T4,{open:e,onContinue:async c=>{if(n(),!r)throw new Error("No drive or folder selected");const u=await o(r.driveId,c||`New ${s.documentModel.name}`,s.documentModel.id,r.id);u&&i({...u,slug:Gte(u.name),kind:qc,documentType:u.documentType,parentFolder:r.id,driveId:r.driveId,syncStatus:r.syncStatus,synchronizationUnits:[],sharingType:r.sharingType})},onOpenChange:c=>{if(!c)return n()}})},Yte=gn(Ns);function w0(){return Ni(Yte)}let Dh;const Kte=new Uint8Array(16);function Jte(){if(!Dh&&(Dh=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Dh))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Dh(Kte)}const Yn=[];for(let t=0;t<256;++t)Yn.push((t+256).toString(16).slice(1));function Xte(t,e=0){return Yn[t[e+0]]+Yn[t[e+1]]+Yn[t[e+2]]+Yn[t[e+3]]+"-"+Yn[t[e+4]]+Yn[t[e+5]]+"-"+Yn[t[e+6]]+Yn[t[e+7]]+"-"+Yn[t[e+8]]+Yn[t[e+9]]+"-"+Yn[t[e+10]]+Yn[t[e+11]]+Yn[t[e+12]]+Yn[t[e+13]]+Yn[t[e+14]]+Yn[t[e+15]]}const Qte=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),pT={randomUUID:Qte};function mT(t,e,n){if(pT.randomUUID&&!t)return pT.randomUUID();t=t||{};const r=t.random||(t.rng||Jte)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Xte(r)}const ene=t=>{var V;const[e]=w0(),{open:n,onClose:r}=t,i=localStorage.getItem("AUTO_REGISTER_PULL_RESPONDER")!=="false";console.log("autoRegisterPullResponder",i);const[s,o]=We(e.appVersion),[a,c]=We({label:Bf.debug?"Enabled":"Disabled",value:Bf.debug}),[u,l]=We(),[d,f]=We(null),[h,m]=We(""),[p,g]=We({label:i?"Enabled":"Disabled",value:i?"true":"false"}),{documentDrives:y,removeTrigger:v,addTrigger:b,registerNewPullResponderTrigger:E}=_0();Dt(()=>{Bf.setDebug(a.value)},[a]),console.log("documentDrives",y),console.log("selectedDrive",u);const w=((V=y.find(T=>T.state.global.id===u))==null?void 0:V.state.local.triggers)||[],_=!u||h==="",k=async()=>{!d||!u||(await v(u,d.value),f(null))},R=async(T=!1)=>{if(!(!h||h===""||!u)){if(!T){const L=await E(u,h,{pullInterval:3e3});await b(u,L),m("");return}await b(u,{id:`invalid-trigger-${mT()}`,type:"PullResponder",data:{interval:"3000",listenerId:`ivalid-listener-${mT()}`,url:h}}),m("")}},F=T=>{g(T),localStorage.setItem("AUTO_REGISTER_PULL_RESPONDER",T.value)};return P(Xs,{open:n,onOpenChange:T=>{if(!T)return r()},contentProps:{className:"rounded-2xl"},children:we("div",{className:"w-[700px] rounded-2xl p-6",children:[we("div",{className:"mb-6 flex justify-between",children:[P("div",{className:"text-xl font-bold",children:"Debug Tools"}),P("button",{id:"close-modal",onClick:()=>r(),children:P(vt,{name:"Xmark",size:28})})]}),we("div",{className:"flex text-sm font-bold",children:[P(vt,{name:"Ring",size:22}),we("span",{className:"ml-2",children:["App Version: ",e.appVersion]})]}),we("div",{className:"mt-4 flex text-sm font-bold",children:[P(vt,{name:"Hdd",size:22}),P("span",{className:"ml-2",children:"Drive Tools:"})]}),we("div",{children:[P("label",{htmlFor:"selectedDrive",className:"text-xs",children:"Selected Drive:"}),P(_l,{id:"selectedDrive",onChange:T=>{if(!T||typeof T!="object"||!("value"in T)){l(void 0),f(null);return}l(T.value),f(null)},options:y.map(T=>({label:T.state.global.name,value:T.state.global.id}))})]}),P("div",{className:"mt-2 flex items-end justify-between pl-4",children:we("div",{className:"w-[400px]",children:[P("label",{htmlFor:"autoRegisterPullResponder",className:"text-xs",children:"Auto register pull responder:"}),P(_l,{id:"autoRegisterPullResponder",onChange:T=>{F(T)},value:p,options:[{label:"Enabled",value:"true"},{label:"Disabled",value:"false"}]})]})}),we("div",{className:"mt-2 flex items-end justify-between pl-4",children:[we("div",{className:"w-[400px]",children:[P("label",{htmlFor:"driveTrigger",className:"text-xs",children:"Drive trigger:"}),P(_l,{id:"driveTrigger",onChange:T=>{f(T)},value:d,options:w.map(T=>({label:`${T.id} - ${T.type}`,value:T.id}))})]}),P("div",{children:P(zn,{onClick:k,color:d?"red":"light",disabled:!d,size:"small",children:"Remove Trigger"})})]}),we("div",{className:"mt-2 flex items-end justify-between pl-4",children:[we("div",{className:"w-[400px]",children:[P("label",{htmlFor:"driveUrl",className:"text-xs",children:"Add drive trigger:"}),P(Aa,{containerClassName:"p-1 bg-white border border-gray-200 rounded-md text-sm",inputClassName:"text-xs font-normal",id:"driveUrl",icon:P("div",{className:"flex h-full items-center text-xs",children:"URL:"}),value:h,onChange:T=>m(T.target.value)})]}),we("div",{className:"mb-1 flex items-center justify-center",children:[P(zn,{className:"mr-2",color:_?"light":"blue",size:"small",disabled:_,onClick:()=>R(),children:"Add Trigger"}),P(zn,{color:_?"light":"red",size:"small",disabled:_,onClick:()=>R(!0),children:"Add Invalid Trigger"})]})]}),we("div",{className:"mt-4 flex text-sm font-bold",children:[P(vt,{name:"Gear",size:22}),P("span",{className:"ml-2",children:"Service Worker Tools:"})]}),P("div",{className:"mt-2 flex items-end justify-between pl-4",children:we("div",{className:"w-[400px]",children:[P("label",{htmlFor:"serviceWorkerDebugMode",className:"text-xs",children:"Service Worker Debug Mode:"}),P(_l,{id:"serviceWorkerDebugMode",onChange:T=>{c(T)},value:a,options:[{label:"Enabled",value:!0},{label:"Disabled",value:!1}]})]})}),we("div",{className:"mt-2 flex items-end justify-between pl-4",children:[we("div",{className:"w-[400px]",children:[P("label",{htmlFor:"appVersion",className:"text-xs",children:"Set invalid app version:"}),P(Aa,{containerClassName:"p-1 bg-white border border-gray-200 rounded-md text-sm",inputClassName:"text-xs font-normal",id:"appVersion",icon:P("div",{className:"flex h-full items-center text-xs",children:"Version:"}),value:s,onChange:T=>o(T.target.value)})]}),P("div",{className:"mb-1 flex items-center justify-center",children:P(zn,{color:s===""?"light":"red",size:"small",disabled:s==="",onClick:()=>{Bf.sendMessage({type:"SET_APP_VERSION",version:s}),o("")},children:"Add Invalid App Version"})})]})]})})},tne=t=>{const{open:e,onClose:n,uiDriveNode:r,onDelete:i}=t,{t:s}=tc();return P(I4,{open:e,driveName:r.name,onCancel:n,header:s("modals.deleteDrive.title",{label:r.name}),body:s("modals.deleteDrive.body"),inputPlaceholder:s("modals.deleteDrive.inputPlaceholder"),cancelLabel:s("common.cancel"),continueLabel:s("common.delete"),onContinue:()=>i(n),onOpenChange:o=>{if(!o)return n()}})},nne=t=>{const{t:e}=tc(),{uiNode:n,open:r,onClose:i,onDelete:s}=t,{kind:o,name:a}=n;return P(O4,{open:r,onDelete:()=>s(i),onCancel:()=>i(),header:e(`modals.deleteItem.${o.toLowerCase()}.header`,{item:a}),body:e(`modals.deleteItem.${o.toLowerCase()}.body`),cancelLabel:e("common.cancel"),deleteLabel:e("common.delete")})},rne=t=>{const{open:e,onClose:n}=t,{t:r}=tc();return P(EO,{open:e,header:r("modals.disclaimer.title"),body:r("modals.disclaimer.body"),closeLabel:"Close",onContinue:()=>n()})};function ine(t){const{uiDriveNode:e,open:n,onRenameDrive:r,onDeleteDrive:i,onChangeAvailableOffline:s,onChangeSharingType:o,onClose:a}=t;return P(C4,{uiDriveNode:e,open:n,onRenameDrive:r,onDeleteDrive:i,onChangeAvailableOffline:s,onChangeSharingType:o,onOpenChange:c=>{if(!c)return a()}})}async function sne(t){const e=await g0();e?e.send("studio:add-external-package",{name:t}):console.error("HMR not available.")}async function one(){const t=await g0();t&&t.on("studio:external-package-added",e=>{console.log("External package added:",e)})}one().catch(console.error);function ane(){const[t,e]=We(""),n=ote();return we("div",{children:[we("label",{htmlFor:"add-external-package",className:"bg-gray-50 text-sm",children:["Add External Package:",P("input",{className:"border border-slate-50",name:"add-external-package",value:t,onChange:r=>e(r.target.value)})]}),P("button",{onClick:()=>sne(t),children:"Add"}),P("ul",{children:n.map((r,i)=>P("li",{children:r.documentModels.map(s=>s.documentModel.id).join(", ")},i))})]})}const cne="defaultDocumentModelEditor",une=Ef(cne,{label:"V2",value:"document-model-editor-v2"}),lne=()=>Ni(une),dne=t=>Y.createElement("svg",{width:126,height:24,viewBox:"0 0 126 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},Y.createElement("g",{id:"Group 1000003373"},Y.createElement("path",{id:"Vector",d:"M11.8372 0.488748C10.2978 5.70206 6.19289 9.81182 0.98589 11.3469C0.332828 11.5409 0.332828 12.4591 0.98589 12.6531C6.18997 14.1882 10.2978 18.2979 11.8372 23.5113C12.0296 24.1629 12.9597 24.1629 13.155 23.5113C14.6943 18.2979 18.7993 14.1882 24.0063 12.6531C24.6594 12.4591 24.6594 11.5409 24.0063 11.3469C18.8022 9.81182 14.6943 5.70206 13.155 0.488748C12.9626 -0.162916 12.0325 -0.162916 11.8372 0.488748Z",fill:"inherit"}),Y.createElement("g",{id:"Renown"},Y.createElement("path",{d:"M42.6238 2.65186C44.3678 2.65186 45.6958 3.05186 46.6078 3.85186C47.5198 4.63586 47.9758 5.65985 47.9758 6.92385C47.9758 7.29185 47.9438 7.63586 47.8798 7.95586C47.6878 9.07586 47.1998 10.0759 46.4158 10.9559C45.6318 11.8359 44.5838 12.4599 43.2718 12.8279L45.9838 19.4999H41.3518L38.9758 13.1399H37.9918L36.8638 19.4999H32.7598L35.7358 2.65186H42.6238ZM43.6798 8.12385C43.7118 7.86786 43.7278 7.69986 43.7278 7.61985C43.7278 7.10786 43.5598 6.71586 43.2238 6.44386C42.9038 6.15586 42.4238 6.01186 41.7838 6.01186H39.2398L38.4958 10.2359H41.0398C41.7918 10.2359 42.3838 10.0519 42.8158 9.68386C43.2638 9.31586 43.5518 8.79586 43.6798 8.12385Z",fill:"inherit"}),Y.createElement("path",{d:"M55.808 5.91585C57.536 5.91585 58.904 6.38785 59.912 7.33185C60.936 8.25985 61.448 9.53186 61.448 11.1479C61.448 11.6759 61.408 12.1479 61.328 12.5639C61.264 12.9319 61.168 13.3239 61.04 13.7399H51.752C51.736 13.8359 51.728 13.9879 51.728 14.1959C51.728 14.8999 51.92 15.4359 52.304 15.8039C52.688 16.1719 53.2 16.3559 53.84 16.3559C54.864 16.3559 55.648 15.9239 56.192 15.0599H60.56C59.984 16.4199 59.048 17.5319 57.752 18.3959C56.456 19.2599 55 19.6919 53.384 19.6919C51.656 19.6919 50.272 19.2119 49.232 18.2519C48.208 17.2919 47.696 15.9879 47.696 14.3399C47.696 13.8439 47.744 13.3319 47.84 12.8039C48.08 11.4119 48.576 10.1959 49.328 9.15586C50.08 8.11586 51.016 7.31586 52.136 6.75586C53.256 6.19586 54.48 5.91585 55.808 5.91585ZM57.296 11.6519C57.328 11.4279 57.344 11.2759 57.344 11.1959C57.344 10.5559 57.144 10.0679 56.744 9.73186C56.344 9.37986 55.816 9.20386 55.16 9.20386C54.456 9.20386 53.832 9.41986 53.288 9.85186C52.76 10.2679 52.376 10.8679 52.136 11.6519H57.296Z",fill:"inherit"}),Y.createElement("path",{d:"M71.8211 5.96386C73.1651 5.96386 74.2211 6.33986 74.9891 7.09186C75.7571 7.84385 76.1411 8.89186 76.1411 10.2359C76.1411 10.6839 76.0931 11.1639 75.9971 11.6759L74.6051 19.4999H70.5251L71.8211 12.2279C71.8691 11.9559 71.8931 11.7159 71.8931 11.5079C71.8931 10.8359 71.7011 10.3159 71.3171 9.94785C70.9491 9.57985 70.4291 9.39585 69.7571 9.39585C68.9571 9.39585 68.2851 9.64386 67.7411 10.1399C67.1971 10.6359 66.8451 11.3319 66.6851 12.2279V12.1079L65.3891 19.4999H61.2851L63.6371 6.10786H67.7411L67.4291 7.90786C67.9571 7.31586 68.5971 6.84385 69.3491 6.49185C70.1171 6.13986 70.9411 5.96386 71.8211 5.96386Z",fill:"inherit"}),Y.createElement("path",{d:"M82.617 19.6919C81.465 19.6919 80.441 19.4599 79.545 18.9959C78.649 18.5319 77.9529 17.8759 77.457 17.0279C76.977 16.1799 76.737 15.1959 76.737 14.0759C76.737 12.5559 77.097 11.1719 77.817 9.92386C78.537 8.67586 79.529 7.69986 80.793 6.99586C82.057 6.27586 83.465 5.91585 85.017 5.91585C86.169 5.91585 87.193 6.15586 88.089 6.63586C89.0009 7.09986 89.7049 7.75586 90.201 8.60386C90.697 9.45186 90.945 10.4359 90.945 11.5559C90.945 13.0919 90.577 14.4839 89.841 15.7319C89.121 16.9639 88.121 17.9319 86.841 18.6359C85.577 19.3399 84.169 19.6919 82.617 19.6919ZM83.193 16.1639C83.865 16.1639 84.465 15.9639 84.993 15.5639C85.5369 15.1479 85.9529 14.6199 86.241 13.9799C86.545 13.3239 86.697 12.6439 86.697 11.9399C86.697 11.1399 86.481 10.5239 86.049 10.0919C85.617 9.65985 85.073 9.44386 84.417 9.44386C83.729 9.44386 83.121 9.65186 82.593 10.0679C82.081 10.4679 81.681 10.9959 81.393 11.6519C81.105 12.3079 80.961 12.9959 80.961 13.7159C80.961 14.4999 81.169 15.1079 81.585 15.5399C82.001 15.9559 82.5369 16.1639 83.193 16.1639Z",fill:"inherit"}),Y.createElement("path",{d:"M112.418 6.10786L106.418 19.4999H101.882L101.306 10.8119L97.5862 19.4999H93.0742L91.8022 6.10786H95.9062L96.0982 15.6839L100.058 6.10786H104.402L105.002 15.6839L108.554 6.10786H112.418Z",fill:"inherit"}),Y.createElement("path",{d:"M121.183 5.96386C122.527 5.96386 123.583 6.33986 124.351 7.09186C125.119 7.84385 125.503 8.89186 125.503 10.2359C125.503 10.6839 125.455 11.1639 125.359 11.6759L123.967 19.4999H119.887L121.183 12.2279C121.231 11.9559 121.255 11.7159 121.255 11.5079C121.255 10.8359 121.063 10.3159 120.679 9.94785C120.311 9.57985 119.791 9.39585 119.119 9.39585C118.319 9.39585 117.647 9.64386 117.103 10.1399C116.559 10.6359 116.207 11.3319 116.047 12.2279V12.1079L114.751 19.4999H110.647L112.999 6.10786H117.103L116.791 7.90786C117.319 7.31586 117.959 6.84385 118.711 6.49185C119.479 6.13986 120.303 5.96386 121.183 5.96386Z",fill:"inherit"})))),fne=()=>{const[t,e]=We(0);return Dt(()=>{const n=setInterval(()=>{e(r=>r===3?0:r+1)},200);return()=>{clearInterval(n)}},[]),P("span",{children:new Array(t).fill(".").join("")})},hne=()=>{const t=Cg(),{openRenown:e,status:n}=b0();return P("div",{children:n==="checking"?we("h2",{className:"px-4 py-5 text-center text-xl font-medium",children:[P("span",{children:"Checking Authorization"}),P("span",{className:"inline-block w-5 text-left",children:P(fne,{})})]}):n!=="authorized"?we("div",{className:"flex flex-col items-center",children:[P("h2",{className:"mb-1 text-2xl font-semibold",children:"Log in with"}),P(dne,{className:"mb-3"}),P("p",{className:"mb-5 text-center text-lg leading-6",children:"Click on the button below to start signing messages in Connect on behalf of your Ethereum identity"}),P(zn,{onClick:()=>e(),className:"mb-3 w-full p-0 text-white shadow-none transition-colors",children:P("p",{className:"block h-10 px-7 leading-10 text-slate-50",children:"Authorize Connect"})})]}):we("p",{className:"p-4 pb-5",children:["Logged in with address: ",t==null?void 0:t.address]})})},gT=t=>t.map(e=>({label:e.documentModel.name,value:e.documentModel.id})),pne=t=>{const{open:e,onClose:n,onRefresh:r}=t,{clearStorage:i}=_0(),{t:s}=tc(),o=vte(),a=hte(),{setConfig:c}=UA(),{showModal:u}=GA(),[l]=w0(),[d,f]=lne(),[h,m]=We(gT(o)),{logout:p,status:g}=b0(),y=Cg(),v=()=>{c(E=>({...E,editors:{enabledEditors:h.map(w=>w.value)}})),n()},b=()=>{u("confirmationModal",{title:s("modals.connectSettings.clearStorage.confirmation.title"),body:s("modals.connectSettings.clearStorage.confirmation.body"),cancelLabel:s("common.cancel"),continueLabel:s("modals.connectSettings.clearStorage.confirmation.clearButton"),onContinue:()=>{i().then(()=>{r()}).catch(Hn.error)},onCancel:()=>u("settingsModal",{onRefresh:r})})};return we(nB,{open:e,title:s("modals.connectSettings.title"),body:s("modals.connectSettings.body"),cancelLabel:s("common.cancel"),saveLabel:s("common.save"),onSave:v,onOpenChange:E=>{if(!E)return n()},children:[P("div",{className:"rounded border border-gray-400 p-4",children:g==="authorized"?we(Us,{children:[we("p",{children:["Logged in with address:"," ",P("span",{className:"text-sm font-semibold",children:y==null?void 0:y.address})]}),P(zn,{className:"mt-2 w-full",onClick:p,children:"Logout"})]}):P(hne,{})}),P(ane,{}),l.content.showDocumentModelSelectionSetting&&P(tB,{selected:h,onChange:E=>m(E),options:gT(a),title:s("modals.connectSettings.enabledDocumentTypes.title"),description:s("modals.connectSettings.enabledDocumentTypes.description"),selectProps:{overrideStrings:{allItemsAreSelected:s("modals.connectSettings.enabledDocumentTypes.allSelected")}}}),P(D4,{onClearStorage:b,buttonLabel:s("modals.connectSettings.clearStorage.button"),description:s("modals.connectSettings.clearStorage.description")}),we("div",{children:[P("label",{htmlFor:"default-document-model-editor",className:"text-sm",children:"Default Document Model Editor:"}),P(_l,{id:"default-document-model-editor",value:d,onChange:E=>f(E),options:[{label:"V1",value:"document-model-editor"},{label:"V2",value:"document-model-editor-v2"}]})]}),P(N4,{packageJson:EP})]})},mne=t=>{const{open:e,onClose:n,driveId:r}=t,{t:i}=tc();return P(rB,{open:e,onContinue:()=>{console.log("Upgrade drive: ",r),n()},header:i("modals.upgradeDrive.header"),body:i("modals.upgradeDrive.body"),cancelLabel:i("common.cancel"),continueLabel:i("common.continue"),onOpenChange:o=>{if(!o)return n()}})},gne={deleteItem:nne,upgradeDrive:mne,createDocument:Zte,addLocalDrive:B9,addRemoteDrive:SH,driveSettings:ine,settingsModal:pne,confirmationModal:xH,deleteDriveModal:tne,debugSettingsModal:ene,disclaimerModal:rne,cookiesPolicy:TH},qA=$e.createContext({showModal:()=>{},closeModal:()=>{}}),GA=()=>Yo(qA),yne=t=>{const{children:e}=t,[n,r]=We(),[i,s]=We(),[o,a]=We(!1),c=He((f,h)=>{a(!0),r(h),s(f)},[]),u=He(()=>{a(!1)},[]),l=i?gne[i]:null,d=Pn(()=>({showModal:c,closeModal:u}),[u,c]);return we(qA.Provider,{value:d,children:[e,l&&P(l,{...n,open:o,onClose:u})]})},vne=(t,e)=>t.some(n=>n.id===e&&n.value),bne=()=>{const{t}=tc(),{showModal:e}=GA(),[n,r]=U9(),[,i]=Y_(),s=[{id:"analytics-cookie",label:t("cookieBanner.cookies.analytics"),value:!0}],o=c=>{r(!1),vne(c,"analytics-cookie")&&i(u=>({...u,analytics:!0}))},a=()=>{r(!1),i({analytics:!1,functional:!1,marketing:!1})};return n?we("div",{className:"absolute inset-0 z-[10000] backdrop-blur-sm",children:[P("div",{className:"absolute inset-0 bg-black opacity-15"}),P("div",{className:"absolute inset-x-0 bottom-0 flex justify-center bg-white px-10 pb-16 pt-10 shadow-lg",children:P(lj,{className:"max-w-[1024px] ",cookies:s,onSubmit:o,onReject:a,submitLabel:t("cookieBanner.accept"),rejectLabel:t("cookieBanner.reject"),children:P("p",{className:"font-semibold text-gray-500",children:P(YT,{i18nKey:"cookieBanner.message",components:{a:P("a",{onClick:()=>e("cookiesPolicy",{}),className:"cursor-pointer text-gray-900 hover:underline"})}})})})})]}):null};var _ne=Object.defineProperty,wne=Object.getOwnPropertyDescriptor,gs=(t,e,n,r)=>{for(var i=wne(e,n),s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=o(e,n,i)||i);return i&&_ne(e,n,i),i};function ys(t,e,n){const r=n.value;n.value=function(...i){if(!this.server)throw new Error("Read mode document drive not initialized.");return r.apply(this,i)}}function Ene(t){const e=Object.getPrototypeOf(t);Object.getOwnPropertyNames(e).forEach(r=>{const i=Object.getOwnPropertyDescriptor(e,r);i&&typeof i.value=="function"&&r!=="constructor"&&(t[r]=t[r].bind(t))})}class Fi{constructor(e){Ve(this,"server");Ene(this),this.server=e}getServer(){return this.server}setDocumentDrive(e){this.server=e}migrateReadDrive(e,n){return this.server.migrateReadDrive(e,n)}addReadDrive(e,n){return this.server.addReadDrive(e,n)}getReadDrives(){return this.server.getReadDrives()}getReadDriveBySlug(e){return this.server.getReadDriveBySlug(e)}getReadDrive(e){return this.server.getReadDrive(e)}getReadDriveContext(e){return this.server.getReadDriveContext(e)}fetchDrive(e){return this.server.fetchDrive(e)}fetchDocument(e,n,r){return this.server.fetchDocument(e,n,r)}deleteReadDrive(e){return this.server.deleteReadDrive(e)}onReadDrivesUpdate(e){return this.server.onReadDrivesUpdate(e)}}gs([ys],Fi.prototype,"migrateReadDrive");gs([ys],Fi.prototype,"addReadDrive");gs([ys],Fi.prototype,"getReadDrives");gs([ys],Fi.prototype,"getReadDriveBySlug");gs([ys],Fi.prototype,"getReadDrive");gs([ys],Fi.prototype,"getReadDriveContext");gs([ys],Fi.prototype,"fetchDrive");gs([ys],Fi.prototype,"fetchDocument");gs([ys],Fi.prototype,"deleteReadDrive");gs([ys],Fi.prototype,"onReadDrivesUpdate");const Mc=new Fi,ZA=Lu({...Mc,readDrives:[]});async function Sne(t){const e=await t.getReadDrives();return(await Promise.all(e.map(r=>t.getReadDrive(r)))).filter(r=>!(r instanceof ca))}const xne=t=>{const e=Ite(),[n,r]=We([]),i=WA(),[s,o]=We(!1);Dt(()=>{e&&(Mc.setDocumentDrive(e),o(!0))},[e]);const a=i===void 0?void 0:!(i.isAllowedToCreateDocuments||i.isAllowedToEditDocuments);Pn(()=>{if(!s||a===void 0)return;const u=a?"READ":"WRITE",l=Mc.getServer();l&&typeof l.setAllDefaultDrivesAccessLevel=="function"&&l.setAllDefaultDrivesAccessLevel(u).catch(Hn.error)},[a,s]),Dt(()=>{if(!s)return;Sne(Mc).then(l=>r(l)).catch(Hn.error);const u=Mc.onReadDrivesUpdate(l=>{r(d=>d.length!==l.length||vm(d)!==vm(l)?l:d)}).catch(Hn.error);return()=>{u.then(l=>l==null?void 0:l()).catch(Hn.error)}},[s]);const c=Pn(()=>({...Mc,readDrives:n}),[n]);return P(ZA.Provider,{...t,value:c})},Sse=()=>Yo(ZA);/**
430
- * @remix-run/router v1.22.0
431
- *
432
- * Copyright (c) Remix Software Inc.
433
- *
434
- * This source code is licensed under the MIT license found in the
435
- * LICENSE.md file in the root directory of this source tree.
436
- *
437
- * @license MIT
438
- */function pn(){return pn=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},pn.apply(this,arguments)}var hn;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(hn||(hn={}));const yT="popstate";function Tne(t){t===void 0&&(t={});let{initialEntries:e=["/"],initialIndex:n,v5Compat:r=!1}=t,i;i=e.map((h,m)=>l(h,typeof h=="string"?null:h.state,m===0?"default":void 0));let s=c(n??i.length-1),o=hn.Pop,a=null;function c(h){return Math.min(Math.max(h,0),i.length-1)}function u(){return i[s]}function l(h,m,p){m===void 0&&(m=null);let g=Mu(i?u().pathname:"/",h,m,p);return Ja(g.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(h)),g}function d(h){return typeof h=="string"?h:tl(h)}return{get index(){return s},get action(){return o},get location(){return u()},createHref:d,createURL(h){return new URL(d(h),"http://localhost")},encodeLocation(h){let m=typeof h=="string"?Qs(h):h;return{pathname:m.pathname||"",search:m.search||"",hash:m.hash||""}},push(h,m){o=hn.Push;let p=l(h,m);s+=1,i.splice(s,i.length,p),r&&a&&a({action:o,location:p,delta:1})},replace(h,m){o=hn.Replace;let p=l(h,m);i[s]=p,r&&a&&a({action:o,location:p,delta:0})},go(h){o=hn.Pop;let m=c(s+h),p=i[m];s=m,a&&a({action:o,location:p,delta:h})},listen(h){return a=h,()=>{a=null}}}}function xse(t){t===void 0&&(t={});function e(r,i){let{pathname:s,search:o,hash:a}=r.location;return Mu("",{pathname:s,search:o,hash:a},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:tl(i)}return One(e,n,null,t)}function kt(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Ja(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Ine(){return Math.random().toString(36).substr(2,8)}function vT(t,e){return{usr:t.state,key:t.key,idx:e}}function Mu(t,e,n,r){return n===void 0&&(n=null),pn({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Qs(e):e,{state:n,key:e&&e.key||r||Ine()})}function tl(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Qs(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function One(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,a=hn.Pop,c=null,u=l();u==null&&(u=0,o.replaceState(pn({},o.state,{idx:u}),""));function l(){return(o.state||{idx:null}).idx}function d(){a=hn.Pop;let g=l(),y=g==null?null:g-u;u=g,c&&c({action:a,location:p.location,delta:y})}function f(g,y){a=hn.Push;let v=Mu(p.location,g,y);u=l()+1;let b=vT(v,u),E=p.createHref(v);try{o.pushState(b,"",E)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;i.location.assign(E)}s&&c&&c({action:a,location:p.location,delta:1})}function h(g,y){a=hn.Replace;let v=Mu(p.location,g,y);u=l();let b=vT(v,u),E=p.createHref(v);o.replaceState(b,"",E),s&&c&&c({action:a,location:p.location,delta:0})}function m(g){let y=i.location.origin!=="null"?i.location.origin:i.location.href,v=typeof g=="string"?g:tl(g);return v=v.replace(/ $/,"%20"),kt(y,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,y)}let p={get action(){return a},get location(){return t(i,o)},listen(g){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(yT,d),c=g,()=>{i.removeEventListener(yT,d),c=null}},createHref(g){return e(i,g)},createURL:m,encodeLocation(g){let y=m(g);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:f,replace:h,go(g){return o.go(g)}};return p}var Kt;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(Kt||(Kt={}));const Cne=new Set(["lazy","caseSensitive","path","id","index","children"]);function kne(t){return t.index===!0}function bm(t,e,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),t.map((i,s)=>{let o=[...n,String(s)],a=typeof i.id=="string"?i.id:o.join("-");if(kt(i.index!==!0||!i.children,"Cannot specify children on an index route"),kt(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),kne(i)){let c=pn({},i,e(i),{id:a});return r[a]=c,c}else{let c=pn({},i,e(i),{id:a,children:void 0});return r[a]=c,i.children&&(c.children=bm(i.children,e,o,r)),c}})}function wo(t,e,n){return n===void 0&&(n="/"),ip(t,e,n,!1)}function ip(t,e,n,r){let i=typeof e=="string"?Qs(e):e,s=Ff(i.pathname||"/",n);if(s==null)return null;let o=YA(t);Rne(o);let a=null;for(let c=0;a==null&&c<o.length;++c){let u=zne(s);a=Une(o[c],u,r)}return a}function Dne(t,e){let{route:n,pathname:r,params:i}=t;return{id:n.id,pathname:r,params:i,data:e[n.id],handle:n.handle}}function YA(t,e,n,r){e===void 0&&(e=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(s,o,a)=>{let c={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};c.relativePath.startsWith("/")&&(kt(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=Po([r,c.relativePath]),l=n.concat(c);s.children&&s.children.length>0&&(kt(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),YA(s.children,e,l,u)),!(s.path==null&&!s.index)&&e.push({path:u,score:$ne(u,s.index),routesMeta:l})};return t.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let c of KA(s.path))i(s,o,c)}),e}function KA(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=KA(r.join("/")),a=[];return a.push(...o.map(c=>c===""?s:[s,c].join("/"))),i&&a.push(...o),a.map(c=>t.startsWith("/")&&c===""?"/":c)}function Rne(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:jne(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Nne=/^:[\w-]+$/,Ane=3,Pne=2,Mne=1,Lne=10,Fne=-2,bT=t=>t==="*";function $ne(t,e){let n=t.split("/"),r=n.length;return n.some(bT)&&(r+=Fne),e&&(r+=Pne),n.filter(i=>!bT(i)).reduce((i,s)=>i+(Nne.test(s)?Ane:s===""?Mne:Lne),r)}function jne(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function Une(t,e,n){n===void 0&&(n=!1);let{routesMeta:r}=t,i={},s="/",o=[];for(let a=0;a<r.length;++a){let c=r[a],u=a===r.length-1,l=s==="/"?e:e.slice(s.length)||"/",d=_T({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},l),f=c.route;if(!d&&u&&n&&!r[r.length-1].route.index&&(d=_T({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:Po([s,d.pathname]),pathnameBase:Wne(Po([s,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(s=Po([s,d.pathnameBase]))}return o}function _T(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=Bne(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((u,l,d)=>{let{paramName:f,isOptional:h}=l;if(f==="*"){let p=a[d]||"";o=s.slice(0,s.length-p.length).replace(/(.)\/+$/,"$1")}const m=a[d];return h&&!m?u[f]=void 0:u[f]=(m||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:o,pattern:t}}function Bne(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),Ja(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,c)=>(r.push({paramName:a,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function zne(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Ja(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function Ff(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function Vne(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?Qs(t):t;return{pathname:n?n.startsWith("/")?n:Hne(n,e):e,search:qne(r),hash:Gne(i)}}function Hne(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Wy(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function JA(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function XA(t,e){let n=JA(t);return e?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function QA(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=Qs(t):(i=pn({},t),kt(!i.pathname||!i.pathname.includes("?"),Wy("?","pathname","search",i)),kt(!i.pathname||!i.pathname.includes("#"),Wy("#","pathname","hash",i)),kt(!i.search||!i.search.includes("#"),Wy("#","search","hash",i)));let s=t===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=n;else{let d=e.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}a=d>=0?e[d]:"/"}let c=Vne(i,a),u=o&&o!=="/"&&o.endsWith("/"),l=(s||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||l)&&(c.pathname+="/"),c}const Po=t=>t.join("/").replace(/\/\/+/g,"/"),Wne=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),qne=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,Gne=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class Db{constructor(e,n,r,i){i===void 0&&(i=!1),this.status=e,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function af(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const eP=["post","put","patch","delete"],Zne=new Set(eP),Yne=["get",...eP],Kne=new Set(Yne),Jne=new Set([301,302,303,307,308]),Xne=new Set([307,308]),qy={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Qne={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},yl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},E0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ere=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),tP="remix-router-transitions";function tre(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",r=!n;kt(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(t.mapRouteProperties)i=t.mapRouteProperties;else if(t.detectErrorBoundary){let te=t.detectErrorBoundary;i=se=>({hasErrorBoundary:te(se)})}else i=ere;let s={},o=bm(t.routes,i,void 0,s),a,c=t.basename||"/",u=t.dataStrategy||sre,l=t.patchRoutesOnNavigation,d=pn({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},t.future),f=null,h=new Set,m=null,p=null,g=null,y=t.hydrationData!=null,v=wo(o,t.history.location,c),b=!1,E=null;if(v==null&&!l){let te=Sr(404,{pathname:t.history.location.pathname}),{matches:se,route:ue}=RT(o);v=se,E={[ue.id]:te}}v&&!t.hydrationData&&pc(v,o,t.history.location.pathname).active&&(v=null);let w;if(v)if(v.some(te=>te.route.lazy))w=!1;else if(!v.some(te=>te.route.loader))w=!0;else if(d.v7_partialHydration){let te=t.hydrationData?t.hydrationData.loaderData:null,se=t.hydrationData?t.hydrationData.errors:null;if(se){let ue=v.findIndex(_e=>se[_e.route.id]!==void 0);w=v.slice(0,ue+1).every(_e=>!Nb(_e.route,te,se))}else w=v.every(ue=>!Nb(ue.route,te,se))}else w=t.hydrationData!=null;else if(w=!1,v=[],d.v7_partialHydration){let te=pc(null,o,t.history.location.pathname);te.active&&te.matches&&(b=!0,v=te.matches)}let x,_={historyAction:t.history.action,location:t.history.location,matches:v,initialized:w,navigation:qy,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||E,fetchers:new Map,blockers:new Map},k=hn.Pop,R=!1,F,V=!1,T=new Map,L=null,S=!1,C=!1,N=[],U=new Set,K=new Map,$=0,q=-1,j=new Map,D=new Set,X=new Map,Z=new Map,z=new Set,le=new Map,pe=new Map,ve;function je(){if(f=t.history.listen(te=>{let{action:se,location:ue,delta:_e}=te;if(ve){ve(),ve=void 0;return}Ja(pe.size===0||_e!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Pe=Ar({currentLocation:_.location,nextLocation:ue,historyAction:se});if(Pe&&_e!=null){let Ke=new Promise(ft=>{ve=ft});t.history.go(_e*-1),to(Pe,{state:"blocked",location:ue,proceed(){to(Pe,{state:"proceeding",proceed:void 0,reset:void 0,location:ue}),Ke.then(()=>t.history.go(_e))},reset(){let ft=new Map(_.blockers);ft.set(Pe,yl),Ye({blockers:ft})}});return}return ae(se,ue)}),n){bre(e,T);let te=()=>_re(e,T);e.addEventListener("pagehide",te),L=()=>e.removeEventListener("pagehide",te)}return _.initialized||ae(hn.Pop,_.location,{initialHydration:!0}),x}function ct(){f&&f(),L&&L(),h.clear(),F&&F.abort(),_.fetchers.forEach((te,se)=>vn(se)),_.blockers.forEach((te,se)=>ea(se))}function ut(te){return h.add(te),()=>h.delete(te)}function Ye(te,se){se===void 0&&(se={}),_=pn({},_,te);let ue=[],_e=[];d.v7_fetcherPersist&&_.fetchers.forEach((Pe,Ke)=>{Pe.state==="idle"&&(z.has(Ke)?_e.push(Ke):ue.push(Ke))}),z.forEach(Pe=>{!_.fetchers.has(Pe)&&!K.has(Pe)&&_e.push(Pe)}),[...h].forEach(Pe=>Pe(_,{deletedFetchers:_e,viewTransitionOpts:se.viewTransitionOpts,flushSync:se.flushSync===!0})),d.v7_fetcherPersist?(ue.forEach(Pe=>_.fetchers.delete(Pe)),_e.forEach(Pe=>vn(Pe))):_e.forEach(Pe=>z.delete(Pe))}function Ot(te,se,ue){var _e,Pe;let{flushSync:Ke}=ue===void 0?{}:ue,ft=_.actionData!=null&&_.navigation.formMethod!=null&&gi(_.navigation.formMethod)&&_.navigation.state==="loading"&&((_e=te.state)==null?void 0:_e._isRedirect)!==!0,Ue;se.actionData?Object.keys(se.actionData).length>0?Ue=se.actionData:Ue=null:ft?Ue=_.actionData:Ue=null;let Be=se.loaderData?kT(_.loaderData,se.loaderData,se.matches||[],se.errors):_.loaderData,Fe=_.blockers;Fe.size>0&&(Fe=new Map(Fe),Fe.forEach((Nt,Mn)=>Fe.set(Mn,yl)));let Je=R===!0||_.navigation.formMethod!=null&&gi(_.navigation.formMethod)&&((Pe=te.state)==null?void 0:Pe._isRedirect)!==!0;a&&(o=a,a=void 0),S||k===hn.Pop||(k===hn.Push?t.history.push(te,te.state):k===hn.Replace&&t.history.replace(te,te.state));let St;if(k===hn.Pop){let Nt=T.get(_.location.pathname);Nt&&Nt.has(te.pathname)?St={currentLocation:_.location,nextLocation:te}:T.has(te.pathname)&&(St={currentLocation:te,nextLocation:_.location})}else if(V){let Nt=T.get(_.location.pathname);Nt?Nt.add(te.pathname):(Nt=new Set([te.pathname]),T.set(_.location.pathname,Nt)),St={currentLocation:_.location,nextLocation:te}}Ye(pn({},se,{actionData:Ue,loaderData:Be,historyAction:k,location:te,initialized:!0,navigation:qy,revalidation:"idle",restoreScrollPosition:jf(te,se.matches||_.matches),preventScrollReset:Je,blockers:Fe}),{viewTransitionOpts:St,flushSync:Ke===!0}),k=hn.Pop,R=!1,V=!1,S=!1,C=!1,N=[]}async function O(te,se){if(typeof te=="number"){t.history.go(te);return}let ue=Rb(_.location,_.matches,c,d.v7_prependBasename,te,d.v7_relativeSplatPath,se==null?void 0:se.fromRouteId,se==null?void 0:se.relative),{path:_e,submission:Pe,error:Ke}=wT(d.v7_normalizeFormMethod,!1,ue,se),ft=_.location,Ue=Mu(_.location,_e,se&&se.state);Ue=pn({},Ue,t.history.encodeLocation(Ue));let Be=se&&se.replace!=null?se.replace:void 0,Fe=hn.Push;Be===!0?Fe=hn.Replace:Be===!1||Pe!=null&&gi(Pe.formMethod)&&Pe.formAction===_.location.pathname+_.location.search&&(Fe=hn.Replace);let Je=se&&"preventScrollReset"in se?se.preventScrollReset===!0:void 0,St=(se&&se.flushSync)===!0,Nt=Ar({currentLocation:ft,nextLocation:Ue,historyAction:Fe});if(Nt){to(Nt,{state:"blocked",location:Ue,proceed(){to(Nt,{state:"proceeding",proceed:void 0,reset:void 0,location:Ue}),O(te,se)},reset(){let Mn=new Map(_.blockers);Mn.set(Nt,yl),Ye({blockers:Mn})}});return}return await ae(Fe,Ue,{submission:Pe,pendingError:Ke,preventScrollReset:Je,replace:se&&se.replace,enableViewTransition:se&&se.viewTransition,flushSync:St})}function he(){if(rt(),Ye({revalidation:"loading"}),_.navigation.state!=="submitting"){if(_.navigation.state==="idle"){ae(_.historyAction,_.location,{startUninterruptedRevalidation:!0});return}ae(k||_.historyAction,_.navigation.location,{overrideNavigation:_.navigation,enableViewTransition:V===!0})}}async function ae(te,se,ue){F&&F.abort(),F=null,k=te,S=(ue&&ue.startUninterruptedRevalidation)===!0,Ng(_.location,_.matches),R=(ue&&ue.preventScrollReset)===!0,V=(ue&&ue.enableViewTransition)===!0;let _e=a||o,Pe=ue&&ue.overrideNavigation,Ke=ue!=null&&ue.initialHydration&&_.matches&&_.matches.length>0&&!b?_.matches:wo(_e,se,c),ft=(ue&&ue.flushSync)===!0,Ue=pc(Ke,_e,se.pathname);if(Ue.active&&Ue.matches&&(Ke=Ue.matches),!Ke){let{error:en,notFoundMatches:Bt,route:dn}=no(se.pathname);Ot(se,{matches:Bt,loaderData:{},errors:{[dn.id]:en}},{flushSync:ft});return}if(_.initialized&&!C&&dre(_.location,se)&&!(ue&&ue.submission&&gi(ue.submission.formMethod))){Ot(se,{matches:Ke},{flushSync:ft});return}F=new AbortController;let Be=Cc(t.history,se,F.signal,ue&&ue.submission),Fe;if(ue&&ue.pendingError)Fe=[ua(Ke).route.id,{type:Kt.error,error:ue.pendingError}];else if(ue&&ue.submission&&gi(ue.submission.formMethod)){let en=await W(Be,se,ue.submission,Ke,Ue.active,{replace:ue.replace,flushSync:ft});if(en.shortCircuited)return;if(en.pendingActionResult){let[Bt,dn]=en.pendingActionResult;if(Pr(dn)&&af(dn.error)&&dn.error.status===404){F=null,Ot(se,{matches:en.matches,loaderData:{},errors:{[Bt]:dn.error}});return}}Ke=en.matches||Ke,Fe=en.pendingActionResult,Pe=Gy(se,ue.submission),ft=!1,Ue.active=!1,Be=Cc(t.history,Be.url,Be.signal)}let{shortCircuited:Je,matches:St,loaderData:Nt,errors:Mn}=await I(Be,se,Ke,Ue.active,Pe,ue&&ue.submission,ue&&ue.fetcherSubmission,ue&&ue.replace,ue&&ue.initialHydration===!0,ft,Fe);Je||(F=null,Ot(se,pn({matches:St||Ke},DT(Fe),{loaderData:Nt,errors:Mn})))}async function W(te,se,ue,_e,Pe,Ke){Ke===void 0&&(Ke={}),rt();let ft=yre(se,ue);if(Ye({navigation:ft},{flushSync:Ke.flushSync===!0}),Pe){let Fe=await mc(_e,se.pathname,te.signal);if(Fe.type==="aborted")return{shortCircuited:!0};if(Fe.type==="error"){let Je=ua(Fe.partialMatches).route.id;return{matches:Fe.partialMatches,pendingActionResult:[Je,{type:Kt.error,error:Fe.error}]}}else if(Fe.matches)_e=Fe.matches;else{let{notFoundMatches:Je,error:St,route:Nt}=no(se.pathname);return{matches:Je,pendingActionResult:[Nt.id,{type:Kt.error,error:St}]}}}let Ue,Be=Ml(_e,se);if(!Be.route.action&&!Be.route.lazy)Ue={type:Kt.error,error:Sr(405,{method:te.method,pathname:se.pathname,routeId:Be.route.id})};else if(Ue=(await fe("action",_,te,[Be],_e,null))[Be.route.id],te.signal.aborted)return{shortCircuited:!0};if(ya(Ue)){let Fe;return Ke&&Ke.replace!=null?Fe=Ke.replace:Fe=IT(Ue.response.headers.get("Location"),new URL(te.url),c)===_.location.pathname+_.location.search,await de(te,Ue,!0,{submission:ue,replace:Fe}),{shortCircuited:!0}}if(ko(Ue))throw Sr(400,{type:"defer-action"});if(Pr(Ue)){let Fe=ua(_e,Be.route.id);return(Ke&&Ke.replace)!==!0&&(k=hn.Push),{matches:_e,pendingActionResult:[Fe.route.id,Ue]}}return{matches:_e,pendingActionResult:[Be.route.id,Ue]}}async function I(te,se,ue,_e,Pe,Ke,ft,Ue,Be,Fe,Je){let St=Pe||Gy(se,Ke),Nt=Ke||ft||AT(St),Mn=!S&&(!d.v7_partialHydration||!Be);if(_e){if(Mn){let fn=A(Je);Ye(pn({navigation:St},fn!==void 0?{actionData:fn}:{}),{flushSync:Fe})}let Ft=await mc(ue,se.pathname,te.signal);if(Ft.type==="aborted")return{shortCircuited:!0};if(Ft.type==="error"){let fn=ua(Ft.partialMatches).route.id;return{matches:Ft.partialMatches,loaderData:{},errors:{[fn]:Ft.error}}}else if(Ft.matches)ue=Ft.matches;else{let{error:fn,notFoundMatches:$i,route:na}=no(se.pathname);return{matches:$i,loaderData:{},errors:{[na.id]:fn}}}}let en=a||o,[Bt,dn]=ST(t.history,_,ue,Nt,se,d.v7_partialHydration&&Be===!0,d.v7_skipActionErrorRevalidation,C,N,U,z,X,D,en,c,Je);if(ci(Ft=>!(ue&&ue.some(fn=>fn.route.id===Ft))||Bt&&Bt.some(fn=>fn.route.id===Ft)),q=++$,Bt.length===0&&dn.length===0){let Ft=ai();return Ot(se,pn({matches:ue,loaderData:{},errors:Je&&Pr(Je[1])?{[Je[0]]:Je[1].error}:null},DT(Je),Ft?{fetchers:new Map(_.fetchers)}:{}),{flushSync:Fe}),{shortCircuited:!0}}if(Mn){let Ft={};if(!_e){Ft.navigation=St;let fn=A(Je);fn!==void 0&&(Ft.actionData=fn)}dn.length>0&&(Ft.fetchers=G(dn)),Ye(Ft,{flushSync:Fe})}dn.forEach(Ft=>{Rt(Ft.key),Ft.controller&&K.set(Ft.key,Ft.controller)});let ro=()=>dn.forEach(Ft=>Rt(Ft.key));F&&F.signal.addEventListener("abort",ro);let{loaderResults:ta,fetcherResults:Yr}=await De(_,ue,Bt,dn,te);if(te.signal.aborted)return{shortCircuited:!0};F&&F.signal.removeEventListener("abort",ro),dn.forEach(Ft=>K.delete(Ft.key));let er=Rh(ta);if(er)return await de(te,er.result,!0,{replace:Ue}),{shortCircuited:!0};if(er=Rh(Yr),er)return D.add(er.key),await de(te,er.result,!0,{replace:Ue}),{shortCircuited:!0};let{loaderData:gc,errors:Kr}=CT(_,ue,ta,Je,dn,Yr,le);le.forEach((Ft,fn)=>{Ft.subscribe($i=>{($i||Ft.done)&&le.delete(fn)})}),d.v7_partialHydration&&Be&&_.errors&&(Kr=pn({},_.errors,Kr));let bs=ai(),_s=_r(q),io=bs||_s||dn.length>0;return pn({matches:ue,loaderData:gc,errors:Kr},io?{fetchers:new Map(_.fetchers)}:{})}function A(te){if(te&&!Pr(te[1]))return{[te[0]]:te[1].data};if(_.actionData)return Object.keys(_.actionData).length===0?null:_.actionData}function G(te){return te.forEach(se=>{let ue=_.fetchers.get(se.key),_e=vl(void 0,ue?ue.data:void 0);_.fetchers.set(se.key,_e)}),new Map(_.fetchers)}function Q(te,se,ue,_e){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Rt(te);let Pe=(_e&&_e.flushSync)===!0,Ke=a||o,ft=Rb(_.location,_.matches,c,d.v7_prependBasename,ue,d.v7_relativeSplatPath,se,_e==null?void 0:_e.relative),Ue=wo(Ke,ft,c),Be=pc(Ue,Ke,ft);if(Be.active&&Be.matches&&(Ue=Be.matches),!Ue){tn(te,se,Sr(404,{pathname:ft}),{flushSync:Pe});return}let{path:Fe,submission:Je,error:St}=wT(d.v7_normalizeFormMethod,!0,ft,_e);if(St){tn(te,se,St,{flushSync:Pe});return}let Nt=Ml(Ue,Fe),Mn=(_e&&_e.preventScrollReset)===!0;if(Je&&gi(Je.formMethod)){H(te,se,Fe,Nt,Ue,Be.active,Pe,Mn,Je);return}X.set(te,{routeId:se,path:Fe}),ee(te,se,Fe,Nt,Ue,Be.active,Pe,Mn,Je)}async function H(te,se,ue,_e,Pe,Ke,ft,Ue,Be){rt(),X.delete(te);function Fe(bn){if(!bn.route.action&&!bn.route.lazy){let M=Sr(405,{method:Be.formMethod,pathname:ue,routeId:se});return tn(te,se,M,{flushSync:ft}),!0}return!1}if(!Ke&&Fe(_e))return;let Je=_.fetchers.get(te);Xe(te,vre(Be,Je),{flushSync:ft});let St=new AbortController,Nt=Cc(t.history,ue,St.signal,Be);if(Ke){let bn=await mc(Pe,new URL(Nt.url).pathname,Nt.signal);if(bn.type==="aborted")return;if(bn.type==="error"){tn(te,se,bn.error,{flushSync:ft});return}else if(bn.matches){if(Pe=bn.matches,_e=Ml(Pe,ue),Fe(_e))return}else{tn(te,se,Sr(404,{pathname:ue}),{flushSync:ft});return}}K.set(te,St);let Mn=$,Bt=(await fe("action",_,Nt,[_e],Pe,te))[_e.route.id];if(Nt.signal.aborted){K.get(te)===St&&K.delete(te);return}if(d.v7_fetcherPersist&&z.has(te)){if(ya(Bt)||Pr(Bt)){Xe(te,ho(void 0));return}}else{if(ya(Bt))if(K.delete(te),q>Mn){Xe(te,ho(void 0));return}else return D.add(te),Xe(te,vl(Be)),de(Nt,Bt,!1,{fetcherSubmission:Be,preventScrollReset:Ue});if(Pr(Bt)){tn(te,se,Bt.error);return}}if(ko(Bt))throw Sr(400,{type:"defer-action"});let dn=_.navigation.location||_.location,ro=Cc(t.history,dn,St.signal),ta=a||o,Yr=_.navigation.state!=="idle"?wo(ta,_.navigation.location,c):_.matches;kt(Yr,"Didn't find any matches after fetcher action");let er=++$;j.set(te,er);let gc=vl(Be,Bt.data);_.fetchers.set(te,gc);let[Kr,bs]=ST(t.history,_,Yr,Be,dn,!1,d.v7_skipActionErrorRevalidation,C,N,U,z,X,D,ta,c,[_e.route.id,Bt]);bs.filter(bn=>bn.key!==te).forEach(bn=>{let M=bn.key,J=_.fetchers.get(M),B=vl(void 0,J?J.data:void 0);_.fetchers.set(M,B),Rt(M),bn.controller&&K.set(M,bn.controller)}),Ye({fetchers:new Map(_.fetchers)});let _s=()=>bs.forEach(bn=>Rt(bn.key));St.signal.addEventListener("abort",_s);let{loaderResults:io,fetcherResults:Ft}=await De(_,Yr,Kr,bs,ro);if(St.signal.aborted)return;St.signal.removeEventListener("abort",_s),j.delete(te),K.delete(te),bs.forEach(bn=>K.delete(bn.key));let fn=Rh(io);if(fn)return de(ro,fn.result,!1,{preventScrollReset:Ue});if(fn=Rh(Ft),fn)return D.add(fn.key),de(ro,fn.result,!1,{preventScrollReset:Ue});let{loaderData:$i,errors:na}=CT(_,Yr,io,void 0,bs,Ft,le);if(_.fetchers.has(te)){let bn=ho(Bt.data);_.fetchers.set(te,bn)}_r(er),_.navigation.state==="loading"&&er>q?(kt(k,"Expected pending action"),F&&F.abort(),Ot(_.navigation.location,{matches:Yr,loaderData:$i,errors:na,fetchers:new Map(_.fetchers)})):(Ye({errors:na,loaderData:kT(_.loaderData,$i,Yr,na),fetchers:new Map(_.fetchers)}),C=!1)}async function ee(te,se,ue,_e,Pe,Ke,ft,Ue,Be){let Fe=_.fetchers.get(te);Xe(te,vl(Be,Fe?Fe.data:void 0),{flushSync:ft});let Je=new AbortController,St=Cc(t.history,ue,Je.signal);if(Ke){let Bt=await mc(Pe,new URL(St.url).pathname,St.signal);if(Bt.type==="aborted")return;if(Bt.type==="error"){tn(te,se,Bt.error,{flushSync:ft});return}else if(Bt.matches)Pe=Bt.matches,_e=Ml(Pe,ue);else{tn(te,se,Sr(404,{pathname:ue}),{flushSync:ft});return}}K.set(te,Je);let Nt=$,en=(await fe("loader",_,St,[_e],Pe,te))[_e.route.id];if(ko(en)&&(en=await S0(en,St.signal,!0)||en),K.get(te)===Je&&K.delete(te),!St.signal.aborted){if(z.has(te)){Xe(te,ho(void 0));return}if(ya(en))if(q>Nt){Xe(te,ho(void 0));return}else{D.add(te),await de(St,en,!1,{preventScrollReset:Ue});return}if(Pr(en)){tn(te,se,en.error);return}kt(!ko(en),"Unhandled fetcher deferred data"),Xe(te,ho(en.data))}}async function de(te,se,ue,_e){let{submission:Pe,fetcherSubmission:Ke,preventScrollReset:ft,replace:Ue}=_e===void 0?{}:_e;se.response.headers.has("X-Remix-Revalidate")&&(C=!0);let Be=se.response.headers.get("Location");kt(Be,"Expected a Location header on the redirect Response"),Be=IT(Be,new URL(te.url),c);let Fe=Mu(_.location,Be,{_isRedirect:!0});if(n){let Bt=!1;if(se.response.headers.has("X-Remix-Reload-Document"))Bt=!0;else if(E0.test(Be)){const dn=t.history.createURL(Be);Bt=dn.origin!==e.location.origin||Ff(dn.pathname,c)==null}if(Bt){Ue?e.location.replace(Be):e.location.assign(Be);return}}F=null;let Je=Ue===!0||se.response.headers.has("X-Remix-Replace")?hn.Replace:hn.Push,{formMethod:St,formAction:Nt,formEncType:Mn}=_.navigation;!Pe&&!Ke&&St&&Nt&&Mn&&(Pe=AT(_.navigation));let en=Pe||Ke;if(Xne.has(se.response.status)&&en&&gi(en.formMethod))await ae(Je,Fe,{submission:pn({},en,{formAction:Be}),preventScrollReset:ft||R,enableViewTransition:ue?V:void 0});else{let Bt=Gy(Fe,Pe);await ae(Je,Fe,{overrideNavigation:Bt,fetcherSubmission:Ke,preventScrollReset:ft||R,enableViewTransition:ue?V:void 0})}}async function fe(te,se,ue,_e,Pe,Ke){let ft,Ue={};try{ft=await ore(u,te,se,ue,_e,Pe,Ke,s,i)}catch(Be){return _e.forEach(Fe=>{Ue[Fe.route.id]={type:Kt.error,error:Be}}),Ue}for(let[Be,Fe]of Object.entries(ft))if(fre(Fe)){let Je=Fe.result;Ue[Be]={type:Kt.redirect,response:ure(Je,ue,Be,Pe,c,d.v7_relativeSplatPath)}}else Ue[Be]=await cre(Fe);return Ue}async function De(te,se,ue,_e,Pe){let Ke=te.matches,ft=fe("loader",te,Pe,ue,se,null),Ue=Promise.all(_e.map(async Je=>{if(Je.matches&&Je.match&&Je.controller){let Nt=(await fe("loader",te,Cc(t.history,Je.path,Je.controller.signal),[Je.match],Je.matches,Je.key))[Je.match.route.id];return{[Je.key]:Nt}}else return Promise.resolve({[Je.key]:{type:Kt.error,error:Sr(404,{pathname:Je.path})}})})),Be=await ft,Fe=(await Ue).reduce((Je,St)=>Object.assign(Je,St),{});return await Promise.all([mre(se,Be,Pe.signal,Ke,te.loaderData),gre(se,Fe,_e)]),{loaderResults:Be,fetcherResults:Fe}}function rt(){C=!0,N.push(...ci()),X.forEach((te,se)=>{K.has(se)&&U.add(se),Rt(se)})}function Xe(te,se,ue){ue===void 0&&(ue={}),_.fetchers.set(te,se),Ye({fetchers:new Map(_.fetchers)},{flushSync:(ue&&ue.flushSync)===!0})}function tn(te,se,ue,_e){_e===void 0&&(_e={});let Pe=ua(_.matches,se);vn(te),Ye({errors:{[Pe.route.id]:ue},fetchers:new Map(_.fetchers)},{flushSync:(_e&&_e.flushSync)===!0})}function sr(te){return Z.set(te,(Z.get(te)||0)+1),z.has(te)&&z.delete(te),_.fetchers.get(te)||Qne}function vn(te){let se=_.fetchers.get(te);K.has(te)&&!(se&&se.state==="loading"&&j.has(te))&&Rt(te),X.delete(te),j.delete(te),D.delete(te),d.v7_fetcherPersist&&z.delete(te),U.delete(te),_.fetchers.delete(te)}function Zr(te){let se=(Z.get(te)||0)-1;se<=0?(Z.delete(te),z.add(te),d.v7_fetcherPersist||vn(te)):Z.set(te,se),Ye({fetchers:new Map(_.fetchers)})}function Rt(te){let se=K.get(te);se&&(se.abort(),K.delete(te))}function Nr(te){for(let se of te){let ue=sr(se),_e=ho(ue.data);_.fetchers.set(se,_e)}}function ai(){let te=[],se=!1;for(let ue of D){let _e=_.fetchers.get(ue);kt(_e,"Expected fetcher: "+ue),_e.state==="loading"&&(D.delete(ue),te.push(ue),se=!0)}return Nr(te),se}function _r(te){let se=[];for(let[ue,_e]of j)if(_e<te){let Pe=_.fetchers.get(ue);kt(Pe,"Expected fetcher: "+ue),Pe.state==="loading"&&(Rt(ue),j.delete(ue),se.push(ue))}return Nr(se),se.length>0}function eo(te,se){let ue=_.blockers.get(te)||yl;return pe.get(te)!==se&&pe.set(te,se),ue}function ea(te){_.blockers.delete(te),pe.delete(te)}function to(te,se){let ue=_.blockers.get(te)||yl;kt(ue.state==="unblocked"&&se.state==="blocked"||ue.state==="blocked"&&se.state==="blocked"||ue.state==="blocked"&&se.state==="proceeding"||ue.state==="blocked"&&se.state==="unblocked"||ue.state==="proceeding"&&se.state==="unblocked","Invalid blocker state transition: "+ue.state+" -> "+se.state);let _e=new Map(_.blockers);_e.set(te,se),Ye({blockers:_e})}function Ar(te){let{currentLocation:se,nextLocation:ue,historyAction:_e}=te;if(pe.size===0)return;pe.size>1&&Ja(!1,"A router only supports one blocker at a time");let Pe=Array.from(pe.entries()),[Ke,ft]=Pe[Pe.length-1],Ue=_.blockers.get(Ke);if(!(Ue&&Ue.state==="proceeding")&&ft({currentLocation:se,nextLocation:ue,historyAction:_e}))return Ke}function no(te){let se=Sr(404,{pathname:te}),ue=a||o,{matches:_e,route:Pe}=RT(ue);return ci(),{notFoundMatches:_e,route:Pe,error:se}}function ci(te){let se=[];return le.forEach((ue,_e)=>{(!te||te(_e))&&(ue.cancel(),se.push(_e),le.delete(_e))}),se}function vs(te,se,ue){if(m=te,g=se,p=ue||null,!y&&_.navigation===qy){y=!0;let _e=jf(_.location,_.matches);_e!=null&&Ye({restoreScrollPosition:_e})}return()=>{m=null,g=null,p=null}}function $f(te,se){return p&&p(te,se.map(_e=>Dne(_e,_.loaderData)))||te.key}function Ng(te,se){if(m&&g){let ue=$f(te,se);m[ue]=g()}}function jf(te,se){if(m){let ue=$f(te,se),_e=m[ue];if(typeof _e=="number")return _e}return null}function pc(te,se,ue){if(l)if(te){if(Object.keys(te[0].params).length>0)return{active:!0,matches:ip(se,ue,c,!0)}}else return{active:!0,matches:ip(se,ue,c,!0)||[]};return{active:!1,matches:null}}async function mc(te,se,ue){if(!l)return{type:"success",matches:te};let _e=te;for(;;){let Pe=a==null,Ke=a||o,ft=s;try{await l({signal:ue,path:se,matches:_e,patch:(Fe,Je)=>{ue.aborted||TT(Fe,Je,Ke,ft,i)}})}catch(Fe){return{type:"error",error:Fe,partialMatches:_e}}finally{Pe&&!ue.aborted&&(o=[...o])}if(ue.aborted)return{type:"aborted"};let Ue=wo(Ke,se,c);if(Ue)return{type:"success",matches:Ue};let Be=ip(Ke,se,c,!0);if(!Be||_e.length===Be.length&&_e.every((Fe,Je)=>Fe.route.id===Be[Je].route.id))return{type:"success",matches:null};_e=Be}}function Ag(te){s={},a=bm(te,i,void 0,s)}function Pg(te,se){let ue=a==null;TT(te,se,a||o,s,i),ue&&(o=[...o],Ye({}))}return x={get basename(){return c},get future(){return d},get state(){return _},get routes(){return o},get window(){return e},initialize:je,subscribe:ut,enableScrollRestoration:vs,navigate:O,fetch:Q,revalidate:he,createHref:te=>t.history.createHref(te),encodeLocation:te=>t.history.encodeLocation(te),getFetcher:sr,deleteFetcher:Zr,dispose:ct,getBlocker:eo,deleteBlocker:ea,patchRoutes:Pg,_internalFetchControllers:K,_internalActiveDeferreds:le,_internalSetRoutes:Ag},x}function nre(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function Rb(t,e,n,r,i,s,o,a){let c,u;if(o){c=[];for(let d of e)if(c.push(d),d.route.id===o){u=d;break}}else c=e,u=e[e.length-1];let l=QA(i||".",XA(c,s),Ff(t.pathname,n)||t.pathname,a==="path");if(i==null&&(l.search=t.search,l.hash=t.hash),(i==null||i===""||i===".")&&u){let d=x0(l.search);if(u.route.index&&!d)l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&d){let f=new URLSearchParams(l.search),h=f.getAll("index");f.delete("index"),h.filter(p=>p).forEach(p=>f.append("index",p));let m=f.toString();l.search=m?"?"+m:""}}return r&&n!=="/"&&(l.pathname=l.pathname==="/"?n:Po([n,l.pathname])),tl(l)}function wT(t,e,n,r){if(!r||!nre(r))return{path:n};if(r.formMethod&&!pre(r.formMethod))return{path:n,error:Sr(405,{method:r.formMethod})};let i=()=>({path:n,error:Sr(400,{type:"invalid-body"})}),s=r.formMethod||"get",o=t?s.toUpperCase():s.toLowerCase(),a=iP(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!gi(o))return i();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((h,m)=>{let[p,g]=m;return""+h+p+"="+g+`
439
- `},""):String(r.body);return{path:n,submission:{formMethod:o,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!gi(o))return i();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:o,formAction:a,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return i()}}}kt(typeof FormData=="function","FormData is not available in this environment");let c,u;if(r.formData)c=Ab(r.formData),u=r.formData;else if(r.body instanceof FormData)c=Ab(r.body),u=r.body;else if(r.body instanceof URLSearchParams)c=r.body,u=OT(c);else if(r.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(r.body),u=OT(c)}catch{return i()}let l={formMethod:o,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(gi(l.formMethod))return{path:n,submission:l};let d=Qs(n);return e&&d.search&&x0(d.search)&&c.append("index",""),d.search="?"+c,{path:tl(d),submission:l}}function ET(t,e,n){n===void 0&&(n=!1);let r=t.findIndex(i=>i.route.id===e);return r>=0?t.slice(0,n?r+1:r):t}function ST(t,e,n,r,i,s,o,a,c,u,l,d,f,h,m,p){let g=p?Pr(p[1])?p[1].error:p[1].data:void 0,y=t.createURL(e.location),v=t.createURL(i),b=n;s&&e.errors?b=ET(n,Object.keys(e.errors)[0],!0):p&&Pr(p[1])&&(b=ET(n,p[0]));let E=p?p[1].statusCode:void 0,w=o&&E&&E>=400,x=b.filter((k,R)=>{let{route:F}=k;if(F.lazy)return!0;if(F.loader==null)return!1;if(s)return Nb(F,e.loaderData,e.errors);if(rre(e.loaderData,e.matches[R],k)||c.some(L=>L===k.route.id))return!0;let V=e.matches[R],T=k;return xT(k,pn({currentUrl:y,currentParams:V.params,nextUrl:v,nextParams:T.params},r,{actionResult:g,actionStatus:E,defaultShouldRevalidate:w?!1:a||y.pathname+y.search===v.pathname+v.search||y.search!==v.search||nP(V,T)}))}),_=[];return d.forEach((k,R)=>{if(s||!n.some(S=>S.route.id===k.routeId)||l.has(R))return;let F=wo(h,k.path,m);if(!F){_.push({key:R,routeId:k.routeId,path:k.path,matches:null,match:null,controller:null});return}let V=e.fetchers.get(R),T=Ml(F,k.path),L=!1;f.has(R)?L=!1:u.has(R)?(u.delete(R),L=!0):V&&V.state!=="idle"&&V.data===void 0?L=a:L=xT(T,pn({currentUrl:y,currentParams:e.matches[e.matches.length-1].params,nextUrl:v,nextParams:n[n.length-1].params},r,{actionResult:g,actionStatus:E,defaultShouldRevalidate:w?!1:a})),L&&_.push({key:R,routeId:k.routeId,path:k.path,matches:F,match:T,controller:new AbortController})}),[x,_]}function Nb(t,e,n){if(t.lazy)return!0;if(!t.loader)return!1;let r=e!=null&&e[t.id]!==void 0,i=n!=null&&n[t.id]!==void 0;return!r&&i?!1:typeof t.loader=="function"&&t.loader.hydrate===!0?!0:!r&&!i}function rre(t,e,n){let r=!e||n.route.id!==e.route.id,i=t[n.route.id]===void 0;return r||i}function nP(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function xT(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}function TT(t,e,n,r,i){var s;let o;if(t){let u=r[t];kt(u,"No route found to patch children into: routeId = "+t),u.children||(u.children=[]),o=u.children}else o=n;let a=e.filter(u=>!o.some(l=>rP(u,l))),c=bm(a,i,[t||"_","patch",String(((s=o)==null?void 0:s.length)||"0")],r);o.push(...c)}function rP(t,e){return"id"in t&&"id"in e&&t.id===e.id?!0:t.index===e.index&&t.path===e.path&&t.caseSensitive===e.caseSensitive?(!t.children||t.children.length===0)&&(!e.children||e.children.length===0)?!0:t.children.every((n,r)=>{var i;return(i=e.children)==null?void 0:i.some(s=>rP(n,s))}):!1}async function ire(t,e,n){if(!t.lazy)return;let r=await t.lazy();if(!t.lazy)return;let i=n[t.id];kt(i,"No route found in manifest");let s={};for(let o in r){let c=i[o]!==void 0&&o!=="hasErrorBoundary";Ja(!c,'Route "'+i.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!c&&!Cne.has(o)&&(s[o]=r[o])}Object.assign(i,s),Object.assign(i,pn({},e(i),{lazy:void 0}))}async function sre(t){let{matches:e}=t,n=e.filter(i=>i.shouldLoad);return(await Promise.all(n.map(i=>i.resolve()))).reduce((i,s,o)=>Object.assign(i,{[n[o].route.id]:s}),{})}async function ore(t,e,n,r,i,s,o,a,c,u){let l=s.map(h=>h.route.lazy?ire(h.route,c,a):void 0),d=s.map((h,m)=>{let p=l[m],g=i.some(v=>v.route.id===h.route.id);return pn({},h,{shouldLoad:g,resolve:async v=>(v&&r.method==="GET"&&(h.route.lazy||h.route.loader)&&(g=!0),g?are(e,r,h,p,v,u):Promise.resolve({type:Kt.data,result:void 0}))})}),f=await t({matches:d,request:r,params:s[0].params,fetcherKey:o,context:u});try{await Promise.all(l)}catch{}return f}async function are(t,e,n,r,i,s){let o,a,c=u=>{let l,d=new Promise((m,p)=>l=p);a=()=>l(),e.signal.addEventListener("abort",a);let f=m=>typeof u!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+t+'" [routeId: '+n.route.id+"]"))):u({request:e,params:n.params,context:s},...m!==void 0?[m]:[]),h=(async()=>{try{return{type:"data",result:await(i?i(p=>f(p)):f())}}catch(m){return{type:"error",result:m}}})();return Promise.race([h,d])};try{let u=n.route[t];if(r)if(u){let l,[d]=await Promise.all([c(u).catch(f=>{l=f}),r]);if(l!==void 0)throw l;o=d}else if(await r,u=n.route[t],u)o=await c(u);else if(t==="action"){let l=new URL(e.url),d=l.pathname+l.search;throw Sr(405,{method:e.method,pathname:d,routeId:n.route.id})}else return{type:Kt.data,result:void 0};else if(u)o=await c(u);else{let l=new URL(e.url),d=l.pathname+l.search;throw Sr(404,{pathname:d})}kt(o.result!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(u){return{type:Kt.error,result:u}}finally{a&&e.signal.removeEventListener("abort",a)}return o}async function cre(t){let{result:e,type:n}=t;if(sP(e)){let d;try{let f=e.headers.get("Content-Type");f&&/\bapplication\/json\b/.test(f)?e.body==null?d=null:d=await e.json():d=await e.text()}catch(f){return{type:Kt.error,error:f}}return n===Kt.error?{type:Kt.error,error:new Db(e.status,e.statusText,d),statusCode:e.status,headers:e.headers}:{type:Kt.data,data:d,statusCode:e.status,headers:e.headers}}if(n===Kt.error){if(NT(e)){var r,i;if(e.data instanceof Error){var s,o;return{type:Kt.error,error:e.data,statusCode:(s=e.init)==null?void 0:s.status,headers:(o=e.init)!=null&&o.headers?new Headers(e.init.headers):void 0}}return{type:Kt.error,error:new Db(((r=e.init)==null?void 0:r.status)||500,void 0,e.data),statusCode:af(e)?e.status:void 0,headers:(i=e.init)!=null&&i.headers?new Headers(e.init.headers):void 0}}return{type:Kt.error,error:e,statusCode:af(e)?e.status:void 0}}if(hre(e)){var a,c;return{type:Kt.deferred,deferredData:e,statusCode:(a=e.init)==null?void 0:a.status,headers:((c=e.init)==null?void 0:c.headers)&&new Headers(e.init.headers)}}if(NT(e)){var u,l;return{type:Kt.data,data:e.data,statusCode:(u=e.init)==null?void 0:u.status,headers:(l=e.init)!=null&&l.headers?new Headers(e.init.headers):void 0}}return{type:Kt.data,data:e}}function ure(t,e,n,r,i,s){let o=t.headers.get("Location");if(kt(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!E0.test(o)){let a=r.slice(0,r.findIndex(c=>c.route.id===n)+1);o=Rb(new URL(e.url),a,i,!0,o,s),t.headers.set("Location",o)}return t}function IT(t,e,n){if(E0.test(t)){let r=t,i=r.startsWith("//")?new URL(e.protocol+r):new URL(r),s=Ff(i.pathname,n)!=null;if(i.origin===e.origin&&s)return i.pathname+i.search+i.hash}return t}function Cc(t,e,n,r){let i=t.createURL(iP(e)).toString(),s={signal:n};if(r&&gi(r.formMethod)){let{formMethod:o,formEncType:a}=r;s.method=o.toUpperCase(),a==="application/json"?(s.headers=new Headers({"Content-Type":a}),s.body=JSON.stringify(r.json)):a==="text/plain"?s.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?s.body=Ab(r.formData):s.body=r.formData}return new Request(i,s)}function Ab(t){let e=new URLSearchParams;for(let[n,r]of t.entries())e.append(n,typeof r=="string"?r:r.name);return e}function OT(t){let e=new FormData;for(let[n,r]of t.entries())e.append(n,r);return e}function lre(t,e,n,r,i){let s={},o=null,a,c=!1,u={},l=n&&Pr(n[1])?n[1].error:void 0;return t.forEach(d=>{if(!(d.route.id in e))return;let f=d.route.id,h=e[f];if(kt(!ya(h),"Cannot handle redirect results in processLoaderData"),Pr(h)){let m=h.error;l!==void 0&&(m=l,l=void 0),o=o||{};{let p=ua(t,f);o[p.route.id]==null&&(o[p.route.id]=m)}s[f]=void 0,c||(c=!0,a=af(h.error)?h.error.status:500),h.headers&&(u[f]=h.headers)}else ko(h)?(r.set(f,h.deferredData),s[f]=h.deferredData.data,h.statusCode!=null&&h.statusCode!==200&&!c&&(a=h.statusCode),h.headers&&(u[f]=h.headers)):(s[f]=h.data,h.statusCode&&h.statusCode!==200&&!c&&(a=h.statusCode),h.headers&&(u[f]=h.headers))}),l!==void 0&&n&&(o={[n[0]]:l},s[n[0]]=void 0),{loaderData:s,errors:o,statusCode:a||200,loaderHeaders:u}}function CT(t,e,n,r,i,s,o){let{loaderData:a,errors:c}=lre(e,n,r,o);return i.forEach(u=>{let{key:l,match:d,controller:f}=u,h=s[l];if(kt(h,"Did not find corresponding fetcher result"),!(f&&f.signal.aborted))if(Pr(h)){let m=ua(t.matches,d==null?void 0:d.route.id);c&&c[m.route.id]||(c=pn({},c,{[m.route.id]:h.error})),t.fetchers.delete(l)}else if(ya(h))kt(!1,"Unhandled fetcher revalidation redirect");else if(ko(h))kt(!1,"Unhandled fetcher deferred data");else{let m=ho(h.data);t.fetchers.set(l,m)}}),{loaderData:a,errors:c}}function kT(t,e,n,r){let i=pn({},e);for(let s of n){let o=s.route.id;if(e.hasOwnProperty(o)?e[o]!==void 0&&(i[o]=e[o]):t[o]!==void 0&&s.route.loader&&(i[o]=t[o]),r&&r.hasOwnProperty(o))break}return i}function DT(t){return t?Pr(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function ua(t,e){return(e?t.slice(0,t.findIndex(r=>r.route.id===e)+1):[...t]).reverse().find(r=>r.route.hasErrorBoundary===!0)||t[0]}function RT(t){let e=t.length===1?t[0]:t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function Sr(t,e){let{pathname:n,routeId:r,method:i,type:s,message:o}=e===void 0?{}:e,a="Unknown Server Error",c="Unknown @remix-run/router error";return t===400?(a="Bad Request",i&&n&&r?c="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":s==="defer-action"?c="defer() is not supported in actions":s==="invalid-body"&&(c="Unable to encode submission body")):t===403?(a="Forbidden",c='Route "'+r+'" does not match URL "'+n+'"'):t===404?(a="Not Found",c='No route matches URL "'+n+'"'):t===405&&(a="Method Not Allowed",i&&n&&r?c="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(c='Invalid request method "'+i.toUpperCase()+'"')),new Db(t||500,a,new Error(c),!0)}function Rh(t){let e=Object.entries(t);for(let n=e.length-1;n>=0;n--){let[r,i]=e[n];if(ya(i))return{key:r,result:i}}}function iP(t){let e=typeof t=="string"?Qs(t):t;return tl(pn({},e,{hash:""}))}function dre(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function fre(t){return sP(t.result)&&Jne.has(t.result.status)}function ko(t){return t.type===Kt.deferred}function Pr(t){return t.type===Kt.error}function ya(t){return(t&&t.type)===Kt.redirect}function NT(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function hre(t){let e=t;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function sP(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function pre(t){return Kne.has(t.toLowerCase())}function gi(t){return Zne.has(t.toLowerCase())}async function mre(t,e,n,r,i){let s=Object.entries(e);for(let o=0;o<s.length;o++){let[a,c]=s[o],u=t.find(f=>(f==null?void 0:f.route.id)===a);if(!u)continue;let l=r.find(f=>f.route.id===u.route.id),d=l!=null&&!nP(l,u)&&(i&&i[u.route.id])!==void 0;ko(c)&&d&&await S0(c,n,!1).then(f=>{f&&(e[a]=f)})}}async function gre(t,e,n){for(let r=0;r<n.length;r++){let{key:i,routeId:s,controller:o}=n[r],a=e[i];t.find(u=>(u==null?void 0:u.route.id)===s)&&ko(a)&&(kt(o,"Expected an AbortController for revalidating fetcher deferred result"),await S0(a,o.signal,!0).then(u=>{u&&(e[i]=u)}))}}async function S0(t,e,n){if(n===void 0&&(n=!1),!await t.deferredData.resolveData(e)){if(n)try{return{type:Kt.data,data:t.deferredData.unwrappedData}}catch(i){return{type:Kt.error,error:i}}return{type:Kt.data,data:t.deferredData.data}}}function x0(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function Ml(t,e){let n=typeof e=="string"?Qs(e).search:e.search;if(t[t.length-1].route.index&&x0(n||""))return t[t.length-1];let r=JA(t);return r[r.length-1]}function AT(t){let{formMethod:e,formAction:n,formEncType:r,text:i,formData:s,json:o}=t;if(!(!e||!n||!r)){if(i!=null)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(s!=null)return{formMethod:e,formAction:n,formEncType:r,formData:s,json:void 0,text:void 0};if(o!==void 0)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function Gy(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function yre(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function vl(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function vre(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function ho(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function bre(t,e){try{let n=t.sessionStorage.getItem(tP);if(n){let r=JSON.parse(n);for(let[i,s]of Object.entries(r||{}))s&&Array.isArray(s)&&e.set(i,new Set(s||[]))}}catch{}}function _re(t,e){if(e.size>0){let n={};for(let[r,i]of e)n[r]=[...i];try{t.sessionStorage.setItem(tP,JSON.stringify(n))}catch(r){Ja(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
440
- * React Router v6.29.0
441
- *
442
- * Copyright (c) Remix Software Inc.
443
- *
444
- * This source code is licensed under the MIT license found in the
445
- * LICENSE.md file in the root directory of this source tree.
446
- *
447
- * @license MIT
448
- */function cf(){return cf=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},cf.apply(this,arguments)}const T0=Y.createContext(null),wre=Y.createContext(null),kg=Y.createContext(null),Dg=Y.createContext(null),Qo=Y.createContext({outlet:null,matches:[],isDataRoute:!1}),oP=Y.createContext(null);function Rg(){return Y.useContext(Dg)!=null}function I0(){return Rg()||kt(!1),Y.useContext(Dg).location}function Ere(){return Y.useContext(Dg).navigationType}function aP(t){Y.useContext(kg).static||Y.useLayoutEffect(t)}function Tse(){let{isDataRoute:t}=Y.useContext(Qo);return t?Mre():Sre()}function Sre(){Rg()||kt(!1);let t=Y.useContext(T0),{basename:e,future:n,navigator:r}=Y.useContext(kg),{matches:i}=Y.useContext(Qo),{pathname:s}=I0(),o=JSON.stringify(XA(i,n.v7_relativeSplatPath)),a=Y.useRef(!1);return aP(()=>{a.current=!0}),Y.useCallback(function(u,l){if(l===void 0&&(l={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let d=QA(u,JSON.parse(o),s,l.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:Po([e,d.pathname])),(l.replace?r.replace:r.push)(d,l.state,l)},[e,r,o,s,t])}const xre=Y.createContext(null);function Tre(t){let e=Y.useContext(Qo).outlet;return e&&Y.createElement(xre.Provider,{value:t},e)}function Ise(){let{matches:t}=Y.useContext(Qo),e=t[t.length-1];return e?e.params:{}}function Ose(t,e,n,r){Rg()||kt(!1);let{navigator:i,static:s}=Y.useContext(kg),{matches:o}=Y.useContext(Qo),a=o[o.length-1],c=a?a.params:{};a&&a.pathname;let u=a?a.pathnameBase:"/";a&&a.route;let l=I0(),d;d=l;let f=d.pathname||"/",h=f;if(u!=="/"){let g=u.replace(/^\//,"").split("/");h="/"+f.replace(/^\//,"").split("/").slice(g.length).join("/")}let m=!s&&n&&n.matches&&n.matches.length>0?n.matches:wo(t,{pathname:h});return Dre(m&&m.map(g=>Object.assign({},g,{params:Object.assign({},c,g.params),pathname:Po([u,i.encodeLocation?i.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?u:Po([u,i.encodeLocation?i.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),o,n,r)}function Ire(){let t=Pre(),e=af(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return Y.createElement(Y.Fragment,null,Y.createElement("h2",null,"Unexpected Application Error!"),Y.createElement("h3",{style:{fontStyle:"italic"}},e),n?Y.createElement("pre",{style:i},n):null,null)}const Ore=Y.createElement(Ire,null);class Cre extends Y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?Y.createElement(Qo.Provider,{value:this.props.routeContext},Y.createElement(oP.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function kre(t){let{routeContext:e,match:n,children:r}=t,i=Y.useContext(T0);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),Y.createElement(Qo.Provider,{value:e},r)}function Dre(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var s;if(!n)return null;if(n.errors)t=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let o=t,a=(i=n)==null?void 0:i.errors;if(a!=null){let l=o.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);l>=0||kt(!1),o=o.slice(0,Math.min(o.length,l+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let l=0;l<o.length;l++){let d=o[l];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=l),d.route.id){let{loaderData:f,errors:h}=n,m=d.route.loader&&f[d.route.id]===void 0&&(!h||h[d.route.id]===void 0);if(d.route.lazy||m){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((l,d,f)=>{let h,m=!1,p=null,g=null;n&&(h=a&&d.route.id?a[d.route.id]:void 0,p=d.route.errorElement||Ore,c&&(u<0&&f===0?(m=!0,g=null):u===f&&(m=!0,g=d.route.hydrateFallbackElement||null)));let y=e.concat(o.slice(0,f+1)),v=()=>{let b;return h?b=p:m?b=g:d.route.Component?b=Y.createElement(d.route.Component,null):d.route.element?b=d.route.element:b=l,Y.createElement(kre,{match:d,routeContext:{outlet:l,matches:y,isDataRoute:n!=null},children:b})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?Y.createElement(Cre,{location:n.location,revalidation:n.revalidation,component:p,error:h,children:v(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):v()},null)}var cP=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(cP||{}),_m=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(_m||{});function Rre(t){let e=Y.useContext(T0);return e||kt(!1),e}function Nre(t){let e=Y.useContext(wre);return e||kt(!1),e}function Are(t){let e=Y.useContext(Qo);return e||kt(!1),e}function uP(t){let e=Are(),n=e.matches[e.matches.length-1];return n.route.id||kt(!1),n.route.id}function Pre(){var t;let e=Y.useContext(oP),n=Nre(_m.UseRouteError),r=uP(_m.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function Mre(){let{router:t}=Rre(cP.UseNavigateStable),e=uP(_m.UseNavigateStable),n=Y.useRef(!1);return aP(()=>{n.current=!0}),Y.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,cf({fromRouteId:e},s)))},[t,e])}function Cse(t,e){t==null||t.v7_startTransition,(t==null?void 0:t.v7_relativeSplatPath)===void 0&&(!e||e.v7_relativeSplatPath),e&&(e.v7_fetcherPersist,e.v7_normalizeFormMethod,e.v7_partialHydration,e.v7_skipActionErrorRevalidation)}function kse(t){return Tre(t.context)}function Lre(t){kt(!1)}function Dse(t){let{basename:e="/",children:n=null,location:r,navigationType:i=hn.Pop,navigator:s,static:o=!1,future:a}=t;Rg()&&kt(!1);let c=e.replace(/^\/*/,"/"),u=Y.useMemo(()=>({basename:c,navigator:s,static:o,future:cf({v7_relativeSplatPath:!1},a)}),[c,a,s,o]);typeof r=="string"&&(r=Qs(r));let{pathname:l="/",search:d="",hash:f="",state:h=null,key:m="default"}=r,p=Y.useMemo(()=>{let g=Ff(l,c);return g==null?null:{location:{pathname:g,search:d,hash:f,state:h,key:m},navigationType:i}},[c,l,d,f,h,m,i]);return p==null?null:Y.createElement(kg.Provider,{value:u},Y.createElement(Dg.Provider,{children:n,value:p}))}new Promise(()=>{});function Pb(t,e){e===void 0&&(e=[]);let n=[];return Y.Children.forEach(t,(r,i)=>{if(!Y.isValidElement(r))return;let s=[...e,i];if(r.type===Y.Fragment){n.push.apply(n,Pb(r.props.children,s));return}r.type!==Lre&&kt(!1),!r.props.index||!r.props.children||kt(!1);let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=Pb(r.props.children,s)),n.push(o)}),n}function Fre(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:Y.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(e,{hydrateFallbackElement:Y.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:Y.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}function Rse(t,e){return tre({basename:e==null?void 0:e.basename,future:cf({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:Tne({initialEntries:e==null?void 0:e.initialEntries,initialIndex:e==null?void 0:e.initialIndex}),hydrationData:e==null?void 0:e.hydrationData,routes:t,mapRouteProperties:Fre,dataStrategy:e==null?void 0:e.dataStrategy,patchRoutesOnNavigation:e==null?void 0:e.patchRoutesOnNavigation}).initialize()}function $re(){const[t]=Y_(),{analytics:e}=t;Dt(()=>{const n=Lt();if(!e){n&&n.close();return}if(n||!Ns.sentry.dsn||Ns.sentry.dsn==="")return;const r=window.__VITE_ENVS.SENTRY_RELEASE,i=[PA(),RA({depth:5}),xee(),kA({levels:["error"]})];Ns.sentry.tracing&&i.push(Hee({useEffect:$e.useEffect,useLocation:I0,useNavigationType:Ere,createRoutesFromChildren:Pb,matchRoutes:wo})),Vee({release:r,dsn:Ns.sentry.dsn,environment:Ns.sentry.env,integrations:i,ignoreErrors:["User is not allowed to create files","User is not allowed to move documents","The user aborted a request."],sendDefaultPii:!0,tracesSampleRate:1,replaysSessionSampleRate:.1,replaysOnErrorSampleRate:1,beforeSend(s,o){const a=o.originalException;return a instanceof TypeError&&a.message.includes("Failed to fetch")&&!navigator.onLine?null:s}})},[e])}const jre=({children:t})=>($re(),t);function PT(...t){var e;(e=window.dataLayer)==null||e.push(...t)}const Ure=()=>{const[{gaTrackingId:t}]=w0(),[{analytics:e}]=Y_(),n=t&&e;return Dt(()=>{if(n){const r=document.createElement("script");return r.src=`https://www.googletagmanager.com/gtag/js?id=${t}`,r.async=!0,document.head.appendChild(r),window.dataLayer=window.dataLayer||[],PT("js",new Date),PT("config",t),()=>{document.head.removeChild(r)}}},[n,t]),null},Bre=$e.lazy(async()=>({default:await(await Se(()=>import("./router-DX6s3TD2.js").then(n=>n.r),__vite__mapDeps([7,1,2,3]))).default()})),zre=()=>{for(const t of Object.values(tte))ac(t);return null},Vre=()=>P($e.StrictMode,{children:P(VT,{fallback:P(Us,{}),children:we(b9,{store:m0,children:[P(zre,{}),P(d9,{children:P(jre,{children:P(xne,{children:we(c9,{children:[P(o9,{position:"bottom-right"}),we(yne,{children:[P(Bre,{}),P(bne,{}),P(Ure,{})]})]})})})})]})})}),Nse=Object.freeze(Object.defineProperty({__proto__:null,default:Vre},Symbol.toStringTag,{value:"Module"}));export{FU as $,Tie as A,qn as B,U5 as C,T0 as D,Db as E,CE as F,iy as G,oU as H,IU as I,Sa as J,sd as K,_U as L,Z5 as M,E1 as N,xU as O,k1 as P,Sie as Q,Dse as R,Wm as S,Iie as T,Cie as U,wie as V,eh as W,PU as X,DU as Y,Bu as Z,yS as _,Tse as a,Ra as a$,zte as a0,Hn as a1,bie as a2,F5 as a3,q5 as a4,P5 as a5,_ie as a6,rc as a7,vie as a8,kie as a9,w0 as aA,Aie as aB,jie as aC,Pie as aD,R3 as aE,Ni as aF,GA as aG,b0 as aH,ete as aI,kse as aJ,Qre as aK,$M as aL,fie as aM,gj as aN,nc as aO,o_ as aP,aie as aQ,eie as aR,tie as aS,nie as aT,rie as aU,iie as aV,sie as aW,oie as aX,ps as aY,gp as aZ,H2 as a_,_1 as aa,gu as ab,C1 as ac,TU as ad,Vt as ae,die as af,qc as ag,Gf as ah,yie as ai,vt as aj,lie as ak,uie as al,r_ as am,i_ as an,zm as ao,s_ as ap,KI as aq,XI as ar,JI as as,QI as at,ff as au,tc as av,_0 as aw,Bte as ax,Sse as ay,Ite as az,wre as b,FC as b$,vj as b0,Do as b1,Qg as b2,Vm as b3,Jj as b4,Pj as b5,i1 as b6,n1 as b7,e1 as b8,m1 as b9,WA as bA,vte as bB,yte as bC,Gte as bD,zP as bE,Lie as bF,Nie as bG,Mie as bH,ti as bI,_j as bJ,E4 as bK,Xre as bL,X3 as bM,zn as bN,zt as bO,Z_ as bP,XC as bQ,Bie as bR,y0 as bS,lne as bT,ac as bU,Cg as bV,Cte as bW,v0 as bX,wse as bY,Qee as bZ,Fte as b_,Tj as ba,o1 as bb,A1 as bc,o3 as bd,qm as be,v3 as bf,d3 as bg,Die as bh,BE as bi,fi as bj,Gm as bk,u3 as bl,l3 as bm,j1 as bn,E3 as bo,h3 as bp,dr as bq,Rie as br,gn as bs,$te as bt,cie as bu,gie as bv,hie as bw,pie as bx,mie as by,Uie as bz,Ose as c,Lte as c0,U9 as c1,YT as c2,Ise as c3,Xt as c4,$C as c5,CC as c6,kC as c7,mC as c8,E8 as c9,Ov as ca,gC as cb,wf as cc,OC as cd,oc as ce,Dd as cf,Ese as cg,l_ as ch,Ll as ci,ge as cj,Nse as ck,tre as d,xse as e,Rse as f,Jre as g,ec as h,O1 as i,a_ as j,vU as k,Cse as l,Fre as m,V5 as n,Eie as o,w1 as p,b1 as q,yp as r,wU as s,W5 as t,I0 as u,xie as v,DE as w,S1 as x,K5 as y,aU as z};
449
- //# sourceMappingURL=app-DKrzRA2f.js.map