zudoku 0.1.1-dev.5 → 0.1.1-dev.51

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 (606) hide show
  1. package/dist/app/App.js +21 -42
  2. package/dist/app/App.js.map +1 -1
  3. package/dist/app/main.js +11 -15
  4. package/dist/app/main.js.map +1 -1
  5. package/dist/cli/build/handler.js +3 -1
  6. package/dist/cli/build/handler.js.map +1 -1
  7. package/dist/cli/cmds/dev.js +0 -1
  8. package/dist/cli/cmds/dev.js.map +1 -1
  9. package/dist/cli/common/analytics/lib.js +1 -1
  10. package/dist/cli/common/analytics/lib.js.map +1 -1
  11. package/dist/cli/common/logger.d.ts +1 -2
  12. package/dist/cli/common/logger.js +3 -3
  13. package/dist/cli/common/logger.js.map +1 -1
  14. package/dist/cli/common/outdated.js +4 -4
  15. package/dist/cli/common/outdated.js.map +1 -1
  16. package/dist/cli/common/output.js +4 -4
  17. package/dist/cli/common/output.js.map +1 -1
  18. package/dist/cli/common/utils/box.js +2 -2
  19. package/dist/cli/common/utils/box.js.map +1 -1
  20. package/dist/cli/dev/handler.d.ts +1 -1
  21. package/dist/cli/dev/handler.js +14 -3
  22. package/dist/cli/dev/handler.js.map +1 -1
  23. package/dist/config/config.d.ts +39 -9
  24. package/dist/config/validators/auth.d.ts +2 -0
  25. package/dist/config/validators/auth.js +2 -0
  26. package/dist/config/validators/auth.js.map +1 -0
  27. package/dist/config/validators/validate.d.ts +2 -0
  28. package/dist/config/validators/validate.js +4 -0
  29. package/dist/config/validators/validate.js.map +1 -0
  30. package/dist/index.d.ts +2 -6
  31. package/dist/index.js +1 -5
  32. package/dist/index.js.map +1 -1
  33. package/dist/lib/authentication/Callback.d.ts +4 -0
  34. package/dist/lib/authentication/Callback.js +20 -0
  35. package/dist/lib/authentication/Callback.js.map +1 -0
  36. package/dist/lib/authentication/auth0.d.ts +5 -0
  37. package/dist/lib/authentication/auth0.js +9 -0
  38. package/dist/lib/authentication/auth0.js.map +1 -0
  39. package/dist/lib/authentication/authentication.d.ts +10 -0
  40. package/dist/lib/authentication/authentication.js.map +1 -0
  41. package/dist/lib/authentication/clerk.d.ts +4 -0
  42. package/dist/{app → lib}/authentication/clerk.js +19 -9
  43. package/dist/lib/authentication/clerk.js.map +1 -0
  44. package/dist/lib/authentication/openid.d.ts +5 -0
  45. package/dist/lib/authentication/openid.js +136 -0
  46. package/dist/lib/authentication/openid.js.map +1 -0
  47. package/dist/{app → lib}/components/AnchorLink.js.map +1 -1
  48. package/dist/{app → lib}/components/CategoryHeading.js.map +1 -1
  49. package/dist/lib/components/DevPortal.d.ts +25 -0
  50. package/dist/lib/components/DevPortal.js +32 -0
  51. package/dist/lib/components/DevPortal.js.map +1 -0
  52. package/dist/{app → lib}/components/Dialog.d.ts +2 -2
  53. package/dist/{app → lib}/components/Dialog.js +3 -3
  54. package/dist/lib/components/Dialog.js.map +1 -0
  55. package/dist/lib/components/Header.d.ts +1 -0
  56. package/dist/lib/components/Header.js +15 -0
  57. package/dist/{app → lib}/components/Header.js.map +1 -1
  58. package/dist/{app → lib/components}/Heading.js +2 -2
  59. package/dist/lib/components/Heading.js.map +1 -0
  60. package/dist/{app → lib}/components/Input.js.map +1 -1
  61. package/dist/{app → lib}/components/Layout.js +4 -7
  62. package/dist/lib/components/Layout.js.map +1 -0
  63. package/dist/lib/components/Link.d.ts +1 -0
  64. package/dist/lib/components/Link.js +2 -0
  65. package/dist/lib/components/Link.js.map +1 -0
  66. package/dist/{app → lib}/components/Markdown.js.map +1 -1
  67. package/dist/lib/components/Router.d.ts +4 -0
  68. package/dist/lib/components/Router.js +20 -0
  69. package/dist/lib/components/Router.js.map +1 -0
  70. package/dist/lib/components/Select.d.ts +13 -0
  71. package/dist/lib/components/Select.js +27 -0
  72. package/dist/lib/components/Select.js.map +1 -0
  73. package/dist/lib/components/Spinner.d.ts +3 -0
  74. package/dist/lib/components/Spinner.js +4 -0
  75. package/dist/lib/components/Spinner.js.map +1 -0
  76. package/dist/{app → lib}/components/SyntaxHighlight.d.ts +2 -1
  77. package/dist/{app → lib}/components/SyntaxHighlight.js +4 -1
  78. package/dist/lib/components/SyntaxHighlight.js.map +1 -0
  79. package/dist/{app → lib}/components/TopNavigation.js.map +1 -1
  80. package/dist/{app → lib}/components/context/ComponentsContext.d.ts +1 -1
  81. package/dist/{app → lib}/components/context/ComponentsContext.js.map +1 -1
  82. package/dist/{app → lib}/components/context/DevPortalProvider.js +1 -1
  83. package/dist/lib/components/context/DevPortalProvider.js.map +1 -0
  84. package/dist/lib/components/context/PluginSystem.js.map +1 -0
  85. package/dist/{app → lib}/components/context/ThemeContext.js +1 -1
  86. package/dist/{app → lib}/components/context/ThemeContext.js.map +1 -1
  87. package/dist/{app → lib}/components/context/ViewportAnchorContext.js.map +1 -1
  88. package/dist/lib/components/index.d.ts +3 -0
  89. package/dist/lib/components/index.js +4 -0
  90. package/dist/lib/components/index.js.map +1 -0
  91. package/dist/{app → lib}/components/navigation/SideNavigation.js +1 -1
  92. package/dist/{app → lib}/components/navigation/SideNavigation.js.map +1 -1
  93. package/dist/{app → lib}/components/navigation/SideNavigationCategory.js +1 -1
  94. package/dist/{app → lib}/components/navigation/SideNavigationCategory.js.map +1 -1
  95. package/dist/{app → lib}/components/navigation/SideNavigationItem.d.ts +2 -1
  96. package/dist/{app → lib}/components/navigation/SideNavigationItem.js +12 -6
  97. package/dist/lib/components/navigation/SideNavigationItem.js.map +1 -0
  98. package/dist/{app → lib}/components/navigation/SideNavigationWrapper.d.ts +3 -0
  99. package/dist/lib/components/navigation/SideNavigationWrapper.js +7 -0
  100. package/dist/lib/components/navigation/SideNavigationWrapper.js.map +1 -0
  101. package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.js.map +1 -1
  102. package/dist/{app → lib}/components/navigation/util.js.map +1 -1
  103. package/dist/{app → lib}/core/DevPortalContext.d.ts +9 -13
  104. package/dist/{app → lib}/core/DevPortalContext.js +8 -8
  105. package/dist/lib/core/DevPortalContext.js.map +1 -0
  106. package/dist/{app → lib}/core/helmet.js.map +1 -1
  107. package/dist/lib/core/icons.js.map +1 -0
  108. package/dist/{app → lib}/core/plugins.d.ts +2 -7
  109. package/dist/{app → lib}/core/plugins.js +1 -1
  110. package/dist/{app → lib}/core/plugins.js.map +1 -1
  111. package/dist/lib/core/router.js.map +1 -0
  112. package/dist/{app → lib}/oas/graphql/index.js +2 -2
  113. package/dist/lib/oas/graphql/index.js.map +1 -0
  114. package/dist/{app → lib}/oas/parser/dereference/index.js.map +1 -1
  115. package/dist/{app → lib}/oas/parser/dereference/resolveRef.js.map +1 -1
  116. package/dist/{app → lib}/oas/parser/index.js.map +1 -1
  117. package/dist/{app → lib}/oas/parser/upgrade/index.js.map +1 -1
  118. package/dist/lib/plugins/api-key/CreateApiKey.d.ts +5 -0
  119. package/dist/lib/plugins/api-key/CreateApiKey.js +37 -0
  120. package/dist/lib/plugins/api-key/CreateApiKey.js.map +1 -0
  121. package/dist/lib/plugins/api-key/SettingsApiKeys.d.ts +5 -0
  122. package/dist/lib/plugins/api-key/SettingsApiKeys.js +38 -0
  123. package/dist/lib/plugins/api-key/SettingsApiKeys.js.map +1 -0
  124. package/dist/lib/plugins/api-key/index.d.ts +30 -0
  125. package/dist/lib/plugins/api-key/index.js +79 -0
  126. package/dist/lib/plugins/api-key/index.js.map +1 -0
  127. package/dist/lib/plugins/index.d.ts +4 -0
  128. package/dist/lib/plugins/index.js +5 -0
  129. package/dist/lib/plugins/index.js.map +1 -0
  130. package/dist/lib/plugins/markdown/MdxPage.d.ts +5 -0
  131. package/dist/lib/plugins/markdown/MdxPage.js +60 -0
  132. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -0
  133. package/dist/{app → lib}/plugins/markdown/Toc.js.map +1 -1
  134. package/dist/{app → lib}/plugins/markdown/generateRoutes.js +1 -6
  135. package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -0
  136. package/dist/{app → lib}/plugins/markdown/index.js.map +1 -1
  137. package/dist/{app → lib}/plugins/openapi/ColorizedParam.d.ts +1 -2
  138. package/dist/{app → lib}/plugins/openapi/ColorizedParam.js +2 -2
  139. package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -0
  140. package/dist/lib/plugins/openapi/MakeRequest.js +38 -0
  141. package/dist/lib/plugins/openapi/MakeRequest.js.map +1 -0
  142. package/dist/{app → lib}/plugins/openapi/MethodBadge.js.map +1 -1
  143. package/dist/{app → lib}/plugins/openapi/OperationList.js +12 -3
  144. package/dist/lib/plugins/openapi/OperationList.js.map +1 -0
  145. package/dist/lib/plugins/openapi/OperationListItem.js +18 -0
  146. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -0
  147. package/dist/{app → lib}/plugins/openapi/ParameterList.js +1 -1
  148. package/dist/{app → lib}/plugins/openapi/ParameterList.js.map +1 -1
  149. package/dist/lib/plugins/openapi/ParameterListItem.js +13 -0
  150. package/dist/{app → lib}/plugins/openapi/ParameterListItem.js.map +1 -1
  151. package/dist/{app → lib}/plugins/openapi/RequestBodySidecarBox.js +1 -1
  152. package/dist/{app → lib}/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  153. package/dist/{app → lib}/plugins/openapi/ResponsesSidecarBox.js +3 -3
  154. package/dist/{app → lib}/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  155. package/dist/lib/plugins/openapi/SchemaListView.d.ts +7 -0
  156. package/dist/lib/plugins/openapi/SchemaListView.js +43 -0
  157. package/dist/lib/plugins/openapi/SchemaListView.js.map +1 -0
  158. package/dist/{app → lib}/plugins/openapi/Select.js.map +1 -1
  159. package/dist/{app → lib}/plugins/openapi/Sidecar.js +15 -15
  160. package/dist/{app → lib}/plugins/openapi/Sidecar.js.map +1 -1
  161. package/dist/{app → lib}/plugins/openapi/SidecarBox.js.map +1 -1
  162. package/dist/{app → lib}/plugins/openapi/graphql/fragment-masking.d.ts +1 -1
  163. package/dist/{app → lib}/plugins/openapi/graphql/fragment-masking.js.map +1 -1
  164. package/dist/{app → lib}/plugins/openapi/graphql/gql.d.ts +5 -5
  165. package/dist/{app → lib}/plugins/openapi/graphql/gql.js +2 -3
  166. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -0
  167. package/dist/{app → lib}/plugins/openapi/graphql/graphql.d.ts +9 -0
  168. package/dist/{app → lib}/plugins/openapi/graphql/graphql.js +50 -0
  169. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -0
  170. package/dist/lib/plugins/openapi/graphql/index.js.map +1 -0
  171. package/dist/{app → lib}/plugins/openapi/index.js +3 -1
  172. package/dist/lib/plugins/openapi/index.js.map +1 -0
  173. package/dist/lib/plugins/openapi/playground/Editor.d.ts +1 -0
  174. package/dist/lib/plugins/openapi/playground/Editor.js +5 -0
  175. package/dist/lib/plugins/openapi/playground/Editor.js.map +1 -0
  176. package/dist/lib/plugins/openapi/playground/Headers.d.ts +7 -0
  177. package/dist/lib/plugins/openapi/playground/Headers.js +15 -0
  178. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -0
  179. package/dist/lib/plugins/openapi/playground/InlineInput.d.ts +4 -0
  180. package/dist/lib/plugins/openapi/playground/InlineInput.js +3 -0
  181. package/dist/lib/plugins/openapi/playground/InlineInput.js.map +1 -0
  182. package/dist/lib/plugins/openapi/playground/PathParams.d.ts +6 -0
  183. package/dist/lib/plugins/openapi/playground/PathParams.js +21 -0
  184. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -0
  185. package/dist/lib/plugins/openapi/playground/Playground.d.ts +30 -0
  186. package/dist/lib/plugins/openapi/playground/Playground.js +99 -0
  187. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -0
  188. package/dist/lib/plugins/openapi/playground/QueryParams.d.ts +5 -0
  189. package/dist/lib/plugins/openapi/playground/QueryParams.js +34 -0
  190. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -0
  191. package/dist/lib/plugins/openapi/playground/UrlDisplay.d.ts +4 -0
  192. package/dist/lib/plugins/openapi/playground/UrlDisplay.js +22 -0
  193. package/dist/lib/plugins/openapi/playground/UrlDisplay.js.map +1 -0
  194. package/dist/lib/plugins/openapi/playground/createUrl.d.ts +2 -0
  195. package/dist/lib/plugins/openapi/playground/createUrl.js +15 -0
  196. package/dist/lib/plugins/openapi/playground/createUrl.js.map +1 -0
  197. package/dist/{app → lib}/plugins/openapi/util/generateSchemaExample.d.ts +1 -1
  198. package/dist/{app → lib}/plugins/openapi/util/generateSchemaExample.js +17 -9
  199. package/dist/lib/plugins/openapi/util/generateSchemaExample.js.map +1 -0
  200. package/dist/{app → lib}/plugins/openapi/util/urql.js.map +1 -1
  201. package/dist/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.js +2 -1
  202. package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.js.map +1 -0
  203. package/dist/lib/plugins/openapi/worker/shared-worker.d.ts +1 -0
  204. package/dist/lib/plugins/openapi/worker/shared-worker.js +6 -0
  205. package/dist/lib/plugins/openapi/worker/shared-worker.js.map +1 -0
  206. package/dist/{app → lib}/plugins/openapi/worker/worker.js.map +1 -1
  207. package/dist/lib/plugins/openapi-worker.d.ts +1 -0
  208. package/dist/lib/plugins/openapi-worker.js +2 -0
  209. package/dist/lib/plugins/openapi-worker.js.map +1 -0
  210. package/dist/{app → lib}/plugins/redirect/index.d.ts +1 -2
  211. package/dist/{app → lib}/plugins/redirect/index.js.map +1 -1
  212. package/dist/lib/ui/Button.d.ts +7 -0
  213. package/dist/lib/ui/Button.js +11 -0
  214. package/dist/lib/ui/Button.js.map +1 -0
  215. package/dist/{app → lib}/ui/Callout.js.map +1 -1
  216. package/dist/{app → lib}/ui/Card.js.map +1 -1
  217. package/dist/{app → lib}/ui/Note.js.map +1 -1
  218. package/dist/{app → lib}/ui/Tabs.d.ts +2 -2
  219. package/dist/{app → lib}/ui/Tabs.js +2 -2
  220. package/dist/{app → lib}/ui/Tabs.js.map +1 -1
  221. package/dist/lib/ui/button-variants.d.ts +4 -0
  222. package/dist/{app/ui/Button.js → lib/ui/button-variants.js} +2 -12
  223. package/dist/lib/ui/button-variants.js.map +1 -0
  224. package/dist/{app → lib}/util/MdxComponents.js +9 -9
  225. package/dist/lib/util/MdxComponents.js.map +1 -0
  226. package/dist/{app → lib}/util/cn.js.map +1 -1
  227. package/dist/lib/util/createVariantComponent.d.ts +9 -0
  228. package/dist/lib/util/createVariantComponent.js +17 -0
  229. package/dist/lib/util/createVariantComponent.js.map +1 -0
  230. package/dist/{app → lib}/util/createWaitForNotify.js.map +1 -1
  231. package/dist/{app → lib}/util/groupBy.js.map +1 -1
  232. package/dist/{app → lib}/util/joinPath.js.map +1 -1
  233. package/dist/{app → lib}/util/pastellize.js.map +1 -1
  234. package/dist/lib/util/slugify.js.map +1 -0
  235. package/dist/{app → lib}/util/traverseNavigation.js.map +1 -1
  236. package/dist/{app → lib}/util/useScrollToAnchor.js.map +1 -1
  237. package/dist/{app → lib}/util/useScrollToTop.js.map +1 -1
  238. package/dist/ts.d.ts +6 -0
  239. package/dist/ts.js +61 -0
  240. package/dist/ts.js.map +1 -0
  241. package/dist/vite/build.js +2 -8
  242. package/dist/vite/build.js.map +1 -1
  243. package/dist/vite/common.d.ts +1 -0
  244. package/dist/vite/common.js +5 -0
  245. package/dist/vite/common.js.map +1 -0
  246. package/dist/vite/config.d.ts +10 -3
  247. package/dist/vite/config.js +109 -58
  248. package/dist/vite/config.js.map +1 -1
  249. package/dist/vite/config.test.js +4 -3
  250. package/dist/vite/config.test.js.map +1 -1
  251. package/dist/vite/dev-server.d.ts +2 -0
  252. package/dist/vite/dev-server.js +30 -9
  253. package/dist/vite/dev-server.js.map +1 -1
  254. package/dist/vite/html.d.ts +1 -1
  255. package/dist/vite/html.js +2 -3
  256. package/dist/vite/html.js.map +1 -1
  257. package/dist/vite/plugin-api-keys.d.ts +4 -0
  258. package/dist/vite/plugin-api-keys.js +33 -0
  259. package/dist/vite/plugin-api-keys.js.map +1 -0
  260. package/dist/vite/plugin-api.d.ts +4 -0
  261. package/dist/vite/plugin-api.js +49 -0
  262. package/dist/vite/plugin-api.js.map +1 -0
  263. package/dist/vite/plugin-auth.d.ts +4 -0
  264. package/dist/vite/plugin-auth.js +30 -0
  265. package/dist/vite/plugin-auth.js.map +1 -0
  266. package/dist/vite/plugin-component.d.ts +4 -0
  267. package/dist/vite/plugin-component.js +16 -0
  268. package/dist/vite/plugin-component.js.map +1 -0
  269. package/dist/vite/plugin-config.d.ts +7 -0
  270. package/dist/vite/plugin-config.js +25 -0
  271. package/dist/vite/plugin-config.js.map +1 -0
  272. package/dist/vite/plugin-docs.d.ts +4 -0
  273. package/dist/vite/plugin-docs.js +45 -0
  274. package/dist/vite/plugin-docs.js.map +1 -0
  275. package/dist/vite/plugin-docs.test.js +30 -0
  276. package/dist/vite/plugin-docs.test.js.map +1 -0
  277. package/dist/vite/plugin-html.d.ts +3 -0
  278. package/dist/vite/plugin-html.js +47 -0
  279. package/dist/vite/plugin-html.js.map +1 -0
  280. package/dist/vite/plugin-mdx.d.ts +8 -0
  281. package/dist/vite/plugin-mdx.js +63 -0
  282. package/dist/vite/plugin-mdx.js.map +1 -0
  283. package/dist/vite/plugin-metadata.d.ts +6 -0
  284. package/dist/vite/plugin-metadata.js +24 -0
  285. package/dist/vite/plugin-metadata.js.map +1 -0
  286. package/dist/vite/plugin-openapi-worker.d.ts +4 -0
  287. package/dist/vite/plugin-openapi-worker.js +28 -0
  288. package/dist/vite/plugin-openapi-worker.js.map +1 -0
  289. package/dist/vite/plugin-redirect.d.ts +4 -0
  290. package/dist/vite/plugin-redirect.js +32 -0
  291. package/dist/vite/plugin-redirect.js.map +1 -0
  292. package/dist/vite/plugin.d.ts +2 -6
  293. package/dist/vite/plugin.js +22 -104
  294. package/dist/vite/plugin.js.map +1 -1
  295. package/lib/DevPortalProvider-yBHPOS9_.js +4559 -0
  296. package/lib/Spinner-Daa7xsri.js +7329 -0
  297. package/lib/assets/index-BPdJm2ty.js +4764 -0
  298. package/lib/assets/worker-BCcpCNJ7.js +14473 -0
  299. package/lib/clerk-Wslx_mPo.js +19685 -0
  300. package/lib/loglevel-D-4S8up4.js +152 -0
  301. package/lib/prism-bash.min-DadFsM4Z.js +6 -0
  302. package/lib/prism-java.min-d5iT_mOd.js +6 -0
  303. package/lib/prism-json.min-B1GJqK1k.js +1 -0
  304. package/lib/prism-markup-templating-DZrrEs0A.js +61 -0
  305. package/lib/prism-php.min-o7FpoMP_.js +10 -0
  306. package/lib/prism-ruby.min-C7LwcKyz.js +9 -0
  307. package/lib/urql-DMlBWUKL.js +1591 -0
  308. package/lib/zudoku.auth-auth0.js +829 -0
  309. package/lib/zudoku.auth-clerk.js +41 -0
  310. package/lib/zudoku.components.js +1203 -0
  311. package/lib/zudoku.openapi-worker.js +225 -0
  312. package/lib/zudoku.plugins.js +19877 -0
  313. package/package.json +75 -50
  314. package/src/app/App.tsx +23 -46
  315. package/src/app/main.css +1 -0
  316. package/src/app/main.tsx +13 -17
  317. package/src/lib/authentication/Callback.tsx +31 -0
  318. package/src/lib/authentication/auth0.tsx +18 -0
  319. package/src/lib/authentication/authentication.ts +11 -0
  320. package/src/lib/authentication/clerk.tsx +56 -0
  321. package/src/lib/authentication/openid.tsx +206 -0
  322. package/src/{app → lib/components}/DevPortal.tsx +30 -42
  323. package/src/{app → lib}/components/Dialog.tsx +37 -37
  324. package/src/{app → lib}/components/Header.tsx +4 -4
  325. package/src/{app → lib/components}/Heading.tsx +2 -2
  326. package/src/{app → lib}/components/Layout.tsx +18 -12
  327. package/src/lib/components/Link.tsx +1 -0
  328. package/src/lib/components/Router.tsx +28 -0
  329. package/src/lib/components/Select.tsx +157 -0
  330. package/src/lib/components/Spinner.tsx +5 -0
  331. package/src/{app → lib}/components/SyntaxHighlight.tsx +10 -3
  332. package/src/{app → lib}/components/context/DevPortalProvider.ts +1 -1
  333. package/src/lib/components/index.ts +3 -0
  334. package/src/{app → lib}/components/navigation/SideNavigation.tsx +4 -1
  335. package/src/{app → lib}/components/navigation/SideNavigationCategory.tsx +3 -1
  336. package/src/{app → lib}/components/navigation/SideNavigationItem.tsx +16 -7
  337. package/src/lib/components/navigation/SideNavigationWrapper.tsx +24 -0
  338. package/src/{app → lib}/core/DevPortalContext.ts +20 -22
  339. package/src/{app → lib}/core/plugins.ts +5 -5
  340. package/src/{app → lib}/oas/graphql/index.ts +2 -2
  341. package/src/lib/plugins/api-key/CreateApiKey.tsx +100 -0
  342. package/src/lib/plugins/api-key/SettingsApiKeys.tsx +125 -0
  343. package/src/lib/plugins/api-key/index.tsx +132 -0
  344. package/src/lib/plugins/index.ts +4 -0
  345. package/src/{app → lib}/plugins/markdown/MdxPage.tsx +32 -10
  346. package/src/{app → lib}/plugins/markdown/generateRoutes.tsx +1 -16
  347. package/src/{app → lib}/plugins/openapi/ColorizedParam.tsx +1 -3
  348. package/src/lib/plugins/openapi/MakeRequest.tsx +58 -0
  349. package/src/{app → lib}/plugins/openapi/OperationList.tsx +14 -4
  350. package/src/{app → lib}/plugins/openapi/OperationListItem.tsx +36 -4
  351. package/src/{app → lib}/plugins/openapi/ParameterList.tsx +1 -1
  352. package/src/{app → lib}/plugins/openapi/ParameterListItem.tsx +5 -2
  353. package/src/{app → lib}/plugins/openapi/RequestBodySidecarBox.tsx +1 -1
  354. package/src/{app → lib}/plugins/openapi/ResponsesSidecarBox.tsx +2 -3
  355. package/src/lib/plugins/openapi/SchemaListView.tsx +228 -0
  356. package/src/{app → lib}/plugins/openapi/Sidecar.tsx +23 -23
  357. package/src/{app → lib}/plugins/openapi/graphql/gql.ts +7 -7
  358. package/src/{app → lib}/plugins/openapi/graphql/graphql.ts +59 -0
  359. package/src/{app → lib}/plugins/openapi/index.tsx +8 -2
  360. package/src/lib/plugins/openapi/playground/Editor.tsx +4 -0
  361. package/src/lib/plugins/openapi/playground/Headers.tsx +60 -0
  362. package/src/lib/plugins/openapi/playground/InlineInput.tsx +6 -0
  363. package/src/lib/plugins/openapi/playground/PathParams.tsx +63 -0
  364. package/src/lib/plugins/openapi/playground/Playground.tsx +367 -0
  365. package/src/lib/plugins/openapi/playground/QueryParams.tsx +109 -0
  366. package/src/lib/plugins/openapi/playground/UrlDisplay.tsx +32 -0
  367. package/src/lib/plugins/openapi/playground/createUrl.ts +22 -0
  368. package/src/{app → lib}/plugins/openapi/util/generateSchemaExample.ts +22 -9
  369. package/src/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.ts +2 -1
  370. package/src/lib/plugins/openapi/worker/shared-worker.ts +5 -0
  371. package/src/lib/plugins/openapi-worker.ts +1 -0
  372. package/src/{app → lib}/plugins/redirect/index.tsx +1 -1
  373. package/src/lib/ui/Button.tsx +25 -0
  374. package/src/{app → lib}/ui/Tabs.tsx +2 -2
  375. package/src/{app/ui/Button.tsx → lib/ui/button-variants.ts} +4 -29
  376. package/src/{app → lib}/util/MdxComponents.tsx +33 -8
  377. package/src/{app → lib}/util/createVariantComponent.tsx +12 -7
  378. package/dist/app/DevPortal.d.ts +0 -25
  379. package/dist/app/DevPortal.js +0 -41
  380. package/dist/app/DevPortal.js.map +0 -1
  381. package/dist/app/Heading.js.map +0 -1
  382. package/dist/app/authentication/authentication.d.ts +0 -13
  383. package/dist/app/authentication/authentication.js.map +0 -1
  384. package/dist/app/authentication/clerk.d.ts +0 -5
  385. package/dist/app/authentication/clerk.js.map +0 -1
  386. package/dist/app/authentication/openid.d.ts +0 -11
  387. package/dist/app/authentication/openid.js +0 -118
  388. package/dist/app/authentication/openid.js.map +0 -1
  389. package/dist/app/components/Dialog.js.map +0 -1
  390. package/dist/app/components/DynamicIcon.d.ts +0 -6
  391. package/dist/app/components/DynamicIcon.js +0 -6
  392. package/dist/app/components/DynamicIcon.js.map +0 -1
  393. package/dist/app/components/Header.d.ts +0 -1
  394. package/dist/app/components/Header.js +0 -15
  395. package/dist/app/components/Layout.js.map +0 -1
  396. package/dist/app/components/SyntaxHighlight.js.map +0 -1
  397. package/dist/app/components/context/DevPortalProvider.js.map +0 -1
  398. package/dist/app/components/context/PluginSystem.js.map +0 -1
  399. package/dist/app/components/navigation/SideNavigationItem.js.map +0 -1
  400. package/dist/app/components/navigation/SideNavigationWrapper.js +0 -6
  401. package/dist/app/components/navigation/SideNavigationWrapper.js.map +0 -1
  402. package/dist/app/config.d.ts +0 -3
  403. package/dist/app/config.js +0 -9
  404. package/dist/app/config.js.map +0 -1
  405. package/dist/app/core/DevPortalContext.js.map +0 -1
  406. package/dist/app/core/icons.js.map +0 -1
  407. package/dist/app/core/router.js.map +0 -1
  408. package/dist/app/core/types/combine.d.ts +0 -4
  409. package/dist/app/core/types/combine.js +0 -2
  410. package/dist/app/core/types/combine.js.map +0 -1
  411. package/dist/app/markdowns.d.ts +0 -3
  412. package/dist/app/markdowns.js +0 -5
  413. package/dist/app/markdowns.js.map +0 -1
  414. package/dist/app/oas/graphql/index.js.map +0 -1
  415. package/dist/app/oas/graphql/server.js +0 -8
  416. package/dist/app/oas/graphql/server.js.map +0 -1
  417. package/dist/app/plugins/api-key/SettingsApiKeys.d.ts +0 -4
  418. package/dist/app/plugins/api-key/SettingsApiKeys.js +0 -7
  419. package/dist/app/plugins/api-key/SettingsApiKeys.js.map +0 -1
  420. package/dist/app/plugins/api-key/index.d.ts +0 -32
  421. package/dist/app/plugins/api-key/index.js +0 -55
  422. package/dist/app/plugins/api-key/index.js.map +0 -1
  423. package/dist/app/plugins/markdown/MdxPage.d.ts +0 -3
  424. package/dist/app/plugins/markdown/MdxPage.js +0 -55
  425. package/dist/app/plugins/markdown/MdxPage.js.map +0 -1
  426. package/dist/app/plugins/markdown/generateRoutes.js.map +0 -1
  427. package/dist/app/plugins/openapi/ColorizedParam.js.map +0 -1
  428. package/dist/app/plugins/openapi/MakeRequest.js +0 -23
  429. package/dist/app/plugins/openapi/MakeRequest.js.map +0 -1
  430. package/dist/app/plugins/openapi/OperationList.js.map +0 -1
  431. package/dist/app/plugins/openapi/OperationListItem.js +0 -15
  432. package/dist/app/plugins/openapi/OperationListItem.js.map +0 -1
  433. package/dist/app/plugins/openapi/ParameterListItem.js +0 -13
  434. package/dist/app/plugins/openapi/graphql/gql.js.map +0 -1
  435. package/dist/app/plugins/openapi/graphql/graphql.js.map +0 -1
  436. package/dist/app/plugins/openapi/graphql/index.js.map +0 -1
  437. package/dist/app/plugins/openapi/index.js.map +0 -1
  438. package/dist/app/plugins/openapi/playground/Playground.d.ts +0 -8
  439. package/dist/app/plugins/openapi/playground/Playground.js +0 -98
  440. package/dist/app/plugins/openapi/playground/Playground.js.map +0 -1
  441. package/dist/app/plugins/openapi/util/generateSchemaExample.js.map +0 -1
  442. package/dist/app/plugins/openapi/worker/createSharedWorkerClient.js.map +0 -1
  443. package/dist/app/ui/Button.d.ts +0 -11
  444. package/dist/app/ui/Button.js.map +0 -1
  445. package/dist/app/util/MdxComponents.js.map +0 -1
  446. package/dist/app/util/createVariantComponent.d.ts +0 -15
  447. package/dist/app/util/createVariantComponent.js +0 -12
  448. package/dist/app/util/createVariantComponent.js.map +0 -1
  449. package/dist/app/util/slugify.js.map +0 -1
  450. package/dist/auth.d.ts +0 -2
  451. package/dist/auth.js +0 -3
  452. package/dist/auth.js.map +0 -1
  453. package/dist/plugins.d.ts +0 -4
  454. package/dist/plugins.js +0 -6
  455. package/dist/plugins.js.map +0 -1
  456. package/src/app/authentication/authentication.ts +0 -18
  457. package/src/app/authentication/clerk.ts +0 -47
  458. package/src/app/authentication/openid.ts +0 -192
  459. package/src/app/components/DynamicIcon.tsx +0 -60
  460. package/src/app/components/navigation/SideNavigationWrapper.tsx +0 -15
  461. package/src/app/config.ts +0 -20
  462. package/src/app/core/types/combine.ts +0 -16
  463. package/src/app/markdowns.ts +0 -7
  464. package/src/app/oas/graphql/server.ts +0 -10
  465. package/src/app/plugins/api-key/SettingsApiKeys.tsx +0 -22
  466. package/src/app/plugins/api-key/index.tsx +0 -123
  467. package/src/app/plugins/openapi/MakeRequest.tsx +0 -49
  468. package/src/app/plugins/openapi/playground/Playground.tsx +0 -309
  469. package/src/app/plugins/openapi/queries.graphql +0 -6
  470. package/dist/{app → lib}/authentication/authentication.js +0 -0
  471. package/dist/{app → lib}/components/AnchorLink.d.ts +0 -0
  472. package/dist/{app → lib}/components/AnchorLink.js +0 -0
  473. package/dist/{app → lib}/components/CategoryHeading.d.ts +0 -0
  474. package/dist/{app → lib}/components/CategoryHeading.js +0 -0
  475. package/dist/{app → lib/components}/Heading.d.ts +0 -0
  476. package/dist/{app → lib}/components/Input.d.ts +0 -0
  477. package/dist/{app → lib}/components/Input.js +0 -0
  478. package/dist/{app → lib}/components/Layout.d.ts +0 -0
  479. package/dist/{app → lib}/components/Markdown.d.ts +0 -0
  480. package/dist/{app → lib}/components/Markdown.js +0 -0
  481. package/dist/{app → lib}/components/TopNavigation.d.ts +0 -0
  482. package/dist/{app → lib}/components/TopNavigation.js +0 -0
  483. package/dist/{app → lib}/components/context/ComponentsContext.js +0 -0
  484. package/dist/{app → lib}/components/context/DevPortalProvider.d.ts +0 -0
  485. package/dist/{app → lib}/components/context/PluginSystem.d.ts +0 -0
  486. package/dist/{app → lib}/components/context/PluginSystem.js +0 -0
  487. package/dist/{app → lib}/components/context/ThemeContext.d.ts +0 -0
  488. package/dist/{app → lib}/components/context/ViewportAnchorContext.d.ts +0 -0
  489. package/dist/{app → lib}/components/context/ViewportAnchorContext.js +0 -0
  490. package/dist/{app → lib}/components/navigation/SideNavigation.d.ts +0 -0
  491. package/dist/{app → lib}/components/navigation/SideNavigationCategory.d.ts +0 -0
  492. package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.d.ts +0 -0
  493. package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.js +0 -0
  494. package/dist/{app → lib}/components/navigation/util.d.ts +0 -0
  495. package/dist/{app → lib}/components/navigation/util.js +0 -0
  496. package/dist/{app → lib}/core/helmet.d.ts +0 -0
  497. package/dist/{app → lib}/core/helmet.js +0 -0
  498. package/dist/{app → lib}/core/icons.d.ts +0 -0
  499. package/dist/{app → lib}/core/icons.js +0 -0
  500. package/dist/{app → lib}/core/router.d.ts +0 -0
  501. package/dist/{app → lib}/core/router.js +0 -0
  502. package/dist/{app → lib}/oas/graphql/index.d.ts +0 -0
  503. package/dist/{app → lib}/oas/parser/dereference/index.d.ts +0 -0
  504. package/dist/{app → lib}/oas/parser/dereference/index.js +0 -0
  505. package/dist/{app → lib}/oas/parser/dereference/resolveRef.d.ts +0 -0
  506. package/dist/{app → lib}/oas/parser/dereference/resolveRef.js +0 -0
  507. package/dist/{app → lib}/oas/parser/index.d.ts +0 -0
  508. package/dist/{app → lib}/oas/parser/index.js +0 -0
  509. package/dist/{app → lib}/oas/parser/upgrade/index.d.ts +0 -0
  510. package/dist/{app → lib}/oas/parser/upgrade/index.js +0 -0
  511. package/dist/{app → lib}/plugins/markdown/Toc.d.ts +0 -0
  512. package/dist/{app → lib}/plugins/markdown/Toc.js +0 -0
  513. package/dist/{app → lib}/plugins/markdown/generateRoutes.d.ts +0 -0
  514. package/dist/{app → lib}/plugins/markdown/index.d.ts +0 -0
  515. package/dist/{app → lib}/plugins/markdown/index.js +0 -0
  516. package/dist/{app → lib}/plugins/openapi/MakeRequest.d.ts +0 -0
  517. package/dist/{app → lib}/plugins/openapi/MethodBadge.d.ts +0 -0
  518. package/dist/{app → lib}/plugins/openapi/MethodBadge.js +0 -0
  519. package/dist/{app → lib}/plugins/openapi/OperationList.d.ts +0 -0
  520. package/dist/{app → lib}/plugins/openapi/OperationListItem.d.ts +0 -0
  521. package/dist/{app → lib}/plugins/openapi/ParameterList.d.ts +0 -0
  522. package/dist/{app → lib}/plugins/openapi/ParameterListItem.d.ts +0 -0
  523. package/dist/{app → lib}/plugins/openapi/RequestBodySidecarBox.d.ts +0 -0
  524. package/dist/{app → lib}/plugins/openapi/ResponsesSidecarBox.d.ts +0 -0
  525. package/dist/{app → lib}/plugins/openapi/Select.d.ts +0 -0
  526. package/dist/{app → lib}/plugins/openapi/Select.js +0 -0
  527. package/dist/{app → lib}/plugins/openapi/Sidecar.d.ts +0 -0
  528. package/dist/{app → lib}/plugins/openapi/SidecarBox.d.ts +0 -0
  529. package/dist/{app → lib}/plugins/openapi/SidecarBox.js +0 -0
  530. package/dist/{app → lib}/plugins/openapi/graphql/fragment-masking.js +0 -0
  531. package/dist/{app → lib}/plugins/openapi/graphql/index.d.ts +0 -0
  532. package/dist/{app → lib}/plugins/openapi/graphql/index.js +0 -0
  533. package/dist/{app → lib}/plugins/openapi/index.d.ts +0 -0
  534. package/dist/{app → lib}/plugins/openapi/util/urql.d.ts +0 -0
  535. package/dist/{app → lib}/plugins/openapi/util/urql.js +0 -0
  536. package/dist/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.d.ts +0 -0
  537. package/dist/{app → lib}/plugins/openapi/worker/worker.d.ts +0 -0
  538. package/dist/{app → lib}/plugins/openapi/worker/worker.js +0 -0
  539. package/dist/{app → lib}/plugins/redirect/index.js +0 -0
  540. package/dist/{app → lib}/ui/Callout.d.ts +0 -0
  541. package/dist/{app → lib}/ui/Callout.js +0 -0
  542. package/dist/{app → lib}/ui/Card.d.ts +0 -0
  543. package/dist/{app → lib}/ui/Card.js +0 -0
  544. package/dist/{app → lib}/ui/Note.d.ts +0 -0
  545. package/dist/{app → lib}/ui/Note.js +0 -0
  546. package/dist/{app → lib}/util/MdxComponents.d.ts +0 -0
  547. package/dist/{app → lib}/util/cn.d.ts +0 -0
  548. package/dist/{app → lib}/util/cn.js +0 -0
  549. package/dist/{app → lib}/util/createWaitForNotify.d.ts +0 -0
  550. package/dist/{app → lib}/util/createWaitForNotify.js +0 -0
  551. package/dist/{app → lib}/util/groupBy.d.ts +0 -0
  552. package/dist/{app → lib}/util/groupBy.js +0 -0
  553. package/dist/{app → lib}/util/joinPath.d.ts +0 -0
  554. package/dist/{app → lib}/util/joinPath.js +0 -0
  555. package/dist/{app → lib}/util/pastellize.d.ts +0 -0
  556. package/dist/{app → lib}/util/pastellize.js +0 -0
  557. package/dist/{app → lib}/util/slugify.d.ts +0 -0
  558. package/dist/{app → lib}/util/slugify.js +0 -0
  559. package/dist/{app → lib}/util/traverseNavigation.d.ts +0 -0
  560. package/dist/{app → lib}/util/traverseNavigation.js +0 -0
  561. package/dist/{app → lib}/util/useScrollToAnchor.d.ts +0 -0
  562. package/dist/{app → lib}/util/useScrollToAnchor.js +0 -0
  563. package/dist/{app → lib}/util/useScrollToTop.d.ts +0 -0
  564. package/dist/{app → lib}/util/useScrollToTop.js +0 -0
  565. package/dist/{app/oas/graphql/server.d.ts → vite/plugin-docs.test.d.ts} +0 -0
  566. package/src/{app → lib}/components/AnchorLink.tsx +0 -0
  567. package/src/{app → lib}/components/CategoryHeading.tsx +1 -1
  568. package/src/{app → lib}/components/Input.tsx +0 -0
  569. package/src/{app → lib}/components/Markdown.tsx +0 -0
  570. package/src/{app → lib}/components/TopNavigation.tsx +0 -0
  571. package/src/{app → lib}/components/context/ComponentsContext.tsx +0 -0
  572. package/src/{app → lib}/components/context/PluginSystem.ts +0 -0
  573. package/src/{app → lib}/components/context/ThemeContext.tsx +1 -1
  574. package/src/{app → lib}/components/context/ViewportAnchorContext.tsx +0 -0
  575. package/src/{app → lib}/components/navigation/useNavigationCollapsibleState.ts +0 -0
  576. package/src/{app → lib}/components/navigation/util.ts +0 -0
  577. package/src/{app → lib}/core/helmet.ts +0 -0
  578. package/src/{app → lib}/core/icons.tsx +0 -0
  579. package/src/{app → lib}/core/router.tsx +0 -0
  580. package/src/{app → lib}/oas/parser/dereference/index.ts +0 -0
  581. package/src/{app → lib}/oas/parser/dereference/resolveRef.ts +0 -0
  582. package/src/{app → lib}/oas/parser/index.ts +0 -0
  583. package/src/{app → lib}/oas/parser/schemas/v3.0.json +0 -0
  584. package/src/{app → lib}/oas/parser/schemas/v3.1.json +0 -0
  585. package/src/{app → lib}/oas/parser/upgrade/index.ts +0 -0
  586. package/src/{app → lib}/plugins/markdown/Toc.tsx +0 -0
  587. package/src/{app → lib}/plugins/markdown/index.tsx +0 -0
  588. package/src/{app → lib}/plugins/openapi/MethodBadge.tsx +0 -0
  589. package/src/{app → lib}/plugins/openapi/Select.tsx +0 -0
  590. package/src/{app → lib}/plugins/openapi/SidecarBox.tsx +0 -0
  591. package/src/{app → lib}/plugins/openapi/graphql/fragment-masking.ts +1 -1
  592. /package/src/{app → lib}/plugins/openapi/graphql/index.ts +0 -0
  593. /package/src/{app → lib}/plugins/openapi/util/urql.ts +0 -0
  594. /package/src/{app → lib}/plugins/openapi/worker/worker.ts +0 -0
  595. /package/src/{app → lib}/ui/Callout.tsx +0 -0
  596. /package/src/{app → lib}/ui/Card.tsx +0 -0
  597. /package/src/{app → lib}/ui/Note.tsx +0 -0
  598. /package/src/{app → lib}/util/cn.ts +0 -0
  599. /package/src/{app → lib}/util/createWaitForNotify.ts +0 -0
  600. /package/src/{app → lib}/util/groupBy.ts +0 -0
  601. /package/src/{app → lib}/util/joinPath.tsx +0 -0
  602. /package/src/{app → lib}/util/pastellize.ts +0 -0
  603. /package/src/{app → lib}/util/slugify.ts +0 -0
  604. /package/src/{app → lib}/util/traverseNavigation.ts +0 -0
  605. /package/src/{app → lib}/util/useScrollToAnchor.ts +0 -0
  606. /package/src/{app → lib}/util/useScrollToTop.ts +0 -0
@@ -0,0 +1,829 @@
1
+ import { w as ie, x as ce, u as ue, k as T, N as de } from "./DevPortalProvider-yBHPOS9_.js";
2
+ import { l as M } from "./loglevel-D-4S8up4.js";
3
+ function he(e, t) {
4
+ return ie(e, ce);
5
+ }
6
+ let K;
7
+ var v, Z;
8
+ (typeof navigator > "u" || !((Z = (v = navigator.userAgent) == null ? void 0 : v.startsWith) != null && Z.call(v, "Mozilla/5.0 "))) && (K = "oauth4webapi/v2.11.1");
9
+ function N(e, t) {
10
+ if (e == null)
11
+ return !1;
12
+ try {
13
+ return e instanceof t || Object.getPrototypeOf(e)[Symbol.toStringTag] === t.prototype[Symbol.toStringTag];
14
+ } catch {
15
+ return !1;
16
+ }
17
+ }
18
+ const R = Symbol(), fe = Symbol(), W = Symbol(), le = new TextEncoder(), pe = new TextDecoder();
19
+ function b(e) {
20
+ return typeof e == "string" ? le.encode(e) : pe.decode(e);
21
+ }
22
+ const B = 32768;
23
+ function we(e) {
24
+ e instanceof ArrayBuffer && (e = new Uint8Array(e));
25
+ const t = [];
26
+ for (let r = 0; r < e.byteLength; r += B)
27
+ t.push(String.fromCharCode.apply(null, e.subarray(r, r + B)));
28
+ return btoa(t.join("")).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
29
+ }
30
+ function me(e) {
31
+ try {
32
+ const t = atob(e.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "")), r = new Uint8Array(t.length);
33
+ for (let a = 0; a < t.length; a++)
34
+ r[a] = t.charCodeAt(a);
35
+ return r;
36
+ } catch (t) {
37
+ throw new o("The input to be decoded is not correctly encoded.", { cause: t });
38
+ }
39
+ }
40
+ function _(e) {
41
+ return typeof e == "string" ? me(e) : we(e);
42
+ }
43
+ class ye {
44
+ constructor(t) {
45
+ this.cache = /* @__PURE__ */ new Map(), this._cache = /* @__PURE__ */ new Map(), this.maxSize = t;
46
+ }
47
+ get(t) {
48
+ let r = this.cache.get(t);
49
+ if (r)
50
+ return r;
51
+ if (r = this._cache.get(t))
52
+ return this.update(t, r), r;
53
+ }
54
+ has(t) {
55
+ return this.cache.has(t) || this._cache.has(t);
56
+ }
57
+ set(t, r) {
58
+ return this.cache.has(t) ? this.cache.set(t, r) : this.update(t, r), this;
59
+ }
60
+ delete(t) {
61
+ return this.cache.has(t) ? this.cache.delete(t) : this._cache.has(t) ? this._cache.delete(t) : !1;
62
+ }
63
+ update(t, r) {
64
+ this.cache.set(t, r), this.cache.size >= this.maxSize && (this._cache = this.cache, this.cache = /* @__PURE__ */ new Map());
65
+ }
66
+ }
67
+ class p extends Error {
68
+ constructor(t) {
69
+ var r;
70
+ super(t ?? "operation not supported"), this.name = this.constructor.name, (r = Error.captureStackTrace) == null || r.call(Error, this, this.constructor);
71
+ }
72
+ }
73
+ class ge extends Error {
74
+ constructor(t, r) {
75
+ var a;
76
+ super(t, r), this.name = this.constructor.name, (a = Error.captureStackTrace) == null || a.call(Error, this, this.constructor);
77
+ }
78
+ }
79
+ const o = ge, X = new ye(100);
80
+ function Y(e) {
81
+ return e instanceof CryptoKey;
82
+ }
83
+ function ee(e) {
84
+ return Y(e) && e.type === "private";
85
+ }
86
+ function _e(e) {
87
+ return Y(e) && e.type === "public";
88
+ }
89
+ function z(e) {
90
+ try {
91
+ const t = e.headers.get("dpop-nonce");
92
+ t && X.set(new URL(e.url).origin, t);
93
+ } catch {
94
+ }
95
+ return e;
96
+ }
97
+ function A(e) {
98
+ return !(e === null || typeof e != "object" || Array.isArray(e));
99
+ }
100
+ function P(e) {
101
+ N(e, Headers) && (e = Object.fromEntries(e.entries()));
102
+ const t = new Headers(e);
103
+ if (K && !t.has("user-agent") && t.set("user-agent", K), t.has("authorization"))
104
+ throw new TypeError('"options.headers" must not include the "authorization" header name');
105
+ if (t.has("dpop"))
106
+ throw new TypeError('"options.headers" must not include the "dpop" header name');
107
+ return t;
108
+ }
109
+ function H(e) {
110
+ if (typeof e == "function" && (e = e()), !(e instanceof AbortSignal))
111
+ throw new TypeError('"options.signal" must return or be an instance of AbortSignal');
112
+ return e;
113
+ }
114
+ async function be(e, t) {
115
+ if (!(e instanceof URL))
116
+ throw new TypeError('"issuerIdentifier" must be an instance of URL');
117
+ if (e.protocol !== "https:" && e.protocol !== "http:")
118
+ throw new TypeError('"issuer.protocol" must be "https:" or "http:"');
119
+ const r = new URL(e.href);
120
+ switch (t == null ? void 0 : t.algorithm) {
121
+ case void 0:
122
+ case "oidc":
123
+ r.pathname = `${r.pathname}/.well-known/openid-configuration`.replace("//", "/");
124
+ break;
125
+ case "oauth2":
126
+ r.pathname === "/" ? r.pathname = ".well-known/oauth-authorization-server" : r.pathname = `.well-known/oauth-authorization-server/${r.pathname}`.replace("//", "/");
127
+ break;
128
+ default:
129
+ throw new TypeError('"options.algorithm" must be "oidc" (default), or "oauth2"');
130
+ }
131
+ const a = P(t == null ? void 0 : t.headers);
132
+ return a.set("accept", "application/json"), ((t == null ? void 0 : t[W]) || fetch)(r.href, {
133
+ headers: Object.fromEntries(a.entries()),
134
+ method: "GET",
135
+ redirect: "manual",
136
+ signal: t != null && t.signal ? H(t.signal) : null
137
+ }).then(z);
138
+ }
139
+ function f(e) {
140
+ return typeof e == "string" && e.length !== 0;
141
+ }
142
+ async function Se(e, t) {
143
+ if (!(e instanceof URL))
144
+ throw new TypeError('"expectedIssuer" must be an instance of URL');
145
+ if (!N(t, Response))
146
+ throw new TypeError('"response" must be an instance of Response');
147
+ if (t.status !== 200)
148
+ throw new o('"response" is not a conform Authorization Server Metadata response');
149
+ D(t);
150
+ let r;
151
+ try {
152
+ r = await t.json();
153
+ } catch (a) {
154
+ throw new o('failed to parse "response" body as JSON', { cause: a });
155
+ }
156
+ if (!A(r))
157
+ throw new o('"response" body must be a top level object');
158
+ if (!f(r.issuer))
159
+ throw new o('"response" body "issuer" property must be a non-empty string');
160
+ if (new URL(r.issuer).href !== e.href)
161
+ throw new o('"response" body "issuer" does not match "expectedIssuer"');
162
+ return r;
163
+ }
164
+ function x() {
165
+ return _(crypto.getRandomValues(new Uint8Array(32)));
166
+ }
167
+ function Ee() {
168
+ return x();
169
+ }
170
+ function Ae() {
171
+ return x();
172
+ }
173
+ async function ve(e) {
174
+ if (!f(e))
175
+ throw new TypeError('"codeVerifier" must be a non-empty string');
176
+ return _(await crypto.subtle.digest("SHA-256", b(e)));
177
+ }
178
+ function Te(e) {
179
+ if (e instanceof CryptoKey)
180
+ return { key: e };
181
+ if (!((e == null ? void 0 : e.key) instanceof CryptoKey))
182
+ return {};
183
+ if (e.kid !== void 0 && !f(e.kid))
184
+ throw new TypeError('"kid" must be a non-empty string');
185
+ return { key: e.key, kid: e.kid };
186
+ }
187
+ function q(e) {
188
+ return encodeURIComponent(e).replace(/%20/g, "+");
189
+ }
190
+ function ke(e, t) {
191
+ const r = q(e), a = q(t);
192
+ return `Basic ${btoa(`${r}:${a}`)}`;
193
+ }
194
+ function Re(e) {
195
+ switch (e.algorithm.hash.name) {
196
+ case "SHA-256":
197
+ return "PS256";
198
+ case "SHA-384":
199
+ return "PS384";
200
+ case "SHA-512":
201
+ return "PS512";
202
+ default:
203
+ throw new p("unsupported RsaHashedKeyAlgorithm hash name");
204
+ }
205
+ }
206
+ function Pe(e) {
207
+ switch (e.algorithm.hash.name) {
208
+ case "SHA-256":
209
+ return "RS256";
210
+ case "SHA-384":
211
+ return "RS384";
212
+ case "SHA-512":
213
+ return "RS512";
214
+ default:
215
+ throw new p("unsupported RsaHashedKeyAlgorithm hash name");
216
+ }
217
+ }
218
+ function xe(e) {
219
+ switch (e.algorithm.namedCurve) {
220
+ case "P-256":
221
+ return "ES256";
222
+ case "P-384":
223
+ return "ES384";
224
+ case "P-521":
225
+ return "ES512";
226
+ default:
227
+ throw new p("unsupported EcKeyAlgorithm namedCurve");
228
+ }
229
+ }
230
+ function te(e) {
231
+ switch (e.algorithm.name) {
232
+ case "RSA-PSS":
233
+ return Re(e);
234
+ case "RSASSA-PKCS1-v1_5":
235
+ return Pe(e);
236
+ case "ECDSA":
237
+ return xe(e);
238
+ case "Ed25519":
239
+ case "Ed448":
240
+ return "EdDSA";
241
+ default:
242
+ throw new p("unsupported CryptoKey algorithm name");
243
+ }
244
+ }
245
+ function j(e) {
246
+ const t = e == null ? void 0 : e[R];
247
+ return typeof t == "number" && Number.isFinite(t) ? t : 0;
248
+ }
249
+ function je(e) {
250
+ const t = e == null ? void 0 : e[fe];
251
+ return typeof t == "number" && Number.isFinite(t) && Math.sign(t) !== -1 ? t : 30;
252
+ }
253
+ function $() {
254
+ return Math.floor(Date.now() / 1e3);
255
+ }
256
+ function Ce(e, t) {
257
+ const r = $() + j(t);
258
+ return {
259
+ jti: x(),
260
+ aud: [e.issuer, e.token_endpoint],
261
+ exp: r + 60,
262
+ iat: r,
263
+ nbf: r,
264
+ iss: t.client_id,
265
+ sub: t.client_id
266
+ };
267
+ }
268
+ async function Ue(e, t, r, a) {
269
+ return re({
270
+ alg: te(r),
271
+ kid: a
272
+ }, Ce(e, t), r);
273
+ }
274
+ function C(e) {
275
+ if (typeof e != "object" || e === null)
276
+ throw new TypeError('"as" must be an object');
277
+ if (!f(e.issuer))
278
+ throw new TypeError('"as.issuer" property must be a non-empty string');
279
+ return !0;
280
+ }
281
+ function U(e) {
282
+ if (typeof e != "object" || e === null)
283
+ throw new TypeError('"client" must be an object');
284
+ if (!f(e.client_id))
285
+ throw new TypeError('"client.client_id" property must be a non-empty string');
286
+ return !0;
287
+ }
288
+ function V(e) {
289
+ if (!f(e))
290
+ throw new TypeError('"client.client_secret" property must be a non-empty string');
291
+ return e;
292
+ }
293
+ function J(e, t) {
294
+ if (t !== void 0)
295
+ throw new TypeError(`"options.clientPrivateKey" property must not be provided when ${e} client authentication method is used.`);
296
+ }
297
+ function F(e, t) {
298
+ if (t !== void 0)
299
+ throw new TypeError(`"client.client_secret" property must not be provided when ${e} client authentication method is used.`);
300
+ }
301
+ async function Je(e, t, r, a, i) {
302
+ switch (r.delete("client_secret"), r.delete("client_assertion_type"), r.delete("client_assertion"), t.token_endpoint_auth_method) {
303
+ case void 0:
304
+ case "client_secret_basic": {
305
+ J("client_secret_basic", i), a.set("authorization", ke(t.client_id, V(t.client_secret)));
306
+ break;
307
+ }
308
+ case "client_secret_post": {
309
+ J("client_secret_post", i), r.set("client_id", t.client_id), r.set("client_secret", V(t.client_secret));
310
+ break;
311
+ }
312
+ case "private_key_jwt": {
313
+ if (F("private_key_jwt", t.client_secret), i === void 0)
314
+ throw new TypeError('"options.clientPrivateKey" must be provided when "client.token_endpoint_auth_method" is "private_key_jwt"');
315
+ const { key: n, kid: s } = Te(i);
316
+ if (!ee(n))
317
+ throw new TypeError('"options.clientPrivateKey.key" must be a private CryptoKey');
318
+ r.set("client_id", t.client_id), r.set("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), r.set("client_assertion", await Ue(e, t, n, s));
319
+ break;
320
+ }
321
+ case "tls_client_auth":
322
+ case "self_signed_tls_client_auth":
323
+ case "none": {
324
+ F(t.token_endpoint_auth_method, t.client_secret), J(t.token_endpoint_auth_method, i), r.set("client_id", t.client_id);
325
+ break;
326
+ }
327
+ default:
328
+ throw new p("unsupported client token_endpoint_auth_method");
329
+ }
330
+ }
331
+ async function re(e, t, r) {
332
+ if (!r.usages.includes("sign"))
333
+ throw new TypeError('CryptoKey instances used for signing assertions must include "sign" in their "usages"');
334
+ const a = `${_(b(JSON.stringify(e)))}.${_(b(JSON.stringify(t)))}`, i = _(await crypto.subtle.sign(se(r), r, b(a)));
335
+ return `${a}.${i}`;
336
+ }
337
+ async function Le(e, t, r, a, i, n) {
338
+ const { privateKey: s, publicKey: u, nonce: h = X.get(r.origin) } = t;
339
+ if (!ee(s))
340
+ throw new TypeError('"DPoP.privateKey" must be a private CryptoKey');
341
+ if (!_e(u))
342
+ throw new TypeError('"DPoP.publicKey" must be a public CryptoKey');
343
+ if (h !== void 0 && !f(h))
344
+ throw new TypeError('"DPoP.nonce" must be a non-empty string or undefined');
345
+ if (!u.extractable)
346
+ throw new TypeError('"DPoP.publicKey.extractable" must be true');
347
+ const l = $() + i, w = await re({
348
+ alg: te(s),
349
+ typ: "dpop+jwt",
350
+ jwk: await Oe(u)
351
+ }, {
352
+ iat: l,
353
+ jti: x(),
354
+ htm: a,
355
+ nonce: h,
356
+ htu: `${r.origin}${r.pathname}`,
357
+ ath: n ? _(await crypto.subtle.digest("SHA-256", b(n))) : void 0
358
+ }, s);
359
+ e.set("dpop", w);
360
+ }
361
+ let k;
362
+ async function Ke(e) {
363
+ const { kty: t, e: r, n: a, x: i, y: n, crv: s } = await crypto.subtle.exportKey("jwk", e), u = { kty: t, e: r, n: a, x: i, y: n, crv: s };
364
+ return k.set(e, u), u;
365
+ }
366
+ async function Oe(e) {
367
+ return k || (k = /* @__PURE__ */ new WeakMap()), k.get(e) || Ke(e);
368
+ }
369
+ function Ne(e, t, r) {
370
+ if (typeof e != "string")
371
+ throw new TypeError(`"as.${t}" must be a string`);
372
+ return new URL(e);
373
+ }
374
+ function ne(e, t, r) {
375
+ return Ne(e[t], t);
376
+ }
377
+ function O(e) {
378
+ const t = e;
379
+ return typeof t != "object" || Array.isArray(t) || t === null ? !1 : t.error !== void 0;
380
+ }
381
+ async function We(e, t, r, a, i, n) {
382
+ if (!f(e))
383
+ throw new TypeError('"accessToken" must be a non-empty string');
384
+ if (!(r instanceof URL))
385
+ throw new TypeError('"url" must be an instance of URL');
386
+ return a = P(a), (n == null ? void 0 : n.DPoP) === void 0 ? a.set("authorization", `Bearer ${e}`) : (await Le(a, n.DPoP, r, "GET", j({ [R]: n == null ? void 0 : n[R] }), e), a.set("authorization", `DPoP ${e}`)), ((n == null ? void 0 : n[W]) || fetch)(r.href, {
387
+ body: i,
388
+ headers: Object.fromEntries(a.entries()),
389
+ method: t,
390
+ redirect: "manual",
391
+ signal: n != null && n.signal ? H(n.signal) : null
392
+ }).then(z);
393
+ }
394
+ async function ze(e, t, r, a) {
395
+ C(e), U(t);
396
+ const i = ne(e, "userinfo_endpoint"), n = P(a == null ? void 0 : a.headers);
397
+ return t.userinfo_signed_response_alg ? n.set("accept", "application/jwt") : (n.set("accept", "application/json"), n.append("accept", "application/jwt")), We(r, "GET", i, n, null, {
398
+ ...a,
399
+ [R]: j(t)
400
+ });
401
+ }
402
+ async function He(e, t, r, a, i, n, s) {
403
+ return await Je(e, t, i, n, s == null ? void 0 : s.clientPrivateKey), n.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"), ((s == null ? void 0 : s[W]) || fetch)(a.href, {
404
+ body: i,
405
+ headers: Object.fromEntries(n.entries()),
406
+ method: r,
407
+ redirect: "manual",
408
+ signal: s != null && s.signal ? H(s.signal) : null
409
+ }).then(z);
410
+ }
411
+ async function $e(e, t, r, a, i) {
412
+ const n = ne(e, "token_endpoint");
413
+ a.set("grant_type", r);
414
+ const s = P(i == null ? void 0 : i.headers);
415
+ return s.set("accept", "application/json"), He(e, t, "POST", n, a, s, i);
416
+ }
417
+ const De = /* @__PURE__ */ new WeakMap();
418
+ async function Ie(e, t, r, a = !1, i = !1) {
419
+ if (C(e), U(t), !N(r, Response))
420
+ throw new TypeError('"response" must be an instance of Response');
421
+ if (r.status !== 200) {
422
+ let s;
423
+ if (s = await Ze(r))
424
+ return s;
425
+ throw new o('"response" is not a conform Token Endpoint response');
426
+ }
427
+ D(r);
428
+ let n;
429
+ try {
430
+ n = await r.json();
431
+ } catch (s) {
432
+ throw new o('failed to parse "response" body as JSON', { cause: s });
433
+ }
434
+ if (!A(n))
435
+ throw new o('"response" body must be a top level object');
436
+ if (!f(n.access_token))
437
+ throw new o('"response" body "access_token" property must be a non-empty string');
438
+ if (!f(n.token_type))
439
+ throw new o('"response" body "token_type" property must be a non-empty string');
440
+ if (n.token_type = n.token_type.toLowerCase(), n.token_type !== "dpop" && n.token_type !== "bearer")
441
+ throw new p("unsupported `token_type` value");
442
+ if (n.expires_in !== void 0 && (typeof n.expires_in != "number" || n.expires_in <= 0))
443
+ throw new o('"response" body "expires_in" property must be a positive number');
444
+ if (!i && n.refresh_token !== void 0 && !f(n.refresh_token))
445
+ throw new o('"response" body "refresh_token" property must be a non-empty string');
446
+ if (n.scope !== void 0 && typeof n.scope != "string")
447
+ throw new o('"response" body "scope" property must be a string');
448
+ if (!a) {
449
+ if (n.id_token !== void 0 && !f(n.id_token))
450
+ throw new o('"response" body "id_token" property must be a non-empty string');
451
+ if (n.id_token) {
452
+ const { claims: s } = await Ye(n.id_token, et.bind(void 0, t.id_token_signed_response_alg, e.id_token_signing_alg_values_supported), oe, j(t), je(t)).then(Ge.bind(void 0, ["aud", "exp", "iat", "iss", "sub"])).then(Be.bind(void 0, e.issuer)).then(Me.bind(void 0, t.client_id));
453
+ if (Array.isArray(s.aud) && s.aud.length !== 1 && s.azp !== t.client_id)
454
+ throw new o('unexpected ID Token "azp" (authorized party) claim value');
455
+ if (s.auth_time !== void 0 && (!Number.isFinite(s.auth_time) || Math.sign(s.auth_time) !== 1))
456
+ throw new o('ID Token "auth_time" (authentication time) must be a positive number');
457
+ De.set(n, s);
458
+ }
459
+ }
460
+ return n;
461
+ }
462
+ function Me(e, t) {
463
+ if (Array.isArray(t.claims.aud)) {
464
+ if (!t.claims.aud.includes(e))
465
+ throw new o('unexpected JWT "aud" (audience) claim value');
466
+ } else if (t.claims.aud !== e)
467
+ throw new o('unexpected JWT "aud" (audience) claim value');
468
+ return t;
469
+ }
470
+ function Be(e, t) {
471
+ if (t.claims.iss !== e)
472
+ throw new o('unexpected JWT "iss" (issuer) claim value');
473
+ return t;
474
+ }
475
+ const ae = /* @__PURE__ */ new WeakSet();
476
+ function qe(e) {
477
+ return ae.add(e), e;
478
+ }
479
+ async function Ve(e, t, r, a, i, n) {
480
+ if (C(e), U(t), !ae.has(r))
481
+ throw new TypeError('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()');
482
+ if (!f(a))
483
+ throw new TypeError('"redirectUri" must be a non-empty string');
484
+ if (!f(i))
485
+ throw new TypeError('"codeVerifier" must be a non-empty string');
486
+ const s = g(r, "code");
487
+ if (!s)
488
+ throw new o('no authorization code in "callbackParameters"');
489
+ const u = new URLSearchParams(n == null ? void 0 : n.additionalParameters);
490
+ return u.set("redirect_uri", a), u.set("code_verifier", i), u.set("code", s), $e(e, t, "authorization_code", u, n);
491
+ }
492
+ const Fe = {
493
+ aud: "audience",
494
+ c_hash: "code hash",
495
+ client_id: "client id",
496
+ exp: "expiration time",
497
+ iat: "issued at",
498
+ iss: "issuer",
499
+ jti: "jwt id",
500
+ nonce: "nonce",
501
+ s_hash: "state hash",
502
+ sub: "subject",
503
+ ath: "access token hash",
504
+ htm: "http method",
505
+ htu: "http uri",
506
+ cnf: "confirmation"
507
+ };
508
+ function Ge(e, t) {
509
+ for (const r of e)
510
+ if (t.claims[r] === void 0)
511
+ throw new o(`JWT "${r}" (${Fe[r]}) claim missing`);
512
+ return t;
513
+ }
514
+ async function Qe(e, t, r) {
515
+ const a = await Ie(e, t, r, !0);
516
+ if (O(a))
517
+ return a;
518
+ if (a.id_token !== void 0) {
519
+ if (typeof a.id_token == "string" && a.id_token.length)
520
+ throw new o("Unexpected ID Token returned, use processAuthorizationCodeOpenIDResponse() for OpenID Connect callback processing");
521
+ delete a.id_token;
522
+ }
523
+ return a;
524
+ }
525
+ function D(e) {
526
+ if (e.bodyUsed)
527
+ throw new TypeError('"response" body has been used already');
528
+ }
529
+ async function Ze(e) {
530
+ if (e.status > 399 && e.status < 500) {
531
+ D(e);
532
+ try {
533
+ const t = await e.json();
534
+ if (A(t) && typeof t.error == "string" && t.error.length)
535
+ return t.error_description !== void 0 && typeof t.error_description != "string" && delete t.error_description, t.error_uri !== void 0 && typeof t.error_uri != "string" && delete t.error_uri, t.algs !== void 0 && typeof t.algs != "string" && delete t.algs, t.scope !== void 0 && typeof t.scope != "string" && delete t.scope, t;
536
+ } catch {
537
+ }
538
+ }
539
+ }
540
+ function G(e) {
541
+ if (typeof e.modulusLength != "number" || e.modulusLength < 2048)
542
+ throw new o(`${e.name} modulusLength must be at least 2048 bits`);
543
+ }
544
+ function Xe(e) {
545
+ switch (e) {
546
+ case "P-256":
547
+ return "SHA-256";
548
+ case "P-384":
549
+ return "SHA-384";
550
+ case "P-521":
551
+ return "SHA-512";
552
+ default:
553
+ throw new p();
554
+ }
555
+ }
556
+ function se(e) {
557
+ switch (e.algorithm.name) {
558
+ case "ECDSA":
559
+ return {
560
+ name: e.algorithm.name,
561
+ hash: Xe(e.algorithm.namedCurve)
562
+ };
563
+ case "RSA-PSS":
564
+ switch (G(e.algorithm), e.algorithm.hash.name) {
565
+ case "SHA-256":
566
+ case "SHA-384":
567
+ case "SHA-512":
568
+ return {
569
+ name: e.algorithm.name,
570
+ saltLength: parseInt(e.algorithm.hash.name.slice(-3), 10) >> 3
571
+ };
572
+ default:
573
+ throw new p();
574
+ }
575
+ case "RSASSA-PKCS1-v1_5":
576
+ return G(e.algorithm), e.algorithm.name;
577
+ case "Ed448":
578
+ case "Ed25519":
579
+ return e.algorithm.name;
580
+ }
581
+ throw new p();
582
+ }
583
+ const oe = Symbol();
584
+ async function Ye(e, t, r, a, i) {
585
+ const { 0: n, 1: s, 2: u, length: h } = e.split(".");
586
+ if (h === 5)
587
+ throw new p("JWE structure JWTs are not supported");
588
+ if (h !== 3)
589
+ throw new o("Invalid JWT");
590
+ let l;
591
+ try {
592
+ l = JSON.parse(b(_(n)));
593
+ } catch (y) {
594
+ throw new o("failed to parse JWT Header body as base64url encoded JSON", { cause: y });
595
+ }
596
+ if (!A(l))
597
+ throw new o("JWT Header must be a top level object");
598
+ if (t(l), l.crit !== void 0)
599
+ throw new o('unexpected JWT "crit" header parameter');
600
+ const w = _(u);
601
+ let d;
602
+ if (r !== oe) {
603
+ d = await r(l);
604
+ const y = `${n}.${s}`;
605
+ if (!await crypto.subtle.verify(se(d), d, w, b(y)))
606
+ throw new o("JWT signature verification failed");
607
+ }
608
+ let c;
609
+ try {
610
+ c = JSON.parse(b(_(s)));
611
+ } catch (y) {
612
+ throw new o("failed to parse JWT Payload body as base64url encoded JSON", { cause: y });
613
+ }
614
+ if (!A(c))
615
+ throw new o("JWT Payload must be a top level object");
616
+ const m = $() + a;
617
+ if (c.exp !== void 0) {
618
+ if (typeof c.exp != "number")
619
+ throw new o('unexpected JWT "exp" (expiration time) claim type');
620
+ if (c.exp <= m - i)
621
+ throw new o('unexpected JWT "exp" (expiration time) claim value, timestamp is <= now()');
622
+ }
623
+ if (c.iat !== void 0 && typeof c.iat != "number")
624
+ throw new o('unexpected JWT "iat" (issued at) claim type');
625
+ if (c.iss !== void 0 && typeof c.iss != "string")
626
+ throw new o('unexpected JWT "iss" (issuer) claim type');
627
+ if (c.nbf !== void 0) {
628
+ if (typeof c.nbf != "number")
629
+ throw new o('unexpected JWT "nbf" (not before) claim type');
630
+ if (c.nbf > m + i)
631
+ throw new o('unexpected JWT "nbf" (not before) claim value, timestamp is > now()');
632
+ }
633
+ if (c.aud !== void 0 && typeof c.aud != "string" && !Array.isArray(c.aud))
634
+ throw new o('unexpected JWT "aud" (audience) claim type');
635
+ return { header: l, claims: c, signature: w, key: d };
636
+ }
637
+ function et(e, t, r) {
638
+ if (e !== void 0) {
639
+ if (r.alg !== e)
640
+ throw new o('unexpected JWT "alg" header parameter');
641
+ return;
642
+ }
643
+ if (Array.isArray(t)) {
644
+ if (!t.includes(r.alg))
645
+ throw new o('unexpected JWT "alg" header parameter');
646
+ return;
647
+ }
648
+ if (r.alg !== "RS256")
649
+ throw new o('unexpected JWT "alg" header parameter');
650
+ }
651
+ function g(e, t) {
652
+ const { 0: r, length: a } = e.getAll(t);
653
+ if (a > 1)
654
+ throw new o(`"${t}" parameter must be provided only once`);
655
+ return r;
656
+ }
657
+ const tt = Symbol(), rt = Symbol();
658
+ function nt(e, t, r, a) {
659
+ if (C(e), U(t), r instanceof URL && (r = r.searchParams), !(r instanceof URLSearchParams))
660
+ throw new TypeError('"parameters" must be an instance of URLSearchParams, or URL');
661
+ if (g(r, "response"))
662
+ throw new o('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()');
663
+ const i = g(r, "iss"), n = g(r, "state");
664
+ if (!i && e.authorization_response_iss_parameter_supported)
665
+ throw new o('response parameter "iss" (issuer) missing');
666
+ if (i && i !== e.issuer)
667
+ throw new o('unexpected "iss" (issuer) response parameter value');
668
+ switch (a) {
669
+ case void 0:
670
+ case rt:
671
+ if (n !== void 0)
672
+ throw new o('unexpected "state" response parameter encountered');
673
+ break;
674
+ case tt:
675
+ break;
676
+ default:
677
+ if (!f(a))
678
+ throw new o('"expectedState" must be a non-empty string');
679
+ if (n === void 0)
680
+ throw new o('response parameter "state" missing');
681
+ if (n !== a)
682
+ throw new o('unexpected "state" response parameter value');
683
+ }
684
+ const s = g(r, "error");
685
+ if (s)
686
+ return {
687
+ error: s,
688
+ error_description: g(r, "error_description"),
689
+ error_uri: g(r, "error_uri")
690
+ };
691
+ const u = g(r, "id_token"), h = g(r, "token");
692
+ if (u !== void 0 || h !== void 0)
693
+ throw new p("implicit and hybrid flows are not supported");
694
+ return qe(new URLSearchParams(r));
695
+ }
696
+ function at({
697
+ handleCallback: e
698
+ }) {
699
+ const t = ue(), r = he({
700
+ queryFn: () => e(new URL(window.location.href), t),
701
+ retry: 0,
702
+ queryKey: ["auth-callback"]
703
+ });
704
+ return r.isPending ? /* @__PURE__ */ T.jsx("div", { children: "Loading..." }) : r.error ? /* @__PURE__ */ T.jsxs("div", { children: [
705
+ "Error: ",
706
+ JSON.stringify(r.error)
707
+ ] }) : /* @__PURE__ */ T.jsx(de, { to: "/", replace: !0 });
708
+ }
709
+ const L = "/oauth/callback";
710
+ async function st(e) {
711
+ const t = typeof e == "string" ? new URL(e) : e, r = await be(t);
712
+ return await Se(t, r);
713
+ }
714
+ async function Q({
715
+ issuer: e,
716
+ authorizationEndpoint: t,
717
+ tokenEndpoint: r
718
+ }) {
719
+ return await st(e);
720
+ }
721
+ const ot = ({
722
+ issuer: e,
723
+ authorizationEndpoint: t,
724
+ tokenEndpoint: r,
725
+ clientId: a
726
+ }) => {
727
+ const i = {
728
+ client_id: a,
729
+ token_endpoint_auth_method: "none"
730
+ };
731
+ async function n(s, u) {
732
+ const h = s.searchParams, l = h.get("state"), w = await u.sessionStorage.get("codeVerifier");
733
+ if (!w)
734
+ return {
735
+ isLoggedIn: !1
736
+ };
737
+ const d = await Q({
738
+ issuer: e,
739
+ authorizationEndpoint: t,
740
+ tokenEndpoint: r
741
+ }), c = nt(
742
+ d,
743
+ i,
744
+ h,
745
+ l ?? void 0
746
+ );
747
+ if (O(c))
748
+ throw M.error("Error Response", c), new Error();
749
+ const m = new URL(s);
750
+ m.pathname = L, m.search = "";
751
+ const y = await Ve(
752
+ d,
753
+ i,
754
+ c,
755
+ m.toString(),
756
+ w
757
+ ), S = await Qe(
758
+ d,
759
+ i,
760
+ y
761
+ );
762
+ if (O(S))
763
+ throw M.error("Error Response", S), new Error(S.error);
764
+ const E = await (await ze(
765
+ d,
766
+ i,
767
+ S.access_token
768
+ )).json(), I = {
769
+ sub: E.sub,
770
+ email: E.email,
771
+ name: E.name,
772
+ email_verified: E.email_verified ?? !1,
773
+ picture: E.picture,
774
+ isLoggedIn: !0
775
+ };
776
+ return u.setUserProfile(I), I;
777
+ }
778
+ return {
779
+ logout: async (s) => {
780
+ await s.setUserProfile({ isLoggedIn: !1 });
781
+ },
782
+ login: async (s) => {
783
+ var m;
784
+ const u = "S256", h = await Q({
785
+ issuer: e,
786
+ authorizationEndpoint: t,
787
+ tokenEndpoint: r
788
+ });
789
+ if (!h.authorization_endpoint)
790
+ throw new Error("No authorization endpoint");
791
+ const l = Ee(), w = await ve(l);
792
+ await s.sessionStorage.set("codeVerifier", l);
793
+ const d = new URL(
794
+ h.authorization_endpoint
795
+ ), c = new URL(s.url);
796
+ if (c.pathname = L, c.search = "", d.searchParams.set("client_id", i.client_id), d.searchParams.set("redirect_uri", c.toString()), d.searchParams.set("response_type", "code"), d.searchParams.set("scope", "openid+profile+email"), d.searchParams.set("code_challenge", w), d.searchParams.set(
797
+ "code_challenge_method",
798
+ u
799
+ ), ((m = h.code_challenge_methods_supported) == null ? void 0 : m.includes(
800
+ "S256"
801
+ )) !== !0) {
802
+ const y = Ae();
803
+ d.searchParams.set("state", y);
804
+ }
805
+ location.href = d.href;
806
+ },
807
+ signRequest(s, u) {
808
+ return Promise.resolve(s);
809
+ },
810
+ getRoutes: () => [
811
+ {
812
+ path: L,
813
+ element: /* @__PURE__ */ T.jsx(at, { handleCallback: n })
814
+ }
815
+ ]
816
+ };
817
+ }, dt = ({
818
+ domain: e,
819
+ clientId: t,
820
+ audience: r
821
+ }) => ot({
822
+ type: "openid",
823
+ issuer: `https://${e}`,
824
+ clientId: t,
825
+ audience: r
826
+ });
827
+ export {
828
+ dt as default
829
+ };