zudoku 0.42.0 → 0.42.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/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/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/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-DPCuR3xm.js +58 -0
- package/lib/{AuthenticationPlugin-EeQpQI3D.js.map → AuthenticationPlugin-DPCuR3xm.js.map} +1 -1
- 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/{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-CZiF_RMW.js} +4 -4
- package/lib/{OasProvider-DKpTJMH2.js.map → OasProvider-CZiF_RMW.js.map} +1 -1
- package/lib/{OperationList-DVOyNeno.js → OperationList-CMMzLfIZ.js} +1417 -1385
- package/lib/{OperationList-DVOyNeno.js.map → OperationList-CMMzLfIZ.js.map} +1 -1
- 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-_d3Mf4IX.js} +44 -43
- package/lib/{SchemaList-BTWzXyYQ.js.map → SchemaList-_d3Mf4IX.js.map} +1 -1
- package/lib/{SchemaView-DNKKW3nB.js → SchemaView-J7Srn-Iy.js} +11 -7
- package/lib/{SchemaView-DNKKW3nB.js.map → SchemaView-J7Srn-Iy.js.map} +1 -1
- 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-CCS3ifKs.js → index-BPqJMdth.js} +733 -690
- package/lib/{index-CCS3ifKs.js.map → index-BPqJMdth.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-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 +6 -16
- package/src/app/main.css +3 -53
- package/src/app/main.tsx +0 -7
- 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/Sidecar.tsx +1 -1
- package/src/lib/plugins/openapi/SidecarExamples.tsx +2 -2
- 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/Markdown-1l-DtDbF.js +0 -7688
- package/lib/Markdown-1l-DtDbF.js.map +0 -1
- package/lib/MdxPage-Dxbq6lFr.js +0 -84
- package/lib/RouteGuard-CGqivwrh.js +0 -733
- 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/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
package/lib/hook-CyNmcNr8.js
DELETED
|
@@ -1,1443 +0,0 @@
|
|
|
1
|
-
import * as S from "react";
|
|
2
|
-
import Y, { createContext as Oe, useContext as Ee } from "react";
|
|
3
|
-
import { j as Ce } from "./jsx-runtime-C5mzlN2N.js";
|
|
4
|
-
import { u as A, m as X } from "./chunk-BAXFHI7N-CFrZQ7Oh.js";
|
|
5
|
-
var $ = class {
|
|
6
|
-
constructor() {
|
|
7
|
-
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
8
|
-
}
|
|
9
|
-
subscribe(e) {
|
|
10
|
-
return this.listeners.add(e), this.onSubscribe(), () => {
|
|
11
|
-
this.listeners.delete(e), this.onUnsubscribe();
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
hasListeners() {
|
|
15
|
-
return this.listeners.size > 0;
|
|
16
|
-
}
|
|
17
|
-
onSubscribe() {
|
|
18
|
-
}
|
|
19
|
-
onUnsubscribe() {
|
|
20
|
-
}
|
|
21
|
-
}, C = typeof window > "u" || "Deno" in globalThis;
|
|
22
|
-
function q() {
|
|
23
|
-
}
|
|
24
|
-
function mt(e, t) {
|
|
25
|
-
return typeof e == "function" ? e(t) : e;
|
|
26
|
-
}
|
|
27
|
-
function U(e) {
|
|
28
|
-
return typeof e == "number" && e >= 0 && e !== 1 / 0;
|
|
29
|
-
}
|
|
30
|
-
function ue(e, t) {
|
|
31
|
-
return Math.max(e + (t || 0) - Date.now(), 0);
|
|
32
|
-
}
|
|
33
|
-
function k(e, t) {
|
|
34
|
-
return typeof e == "function" ? e(t) : e;
|
|
35
|
-
}
|
|
36
|
-
function w(e, t) {
|
|
37
|
-
return typeof e == "function" ? e(t) : e;
|
|
38
|
-
}
|
|
39
|
-
function gt(e, t) {
|
|
40
|
-
const {
|
|
41
|
-
type: s = "all",
|
|
42
|
-
exact: r,
|
|
43
|
-
fetchStatus: n,
|
|
44
|
-
predicate: o,
|
|
45
|
-
queryKey: a,
|
|
46
|
-
stale: i
|
|
47
|
-
} = e;
|
|
48
|
-
if (a) {
|
|
49
|
-
if (r) {
|
|
50
|
-
if (t.queryHash !== Fe(a, t.options))
|
|
51
|
-
return !1;
|
|
52
|
-
} else if (!G(t.queryKey, a))
|
|
53
|
-
return !1;
|
|
54
|
-
}
|
|
55
|
-
if (s !== "all") {
|
|
56
|
-
const u = t.isActive();
|
|
57
|
-
if (s === "active" && !u || s === "inactive" && u)
|
|
58
|
-
return !1;
|
|
59
|
-
}
|
|
60
|
-
return !(typeof i == "boolean" && t.isStale() !== i || n && n !== t.state.fetchStatus || o && !o(t));
|
|
61
|
-
}
|
|
62
|
-
function St(e, t) {
|
|
63
|
-
const { exact: s, status: r, predicate: n, mutationKey: o } = e;
|
|
64
|
-
if (o) {
|
|
65
|
-
if (!t.options.mutationKey)
|
|
66
|
-
return !1;
|
|
67
|
-
if (s) {
|
|
68
|
-
if (Q(t.options.mutationKey) !== Q(o))
|
|
69
|
-
return !1;
|
|
70
|
-
} else if (!G(t.options.mutationKey, o))
|
|
71
|
-
return !1;
|
|
72
|
-
}
|
|
73
|
-
return !(r && t.state.status !== r || n && !n(t));
|
|
74
|
-
}
|
|
75
|
-
function Fe(e, t) {
|
|
76
|
-
return (t?.queryKeyHashFn || Q)(e);
|
|
77
|
-
}
|
|
78
|
-
function Q(e) {
|
|
79
|
-
return JSON.stringify(
|
|
80
|
-
e,
|
|
81
|
-
(t, s) => M(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
function G(e, t) {
|
|
85
|
-
return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? Object.keys(t).every((s) => G(e[s], t[s])) : !1;
|
|
86
|
-
}
|
|
87
|
-
function N(e, t) {
|
|
88
|
-
if (e === t)
|
|
89
|
-
return e;
|
|
90
|
-
const s = ee(e) && ee(t);
|
|
91
|
-
if (s || M(e) && M(t)) {
|
|
92
|
-
const r = s ? e : Object.keys(e), n = r.length, o = s ? t : Object.keys(t), a = o.length, i = s ? [] : {};
|
|
93
|
-
let u = 0;
|
|
94
|
-
for (let l = 0; l < a; l++) {
|
|
95
|
-
const h = s ? l : o[l];
|
|
96
|
-
(!s && r.includes(h) || s) && e[h] === void 0 && t[h] === void 0 ? (i[h] = void 0, u++) : (i[h] = N(e[h], t[h]), i[h] === e[h] && e[h] !== void 0 && u++);
|
|
97
|
-
}
|
|
98
|
-
return n === a && u === n ? e : i;
|
|
99
|
-
}
|
|
100
|
-
return t;
|
|
101
|
-
}
|
|
102
|
-
function L(e, t) {
|
|
103
|
-
if (!t || Object.keys(e).length !== Object.keys(t).length)
|
|
104
|
-
return !1;
|
|
105
|
-
for (const s in e)
|
|
106
|
-
if (e[s] !== t[s])
|
|
107
|
-
return !1;
|
|
108
|
-
return !0;
|
|
109
|
-
}
|
|
110
|
-
function ee(e) {
|
|
111
|
-
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
112
|
-
}
|
|
113
|
-
function M(e) {
|
|
114
|
-
if (!te(e))
|
|
115
|
-
return !1;
|
|
116
|
-
const t = e.constructor;
|
|
117
|
-
if (t === void 0)
|
|
118
|
-
return !0;
|
|
119
|
-
const s = t.prototype;
|
|
120
|
-
return !(!te(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
|
|
121
|
-
}
|
|
122
|
-
function te(e) {
|
|
123
|
-
return Object.prototype.toString.call(e) === "[object Object]";
|
|
124
|
-
}
|
|
125
|
-
function Ie(e) {
|
|
126
|
-
return new Promise((t) => {
|
|
127
|
-
setTimeout(t, e);
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
function _(e, t, s) {
|
|
131
|
-
if (typeof s.structuralSharing == "function")
|
|
132
|
-
return s.structuralSharing(e, t);
|
|
133
|
-
if (s.structuralSharing !== !1) {
|
|
134
|
-
if (process.env.NODE_ENV !== "production")
|
|
135
|
-
try {
|
|
136
|
-
return N(e, t);
|
|
137
|
-
} catch (r) {
|
|
138
|
-
throw console.error(
|
|
139
|
-
`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${s.queryHash}]: ${r}`
|
|
140
|
-
), r;
|
|
141
|
-
}
|
|
142
|
-
return N(e, t);
|
|
143
|
-
}
|
|
144
|
-
return t;
|
|
145
|
-
}
|
|
146
|
-
function wt(e) {
|
|
147
|
-
return e;
|
|
148
|
-
}
|
|
149
|
-
function Rt(e, t, s = 0) {
|
|
150
|
-
const r = [...e, t];
|
|
151
|
-
return s && r.length > s ? r.slice(1) : r;
|
|
152
|
-
}
|
|
153
|
-
function Ot(e, t, s = 0) {
|
|
154
|
-
const r = [t, ...e];
|
|
155
|
-
return s && r.length > s ? r.slice(0, -1) : r;
|
|
156
|
-
}
|
|
157
|
-
var j = Symbol();
|
|
158
|
-
function Pe(e, t) {
|
|
159
|
-
return process.env.NODE_ENV !== "production" && e.queryFn === j && console.error(
|
|
160
|
-
`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`
|
|
161
|
-
), !e.queryFn && t?.initialPromise ? () => t.initialPromise : !e.queryFn || e.queryFn === j ? () => Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn;
|
|
162
|
-
}
|
|
163
|
-
var Te = class extends $ {
|
|
164
|
-
#t;
|
|
165
|
-
#e;
|
|
166
|
-
#s;
|
|
167
|
-
constructor() {
|
|
168
|
-
super(), this.#s = (e) => {
|
|
169
|
-
if (!C && window.addEventListener) {
|
|
170
|
-
const t = () => e();
|
|
171
|
-
return window.addEventListener("visibilitychange", t, !1), () => {
|
|
172
|
-
window.removeEventListener("visibilitychange", t);
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
onSubscribe() {
|
|
178
|
-
this.#e || this.setEventListener(this.#s);
|
|
179
|
-
}
|
|
180
|
-
onUnsubscribe() {
|
|
181
|
-
this.hasListeners() || (this.#e?.(), this.#e = void 0);
|
|
182
|
-
}
|
|
183
|
-
setEventListener(e) {
|
|
184
|
-
this.#s = e, this.#e?.(), this.#e = e((t) => {
|
|
185
|
-
typeof t == "boolean" ? this.setFocused(t) : this.onFocus();
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
setFocused(e) {
|
|
189
|
-
this.#t !== e && (this.#t = e, this.onFocus());
|
|
190
|
-
}
|
|
191
|
-
onFocus() {
|
|
192
|
-
const e = this.isFocused();
|
|
193
|
-
this.listeners.forEach((t) => {
|
|
194
|
-
t(e);
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
isFocused() {
|
|
198
|
-
return typeof this.#t == "boolean" ? this.#t : globalThis.document?.visibilityState !== "hidden";
|
|
199
|
-
}
|
|
200
|
-
}, ce = new Te(), De = class extends $ {
|
|
201
|
-
#t = !0;
|
|
202
|
-
#e;
|
|
203
|
-
#s;
|
|
204
|
-
constructor() {
|
|
205
|
-
super(), this.#s = (e) => {
|
|
206
|
-
if (!C && window.addEventListener) {
|
|
207
|
-
const t = () => e(!0), s = () => e(!1);
|
|
208
|
-
return window.addEventListener("online", t, !1), window.addEventListener("offline", s, !1), () => {
|
|
209
|
-
window.removeEventListener("online", t), window.removeEventListener("offline", s);
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
onSubscribe() {
|
|
215
|
-
this.#e || this.setEventListener(this.#s);
|
|
216
|
-
}
|
|
217
|
-
onUnsubscribe() {
|
|
218
|
-
this.hasListeners() || (this.#e?.(), this.#e = void 0);
|
|
219
|
-
}
|
|
220
|
-
setEventListener(e) {
|
|
221
|
-
this.#s = e, this.#e?.(), this.#e = e(this.setOnline.bind(this));
|
|
222
|
-
}
|
|
223
|
-
setOnline(e) {
|
|
224
|
-
this.#t !== e && (this.#t = e, this.listeners.forEach((s) => {
|
|
225
|
-
s(e);
|
|
226
|
-
}));
|
|
227
|
-
}
|
|
228
|
-
isOnline() {
|
|
229
|
-
return this.#t;
|
|
230
|
-
}
|
|
231
|
-
}, he = new De();
|
|
232
|
-
function H() {
|
|
233
|
-
let e, t;
|
|
234
|
-
const s = new Promise((n, o) => {
|
|
235
|
-
e = n, t = o;
|
|
236
|
-
});
|
|
237
|
-
s.status = "pending", s.catch(() => {
|
|
238
|
-
});
|
|
239
|
-
function r(n) {
|
|
240
|
-
Object.assign(s, n), delete s.resolve, delete s.reject;
|
|
241
|
-
}
|
|
242
|
-
return s.resolve = (n) => {
|
|
243
|
-
r({
|
|
244
|
-
status: "fulfilled",
|
|
245
|
-
value: n
|
|
246
|
-
}), e(n);
|
|
247
|
-
}, s.reject = (n) => {
|
|
248
|
-
r({
|
|
249
|
-
status: "rejected",
|
|
250
|
-
reason: n
|
|
251
|
-
}), t(n);
|
|
252
|
-
}, s;
|
|
253
|
-
}
|
|
254
|
-
function ke(e) {
|
|
255
|
-
return Math.min(1e3 * 2 ** e, 3e4);
|
|
256
|
-
}
|
|
257
|
-
function le(e) {
|
|
258
|
-
return (e ?? "online") === "online" ? he.isOnline() : !0;
|
|
259
|
-
}
|
|
260
|
-
var de = class extends Error {
|
|
261
|
-
constructor(e) {
|
|
262
|
-
super("CancelledError"), this.revert = e?.revert, this.silent = e?.silent;
|
|
263
|
-
}
|
|
264
|
-
};
|
|
265
|
-
function x(e) {
|
|
266
|
-
return e instanceof de;
|
|
267
|
-
}
|
|
268
|
-
function je(e) {
|
|
269
|
-
let t = !1, s = 0, r = !1, n;
|
|
270
|
-
const o = H(), a = (c) => {
|
|
271
|
-
r || (d(new de(c)), e.abort?.());
|
|
272
|
-
}, i = () => {
|
|
273
|
-
t = !0;
|
|
274
|
-
}, u = () => {
|
|
275
|
-
t = !1;
|
|
276
|
-
}, l = () => ce.isFocused() && (e.networkMode === "always" || he.isOnline()) && e.canRun(), h = () => le(e.networkMode) && e.canRun(), p = (c) => {
|
|
277
|
-
r || (r = !0, e.onSuccess?.(c), n?.(), o.resolve(c));
|
|
278
|
-
}, d = (c) => {
|
|
279
|
-
r || (r = !0, e.onError?.(c), n?.(), o.reject(c));
|
|
280
|
-
}, b = () => new Promise((c) => {
|
|
281
|
-
n = (m) => {
|
|
282
|
-
(r || l()) && c(m);
|
|
283
|
-
}, e.onPause?.();
|
|
284
|
-
}).then(() => {
|
|
285
|
-
n = void 0, r || e.onContinue?.();
|
|
286
|
-
}), O = () => {
|
|
287
|
-
if (r)
|
|
288
|
-
return;
|
|
289
|
-
let c;
|
|
290
|
-
const m = s === 0 ? e.initialPromise : void 0;
|
|
291
|
-
try {
|
|
292
|
-
c = m ?? e.fn();
|
|
293
|
-
} catch (v) {
|
|
294
|
-
c = Promise.reject(v);
|
|
295
|
-
}
|
|
296
|
-
Promise.resolve(c).then(p).catch((v) => {
|
|
297
|
-
if (r)
|
|
298
|
-
return;
|
|
299
|
-
const f = e.retry ?? (C ? 0 : 3), y = e.retryDelay ?? ke, E = typeof y == "function" ? y(s, v) : y, F = f === !0 || typeof f == "number" && s < f || typeof f == "function" && f(s, v);
|
|
300
|
-
if (t || !F) {
|
|
301
|
-
d(v);
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
s++, e.onFail?.(s, v), Ie(E).then(() => l() ? void 0 : b()).then(() => {
|
|
305
|
-
t ? d(v) : O();
|
|
306
|
-
});
|
|
307
|
-
});
|
|
308
|
-
};
|
|
309
|
-
return {
|
|
310
|
-
promise: o,
|
|
311
|
-
cancel: a,
|
|
312
|
-
continue: () => (n?.(), o),
|
|
313
|
-
cancelRetry: i,
|
|
314
|
-
continueRetry: u,
|
|
315
|
-
canStart: h,
|
|
316
|
-
start: () => (h() ? O() : b().then(O), o)
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
var Ae = (e) => setTimeout(e, 0);
|
|
320
|
-
function xe() {
|
|
321
|
-
let e = [], t = 0, s = (i) => {
|
|
322
|
-
i();
|
|
323
|
-
}, r = (i) => {
|
|
324
|
-
i();
|
|
325
|
-
}, n = Ae;
|
|
326
|
-
const o = (i) => {
|
|
327
|
-
t ? e.push(i) : n(() => {
|
|
328
|
-
s(i);
|
|
329
|
-
});
|
|
330
|
-
}, a = () => {
|
|
331
|
-
const i = e;
|
|
332
|
-
e = [], i.length && n(() => {
|
|
333
|
-
r(() => {
|
|
334
|
-
i.forEach((u) => {
|
|
335
|
-
s(u);
|
|
336
|
-
});
|
|
337
|
-
});
|
|
338
|
-
});
|
|
339
|
-
};
|
|
340
|
-
return {
|
|
341
|
-
batch: (i) => {
|
|
342
|
-
let u;
|
|
343
|
-
t++;
|
|
344
|
-
try {
|
|
345
|
-
u = i();
|
|
346
|
-
} finally {
|
|
347
|
-
t--, t || a();
|
|
348
|
-
}
|
|
349
|
-
return u;
|
|
350
|
-
},
|
|
351
|
-
/**
|
|
352
|
-
* All calls to the wrapped function will be batched.
|
|
353
|
-
*/
|
|
354
|
-
batchCalls: (i) => (...u) => {
|
|
355
|
-
o(() => {
|
|
356
|
-
i(...u);
|
|
357
|
-
});
|
|
358
|
-
},
|
|
359
|
-
schedule: o,
|
|
360
|
-
/**
|
|
361
|
-
* Use this method to set a custom notify function.
|
|
362
|
-
* This can be used to for example wrap notifications with `React.act` while running tests.
|
|
363
|
-
*/
|
|
364
|
-
setNotifyFunction: (i) => {
|
|
365
|
-
s = i;
|
|
366
|
-
},
|
|
367
|
-
/**
|
|
368
|
-
* Use this method to set a custom function to batch notifications together into a single tick.
|
|
369
|
-
* By default React Query will use the batch function provided by ReactDOM or React Native.
|
|
370
|
-
*/
|
|
371
|
-
setBatchNotifyFunction: (i) => {
|
|
372
|
-
r = i;
|
|
373
|
-
},
|
|
374
|
-
setScheduler: (i) => {
|
|
375
|
-
n = i;
|
|
376
|
-
}
|
|
377
|
-
};
|
|
378
|
-
}
|
|
379
|
-
var z = xe(), qe = class {
|
|
380
|
-
#t;
|
|
381
|
-
destroy() {
|
|
382
|
-
this.clearGcTimeout();
|
|
383
|
-
}
|
|
384
|
-
scheduleGc() {
|
|
385
|
-
this.clearGcTimeout(), U(this.gcTime) && (this.#t = setTimeout(() => {
|
|
386
|
-
this.optionalRemove();
|
|
387
|
-
}, this.gcTime));
|
|
388
|
-
}
|
|
389
|
-
updateGcTime(e) {
|
|
390
|
-
this.gcTime = Math.max(
|
|
391
|
-
this.gcTime || 0,
|
|
392
|
-
e ?? (C ? 1 / 0 : 5 * 60 * 1e3)
|
|
393
|
-
);
|
|
394
|
-
}
|
|
395
|
-
clearGcTimeout() {
|
|
396
|
-
this.#t && (clearTimeout(this.#t), this.#t = void 0);
|
|
397
|
-
}
|
|
398
|
-
}, Et = class extends qe {
|
|
399
|
-
#t;
|
|
400
|
-
#e;
|
|
401
|
-
#s;
|
|
402
|
-
#n;
|
|
403
|
-
#r;
|
|
404
|
-
#a;
|
|
405
|
-
#o;
|
|
406
|
-
constructor(e) {
|
|
407
|
-
super(), this.#o = !1, this.#a = e.defaultOptions, this.setOptions(e.options), this.observers = [], this.#n = e.client, this.#s = this.#n.getQueryCache(), this.queryKey = e.queryKey, this.queryHash = e.queryHash, this.#t = Ue(this.options), this.state = e.state ?? this.#t, this.scheduleGc();
|
|
408
|
-
}
|
|
409
|
-
get meta() {
|
|
410
|
-
return this.options.meta;
|
|
411
|
-
}
|
|
412
|
-
get promise() {
|
|
413
|
-
return this.#r?.promise;
|
|
414
|
-
}
|
|
415
|
-
setOptions(e) {
|
|
416
|
-
this.options = { ...this.#a, ...e }, this.updateGcTime(this.options.gcTime);
|
|
417
|
-
}
|
|
418
|
-
optionalRemove() {
|
|
419
|
-
!this.observers.length && this.state.fetchStatus === "idle" && this.#s.remove(this);
|
|
420
|
-
}
|
|
421
|
-
setData(e, t) {
|
|
422
|
-
const s = _(this.state.data, e, this.options);
|
|
423
|
-
return this.#i({
|
|
424
|
-
data: s,
|
|
425
|
-
type: "success",
|
|
426
|
-
dataUpdatedAt: t?.updatedAt,
|
|
427
|
-
manual: t?.manual
|
|
428
|
-
}), s;
|
|
429
|
-
}
|
|
430
|
-
setState(e, t) {
|
|
431
|
-
this.#i({ type: "setState", state: e, setStateOptions: t });
|
|
432
|
-
}
|
|
433
|
-
cancel(e) {
|
|
434
|
-
const t = this.#r?.promise;
|
|
435
|
-
return this.#r?.cancel(e), t ? t.then(q).catch(q) : Promise.resolve();
|
|
436
|
-
}
|
|
437
|
-
destroy() {
|
|
438
|
-
super.destroy(), this.cancel({ silent: !0 });
|
|
439
|
-
}
|
|
440
|
-
reset() {
|
|
441
|
-
this.destroy(), this.setState(this.#t);
|
|
442
|
-
}
|
|
443
|
-
isActive() {
|
|
444
|
-
return this.observers.some(
|
|
445
|
-
(e) => w(e.options.enabled, this) !== !1
|
|
446
|
-
);
|
|
447
|
-
}
|
|
448
|
-
isDisabled() {
|
|
449
|
-
return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === j || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
|
|
450
|
-
}
|
|
451
|
-
isStale() {
|
|
452
|
-
return this.state.isInvalidated ? !0 : this.getObserversCount() > 0 ? this.observers.some(
|
|
453
|
-
(e) => e.getCurrentResult().isStale
|
|
454
|
-
) : this.state.data === void 0;
|
|
455
|
-
}
|
|
456
|
-
isStaleByTime(e = 0) {
|
|
457
|
-
return this.state.isInvalidated || this.state.data === void 0 || !ue(this.state.dataUpdatedAt, e);
|
|
458
|
-
}
|
|
459
|
-
onFocus() {
|
|
460
|
-
this.observers.find((t) => t.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: !1 }), this.#r?.continue();
|
|
461
|
-
}
|
|
462
|
-
onOnline() {
|
|
463
|
-
this.observers.find((t) => t.shouldFetchOnReconnect())?.refetch({ cancelRefetch: !1 }), this.#r?.continue();
|
|
464
|
-
}
|
|
465
|
-
addObserver(e) {
|
|
466
|
-
this.observers.includes(e) || (this.observers.push(e), this.clearGcTimeout(), this.#s.notify({ type: "observerAdded", query: this, observer: e }));
|
|
467
|
-
}
|
|
468
|
-
removeObserver(e) {
|
|
469
|
-
this.observers.includes(e) && (this.observers = this.observers.filter((t) => t !== e), this.observers.length || (this.#r && (this.#o ? this.#r.cancel({ revert: !0 }) : this.#r.cancelRetry()), this.scheduleGc()), this.#s.notify({ type: "observerRemoved", query: this, observer: e }));
|
|
470
|
-
}
|
|
471
|
-
getObserversCount() {
|
|
472
|
-
return this.observers.length;
|
|
473
|
-
}
|
|
474
|
-
invalidate() {
|
|
475
|
-
this.state.isInvalidated || this.#i({ type: "invalidate" });
|
|
476
|
-
}
|
|
477
|
-
fetch(e, t) {
|
|
478
|
-
if (this.state.fetchStatus !== "idle") {
|
|
479
|
-
if (this.state.data !== void 0 && t?.cancelRefetch)
|
|
480
|
-
this.cancel({ silent: !0 });
|
|
481
|
-
else if (this.#r)
|
|
482
|
-
return this.#r.continueRetry(), this.#r.promise;
|
|
483
|
-
}
|
|
484
|
-
if (e && this.setOptions(e), !this.options.queryFn) {
|
|
485
|
-
const i = this.observers.find((u) => u.options.queryFn);
|
|
486
|
-
i && this.setOptions(i.options);
|
|
487
|
-
}
|
|
488
|
-
process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
|
|
489
|
-
"As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"
|
|
490
|
-
));
|
|
491
|
-
const s = new AbortController(), r = (i) => {
|
|
492
|
-
Object.defineProperty(i, "signal", {
|
|
493
|
-
enumerable: !0,
|
|
494
|
-
get: () => (this.#o = !0, s.signal)
|
|
495
|
-
});
|
|
496
|
-
}, n = () => {
|
|
497
|
-
const i = Pe(this.options, t), u = {
|
|
498
|
-
client: this.#n,
|
|
499
|
-
queryKey: this.queryKey,
|
|
500
|
-
meta: this.meta
|
|
501
|
-
};
|
|
502
|
-
return r(u), this.#o = !1, this.options.persister ? this.options.persister(
|
|
503
|
-
i,
|
|
504
|
-
u,
|
|
505
|
-
this
|
|
506
|
-
) : i(u);
|
|
507
|
-
}, o = {
|
|
508
|
-
fetchOptions: t,
|
|
509
|
-
options: this.options,
|
|
510
|
-
queryKey: this.queryKey,
|
|
511
|
-
client: this.#n,
|
|
512
|
-
state: this.state,
|
|
513
|
-
fetchFn: n
|
|
514
|
-
};
|
|
515
|
-
r(o), this.options.behavior?.onFetch(
|
|
516
|
-
o,
|
|
517
|
-
this
|
|
518
|
-
), this.#e = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== o.fetchOptions?.meta) && this.#i({ type: "fetch", meta: o.fetchOptions?.meta });
|
|
519
|
-
const a = (i) => {
|
|
520
|
-
x(i) && i.silent || this.#i({
|
|
521
|
-
type: "error",
|
|
522
|
-
error: i
|
|
523
|
-
}), x(i) || (this.#s.config.onError?.(
|
|
524
|
-
i,
|
|
525
|
-
this
|
|
526
|
-
), this.#s.config.onSettled?.(
|
|
527
|
-
this.state.data,
|
|
528
|
-
i,
|
|
529
|
-
this
|
|
530
|
-
)), this.scheduleGc();
|
|
531
|
-
};
|
|
532
|
-
return this.#r = je({
|
|
533
|
-
initialPromise: t?.initialPromise,
|
|
534
|
-
fn: o.fetchFn,
|
|
535
|
-
abort: s.abort.bind(s),
|
|
536
|
-
onSuccess: (i) => {
|
|
537
|
-
if (i === void 0) {
|
|
538
|
-
process.env.NODE_ENV !== "production" && console.error(
|
|
539
|
-
`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
|
|
540
|
-
), a(new Error(`${this.queryHash} data is undefined`));
|
|
541
|
-
return;
|
|
542
|
-
}
|
|
543
|
-
try {
|
|
544
|
-
this.setData(i);
|
|
545
|
-
} catch (u) {
|
|
546
|
-
a(u);
|
|
547
|
-
return;
|
|
548
|
-
}
|
|
549
|
-
this.#s.config.onSuccess?.(i, this), this.#s.config.onSettled?.(
|
|
550
|
-
i,
|
|
551
|
-
this.state.error,
|
|
552
|
-
this
|
|
553
|
-
), this.scheduleGc();
|
|
554
|
-
},
|
|
555
|
-
onError: a,
|
|
556
|
-
onFail: (i, u) => {
|
|
557
|
-
this.#i({ type: "failed", failureCount: i, error: u });
|
|
558
|
-
},
|
|
559
|
-
onPause: () => {
|
|
560
|
-
this.#i({ type: "pause" });
|
|
561
|
-
},
|
|
562
|
-
onContinue: () => {
|
|
563
|
-
this.#i({ type: "continue" });
|
|
564
|
-
},
|
|
565
|
-
retry: o.options.retry,
|
|
566
|
-
retryDelay: o.options.retryDelay,
|
|
567
|
-
networkMode: o.options.networkMode,
|
|
568
|
-
canRun: () => !0
|
|
569
|
-
}), this.#r.start();
|
|
570
|
-
}
|
|
571
|
-
#i(e) {
|
|
572
|
-
const t = (s) => {
|
|
573
|
-
switch (e.type) {
|
|
574
|
-
case "failed":
|
|
575
|
-
return {
|
|
576
|
-
...s,
|
|
577
|
-
fetchFailureCount: e.failureCount,
|
|
578
|
-
fetchFailureReason: e.error
|
|
579
|
-
};
|
|
580
|
-
case "pause":
|
|
581
|
-
return {
|
|
582
|
-
...s,
|
|
583
|
-
fetchStatus: "paused"
|
|
584
|
-
};
|
|
585
|
-
case "continue":
|
|
586
|
-
return {
|
|
587
|
-
...s,
|
|
588
|
-
fetchStatus: "fetching"
|
|
589
|
-
};
|
|
590
|
-
case "fetch":
|
|
591
|
-
return {
|
|
592
|
-
...s,
|
|
593
|
-
...fe(s.data, this.options),
|
|
594
|
-
fetchMeta: e.meta ?? null
|
|
595
|
-
};
|
|
596
|
-
case "success":
|
|
597
|
-
return {
|
|
598
|
-
...s,
|
|
599
|
-
data: e.data,
|
|
600
|
-
dataUpdateCount: s.dataUpdateCount + 1,
|
|
601
|
-
dataUpdatedAt: e.dataUpdatedAt ?? Date.now(),
|
|
602
|
-
error: null,
|
|
603
|
-
isInvalidated: !1,
|
|
604
|
-
status: "success",
|
|
605
|
-
...!e.manual && {
|
|
606
|
-
fetchStatus: "idle",
|
|
607
|
-
fetchFailureCount: 0,
|
|
608
|
-
fetchFailureReason: null
|
|
609
|
-
}
|
|
610
|
-
};
|
|
611
|
-
case "error":
|
|
612
|
-
const r = e.error;
|
|
613
|
-
return x(r) && r.revert && this.#e ? { ...this.#e, fetchStatus: "idle" } : {
|
|
614
|
-
...s,
|
|
615
|
-
error: r,
|
|
616
|
-
errorUpdateCount: s.errorUpdateCount + 1,
|
|
617
|
-
errorUpdatedAt: Date.now(),
|
|
618
|
-
fetchFailureCount: s.fetchFailureCount + 1,
|
|
619
|
-
fetchFailureReason: r,
|
|
620
|
-
fetchStatus: "idle",
|
|
621
|
-
status: "error"
|
|
622
|
-
};
|
|
623
|
-
case "invalidate":
|
|
624
|
-
return {
|
|
625
|
-
...s,
|
|
626
|
-
isInvalidated: !0
|
|
627
|
-
};
|
|
628
|
-
case "setState":
|
|
629
|
-
return {
|
|
630
|
-
...s,
|
|
631
|
-
...e.state
|
|
632
|
-
};
|
|
633
|
-
}
|
|
634
|
-
};
|
|
635
|
-
this.state = t(this.state), z.batch(() => {
|
|
636
|
-
this.observers.forEach((s) => {
|
|
637
|
-
s.onQueryUpdate();
|
|
638
|
-
}), this.#s.notify({ query: this, type: "updated", action: e });
|
|
639
|
-
});
|
|
640
|
-
}
|
|
641
|
-
};
|
|
642
|
-
function fe(e, t) {
|
|
643
|
-
return {
|
|
644
|
-
fetchFailureCount: 0,
|
|
645
|
-
fetchFailureReason: null,
|
|
646
|
-
fetchStatus: le(t.networkMode) ? "fetching" : "paused",
|
|
647
|
-
...e === void 0 && {
|
|
648
|
-
error: null,
|
|
649
|
-
status: "pending"
|
|
650
|
-
}
|
|
651
|
-
};
|
|
652
|
-
}
|
|
653
|
-
function Ue(e) {
|
|
654
|
-
const t = typeof e.initialData == "function" ? e.initialData() : e.initialData, s = t !== void 0, r = s ? typeof e.initialDataUpdatedAt == "function" ? e.initialDataUpdatedAt() : e.initialDataUpdatedAt : 0;
|
|
655
|
-
return {
|
|
656
|
-
data: t,
|
|
657
|
-
dataUpdateCount: 0,
|
|
658
|
-
dataUpdatedAt: s ? r ?? Date.now() : 0,
|
|
659
|
-
error: null,
|
|
660
|
-
errorUpdateCount: 0,
|
|
661
|
-
errorUpdatedAt: 0,
|
|
662
|
-
fetchFailureCount: 0,
|
|
663
|
-
fetchFailureReason: null,
|
|
664
|
-
fetchMeta: null,
|
|
665
|
-
isInvalidated: !1,
|
|
666
|
-
status: s ? "success" : "pending",
|
|
667
|
-
fetchStatus: "idle"
|
|
668
|
-
};
|
|
669
|
-
}
|
|
670
|
-
var pe = class extends $ {
|
|
671
|
-
constructor(e, t) {
|
|
672
|
-
super(), this.options = t, this.#t = e, this.#i = null, this.#o = H(), this.options.experimental_prefetchInRender || this.#o.reject(
|
|
673
|
-
new Error("experimental_prefetchInRender feature flag is not enabled")
|
|
674
|
-
), this.bindMethods(), this.setOptions(t);
|
|
675
|
-
}
|
|
676
|
-
#t;
|
|
677
|
-
#e = void 0;
|
|
678
|
-
#s = void 0;
|
|
679
|
-
#n = void 0;
|
|
680
|
-
#r;
|
|
681
|
-
#a;
|
|
682
|
-
#o;
|
|
683
|
-
#i;
|
|
684
|
-
#y;
|
|
685
|
-
#d;
|
|
686
|
-
// This property keeps track of the last query with defined data.
|
|
687
|
-
// It will be used to pass the previous data and query to the placeholder function between renders.
|
|
688
|
-
#f;
|
|
689
|
-
#c;
|
|
690
|
-
#h;
|
|
691
|
-
#u;
|
|
692
|
-
#p = /* @__PURE__ */ new Set();
|
|
693
|
-
bindMethods() {
|
|
694
|
-
this.refetch = this.refetch.bind(this);
|
|
695
|
-
}
|
|
696
|
-
onSubscribe() {
|
|
697
|
-
this.listeners.size === 1 && (this.#e.addObserver(this), se(this.#e, this.options) ? this.#l() : this.updateResult(), this.#g());
|
|
698
|
-
}
|
|
699
|
-
onUnsubscribe() {
|
|
700
|
-
this.hasListeners() || this.destroy();
|
|
701
|
-
}
|
|
702
|
-
shouldFetchOnReconnect() {
|
|
703
|
-
return K(
|
|
704
|
-
this.#e,
|
|
705
|
-
this.options,
|
|
706
|
-
this.options.refetchOnReconnect
|
|
707
|
-
);
|
|
708
|
-
}
|
|
709
|
-
shouldFetchOnWindowFocus() {
|
|
710
|
-
return K(
|
|
711
|
-
this.#e,
|
|
712
|
-
this.options,
|
|
713
|
-
this.options.refetchOnWindowFocus
|
|
714
|
-
);
|
|
715
|
-
}
|
|
716
|
-
destroy() {
|
|
717
|
-
this.listeners = /* @__PURE__ */ new Set(), this.#S(), this.#w(), this.#e.removeObserver(this);
|
|
718
|
-
}
|
|
719
|
-
setOptions(e) {
|
|
720
|
-
const t = this.options, s = this.#e;
|
|
721
|
-
if (this.options = this.#t.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof w(this.options.enabled, this.#e) != "boolean")
|
|
722
|
-
throw new Error(
|
|
723
|
-
"Expected enabled to be a boolean or a callback that returns a boolean"
|
|
724
|
-
);
|
|
725
|
-
this.#R(), this.#e.setOptions(this.options), t._defaulted && !L(this.options, t) && this.#t.getQueryCache().notify({
|
|
726
|
-
type: "observerOptionsUpdated",
|
|
727
|
-
query: this.#e,
|
|
728
|
-
observer: this
|
|
729
|
-
});
|
|
730
|
-
const r = this.hasListeners();
|
|
731
|
-
r && re(
|
|
732
|
-
this.#e,
|
|
733
|
-
s,
|
|
734
|
-
this.options,
|
|
735
|
-
t
|
|
736
|
-
) && this.#l(), this.updateResult(), r && (this.#e !== s || w(this.options.enabled, this.#e) !== w(t.enabled, this.#e) || k(this.options.staleTime, this.#e) !== k(t.staleTime, this.#e)) && this.#v();
|
|
737
|
-
const n = this.#b();
|
|
738
|
-
r && (this.#e !== s || w(this.options.enabled, this.#e) !== w(t.enabled, this.#e) || n !== this.#u) && this.#m(n);
|
|
739
|
-
}
|
|
740
|
-
getOptimisticResult(e) {
|
|
741
|
-
const t = this.#t.getQueryCache().build(this.#t, e), s = this.createResult(t, e);
|
|
742
|
-
return Ne(this, s) && (this.#n = s, this.#a = this.options, this.#r = this.#e.state), s;
|
|
743
|
-
}
|
|
744
|
-
getCurrentResult() {
|
|
745
|
-
return this.#n;
|
|
746
|
-
}
|
|
747
|
-
trackResult(e, t) {
|
|
748
|
-
const s = {};
|
|
749
|
-
return Object.keys(e).forEach((r) => {
|
|
750
|
-
Object.defineProperty(s, r, {
|
|
751
|
-
configurable: !1,
|
|
752
|
-
enumerable: !0,
|
|
753
|
-
get: () => (this.trackProp(r), t?.(r), e[r])
|
|
754
|
-
});
|
|
755
|
-
}), s;
|
|
756
|
-
}
|
|
757
|
-
trackProp(e) {
|
|
758
|
-
this.#p.add(e);
|
|
759
|
-
}
|
|
760
|
-
getCurrentQuery() {
|
|
761
|
-
return this.#e;
|
|
762
|
-
}
|
|
763
|
-
refetch({ ...e } = {}) {
|
|
764
|
-
return this.fetch({
|
|
765
|
-
...e
|
|
766
|
-
});
|
|
767
|
-
}
|
|
768
|
-
fetchOptimistic(e) {
|
|
769
|
-
const t = this.#t.defaultQueryOptions(e), s = this.#t.getQueryCache().build(this.#t, t);
|
|
770
|
-
return s.fetch().then(() => this.createResult(s, t));
|
|
771
|
-
}
|
|
772
|
-
fetch(e) {
|
|
773
|
-
return this.#l({
|
|
774
|
-
...e,
|
|
775
|
-
cancelRefetch: e.cancelRefetch ?? !0
|
|
776
|
-
}).then(() => (this.updateResult(), this.#n));
|
|
777
|
-
}
|
|
778
|
-
#l(e) {
|
|
779
|
-
this.#R();
|
|
780
|
-
let t = this.#e.fetch(
|
|
781
|
-
this.options,
|
|
782
|
-
e
|
|
783
|
-
);
|
|
784
|
-
return e?.throwOnError || (t = t.catch(q)), t;
|
|
785
|
-
}
|
|
786
|
-
#v() {
|
|
787
|
-
this.#S();
|
|
788
|
-
const e = k(
|
|
789
|
-
this.options.staleTime,
|
|
790
|
-
this.#e
|
|
791
|
-
);
|
|
792
|
-
if (C || this.#n.isStale || !U(e))
|
|
793
|
-
return;
|
|
794
|
-
const s = ue(this.#n.dataUpdatedAt, e) + 1;
|
|
795
|
-
this.#c = setTimeout(() => {
|
|
796
|
-
this.#n.isStale || this.updateResult();
|
|
797
|
-
}, s);
|
|
798
|
-
}
|
|
799
|
-
#b() {
|
|
800
|
-
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#e) : this.options.refetchInterval) ?? !1;
|
|
801
|
-
}
|
|
802
|
-
#m(e) {
|
|
803
|
-
this.#w(), this.#u = e, !(C || w(this.options.enabled, this.#e) === !1 || !U(this.#u) || this.#u === 0) && (this.#h = setInterval(() => {
|
|
804
|
-
(this.options.refetchIntervalInBackground || ce.isFocused()) && this.#l();
|
|
805
|
-
}, this.#u));
|
|
806
|
-
}
|
|
807
|
-
#g() {
|
|
808
|
-
this.#v(), this.#m(this.#b());
|
|
809
|
-
}
|
|
810
|
-
#S() {
|
|
811
|
-
this.#c && (clearTimeout(this.#c), this.#c = void 0);
|
|
812
|
-
}
|
|
813
|
-
#w() {
|
|
814
|
-
this.#h && (clearInterval(this.#h), this.#h = void 0);
|
|
815
|
-
}
|
|
816
|
-
createResult(e, t) {
|
|
817
|
-
const s = this.#e, r = this.options, n = this.#n, o = this.#r, a = this.#a, u = e !== s ? e.state : this.#s, { state: l } = e;
|
|
818
|
-
let h = { ...l }, p = !1, d;
|
|
819
|
-
if (t._optimisticResults) {
|
|
820
|
-
const g = this.hasListeners(), T = !g && se(e, t), I = g && re(e, s, t, r);
|
|
821
|
-
(T || I) && (h = {
|
|
822
|
-
...h,
|
|
823
|
-
...fe(l.data, e.options)
|
|
824
|
-
}), t._optimisticResults === "isRestoring" && (h.fetchStatus = "idle");
|
|
825
|
-
}
|
|
826
|
-
let { error: b, errorUpdatedAt: O, status: c } = h;
|
|
827
|
-
d = h.data;
|
|
828
|
-
let m = !1;
|
|
829
|
-
if (t.placeholderData !== void 0 && d === void 0 && c === "pending") {
|
|
830
|
-
let g;
|
|
831
|
-
n?.isPlaceholderData && t.placeholderData === a?.placeholderData ? (g = n.data, m = !0) : g = typeof t.placeholderData == "function" ? t.placeholderData(
|
|
832
|
-
this.#f?.state.data,
|
|
833
|
-
this.#f
|
|
834
|
-
) : t.placeholderData, g !== void 0 && (c = "success", d = _(
|
|
835
|
-
n?.data,
|
|
836
|
-
g,
|
|
837
|
-
t
|
|
838
|
-
), p = !0);
|
|
839
|
-
}
|
|
840
|
-
if (t.select && d !== void 0 && !m)
|
|
841
|
-
if (n && d === o?.data && t.select === this.#y)
|
|
842
|
-
d = this.#d;
|
|
843
|
-
else
|
|
844
|
-
try {
|
|
845
|
-
this.#y = t.select, d = t.select(d), d = _(n?.data, d, t), this.#d = d, this.#i = null;
|
|
846
|
-
} catch (g) {
|
|
847
|
-
this.#i = g;
|
|
848
|
-
}
|
|
849
|
-
this.#i && (b = this.#i, d = this.#d, O = Date.now(), c = "error");
|
|
850
|
-
const v = h.fetchStatus === "fetching", f = c === "pending", y = c === "error", E = f && v, F = d !== void 0, R = {
|
|
851
|
-
status: c,
|
|
852
|
-
fetchStatus: h.fetchStatus,
|
|
853
|
-
isPending: f,
|
|
854
|
-
isSuccess: c === "success",
|
|
855
|
-
isError: y,
|
|
856
|
-
isInitialLoading: E,
|
|
857
|
-
isLoading: E,
|
|
858
|
-
data: d,
|
|
859
|
-
dataUpdatedAt: h.dataUpdatedAt,
|
|
860
|
-
error: b,
|
|
861
|
-
errorUpdatedAt: O,
|
|
862
|
-
failureCount: h.fetchFailureCount,
|
|
863
|
-
failureReason: h.fetchFailureReason,
|
|
864
|
-
errorUpdateCount: h.errorUpdateCount,
|
|
865
|
-
isFetched: h.dataUpdateCount > 0 || h.errorUpdateCount > 0,
|
|
866
|
-
isFetchedAfterMount: h.dataUpdateCount > u.dataUpdateCount || h.errorUpdateCount > u.errorUpdateCount,
|
|
867
|
-
isFetching: v,
|
|
868
|
-
isRefetching: v && !f,
|
|
869
|
-
isLoadingError: y && !F,
|
|
870
|
-
isPaused: h.fetchStatus === "paused",
|
|
871
|
-
isPlaceholderData: p,
|
|
872
|
-
isRefetchError: y && F,
|
|
873
|
-
isStale: V(e, t),
|
|
874
|
-
refetch: this.refetch,
|
|
875
|
-
promise: this.#o
|
|
876
|
-
};
|
|
877
|
-
if (this.options.experimental_prefetchInRender) {
|
|
878
|
-
const g = (D) => {
|
|
879
|
-
R.status === "error" ? D.reject(R.error) : R.data !== void 0 && D.resolve(R.data);
|
|
880
|
-
}, T = () => {
|
|
881
|
-
const D = this.#o = R.promise = H();
|
|
882
|
-
g(D);
|
|
883
|
-
}, I = this.#o;
|
|
884
|
-
switch (I.status) {
|
|
885
|
-
case "pending":
|
|
886
|
-
e.queryHash === s.queryHash && g(I);
|
|
887
|
-
break;
|
|
888
|
-
case "fulfilled":
|
|
889
|
-
(R.status === "error" || R.data !== I.value) && T();
|
|
890
|
-
break;
|
|
891
|
-
case "rejected":
|
|
892
|
-
(R.status !== "error" || R.error !== I.reason) && T();
|
|
893
|
-
break;
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
return R;
|
|
897
|
-
}
|
|
898
|
-
updateResult() {
|
|
899
|
-
const e = this.#n, t = this.createResult(this.#e, this.options);
|
|
900
|
-
if (this.#r = this.#e.state, this.#a = this.options, this.#r.data !== void 0 && (this.#f = this.#e), L(t, e))
|
|
901
|
-
return;
|
|
902
|
-
this.#n = t;
|
|
903
|
-
const s = () => {
|
|
904
|
-
if (!e)
|
|
905
|
-
return !0;
|
|
906
|
-
const { notifyOnChangeProps: r } = this.options, n = typeof r == "function" ? r() : r;
|
|
907
|
-
if (n === "all" || !n && !this.#p.size)
|
|
908
|
-
return !0;
|
|
909
|
-
const o = new Set(
|
|
910
|
-
n ?? this.#p
|
|
911
|
-
);
|
|
912
|
-
return this.options.throwOnError && o.add("error"), Object.keys(this.#n).some((a) => {
|
|
913
|
-
const i = a;
|
|
914
|
-
return this.#n[i] !== e[i] && o.has(i);
|
|
915
|
-
});
|
|
916
|
-
};
|
|
917
|
-
this.#O({ listeners: s() });
|
|
918
|
-
}
|
|
919
|
-
#R() {
|
|
920
|
-
const e = this.#t.getQueryCache().build(this.#t, this.options);
|
|
921
|
-
if (e === this.#e)
|
|
922
|
-
return;
|
|
923
|
-
const t = this.#e;
|
|
924
|
-
this.#e = e, this.#s = e.state, this.hasListeners() && (t?.removeObserver(this), e.addObserver(this));
|
|
925
|
-
}
|
|
926
|
-
onQueryUpdate() {
|
|
927
|
-
this.updateResult(), this.hasListeners() && this.#g();
|
|
928
|
-
}
|
|
929
|
-
#O(e) {
|
|
930
|
-
z.batch(() => {
|
|
931
|
-
e.listeners && this.listeners.forEach((t) => {
|
|
932
|
-
t(this.#n);
|
|
933
|
-
}), this.#t.getQueryCache().notify({
|
|
934
|
-
query: this.#e,
|
|
935
|
-
type: "observerResultsUpdated"
|
|
936
|
-
});
|
|
937
|
-
});
|
|
938
|
-
}
|
|
939
|
-
};
|
|
940
|
-
function Qe(e, t) {
|
|
941
|
-
return w(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && t.retryOnMount === !1);
|
|
942
|
-
}
|
|
943
|
-
function se(e, t) {
|
|
944
|
-
return Qe(e, t) || e.state.data !== void 0 && K(e, t, t.refetchOnMount);
|
|
945
|
-
}
|
|
946
|
-
function K(e, t, s) {
|
|
947
|
-
if (w(t.enabled, e) !== !1) {
|
|
948
|
-
const r = typeof s == "function" ? s(e) : s;
|
|
949
|
-
return r === "always" || r !== !1 && V(e, t);
|
|
950
|
-
}
|
|
951
|
-
return !1;
|
|
952
|
-
}
|
|
953
|
-
function re(e, t, s, r) {
|
|
954
|
-
return (e !== t || w(r.enabled, e) === !1) && (!s.suspense || e.state.status !== "error") && V(e, s);
|
|
955
|
-
}
|
|
956
|
-
function V(e, t) {
|
|
957
|
-
return w(t.enabled, e) !== !1 && e.isStaleByTime(k(t.staleTime, e));
|
|
958
|
-
}
|
|
959
|
-
function Ne(e, t) {
|
|
960
|
-
return !L(e.getCurrentResult(), t);
|
|
961
|
-
}
|
|
962
|
-
var ye = S.createContext(
|
|
963
|
-
void 0
|
|
964
|
-
), ve = (e) => {
|
|
965
|
-
const t = S.useContext(ye);
|
|
966
|
-
if (e)
|
|
967
|
-
return e;
|
|
968
|
-
if (!t)
|
|
969
|
-
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
970
|
-
return t;
|
|
971
|
-
}, Ct = ({
|
|
972
|
-
client: e,
|
|
973
|
-
children: t
|
|
974
|
-
}) => (S.useEffect(() => (e.mount(), () => {
|
|
975
|
-
e.unmount();
|
|
976
|
-
}), [e]), /* @__PURE__ */ Ce.jsx(ye.Provider, { value: e, children: t })), be = S.createContext(!1), Le = () => S.useContext(be);
|
|
977
|
-
be.Provider;
|
|
978
|
-
function Me() {
|
|
979
|
-
let e = !1;
|
|
980
|
-
return {
|
|
981
|
-
clearReset: () => {
|
|
982
|
-
e = !1;
|
|
983
|
-
},
|
|
984
|
-
reset: () => {
|
|
985
|
-
e = !0;
|
|
986
|
-
},
|
|
987
|
-
isReset: () => e
|
|
988
|
-
};
|
|
989
|
-
}
|
|
990
|
-
var _e = S.createContext(Me()), He = () => S.useContext(_e);
|
|
991
|
-
function Ke(e, t) {
|
|
992
|
-
return typeof e == "function" ? e(...t) : !!e;
|
|
993
|
-
}
|
|
994
|
-
function ne() {
|
|
995
|
-
}
|
|
996
|
-
var Be = (e, t) => {
|
|
997
|
-
(e.suspense || e.throwOnError || e.experimental_prefetchInRender) && (t.isReset() || (e.retryOnMount = !1));
|
|
998
|
-
}, $e = (e) => {
|
|
999
|
-
S.useEffect(() => {
|
|
1000
|
-
e.clearReset();
|
|
1001
|
-
}, [e]);
|
|
1002
|
-
}, Ge = ({
|
|
1003
|
-
result: e,
|
|
1004
|
-
errorResetBoundary: t,
|
|
1005
|
-
throwOnError: s,
|
|
1006
|
-
query: r,
|
|
1007
|
-
suspense: n
|
|
1008
|
-
}) => e.isError && !t.isReset() && !e.isFetching && r && (n && e.data === void 0 || Ke(s, [e.error, r])), ze = (e, t) => t.state.data === void 0, Ve = (e) => {
|
|
1009
|
-
const t = e.staleTime;
|
|
1010
|
-
e.suspense && (e.staleTime = typeof t == "function" ? (...s) => Math.max(t(...s), 1e3) : Math.max(t ?? 1e3, 1e3), typeof e.gcTime == "number" && (e.gcTime = Math.max(e.gcTime, 1e3)));
|
|
1011
|
-
}, Je = (e, t) => e.isLoading && e.isFetching && !t, Ze = (e, t) => e?.suspense && t.isPending, ie = (e, t, s) => t.fetchOptimistic(e).catch(() => {
|
|
1012
|
-
s.clearReset();
|
|
1013
|
-
});
|
|
1014
|
-
function me(e, t, s) {
|
|
1015
|
-
if (process.env.NODE_ENV !== "production" && (typeof e != "object" || Array.isArray(e)))
|
|
1016
|
-
throw new Error(
|
|
1017
|
-
'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'
|
|
1018
|
-
);
|
|
1019
|
-
const r = ve(s), n = Le(), o = He(), a = r.defaultQueryOptions(e);
|
|
1020
|
-
r.getDefaultOptions().queries?._experimental_beforeQuery?.(
|
|
1021
|
-
a
|
|
1022
|
-
), process.env.NODE_ENV !== "production" && (a.queryFn || console.error(
|
|
1023
|
-
`[${a.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`
|
|
1024
|
-
)), a._optimisticResults = n ? "isRestoring" : "optimistic", Ve(a), Be(a, o), $e(o);
|
|
1025
|
-
const i = !r.getQueryCache().get(a.queryHash), [u] = S.useState(
|
|
1026
|
-
() => new t(
|
|
1027
|
-
r,
|
|
1028
|
-
a
|
|
1029
|
-
)
|
|
1030
|
-
), l = u.getOptimisticResult(a), h = !n && e.subscribed !== !1;
|
|
1031
|
-
if (S.useSyncExternalStore(
|
|
1032
|
-
S.useCallback(
|
|
1033
|
-
(p) => {
|
|
1034
|
-
const d = h ? u.subscribe(z.batchCalls(p)) : ne;
|
|
1035
|
-
return u.updateResult(), d;
|
|
1036
|
-
},
|
|
1037
|
-
[u, h]
|
|
1038
|
-
),
|
|
1039
|
-
() => u.getCurrentResult(),
|
|
1040
|
-
() => u.getCurrentResult()
|
|
1041
|
-
), S.useEffect(() => {
|
|
1042
|
-
u.setOptions(a);
|
|
1043
|
-
}, [a, u]), Ze(a, l))
|
|
1044
|
-
throw ie(a, u, o);
|
|
1045
|
-
if (Ge({
|
|
1046
|
-
result: l,
|
|
1047
|
-
errorResetBoundary: o,
|
|
1048
|
-
throwOnError: a.throwOnError,
|
|
1049
|
-
query: r.getQueryCache().get(a.queryHash),
|
|
1050
|
-
suspense: a.suspense
|
|
1051
|
-
}))
|
|
1052
|
-
throw l.error;
|
|
1053
|
-
return r.getDefaultOptions().queries?._experimental_afterQuery?.(
|
|
1054
|
-
a,
|
|
1055
|
-
l
|
|
1056
|
-
), a.experimental_prefetchInRender && !C && Je(l, n) && (i ? (
|
|
1057
|
-
// Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
|
|
1058
|
-
ie(a, u, o)
|
|
1059
|
-
) : (
|
|
1060
|
-
// subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
|
|
1061
|
-
r.getQueryCache().get(a.queryHash)?.promise
|
|
1062
|
-
))?.catch(ne).finally(() => {
|
|
1063
|
-
u.updateResult();
|
|
1064
|
-
}), a.notifyOnChangeProps ? l : u.trackResult(l);
|
|
1065
|
-
}
|
|
1066
|
-
function We(e, t) {
|
|
1067
|
-
return me(e, pe, t);
|
|
1068
|
-
}
|
|
1069
|
-
function Ye(e, t) {
|
|
1070
|
-
return process.env.NODE_ENV !== "production" && e.queryFn === j && console.error("skipToken is not allowed for useSuspenseQuery"), me(
|
|
1071
|
-
{
|
|
1072
|
-
...e,
|
|
1073
|
-
enabled: !0,
|
|
1074
|
-
suspense: !0,
|
|
1075
|
-
throwOnError: ze,
|
|
1076
|
-
placeholderData: void 0
|
|
1077
|
-
},
|
|
1078
|
-
pe,
|
|
1079
|
-
t
|
|
1080
|
-
);
|
|
1081
|
-
}
|
|
1082
|
-
const Xe = /^(\w+:\/\/[^/?]+)?([^?]*)(\?.*)?$/, et = (e) => e.filter(
|
|
1083
|
-
(t) => t != null && t !== !1 && (typeof t == "string" || typeof t == "number")
|
|
1084
|
-
).map((t) => `${t}`).filter((t) => t), tt = (e) => {
|
|
1085
|
-
const t = e.join("/"), [, s = "", r = ""] = t.match(Xe) ?? [];
|
|
1086
|
-
return {
|
|
1087
|
-
prefix: s,
|
|
1088
|
-
pathname: r.split("/").filter((n) => n !== "")
|
|
1089
|
-
};
|
|
1090
|
-
}, st = (e) => {
|
|
1091
|
-
const { prefix: t, pathname: s } = e;
|
|
1092
|
-
let r = t;
|
|
1093
|
-
return s.length > 0 ? (r ? r += "/" : r = "/", r += s.join("/")) : r || (r = "/"), r;
|
|
1094
|
-
}, oe = (...e) => {
|
|
1095
|
-
const t = et(e), s = tt(t);
|
|
1096
|
-
return st(s);
|
|
1097
|
-
}, ge = Object.freeze({
|
|
1098
|
-
API_IDENTITIES: ["api-identities"]
|
|
1099
|
-
}), Ft = () => {
|
|
1100
|
-
const e = ve();
|
|
1101
|
-
return {
|
|
1102
|
-
invalidateCache: async (t) => {
|
|
1103
|
-
await e.invalidateQueries({ queryKey: ge[t] });
|
|
1104
|
-
}
|
|
1105
|
-
};
|
|
1106
|
-
}, rt = "no-dehydrate", P = (...e) => {
|
|
1107
|
-
const t = e.filter((s) => !!s).map((s) => s.replace(/(^\/+|\/+$)/g, "")).join("/").replace(/(^\/+|\/+$)/g, "");
|
|
1108
|
-
return t ? `/${t}` : "/";
|
|
1109
|
-
}, J = (e, t) => {
|
|
1110
|
-
for (const s of e) {
|
|
1111
|
-
const r = Z(s, t);
|
|
1112
|
-
if (r !== void 0) return r;
|
|
1113
|
-
}
|
|
1114
|
-
}, Z = (e, t, s = []) => {
|
|
1115
|
-
const r = t(e, s);
|
|
1116
|
-
if (r !== void 0) return r;
|
|
1117
|
-
if (e.type === "category")
|
|
1118
|
-
for (const n of e.items) {
|
|
1119
|
-
const o = Z(n, t, [
|
|
1120
|
-
...s,
|
|
1121
|
-
e
|
|
1122
|
-
]);
|
|
1123
|
-
if (o !== void 0) return o;
|
|
1124
|
-
}
|
|
1125
|
-
}, It = () => {
|
|
1126
|
-
const e = A(), s = Se().sidebar;
|
|
1127
|
-
return J(s, (r) => {
|
|
1128
|
-
if (r.type === "doc" && P(r.id) === e.pathname)
|
|
1129
|
-
return r;
|
|
1130
|
-
});
|
|
1131
|
-
}, Pt = (e) => {
|
|
1132
|
-
const t = A();
|
|
1133
|
-
return Z(e, (s) => {
|
|
1134
|
-
if (s.type === "category" && s.link && P(s.link.id) === t.pathname || s.type === "doc" && P(s.id) === t.pathname)
|
|
1135
|
-
return !0;
|
|
1136
|
-
});
|
|
1137
|
-
}, Tt = () => {
|
|
1138
|
-
const e = A().pathname, s = Se().sidebar;
|
|
1139
|
-
let r, n, o = !1;
|
|
1140
|
-
return J(s, (a) => {
|
|
1141
|
-
const i = a.type === "doc" ? P(a.id) : a.type === "category" && a.link ? P(a.link.id) : void 0;
|
|
1142
|
-
if (i) {
|
|
1143
|
-
if (o)
|
|
1144
|
-
return n = { label: a.label, id: i }, !0;
|
|
1145
|
-
e === i ? o = !0 : r = { label: a.label, id: i };
|
|
1146
|
-
}
|
|
1147
|
-
}), { prev: r, next: n };
|
|
1148
|
-
}, nt = Oe(
|
|
1149
|
-
void 0
|
|
1150
|
-
), W = () => {
|
|
1151
|
-
const e = Ee(nt);
|
|
1152
|
-
if (!e)
|
|
1153
|
-
throw new Error("useZudoku must be used within a ZudokuProvider.");
|
|
1154
|
-
return e;
|
|
1155
|
-
}, Dt = () => {
|
|
1156
|
-
const { getApiIdentities: e } = W();
|
|
1157
|
-
return We({
|
|
1158
|
-
queryFn: e,
|
|
1159
|
-
queryKey: ge.API_IDENTITIES
|
|
1160
|
-
});
|
|
1161
|
-
}, Se = () => {
|
|
1162
|
-
const { getPluginSidebar: e, sidebars: t, topNavigation: s, options: r } = W(), n = A(), o = ft(), a = r.protectedRoutes?.some(
|
|
1163
|
-
(p) => X(p, n.pathname)
|
|
1164
|
-
);
|
|
1165
|
-
let i = Object.entries(t).find(([, p]) => J(p, (d) => {
|
|
1166
|
-
if ((d.type === "doc" ? oe(d.id) : d.type === "category" && d.link ? oe(d.link.id) : void 0) === n.pathname)
|
|
1167
|
-
return d;
|
|
1168
|
-
}));
|
|
1169
|
-
const u = s.find((p) => p.id === i?.[0]) ?? s.find((p) => X(p.id, n.pathname));
|
|
1170
|
-
u && !i && u.id in t && (i = ["", t[u.id]]);
|
|
1171
|
-
const { data: l } = Ye({
|
|
1172
|
-
queryFn: () => e(n.pathname),
|
|
1173
|
-
// We just want to suspend here and don't store in SSR dehydrated state
|
|
1174
|
-
queryKey: ["plugin-sidebar", rt, n.pathname]
|
|
1175
|
-
});
|
|
1176
|
-
return {
|
|
1177
|
-
sidebar: o.isAuthEnabled && !o.isAuthenticated && a ? [] : [...i ? i[1] : [], ...l],
|
|
1178
|
-
topNavItem: u
|
|
1179
|
-
};
|
|
1180
|
-
}, ae = (e) => {
|
|
1181
|
-
let t;
|
|
1182
|
-
const s = /* @__PURE__ */ new Set(), r = (l, h) => {
|
|
1183
|
-
const p = typeof l == "function" ? l(t) : l;
|
|
1184
|
-
if (!Object.is(p, t)) {
|
|
1185
|
-
const d = t;
|
|
1186
|
-
t = h ?? (typeof p != "object" || p === null) ? p : Object.assign({}, t, p), s.forEach((b) => b(t, d));
|
|
1187
|
-
}
|
|
1188
|
-
}, n = () => t, i = { setState: r, getState: n, getInitialState: () => u, subscribe: (l) => (s.add(l), () => s.delete(l)) }, u = t = e(r, n, i);
|
|
1189
|
-
return i;
|
|
1190
|
-
}, it = (e) => e ? ae(e) : ae, ot = (e) => e;
|
|
1191
|
-
function at(e, t = ot) {
|
|
1192
|
-
const s = Y.useSyncExternalStore(
|
|
1193
|
-
e.subscribe,
|
|
1194
|
-
() => t(e.getState()),
|
|
1195
|
-
() => t(e.getInitialState())
|
|
1196
|
-
);
|
|
1197
|
-
return Y.useDebugValue(s), s;
|
|
1198
|
-
}
|
|
1199
|
-
const ut = (e) => {
|
|
1200
|
-
const t = it(e), s = (r) => at(t, r);
|
|
1201
|
-
return Object.assign(s, t), s;
|
|
1202
|
-
}, ct = (e) => ut;
|
|
1203
|
-
function we(e, t) {
|
|
1204
|
-
let s;
|
|
1205
|
-
try {
|
|
1206
|
-
s = e();
|
|
1207
|
-
} catch {
|
|
1208
|
-
return;
|
|
1209
|
-
}
|
|
1210
|
-
return {
|
|
1211
|
-
getItem: (n) => {
|
|
1212
|
-
var o;
|
|
1213
|
-
const a = (u) => u === null ? null : JSON.parse(u, void 0), i = (o = s.getItem(n)) != null ? o : null;
|
|
1214
|
-
return i instanceof Promise ? i.then(a) : a(i);
|
|
1215
|
-
},
|
|
1216
|
-
setItem: (n, o) => s.setItem(
|
|
1217
|
-
n,
|
|
1218
|
-
JSON.stringify(o, void 0)
|
|
1219
|
-
),
|
|
1220
|
-
removeItem: (n) => s.removeItem(n)
|
|
1221
|
-
};
|
|
1222
|
-
}
|
|
1223
|
-
const B = (e) => (t) => {
|
|
1224
|
-
try {
|
|
1225
|
-
const s = e(t);
|
|
1226
|
-
return s instanceof Promise ? s : {
|
|
1227
|
-
then(r) {
|
|
1228
|
-
return B(r)(s);
|
|
1229
|
-
},
|
|
1230
|
-
catch(r) {
|
|
1231
|
-
return this;
|
|
1232
|
-
}
|
|
1233
|
-
};
|
|
1234
|
-
} catch (s) {
|
|
1235
|
-
return {
|
|
1236
|
-
then(r) {
|
|
1237
|
-
return this;
|
|
1238
|
-
},
|
|
1239
|
-
catch(r) {
|
|
1240
|
-
return B(r)(s);
|
|
1241
|
-
}
|
|
1242
|
-
};
|
|
1243
|
-
}
|
|
1244
|
-
}, ht = (e, t) => (s, r, n) => {
|
|
1245
|
-
let o = {
|
|
1246
|
-
storage: we(() => localStorage),
|
|
1247
|
-
partialize: (c) => c,
|
|
1248
|
-
version: 0,
|
|
1249
|
-
merge: (c, m) => ({
|
|
1250
|
-
...m,
|
|
1251
|
-
...c
|
|
1252
|
-
}),
|
|
1253
|
-
...t
|
|
1254
|
-
}, a = !1;
|
|
1255
|
-
const i = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
|
|
1256
|
-
let l = o.storage;
|
|
1257
|
-
if (!l)
|
|
1258
|
-
return e(
|
|
1259
|
-
(...c) => {
|
|
1260
|
-
console.warn(
|
|
1261
|
-
`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`
|
|
1262
|
-
), s(...c);
|
|
1263
|
-
},
|
|
1264
|
-
r,
|
|
1265
|
-
n
|
|
1266
|
-
);
|
|
1267
|
-
const h = () => {
|
|
1268
|
-
const c = o.partialize({ ...r() });
|
|
1269
|
-
return l.setItem(o.name, {
|
|
1270
|
-
state: c,
|
|
1271
|
-
version: o.version
|
|
1272
|
-
});
|
|
1273
|
-
}, p = n.setState;
|
|
1274
|
-
n.setState = (c, m) => {
|
|
1275
|
-
p(c, m), h();
|
|
1276
|
-
};
|
|
1277
|
-
const d = e(
|
|
1278
|
-
(...c) => {
|
|
1279
|
-
s(...c), h();
|
|
1280
|
-
},
|
|
1281
|
-
r,
|
|
1282
|
-
n
|
|
1283
|
-
);
|
|
1284
|
-
n.getInitialState = () => d;
|
|
1285
|
-
let b;
|
|
1286
|
-
const O = () => {
|
|
1287
|
-
var c, m;
|
|
1288
|
-
if (!l) return;
|
|
1289
|
-
a = !1, i.forEach((f) => {
|
|
1290
|
-
var y;
|
|
1291
|
-
return f((y = r()) != null ? y : d);
|
|
1292
|
-
});
|
|
1293
|
-
const v = ((m = o.onRehydrateStorage) == null ? void 0 : m.call(o, (c = r()) != null ? c : d)) || void 0;
|
|
1294
|
-
return B(l.getItem.bind(l))(o.name).then((f) => {
|
|
1295
|
-
if (f)
|
|
1296
|
-
if (typeof f.version == "number" && f.version !== o.version) {
|
|
1297
|
-
if (o.migrate) {
|
|
1298
|
-
const y = o.migrate(
|
|
1299
|
-
f.state,
|
|
1300
|
-
f.version
|
|
1301
|
-
);
|
|
1302
|
-
return y instanceof Promise ? y.then((E) => [!0, E]) : [!0, y];
|
|
1303
|
-
}
|
|
1304
|
-
console.error(
|
|
1305
|
-
"State loaded from storage couldn't be migrated since no migrate function was provided"
|
|
1306
|
-
);
|
|
1307
|
-
} else
|
|
1308
|
-
return [!1, f.state];
|
|
1309
|
-
return [!1, void 0];
|
|
1310
|
-
}).then((f) => {
|
|
1311
|
-
var y;
|
|
1312
|
-
const [E, F] = f;
|
|
1313
|
-
if (b = o.merge(
|
|
1314
|
-
F,
|
|
1315
|
-
(y = r()) != null ? y : d
|
|
1316
|
-
), s(b, !0), E)
|
|
1317
|
-
return h();
|
|
1318
|
-
}).then(() => {
|
|
1319
|
-
v?.(b, void 0), b = r(), a = !0, u.forEach((f) => f(b));
|
|
1320
|
-
}).catch((f) => {
|
|
1321
|
-
v?.(void 0, f);
|
|
1322
|
-
});
|
|
1323
|
-
};
|
|
1324
|
-
return n.persist = {
|
|
1325
|
-
setOptions: (c) => {
|
|
1326
|
-
o = {
|
|
1327
|
-
...o,
|
|
1328
|
-
...c
|
|
1329
|
-
}, c.storage && (l = c.storage);
|
|
1330
|
-
},
|
|
1331
|
-
clearStorage: () => {
|
|
1332
|
-
l?.removeItem(o.name);
|
|
1333
|
-
},
|
|
1334
|
-
getOptions: () => o,
|
|
1335
|
-
rehydrate: () => O(),
|
|
1336
|
-
hasHydrated: () => a,
|
|
1337
|
-
onHydrate: (c) => (i.add(c), () => {
|
|
1338
|
-
i.delete(c);
|
|
1339
|
-
}),
|
|
1340
|
-
onFinishHydration: (c) => (u.add(c), () => {
|
|
1341
|
-
u.delete(c);
|
|
1342
|
-
})
|
|
1343
|
-
}, o.skipHydration || O(), b || d;
|
|
1344
|
-
}, lt = ht, dt = (e) => {
|
|
1345
|
-
const t = (s) => {
|
|
1346
|
-
s.key === e.persist.getOptions().name && s.newValue && e.persist.rehydrate();
|
|
1347
|
-
};
|
|
1348
|
-
return window.addEventListener("storage", t), () => {
|
|
1349
|
-
window.removeEventListener("storage", t);
|
|
1350
|
-
};
|
|
1351
|
-
}, Re = ct()(
|
|
1352
|
-
lt(
|
|
1353
|
-
(e) => ({
|
|
1354
|
-
isAuthenticated: !1,
|
|
1355
|
-
isPending: !0,
|
|
1356
|
-
profile: null,
|
|
1357
|
-
providerData: null
|
|
1358
|
-
}),
|
|
1359
|
-
{
|
|
1360
|
-
merge: (e, t) => ({
|
|
1361
|
-
...t,
|
|
1362
|
-
isPending: !1,
|
|
1363
|
-
...typeof e == "object" ? e : {}
|
|
1364
|
-
}),
|
|
1365
|
-
name: "auth-state",
|
|
1366
|
-
storage: we(() => localStorage)
|
|
1367
|
-
}
|
|
1368
|
-
)
|
|
1369
|
-
);
|
|
1370
|
-
typeof window < "u" && dt(Re);
|
|
1371
|
-
const ft = () => {
|
|
1372
|
-
const { authentication: e } = W(), t = Re(), s = typeof e < "u";
|
|
1373
|
-
return {
|
|
1374
|
-
isAuthEnabled: s,
|
|
1375
|
-
...t,
|
|
1376
|
-
login: async () => {
|
|
1377
|
-
if (!s)
|
|
1378
|
-
throw new Error("Authentication is not enabled.");
|
|
1379
|
-
await e.signIn({
|
|
1380
|
-
redirectTo: window.location.href
|
|
1381
|
-
});
|
|
1382
|
-
},
|
|
1383
|
-
logout: async () => {
|
|
1384
|
-
if (!s)
|
|
1385
|
-
throw new Error("Authentication is not enabled.");
|
|
1386
|
-
await e.signOut(), window.location.href = "/";
|
|
1387
|
-
},
|
|
1388
|
-
signup: async () => {
|
|
1389
|
-
if (!s)
|
|
1390
|
-
throw new Error("Authentication is not enabled.");
|
|
1391
|
-
await e.signUp({
|
|
1392
|
-
redirectTo: window.location.href
|
|
1393
|
-
});
|
|
1394
|
-
}
|
|
1395
|
-
};
|
|
1396
|
-
};
|
|
1397
|
-
export {
|
|
1398
|
-
Ot as A,
|
|
1399
|
-
Rt as B,
|
|
1400
|
-
ce as C,
|
|
1401
|
-
he as D,
|
|
1402
|
-
k as E,
|
|
1403
|
-
mt as F,
|
|
1404
|
-
G,
|
|
1405
|
-
j as H,
|
|
1406
|
-
Ct as I,
|
|
1407
|
-
Se as J,
|
|
1408
|
-
J as K,
|
|
1409
|
-
Ft as L,
|
|
1410
|
-
ge as M,
|
|
1411
|
-
Pt as N,
|
|
1412
|
-
Et as Q,
|
|
1413
|
-
qe as R,
|
|
1414
|
-
$ as S,
|
|
1415
|
-
nt as Z,
|
|
1416
|
-
It as a,
|
|
1417
|
-
Tt as b,
|
|
1418
|
-
je as c,
|
|
1419
|
-
Ye as d,
|
|
1420
|
-
W as e,
|
|
1421
|
-
oe as f,
|
|
1422
|
-
ve as g,
|
|
1423
|
-
Q as h,
|
|
1424
|
-
ne as i,
|
|
1425
|
-
P as j,
|
|
1426
|
-
Ke as k,
|
|
1427
|
-
ft as l,
|
|
1428
|
-
We as m,
|
|
1429
|
-
z as n,
|
|
1430
|
-
wt as o,
|
|
1431
|
-
ct as p,
|
|
1432
|
-
lt as q,
|
|
1433
|
-
we as r,
|
|
1434
|
-
L as s,
|
|
1435
|
-
Dt as t,
|
|
1436
|
-
Re as u,
|
|
1437
|
-
Fe as v,
|
|
1438
|
-
gt as w,
|
|
1439
|
-
St as x,
|
|
1440
|
-
q as y,
|
|
1441
|
-
Pe as z
|
|
1442
|
-
};
|
|
1443
|
-
//# sourceMappingURL=hook-CyNmcNr8.js.map
|