"use strict";(self.webpackChunkfurion=self.webpackChunkfurion||[]).push([[657],{1995:(e,n,c)=>{c.r(n),c.d(n,{assets:()=>o,contentTitle:()=>d,default:()=>a,frontMatter:()=>s,metadata:()=>t,toc:()=>l});var i=c(5893),r=c(1151);c(4996);const s={id:"inject",title:"2.8 \u795e\u5947\u7684 Inject",sidebar_label:"2.8 \u795e\u5947\u7684 Inject",description:"\u4e00\u53e5\u8bdd\u96c6\u6210 Furion"},d=void 0,t={id:"inject",title:"2.8 \u795e\u5947\u7684 Inject",description:"\u4e00\u53e5\u8bdd\u96c6\u6210 Furion",source:"@site/docs/inject.mdx",sourceDirName:".",slug:"/inject",permalink:"/docs/inject",draft:!1,unlisted:!1,editUrl:"https://gitee.com/dotnetchina/Furion/tree/v4/handbook/docs/inject.mdx",tags:[],version:"current",lastUpdatedBy:"MonkSoul",lastUpdatedAt:1682387971,formattedLastUpdatedAt:"Apr 25, 2023",frontMatter:{id:"inject",title:"2.8 \u795e\u5947\u7684 Inject",sidebar_label:"2.8 \u795e\u5947\u7684 Inject",description:"\u4e00\u53e5\u8bdd\u96c6\u6210 Furion"},sidebar:"docs",previous:{title:"2.7 \u624b\u52a8\u642d\u5efa\u5206\u5c42",permalink:"/docs/reference"},next:{title:"2.9 .NET5 \u5347\u7ea7 .NET6",permalink:"/docs/net5-to-net6"}},o={},l=[{value:"2.8.1 Inject
\u8bbe\u8ba1",id:"281-inject-\u8bbe\u8ba1",level:2},{value:"2.8.2 Inject
\u65b9\u6cd5\u6709\u54ea\u4e9b",id:"282-inject-\u65b9\u6cd5\u6709\u54ea\u4e9b",level:2},{value:"2.8.3 \u5728 Program.cs
\u4e2d\u4f7f\u7528",id:"283-\u5728-programcs-\u4e2d\u4f7f\u7528",level:2},{value:"2.8.3.1 Inject()
\u65b9\u6cd5",id:"2831-inject-\u65b9\u6cd5",level:3},{value:"2.8.4 Startup.ConfigureServices
\u4f7f\u7528",id:"284-startupconfigureservices-\u4f7f\u7528",level:2},{value:"2.8.4.1 AddInject()
\u65b9\u6cd5",id:"2841-addinject-\u65b9\u6cd5",level:3},{value:"2.8.4.2 AddInjectBase()
\u65b9\u6cd5",id:"2842-addinjectbase-\u65b9\u6cd5",level:3},{value:"2.8.4.3 AddInjectMini()
\u65b9\u6cd5",id:"2843-addinjectmini-\u65b9\u6cd5",level:3},{value:"2.8.4.4 AddInjectWithUnifyResult()
\u65b9\u6cd5",id:"2844-addinjectwithunifyresult-\u65b9\u6cd5",level:3},{value:"2.8.5 Startup.Configure
\u4f7f\u7528",id:"285-startupconfigure-\u4f7f\u7528",level:2},{value:"2.8.5.1 UseInject()
\u65b9\u6cd5",id:"2851-useinject-\u65b9\u6cd5",level:3},{value:"2.8.5.2 UseInjectBase()
\u65b9\u6cd5",id:"2852-useinjectbase-\u65b9\u6cd5",level:3},{value:"2.8.6 \u914d\u7f6e Inject()
\u9ed8\u8ba4\u6ce8\u518c\u670d\u52a1",id:"286-\u914d\u7f6e-inject-\u9ed8\u8ba4\u6ce8\u518c\u670d\u52a1",level:2},{value:"2.8.7 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"287-\u53cd\u9988\u4e0e\u5efa\u8bae",level:2}];function j(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.admonition,{title:"\u7279\u522b\u6ce8\u610f",type:"warning",children:(0,i.jsxs)(n.p,{children:["\u6240\u6709 ",(0,i.jsx)(n.code,{children:".AddInject****()"})," \u65b9\u6cd5\u4e0d\u80fd\u540c\u65f6\u6ce8\u518c\uff0c\u53ea\u80fd\u53d6\u5176\u4e00\u3002"]})}),"\n",(0,i.jsxs)(n.h2,{id:"281-inject-\u8bbe\u8ba1",children:["2.8.1 ",(0,i.jsx)(n.code,{children:"Inject"})," \u8bbe\u8ba1"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Inject [\u026an\u02c8d\u0292ekt]"})," \u610f\u601d\u662f ",(0,i.jsx)(n.code,{children:"\u6ce8\u5165\uff0c\u6ce8\u5c04"})," \u7684\u610f\u601d\uff0c\u5728\u8fd9\u91cc\u610f\u4e3a\u4f7f\u7528\u6700\u5c0f\u7684\u4fb5\u5165\u5f0f\u5bf9\u5e94\u7528\u8fdb\u884c\u673a\u80fd\u6539\u9020\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Inject()"})," \u65b9\u6cd5\u662f ",(0,i.jsx)(n.code,{children:"Furion"})," \u6846\u67b6\u63d0\u4f9b\u7684\u6700\u5c0f\u4fb5\u5165\u5f0f\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u8ba9\u4efb\u4f55 ",(0,i.jsx)(n.code,{children:"ASP.NET Core"})," Web \u540e\u7aef\u9879\u76ee\u77ac\u95f4\u652f\u6301\u6240\u6709 ",(0,i.jsx)(n.code,{children:"Furion"})," \u6846\u67b6\u7279\u6027\u3002"]}),"\n",(0,i.jsxs)(n.h2,{id:"282-inject-\u65b9\u6cd5\u6709\u54ea\u4e9b",children:["2.8.2 ",(0,i.jsx)(n.code,{children:"Inject"})," \u65b9\u6cd5\u6709\u54ea\u4e9b"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Inject()"}),"\uff1a\u5728 ",(0,i.jsx)(n.code,{children:"Program.cs"})," \u4e2d\u6ce8\u518c"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"AddInject()"}),"\uff1a\u5728 ",(0,i.jsx)(n.code,{children:"Startup.cs"})," \u7684 ",(0,i.jsx)(n.code,{children:"ConfigureServices"})," \u4e2d\u6ce8\u518c"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"AddInjectBase()"}),"\uff1a\u5728 ",(0,i.jsx)(n.code,{children:"Startup.cs"})," \u7684 ",(0,i.jsx)(n.code,{children:"ConfigureServices"})," \u4e2d\u6ce8\u518c"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"AddInjectWithUnifyResult()/ AddInjectWithUnifyResult()"}),"\uff1a\u5728 ",(0,i.jsx)(n.code,{children:"Startup.cs"})," \u7684 ",(0,i.jsx)(n.code,{children:"ConfigureServices"})," \u4e2d\u6ce8\u518c"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"AddInjectMini()"}),"\uff1a\u652f\u6301 ",(0,i.jsx)(n.code,{children:"Minimal API"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"UseInject()"}),"\uff1a\u5728 ",(0,i.jsx)(n.code,{children:"Startup.cs"})," \u7684 ",(0,i.jsx)(n.code,{children:"Configure"})," \u4e2d\u6ce8\u518c"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"UseInjectBase()"}),"\uff1a\u5728 ",(0,i.jsx)(n.code,{children:"Startup.cs"})," \u7684 ",(0,i.jsx)(n.code,{children:"Configure"})," \u4e2d\u6ce8\u518c"]}),"\n"]}),"\n",(0,i.jsxs)(n.h2,{id:"283-\u5728-programcs-\u4e2d\u4f7f\u7528",children:["2.8.3 \u5728 ",(0,i.jsx)(n.code,{children:"Program.cs"})," \u4e2d\u4f7f\u7528"]}),"\n",(0,i.jsxs)(n.h3,{id:"2831-inject-\u65b9\u6cd5",children:["2.8.3.1 ",(0,i.jsx)(n.code,{children:"Inject()"})," \u65b9\u6cd5"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Inject()"})," \u662f\u5728\u542f\u52a8\u7a0b\u5e8f ",(0,i.jsx)(n.code,{children:"Program.cs"})," \u4e2d\u4f7f\u7528\u7684\uff0c\u96c6\u6210 ",(0,i.jsx)(n.code,{children:"Furion"})," \u6846\u67b6\u552f\u4e00\u65b9\u6cd5\uff0c\u5982\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:'showLineNumbers {6,18} title="Furion.Web.Entry\\Program.cs"',children:"using Microsoft.AspNetCore.Hosting;\r\nusing Microsoft.Extensions.Hosting;\r\n\r\nnamespace Furion.Web.Entry\r\n{\r\n public class Program\r\n {\r\n public static void Main(string[] args)\r\n {\r\n CreateHostBuilder(args).Build().Run();\r\n }\r\n\r\n public static IHostBuilder CreateHostBuilder(string[] args)\r\n {\r\n return Host.CreateDefaultBuilder(args)\r\n .ConfigureWebHostDefaults(webBuilder =>\r\n {\r\n webBuilder.Inject()\r\n .UseStartup();\r\n });\r\n }\r\n }\r\n}\n"})}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:".Inject()"})," \u65b9\u6cd5\u63d0\u4f9b\u4e86\u4e00\u4e2a\u53ef\u914d\u7f6e\u7684\u9009\u9879 ",(0,i.jsx)(n.code,{children:"InjectOptions"}),"\uff0c\u53ef\u4ee5\u901a\u8fc7\u8be5\u914d\u7f6e\u914d\u7f6e\u6846\u67b6\u521d\u59cb\u5316\u7684\u4e00\u4e9b\u914d\u7f6e\uff0c\u5982\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {1}",children:'.Inject((builder, options) =>\r\n{\r\n options.AssemblyName = "Furion"; // \u914d\u7f6e\u5916\u90e8\u7a0b\u5e8f\u96c6\u540d\u79f0\r\n options.AutoRegisterBackgroundService = true; // \u662f\u5426\u81ea\u52a8\u6ce8\u518c BackgroundService\r\n\r\n options.ConfigurationScanDirectories("\u76ee\u5f551", "\u76ee\u5f552", ...); // \u914d\u7f6e\u914d\u7f6e\u6587\u4ef6\u626b\u63cf\u76ee\u5f55\r\n options.IgnoreConfigurationFiles("\u6587\u4ef61", "\u6587\u4ef62", ...); // \u914d\u7f6e\u5ffd\u7565\u914d\u7f6e\u6587\u4ef6\r\n\r\n // \u914d\u7f6e\u914d\u7f6e\u5bf9\u8c61\r\n options.ConfigureAppConfiguration((context, config) =>\r\n {\r\n });\r\n\r\n // \u914d\u7f6e\u914d\u7f6e\u5bf9\u8c61\uff08Web\uff09\r\n options.ConfigureWebAppConfiguration((context, config) =>\r\n {\r\n });\r\n\r\n // \u914d\u7f6e ConfigureServices\r\n options.ConfigureServices((context, services) =>\r\n {\r\n });\r\n\r\n // \u914d\u7f6e ConfigureServices\uff08Web\uff09\r\n options.ConfigureWebServices((context, services) =>\r\n {\r\n });\r\n});\n'})}),"\n",(0,i.jsxs)(n.h2,{id:"284-startupconfigureservices-\u4f7f\u7528",children:["2.8.4 ",(0,i.jsx)(n.code,{children:"Startup.ConfigureServices"})," \u4f7f\u7528"]}),"\n",(0,i.jsxs)(n.h3,{id:"2841-addinject-\u65b9\u6cd5",children:["2.8.4.1 ",(0,i.jsx)(n.code,{children:"AddInject()"})," \u65b9\u6cd5"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"AddInject()"})," \u65b9\u6cd5\u662f\u5728 ",(0,i.jsx)(n.code,{children:"Startup.cs"})," \u7684 ",(0,i.jsx)(n.code,{children:"ConfigureServices"})," \u4e2d\u63d0\u4f9b\u6700\u57fa\u7840\u529f\u80fd\u7684\u6ce8\u518c\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"AddInject()"})," \u5305\u542b\u4ee5\u4e0b\u57fa\u7840\u529f\u80fd\u6ce8\u518c\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers",children:"services.AddSpecificationDocuments([options])\r\n .AddDynamicApiControllers()\r\n .AddDataValidation()\r\n .AddFriendlyException();\n"})}),"\n",(0,i.jsx)(n.p,{children:"\u4f7f\u7528\u5982\u4e0b\uff1a"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {3,5,7,10}",children:"namespace Furion.Web.Entry\r\n{\r\n public class Startup\r\n {\r\n public void ConfigureServices(IServiceCollection services)\r\n {\r\n services.AddInject(); // \u652f\u6301\u76f4\u63a5\u6ce8\u518c\uff08\u548c\u4e0b\u9762\u4ee3\u7801\u4e8c\u9009\u4e00\uff0c\u4e0d\u80fd\u540c\u65f6\u6ce8\u518c\u4e24\u6b21\uff09\r\n\r\n services.AddControllers()\r\n .AddInject(); // \u652f\u6301\u94fe\u5f0f\u6ce8\u518c\uff08\u548c\u4e0a\u9762\u4ee3\u7801\u4e8c\u9009\u4e00\uff0c\u4e0d\u80fd\u540c\u65f6\u6ce8\u518c\u4e24\u6b21\uff09\r\n }\r\n\r\n public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\r\n {\r\n // \u5176\u4ed6\u4ee3\u7801\r\n }\r\n }\r\n}\n"})}),"\n",(0,i.jsxs)(n.h3,{id:"2842-addinjectbase-\u65b9\u6cd5",children:["2.8.4.2 ",(0,i.jsx)(n.code,{children:"AddInjectBase()"})," \u65b9\u6cd5"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"AddInjectBase()"})," \u65b9\u6cd5\u662f\u5728 ",(0,i.jsx)(n.code,{children:"Startup.cs"})," \u7684 ",(0,i.jsx)(n.code,{children:"ConfigureServices"})," \u4e2d\u63d0\u4f9b\u6700\u57fa\u7840\u529f\u80fd\u7684\u6ce8\u518c\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"AddInjectBase()"})," \u5305\u542b\u4ee5\u4e0b\u57fa\u7840\u529f\u80fd\u6ce8\u518c\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers",children:"services.AddDataValidation()\r\n .AddFriendlyException();\n"})}),"\n",(0,i.jsxs)(n.p,{children:["\u4f7f\u7528\u540c\u4e0a ",(0,i.jsx)(n.code,{children:"AddInject()"}),"\u3002"]}),"\n",(0,i.jsxs)(n.h3,{id:"2843-addinjectmini-\u65b9\u6cd5",children:["2.8.4.3 ",(0,i.jsx)(n.code,{children:"AddInjectMini()"})," \u65b9\u6cd5"]}),"\n",(0,i.jsx)(n.admonition,{title:"\u7248\u672c\u8bf4\u660e",type:"important",children:(0,i.jsxs)(n.p,{children:["\u4ee5\u4e0b\u5185\u5bb9\u4ec5\u9650 ",(0,i.jsx)(n.code,{children:"Furion 3.7.6 +"})," \u7248\u672c\u4f7f\u7528\u3002"]})}),"\n",(0,i.jsxs)(n.p,{children:["\u652f\u6301 ",(0,i.jsx)(n.code,{children:".NET6"})," \u6700\u65b0\u7684 ",(0,i.jsx)(n.code,{children:"Minimal API"})," \u6a21\u5f0f\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers",children:"builder.Services.AddInjectMini();\n"})}),"\n",(0,i.jsxs)(n.h3,{id:"2844-addinjectwithunifyresult-\u65b9\u6cd5",children:["2.8.4.4 ",(0,i.jsx)(n.code,{children:"AddInjectWithUnifyResult()"})," \u65b9\u6cd5"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"AddInjectWithUnifyResult()"})," \u65b9\u6cd5\u5b9e\u9645\u4e0a\u7b49\u540c\u4e8e\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers",children:"services.AddInject([swaggerGen])\r\n .AddUnifyResult();\n"})}),"\n",(0,i.jsxs)(n.p,{children:["\u4f7f\u7528\u540c\u4e0a ",(0,i.jsx)(n.code,{children:"AddInject()"}),"\u3002"]}),"\n",(0,i.jsxs)(n.h2,{id:"285-startupconfigure-\u4f7f\u7528",children:["2.8.5 ",(0,i.jsx)(n.code,{children:"Startup.Configure"})," \u4f7f\u7528"]}),"\n",(0,i.jsxs)(n.h3,{id:"2851-useinject-\u65b9\u6cd5",children:["2.8.5.1 ",(0,i.jsx)(n.code,{children:"UseInject()"})," \u65b9\u6cd5"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"UseInject()"})," \u65b9\u6cd5\u662f\u5728 ",(0,i.jsx)(n.code,{children:"Startup.cs"})," \u7684 ",(0,i.jsx)(n.code,{children:"Configure"})," \u4e2d\u63d0\u4f9b\u6700\u57fa\u7840\u529f\u80fd\u7684\u6ce8\u518c\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"UseInject()"})," \u5305\u542b\u4ee5\u4e0b\u57fa\u7840\u529f\u80fd\u6ce8\u518c\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers",children:"app.UseSpecificationDocuments();\n"})}),"\n",(0,i.jsx)(n.p,{children:"\u4f7f\u7528\u5982\u4e0b\uff1a"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {3,5,12}",children:"namespace Furion.Web.Entry\r\n{\r\n public class Startup\r\n {\r\n public void ConfigureServices(IServiceCollection services)\r\n {\r\n // \u5176\u4ed6\u4ee3\u7801\r\n }\r\n\r\n public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\r\n {\r\n app.UseInject(); // \u5305\u542b\u6700\u5c0f Swagger \u6ce8\u518c\r\n }\r\n }\r\n}\n"})}),"\n",(0,i.jsxs)(n.h3,{id:"2852-useinjectbase-\u65b9\u6cd5",children:["2.8.5.2 ",(0,i.jsx)(n.code,{children:"UseInjectBase()"})," \u65b9\u6cd5"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"UseInjectBase()"})," \u65b9\u6cd5\u662f\u5728 ",(0,i.jsx)(n.code,{children:"Startup.cs"})," \u7684 ",(0,i.jsx)(n.code,{children:"Configure"})," \u4e2d\u63d0\u4f9b\u6700\u57fa\u7840\u529f\u80fd\u7684\u6ce8\u518c\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"UseInjectBase()"})," \u5b9e\u9645\u4e0a\u662f\u4e2a\u7a7a\u65b9\u6cd5\uff0c\u4e3a\u4e86\u89c4\u8303\u5316\u4ee3\u7801\u7279\u610f\u5efa\u7acb\u7684\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:["\u4f7f\u7528\u540c\u4e0a ",(0,i.jsx)(n.code,{children:"UseInject()"}),"\u3002"]}),"\n",(0,i.jsxs)(n.h2,{id:"286-\u914d\u7f6e-inject-\u9ed8\u8ba4\u6ce8\u518c\u670d\u52a1",children:["2.8.6 \u914d\u7f6e ",(0,i.jsx)(n.code,{children:"Inject()"})," \u9ed8\u8ba4\u6ce8\u518c\u670d\u52a1"]}),"\n",(0,i.jsxs)(n.p,{children:["\u6240\u6709 ",(0,i.jsx)(n.code,{children:".Inject"})," \u65b9\u6cd5\u90fd\u53ef\u4ee5\u4f20\u5165\u59d4\u6258\uff0c\u901a\u8fc7\u59d4\u6258\u53ef\u4ee5\u8fdb\u4e00\u6b65\u53bb\u914d\u7f6e\u9ed8\u8ba4\u884c\u4e3a\u3002\u5982\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {1}",children:".AddInject(options =>\r\n{\r\n options.ConfigureDataValidation(vail =>\r\n {\r\n vail.GlobalEnabled = false;\r\n });\r\n\r\n // ....\r\n});\n"})}),"\n",(0,i.jsx)(n.h2,{id:"287-\u53cd\u9988\u4e0e\u5efa\u8bae",children:"2.8.7 \u53cd\u9988\u4e0e\u5efa\u8bae"}),"\n",(0,i.jsx)(n.admonition,{title:"\u4e0e\u6211\u4eec\u4ea4\u6d41",type:"note",children:(0,i.jsxs)(n.p,{children:["\u7ed9 Furion \u63d0 ",(0,i.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/issues/new?issue",children:"Issue"}),"\u3002"]})})]})}function a(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(j,{...e})}):j(e)}},1151:(e,n,c)=>{c.d(n,{Z:()=>t,a:()=>d});var i=c(7294);const r={},s=i.createContext(r);function d(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function t(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:d(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]);