mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-09-29 00:32:06 +08:00
1 line
18 KiB
JavaScript
1 line
18 KiB
JavaScript
"use strict";(self.webpackChunkzhenxun_docs=self.webpackChunkzhenxun_docs||[]).push([[3850],{8782:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>u,contentTitle:()=>c,default:()=>x,frontMatter:()=>a,metadata:()=>d,toc:()=>o});var l=t(4848),r=t(8453),s=t(1470),i=t(9365);const a={title:"\u5b89\u88c5\u5c0f\u771f\u5bfb(\u624b\u52a8 - uv \u90e8\u7f72)",subSidebar:!1,id:"install-zhenxun"},c=void 0,d={id:"install/zhenxun/install-zhenxun",title:"\u5b89\u88c5\u5c0f\u771f\u5bfb(\u624b\u52a8 - uv \u90e8\u7f72)",description:"\u771f\u5bfbBot\u9700\u8981python\u7248\u672c\u4e3a >=3.10",source:"@site/docs/install/zhenxun/zhenxun.md",sourceDirName:"install/zhenxun",slug:"/install/zhenxun/",permalink:"/zhenxun_bot/install/zhenxun/",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/install/zhenxun/zhenxun.md",tags:[],version:"current",frontMatter:{title:"\u5b89\u88c5\u5c0f\u771f\u5bfb(\u624b\u52a8 - uv \u90e8\u7f72)",subSidebar:!1,id:"install-zhenxun"},sidebar:"installSidebar",previous:{title:"\u5b89\u88c5\u5c0f\u771f\u5bfb(nb-cli)",permalink:"/zhenxun_bot/install/zhenxun/nb-install-zhenxun"},next:{title:"\u9ed8\u8ba4\u5b89\u88c5",permalink:"/zhenxun_bot/install/webui/install-webui-default"}},u={},o=[{value:"\u4e0b\u8f7d",id:"\u4e0b\u8f7d",level:2},{value:"\u65b9\u5f0f\u4e00\uff1a\u4f7f\u7528 Git Clone (\u63a8\u8350)",id:"\u65b9\u5f0f\u4e00\u4f7f\u7528-git-clone-\u63a8\u8350",level:3},{value:"\u514b\u9686\u5b8c\u6210\u540e\u8fdb\u5165\u9879\u76ee\u6839\u76ee\u5f55",id:"\u514b\u9686\u5b8c\u6210\u540e\u8fdb\u5165\u9879\u76ee\u6839\u76ee\u5f55",level:4},{value:"\u65b9\u5f0f\u4e8c\uff1a\u76f4\u63a5\u4e0b\u8f7d",id:"\u65b9\u5f0f\u4e8c\u76f4\u63a5\u4e0b\u8f7d",level:3},{value:"\u5b89\u88c5\u4f9d\u8d56\u5305",id:"\u5b89\u88c5\u4f9d\u8d56\u5305",level:2},{value:"\u5b89\u88c5 UV \u7ba1\u7406\u5de5\u5177",id:"\u5b89\u88c5-uv-\u7ba1\u7406\u5de5\u5177",level:3},{value:"\u5b89\u88c5\u9879\u76ee\u4f9d\u8d56",id:"\u5b89\u88c5\u9879\u76ee\u4f9d\u8d56",level:3},{value:"\u57fa\u7840\u914d\u7f6e",id:"\u57fa\u7840\u914d\u7f6e",level:2},{value:"\u8bbe\u7f6e\u8d85\u7ea7\u7528\u6237\uff0c\u6253\u5f00 <strong>.env.dev</strong> \u6587\u4ef6\uff0c\u5728<code>SUPERUSERS</code>\u548c<code>qq</code>\u4e2d\u6dfb\u52a0\u81ea\u5df1\u7684QQ",id:"\u8bbe\u7f6e\u8d85\u7ea7\u7528\u6237\u6253\u5f00-envdev-\u6587\u4ef6\u5728superusers\u548cqq\u4e2d\u6dfb\u52a0\u81ea\u5df1\u7684qq",level:3},{value:"\u6570\u636e\u5e93\u914d\u7f6e",id:"\u6570\u636e\u5e93\u914d\u7f6e",level:3},{value:"\u57fa\u7840\u63d2\u4ef6\u914d\u7f6e",id:"\u57fa\u7840\u63d2\u4ef6\u914d\u7f6e",level:3},{value:"\u542f\u52a8",id:"\u542f\u52a8",level:2},{value:"\u5f53\u4f60\u7684\u63a7\u5236\u53f0\u51fa\u73b0\u4ee5\u4e0b\u65e5\u5fd7\uff0c\u8bf4\u660e\u4f60\u5df2\u7ecf\u6210\u529f\u4e86\ud83c\udf89\ud83c\udf89",id:"\u5f53\u4f60\u7684\u63a7\u5236\u53f0\u51fa\u73b0\u4ee5\u4e0b\u65e5\u5fd7\u8bf4\u660e\u4f60\u5df2\u7ecf\u6210\u529f\u4e86",level:4}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.admonition,{title:"\u7248\u672c\u8b66\u544a",type:"warning",children:(0,l.jsxs)(n.p,{children:["\u771f\u5bfbBot\u9700\u8981python\u7248\u672c\u4e3a ",(0,l.jsx)(n.strong,{children:">=3.10"})]})}),"\n",(0,l.jsx)(n.h2,{id:"\u4e0b\u8f7d",children:"\u4e0b\u8f7d"}),"\n",(0,l.jsx)(n.p,{children:"\u4f60\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u4e24\u79cd\u65b9\u5f0f\u4e4b\u4e00\u83b7\u53d6\u9879\u76ee\u4ee3\u7801\uff1a"}),"\n",(0,l.jsx)(n.h3,{id:"\u65b9\u5f0f\u4e00\u4f7f\u7528-git-clone-\u63a8\u8350",children:"\u65b9\u5f0f\u4e00\uff1a\u4f7f\u7528 Git Clone (\u63a8\u8350)"}),"\n",(0,l.jsx)(n.p,{children:"\u5728\u7ec8\u7aef\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-shell",children:"git clone https://github.com/HibiKier/zhenxun_bot.git\n"})}),"\n",(0,l.jsx)(n.h4,{id:"\u514b\u9686\u5b8c\u6210\u540e\u8fdb\u5165\u9879\u76ee\u6839\u76ee\u5f55",children:"\u514b\u9686\u5b8c\u6210\u540e\u8fdb\u5165\u9879\u76ee\u6839\u76ee\u5f55"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-shell",children:"cd zhenxun_bot\n"})}),"\n",(0,l.jsx)(n.h3,{id:"\u65b9\u5f0f\u4e8c\u76f4\u63a5\u4e0b\u8f7d",children:"\u65b9\u5f0f\u4e8c\uff1a\u76f4\u63a5\u4e0b\u8f7d"}),"\n",(0,l.jsxs)(n.p,{children:["\u4ece ",(0,l.jsx)(n.a,{href:"https://github.com/zhenxun-org/zhenxun_bot",children:"zhenxun-org / zhenxun_bot"})," clone\u4ee3\u7801 \u6216 \u76f4\u63a5\u4e0b\u8f7d ",(0,l.jsx)(n.a,{href:"https://github.com/zhenxun-org/zhenxun_bot/archive/refs/heads/main.zip",children:"\u538b\u7f29\u5305"})," \u5e76\u89e3\u538b\uff0c\u968f\u540e\u5728\u7ec8\u7aef\u8fdb\u5165\u89e3\u538b\u540e\u7684\u6587\u4ef6\u5939\u3002"]}),"\n",(0,l.jsx)(n.h2,{id:"\u5b89\u88c5\u4f9d\u8d56\u5305",children:"\u5b89\u88c5\u4f9d\u8d56\u5305"}),"\n",(0,l.jsx)(n.h3,{id:"\u5b89\u88c5-uv-\u7ba1\u7406\u5de5\u5177",children:"\u5b89\u88c5 UV \u7ba1\u7406\u5de5\u5177"}),"\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"uv"})," \u662f\u9ad8\u6027\u80fd\u7684 Python \u5305\u7ba1\u7406\u5668\uff0c\u7528\u4e8e\u66ff\u4ee3\u4f20\u7edf\u7684 pip \u548c poetry\u3002"]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-shell",children:"pip install uv\n"})}),"\n",(0,l.jsx)(n.h3,{id:"\u5b89\u88c5\u9879\u76ee\u4f9d\u8d56",children:"\u5b89\u88c5\u9879\u76ee\u4f9d\u8d56"}),"\n",(0,l.jsxs)(n.p,{children:["\u5728\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff0c",(0,l.jsx)(n.code,{children:"uv"})," \u4f1a\u81ea\u52a8\u521b\u5efa\u865a\u62df\u73af\u5883\u5e76\u540c\u6b65\u6240\u6709\u4f9d\u8d56\uff1a"]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-shell",children:"uv sync\n"})}),"\n",(0,l.jsx)(n.h2,{id:"\u57fa\u7840\u914d\u7f6e",children:"\u57fa\u7840\u914d\u7f6e"}),"\n",(0,l.jsxs)(n.h3,{id:"\u8bbe\u7f6e\u8d85\u7ea7\u7528\u6237\u6253\u5f00-envdev-\u6587\u4ef6\u5728superusers\u548cqq\u4e2d\u6dfb\u52a0\u81ea\u5df1\u7684qq",children:["\u8bbe\u7f6e\u8d85\u7ea7\u7528\u6237\uff0c\u6253\u5f00 ",(0,l.jsx)(n.strong,{children:".env.dev"})," \u6587\u4ef6\uff0c\u5728",(0,l.jsx)(n.code,{children:"SUPERUSERS"}),"\u548c",(0,l.jsx)(n.code,{children:"qq"}),"\u4e2d\u6dfb\u52a0\u81ea\u5df1\u7684QQ"]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-python",metastring:'title="env.dev"',children:'SUPERUSERS=["123456789"]\n\nPLATFORM_SUPERUSERS = \'\n {\n "qq": ["123456789"],\n "dodo": [],\n "kaiheila": [],\n "discord": []\n }\n\'\n'})}),"\n",(0,l.jsx)(n.h3,{id:"\u6570\u636e\u5e93\u914d\u7f6e",children:"\u6570\u636e\u5e93\u914d\u7f6e"}),"\n",(0,l.jsxs)(s.A,{children:[(0,l.jsxs)(i.A,{value:"Postgresql",label:"Postgresql",default:!0,children:[(0,l.jsxs)(n.p,{children:["\u5efa\u8bae\u7684\u6570\u636e\u5e93\uff0c\u5acc\u9ebb\u70e6\u8bf7\u4f7f\u7528",(0,l.jsx)(n.code,{children:"Sqlite"})]}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-python",metastring:'title="env.dev"',children:'# \u793a\u4f8b: "postgres://user:password@127.0.0.1:5432/database"\n\nDB_URL = "postgres://\u7528\u6237\u540d:\u5bc6\u7801@127.0.0.1:\u7aef\u53e3/\u6570\u636e\u5e93\u540d\u79f0"\n\n# \u5982\u679c\u4f60\u662f\u4e0e\u6559\u7a0b\u4e00\u6a21\u4e00\u6837\u7684\u547d\u4ee4\u4ee3\u7801\uff0c\u4e14\u6570\u636e\u5e93\u4e5f\u5728\u8be5\u670d\u52a1\u5668\u4e0a\uff0c\u53ef\u4ee5\u76f4\u63a5\u590d\u5236\u4ee5\u4e0bURL\nDB_URL = "postgres://postgres:zhenxun_bot@127.0.0.1:5432/zhenxun_bot"\n'})})]}),(0,l.jsxs)(i.A,{value:"Sqlite",label:"Sqlite",children:[(0,l.jsxs)(n.p,{children:["Sqlite\u53ef\u4ee5\u653e\u7f6e\u5728\u4efb\u4f55\u4f4d\u7f6e\uff0c",(0,l.jsx)(n.code,{children:"sqlite:"}),"\u4e4b\u540e\u4e3a\u5b58\u653e\u8def\u5f84\uff0c\u4f46\u5efa\u8bae\u5728data\u6587\u4ef6\u5939\u4e0b\u65b0\u5efadb\u6587\u4ef6\u5939\u540e\u4f7f\u7528\u4ee5\u4e0b"]}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-python",metastring:'title="env.dev"',children:'# \u793a\u4f8b: "sqlite:data/db/zhenxun.db"\n\nDB_URL = "sqlite:data/db/zhenxun.db"\n'})})]}),(0,l.jsxs)(i.A,{value:"Mysql",label:"Mysql",children:[(0,l.jsxs)(n.p,{children:["\u4e0e",(0,l.jsx)(n.code,{children:"Postgresql"}),"\u76f8\u540c"]}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-python",metastring:'title="env.dev"',children:'# \u793a\u4f8b: "mysql://user:password@127.0.0.1:3306/database"\n\nDB_URL = "mysql://\u7528\u6237\u540d:\u5bc6\u7801@127.0.0.1:\u7aef\u53e3/\u6570\u636e\u5e93\u540d\u79f0"\n'})})]})]}),"\n",(0,l.jsx)(n.h3,{id:"\u57fa\u7840\u63d2\u4ef6\u914d\u7f6e",children:"\u57fa\u7840\u63d2\u4ef6\u914d\u7f6e"}),"\n",(0,l.jsxs)(n.p,{children:["\u6587\u4ef6\u4fdd\u5b58\u5728 ",(0,l.jsx)(n.strong,{children:"data/config.yaml"}),"\uff0c\u6240\u6709\u771f\u5bfb\u76f8\u5173\u63d2\u4ef6\u90fd\u5728\u4f7f\u7528\u8be5\u914d\u7f6e\u6587\u4ef6\uff0c\u6309\u9700\u4fee\u6539"]}),"\n",(0,l.jsx)(n.h2,{id:"\u542f\u52a8",children:"\u542f\u52a8"}),"\n",(0,l.jsx)(n.p,{children:"\u4f7f\u7528 uv run \u6765\u542f\u52a8 Bot\uff0c\u5b83\u4f1a\u81ea\u52a8\u5173\u8054\u5f53\u524d\u76ee\u5f55\u4e0b\u7684\u865a\u62df\u73af\u5883\uff1a"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"uv run zx\n"})}),"\n",(0,l.jsxs)(n.admonition,{type:"tip",children:[(0,l.jsx)(n.p,{children:"\u5982\u679c\u4f60\u60f3\u8981\u5b89\u88c5\u5305\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff0c\u4ee5httpx\u4e3a\u4f8b\u5b50"}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"uv add httpx\n"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"uv add httpx==0.27.2\n"})})]}),"\n",(0,l.jsx)(n.h4,{id:"\u5f53\u4f60\u7684\u63a7\u5236\u53f0\u51fa\u73b0\u4ee5\u4e0b\u65e5\u5fd7\u8bf4\u660e\u4f60\u5df2\u7ecf\u6210\u529f\u4e86",children:"\u5f53\u4f60\u7684\u63a7\u5236\u53f0\u51fa\u73b0\u4ee5\u4e0b\u65e5\u5fd7\uff0c\u8bf4\u660e\u4f60\u5df2\u7ecf\u6210\u529f\u4e86\ud83c\udf89\ud83c\udf89"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"08-14 23:18:44 [INFO] zhenxun | CMD[Web UI] API\u542f\u52a8\u6210\u529f\n08-14 23:18:44 [INFO] uvicorn | Application startup complete.\n08-14 23:18:44 [INFO] uvicorn | Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit)\n"})}),"\n",(0,l.jsx)(n.admonition,{title:"\u63d0\u793a",type:"tip",children:(0,l.jsx)(n.p,{children:"\u5f53\u524d\u7248\u672c\u771f\u5bfb\u672c\u4f53\u4e0e\u63d2\u4ef6\u5e93\u5206\u79bb\uff0c\u4f60\u53ef\u4ee5\u5728\u4ee5\u4e0b\u83b7\u53d6\u63d2\u4ef6\u6216\u5176\u4ed6\u76f8\u5173\uff0c\u6216\u901a\u8fc7\u4e0e\u771f\u5bfb\u7684\u5bf9\u8bdd\u547d\u4ee4\u5b89\u88c5\u63d2\u4ef6\uff08\u63d2\u4ef6\u5546\u5e97\uff09"})}),"\n",(0,l.jsxs)(n.table,{children:[(0,l.jsx)(n.thead,{children:(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.th,{style:{textAlign:"center"},children:"\u9879\u76ee\u540d\u79f0"}),(0,l.jsx)(n.th,{style:{textAlign:"center"},children:"\u4e3b\u8981\u7528\u9014"}),(0,l.jsx)(n.th,{style:{textAlign:"center"},children:"\u4ed3\u5e93\u4f5c\u8005"}),(0,l.jsx)(n.th,{style:{textAlign:"center"},children:"\u5907\u6ce8"})]})}),(0,l.jsxs)(n.tbody,{children:[(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{style:{textAlign:"center"},children:(0,l.jsx)(n.a,{href:"https://github.com/zhenxun-org/zhenxun_bot_plugins",children:"\u63d2\u4ef6\u5e93"})}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:"\u63d2\u4ef6"}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:(0,l.jsx)(n.a,{href:"https://github.com/zhenxun-org",children:"zhenxun-org"})}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:"\u539f plugins \u6587\u4ef6\u5939\u63d2\u4ef6"})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{style:{textAlign:"center"},children:(0,l.jsx)(n.a,{href:"https://github.com/zhenxun-org/zhenxun_bot_plugins_index",children:"\u63d2\u4ef6\u7d22\u5f15\u5e93"})}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:"\u63d2\u4ef6"}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:(0,l.jsx)(n.a,{href:"https://github.com/zhenxun-org",children:"zhenxun-org"})}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:"\u6269\u5c55\u63d2\u4ef6\u7d22\u5f15\u5e93"})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{style:{textAlign:"center"},children:(0,l.jsx)(n.a,{href:"https://github.com/soloxiaoye2022/zhenxun_bot-deploy",children:"\u4e00\u952e\u5b89\u88c5"})}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:"\u5b89\u88c5"}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:(0,l.jsx)(n.a,{href:"https://github.com/soloxiaoye2022",children:"soloxiaoye2022"})}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:"\u7b2c\u4e09\u65b9"})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{style:{textAlign:"center"},children:(0,l.jsx)(n.a,{href:"https://github.com/HibiKier/zhenxun_bot_webui",children:"WebUi"})}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:"\u7ba1\u7406"}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:(0,l.jsx)(n.a,{href:"https://github.com/HibiKier",children:"hibikier"})}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:"\u57fa\u4e8e\u771f\u5bfb WebApi \u7684 webui \u5b9e\u73b0"})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{style:{textAlign:"center"},children:(0,l.jsx)(n.a,{href:"https://github.com/YuS1aN/zhenxun_bot_android_ui",children:"\u5b89\u5353 app(WebUi)"})}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:"\u5b89\u88c5"}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:(0,l.jsx)(n.a,{href:"https://github.com/YuS1aN",children:"YuS1aN"})}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:"\u7b2c\u4e09\u65b9"})]})]})]})]})}function x(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,l.jsx)(n,{...e,children:(0,l.jsx)(h,{...e})}):h(e)}},9365:(e,n,t)=>{t.d(n,{A:()=>i});t(6540);var l=t(4164);const r={tabItem:"tabItem_Ymn6"};var s=t(4848);function i(e){let{children:n,hidden:t,className:i}=e;return(0,s.jsx)("div",{role:"tabpanel",className:(0,l.A)(r.tabItem,i),hidden:t,children:n})}},1470:(e,n,t)=>{t.d(n,{A:()=>A});var l=t(6540),r=t(4164),s=t(3104),i=t(6347),a=t(205),c=t(7485),d=t(1682),u=t(679);function o(e){return l.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,l.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad <Tabs> child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:t}=e;return(0,l.useMemo)((()=>{const e=n??function(e){return o(e).map((e=>{let{props:{value:n,label:t,attributes:l,default:r}}=e;return{value:n,label:t,attributes:l,default:r}}))}(t);return function(e){const n=(0,d.XI)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in <Tabs>. Every value needs to be unique.`)}(e),e}),[n,t])}function x(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function p(e){let{queryString:n=!1,groupId:t}=e;const r=(0,i.W6)(),s=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,c.aZ)(s),(0,l.useCallback)((e=>{if(!s)return;const n=new URLSearchParams(r.location.search);n.set(s,e),r.replace({...r.location,search:n.toString()})}),[s,r])]}function b(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,s=h(e),[i,c]=(0,l.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(n){if(!x({value:n,tabValues:t}))throw new Error(`Docusaurus error: The <Tabs> has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const l=t.find((e=>e.default))??t[0];if(!l)throw new Error("Unexpected error: 0 tabValues");return l.value}({defaultValue:n,tabValues:s}))),[d,o]=p({queryString:t,groupId:r}),[b,g]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,s]=(0,u.Dv)(t);return[r,(0,l.useCallback)((e=>{t&&s.set(e)}),[t,s])]}({groupId:r}),j=(()=>{const e=d??b;return x({value:e,tabValues:s})?e:null})();(0,a.A)((()=>{j&&c(j)}),[j]);return{selectedValue:i,selectValue:(0,l.useCallback)((e=>{if(!x({value:e,tabValues:s}))throw new Error(`Can't select invalid tab value=${e}`);c(e),o(e),g(e)}),[o,g,s]),tabValues:s}}var g=t(2303);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var v=t(4848);function m(e){let{className:n,block:t,selectedValue:l,selectValue:i,tabValues:a}=e;const c=[],{blockElementScrollPositionUntilNextRender:d}=(0,s.a_)(),u=e=>{const n=e.currentTarget,t=c.indexOf(n),r=a[t].value;r!==l&&(d(n),i(r))},o=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const t=c.indexOf(e.currentTarget)+1;n=c[t]??c[0];break}case"ArrowLeft":{const t=c.indexOf(e.currentTarget)-1;n=c[t]??c[c.length-1];break}}n?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":t},n),children:a.map((e=>{let{value:n,label:t,attributes:s}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:l===n?0:-1,"aria-selected":l===n,ref:e=>c.push(e),onKeyDown:o,onClick:u,...s,className:(0,r.A)("tabs__item",j.tabItem,s?.className,{"tabs__item--active":l===n}),children:t??n},n)}))})}function f(e){let{lazy:n,children:t,selectedValue:s}=e;const i=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=i.find((e=>e.props.value===s));return e?(0,l.cloneElement)(e,{className:(0,r.A)("margin-top--md",e.props.className)}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:i.map(((e,n)=>(0,l.cloneElement)(e,{key:n,hidden:e.props.value!==s})))})}function y(e){const n=b(e);return(0,v.jsxs)("div",{className:(0,r.A)("tabs-container",j.tabList),children:[(0,v.jsx)(m,{...n,...e}),(0,v.jsx)(f,{...n,...e})]})}function A(e){const n=(0,g.A)();return(0,v.jsx)(y,{...e,children:o(e.children)},String(n))}},8453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>a});var l=t(6540);const r={},s=l.createContext(r);function i(e){const n=l.useContext(s);return l.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),l.createElement(s.Provider,{value:n},e.children)}}}]); |