zudoku 0.42.0 → 0.42.2
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.
- package/dist/app/main.js +0 -6
- package/dist/app/main.js.map +1 -1
- package/dist/config/validators/common.d.ts +288 -420
- package/dist/config/validators/common.js +0 -10
- package/dist/config/validators/common.js.map +1 -1
- package/dist/config/validators/validate.d.ts +108 -161
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/authentication/components/SignIn.d.ts +1 -1
- package/dist/lib/authentication/components/SignIn.js +5 -2
- package/dist/lib/authentication/components/SignIn.js.map +1 -1
- package/dist/lib/authentication/components/SignUp.d.ts +1 -1
- package/dist/lib/authentication/components/SignUp.js +4 -1
- package/dist/lib/authentication/components/SignUp.js.map +1 -1
- package/dist/lib/components/Markdown.d.ts +1 -3
- package/dist/lib/components/Markdown.js +14 -8
- package/dist/lib/components/Markdown.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +1 -1
- package/dist/lib/components/index.d.ts +1 -2
- package/dist/lib/core/ZudokuContext.d.ts +0 -7
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/errors/ErrorAlert.js +1 -1
- package/dist/lib/errors/ErrorAlert.js.map +1 -1
- package/dist/lib/plugins/openapi/CollapsibleCode.js +1 -1
- package/dist/lib/plugins/openapi/CollapsibleCode.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js +8 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/SidecarExamples.js +1 -1
- package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +5 -3
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/utils.d.ts +1 -0
- package/dist/lib/plugins/openapi/schema/utils.js +3 -0
- package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
- package/dist/lib/ui/Callout.js +1 -1
- package/dist/lib/ui/Callout.js.map +1 -1
- package/dist/lib/ui/SyntaxHighlight.d.ts +15 -10
- package/dist/lib/ui/SyntaxHighlight.js +60 -10
- package/dist/lib/ui/SyntaxHighlight.js.map +1 -1
- package/dist/lib/util/MdxComponents.d.ts +3 -9
- package/dist/lib/util/MdxComponents.js +10 -9
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/vite/config.js +0 -34
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/plugin-mdx.js +11 -4
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin.js +0 -2
- package/dist/vite/plugin.js.map +1 -1
- package/lib/AuthenticationPlugin-ByDF051g.js +99 -0
- package/lib/AuthenticationPlugin-ByDF051g.js.map +1 -0
- package/lib/{Button-Bdk_Ij3U.js → Button-BBNrKpQd.js} +3 -3
- package/lib/{Button-Bdk_Ij3U.js.map → Button-BBNrKpQd.js.map} +1 -1
- package/lib/{Callout-XadUe37J.js → Callout-D3Ja4OPX.js} +12 -12
- package/lib/{Callout-XadUe37J.js.map → Callout-D3Ja4OPX.js.map} +1 -1
- package/lib/Card-BtheiD7j.js +61 -0
- package/lib/Card-BtheiD7j.js.map +1 -0
- package/lib/{CategoryHeading-DZi-Szor.js → CategoryHeading-D06WK_Wo.js} +2 -2
- package/lib/{CategoryHeading-DZi-Szor.js.map → CategoryHeading-D06WK_Wo.js.map} +1 -1
- package/lib/{Dialog-CNf2oWXG.js → Dialog-ByYz4ABw.js} +2 -2
- package/lib/{Dialog-CNf2oWXG.js.map → Dialog-ByYz4ABw.js.map} +1 -1
- package/lib/{Drawer-BPBxzel2.js → Drawer-CEwbkLDb.js} +25 -25
- package/lib/{Drawer-BPBxzel2.js.map → Drawer-CEwbkLDb.js.map} +1 -1
- package/lib/Markdown-mFpg_n9p.js +17125 -0
- package/lib/Markdown-mFpg_n9p.js.map +1 -0
- package/lib/MdxPage-Cm7atiW3.js +85 -0
- package/lib/{MdxPage-Dxbq6lFr.js.map → MdxPage-Cm7atiW3.js.map} +1 -1
- package/lib/{OasProvider-DKpTJMH2.js → OasProvider-CDtbrUG_.js} +4 -4
- package/lib/{OasProvider-DKpTJMH2.js.map → OasProvider-CDtbrUG_.js.map} +1 -1
- package/lib/{OperationList-DVOyNeno.js → OperationList-DTyJIxKW.js} +1967 -1914
- package/lib/OperationList-DTyJIxKW.js.map +1 -0
- package/lib/{Pagination-COMmV-g9.js → Pagination-DLPL5z77.js} +4 -4
- package/lib/{Pagination-COMmV-g9.js.map → Pagination-DLPL5z77.js.map} +1 -1
- package/lib/RouteGuard-DRtEu9nh.js +744 -0
- package/lib/{RouteGuard-CGqivwrh.js.map → RouteGuard-DRtEu9nh.js.map} +1 -1
- package/lib/{SchemaList-BTWzXyYQ.js → SchemaList-B9lvArDe.js} +44 -43
- package/lib/{SchemaList-BTWzXyYQ.js.map → SchemaList-B9lvArDe.js.map} +1 -1
- package/lib/{SchemaView-DNKKW3nB.js → SchemaView-DXjql-Bl.js} +111 -108
- package/lib/SchemaView-DXjql-Bl.js.map +1 -0
- package/lib/Select-CT64Ou40.js +223 -0
- package/lib/{Select-m-ITdvFa.js.map → Select-CT64Ou40.js.map} +1 -1
- package/lib/SlotletProvider-CS_nO-XT.js +340 -0
- package/lib/SlotletProvider-CS_nO-XT.js.map +1 -0
- package/lib/SyntaxHighlight-CxhyyMkF.js +2890 -0
- package/lib/SyntaxHighlight-CxhyyMkF.js.map +1 -0
- package/lib/{Toc-CzMOgcPS.js → Toc-D_tV8_Ri.js} +3 -3
- package/lib/{Toc-CzMOgcPS.js.map → Toc-D_tV8_Ri.js.map} +1 -1
- package/lib/{chunk-BAXFHI7N-CFrZQ7Oh.js → chunk-BAXFHI7N-BVBOl9s0.js} +264 -257
- package/lib/{chunk-BAXFHI7N-CFrZQ7Oh.js.map → chunk-BAXFHI7N-BVBOl9s0.js.map} +1 -1
- package/lib/{circular-D__GEK2G.js → circular-ByJI6Mci.js} +47 -47
- package/lib/{circular-D__GEK2G.js.map → circular-ByJI6Mci.js.map} +1 -1
- package/lib/{cn-CwJPJKOE.js → cn-qaFjX9_3.js} +29 -28
- package/lib/{cn-CwJPJKOE.js.map → cn-qaFjX9_3.js.map} +1 -1
- package/lib/{createServer-B4l2NSkt.js → createServer-IW7v5hWm.js} +3868 -3724
- package/lib/{createServer-B4l2NSkt.js.map → createServer-IW7v5hWm.js.map} +1 -1
- package/lib/hook-CldJlP5c.js +1478 -0
- package/lib/{hook-CyNmcNr8.js.map → hook-CldJlP5c.js.map} +1 -1
- package/lib/{index-Z13x6tPX.js → index-CPNSgwSb.js} +5 -5
- package/lib/{index-Z13x6tPX.js.map → index-CPNSgwSb.js.map} +1 -1
- package/lib/{index-CCS3ifKs.js → index-Ckl3s_w-.js} +763 -769
- package/lib/index-Ckl3s_w-.js.map +1 -0
- package/lib/{index-CrcNWbel.js → index-CuBIgTKC.js} +9 -9
- package/lib/{index-CrcNWbel.js.map → index-CuBIgTKC.js.map} +1 -1
- package/lib/{index-zddirpDj.js → index-DcHeSvkE.js} +609 -581
- package/lib/{index-zddirpDj.js.map → index-DcHeSvkE.js.map} +1 -1
- package/lib/index-DnQftvP4.js +5031 -0
- package/lib/{index-BcMPFdRU.js.map → index-DnQftvP4.js.map} +1 -1
- package/lib/{index--oeBayMa.js → index-DwT-v3zK.js} +2 -2
- package/lib/{index--oeBayMa.js.map → index-DwT-v3zK.js.map} +1 -1
- package/lib/{index-BvvmIczU.js → index-LNp6rxyU.js} +2 -2
- package/lib/{index-BvvmIczU.js.map → index-LNp6rxyU.js.map} +1 -1
- package/lib/invariant-Caa8-XvF.js +26 -0
- package/lib/{invariant-D3QcI9fa.js.map → invariant-Caa8-XvF.js.map} +1 -1
- package/lib/mutation-DBQh7AOZ.js +211 -0
- package/lib/{mutation-narTVsCe.js.map → mutation-DBQh7AOZ.js.map} +1 -1
- package/lib/prism-bash.min-HHIMdNJ_.js +7 -0
- package/lib/prism-bash.min-HHIMdNJ_.js.map +1 -0
- package/lib/prism-csharp.min-C43x1RY2.js +63 -0
- package/lib/prism-csharp.min-C43x1RY2.js.map +1 -0
- package/lib/prism-java.min-CQzr40NQ.js +35 -0
- package/lib/prism-java.min-CQzr40NQ.js.map +1 -0
- package/lib/prism-javascript.min-CEqHqgbm.js +9 -0
- package/lib/prism-javascript.min-CEqHqgbm.js.map +1 -0
- package/lib/prism-json.min-B1GJqK1k.js +2 -0
- package/lib/prism-json.min-B1GJqK1k.js.map +1 -0
- package/lib/prism-jsstacktrace.min-BfobCF2F.js +2 -0
- package/lib/prism-jsstacktrace.min-BfobCF2F.js.map +1 -0
- package/lib/prism-markdown.min-C0Qn0m-5.js +61 -0
- package/lib/prism-markdown.min-C0Qn0m-5.js.map +1 -0
- package/lib/prism-markup-BNGj0Tvm.js +174 -0
- package/lib/prism-markup-BNGj0Tvm.js.map +1 -0
- package/lib/prism-objectivec.min-BXSWqpJJ.js +2 -0
- package/lib/prism-objectivec.min-BXSWqpJJ.js.map +1 -0
- package/lib/prism-ruby.min-L9OdQ6tU.js +38 -0
- package/lib/prism-ruby.min-L9OdQ6tU.js.map +1 -0
- package/lib/prism-typescript.min-qTySPvCh.js +34 -0
- package/lib/prism-typescript.min-qTySPvCh.js.map +1 -0
- package/lib/processors/removeParameters.js +28 -27
- package/lib/processors/removeParameters.js.map +1 -1
- package/lib/processors/removePaths.js +17 -17
- package/lib/processors/removePaths.js.map +1 -1
- package/lib/ui/Accordion.js +1 -1
- package/lib/ui/ActionButton.js +2 -2
- package/lib/ui/Alert.js +2 -2
- package/lib/ui/AlertDialog.js +1 -1
- package/lib/ui/Badge.js +2 -2
- package/lib/ui/Breadcrumb.js +1 -1
- package/lib/ui/Button.js +2 -2
- package/lib/ui/Callout.js +7 -7
- package/lib/ui/Callout.js.map +1 -1
- package/lib/ui/Card.js +1 -1
- package/lib/ui/Carousel.js +175 -175
- package/lib/ui/Carousel.js.map +1 -1
- package/lib/ui/Checkbox.js +1 -1
- package/lib/ui/Command.js +58 -58
- package/lib/ui/Command.js.map +1 -1
- package/lib/ui/Dialog.js +1 -1
- package/lib/ui/Drawer.js +2 -2
- package/lib/ui/DropdownMenu.js +1 -1
- package/lib/ui/Form.js +1 -1
- package/lib/ui/HoverCard.js +1 -1
- package/lib/ui/Input.js +1 -1
- package/lib/ui/Label.js +2 -2
- package/lib/ui/Pagination.js +1 -1
- package/lib/ui/Popover.js +1 -1
- package/lib/ui/Progress.js +1 -1
- package/lib/ui/RadioGroup.js +1 -1
- package/lib/ui/ScrollArea.js +1 -1
- package/lib/ui/Select.js +1 -1
- package/lib/ui/Skeleton.js +1 -1
- package/lib/ui/Slider.js +1 -1
- package/lib/ui/Switch.js +1 -1
- package/lib/ui/SyntaxHighlight.js +6 -4
- package/lib/ui/SyntaxHighlight.js.map +1 -1
- package/lib/ui/Tabs.js +1 -1
- package/lib/ui/Textarea.js +1 -1
- package/lib/ui/Toggle.js +2 -2
- package/lib/ui/ToggleGroup.js +1 -1
- package/lib/ui/Tooltip.js +1 -1
- package/lib/ui/util.js +1 -1
- package/lib/{useExposedProps-n1u49409.js → useExposedProps-DbIZXspi.js} +2 -2
- package/lib/{useExposedProps-n1u49409.js.map → useExposedProps-DbIZXspi.js.map} +1 -1
- package/lib/zudoku.auth-auth0.js +31 -28
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +68 -62
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +483 -475
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +7 -7
- package/lib/zudoku.hooks.js +2 -2
- package/lib/zudoku.plugin-api-catalog.js +45 -45
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +6 -6
- package/lib/zudoku.plugin-custom-pages.js +3 -3
- package/lib/zudoku.plugin-markdown.js +28 -25
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +3 -3
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/lib/zudoku.plugin-search-inkeep.js +27 -26
- package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +110 -107
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
- package/package.json +7 -17
- package/src/app/main.css +3 -53
- package/src/app/main.tsx +0 -7
- package/src/lib/authentication/components/SignIn.tsx +35 -2
- package/src/lib/authentication/components/SignUp.tsx +35 -1
- package/src/lib/components/Markdown.tsx +24 -29
- package/src/lib/core/ZudokuContext.ts +0 -4
- package/src/lib/errors/ErrorAlert.tsx +1 -1
- package/src/lib/plugins/openapi/CollapsibleCode.tsx +2 -5
- package/src/lib/plugins/openapi/ParameterListItem.tsx +30 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +1 -1
- package/src/lib/plugins/openapi/SidecarExamples.tsx +2 -2
- package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +7 -4
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +1 -6
- package/src/lib/plugins/openapi/schema/utils.ts +5 -0
- package/src/lib/ui/Callout.tsx +1 -1
- package/src/lib/ui/SyntaxHighlight.tsx +182 -18
- package/src/lib/util/MdxComponents.tsx +14 -27
- package/dist/lib/shiki.d.ts +0 -35
- package/dist/lib/shiki.js +0 -103
- package/dist/lib/shiki.js.map +0 -1
- package/dist/lib/ui/CodeBlock.d.ts +0 -16
- package/dist/lib/ui/CodeBlock.js +0 -18
- package/dist/lib/ui/CodeBlock.js.map +0 -1
- package/dist/vite/plugin-shiki-register.d.ts +0 -3
- package/dist/vite/plugin-shiki-register.js +0 -38
- package/dist/vite/plugin-shiki-register.js.map +0 -1
- package/lib/AuthenticationPlugin-EeQpQI3D.js +0 -55
- package/lib/AuthenticationPlugin-EeQpQI3D.js.map +0 -1
- package/lib/Markdown-1l-DtDbF.js +0 -7688
- package/lib/Markdown-1l-DtDbF.js.map +0 -1
- package/lib/MdxPage-Dxbq6lFr.js +0 -84
- package/lib/OperationList-DVOyNeno.js.map +0 -1
- package/lib/RouteGuard-CGqivwrh.js +0 -733
- package/lib/SchemaView-DNKKW3nB.js.map +0 -1
- package/lib/Select-m-ITdvFa.js +0 -211
- package/lib/SlotletProvider-DhK1Fmm9.js +0 -254
- package/lib/SlotletProvider-DhK1Fmm9.js.map +0 -1
- package/lib/SyntaxHighlight-CJ6FoYvt.js +0 -9104
- package/lib/SyntaxHighlight-CJ6FoYvt.js.map +0 -1
- package/lib/hook-CyNmcNr8.js +0 -1443
- package/lib/index-BcMPFdRU.js +0 -4975
- package/lib/index-CCS3ifKs.js.map +0 -1
- package/lib/invariant-D3QcI9fa.js +0 -22
- package/lib/mutation-narTVsCe.js +0 -196
- package/lib/ui/CodeBlock.js +0 -83
- package/lib/ui/CodeBlock.js.map +0 -1
- package/src/lib/shiki.ts +0 -129
- package/src/lib/ui/CodeBlock.tsx +0 -102
- package/src/shiki/langs/abap.js +0 -1
- package/src/shiki/langs/actionscript-3.js +0 -1
- package/src/shiki/langs/ada.js +0 -1
- package/src/shiki/langs/angular-expression.js +0 -1
- package/src/shiki/langs/angular-html.js +0 -1
- package/src/shiki/langs/angular-inline-style.js +0 -1
- package/src/shiki/langs/angular-inline-template.js +0 -1
- package/src/shiki/langs/angular-let-declaration.js +0 -1
- package/src/shiki/langs/angular-template-blocks.js +0 -1
- package/src/shiki/langs/angular-template.js +0 -1
- package/src/shiki/langs/angular-ts.js +0 -1
- package/src/shiki/langs/apache.js +0 -1
- package/src/shiki/langs/apex.js +0 -1
- package/src/shiki/langs/apl.js +0 -1
- package/src/shiki/langs/applescript.js +0 -1
- package/src/shiki/langs/ara.js +0 -1
- package/src/shiki/langs/asciidoc.js +0 -1
- package/src/shiki/langs/asm.js +0 -1
- package/src/shiki/langs/astro.js +0 -1
- package/src/shiki/langs/awk.js +0 -1
- package/src/shiki/langs/ballerina.js +0 -1
- package/src/shiki/langs/bat.js +0 -1
- package/src/shiki/langs/beancount.js +0 -1
- package/src/shiki/langs/berry.js +0 -1
- package/src/shiki/langs/bibtex.js +0 -1
- package/src/shiki/langs/bicep.js +0 -1
- package/src/shiki/langs/blade.js +0 -1
- package/src/shiki/langs/bsl.js +0 -1
- package/src/shiki/langs/c.js +0 -1
- package/src/shiki/langs/cadence.js +0 -1
- package/src/shiki/langs/cairo.js +0 -1
- package/src/shiki/langs/clarity.js +0 -1
- package/src/shiki/langs/clojure.js +0 -1
- package/src/shiki/langs/cmake.js +0 -1
- package/src/shiki/langs/cobol.js +0 -1
- package/src/shiki/langs/codeowners.js +0 -1
- package/src/shiki/langs/codeql.js +0 -1
- package/src/shiki/langs/coffee.js +0 -1
- package/src/shiki/langs/common-lisp.js +0 -1
- package/src/shiki/langs/coq.js +0 -1
- package/src/shiki/langs/cpp-macro.js +0 -1
- package/src/shiki/langs/cpp.js +0 -1
- package/src/shiki/langs/crystal.js +0 -1
- package/src/shiki/langs/csharp.js +0 -1
- package/src/shiki/langs/css.js +0 -1
- package/src/shiki/langs/csv.js +0 -1
- package/src/shiki/langs/cue.js +0 -1
- package/src/shiki/langs/cypher.js +0 -1
- package/src/shiki/langs/d.js +0 -1
- package/src/shiki/langs/dart.js +0 -1
- package/src/shiki/langs/dax.js +0 -1
- package/src/shiki/langs/desktop.js +0 -1
- package/src/shiki/langs/diff.js +0 -1
- package/src/shiki/langs/docker.js +0 -1
- package/src/shiki/langs/dotenv.js +0 -1
- package/src/shiki/langs/dream-maker.js +0 -1
- package/src/shiki/langs/edge.js +0 -1
- package/src/shiki/langs/elixir.js +0 -1
- package/src/shiki/langs/elm.js +0 -1
- package/src/shiki/langs/emacs-lisp.js +0 -1
- package/src/shiki/langs/erb.js +0 -1
- package/src/shiki/langs/erlang.js +0 -1
- package/src/shiki/langs/es-tag-css.js +0 -1
- package/src/shiki/langs/es-tag-glsl.js +0 -1
- package/src/shiki/langs/es-tag-html.js +0 -1
- package/src/shiki/langs/es-tag-sql.js +0 -1
- package/src/shiki/langs/es-tag-xml.js +0 -1
- package/src/shiki/langs/fennel.js +0 -1
- package/src/shiki/langs/fish.js +0 -1
- package/src/shiki/langs/fluent.js +0 -1
- package/src/shiki/langs/fortran-fixed-form.js +0 -1
- package/src/shiki/langs/fortran-free-form.js +0 -1
- package/src/shiki/langs/fsharp.js +0 -1
- package/src/shiki/langs/gdresource.js +0 -1
- package/src/shiki/langs/gdscript.js +0 -1
- package/src/shiki/langs/gdshader.js +0 -1
- package/src/shiki/langs/genie.js +0 -1
- package/src/shiki/langs/gherkin.js +0 -1
- package/src/shiki/langs/git-commit.js +0 -1
- package/src/shiki/langs/git-rebase.js +0 -1
- package/src/shiki/langs/gleam.js +0 -1
- package/src/shiki/langs/glimmer-js.js +0 -1
- package/src/shiki/langs/glimmer-ts.js +0 -1
- package/src/shiki/langs/glsl.js +0 -1
- package/src/shiki/langs/gnuplot.js +0 -1
- package/src/shiki/langs/go.js +0 -1
- package/src/shiki/langs/graphql.js +0 -1
- package/src/shiki/langs/groovy.js +0 -1
- package/src/shiki/langs/hack.js +0 -1
- package/src/shiki/langs/haml.js +0 -1
- package/src/shiki/langs/handlebars.js +0 -1
- package/src/shiki/langs/haskell.js +0 -1
- package/src/shiki/langs/haxe.js +0 -1
- package/src/shiki/langs/hcl.js +0 -1
- package/src/shiki/langs/hjson.js +0 -1
- package/src/shiki/langs/hlsl.js +0 -1
- package/src/shiki/langs/html-derivative.js +0 -1
- package/src/shiki/langs/html.js +0 -1
- package/src/shiki/langs/http.js +0 -1
- package/src/shiki/langs/hxml.js +0 -1
- package/src/shiki/langs/hy.js +0 -1
- package/src/shiki/langs/imba.js +0 -1
- package/src/shiki/langs/ini.js +0 -1
- package/src/shiki/langs/java.js +0 -1
- package/src/shiki/langs/javascript.js +0 -1
- package/src/shiki/langs/jinja-html.js +0 -1
- package/src/shiki/langs/jinja.js +0 -1
- package/src/shiki/langs/jison.js +0 -1
- package/src/shiki/langs/json.js +0 -1
- package/src/shiki/langs/json5.js +0 -1
- package/src/shiki/langs/jsonc.js +0 -1
- package/src/shiki/langs/jsonl.js +0 -1
- package/src/shiki/langs/jsonnet.js +0 -1
- package/src/shiki/langs/jssm.js +0 -1
- package/src/shiki/langs/jsx.js +0 -1
- package/src/shiki/langs/julia.js +0 -1
- package/src/shiki/langs/kotlin.js +0 -1
- package/src/shiki/langs/kusto.js +0 -1
- package/src/shiki/langs/latex.js +0 -1
- package/src/shiki/langs/lean.js +0 -1
- package/src/shiki/langs/less.js +0 -1
- package/src/shiki/langs/liquid.js +0 -1
- package/src/shiki/langs/llvm.js +0 -1
- package/src/shiki/langs/log.js +0 -1
- package/src/shiki/langs/logo.js +0 -1
- package/src/shiki/langs/lua.js +0 -1
- package/src/shiki/langs/luau.js +0 -1
- package/src/shiki/langs/make.js +0 -1
- package/src/shiki/langs/markdown-vue.js +0 -1
- package/src/shiki/langs/markdown.js +0 -1
- package/src/shiki/langs/marko.js +0 -1
- package/src/shiki/langs/matlab.js +0 -1
- package/src/shiki/langs/mdc.js +0 -1
- package/src/shiki/langs/mdx.js +0 -1
- package/src/shiki/langs/mermaid.js +0 -1
- package/src/shiki/langs/mipsasm.js +0 -1
- package/src/shiki/langs/mojo.js +0 -1
- package/src/shiki/langs/move.js +0 -1
- package/src/shiki/langs/narrat.js +0 -1
- package/src/shiki/langs/nextflow.js +0 -1
- package/src/shiki/langs/nginx.js +0 -1
- package/src/shiki/langs/nim.js +0 -1
- package/src/shiki/langs/nix.js +0 -1
- package/src/shiki/langs/nushell.js +0 -1
- package/src/shiki/langs/objective-c.js +0 -1
- package/src/shiki/langs/objective-cpp.js +0 -1
- package/src/shiki/langs/ocaml.js +0 -1
- package/src/shiki/langs/pascal.js +0 -1
- package/src/shiki/langs/perl.js +0 -1
- package/src/shiki/langs/php.js +0 -1
- package/src/shiki/langs/plsql.js +0 -1
- package/src/shiki/langs/po.js +0 -1
- package/src/shiki/langs/polar.js +0 -1
- package/src/shiki/langs/postcss.js +0 -1
- package/src/shiki/langs/powerquery.js +0 -1
- package/src/shiki/langs/powershell.js +0 -1
- package/src/shiki/langs/prisma.js +0 -1
- package/src/shiki/langs/prolog.js +0 -1
- package/src/shiki/langs/proto.js +0 -1
- package/src/shiki/langs/pug.js +0 -1
- package/src/shiki/langs/puppet.js +0 -1
- package/src/shiki/langs/purescript.js +0 -1
- package/src/shiki/langs/python.js +0 -1
- package/src/shiki/langs/qml.js +0 -1
- package/src/shiki/langs/qmldir.js +0 -1
- package/src/shiki/langs/qss.js +0 -1
- package/src/shiki/langs/r.js +0 -1
- package/src/shiki/langs/racket.js +0 -1
- package/src/shiki/langs/raku.js +0 -1
- package/src/shiki/langs/razor.js +0 -1
- package/src/shiki/langs/reg.js +0 -1
- package/src/shiki/langs/regexp.js +0 -1
- package/src/shiki/langs/rel.js +0 -1
- package/src/shiki/langs/riscv.js +0 -1
- package/src/shiki/langs/rst.js +0 -1
- package/src/shiki/langs/ruby.js +0 -1
- package/src/shiki/langs/rust.js +0 -1
- package/src/shiki/langs/sas.js +0 -1
- package/src/shiki/langs/sass.js +0 -1
- package/src/shiki/langs/scala.js +0 -1
- package/src/shiki/langs/scheme.js +0 -1
- package/src/shiki/langs/scss.js +0 -1
- package/src/shiki/langs/sdbl.js +0 -1
- package/src/shiki/langs/shaderlab.js +0 -1
- package/src/shiki/langs/shellscript.js +0 -1
- package/src/shiki/langs/shellsession.js +0 -1
- package/src/shiki/langs/smalltalk.js +0 -1
- package/src/shiki/langs/solidity.js +0 -1
- package/src/shiki/langs/soy.js +0 -1
- package/src/shiki/langs/sparql.js +0 -1
- package/src/shiki/langs/splunk.js +0 -1
- package/src/shiki/langs/sql.js +0 -1
- package/src/shiki/langs/ssh-config.js +0 -1
- package/src/shiki/langs/stata.js +0 -1
- package/src/shiki/langs/stylus.js +0 -1
- package/src/shiki/langs/svelte.js +0 -1
- package/src/shiki/langs/swift.js +0 -1
- package/src/shiki/langs/system-verilog.js +0 -1
- package/src/shiki/langs/systemd.js +0 -1
- package/src/shiki/langs/talonscript.js +0 -1
- package/src/shiki/langs/tasl.js +0 -1
- package/src/shiki/langs/tcl.js +0 -1
- package/src/shiki/langs/templ.js +0 -1
- package/src/shiki/langs/terraform.js +0 -1
- package/src/shiki/langs/tex.js +0 -1
- package/src/shiki/langs/toml.js +0 -1
- package/src/shiki/langs/ts-tags.js +0 -1
- package/src/shiki/langs/tsv.js +0 -1
- package/src/shiki/langs/tsx.js +0 -1
- package/src/shiki/langs/turtle.js +0 -1
- package/src/shiki/langs/twig.js +0 -1
- package/src/shiki/langs/typescript.js +0 -1
- package/src/shiki/langs/typespec.js +0 -1
- package/src/shiki/langs/typst.js +0 -1
- package/src/shiki/langs/v.js +0 -1
- package/src/shiki/langs/vala.js +0 -1
- package/src/shiki/langs/vb.js +0 -1
- package/src/shiki/langs/verilog.js +0 -1
- package/src/shiki/langs/vhdl.js +0 -1
- package/src/shiki/langs/viml.js +0 -1
- package/src/shiki/langs/vue-directives.js +0 -1
- package/src/shiki/langs/vue-html.js +0 -1
- package/src/shiki/langs/vue-interpolations.js +0 -1
- package/src/shiki/langs/vue-sfc-style-variable-injection.js +0 -1
- package/src/shiki/langs/vue.js +0 -1
- package/src/shiki/langs/vyper.js +0 -1
- package/src/shiki/langs/wasm.js +0 -1
- package/src/shiki/langs/wenyan.js +0 -1
- package/src/shiki/langs/wgsl.js +0 -1
- package/src/shiki/langs/wikitext.js +0 -1
- package/src/shiki/langs/wit.js +0 -1
- package/src/shiki/langs/wolfram.js +0 -1
- package/src/shiki/langs/xml.js +0 -1
- package/src/shiki/langs/xsl.js +0 -1
- package/src/shiki/langs/yaml.js +0 -1
- package/src/shiki/langs/zenscript.js +0 -1
- package/src/shiki/langs/zig.js +0 -1
- package/src/shiki/themes/andromeeda.js +0 -1
- package/src/shiki/themes/aurora-x.js +0 -1
- package/src/shiki/themes/ayu-dark.js +0 -1
- package/src/shiki/themes/catppuccin-frappe.js +0 -1
- package/src/shiki/themes/catppuccin-latte.js +0 -1
- package/src/shiki/themes/catppuccin-macchiato.js +0 -1
- package/src/shiki/themes/catppuccin-mocha.js +0 -1
- package/src/shiki/themes/dark-plus.js +0 -1
- package/src/shiki/themes/dracula-soft.js +0 -1
- package/src/shiki/themes/dracula.js +0 -1
- package/src/shiki/themes/everforest-dark.js +0 -1
- package/src/shiki/themes/everforest-light.js +0 -1
- package/src/shiki/themes/github-dark-default.js +0 -1
- package/src/shiki/themes/github-dark-dimmed.js +0 -1
- package/src/shiki/themes/github-dark-high-contrast.js +0 -1
- package/src/shiki/themes/github-dark.js +0 -1
- package/src/shiki/themes/github-light-default.js +0 -1
- package/src/shiki/themes/github-light-high-contrast.js +0 -1
- package/src/shiki/themes/github-light.js +0 -1
- package/src/shiki/themes/gruvbox-dark-hard.js +0 -1
- package/src/shiki/themes/gruvbox-dark-medium.js +0 -1
- package/src/shiki/themes/gruvbox-dark-soft.js +0 -1
- package/src/shiki/themes/gruvbox-light-hard.js +0 -1
- package/src/shiki/themes/gruvbox-light-medium.js +0 -1
- package/src/shiki/themes/gruvbox-light-soft.js +0 -1
- package/src/shiki/themes/houston.js +0 -1
- package/src/shiki/themes/kanagawa-dragon.js +0 -1
- package/src/shiki/themes/kanagawa-lotus.js +0 -1
- package/src/shiki/themes/kanagawa-wave.js +0 -1
- package/src/shiki/themes/laserwave.js +0 -1
- package/src/shiki/themes/light-plus.js +0 -1
- package/src/shiki/themes/material-theme-darker.js +0 -1
- package/src/shiki/themes/material-theme-lighter.js +0 -1
- package/src/shiki/themes/material-theme-ocean.js +0 -1
- package/src/shiki/themes/material-theme-palenight.js +0 -1
- package/src/shiki/themes/material-theme.js +0 -1
- package/src/shiki/themes/min-dark.js +0 -1
- package/src/shiki/themes/min-light.js +0 -1
- package/src/shiki/themes/monokai.js +0 -1
- package/src/shiki/themes/night-owl.js +0 -1
- package/src/shiki/themes/nord.js +0 -1
- package/src/shiki/themes/one-dark-pro.js +0 -1
- package/src/shiki/themes/one-light.js +0 -1
- package/src/shiki/themes/plastic.js +0 -1
- package/src/shiki/themes/poimandres.js +0 -1
- package/src/shiki/themes/red.js +0 -1
- package/src/shiki/themes/rose-pine-dawn.js +0 -1
- package/src/shiki/themes/rose-pine-moon.js +0 -1
- package/src/shiki/themes/rose-pine.js +0 -1
- package/src/shiki/themes/slack-dark.js +0 -1
- package/src/shiki/themes/slack-ochin.js +0 -1
- package/src/shiki/themes/snazzy-light.js +0 -1
- package/src/shiki/themes/solarized-dark.js +0 -1
- package/src/shiki/themes/solarized-light.js +0 -1
- package/src/shiki/themes/synthwave-84.js +0 -1
- package/src/shiki/themes/tokyo-night.js +0 -1
- package/src/shiki/themes/vesper.js +0 -1
- package/src/shiki/themes/vitesse-black.js +0 -1
- package/src/shiki/themes/vitesse-dark.js +0 -1
- package/src/shiki/themes/vitesse-light.js +0 -1
|
@@ -1,26 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
var Ce = Object.defineProperty;
|
|
2
|
+
var Le = (t, e, n) => e in t ? Ce(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var w = (t, e, n) => Le(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { j as B } from "./jsx-runtime-C5mzlN2N.js";
|
|
5
|
+
import { g as xe } from "./_commonjsHelpers-B4e78b8K.js";
|
|
6
|
+
import { C as Ie } from "./ClientOnly-E7hGysn1.js";
|
|
7
|
+
import { d as je, f as ie, u as L } from "./hook-CldJlP5c.js";
|
|
8
|
+
import { A as Je } from "./AuthenticationPlugin-ByDF051g.js";
|
|
9
|
+
import { N as Oe } from "./chunk-BAXFHI7N-BVBOl9s0.js";
|
|
10
|
+
import { Z as ze } from "./invariant-Caa8-XvF.js";
|
|
11
|
+
var D = { exports: {} }, De = D.exports, ae;
|
|
12
|
+
function Ne() {
|
|
13
|
+
return ae || (ae = 1, function(t) {
|
|
11
14
|
(function(e, n) {
|
|
12
15
|
t.exports ? t.exports = n() : e.log = n();
|
|
13
|
-
})(
|
|
16
|
+
})(De, function() {
|
|
14
17
|
var e = function() {
|
|
15
|
-
}, n = "undefined", o = typeof window !== n && typeof window.navigator !== n && /Trident\/|MSIE /.test(window.navigator.userAgent),
|
|
18
|
+
}, n = "undefined", o = typeof window !== n && typeof window.navigator !== n && /Trident\/|MSIE /.test(window.navigator.userAgent), a = [
|
|
16
19
|
"trace",
|
|
17
20
|
"debug",
|
|
18
21
|
"info",
|
|
19
22
|
"warn",
|
|
20
23
|
"error"
|
|
21
24
|
], r = {}, i = null;
|
|
22
|
-
function c(l,
|
|
23
|
-
var u = l[
|
|
25
|
+
function c(l, m) {
|
|
26
|
+
var u = l[m];
|
|
24
27
|
if (typeof u.bind == "function")
|
|
25
28
|
return u.bind(l);
|
|
26
29
|
try {
|
|
@@ -34,76 +37,76 @@ function je() {
|
|
|
34
37
|
function p() {
|
|
35
38
|
console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace();
|
|
36
39
|
}
|
|
37
|
-
function
|
|
40
|
+
function _(l) {
|
|
38
41
|
return l === "debug" && (l = "log"), typeof console === n ? !1 : l === "trace" && o ? p : console[l] !== void 0 ? c(console, l) : console.log !== void 0 ? c(console, "log") : e;
|
|
39
42
|
}
|
|
40
43
|
function f() {
|
|
41
|
-
for (var l = this.getLevel(),
|
|
42
|
-
var u =
|
|
43
|
-
this[u] =
|
|
44
|
+
for (var l = this.getLevel(), m = 0; m < a.length; m++) {
|
|
45
|
+
var u = a[m];
|
|
46
|
+
this[u] = m < l ? e : this.methodFactory(u, l, this.name);
|
|
44
47
|
}
|
|
45
48
|
if (this.log = this.debug, typeof console === n && l < this.levels.SILENT)
|
|
46
49
|
return "No console available for logging";
|
|
47
50
|
}
|
|
48
|
-
function
|
|
51
|
+
function v(l) {
|
|
49
52
|
return function() {
|
|
50
53
|
typeof console !== n && (f.call(this), this[l].apply(this, arguments));
|
|
51
54
|
};
|
|
52
55
|
}
|
|
53
|
-
function b(l,
|
|
54
|
-
return
|
|
56
|
+
function b(l, m, u) {
|
|
57
|
+
return _(l) || v.apply(this, arguments);
|
|
55
58
|
}
|
|
56
|
-
function d(l,
|
|
57
|
-
var u = this,
|
|
58
|
-
typeof l == "string" ?
|
|
59
|
-
function
|
|
60
|
-
var
|
|
61
|
-
if (!(typeof window === n || !
|
|
59
|
+
function d(l, m) {
|
|
60
|
+
var u = this, J, $, U, S = "loglevel";
|
|
61
|
+
typeof l == "string" ? S += ":" + l : typeof l == "symbol" && (S = void 0);
|
|
62
|
+
function Re(h) {
|
|
63
|
+
var y = (a[h] || "silent").toUpperCase();
|
|
64
|
+
if (!(typeof window === n || !S)) {
|
|
62
65
|
try {
|
|
63
|
-
window.localStorage[
|
|
66
|
+
window.localStorage[S] = y;
|
|
64
67
|
return;
|
|
65
68
|
} catch {
|
|
66
69
|
}
|
|
67
70
|
try {
|
|
68
|
-
window.document.cookie = encodeURIComponent(
|
|
71
|
+
window.document.cookie = encodeURIComponent(S) + "=" + y + ";";
|
|
69
72
|
} catch {
|
|
70
73
|
}
|
|
71
74
|
}
|
|
72
75
|
}
|
|
73
|
-
function
|
|
76
|
+
function ne() {
|
|
74
77
|
var h;
|
|
75
|
-
if (!(typeof window === n || !
|
|
78
|
+
if (!(typeof window === n || !S)) {
|
|
76
79
|
try {
|
|
77
|
-
h = window.localStorage[
|
|
80
|
+
h = window.localStorage[S];
|
|
78
81
|
} catch {
|
|
79
82
|
}
|
|
80
83
|
if (typeof h === n)
|
|
81
84
|
try {
|
|
82
|
-
var
|
|
83
|
-
|
|
84
|
-
|
|
85
|
+
var y = window.document.cookie, O = encodeURIComponent(S), oe = y.indexOf(O + "=");
|
|
86
|
+
oe !== -1 && (h = /^([^;]+)/.exec(
|
|
87
|
+
y.slice(oe + O.length + 1)
|
|
85
88
|
)[1]);
|
|
86
89
|
} catch {
|
|
87
90
|
}
|
|
88
91
|
return u.levels[h] === void 0 && (h = void 0), h;
|
|
89
92
|
}
|
|
90
93
|
}
|
|
91
|
-
function
|
|
92
|
-
if (!(typeof window === n || !
|
|
94
|
+
function Pe() {
|
|
95
|
+
if (!(typeof window === n || !S)) {
|
|
93
96
|
try {
|
|
94
|
-
window.localStorage.removeItem(
|
|
97
|
+
window.localStorage.removeItem(S);
|
|
95
98
|
} catch {
|
|
96
99
|
}
|
|
97
100
|
try {
|
|
98
|
-
window.document.cookie = encodeURIComponent(
|
|
101
|
+
window.document.cookie = encodeURIComponent(S) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
|
|
99
102
|
} catch {
|
|
100
103
|
}
|
|
101
104
|
}
|
|
102
105
|
}
|
|
103
|
-
function
|
|
104
|
-
var
|
|
105
|
-
if (typeof
|
|
106
|
-
return
|
|
106
|
+
function C(h) {
|
|
107
|
+
var y = h;
|
|
108
|
+
if (typeof y == "string" && u.levels[y.toUpperCase()] !== void 0 && (y = u.levels[y.toUpperCase()]), typeof y == "number" && y >= 0 && y <= u.levels.SILENT)
|
|
109
|
+
return y;
|
|
107
110
|
throw new TypeError("log.setLevel() called with invalid level: " + h);
|
|
108
111
|
}
|
|
109
112
|
u.name = l, u.levels = {
|
|
@@ -113,51 +116,52 @@ function je() {
|
|
|
113
116
|
WARN: 3,
|
|
114
117
|
ERROR: 4,
|
|
115
118
|
SILENT: 5
|
|
116
|
-
}, u.methodFactory =
|
|
117
|
-
return
|
|
118
|
-
}, u.setLevel = function(h,
|
|
119
|
-
return
|
|
119
|
+
}, u.methodFactory = m || b, u.getLevel = function() {
|
|
120
|
+
return U ?? $ ?? J;
|
|
121
|
+
}, u.setLevel = function(h, y) {
|
|
122
|
+
return U = C(h), y !== !1 && Re(U), f.call(u);
|
|
120
123
|
}, u.setDefaultLevel = function(h) {
|
|
121
|
-
|
|
124
|
+
$ = C(h), ne() || u.setLevel(h, !1);
|
|
122
125
|
}, u.resetLevel = function() {
|
|
123
|
-
|
|
126
|
+
U = null, Pe(), f.call(u);
|
|
124
127
|
}, u.enableAll = function(h) {
|
|
125
128
|
u.setLevel(u.levels.TRACE, h);
|
|
126
129
|
}, u.disableAll = function(h) {
|
|
127
130
|
u.setLevel(u.levels.SILENT, h);
|
|
128
131
|
}, u.rebuild = function() {
|
|
129
|
-
if (i !== u && (
|
|
132
|
+
if (i !== u && (J = C(i.getLevel())), f.call(u), i === u)
|
|
130
133
|
for (var h in r)
|
|
131
134
|
r[h].rebuild();
|
|
132
|
-
},
|
|
135
|
+
}, J = C(
|
|
133
136
|
i ? i.getLevel() : "WARN"
|
|
134
137
|
);
|
|
135
|
-
var
|
|
136
|
-
|
|
138
|
+
var re = ne();
|
|
139
|
+
re != null && (U = C(re)), f.call(u);
|
|
137
140
|
}
|
|
138
|
-
i = new d(), i.getLogger = function(
|
|
139
|
-
if (typeof
|
|
141
|
+
i = new d(), i.getLogger = function(m) {
|
|
142
|
+
if (typeof m != "symbol" && typeof m != "string" || m === "")
|
|
140
143
|
throw new TypeError("You must supply a name when creating a logger.");
|
|
141
|
-
var u = r[
|
|
142
|
-
return u || (u = r[
|
|
143
|
-
|
|
144
|
+
var u = r[m];
|
|
145
|
+
return u || (u = r[m] = new d(
|
|
146
|
+
m,
|
|
144
147
|
i.methodFactory
|
|
145
148
|
)), u;
|
|
146
149
|
};
|
|
147
|
-
var
|
|
150
|
+
var P = typeof window !== n ? window.log : void 0;
|
|
148
151
|
return i.noConflict = function() {
|
|
149
|
-
return typeof window !== n && window.log === i && (window.log =
|
|
152
|
+
return typeof window !== n && window.log === i && (window.log = P), i;
|
|
150
153
|
}, i.getLoggers = function() {
|
|
151
154
|
return r;
|
|
152
155
|
}, i.default = i, i;
|
|
153
156
|
});
|
|
154
|
-
}(
|
|
155
|
-
}
|
|
156
|
-
var
|
|
157
|
-
const
|
|
158
|
-
let
|
|
159
|
-
|
|
160
|
-
|
|
157
|
+
}(D)), D.exports;
|
|
158
|
+
}
|
|
159
|
+
var We = Ne();
|
|
160
|
+
const se = /* @__PURE__ */ xe(We);
|
|
161
|
+
let V;
|
|
162
|
+
var z, we;
|
|
163
|
+
(typeof navigator > "u" || !((we = (z = navigator.userAgent) == null ? void 0 : z.startsWith) != null && we.call(z, "Mozilla/5.0 "))) && (V = "oauth4webapi/v2.17.0");
|
|
164
|
+
function Y(t, e) {
|
|
161
165
|
if (t == null)
|
|
162
166
|
return !1;
|
|
163
167
|
try {
|
|
@@ -166,32 +170,32 @@ function V(t, e) {
|
|
|
166
170
|
return !1;
|
|
167
171
|
}
|
|
168
172
|
}
|
|
169
|
-
const
|
|
170
|
-
function
|
|
171
|
-
return typeof t == "string" ?
|
|
173
|
+
const W = Symbol(), Ke = Symbol(), Z = Symbol(), He = Symbol(), $e = Symbol(), Fe = Symbol(), Me = new TextEncoder(), qe = new TextDecoder();
|
|
174
|
+
function E(t) {
|
|
175
|
+
return typeof t == "string" ? Me.encode(t) : qe.decode(t);
|
|
172
176
|
}
|
|
173
|
-
const
|
|
174
|
-
function
|
|
177
|
+
const ce = 32768;
|
|
178
|
+
function Be(t) {
|
|
175
179
|
t instanceof ArrayBuffer && (t = new Uint8Array(t));
|
|
176
180
|
const e = [];
|
|
177
|
-
for (let n = 0; n < t.byteLength; n +=
|
|
178
|
-
e.push(String.fromCharCode.apply(null, t.subarray(n, n +
|
|
181
|
+
for (let n = 0; n < t.byteLength; n += ce)
|
|
182
|
+
e.push(String.fromCharCode.apply(null, t.subarray(n, n + ce)));
|
|
179
183
|
return btoa(e.join("")).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
180
184
|
}
|
|
181
|
-
function
|
|
185
|
+
function Ve(t) {
|
|
182
186
|
try {
|
|
183
187
|
const e = atob(t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "")), n = new Uint8Array(e.length);
|
|
184
188
|
for (let o = 0; o < e.length; o++)
|
|
185
189
|
n[o] = e.charCodeAt(o);
|
|
186
190
|
return n;
|
|
187
191
|
} catch (e) {
|
|
188
|
-
throw new
|
|
192
|
+
throw new s("The input to be decoded is not correctly encoded.", { cause: e });
|
|
189
193
|
}
|
|
190
194
|
}
|
|
191
|
-
function
|
|
192
|
-
return typeof t == "string" ?
|
|
195
|
+
function A(t) {
|
|
196
|
+
return typeof t == "string" ? Ve(t) : Be(t);
|
|
193
197
|
}
|
|
194
|
-
class
|
|
198
|
+
class Ge {
|
|
195
199
|
constructor(e) {
|
|
196
200
|
this.cache = /* @__PURE__ */ new Map(), this._cache = /* @__PURE__ */ new Map(), this.maxSize = e;
|
|
197
201
|
}
|
|
@@ -215,58 +219,60 @@ class Fe {
|
|
|
215
219
|
this.cache.set(e, n), this.cache.size >= this.maxSize && (this._cache = this.cache, this.cache = /* @__PURE__ */ new Map());
|
|
216
220
|
}
|
|
217
221
|
}
|
|
218
|
-
class
|
|
222
|
+
class T extends Error {
|
|
219
223
|
constructor(e) {
|
|
220
|
-
|
|
224
|
+
var n;
|
|
225
|
+
super(e ?? "operation not supported"), this.name = this.constructor.name, (n = Error.captureStackTrace) == null || n.call(Error, this, this.constructor);
|
|
221
226
|
}
|
|
222
227
|
}
|
|
223
|
-
class
|
|
228
|
+
class Ye extends Error {
|
|
224
229
|
constructor(e, n) {
|
|
225
|
-
|
|
230
|
+
var o;
|
|
231
|
+
super(e, n), this.name = this.constructor.name, (o = Error.captureStackTrace) == null || o.call(Error, this, this.constructor);
|
|
226
232
|
}
|
|
227
233
|
}
|
|
228
|
-
const
|
|
229
|
-
function
|
|
234
|
+
const s = Ye, ge = new Ge(100);
|
|
235
|
+
function me(t) {
|
|
230
236
|
return t instanceof CryptoKey;
|
|
231
237
|
}
|
|
232
|
-
function
|
|
233
|
-
return
|
|
238
|
+
function Ze(t) {
|
|
239
|
+
return me(t) && t.type === "private";
|
|
234
240
|
}
|
|
235
|
-
function
|
|
236
|
-
return
|
|
241
|
+
function Qe(t) {
|
|
242
|
+
return me(t) && t.type === "public";
|
|
237
243
|
}
|
|
238
|
-
function
|
|
244
|
+
function Q(t) {
|
|
239
245
|
try {
|
|
240
246
|
const e = t.headers.get("dpop-nonce");
|
|
241
|
-
e &&
|
|
247
|
+
e && ge.set(new URL(t.url).origin, e);
|
|
242
248
|
} catch {
|
|
243
249
|
}
|
|
244
250
|
return t;
|
|
245
251
|
}
|
|
246
|
-
function
|
|
252
|
+
function x(t) {
|
|
247
253
|
return !(t === null || typeof t != "object" || Array.isArray(t));
|
|
248
254
|
}
|
|
249
|
-
function
|
|
250
|
-
|
|
255
|
+
function K(t) {
|
|
256
|
+
Y(t, Headers) && (t = Object.fromEntries(t.entries()));
|
|
251
257
|
const e = new Headers(t);
|
|
252
|
-
if (
|
|
258
|
+
if (V && !e.has("user-agent") && e.set("user-agent", V), e.has("authorization"))
|
|
253
259
|
throw new TypeError('"options.headers" must not include the "authorization" header name');
|
|
254
260
|
if (e.has("dpop"))
|
|
255
261
|
throw new TypeError('"options.headers" must not include the "dpop" header name');
|
|
256
262
|
return e;
|
|
257
263
|
}
|
|
258
|
-
function
|
|
264
|
+
function Xe(t) {
|
|
259
265
|
if (typeof t == "function" && (t = t()), !(t instanceof AbortSignal))
|
|
260
266
|
throw new TypeError('"options.signal" must return or be an instance of AbortSignal');
|
|
261
267
|
return t;
|
|
262
268
|
}
|
|
263
|
-
async function
|
|
269
|
+
async function et(t, e) {
|
|
264
270
|
if (!(t instanceof URL))
|
|
265
271
|
throw new TypeError('"issuerIdentifier" must be an instance of URL');
|
|
266
272
|
if (t.protocol !== "https:" && t.protocol !== "http:")
|
|
267
273
|
throw new TypeError('"issuer.protocol" must be "https:" or "http:"');
|
|
268
274
|
const n = new URL(t.href);
|
|
269
|
-
switch (e
|
|
275
|
+
switch (e == null ? void 0 : e.algorithm) {
|
|
270
276
|
case void 0:
|
|
271
277
|
case "oidc":
|
|
272
278
|
n.pathname = `${n.pathname}/.well-known/openid-configuration`.replace("//", "/");
|
|
@@ -277,61 +283,61 @@ async function Ge(t, e) {
|
|
|
277
283
|
default:
|
|
278
284
|
throw new TypeError('"options.algorithm" must be "oidc" (default), or "oauth2"');
|
|
279
285
|
}
|
|
280
|
-
const o =
|
|
281
|
-
return o.set("accept", "application/json"), (e
|
|
286
|
+
const o = K(e == null ? void 0 : e.headers);
|
|
287
|
+
return o.set("accept", "application/json"), ((e == null ? void 0 : e[Z]) || fetch)(n.href, {
|
|
282
288
|
headers: Object.fromEntries(o.entries()),
|
|
283
289
|
method: "GET",
|
|
284
290
|
redirect: "manual",
|
|
285
291
|
signal: null
|
|
286
|
-
}).then(
|
|
292
|
+
}).then(Q);
|
|
287
293
|
}
|
|
288
|
-
function
|
|
294
|
+
function g(t) {
|
|
289
295
|
return typeof t == "string" && t.length !== 0;
|
|
290
296
|
}
|
|
291
|
-
async function
|
|
297
|
+
async function tt(t, e) {
|
|
292
298
|
if (!(t instanceof URL))
|
|
293
299
|
throw new TypeError('"expectedIssuer" must be an instance of URL');
|
|
294
|
-
if (!
|
|
300
|
+
if (!Y(e, Response))
|
|
295
301
|
throw new TypeError('"response" must be an instance of Response');
|
|
296
302
|
if (e.status !== 200)
|
|
297
|
-
throw new
|
|
298
|
-
|
|
303
|
+
throw new s('"response" is not a conform Authorization Server Metadata response');
|
|
304
|
+
te(e);
|
|
299
305
|
let n;
|
|
300
306
|
try {
|
|
301
307
|
n = await e.json();
|
|
302
308
|
} catch (o) {
|
|
303
|
-
throw new
|
|
309
|
+
throw new s('failed to parse "response" body as JSON', { cause: o });
|
|
304
310
|
}
|
|
305
|
-
if (!
|
|
306
|
-
throw new
|
|
307
|
-
if (!
|
|
308
|
-
throw new
|
|
311
|
+
if (!x(n))
|
|
312
|
+
throw new s('"response" body must be a top level object');
|
|
313
|
+
if (!g(n.issuer))
|
|
314
|
+
throw new s('"response" body "issuer" property must be a non-empty string');
|
|
309
315
|
if (new URL(n.issuer).href !== t.href)
|
|
310
|
-
throw new
|
|
316
|
+
throw new s('"response" body "issuer" does not match "expectedIssuer"');
|
|
311
317
|
return n;
|
|
312
318
|
}
|
|
313
|
-
function
|
|
314
|
-
return
|
|
319
|
+
function X() {
|
|
320
|
+
return A(crypto.getRandomValues(new Uint8Array(32)));
|
|
315
321
|
}
|
|
316
|
-
function
|
|
317
|
-
return
|
|
322
|
+
function nt() {
|
|
323
|
+
return X();
|
|
318
324
|
}
|
|
319
|
-
function
|
|
320
|
-
return
|
|
325
|
+
function rt() {
|
|
326
|
+
return X();
|
|
321
327
|
}
|
|
322
|
-
async function
|
|
323
|
-
if (!
|
|
328
|
+
async function ot(t) {
|
|
329
|
+
if (!g(t))
|
|
324
330
|
throw new TypeError('"codeVerifier" must be a non-empty string');
|
|
325
|
-
return
|
|
331
|
+
return A(await crypto.subtle.digest("SHA-256", E(t)));
|
|
326
332
|
}
|
|
327
|
-
function
|
|
333
|
+
function ue(t) {
|
|
328
334
|
return encodeURIComponent(t).replace(/%20/g, "+");
|
|
329
335
|
}
|
|
330
|
-
function
|
|
331
|
-
const n =
|
|
336
|
+
function it(t, e) {
|
|
337
|
+
const n = ue(t), o = ue(e);
|
|
332
338
|
return `Basic ${btoa(`${n}:${o}`)}`;
|
|
333
339
|
}
|
|
334
|
-
function
|
|
340
|
+
function at(t) {
|
|
335
341
|
switch (t.algorithm.hash.name) {
|
|
336
342
|
case "SHA-256":
|
|
337
343
|
return "PS256";
|
|
@@ -340,10 +346,10 @@ function tt(t) {
|
|
|
340
346
|
case "SHA-512":
|
|
341
347
|
return "PS512";
|
|
342
348
|
default:
|
|
343
|
-
throw new
|
|
349
|
+
throw new T("unsupported RsaHashedKeyAlgorithm hash name");
|
|
344
350
|
}
|
|
345
351
|
}
|
|
346
|
-
function
|
|
352
|
+
function st(t) {
|
|
347
353
|
switch (t.algorithm.hash.name) {
|
|
348
354
|
case "SHA-256":
|
|
349
355
|
return "RS256";
|
|
@@ -352,10 +358,10 @@ function nt(t) {
|
|
|
352
358
|
case "SHA-512":
|
|
353
359
|
return "RS512";
|
|
354
360
|
default:
|
|
355
|
-
throw new
|
|
361
|
+
throw new T("unsupported RsaHashedKeyAlgorithm hash name");
|
|
356
362
|
}
|
|
357
363
|
}
|
|
358
|
-
function
|
|
364
|
+
function ct(t) {
|
|
359
365
|
switch (t.algorithm.namedCurve) {
|
|
360
366
|
case "P-256":
|
|
361
367
|
return "ES256";
|
|
@@ -364,267 +370,268 @@ function rt(t) {
|
|
|
364
370
|
case "P-521":
|
|
365
371
|
return "ES512";
|
|
366
372
|
default:
|
|
367
|
-
throw new
|
|
373
|
+
throw new T("unsupported EcKeyAlgorithm namedCurve");
|
|
368
374
|
}
|
|
369
375
|
}
|
|
370
|
-
function
|
|
376
|
+
function ut(t) {
|
|
371
377
|
switch (t.algorithm.name) {
|
|
372
378
|
case "RSA-PSS":
|
|
373
|
-
return
|
|
379
|
+
return at(t);
|
|
374
380
|
case "RSASSA-PKCS1-v1_5":
|
|
375
|
-
return
|
|
381
|
+
return st(t);
|
|
376
382
|
case "ECDSA":
|
|
377
|
-
return
|
|
383
|
+
return ct(t);
|
|
378
384
|
case "Ed25519":
|
|
379
385
|
case "Ed448":
|
|
380
386
|
return "EdDSA";
|
|
381
387
|
default:
|
|
382
|
-
throw new
|
|
388
|
+
throw new T("unsupported CryptoKey algorithm name");
|
|
383
389
|
}
|
|
384
390
|
}
|
|
385
|
-
function
|
|
386
|
-
const e = t
|
|
391
|
+
function H(t) {
|
|
392
|
+
const e = t == null ? void 0 : t[W];
|
|
387
393
|
return typeof e == "number" && Number.isFinite(e) ? e : 0;
|
|
388
394
|
}
|
|
389
|
-
function
|
|
390
|
-
const e = t
|
|
395
|
+
function ye(t) {
|
|
396
|
+
const e = t == null ? void 0 : t[Ke];
|
|
391
397
|
return typeof e == "number" && Number.isFinite(e) && Math.sign(e) !== -1 ? e : 30;
|
|
392
398
|
}
|
|
393
|
-
function
|
|
399
|
+
function ee() {
|
|
394
400
|
return Math.floor(Date.now() / 1e3);
|
|
395
401
|
}
|
|
396
|
-
function
|
|
402
|
+
function I(t) {
|
|
397
403
|
if (typeof t != "object" || t === null)
|
|
398
404
|
throw new TypeError('"as" must be an object');
|
|
399
|
-
if (!
|
|
405
|
+
if (!g(t.issuer))
|
|
400
406
|
throw new TypeError('"as.issuer" property must be a non-empty string');
|
|
401
407
|
return !0;
|
|
402
408
|
}
|
|
403
|
-
function
|
|
409
|
+
function j(t) {
|
|
404
410
|
if (typeof t != "object" || t === null)
|
|
405
411
|
throw new TypeError('"client" must be an object');
|
|
406
|
-
if (!
|
|
412
|
+
if (!g(t.client_id))
|
|
407
413
|
throw new TypeError('"client.client_id" property must be a non-empty string');
|
|
408
414
|
return !0;
|
|
409
415
|
}
|
|
410
|
-
function
|
|
411
|
-
if (!
|
|
416
|
+
function le(t) {
|
|
417
|
+
if (!g(t))
|
|
412
418
|
throw new TypeError('"client.client_secret" property must be a non-empty string');
|
|
413
419
|
return t;
|
|
414
420
|
}
|
|
415
|
-
function
|
|
421
|
+
function he(t, e) {
|
|
416
422
|
if (e !== void 0)
|
|
417
423
|
throw new TypeError(`"client.client_secret" property must not be provided when ${t} client authentication method is used.`);
|
|
418
424
|
}
|
|
419
|
-
async function
|
|
425
|
+
async function lt(t, e, n, o, a) {
|
|
420
426
|
switch (n.delete("client_secret"), n.delete("client_assertion_type"), n.delete("client_assertion"), e.token_endpoint_auth_method) {
|
|
421
427
|
case void 0:
|
|
422
428
|
case "client_secret_basic": {
|
|
423
|
-
o.set("authorization",
|
|
429
|
+
o.set("authorization", it(e.client_id, le(e.client_secret)));
|
|
424
430
|
break;
|
|
425
431
|
}
|
|
426
432
|
case "client_secret_post": {
|
|
427
|
-
n.set("client_id", e.client_id), n.set("client_secret",
|
|
433
|
+
n.set("client_id", e.client_id), n.set("client_secret", le(e.client_secret));
|
|
428
434
|
break;
|
|
429
435
|
}
|
|
430
436
|
case "private_key_jwt":
|
|
431
|
-
throw
|
|
437
|
+
throw he("private_key_jwt", e.client_secret), new TypeError('"options.clientPrivateKey" must be provided when "client.token_endpoint_auth_method" is "private_key_jwt"');
|
|
432
438
|
case "tls_client_auth":
|
|
433
439
|
case "self_signed_tls_client_auth":
|
|
434
440
|
case "none": {
|
|
435
|
-
|
|
441
|
+
he(e.token_endpoint_auth_method, e.client_secret), e.token_endpoint_auth_method, n.set("client_id", e.client_id);
|
|
436
442
|
break;
|
|
437
443
|
}
|
|
438
444
|
default:
|
|
439
|
-
throw new
|
|
445
|
+
throw new T("unsupported client token_endpoint_auth_method");
|
|
440
446
|
}
|
|
441
447
|
}
|
|
442
|
-
async function
|
|
448
|
+
async function ht(t, e, n) {
|
|
443
449
|
if (!n.usages.includes("sign"))
|
|
444
450
|
throw new TypeError('CryptoKey instances used for signing assertions must include "sign" in their "usages"');
|
|
445
|
-
const o = `${
|
|
446
|
-
return `${o}.${
|
|
451
|
+
const o = `${A(E(JSON.stringify(t)))}.${A(E(JSON.stringify(e)))}`, a = A(await crypto.subtle.sign(Ae(n), n, E(o)));
|
|
452
|
+
return `${o}.${a}`;
|
|
447
453
|
}
|
|
448
|
-
async function
|
|
449
|
-
|
|
450
|
-
|
|
454
|
+
async function dt(t, e, n, o, a, r) {
|
|
455
|
+
var b;
|
|
456
|
+
const { privateKey: i, publicKey: c, nonce: p = ge.get(n.origin) } = e;
|
|
457
|
+
if (!Ze(i))
|
|
451
458
|
throw new TypeError('"DPoP.privateKey" must be a private CryptoKey');
|
|
452
|
-
if (!
|
|
459
|
+
if (!Qe(c))
|
|
453
460
|
throw new TypeError('"DPoP.publicKey" must be a public CryptoKey');
|
|
454
|
-
if (p !== void 0 && !
|
|
461
|
+
if (p !== void 0 && !g(p))
|
|
455
462
|
throw new TypeError('"DPoP.nonce" must be a non-empty string or undefined');
|
|
456
463
|
if (!c.extractable)
|
|
457
464
|
throw new TypeError('"DPoP.publicKey.extractable" must be true');
|
|
458
|
-
const
|
|
459
|
-
alg:
|
|
465
|
+
const _ = ee() + a, f = {
|
|
466
|
+
alg: ut(i),
|
|
460
467
|
typ: "dpop+jwt",
|
|
461
|
-
jwk: await
|
|
462
|
-
},
|
|
463
|
-
iat:
|
|
464
|
-
jti:
|
|
468
|
+
jwk: await pt(c)
|
|
469
|
+
}, v = {
|
|
470
|
+
iat: _,
|
|
471
|
+
jti: X(),
|
|
465
472
|
htm: o,
|
|
466
473
|
nonce: p,
|
|
467
474
|
htu: `${n.origin}${n.pathname}`,
|
|
468
|
-
ath: r ?
|
|
475
|
+
ath: r ? A(await crypto.subtle.digest("SHA-256", E(r))) : void 0
|
|
469
476
|
};
|
|
470
|
-
e[
|
|
477
|
+
(b = e[He]) == null || b.call(e, f, v), t.set("dpop", await ht(f, v, i));
|
|
471
478
|
}
|
|
472
|
-
let
|
|
473
|
-
async function
|
|
474
|
-
const { kty: e, e: n, n: o, x:
|
|
475
|
-
return
|
|
479
|
+
let N;
|
|
480
|
+
async function ft(t) {
|
|
481
|
+
const { kty: e, e: n, n: o, x: a, y: r, crv: i } = await crypto.subtle.exportKey("jwk", t), c = { kty: e, e: n, n: o, x: a, y: r, crv: i };
|
|
482
|
+
return N.set(t, c), c;
|
|
476
483
|
}
|
|
477
|
-
async function
|
|
478
|
-
return
|
|
484
|
+
async function pt(t) {
|
|
485
|
+
return N || (N = /* @__PURE__ */ new WeakMap()), N.get(t) || ft(t);
|
|
479
486
|
}
|
|
480
|
-
function
|
|
487
|
+
function de(t, e, n) {
|
|
481
488
|
if (typeof t != "string")
|
|
482
489
|
throw n ? new TypeError(`"as.mtls_endpoint_aliases.${e}" must be a string`) : new TypeError(`"as.${e}" must be a string`);
|
|
483
490
|
return new URL(t);
|
|
484
491
|
}
|
|
485
|
-
function
|
|
486
|
-
return n && t.mtls_endpoint_aliases && e in t.mtls_endpoint_aliases ?
|
|
492
|
+
function be(t, e, n = !1) {
|
|
493
|
+
return n && t.mtls_endpoint_aliases && e in t.mtls_endpoint_aliases ? de(t.mtls_endpoint_aliases[e], e, n) : de(t[e], e, n);
|
|
487
494
|
}
|
|
488
|
-
function
|
|
489
|
-
return !!(t.use_mtls_endpoint_aliases || e
|
|
495
|
+
function _e(t, e) {
|
|
496
|
+
return !!(t.use_mtls_endpoint_aliases || e != null && e[Fe]);
|
|
490
497
|
}
|
|
491
|
-
function
|
|
498
|
+
function G(t) {
|
|
492
499
|
const e = t;
|
|
493
500
|
return typeof e != "object" || Array.isArray(e) || e === null ? !1 : e.error !== void 0;
|
|
494
501
|
}
|
|
495
|
-
async function
|
|
496
|
-
if (!
|
|
502
|
+
async function wt(t, e, n, o, a, r) {
|
|
503
|
+
if (!g(t))
|
|
497
504
|
throw new TypeError('"accessToken" must be a non-empty string');
|
|
498
505
|
if (!(n instanceof URL))
|
|
499
506
|
throw new TypeError('"url" must be an instance of URL');
|
|
500
|
-
return o =
|
|
501
|
-
body:
|
|
507
|
+
return o = K(o), (r == null ? void 0 : r.DPoP) === void 0 ? o.set("authorization", `Bearer ${t}`) : (await dt(o, r.DPoP, n, e.toUpperCase(), H({ [W]: r == null ? void 0 : r[W] }), t), o.set("authorization", `DPoP ${t}`)), ((r == null ? void 0 : r[Z]) || fetch)(n.href, {
|
|
508
|
+
body: a,
|
|
502
509
|
headers: Object.fromEntries(o.entries()),
|
|
503
510
|
method: e,
|
|
504
511
|
redirect: "manual",
|
|
505
|
-
signal: r
|
|
506
|
-
}).then(
|
|
512
|
+
signal: r != null && r.signal ? Xe(r.signal) : null
|
|
513
|
+
}).then(Q);
|
|
507
514
|
}
|
|
508
|
-
async function
|
|
509
|
-
|
|
510
|
-
const
|
|
511
|
-
return e.userinfo_signed_response_alg ? r.set("accept", "application/jwt") : (r.set("accept", "application/json"), r.append("accept", "application/jwt")),
|
|
515
|
+
async function gt(t, e, n, o) {
|
|
516
|
+
I(t), j(e);
|
|
517
|
+
const a = be(t, "userinfo_endpoint", _e(e, o)), r = K(o == null ? void 0 : o.headers);
|
|
518
|
+
return e.userinfo_signed_response_alg ? r.set("accept", "application/jwt") : (r.set("accept", "application/json"), r.append("accept", "application/jwt")), wt(n, "GET", a, r, null, {
|
|
512
519
|
...o,
|
|
513
|
-
[
|
|
520
|
+
[W]: H(e)
|
|
514
521
|
});
|
|
515
522
|
}
|
|
516
|
-
async function
|
|
517
|
-
return await
|
|
518
|
-
body:
|
|
523
|
+
async function mt(t, e, n, o, a, r, i) {
|
|
524
|
+
return await lt(t, e, a, r), r.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"), ((i == null ? void 0 : i[Z]) || fetch)(o.href, {
|
|
525
|
+
body: a,
|
|
519
526
|
headers: Object.fromEntries(r.entries()),
|
|
520
527
|
method: n,
|
|
521
528
|
redirect: "manual",
|
|
522
529
|
signal: null
|
|
523
|
-
}).then(
|
|
530
|
+
}).then(Q);
|
|
524
531
|
}
|
|
525
|
-
async function
|
|
526
|
-
const r =
|
|
532
|
+
async function ve(t, e, n, o, a) {
|
|
533
|
+
const r = be(t, "token_endpoint", _e(e, a));
|
|
527
534
|
o.set("grant_type", n);
|
|
528
|
-
const i =
|
|
529
|
-
return i.set("accept", "application/json"),
|
|
535
|
+
const i = K(a == null ? void 0 : a.headers);
|
|
536
|
+
return i.set("accept", "application/json"), mt(t, e, "POST", r, o, i, a);
|
|
530
537
|
}
|
|
531
|
-
async function
|
|
532
|
-
if (
|
|
538
|
+
async function yt(t, e, n, o) {
|
|
539
|
+
if (I(t), j(e), !g(n))
|
|
533
540
|
throw new TypeError('"refreshToken" must be a non-empty string');
|
|
534
|
-
const
|
|
535
|
-
return
|
|
541
|
+
const a = new URLSearchParams(o == null ? void 0 : o.additionalParameters);
|
|
542
|
+
return a.set("refresh_token", n), ve(t, e, "refresh_token", a, o);
|
|
536
543
|
}
|
|
537
|
-
const
|
|
538
|
-
function
|
|
544
|
+
const Se = /* @__PURE__ */ new WeakMap();
|
|
545
|
+
function bt(t) {
|
|
539
546
|
if (!t.id_token)
|
|
540
547
|
return;
|
|
541
|
-
const e =
|
|
548
|
+
const e = Se.get(t);
|
|
542
549
|
if (!e)
|
|
543
550
|
throw new TypeError('"ref" was already garbage collected or did not resolve from the proper sources');
|
|
544
551
|
return e[0];
|
|
545
552
|
}
|
|
546
|
-
async function
|
|
547
|
-
if (
|
|
553
|
+
async function Te(t, e, n, o = !1, a = !1) {
|
|
554
|
+
if (I(t), j(e), !Y(n, Response))
|
|
548
555
|
throw new TypeError('"response" must be an instance of Response');
|
|
549
556
|
if (n.status !== 200) {
|
|
550
557
|
let i;
|
|
551
|
-
if (i = await
|
|
558
|
+
if (i = await Ut(n))
|
|
552
559
|
return i;
|
|
553
|
-
throw new
|
|
560
|
+
throw new s('"response" is not a conform Token Endpoint response');
|
|
554
561
|
}
|
|
555
|
-
|
|
562
|
+
te(n);
|
|
556
563
|
let r;
|
|
557
564
|
try {
|
|
558
565
|
r = await n.json();
|
|
559
566
|
} catch (i) {
|
|
560
|
-
throw new
|
|
567
|
+
throw new s('failed to parse "response" body as JSON', { cause: i });
|
|
561
568
|
}
|
|
562
|
-
if (!
|
|
563
|
-
throw new
|
|
564
|
-
if (!
|
|
565
|
-
throw new
|
|
566
|
-
if (!
|
|
567
|
-
throw new
|
|
569
|
+
if (!x(r))
|
|
570
|
+
throw new s('"response" body must be a top level object');
|
|
571
|
+
if (!g(r.access_token))
|
|
572
|
+
throw new s('"response" body "access_token" property must be a non-empty string');
|
|
573
|
+
if (!g(r.token_type))
|
|
574
|
+
throw new s('"response" body "token_type" property must be a non-empty string');
|
|
568
575
|
if (r.token_type = r.token_type.toLowerCase(), r.token_type !== "dpop" && r.token_type !== "bearer")
|
|
569
|
-
throw new
|
|
576
|
+
throw new T("unsupported `token_type` value");
|
|
570
577
|
if (r.expires_in !== void 0 && (typeof r.expires_in != "number" || r.expires_in <= 0))
|
|
571
|
-
throw new
|
|
572
|
-
if (!
|
|
573
|
-
throw new
|
|
578
|
+
throw new s('"response" body "expires_in" property must be a positive number');
|
|
579
|
+
if (!a && r.refresh_token !== void 0 && !g(r.refresh_token))
|
|
580
|
+
throw new s('"response" body "refresh_token" property must be a non-empty string');
|
|
574
581
|
if (r.scope !== void 0 && typeof r.scope != "string")
|
|
575
|
-
throw new
|
|
582
|
+
throw new s('"response" body "scope" property must be a string');
|
|
576
583
|
if (!o) {
|
|
577
|
-
if (r.id_token !== void 0 && !
|
|
578
|
-
throw new
|
|
584
|
+
if (r.id_token !== void 0 && !g(r.id_token))
|
|
585
|
+
throw new s('"response" body "id_token" property must be a non-empty string');
|
|
579
586
|
if (r.id_token) {
|
|
580
|
-
const { claims: i, jwt: c } = await
|
|
587
|
+
const { claims: i, jwt: c } = await xt(r.id_token, It.bind(void 0, e.id_token_signed_response_alg, t.id_token_signing_alg_values_supported), Ee, H(e), ye(e), e[$e]).then(Et.bind(void 0, ["aud", "exp", "iat", "iss", "sub"])).then(St.bind(void 0, t.issuer)).then(vt.bind(void 0, e.client_id));
|
|
581
588
|
if (Array.isArray(i.aud) && i.aud.length !== 1) {
|
|
582
589
|
if (i.azp === void 0)
|
|
583
|
-
throw new
|
|
590
|
+
throw new s('ID Token "aud" (audience) claim includes additional untrusted audiences');
|
|
584
591
|
if (i.azp !== e.client_id)
|
|
585
|
-
throw new
|
|
592
|
+
throw new s('unexpected ID Token "azp" (authorized party) claim value');
|
|
586
593
|
}
|
|
587
594
|
if (i.auth_time !== void 0 && (!Number.isFinite(i.auth_time) || Math.sign(i.auth_time) !== 1))
|
|
588
|
-
throw new
|
|
589
|
-
|
|
595
|
+
throw new s('ID Token "auth_time" (authentication time) must be a positive number');
|
|
596
|
+
Se.set(r, [i, c]);
|
|
590
597
|
}
|
|
591
598
|
}
|
|
592
599
|
return r;
|
|
593
600
|
}
|
|
594
|
-
async function
|
|
595
|
-
return
|
|
601
|
+
async function _t(t, e, n) {
|
|
602
|
+
return Te(t, e, n);
|
|
596
603
|
}
|
|
597
|
-
function
|
|
604
|
+
function vt(t, e) {
|
|
598
605
|
if (Array.isArray(e.claims.aud)) {
|
|
599
606
|
if (!e.claims.aud.includes(t))
|
|
600
|
-
throw new
|
|
607
|
+
throw new s('unexpected JWT "aud" (audience) claim value');
|
|
601
608
|
} else if (e.claims.aud !== t)
|
|
602
|
-
throw new
|
|
609
|
+
throw new s('unexpected JWT "aud" (audience) claim value');
|
|
603
610
|
return e;
|
|
604
611
|
}
|
|
605
|
-
function
|
|
612
|
+
function St(t, e) {
|
|
606
613
|
if (e.claims.iss !== t)
|
|
607
|
-
throw new
|
|
614
|
+
throw new s('unexpected JWT "iss" (issuer) claim value');
|
|
608
615
|
return e;
|
|
609
616
|
}
|
|
610
|
-
const
|
|
611
|
-
function
|
|
612
|
-
return
|
|
617
|
+
const ke = /* @__PURE__ */ new WeakSet();
|
|
618
|
+
function Tt(t) {
|
|
619
|
+
return ke.add(t), t;
|
|
613
620
|
}
|
|
614
|
-
async function
|
|
615
|
-
if (
|
|
621
|
+
async function kt(t, e, n, o, a, r) {
|
|
622
|
+
if (I(t), j(e), !ke.has(n))
|
|
616
623
|
throw new TypeError('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()');
|
|
617
|
-
if (!
|
|
624
|
+
if (!g(o))
|
|
618
625
|
throw new TypeError('"redirectUri" must be a non-empty string');
|
|
619
|
-
if (!
|
|
626
|
+
if (!g(a))
|
|
620
627
|
throw new TypeError('"codeVerifier" must be a non-empty string');
|
|
621
|
-
const i =
|
|
628
|
+
const i = k(n, "code");
|
|
622
629
|
if (!i)
|
|
623
|
-
throw new
|
|
624
|
-
const c = new URLSearchParams(r
|
|
625
|
-
return c.set("redirect_uri", o), c.set("code_verifier",
|
|
630
|
+
throw new s('no authorization code in "callbackParameters"');
|
|
631
|
+
const c = new URLSearchParams(r == null ? void 0 : r.additionalParameters);
|
|
632
|
+
return c.set("redirect_uri", o), c.set("code_verifier", a), c.set("code", i), ve(t, e, "authorization_code", c, r);
|
|
626
633
|
}
|
|
627
|
-
const
|
|
634
|
+
const At = {
|
|
628
635
|
aud: "audience",
|
|
629
636
|
c_hash: "code hash",
|
|
630
637
|
client_id: "client id",
|
|
@@ -640,66 +647,66 @@ const _t = {
|
|
|
640
647
|
htu: "http uri",
|
|
641
648
|
cnf: "confirmation"
|
|
642
649
|
};
|
|
643
|
-
function
|
|
650
|
+
function Et(t, e) {
|
|
644
651
|
for (const n of t)
|
|
645
652
|
if (e.claims[n] === void 0)
|
|
646
|
-
throw new
|
|
653
|
+
throw new s(`JWT "${n}" (${At[n]}) claim missing`);
|
|
647
654
|
return e;
|
|
648
655
|
}
|
|
649
|
-
const
|
|
650
|
-
async function
|
|
651
|
-
const r = await
|
|
652
|
-
if (
|
|
656
|
+
const Rt = Symbol(), F = Symbol();
|
|
657
|
+
async function Pt(t, e, n, o, a) {
|
|
658
|
+
const r = await Te(t, e, n);
|
|
659
|
+
if (G(r))
|
|
653
660
|
return r;
|
|
654
|
-
if (!
|
|
655
|
-
throw new
|
|
656
|
-
|
|
657
|
-
const i =
|
|
658
|
-
if ((e.require_auth_time ||
|
|
659
|
-
throw new
|
|
660
|
-
if (
|
|
661
|
-
if (typeof
|
|
661
|
+
if (!g(r.id_token))
|
|
662
|
+
throw new s('"response" body "id_token" property must be a non-empty string');
|
|
663
|
+
a ?? (a = e.default_max_age ?? F);
|
|
664
|
+
const i = bt(r);
|
|
665
|
+
if ((e.require_auth_time || a !== F) && i.auth_time === void 0)
|
|
666
|
+
throw new s('ID Token "auth_time" (authentication time) claim missing');
|
|
667
|
+
if (a !== F) {
|
|
668
|
+
if (typeof a != "number" || a < 0)
|
|
662
669
|
throw new TypeError('"maxAge" must be a non-negative number');
|
|
663
|
-
const c =
|
|
664
|
-
if (i.auth_time +
|
|
665
|
-
throw new
|
|
670
|
+
const c = ee() + H(e), p = ye(e);
|
|
671
|
+
if (i.auth_time + a < c - p)
|
|
672
|
+
throw new s("too much time has elapsed since the last End-User authentication");
|
|
666
673
|
}
|
|
667
674
|
switch (o) {
|
|
668
675
|
case void 0:
|
|
669
|
-
case
|
|
676
|
+
case Rt:
|
|
670
677
|
if (i.nonce !== void 0)
|
|
671
|
-
throw new
|
|
678
|
+
throw new s('unexpected ID Token "nonce" claim value');
|
|
672
679
|
break;
|
|
673
680
|
default:
|
|
674
|
-
if (!
|
|
681
|
+
if (!g(o))
|
|
675
682
|
throw new TypeError('"expectedNonce" must be a non-empty string');
|
|
676
683
|
if (i.nonce === void 0)
|
|
677
|
-
throw new
|
|
684
|
+
throw new s('ID Token "nonce" claim missing');
|
|
678
685
|
if (i.nonce !== o)
|
|
679
|
-
throw new
|
|
686
|
+
throw new s('unexpected ID Token "nonce" claim value');
|
|
680
687
|
}
|
|
681
688
|
return r;
|
|
682
689
|
}
|
|
683
|
-
function
|
|
690
|
+
function te(t) {
|
|
684
691
|
if (t.bodyUsed)
|
|
685
692
|
throw new TypeError('"response" body has been used already');
|
|
686
693
|
}
|
|
687
|
-
async function
|
|
694
|
+
async function Ut(t) {
|
|
688
695
|
if (t.status > 399 && t.status < 500) {
|
|
689
|
-
|
|
696
|
+
te(t);
|
|
690
697
|
try {
|
|
691
698
|
const e = await t.json();
|
|
692
|
-
if (
|
|
699
|
+
if (x(e) && typeof e.error == "string" && e.error.length)
|
|
693
700
|
return e.error_description !== void 0 && typeof e.error_description != "string" && delete e.error_description, e.error_uri !== void 0 && typeof e.error_uri != "string" && delete e.error_uri, e.algs !== void 0 && typeof e.algs != "string" && delete e.algs, e.scope !== void 0 && typeof e.scope != "string" && delete e.scope, e;
|
|
694
701
|
} catch {
|
|
695
702
|
}
|
|
696
703
|
}
|
|
697
704
|
}
|
|
698
|
-
function
|
|
705
|
+
function fe(t) {
|
|
699
706
|
if (typeof t.modulusLength != "number" || t.modulusLength < 2048)
|
|
700
|
-
throw new
|
|
707
|
+
throw new s(`${t.name} modulusLength must be at least 2048 bits`);
|
|
701
708
|
}
|
|
702
|
-
function
|
|
709
|
+
function Ct(t) {
|
|
703
710
|
switch (t) {
|
|
704
711
|
case "P-256":
|
|
705
712
|
return "SHA-256";
|
|
@@ -708,18 +715,18 @@ function At(t) {
|
|
|
708
715
|
case "P-521":
|
|
709
716
|
return "SHA-512";
|
|
710
717
|
default:
|
|
711
|
-
throw new
|
|
718
|
+
throw new T();
|
|
712
719
|
}
|
|
713
720
|
}
|
|
714
|
-
function
|
|
721
|
+
function Ae(t) {
|
|
715
722
|
switch (t.algorithm.name) {
|
|
716
723
|
case "ECDSA":
|
|
717
724
|
return {
|
|
718
725
|
name: t.algorithm.name,
|
|
719
|
-
hash:
|
|
726
|
+
hash: Ct(t.algorithm.namedCurve)
|
|
720
727
|
};
|
|
721
728
|
case "RSA-PSS":
|
|
722
|
-
switch (
|
|
729
|
+
switch (fe(t.algorithm), t.algorithm.hash.name) {
|
|
723
730
|
case "SHA-256":
|
|
724
731
|
case "SHA-384":
|
|
725
732
|
case "SHA-512":
|
|
@@ -728,143 +735,143 @@ function Se(t) {
|
|
|
728
735
|
saltLength: parseInt(t.algorithm.hash.name.slice(-3), 10) >> 3
|
|
729
736
|
};
|
|
730
737
|
default:
|
|
731
|
-
throw new
|
|
738
|
+
throw new T();
|
|
732
739
|
}
|
|
733
740
|
case "RSASSA-PKCS1-v1_5":
|
|
734
|
-
return
|
|
741
|
+
return fe(t.algorithm), t.algorithm.name;
|
|
735
742
|
case "Ed448":
|
|
736
743
|
case "Ed25519":
|
|
737
744
|
return t.algorithm.name;
|
|
738
745
|
}
|
|
739
|
-
throw new
|
|
746
|
+
throw new T();
|
|
740
747
|
}
|
|
741
|
-
const
|
|
742
|
-
async function
|
|
743
|
-
const
|
|
744
|
-
if (!await crypto.subtle.verify(
|
|
745
|
-
throw new
|
|
748
|
+
const Ee = Symbol();
|
|
749
|
+
async function Lt(t, e, n, o) {
|
|
750
|
+
const a = `${t}.${e}`;
|
|
751
|
+
if (!await crypto.subtle.verify(Ae(n), n, o, E(a)))
|
|
752
|
+
throw new s("JWT signature verification failed");
|
|
746
753
|
}
|
|
747
|
-
async function
|
|
748
|
-
let { 0: i, 1: c, 2: p, length:
|
|
749
|
-
if (
|
|
754
|
+
async function xt(t, e, n, o, a, r) {
|
|
755
|
+
let { 0: i, 1: c, 2: p, length: _ } = t.split(".");
|
|
756
|
+
if (_ === 5)
|
|
750
757
|
if (r !== void 0)
|
|
751
|
-
t = await r(t), { 0: i, 1: c, 2: p, length:
|
|
758
|
+
t = await r(t), { 0: i, 1: c, 2: p, length: _ } = t.split(".");
|
|
752
759
|
else
|
|
753
|
-
throw new
|
|
754
|
-
if (
|
|
755
|
-
throw new
|
|
760
|
+
throw new T("JWE structure JWTs are not supported");
|
|
761
|
+
if (_ !== 3)
|
|
762
|
+
throw new s("Invalid JWT");
|
|
756
763
|
let f;
|
|
757
764
|
try {
|
|
758
|
-
f = JSON.parse(A(
|
|
765
|
+
f = JSON.parse(E(A(i)));
|
|
759
766
|
} catch (l) {
|
|
760
|
-
throw new
|
|
767
|
+
throw new s("failed to parse JWT Header body as base64url encoded JSON", { cause: l });
|
|
761
768
|
}
|
|
762
|
-
if (!
|
|
763
|
-
throw new
|
|
769
|
+
if (!x(f))
|
|
770
|
+
throw new s("JWT Header must be a top level object");
|
|
764
771
|
if (e(f), f.crit !== void 0)
|
|
765
|
-
throw new
|
|
766
|
-
const
|
|
772
|
+
throw new s('unexpected JWT "crit" header parameter');
|
|
773
|
+
const v = A(p);
|
|
767
774
|
let b;
|
|
768
|
-
n !==
|
|
775
|
+
n !== Ee && (b = await n(f), await Lt(i, c, b, v));
|
|
769
776
|
let d;
|
|
770
777
|
try {
|
|
771
|
-
d = JSON.parse(A(
|
|
778
|
+
d = JSON.parse(E(A(c)));
|
|
772
779
|
} catch (l) {
|
|
773
|
-
throw new
|
|
780
|
+
throw new s("failed to parse JWT Payload body as base64url encoded JSON", { cause: l });
|
|
774
781
|
}
|
|
775
|
-
if (!
|
|
776
|
-
throw new
|
|
777
|
-
const
|
|
782
|
+
if (!x(d))
|
|
783
|
+
throw new s("JWT Payload must be a top level object");
|
|
784
|
+
const P = ee() + o;
|
|
778
785
|
if (d.exp !== void 0) {
|
|
779
786
|
if (typeof d.exp != "number")
|
|
780
|
-
throw new
|
|
781
|
-
if (d.exp <=
|
|
782
|
-
throw new
|
|
787
|
+
throw new s('unexpected JWT "exp" (expiration time) claim type');
|
|
788
|
+
if (d.exp <= P - a)
|
|
789
|
+
throw new s('unexpected JWT "exp" (expiration time) claim value, timestamp is <= now()');
|
|
783
790
|
}
|
|
784
791
|
if (d.iat !== void 0 && typeof d.iat != "number")
|
|
785
|
-
throw new
|
|
792
|
+
throw new s('unexpected JWT "iat" (issued at) claim type');
|
|
786
793
|
if (d.iss !== void 0 && typeof d.iss != "string")
|
|
787
|
-
throw new
|
|
794
|
+
throw new s('unexpected JWT "iss" (issuer) claim type');
|
|
788
795
|
if (d.nbf !== void 0) {
|
|
789
796
|
if (typeof d.nbf != "number")
|
|
790
|
-
throw new
|
|
791
|
-
if (d.nbf >
|
|
792
|
-
throw new
|
|
797
|
+
throw new s('unexpected JWT "nbf" (not before) claim type');
|
|
798
|
+
if (d.nbf > P + a)
|
|
799
|
+
throw new s('unexpected JWT "nbf" (not before) claim value, timestamp is > now()');
|
|
793
800
|
}
|
|
794
801
|
if (d.aud !== void 0 && typeof d.aud != "string" && !Array.isArray(d.aud))
|
|
795
|
-
throw new
|
|
796
|
-
return { header: f, claims: d, signature:
|
|
802
|
+
throw new s('unexpected JWT "aud" (audience) claim type');
|
|
803
|
+
return { header: f, claims: d, signature: v, key: b, jwt: t };
|
|
797
804
|
}
|
|
798
|
-
function
|
|
805
|
+
function It(t, e, n) {
|
|
799
806
|
if (t !== void 0) {
|
|
800
807
|
if (n.alg !== t)
|
|
801
|
-
throw new
|
|
808
|
+
throw new s('unexpected JWT "alg" header parameter');
|
|
802
809
|
return;
|
|
803
810
|
}
|
|
804
811
|
if (Array.isArray(e)) {
|
|
805
812
|
if (!e.includes(n.alg))
|
|
806
|
-
throw new
|
|
813
|
+
throw new s('unexpected JWT "alg" header parameter');
|
|
807
814
|
return;
|
|
808
815
|
}
|
|
809
816
|
if (n.alg !== "RS256")
|
|
810
|
-
throw new
|
|
817
|
+
throw new s('unexpected JWT "alg" header parameter');
|
|
811
818
|
}
|
|
812
|
-
function
|
|
819
|
+
function k(t, e) {
|
|
813
820
|
const { 0: n, length: o } = t.getAll(e);
|
|
814
821
|
if (o > 1)
|
|
815
|
-
throw new
|
|
822
|
+
throw new s(`"${e}" parameter must be provided only once`);
|
|
816
823
|
return n;
|
|
817
824
|
}
|
|
818
|
-
const
|
|
819
|
-
function
|
|
820
|
-
if (
|
|
825
|
+
const jt = Symbol(), Jt = Symbol();
|
|
826
|
+
function Ot(t, e, n, o) {
|
|
827
|
+
if (I(t), j(e), n instanceof URL && (n = n.searchParams), !(n instanceof URLSearchParams))
|
|
821
828
|
throw new TypeError('"parameters" must be an instance of URLSearchParams, or URL');
|
|
822
|
-
if (
|
|
823
|
-
throw new
|
|
824
|
-
const
|
|
825
|
-
if (!
|
|
826
|
-
throw new
|
|
827
|
-
if (
|
|
828
|
-
throw new
|
|
829
|
+
if (k(n, "response"))
|
|
830
|
+
throw new s('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()');
|
|
831
|
+
const a = k(n, "iss"), r = k(n, "state");
|
|
832
|
+
if (!a && t.authorization_response_iss_parameter_supported)
|
|
833
|
+
throw new s('response parameter "iss" (issuer) missing');
|
|
834
|
+
if (a && a !== t.issuer)
|
|
835
|
+
throw new s('unexpected "iss" (issuer) response parameter value');
|
|
829
836
|
switch (o) {
|
|
830
837
|
case void 0:
|
|
831
|
-
case
|
|
838
|
+
case Jt:
|
|
832
839
|
if (r !== void 0)
|
|
833
|
-
throw new
|
|
840
|
+
throw new s('unexpected "state" response parameter encountered');
|
|
834
841
|
break;
|
|
835
|
-
case
|
|
842
|
+
case jt:
|
|
836
843
|
break;
|
|
837
844
|
default:
|
|
838
|
-
if (!
|
|
839
|
-
throw new
|
|
845
|
+
if (!g(o))
|
|
846
|
+
throw new s('"expectedState" must be a non-empty string');
|
|
840
847
|
if (r === void 0)
|
|
841
|
-
throw new
|
|
848
|
+
throw new s('response parameter "state" missing');
|
|
842
849
|
if (r !== o)
|
|
843
|
-
throw new
|
|
850
|
+
throw new s('unexpected "state" response parameter value');
|
|
844
851
|
}
|
|
845
|
-
const i =
|
|
852
|
+
const i = k(n, "error");
|
|
846
853
|
if (i)
|
|
847
854
|
return {
|
|
848
855
|
error: i,
|
|
849
|
-
error_description:
|
|
850
|
-
error_uri:
|
|
856
|
+
error_description: k(n, "error_description"),
|
|
857
|
+
error_uri: k(n, "error_uri")
|
|
851
858
|
};
|
|
852
|
-
const c =
|
|
859
|
+
const c = k(n, "id_token"), p = k(n, "token");
|
|
853
860
|
if (c !== void 0 || p !== void 0)
|
|
854
|
-
throw new
|
|
855
|
-
return
|
|
861
|
+
throw new T("implicit and hybrid flows are not supported");
|
|
862
|
+
return Tt(new URLSearchParams(n));
|
|
856
863
|
}
|
|
857
|
-
function
|
|
864
|
+
function zt({
|
|
858
865
|
handleCallback: t
|
|
859
866
|
}) {
|
|
860
|
-
const e =
|
|
867
|
+
const e = je({
|
|
861
868
|
retry: !1,
|
|
862
869
|
queryKey: ["oauth-callback"],
|
|
863
870
|
queryFn: async () => {
|
|
864
871
|
try {
|
|
865
872
|
return await t();
|
|
866
873
|
} catch (n) {
|
|
867
|
-
throw new
|
|
874
|
+
throw new ze("Could not validate user", {
|
|
868
875
|
cause: n,
|
|
869
876
|
title: "Authentication Error",
|
|
870
877
|
developerHint: "Check the configuration of your authorization provider and ensure all settings such as the callback URL are configured correctly."
|
|
@@ -872,17 +879,17 @@ function xt({
|
|
|
872
879
|
}
|
|
873
880
|
}
|
|
874
881
|
});
|
|
875
|
-
return /* @__PURE__ */
|
|
882
|
+
return /* @__PURE__ */ B.jsx(Oe, { to: e.data });
|
|
876
883
|
}
|
|
877
|
-
class
|
|
884
|
+
class R extends Error {
|
|
878
885
|
}
|
|
879
|
-
class
|
|
886
|
+
class pe extends R {
|
|
880
887
|
constructor(e, n, o) {
|
|
881
888
|
super(e, o), this.error = n;
|
|
882
889
|
}
|
|
883
890
|
}
|
|
884
|
-
const
|
|
885
|
-
class
|
|
891
|
+
const M = "code-verifier", q = "oauth-state";
|
|
892
|
+
class Dt extends Je {
|
|
886
893
|
constructor(e, n) {
|
|
887
894
|
super(), this.callbackUrlPath = e, this.handleCallback = n;
|
|
888
895
|
}
|
|
@@ -891,47 +898,119 @@ class It extends Ce {
|
|
|
891
898
|
...super.getRoutes(),
|
|
892
899
|
{
|
|
893
900
|
path: this.callbackUrlPath,
|
|
894
|
-
element: /* @__PURE__ */
|
|
901
|
+
element: /* @__PURE__ */ B.jsx(Ie, { children: /* @__PURE__ */ B.jsx(zt, { handleCallback: this.handleCallback }) })
|
|
895
902
|
}
|
|
896
903
|
];
|
|
897
904
|
}
|
|
898
905
|
}
|
|
899
|
-
class
|
|
900
|
-
client;
|
|
901
|
-
issuer;
|
|
902
|
-
authorizationServer;
|
|
903
|
-
absoluteCallbackUrlPath;
|
|
904
|
-
relativeCallbackUrlPath;
|
|
905
|
-
logoutRedirectUrlPath;
|
|
906
|
-
onAuthorizationUrl;
|
|
907
|
-
redirectToAfterSignUp;
|
|
908
|
-
redirectToAfterSignIn;
|
|
909
|
-
redirectToAfterSignOut;
|
|
910
|
-
audience;
|
|
911
|
-
scopes;
|
|
912
|
-
root;
|
|
906
|
+
class Nt {
|
|
913
907
|
constructor({
|
|
914
908
|
issuer: e,
|
|
915
909
|
audience: n,
|
|
916
910
|
clientId: o,
|
|
917
|
-
redirectToAfterSignUp:
|
|
911
|
+
redirectToAfterSignUp: a,
|
|
918
912
|
redirectToAfterSignIn: r,
|
|
919
913
|
redirectToAfterSignOut: i,
|
|
920
914
|
basePath: c,
|
|
921
915
|
scopes: p
|
|
922
916
|
}) {
|
|
917
|
+
w(this, "client");
|
|
918
|
+
w(this, "issuer");
|
|
919
|
+
w(this, "authorizationServer");
|
|
920
|
+
w(this, "absoluteCallbackUrlPath");
|
|
921
|
+
w(this, "relativeCallbackUrlPath");
|
|
922
|
+
w(this, "logoutRedirectUrlPath");
|
|
923
|
+
w(this, "onAuthorizationUrl");
|
|
924
|
+
w(this, "redirectToAfterSignUp");
|
|
925
|
+
w(this, "redirectToAfterSignIn");
|
|
926
|
+
w(this, "redirectToAfterSignOut");
|
|
927
|
+
w(this, "audience");
|
|
928
|
+
w(this, "scopes");
|
|
929
|
+
w(this, "root");
|
|
930
|
+
w(this, "signRequest", async (e) => {
|
|
931
|
+
const n = await this.getAccessToken();
|
|
932
|
+
return e.headers.set("Authorization", `Bearer ${n}`), e;
|
|
933
|
+
});
|
|
934
|
+
w(this, "signOut", async () => {
|
|
935
|
+
L.setState({
|
|
936
|
+
isAuthenticated: !1,
|
|
937
|
+
isPending: !1,
|
|
938
|
+
profile: void 0,
|
|
939
|
+
providerData: void 0
|
|
940
|
+
});
|
|
941
|
+
const e = await this.getAuthServer(), n = new URL(
|
|
942
|
+
window.location.origin + this.redirectToAfterSignOut
|
|
943
|
+
);
|
|
944
|
+
n.pathname = this.logoutRedirectUrlPath;
|
|
945
|
+
let o;
|
|
946
|
+
e.end_session_endpoint ? (o = new URL(e.end_session_endpoint), o.searchParams.set(
|
|
947
|
+
"post_logout_redirect_uri",
|
|
948
|
+
n.toString()
|
|
949
|
+
)) : o = n;
|
|
950
|
+
});
|
|
951
|
+
w(this, "handleCallback", async () => {
|
|
952
|
+
const e = new URL(window.location.href), n = e.searchParams.get("state"), o = sessionStorage.getItem(q);
|
|
953
|
+
if (sessionStorage.removeItem(q), n !== o)
|
|
954
|
+
throw new R("Invalid state parameter");
|
|
955
|
+
const a = sessionStorage.getItem(M);
|
|
956
|
+
if (sessionStorage.removeItem(M), !a)
|
|
957
|
+
throw new R("No code verifier found in state.");
|
|
958
|
+
const r = await this.getAuthServer(), i = Ot(
|
|
959
|
+
r,
|
|
960
|
+
this.client,
|
|
961
|
+
e.searchParams,
|
|
962
|
+
n ?? void 0
|
|
963
|
+
);
|
|
964
|
+
if (G(i))
|
|
965
|
+
throw se.error("Error validating OAuth response", i), new pe(
|
|
966
|
+
"Error validating OAuth response",
|
|
967
|
+
i
|
|
968
|
+
);
|
|
969
|
+
const c = new URL(e);
|
|
970
|
+
c.pathname = this.absoluteCallbackUrlPath, c.search = "";
|
|
971
|
+
const p = await kt(
|
|
972
|
+
r,
|
|
973
|
+
this.client,
|
|
974
|
+
i,
|
|
975
|
+
c.toString(),
|
|
976
|
+
a
|
|
977
|
+
), _ = await Pt(
|
|
978
|
+
r,
|
|
979
|
+
this.client,
|
|
980
|
+
p
|
|
981
|
+
);
|
|
982
|
+
this.setTokensFromResponse(_);
|
|
983
|
+
const f = await this.getAccessToken(), b = await (await gt(
|
|
984
|
+
r,
|
|
985
|
+
this.client,
|
|
986
|
+
f
|
|
987
|
+
)).json(), d = {
|
|
988
|
+
sub: b.sub,
|
|
989
|
+
email: b.email,
|
|
990
|
+
name: b.name,
|
|
991
|
+
emailVerified: b.email_verified ?? !1,
|
|
992
|
+
pictureUrl: b.picture
|
|
993
|
+
};
|
|
994
|
+
L.setState({
|
|
995
|
+
isAuthenticated: !0,
|
|
996
|
+
isPending: !1,
|
|
997
|
+
profile: d
|
|
998
|
+
});
|
|
999
|
+
const P = sessionStorage.getItem("redirect-to") ?? "/";
|
|
1000
|
+
return sessionStorage.removeItem("redirect-to"), P;
|
|
1001
|
+
});
|
|
923
1002
|
this.client = {
|
|
924
1003
|
client_id: o,
|
|
925
1004
|
token_endpoint_auth_method: "none"
|
|
926
|
-
}, this.audience = n, this.issuer = e, this.relativeCallbackUrlPath = "/oauth/callback", this.absoluteCallbackUrlPath =
|
|
1005
|
+
}, this.audience = n, this.issuer = e, this.relativeCallbackUrlPath = "/oauth/callback", this.absoluteCallbackUrlPath = ie(
|
|
927
1006
|
c,
|
|
928
1007
|
this.relativeCallbackUrlPath
|
|
929
|
-
), this.scopes = p ?? ["openid", "profile", "email"], this.root =
|
|
1008
|
+
), this.scopes = p ?? ["openid", "profile", "email"], this.root = ie(c, "/"), this.logoutRedirectUrlPath = this.root, this.redirectToAfterSignUp = a ?? this.root, this.redirectToAfterSignIn = r ?? this.root, this.redirectToAfterSignOut = i ?? this.root;
|
|
930
1009
|
}
|
|
931
1010
|
async getAuthServer() {
|
|
932
1011
|
if (!this.authorizationServer) {
|
|
933
|
-
const e = new URL(this.issuer), n = await
|
|
934
|
-
this.authorizationServer = await
|
|
1012
|
+
const e = new URL(this.issuer), n = await et(e);
|
|
1013
|
+
this.authorizationServer = await tt(
|
|
935
1014
|
e,
|
|
936
1015
|
n
|
|
937
1016
|
);
|
|
@@ -943,10 +1022,10 @@ class jt {
|
|
|
943
1022
|
* @param response
|
|
944
1023
|
*/
|
|
945
1024
|
setTokensFromResponse(e) {
|
|
946
|
-
if (
|
|
947
|
-
throw
|
|
1025
|
+
if (G(e))
|
|
1026
|
+
throw se.error("Bad Token Response", e), new pe("Bad Token Response", e);
|
|
948
1027
|
if (!e.expires_in)
|
|
949
|
-
throw new
|
|
1028
|
+
throw new R("No expires_in in response");
|
|
950
1029
|
const n = {
|
|
951
1030
|
accessToken: e.access_token,
|
|
952
1031
|
refreshToken: e.refresh_token,
|
|
@@ -954,7 +1033,7 @@ class jt {
|
|
|
954
1033
|
expiresOn: new Date(Date.now() + e.expires_in * 1e3),
|
|
955
1034
|
tokenType: e.token_type
|
|
956
1035
|
};
|
|
957
|
-
|
|
1036
|
+
L.setState({
|
|
958
1037
|
providerData: n
|
|
959
1038
|
});
|
|
960
1039
|
}
|
|
@@ -973,136 +1052,65 @@ class jt {
|
|
|
973
1052
|
redirectTo: e,
|
|
974
1053
|
isSignUp: n = !1
|
|
975
1054
|
}) {
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
1055
|
+
var v;
|
|
1056
|
+
const o = "S256", a = await this.getAuthServer();
|
|
1057
|
+
if (!a.authorization_endpoint)
|
|
1058
|
+
throw new R("No authorization endpoint");
|
|
1059
|
+
const r = nt(), i = await ot(r);
|
|
1060
|
+
sessionStorage.setItem(M, r);
|
|
981
1061
|
const c = new URL(
|
|
982
|
-
|
|
1062
|
+
a.authorization_endpoint
|
|
983
1063
|
), p = e.startsWith(window.location.origin) ? this.root !== "/" && e.startsWith(window.location.origin + this.root) ? e.slice(window.location.origin.length + this.root.length) : e.slice(window.location.origin.length) : e;
|
|
984
1064
|
sessionStorage.setItem("redirect-to", p);
|
|
985
|
-
const
|
|
986
|
-
|
|
1065
|
+
const _ = new URL(window.location.origin);
|
|
1066
|
+
_.pathname = this.absoluteCallbackUrlPath, _.search = "", c.searchParams.set("client_id", this.client.client_id), c.searchParams.set("redirect_uri", _.toString()), c.searchParams.set("response_type", "code"), c.searchParams.set("scope", this.scopes.join(" ")), c.searchParams.set("code_challenge", i), c.searchParams.set(
|
|
987
1067
|
"code_challenge_method",
|
|
988
1068
|
o
|
|
989
|
-
), this.audience && c.searchParams.set("audience", this.audience), this.onAuthorizationUrl
|
|
1069
|
+
), this.audience && c.searchParams.set("audience", this.audience), (v = this.onAuthorizationUrl) == null || v.call(this, c, {
|
|
990
1070
|
isSignIn: !n,
|
|
991
1071
|
isSignUp: n
|
|
992
1072
|
});
|
|
993
|
-
const f =
|
|
994
|
-
sessionStorage.setItem(
|
|
1073
|
+
const f = rt();
|
|
1074
|
+
sessionStorage.setItem(q, f), c.searchParams.set("state", f), location.href = c.href;
|
|
995
1075
|
}
|
|
996
1076
|
async getAccessToken() {
|
|
997
|
-
const e = await this.getAuthServer(), { providerData: n } =
|
|
1077
|
+
const e = await this.getAuthServer(), { providerData: n } = L.getState();
|
|
998
1078
|
if (!n)
|
|
999
|
-
throw new
|
|
1079
|
+
throw new R("User is not authenticated");
|
|
1000
1080
|
const o = n;
|
|
1001
1081
|
if (new Date(o.expiresOn) < /* @__PURE__ */ new Date()) {
|
|
1002
1082
|
if (!o.refreshToken)
|
|
1003
|
-
return
|
|
1083
|
+
return L.setState({
|
|
1004
1084
|
isAuthenticated: !1,
|
|
1005
1085
|
isPending: !1,
|
|
1006
1086
|
profile: null,
|
|
1007
1087
|
providerData: null
|
|
1008
1088
|
}), "";
|
|
1009
|
-
const
|
|
1089
|
+
const a = await yt(
|
|
1010
1090
|
e,
|
|
1011
1091
|
this.client,
|
|
1012
1092
|
o.refreshToken
|
|
1013
|
-
), r = await
|
|
1093
|
+
), r = await _t(
|
|
1014
1094
|
e,
|
|
1015
1095
|
this.client,
|
|
1016
|
-
|
|
1096
|
+
a
|
|
1017
1097
|
);
|
|
1018
1098
|
if (!r.access_token)
|
|
1019
|
-
throw new
|
|
1099
|
+
throw new R("No access token in response");
|
|
1020
1100
|
return this.setTokensFromResponse(r), r.access_token.toString();
|
|
1021
1101
|
} else
|
|
1022
1102
|
return o.accessToken;
|
|
1023
1103
|
}
|
|
1024
|
-
signRequest = async (e) => {
|
|
1025
|
-
const n = await this.getAccessToken();
|
|
1026
|
-
return e.headers.set("Authorization", `Bearer ${n}`), e;
|
|
1027
|
-
};
|
|
1028
|
-
signOut = async () => {
|
|
1029
|
-
C.setState({
|
|
1030
|
-
isAuthenticated: !1,
|
|
1031
|
-
isPending: !1,
|
|
1032
|
-
profile: void 0,
|
|
1033
|
-
providerData: void 0
|
|
1034
|
-
});
|
|
1035
|
-
const e = await this.getAuthServer(), n = new URL(
|
|
1036
|
-
window.location.origin + this.redirectToAfterSignOut
|
|
1037
|
-
);
|
|
1038
|
-
n.pathname = this.logoutRedirectUrlPath;
|
|
1039
|
-
let o;
|
|
1040
|
-
e.end_session_endpoint ? (o = new URL(e.end_session_endpoint), o.searchParams.set(
|
|
1041
|
-
"post_logout_redirect_uri",
|
|
1042
|
-
n.toString()
|
|
1043
|
-
)) : o = n;
|
|
1044
|
-
};
|
|
1045
|
-
handleCallback = async () => {
|
|
1046
|
-
const e = new URL(window.location.href), n = e.searchParams.get("state"), o = sessionStorage.getItem(F);
|
|
1047
|
-
if (sessionStorage.removeItem(F), n !== o)
|
|
1048
|
-
throw new E("Invalid state parameter");
|
|
1049
|
-
const s = sessionStorage.getItem($);
|
|
1050
|
-
if (sessionStorage.removeItem($), !s)
|
|
1051
|
-
throw new E("No code verifier found in state.");
|
|
1052
|
-
const r = await this.getAuthServer(), i = Lt(
|
|
1053
|
-
r,
|
|
1054
|
-
this.client,
|
|
1055
|
-
e.searchParams,
|
|
1056
|
-
n ?? void 0
|
|
1057
|
-
);
|
|
1058
|
-
if (B(i))
|
|
1059
|
-
throw ie.error("Error validating OAuth response", i), new de(
|
|
1060
|
-
"Error validating OAuth response",
|
|
1061
|
-
i
|
|
1062
|
-
);
|
|
1063
|
-
const c = new URL(e);
|
|
1064
|
-
c.pathname = this.absoluteCallbackUrlPath, c.search = "";
|
|
1065
|
-
const p = await bt(
|
|
1066
|
-
r,
|
|
1067
|
-
this.client,
|
|
1068
|
-
i,
|
|
1069
|
-
c.toString(),
|
|
1070
|
-
s
|
|
1071
|
-
), y = await Tt(
|
|
1072
|
-
r,
|
|
1073
|
-
this.client,
|
|
1074
|
-
p
|
|
1075
|
-
);
|
|
1076
|
-
this.setTokensFromResponse(y);
|
|
1077
|
-
const f = await this.getAccessToken(), b = await (await ht(
|
|
1078
|
-
r,
|
|
1079
|
-
this.client,
|
|
1080
|
-
f
|
|
1081
|
-
)).json(), d = {
|
|
1082
|
-
sub: b.sub,
|
|
1083
|
-
email: b.email,
|
|
1084
|
-
name: b.name,
|
|
1085
|
-
emailVerified: b.email_verified ?? !1,
|
|
1086
|
-
pictureUrl: b.picture
|
|
1087
|
-
};
|
|
1088
|
-
C.setState({
|
|
1089
|
-
isAuthenticated: !0,
|
|
1090
|
-
isPending: !1,
|
|
1091
|
-
profile: d
|
|
1092
|
-
});
|
|
1093
|
-
const R = sessionStorage.getItem("redirect-to") ?? "/";
|
|
1094
|
-
return sessionStorage.removeItem("redirect-to"), R;
|
|
1095
|
-
};
|
|
1096
1104
|
getAuthenticationPlugin() {
|
|
1097
|
-
return new
|
|
1105
|
+
return new Dt(
|
|
1098
1106
|
this.relativeCallbackUrlPath,
|
|
1099
1107
|
this.handleCallback
|
|
1100
1108
|
);
|
|
1101
1109
|
}
|
|
1102
1110
|
}
|
|
1103
|
-
const
|
|
1111
|
+
const Vt = (t) => new Nt(t);
|
|
1104
1112
|
export {
|
|
1105
|
-
|
|
1106
|
-
|
|
1113
|
+
Nt as OpenIDAuthenticationProvider,
|
|
1114
|
+
Vt as default
|
|
1107
1115
|
};
|
|
1108
1116
|
//# sourceMappingURL=zudoku.auth-openid.js.map
|