diff --git a/404.html b/404.html index 145a4738..279f13b9 100644 --- a/404.html +++ b/404.html @@ -9,8 +9,8 @@ - - + +
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

diff --git a/assets/js/29dd3281.26226fe3.js b/assets/js/29dd3281.26226fe3.js new file mode 100644 index 00000000..5820587b --- /dev/null +++ b/assets/js/29dd3281.26226fe3.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_inversifyjs_inversify_docs_site=self.webpackChunk_inversifyjs_inversify_docs_site||[]).push([[262],{2161:(n,e,a)=>{a.r(e),a.d(e,{assets:()=>m,contentTitle:()=>g,default:()=>x,frontMatter:()=>j,metadata:()=>t,toc:()=>b});const t=JSON.parse('{"id":"api/decorator","title":"Decorator","description":"This section covers inversify decorators used to provide class metadata.","source":"@site/docs/api/decorator.mdx","sourceDirName":"api","slug":"/api/decorator","permalink":"/monorepo/docs/api/decorator","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":4,"frontMatter":{"sidebar_position":4,"title":"Decorator"},"sidebar":"tutorialSidebar","previous":{"title":"Container Module","permalink":"/monorepo/docs/api/container-module"}}');var i=a(9793),r=a(1425);const o="@injectable()\nclass Ninja {\n constructor(\n @inject(weaponServiceId)\n public readonly weapon: Weapon,\n ) {}\n}\n\nconst container: Container = new Container();\n\ncontainer.bind(Ninja).toSelf();\ncontainer.bind(weaponServiceId).to(Katana);\n\nconst ninja: Ninja = container.get(Ninja);\n\n// Returns 10\nconst ninjaWeaponDamage: number = ninja.weapon.damage;",s="@injectable()\nclass Ninja {\n @inject(weaponServiceId)\n public readonly weapon!: Weapon;\n}\n\nconst container: Container = new Container();\n\ncontainer.bind(Ninja).toSelf();\ncontainer.bind(weaponServiceId).to(Katana);\n\nconst ninja: Ninja = container.get(Ninja);\n\n// Returns 10\nconst ninjaWeaponDamage: number = ninja.weapon.damage;",c="@injectable()\nclass Ninja {\n @multiInject(weaponServiceId)\n public readonly weapon!: Weapon[];\n}\n\nconst container: Container = new Container();\n\ncontainer.bind(Ninja).toSelf();\ncontainer.bind(weaponServiceId).to(Katana);\n\nconst ninja: Ninja = container.get(Ninja);\n\n// Returns 10\nconst ninjaWeaponDamage: number | undefined = ninja.weapon[0]?.damage;",l="@injectable()\nclass Ninja {\n public katana: Weapon;\n public shuriken: Weapon;\n constructor(\n @inject('Weapon') @named('melee') katana: Weapon,\n @inject('Weapon') @named('ranged') shuriken: Weapon,\n ) {\n this.katana = katana;\n this.shuriken = shuriken;\n }\n}\n\nconst container: Container = new Container();\ncontainer.bind('Weapon').to(Katana).whenTargetNamed('melee');\ncontainer.bind('Weapon').to(Shuriken).whenTargetNamed('ranged');\ncontainer.bind(Ninja).toSelf();\n\nconst ninja: Ninja = container.get(Ninja);",d="@injectable()\nclass Ninja {\n public katana: Weapon;\n public shuriken: Weapon | undefined;\n constructor(\n @inject('Katana') katana: Weapon,\n @inject('Shuriken') @optional() shuriken: Weapon | undefined,\n ) {\n this.katana = katana;\n this.shuriken = shuriken;\n }\n}\n\nconst container: Container = new Container();\ncontainer.bind('Katana').to(Katana);\n\ncontainer.bind(Ninja).toSelf();\n\n// Returns a \"Ninja\" instance with a \"Katana\" katana property and undefined shuriken property.\nconst ninja: Ninja = container.get(Ninja);",p="@injectable()\nclass Ninja {\n public katana: Weapon;\n public shuriken: Weapon;\n constructor(\n @inject('Weapon') @tagged('weaponKind', 'melee') katana: Weapon,\n @inject('Weapon') @tagged('weaponKind', 'ranged') shuriken: Weapon,\n ) {\n this.katana = katana;\n this.shuriken = shuriken;\n }\n}\n\nconst container: Container = new Container();\ncontainer\n .bind('Weapon')\n .to(Katana)\n .whenTargetTagged('weaponKind', 'melee');\ncontainer\n .bind('Weapon')\n .to(Shuriken)\n .whenTargetTagged('weaponKind', 'ranged');\ncontainer.bind(Ninja).toSelf();\n\nconst ninja: Ninja = container.get(Ninja);",h="import { Container, injectable, unmanaged } from 'inversify';\n\n@injectable()\nclass Base {\n public prop: string;\n constructor(@unmanaged() arg: string) {\n this.prop = arg;\n }\n}\n\n@injectable()\nclass Derived extends Base {\n constructor() {\n super('inherited-value');\n }\n}\n\nconst container: Container = new Container();\n\nconst derived: Derived = container.resolve(Derived);\n\n// Returns 'inherited-value'\nconst derivedProp: string = derived.prop;";var u=a(2848);const j={sidebar_position:4,title:"Decorator"},g="Decorators",m={},b=[{value:"injectable",id:"injectable",level:2},{value:"When is injectable mandatory?",id:"when-is-injectable-mandatory",level:3},{value:"inject",id:"inject",level:2},{value:"Example: decorating a class constructor argument",id:"example-decorating-a-class-constructor-argument",level:3},{value:"Example: decorating a property",id:"example-decorating-a-property",level:3},{value:"multiInject",id:"multiinject",level:2},{value:"Example: decorating a property",id:"example-decorating-a-property-1",level:3},{value:"named",id:"named",level:2},{value:"optional",id:"optional",level:2},{value:"tagged",id:"tagged",level:2},{value:"targetName",id:"targetname",level:2},{value:"unmanaged",id:"unmanaged",level:2}];function v(n){const e={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",...(0,r.R)(),...n.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e.header,{children:(0,i.jsx)(e.h1,{id:"decorators",children:"Decorators"})}),"\n",(0,i.jsx)(e.p,{children:"This section covers inversify decorators used to provide class metadata."}),"\n",(0,i.jsx)(e.h2,{id:"injectable",children:"injectable"}),"\n",(0,i.jsx)(e.p,{children:"Decorator used to set class metadata so containers can receive class emitted metadata."}),"\n",(0,i.jsx)(e.p,{children:"It's highly recommended to annotate every class provided as a service with the injectable decorator. Having said that, it's not mandatory in every single case."}),"\n",(0,i.jsx)(e.h3,{id:"when-is-injectable-mandatory",children:"When is injectable mandatory?"}),"\n",(0,i.jsx)(e.p,{children:"Basically, whenever class emitted metadata is expected."}),"\n",(0,i.jsx)(e.p,{children:"Consider the following sample code:"}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-ts",children:"import 'reflect-metadata';\nimport { injectable } from 'inversify';\n\n@injectable()\nclass B {\n readonly foo: string = 'foo';\n}\n\n@injectable()\nclass A {\n constructor(public readonly b: B) {}\n}\n"})}),"\n",(0,i.jsxs)(e.p,{children:["A commonJS transpilation with ",(0,i.jsx)(e.a,{href:"https://www.typescriptlang.org/tsconfig/#emitDecoratorMetadata",children:"emitDecoratorMetadata"})," option enabled might look like this:"]}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-js",children:'Object.defineProperty(exports, "__esModule", { value: true });\nrequire("reflect-metadata");\nconst inversify_1 = require("inversify");\nlet B = class B {\n foo = \'foo\';\n};\nB = __decorate([\n (0, inversify_1.injectable)()\n], B);\nlet A = class A {\n b;\n constructor(b) {\n this.b = b;\n }\n};\nA = __decorate([\n (0, inversify_1.injectable)(),\n __metadata("design:paramtypes", [B])\n], A);\n'})}),"\n",(0,i.jsxs)(e.p,{children:["Typescript emits class metadata if and only if there're any class decorators applied to the target class. If we remove the ",(0,i.jsx)(e.code,{children:"injectable"})," from ",(0,i.jsx)(e.code,{children:"A"}),", the transpiled code looks way different:"]}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-js",children:'Object.defineProperty(exports, "__esModule", { value: true });\nrequire("reflect-metadata");\nclass B {\n foo = \'foo\';\n}\nclass A {\n b;\n constructor(b) {\n this.b = b;\n }\n}\n'})}),"\n",(0,i.jsxs)(e.p,{children:["This time no class metadata is emitted even if ",(0,i.jsx)(e.code,{children:"emitDecoratorMetadata"})," typescript option is enabled, causing trouble at execution time."]}),"\n",(0,i.jsx)(e.h2,{id:"inject",children:"inject"}),"\n",(0,i.jsx)(e.p,{children:"Decorator used to establish a relation between a constructor argument or a class property and a service id."}),"\n",(0,i.jsxs)(e.p,{children:["When resolving an instance of the class, the target constructor argument or property will be resolved in the same way ",(0,i.jsx)(e.a,{href:"/docs/api/container#get",children:"container.get"})," behaves."]}),"\n",(0,i.jsx)(e.h3,{id:"example-decorating-a-class-constructor-argument",children:"Example: decorating a class constructor argument"}),"\n",(0,i.jsx)(u.A,{language:"ts",children:o}),"\n",(0,i.jsx)(e.h3,{id:"example-decorating-a-property",children:"Example: decorating a property"}),"\n",(0,i.jsx)(u.A,{language:"ts",children:s}),"\n",(0,i.jsx)(e.h2,{id:"multiinject",children:"multiInject"}),"\n",(0,i.jsx)(e.p,{children:"Decorator used to establish a relation between a constructor argument or a class property and a service id."}),"\n",(0,i.jsxs)(e.p,{children:["When resolving an instance of the class, the target constructor argument or property will be resolved in the same way ",(0,i.jsx)(e.a,{href:"/docs/api/container#getall",children:"container.getAll"})," behaves with the ",(0,i.jsx)(e.code,{children:"enforceBindingConstraints"})," flag enabled."]}),"\n",(0,i.jsx)(e.h3,{id:"example-decorating-a-property-1",children:"Example: decorating a property"}),"\n",(0,i.jsx)(u.A,{language:"ts",children:c}),"\n",(0,i.jsx)(e.h2,{id:"named",children:"named"}),"\n",(0,i.jsx)(e.p,{children:"Decorator used to establish a relation between a constructor argument or a class property and a metadata name."}),"\n",(0,i.jsx)(u.A,{language:"ts",children:l}),"\n",(0,i.jsx)(e.h2,{id:"optional",children:"optional"}),"\n",(0,i.jsx)(e.p,{children:"Decorator used to establish a target constructor argument or property is optional and, therefore, it shall not be resolved if no bindings are found for the associated service id."}),"\n",(0,i.jsx)(u.A,{language:"ts",children:d}),"\n",(0,i.jsx)(e.h2,{id:"tagged",children:"tagged"}),"\n",(0,i.jsx)(e.p,{children:"Decorator used to establish a relation between a constructor argument or a class property and a metadata tag."}),"\n",(0,i.jsx)(u.A,{language:"ts",children:p}),"\n",(0,i.jsx)(e.h2,{id:"targetname",children:"targetName"}),"\n",(0,i.jsx)(e.p,{children:"Decorator used to establish a relation between a constructor argument or a class property name at design time."}),"\n",(0,i.jsx)(e.p,{children:"Bundlers might minify code, altering class property names. This decorator keeps track of the original name."}),"\n",(0,i.jsxs)(e.p,{children:["This property is kept in the ",(0,i.jsx)(e.code,{children:"name"})," property of the ",(0,i.jsx)(e.code,{children:"target"})," request in a binding constraint."]}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-ts",children:'@injectable()\nclass Ninja implements Ninja {\n public katana: Weapon;\n public shuriken: Weapon;\n constructor(\n @inject("Weapon") @targetName("katana") katana: Weapon,\n @inject("Weapon") @targetName("shuriken") shuriken: Weapon\n ) {\n this.katana = katana;\n this.shuriken = shuriken;\n }\n}\n\ncontainer.bind("Weapon").to(Katana).when((request: interfaces.Request) => {\n return request.target.name.equals("katana");\n});\n'})}),"\n",(0,i.jsx)(e.h2,{id:"unmanaged",children:"unmanaged"}),"\n",(0,i.jsx)(e.p,{children:"Decorator used to establish inversify should not inject the target constructor argument or property whatsoever."}),"\n",(0,i.jsx)(u.A,{language:"ts",children:h})]})}function x(n={}){const{wrapper:e}={...(0,r.R)(),...n.components};return e?(0,i.jsx)(e,{...n,children:(0,i.jsx)(v,{...n})}):v(n)}}}]); \ No newline at end of file diff --git a/assets/js/565f2789.b170d64f.js b/assets/js/565f2789.b170d64f.js new file mode 100644 index 00000000..3fe9d7ad --- /dev/null +++ b/assets/js/565f2789.b170d64f.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_inversifyjs_inversify_docs_site=self.webpackChunk_inversifyjs_inversify_docs_site||[]).push([[31],{6067:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>l,contentTitle:()=>c,default:()=>v,frontMatter:()=>d,metadata:()=>t,toc:()=>h});const t=JSON.parse('{"id":"fundamentals/lifecycle/deactivation","title":"Deactivation","description":"Whenever a service is unbound, the deactivation event is dispatched. A deactivation handler receives a resolved value and returns nothing.","source":"@site/docs/fundamentals/lifecycle/deactivation.mdx","sourceDirName":"fundamentals/lifecycle","slug":"/fundamentals/lifecycle/deactivation","permalink":"/monorepo/docs/fundamentals/lifecycle/deactivation","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":2,"frontMatter":{"sidebar_position":2,"title":"Deactivation"},"sidebar":"tutorialSidebar","previous":{"title":"Activation","permalink":"/monorepo/docs/fundamentals/lifecycle/activation"},"next":{"title":"Binding Syntax","permalink":"/monorepo/docs/api/binding-syntax"}}');var a=i(9793),o=i(1425),s=i(2969),r=i(2848);const d={sidebar_position:2,title:"Deactivation"},c=void 0,l={},h=[];function p(e){const n={a:"a",code:"code",li:"li",p:"p",ul:"ul",...(0,o.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.p,{children:"Whenever a service is unbound, the deactivation event is dispatched. A deactivation handler receives a resolved value and returns nothing."}),"\n",(0,a.jsx)(r.A,{language:"ts",children:s}),"\n",(0,a.jsx)(n.p,{children:"It's possible to add a deactivation handler in multiple ways"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:["Adding the handler to the ",(0,a.jsx)(n.a,{href:"/docs/api/container#ondeactivation",children:"container"}),"."]}),"\n",(0,a.jsxs)(n.li,{children:["Adding the handler to a ",(0,a.jsx)(n.a,{href:"/docs/api/binding-syntax#ondeactivation",children:"binding"}),"."]}),"\n",(0,a.jsxs)(n.li,{children:["Adding the handler to the class through the ",(0,a.jsx)(n.a,{href:"https://github.com/inversify/InversifyJS/blob/master/wiki/pre_destroy.md",children:"preDestroy decorator"}),"."]}),"\n"]}),"\n",(0,a.jsxs)(n.p,{children:["Handlers added to the container are the first ones to be resolved. Any handler added to a child container is called before the ones added to their parent. Relevant bindings from the container are called next and finally the ",(0,a.jsx)(n.code,{children:"preDestroy"}),' method is called. In the example above, relevant bindings are those bindings bound to the unbinded "Destroyable" service identifier.']})]})}function v(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(p,{...e})}):p(e)}},2969:e=>{e.exports="interface Weapon {\n damage: number;\n}\n\nexport class Katana implements Weapon {\n #damage: number = 10;\n\n public get damage(): number {\n return this.#damage;\n }\n\n public improve(): void {\n this.#damage += 2;\n }\n}\n\nconst container: Container = new Container();\n\ncontainer.bind('Weapon').to(Katana).inSingletonScope();\n\ncontainer.get('Weapon');\ncontainer.onDeactivation('Weapon', (weapon: Weapon): void | Promise => {\n console.log(`Deactivating weapon with damage ${weapon.damage.toString()}`);\n});\n\ncontainer.unbind('Weapon');"}}]); \ No newline at end of file diff --git a/assets/js/565f2789.cc4aa298.js b/assets/js/565f2789.cc4aa298.js deleted file mode 100644 index 184f8456..00000000 --- a/assets/js/565f2789.cc4aa298.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_inversifyjs_inversify_docs_site=self.webpackChunk_inversifyjs_inversify_docs_site||[]).push([[31],{6067:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>l,contentTitle:()=>c,default:()=>v,frontMatter:()=>d,metadata:()=>t,toc:()=>h});const t=JSON.parse('{"id":"fundamentals/lifecycle/deactivation","title":"Deactivation","description":"Whenever a service is unbound, the deactivation event is dispatched. A deactivation handler receives a resolved value and returns nothing.","source":"@site/docs/fundamentals/lifecycle/deactivation.mdx","sourceDirName":"fundamentals/lifecycle","slug":"/fundamentals/lifecycle/deactivation","permalink":"/monorepo/docs/fundamentals/lifecycle/deactivation","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":2,"frontMatter":{"sidebar_position":2,"title":"Deactivation"},"sidebar":"tutorialSidebar","previous":{"title":"Activation","permalink":"/monorepo/docs/fundamentals/lifecycle/activation"},"next":{"title":"Container","permalink":"/monorepo/docs/api/container"}}');var a=i(9793),o=i(1425),r=i(2969),s=i(2848);const d={sidebar_position:2,title:"Deactivation"},c=void 0,l={},h=[];function p(e){const n={a:"a",code:"code",li:"li",p:"p",ul:"ul",...(0,o.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.p,{children:"Whenever a service is unbound, the deactivation event is dispatched. A deactivation handler receives a resolved value and returns nothing."}),"\n",(0,a.jsx)(s.A,{language:"ts",children:r}),"\n",(0,a.jsx)(n.p,{children:"It's possible to add a deactivation handler in multiple ways"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:["Adding the handler to the ",(0,a.jsx)(n.a,{href:"/docs/api/container#ondeactivation",children:"container"}),"."]}),"\n",(0,a.jsxs)(n.li,{children:["Adding the handler to a ",(0,a.jsx)(n.a,{href:"/docs/api/binding-syntax#ondeactivation",children:"binding"}),"."]}),"\n",(0,a.jsxs)(n.li,{children:["Adding the handler to the class through the ",(0,a.jsx)(n.a,{href:"https://github.com/inversify/InversifyJS/blob/master/wiki/pre_destroy.md",children:"preDestroy decorator"}),"."]}),"\n"]}),"\n",(0,a.jsxs)(n.p,{children:["Handlers added to the container are the first ones to be resolved. Any handler added to a child container is called before the ones added to their parent. Relevant bindings from the container are called next and finally the ",(0,a.jsx)(n.code,{children:"preDestroy"}),' method is called. In the example above, relevant bindings are those bindings bound to the unbinded "Destroyable" service identifier.']})]})}function v(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(p,{...e})}):p(e)}},2969:e=>{e.exports="interface Weapon {\n damage: number;\n}\n\nexport class Katana implements Weapon {\n #damage: number = 10;\n\n public get damage(): number {\n return this.#damage;\n }\n\n public improve(): void {\n this.#damage += 2;\n }\n}\n\nconst container: Container = new Container();\n\ncontainer.bind('Weapon').to(Katana).inSingletonScope();\n\ncontainer.get('Weapon');\ncontainer.onDeactivation('Weapon', (weapon: Weapon): void | Promise => {\n console.log(`Deactivating weapon with damage ${weapon.damage.toString()}`);\n});\n\ncontainer.unbind('Weapon');"}}]); \ No newline at end of file diff --git a/assets/js/9fbf92dd.b2b9a0a2.js b/assets/js/9fbf92dd.b2b9a0a2.js new file mode 100644 index 00000000..39af3489 --- /dev/null +++ b/assets/js/9fbf92dd.b2b9a0a2.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_inversifyjs_inversify_docs_site=self.webpackChunk_inversifyjs_inversify_docs_site||[]).push([[871],{348:(n,e,i)=>{i.r(e),i.d(e,{assets:()=>G,contentTitle:()=>D,default:()=>_,frontMatter:()=>K,metadata:()=>a,toc:()=>V});const a=JSON.parse('{"id":"api/container","title":"Container","description":"The InversifyJS container is where dependencies are first configured through bind and, possibly later, reconfigured and removed. The container can be worked on directly in this regard or container modules can be utilized.","source":"@site/docs/api/container.mdx","sourceDirName":"api","slug":"/api/container","permalink":"/monorepo/docs/api/container","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":2,"frontMatter":{"sidebar_position":2,"title":"Container"},"sidebar":"tutorialSidebar","previous":{"title":"Binding Syntax","permalink":"/monorepo/docs/api/binding-syntax"},"next":{"title":"Container Module","permalink":"/monorepo/docs/api/container-module"}}');var t=i(9793),r=i(1425);const s="const container: Container = new Container();\ncontainer.bind('Weapon').to(Katana);\ncontainer.bind('Weapon').to(Shuriken);\n\nconst weapons: Weapon[] = container.getAll('Weapon');",o="const container: Container = new Container();\ncontainer.bind('Weapon').toDynamicValue(async () => new Katana());\ncontainer.bind('Weapon').to(Shuriken);\n\nconst weapons: Promise = container.getAllAsync('Weapon');",d="const container: Container = new Container();\ncontainer\n .bind('Weapon')\n .toDynamicValue(async () => new Katana())\n .when(() => true);\ncontainer\n .bind('Weapon')\n .to(Shuriken)\n .when(() => false);\n\n// returns [new Katana(), new Shuriken()]\nconst allWeapons: Promise = container.getAllAsync('Weapon');\n\n// returns [new Katana()]\nconst notAllWeapons: Promise = container.getAllAsync(\n 'Weapon',\n {\n enforceBindingConstraints: true,\n },\n);",l="const container: Container = new Container();\ncontainer\n .bind('Weapon')\n .to(Katana)\n .when(() => true);\ncontainer\n .bind('Weapon')\n .to(Shuriken)\n .when(() => false);\n\n// returns [new Katana(), new Shuriken()]\nconst allWeapons: Weapon[] = container.getAll('Weapon');\n\n// returns [new Katana()]\nconst notAllWeapons: Weapon[] = container.getAll('Weapon', {\n enforceBindingConstraints: true,\n});",c="const container: Container = new Container();\n\ninterface Intl {\n hello?: string;\n goodbye?: string;\n}\n\ncontainer\n .bind('Intl')\n .toConstantValue({ hello: 'bonjour' })\n .whenTargetNamed('fr');\ncontainer\n .bind('Intl')\n .toConstantValue({ goodbye: 'au revoir' })\n .whenTargetNamed('fr');\n\ncontainer\n .bind('Intl')\n .toConstantValue({ hello: 'hola' })\n .whenTargetNamed('es');\ncontainer\n .bind('Intl')\n .toConstantValue({ goodbye: 'adios' })\n .whenTargetNamed('es');\n\nconst fr: Intl[] = container.getAllNamed('Intl', 'fr');\n\nconst es: Intl[] = container.getAllNamed('Intl', 'es');",h="const container: Container = new Container();\n\ninterface Intl {\n hello?: string;\n goodbye?: string;\n}\n\ncontainer\n .bind('Intl')\n .toDynamicValue(async () => ({ hello: 'bonjour' }))\n .whenTargetNamed('fr');\ncontainer\n .bind('Intl')\n .toDynamicValue(async () => ({ goodbye: 'au revoir' }))\n .whenTargetNamed('fr');\n\ncontainer\n .bind('Intl')\n .toDynamicValue(async () => ({ hello: 'hola' }))\n .whenTargetNamed('es');\ncontainer\n .bind('Intl')\n .toDynamicValue(async () => ({ goodbye: 'adios' }))\n .whenTargetNamed('es');\n\nconst fr: Promise = container.getAllNamedAsync('Intl', 'fr');\n\nconst es: Promise = container.getAllNamedAsync('Intl', 'es');",g="const container: Container = new Container();\n\ninterface Intl {\n hello?: string;\n goodbye?: string;\n}\n\ncontainer\n .bind('Intl')\n .toConstantValue({ hello: 'bonjour' })\n .whenTargetTagged('lang', 'fr');\ncontainer\n .bind('Intl')\n .toConstantValue({ goodbye: 'au revoir' })\n .whenTargetTagged('lang', 'fr');\n\ncontainer\n .bind('Intl')\n .toConstantValue({ hello: 'hola' })\n .whenTargetTagged('lang', 'es');\ncontainer\n .bind('Intl')\n .toConstantValue({ goodbye: 'adios' })\n .whenTargetTagged('lang', 'es');\n\nconst fr: Intl[] = container.getAllTagged('Intl', 'lang', 'fr');\n\nconst es: Intl[] = container.getAllTagged('Intl', 'lang', 'es');",u="const container: Container = new Container();\n\ninterface Intl {\n hello?: string;\n goodbye?: string;\n}\n\ncontainer\n .bind('Intl')\n .toDynamicValue(async () => ({ hello: 'bonjour' }))\n .whenTargetTagged('lang', 'fr');\ncontainer\n .bind('Intl')\n .toDynamicValue(async () => ({ goodbye: 'au revoir' }))\n .whenTargetTagged('lang', 'fr');\n\ncontainer\n .bind('Intl')\n .toDynamicValue(async () => ({ hello: 'hola' }))\n .whenTargetTagged('lang', 'es');\ncontainer\n .bind('Intl')\n .toDynamicValue(async () => ({ goodbye: 'adios' }))\n .whenTargetTagged('lang', 'es');\n\nconst fr: Promise = container.getAllTaggedAsync(\n 'Intl',\n 'lang',\n 'fr',\n);\n\nconst es: Promise = container.getAllTaggedAsync(\n 'Intl',\n 'lang',\n 'es',\n);",m="async function buildLevel1(): Promise {\n return new Level1();\n}\n\nconst container: Container = new Container();\ncontainer\n .bind('Level1')\n .toDynamicValue(async (): Promise => buildLevel1());\n\nconst level1: Promise = container.getAsync('Level1');",v="const container: Container = new Container();\ncontainer\n .bind('Weapon')\n .toDynamicValue(async () => new Katana())\n .whenTargetNamed('melee');\ncontainer\n .bind('Weapon')\n .toDynamicValue(async () => new Shuriken())\n .whenTargetNamed('ranged');\n\nconst katana: Promise = container.getNamedAsync(\n 'Weapon',\n 'melee',\n);\nconst shuriken: Promise = container.getNamedAsync(\n 'Weapon',\n 'ranged',\n);",b="const container: Container = new Container();\ncontainer.bind('Weapon').to(Katana).whenTargetNamed('melee');\ncontainer.bind('Weapon').to(Shuriken).whenTargetNamed('ranged');\n\nconst katana: Weapon = container.getNamed('Weapon', 'melee');\nconst shuriken: Weapon = container.getNamed('Weapon', 'ranged');",p="const container: Container = new Container();\ncontainer.bind('Weapon').to(Katana);\n\nconst katana: Weapon = container.get('Weapon');",j="const container: Container = new Container();\ncontainer\n .bind('Weapon')\n .toDynamicValue(async () => new Katana())\n .whenTargetTagged('faction', 'samurai');\ncontainer\n .bind('Weapon')\n .toDynamicValue(async () => new Shuriken())\n .whenTargetTagged('faction', 'ninja');\n\nconst katana: Promise = container.getTaggedAsync(\n 'Weapon',\n 'faction',\n 'samurai',\n);\nconst shuriken: Promise = container.getTaggedAsync(\n 'Weapon',\n 'faction',\n 'ninja',\n);",y="const container: Container = new Container();\ncontainer\n .bind('Weapon')\n .to(Katana)\n .whenTargetTagged('faction', 'samurai');\ncontainer\n .bind('Weapon')\n .to(Shuriken)\n .whenTargetTagged('faction', 'ninja');\n\nconst katana: Weapon = container.getTagged(\n 'Weapon',\n 'faction',\n 'samurai',\n);\nconst shuriken: Weapon = container.getTagged(\n 'Weapon',\n 'faction',\n 'ninja',\n);",f="interface Warrior {\n kind: string;\n}\n\nconst katanaSymbol: symbol = Symbol.for('Katana');\nconst warriorSymbol: symbol = Symbol.for('Warrior');\n\n@injectable()\nclass Ninja implements Warrior {\n public readonly kind: string = 'ninja';\n}\n\n@injectable()\nclass Katana {}\n\nconst container: Container = new Container();\ncontainer.bind(Ninja).to(Ninja);\ncontainer.bind(warriorSymbol).to(Ninja);\n\n// returns true\nconst isNinjaBound: boolean = container.isBound(Ninja);\n// returns true\nconst isWarriorSymbolBound: boolean = container.isBound(warriorSymbol);\n// returns false\nconst isKatanaBound: boolean = container.isBound(Katana);\n// returns false\nconst isKatanaSymbolBound: boolean = container.isBound(katanaSymbol);",x="const divisor: string = 'divisor';\nconst invalidDivisor: string = 'InvalidDivisor';\nconst validDivisor: string = 'ValidDivisor';\nconst container: Container = new Container();\n\ncontainer\n .bind(divisor)\n .toConstantValue(0)\n .whenTargetNamed(invalidDivisor);\n\n// returns true\nconst isDivisorBoundInInvalidDivisorName: boolean = container.isBoundNamed(\n divisor,\n invalidDivisor,\n);\n\ncontainer\n .bind(divisor)\n .toConstantValue(1)\n .whenTargetNamed(validDivisor);\n\n// returns true\nconst isDivisorBoundInValidDivisorName: boolean = container.isBoundNamed(\n divisor,\n validDivisor,\n);",T="const divisor: string = 'divisor';\nconst container: Container = new Container();\n\ncontainer\n .bind(divisor)\n .toConstantValue(0)\n .whenTargetTagged('isValidDivisor', false);\n\n// returns true\nconst isDivisorBoundInIsValidDivisorFalseTag: boolean = container.isBoundTagged(\n divisor,\n 'isValidDivisor',\n false,\n);\n\ncontainer\n .bind(divisor)\n .toConstantValue(1)\n .whenTargetTagged('isValidDivisor', true);\n\n// returns true\nconst isDivisorBoundInIsValidDivisorTrueTag: boolean = container.isBoundTagged(\n divisor,\n 'isValidDivisor',\n true,\n);",A="interface Warrior {\n kind: string;\n}\n\nconst katanaSymbol: symbol = Symbol.for('Katana');\nconst warriorSymbol: symbol = Symbol.for('Warrior');\n\n@injectable()\nclass Ninja implements Warrior {\n public readonly kind: string = 'ninja';\n}\n\n@injectable()\nclass Katana {}\n\nconst container: Container = new Container();\ncontainer.bind(Ninja).to(Ninja);\ncontainer.bind(warriorSymbol).to(Ninja);\n\nconst containerChild: Container = container.createChild();\n\ncontainerChild.bind(Katana).to(Katana);\ncontainerChild.bind(katanaSymbol).to(Katana);\n\n// returns false\nconst isNinjaBound: boolean = containerChild.isCurrentBound(Ninja);\n// returns false\nconst isWarriorSymbolBound: boolean =\n containerChild.isCurrentBound(warriorSymbol);\n// returns true\nconst isKatanaBound: boolean = containerChild.isCurrentBound(Katana);\n// returns true\nconst isKatanaSymbolBound: boolean =\n containerChild.isCurrentBound(katanaSymbol);",I="@injectable()\nclass Ninja {\n public readonly name: string = 'Ninja';\n}\n\n@injectable()\nclass Shuriken {\n public readonly name: string = 'Shuriken';\n}\n\nconst NINJA_EXPANSION_TYPES = {\n Ninja: 'Ninja',\n Shuriken: 'Shuriken',\n} satisfies Record;\n\nconst ninjaExpansionContainer: Container = new Container();\n\nninjaExpansionContainer.bind(NINJA_EXPANSION_TYPES.Ninja).to(Ninja);\nninjaExpansionContainer\n .bind(NINJA_EXPANSION_TYPES.Shuriken)\n .to(Shuriken);\n\n@injectable()\nclass Samurai {\n public readonly name: string = 'Samurai';\n}\n\n@injectable()\nclass Katana {\n public name = 'Katana';\n}\n\nconst SAMURAI_EXPANSION_TYPES = {\n Katana: 'Katana',\n Samurai: 'Samurai',\n} satisfies Record;\n\nconst samuraiExpansionContainer: Container = new Container();\nsamuraiExpansionContainer\n .bind(SAMURAI_EXPANSION_TYPES.Samurai)\n .to(Samurai);\nsamuraiExpansionContainer\n .bind(SAMURAI_EXPANSION_TYPES.Katana)\n .to(Katana);\n\nconst gameContainer: interfaces.Container = Container.merge(\n ninjaExpansionContainer,\n samuraiExpansionContainer,\n);",w="const container: Container = new Container({ autoBindInjectable: true });\n\n// returns a Ninja\ncontainer.bind(Ninja).to(NinjaMaster);\n// returns NinjaMaster\ncontainer.get(Ninja);",N="const container: Container = new Container({ autoBindInjectable: true });\n// returns false\ncontainer.isBound(Ninja);\n// returns a Ninja\ncontainer.get(Ninja);\n// returns true\ncontainer.isBound(Ninja);",C="const container: Container = new Container({ defaultScope: 'Singleton' });\n\n// You can configure the scope when declaring bindings:\ncontainer.bind(warriorServiceId).to(Ninja).inTransientScope();";var S=i(9466),W=i(2969);const k="const serviceId: string = 'serviceId';\n\nconst container: Container = new Container();\ncontainer.bind(serviceId).toConstantValue(1);\ncontainer.bind(serviceId).toConstantValue(2);\n\n// returns [1, 2]\nconst valuesBeforeRebind: number[] = container.getAll(serviceId);\n\ncontainer.rebind(serviceId).toConstantValue(3);\n\n// returns [3]\nconst valuesAfterRebind: number[] = container.getAll(serviceId);",B="import { Container, injectable } from 'inversify';\n\n@injectable()\nclass Katana {\n public hit() {\n return 'cut!';\n }\n}\n\n@injectable()\nclass Ninja implements Ninja {\n public katana: Katana;\n\n constructor(katana: Katana) {\n this.katana = katana;\n }\n\n public fight() {\n return this.katana.hit();\n }\n}\n\nconst container: Container = new Container();\ncontainer.bind(Katana).toSelf();\n\n// Ninja is provided and a Ninja bindong is added to the container\nconst ninja: Ninja = container.resolve(Ninja);";var P=i(2848);const K={sidebar_position:2,title:"Container"},D="Container",G={},V=[{value:"Container Options",id:"container-options",level:2},{value:"defaultScope",id:"defaultscope",level:3},{value:"autoBindInjectable",id:"autobindinjectable",level:3},{value:"skipBaseClassChecks",id:"skipbaseclasschecks",level:3},{value:"Container.merge",id:"containermerge",level:2},{value:"applyCustomMetadataReader",id:"applycustommetadatareader",level:2},{value:"applyMiddleware",id:"applymiddleware",level:2},{value:"bind",id:"bind",level:2},{value:"createChild",id:"createchild",level:2},{value:"get",id:"get",level:2},{value:"getAsync",id:"getasync",level:2},{value:"getNamed",id:"getnamed",level:2},{value:"getNamedAsync",id:"getnamedasync",level:2},{value:"getTagged",id:"gettagged",level:2},{value:"getTaggedAsync",id:"gettaggedasync",level:2},{value:"getAll",id:"getall",level:2},{value:"getAllAsync",id:"getallasync",level:2},{value:"getAllNamed",id:"getallnamed",level:2},{value:"getAllNamedAsync",id:"getallnamedasync",level:2},{value:"getAllTagged",id:"getalltagged",level:2},{value:"getAllTaggedAsync",id:"getalltaggedasync",level:2},{value:"isBound",id:"isbound",level:2},{value:"isCurrentBound",id:"iscurrentbound",level:2},{value:"isBoundNamed",id:"isboundnamed",level:2},{value:"isBoundTagged",id:"isboundtagged",level:2},{value:"load",id:"load",level:2},{value:"loadAsync",id:"loadasync",level:2},{value:"rebind",id:"rebind",level:2},{value:"rebindAsync",id:"rebindasync",level:2},{value:"resolve",id:"resolve",level:2},{value:"onActivation",id:"onactivation",level:2},{value:"onDeactivation",id:"ondeactivation",level:2},{value:"restore",id:"restore",level:2},{value:"snapshot",id:"snapshot",level:2},{value:"tryGet",id:"tryget",level:2},{value:"tryGetAsync",id:"trygetasync",level:2},{value:"tryGetNamed",id:"trygetnamed",level:2},{value:"tryGetNamedAsync",id:"trygetnamedasync",level:2},{value:"tryGetTagged",id:"trygettagged",level:2},{value:"tryGetTaggedAsync",id:"trygettaggedasync",level:2},{value:"tryGetAll",id:"trygetall",level:2},{value:"tryGetAllAsync",id:"trygetallasync",level:2},{value:"tryGetAllNamed",id:"trygetallnamed",level:2},{value:"tryGetAllNamedAsync",id:"trygetallnamedasync",level:2},{value:"tryGetAllTagged",id:"trygetalltagged",level:2},{value:"tryGetAllTaggedAsync",id:"trygetalltaggedasync",level:2},{value:"unbind",id:"unbind",level:2},{value:"unbindAsync",id:"unbindasync",level:2},{value:"unbindAll",id:"unbindall",level:2},{value:"unbindAllAsync",id:"unbindallasync",level:2},{value:"unload",id:"unload",level:2},{value:"unloadAsync",id:"unloadasync",level:2},{value:"parent",id:"parent",level:2},{value:"id",id:"id",level:2}];function R(n){const e={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",...(0,r.R)(),...n.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e.header,{children:(0,t.jsx)(e.h1,{id:"container",children:"Container"})}),"\n",(0,t.jsx)(e.p,{children:"The InversifyJS container is where dependencies are first configured through bind and, possibly later, reconfigured and removed. The container can be worked on directly in this regard or container modules can be utilized.\nYou can query the configuration and resolve configured dependencies with resolved and the 'get' methods.\nYou can react to resolutions with container activation handlers and unbinding with container deactivation handlers.\nYou can create container hierarchies where container ascendants can supply the dependencies for descendants.\nFor testing, state can be saved as a snapshot on a stack and later restored.\nFor advanced control you can apply middleware to intercept the resolution request and the resolved dependency.\nYou can even provide your own annotation solution."}),"\n",(0,t.jsx)(e.h2,{id:"container-options",children:"Container Options"}),"\n",(0,t.jsx)(e.p,{children:"Container options can be passed to the Container constructor and defaults will be provided if you do not or if you do but omit an option.\nOptions can be changed after construction and will be shared by child containers created from the Container if you do not provide options for them."}),"\n",(0,t.jsx)(e.h3,{id:"defaultscope",children:"defaultScope"}),"\n",(0,t.jsxs)(e.p,{children:["The default scope is ",(0,t.jsx)(e.code,{children:"transient"})," when binding to/toSelf/toDynamicValue/toService.\nOther bindings can only be bound in ",(0,t.jsx)(e.code,{children:"singleton"})," scope."]}),"\n",(0,t.jsxs)(e.p,{children:["You can use container options to change the default scope for the bindings that default to ",(0,t.jsx)(e.code,{children:"transient"})," at application level:"]}),"\n",(0,t.jsx)(P.A,{language:"ts",children:C}),"\n",(0,t.jsx)(e.h3,{id:"autobindinjectable",children:"autoBindInjectable"}),"\n",(0,t.jsxs)(e.p,{children:["You can use this to activate automatic binding for ",(0,t.jsx)(e.code,{children:"@injectable()"})," decorated classes.\nWhenever an instance is requested via ",(0,t.jsx)(e.code,{children:"get"}),", the container attempts to add a binding if no binding is found for the requested service."]}),"\n",(0,t.jsx)(P.A,{language:"ts",children:N}),"\n",(0,t.jsx)(e.p,{children:"Manually defined bindings will take precedence:"}),"\n",(0,t.jsx)(P.A,{language:"ts",children:w}),"\n",(0,t.jsx)(e.h3,{id:"skipbaseclasschecks",children:"skipBaseClassChecks"}),"\n",(0,t.jsxs)(e.p,{children:["You can use this to skip checking base classes for the @injectable property, which is\nespecially useful if any of your @injectable classes extend classes that you don't control\n(third party classes). By default, this value is ",(0,t.jsx)(e.code,{children:"false"}),"."]}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"const container = new Container({ skipBaseClassChecks: true });\n"})}),"\n",(0,t.jsx)(e.h2,{id:"containermerge",children:"Container.merge"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"Container.merge(a: interfaces.Container, b: interfaces.Container, ...containers: interfaces.Container[]): interfaces.Container;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Creates a new Container containing the bindings ( cloned bindings ) of two or more containers:"}),"\n",(0,t.jsx)(P.A,{language:"ts",children:I}),"\n",(0,t.jsx)(e.h2,{id:"applycustommetadatareader",children:"applyCustomMetadataReader"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"applyCustomMetadataReader(metadataReader: interfaces.MetadataReader): void;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Sets a custom metadata reader. See ",(0,t.jsx)(e.a,{href:"https://github.com/inversify/InversifyJS/blob/master/wiki/middleware.md",children:"middleware"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"applymiddleware",children:"applyMiddleware"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"applyMiddleware(...middleware: interfaces.Middleware[]): void;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["An advanced feature that can be used for cross cutting concerns. See ",(0,t.jsx)(e.a,{href:"https://github.com/inversify/InversifyJS/blob/master/wiki/middleware.md",children:"middleware"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"bind",children:"bind"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"bind(serviceIdentifier: interfaces.ServiceIdentifier): interfaces.BindingToSyntax\n"})}),"\n",(0,t.jsx)(e.p,{children:"Sets a new binding."}),"\n",(0,t.jsx)(e.h2,{id:"createchild",children:"createChild"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"createChild(containerOptions?: interfaces.ContainerOptions): Container;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Create a ",(0,t.jsx)(e.a,{href:"https://github.com/inversify/InversifyJS/blob/master/wiki/hierarchical_di.md",children:"container hierarchy"}),". Parent ",(0,t.jsx)(e.code,{children:"ContainerOptions"})," are provided by default."]}),"\n",(0,t.jsx)(e.h2,{id:"get",children:"get"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"get(serviceIdentifier: interfaces.ServiceIdentifier): T;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Resolves a dependency by its runtime identifier. The runtime identifier must be associated with only one binding and the binding must be synchronously resolved, otherwise an error is thrown."}),"\n",(0,t.jsx)(P.A,{language:"ts",children:p}),"\n",(0,t.jsx)(e.h2,{id:"getasync",children:"getAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"getAsync(serviceIdentifier: interfaces.ServiceIdentifier): Promise;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Resolves a dependency by its runtime identifier. The runtime identifier must be associated with only one binding, otherwise an error is thrown."}),"\n",(0,t.jsx)(P.A,{language:"ts",children:m}),"\n",(0,t.jsx)(e.h2,{id:"getnamed",children:"getNamed"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"getNamed(serviceIdentifier: interfaces.ServiceIdentifier, named: string | number | symbol): T;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Resolves a dependency by its runtime identifier that matches the given named constraint. The runtime identifier must be associated with only one binding and the binding must be synchronously resolved, otherwise an error is thrown:"}),"\n",(0,t.jsx)(P.A,{language:"ts",children:b}),"\n",(0,t.jsx)(e.h2,{id:"getnamedasync",children:"getNamedAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"getNamedAsync(serviceIdentifier: interfaces.ServiceIdentifier, named: string | number | symbol): Promise;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Resolves a dependency by its runtime identifier that matches the given named constraint. The runtime identifier must be associated with only one binding, otherwise an error is thrown:"}),"\n",(0,t.jsx)(P.A,{language:"ts",children:v}),"\n",(0,t.jsx)(e.h2,{id:"gettagged",children:"getTagged"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"getTagged(serviceIdentifier: interfaces.ServiceIdentifier, key: string | number | symbol, value: unknown): T;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Resolves a dependency by its runtime identifier that matches the given tagged constraint. The runtime identifier must be associated with only one binding and the binding must be synchronously resolved, otherwise an error is thrown:"}),"\n",(0,t.jsx)(P.A,{language:"ts",children:y}),"\n",(0,t.jsx)(e.h2,{id:"gettaggedasync",children:"getTaggedAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"getTaggedAsync(serviceIdentifier: interfaces.ServiceIdentifier, key: string | number | symbol, value: unknown): Promise;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Resolves a dependency by its runtime identifier that matches the given tagged constraint. The runtime identifier must be associated with only one binding, otherwise an error is thrown:"}),"\n",(0,t.jsx)(P.A,{language:"ts",children:j}),"\n",(0,t.jsx)(e.h2,{id:"getall",children:"getAll"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"getAll(serviceIdentifier: interfaces.ServiceIdentifier, options?: interfaces.GetAllOptions): T[];\n"})}),"\n",(0,t.jsx)(e.p,{children:"Get all available bindings for a given identifier. All the bindings must be synchronously resolved, otherwise an error is thrown:"}),"\n",(0,t.jsx)(P.A,{language:"ts",children:s}),"\n",(0,t.jsxs)(e.p,{children:["Keep in mind ",(0,t.jsx)(e.code,{children:"container.getAll"})," doesn't enforce binding contraints by default in the root level, enable the ",(0,t.jsx)(e.code,{children:"enforceBindingConstraints"})," flag to force this binding constraint check:"]}),"\n",(0,t.jsx)(P.A,{language:"ts",children:l}),"\n",(0,t.jsx)(e.h2,{id:"getallasync",children:"getAllAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"getAllAsync(serviceIdentifier: interfaces.ServiceIdentifier, options?: interfaces.GetAllOptions): Promise\n"})}),"\n",(0,t.jsx)(e.p,{children:"Get all available bindings for a given identifier:"}),"\n",(0,t.jsx)(P.A,{language:"ts",children:o}),"\n",(0,t.jsxs)(e.p,{children:["Keep in mind ",(0,t.jsx)(e.code,{children:"container.getAll"})," doesn't enforce binding contraints by default in the root level, enable the ",(0,t.jsx)(e.code,{children:"enforceBindingConstraints"})," flag to force this binding constraint check:"]}),"\n",(0,t.jsx)(P.A,{language:"ts",children:d}),"\n",(0,t.jsx)(e.h2,{id:"getallnamed",children:"getAllNamed"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"getAllNamed(serviceIdentifier: interfaces.ServiceIdentifier, named: string | number | symbol): T[];\n"})}),"\n",(0,t.jsx)(e.p,{children:"Resolves all the dependencies by its runtime identifier that matches the given named constraint. All the binding must be synchronously resolved, otherwise an error is thrown:"}),"\n",(0,t.jsx)(P.A,{language:"ts",children:c}),"\n",(0,t.jsx)(e.h2,{id:"getallnamedasync",children:"getAllNamedAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"getAllNamedAsync(serviceIdentifier: interfaces.ServiceIdentifier, named: string | number | symbol): Promise;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Resolves all the dependencies by its runtime identifier that matches the given named constraint:"}),"\n",(0,t.jsx)(P.A,{language:"ts",children:h}),"\n",(0,t.jsx)(e.h2,{id:"getalltagged",children:"getAllTagged"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"getAllTagged(serviceIdentifier: interfaces.ServiceIdentifier, key: string | number | symbol, value: unknown): T[];\n"})}),"\n",(0,t.jsx)(e.p,{children:"Resolves all the dependencies by its runtime identifier that matches the given tagged constraint. All the binding must be synchronously resolved, otherwise an error is thrown:"}),"\n",(0,t.jsx)(P.A,{language:"ts",children:g}),"\n",(0,t.jsx)(e.h2,{id:"getalltaggedasync",children:"getAllTaggedAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"getAllTaggedAsync(serviceIdentifier: interfaces.ServiceIdentifier, key: string | number | symbol, value: unknown): Promise;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Resolves all the dependencies by its runtime identifier that matches the given tagged constraint:"}),"\n",(0,t.jsx)(P.A,{language:"ts",children:u}),"\n",(0,t.jsx)(e.h2,{id:"isbound",children:"isBound"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"isBound(serviceIdentifier: interfaces.ServiceIdentifier): boolean;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["You can use the ",(0,t.jsx)(e.code,{children:"isBound"})," method to check if there are registered bindings for a given service identifier."]}),"\n",(0,t.jsx)(P.A,{language:"ts",children:f}),"\n",(0,t.jsx)(e.h2,{id:"iscurrentbound",children:"isCurrentBound"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"isCurrentBound(serviceIdentifier: interfaces.ServiceIdentifier\\): boolean\n"})}),"\n",(0,t.jsxs)(e.p,{children:["You can use the ",(0,t.jsx)(e.code,{children:"isCurrentBound"})," method to check if there are registered bindings for a given service identifier only in the current container."]}),"\n",(0,t.jsx)(P.A,{language:"ts",children:A}),"\n",(0,t.jsx)(e.h2,{id:"isboundnamed",children:"isBoundNamed"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"isBoundNamed(serviceIdentifier: interfaces.ServiceIdentifier, named: string): boolean;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["You can use the ",(0,t.jsx)(e.code,{children:"isBoundNamed"})," method to check if there are registered bindings for a given service identifier with a given named constraint."]}),"\n",(0,t.jsx)(P.A,{language:"ts",children:x}),"\n",(0,t.jsx)(e.h2,{id:"isboundtagged",children:"isBoundTagged"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"isBoundTagged(serviceIdentifier: interfaces.ServiceIdentifier, key: string, value: unknown): boolean;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["You can use the ",(0,t.jsx)(e.code,{children:"isBoundTagged"})," method to check if there are registered bindings for a given service identifier with a given tagged constraint."]}),"\n",(0,t.jsx)(P.A,{language:"ts",children:T}),"\n",(0,t.jsx)(e.h2,{id:"load",children:"load"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"load(...modules: interfaces.ContainerModule[]): void;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Calls the registration method of each module. See ",(0,t.jsx)(e.a,{href:"/docs/api/container-module",children:"ContainerModule API docs"})]}),"\n",(0,t.jsx)(e.h2,{id:"loadasync",children:"loadAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"loadAsync(...modules: interfaces.AsyncContainerModule[]): Promise;\n"})}),"\n",(0,t.jsx)(e.p,{children:"As per load but for asynchronous registration."}),"\n",(0,t.jsx)(e.h2,{id:"rebind",children:"rebind"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"rebind(serviceIdentifier: interfaces.ServiceIdentifier): interfaces.BindingToSyntax;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Replaces all the existing bindings for a given ",(0,t.jsx)(e.code,{children:"serviceIdentifier"}),".\nThe function returns an instance of ",(0,t.jsx)(e.code,{children:"BindingToSyntax"})," which allows to create the replacement binding."]}),"\n",(0,t.jsx)(P.A,{language:"ts",children:k}),"\n",(0,t.jsx)(e.h2,{id:"rebindasync",children:"rebindAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"rebindAsync(serviceIdentifier: interfaces.ServiceIdentifier): Promise>;\n"})}),"\n",(0,t.jsx)(e.p,{children:"This is an asynchronous version of rebind. If you know deactivation is asynchronous then this should be used."}),"\n",(0,t.jsx)(e.h2,{id:"resolve",children:"resolve"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"resolve(constructor: interfaces.Newable): T;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Resolve works the same way ",(0,t.jsx)(e.code,{children:"container.get"}),", but an automatic binding will be added to the container if no bindings are found for the type provided."]}),"\n",(0,t.jsx)(P.A,{language:"ts",children:B}),"\n",(0,t.jsxs)(e.p,{children:["Please note that it only allows to skip declaring a binding for the root element in the dependency graph (composition root). All the sub-dependencies (e.g. ",(0,t.jsx)(e.code,{children:"Katana"})," in the preceding example) will require a binding to be declared."]}),"\n",(0,t.jsx)(e.h2,{id:"onactivation",children:"onActivation"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"onActivation(serviceIdentifier: interfaces.ServiceIdentifier, onActivation: interfaces.BindingActivation): void;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Adds an activation handler for all services associated to the service identifier."}),"\n",(0,t.jsx)(P.A,{language:"ts",children:S}),"\n",(0,t.jsx)(e.h2,{id:"ondeactivation",children:"onDeactivation"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"onDeactivation(serviceIdentifier: interfaces.ServiceIdentifier, onDeactivation: interfaces.BindingDeactivation): void;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Adds a deactivation handler for a service identifier."}),"\n",(0,t.jsx)(P.A,{language:"ts",children:W}),"\n",(0,t.jsx)(e.h2,{id:"restore",children:"restore"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"restore(): void;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Restore container state to last snapshot."}),"\n",(0,t.jsx)(e.h2,{id:"snapshot",children:"snapshot"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"snapshot(): void;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Save the state of the container to be later restored with the restore method."}),"\n",(0,t.jsx)(e.h2,{id:"tryget",children:"tryGet"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"tryGet(serviceIdentifier: interfaces.ServiceIdentifier): T | undefined;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Same as ",(0,t.jsx)(e.code,{children:"container.get"}),", but returns ",(0,t.jsx)(e.code,{children:"undefined"})," in the event no bindings are bound to ",(0,t.jsx)(e.code,{children:"serviceIdentifier"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"trygetasync",children:"tryGetAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"tryGetAsync(serviceIdentifier: interfaces.ServiceIdentifier): Promise;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Same as ",(0,t.jsx)(e.code,{children:"container.getAsync"}),", but returns ",(0,t.jsx)(e.code,{children:"Promise"})," in the event no bindings are bound to ",(0,t.jsx)(e.code,{children:"serviceIdentifier"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"trygetnamed",children:"tryGetNamed"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"tryGetNamed(serviceIdentifier: interfaces.ServiceIdentifier, named: string | number | symbol): T | undefined;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Same as ",(0,t.jsx)(e.code,{children:"container.getNamed"}),", but returns ",(0,t.jsx)(e.code,{children:"undefined"})," in the event no bindings are bound to ",(0,t.jsx)(e.code,{children:"serviceIdentifier"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"trygetnamedasync",children:"tryGetNamedAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"tryGetNamedAsync(serviceIdentifier: interfaces.ServiceIdentifier, named: string | number | symbol): Promise;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Same as ",(0,t.jsx)(e.code,{children:"container.getNamedAsync"}),", but returns ",(0,t.jsx)(e.code,{children:"Promise"})," in the event no bindings are bound to ",(0,t.jsx)(e.code,{children:"serviceIdentifier"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"trygettagged",children:"tryGetTagged"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"tryGetTagged(serviceIdentifier: interfaces.ServiceIdentifier, key: string | number | symbol, value: unknown): T | undefined;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Same as ",(0,t.jsx)(e.code,{children:"container.getTagged"}),", but returns ",(0,t.jsx)(e.code,{children:"undefined"})," in the event no bindings are bound to ",(0,t.jsx)(e.code,{children:"serviceIdentifier"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"trygettaggedasync",children:"tryGetTaggedAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"tryGetTaggedAsync(serviceIdentifier: interfaces.ServiceIdentifier, key: string | number | symbol, value: unknown): Promise\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Same as ",(0,t.jsx)(e.code,{children:"container.getTaggedAsync"}),", but returns ",(0,t.jsx)(e.code,{children:"Promise"})," in the event no bindings are bound to ",(0,t.jsx)(e.code,{children:"serviceIdentifier"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"trygetall",children:"tryGetAll"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"tryGetAll(serviceIdentifier: interfaces.ServiceIdentifier, options?: interfaces.GetAllOptions): T[]\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Same as ",(0,t.jsx)(e.code,{children:"container.getAll"}),", but returns ",(0,t.jsx)(e.code,{children:"[]"})," in the event no bindings are bound to ",(0,t.jsx)(e.code,{children:"serviceIdentifier"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"trygetallasync",children:"tryGetAllAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"tryGetAllAsync(serviceIdentifier: interfaces.ServiceIdentifier, options?: interfaces.GetAllOptions): Promise;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Same as ",(0,t.jsx)(e.code,{children:"container.getAllAsync"}),", but returns ",(0,t.jsx)(e.code,{children:"Promise<[]>"})," in the event no bindings are bound to ",(0,t.jsx)(e.code,{children:"serviceIdentifier"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"trygetallnamed",children:"tryGetAllNamed"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"tryGetAllNamed(serviceIdentifier: interfaces.ServiceIdentifier, named: string | number | symbol): T[];\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Same as ",(0,t.jsx)(e.code,{children:"container.getAllNamed"}),", but returns ",(0,t.jsx)(e.code,{children:"[]"})," in the event no bindings are bound to ",(0,t.jsx)(e.code,{children:"serviceIdentifier"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"trygetallnamedasync",children:"tryGetAllNamedAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"tryGetAllNamedAsync(serviceIdentifier: interfaces.ServiceIdentifier, named: string | number | symbol): Promise;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Same as ",(0,t.jsx)(e.code,{children:"container.getAllNamedAsync"}),", but returns ",(0,t.jsx)(e.code,{children:"Promise<[]>"})," in the event no bindings are bound to ",(0,t.jsx)(e.code,{children:"serviceIdentifier"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"trygetalltagged",children:"tryGetAllTagged"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"tryGetAllTagged(serviceIdentifier: interfaces.ServiceIdentifier, key: string | number | symbol, value: unknown): T[];\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Same as ",(0,t.jsx)(e.code,{children:"container.getAllTagged"}),", but returns ",(0,t.jsx)(e.code,{children:"[]"})," in the event no bindings are bound to ",(0,t.jsx)(e.code,{children:"serviceIdentifier"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"trygetalltaggedasync",children:"tryGetAllTaggedAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"tryGetAllTaggedAsync(serviceIdentifier: interfaces.ServiceIdentifier, key: string | number | symbol, value: unknown): Promise;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Same as ",(0,t.jsx)(e.code,{children:"container.getAllTaggedAsync"}),", but returns ",(0,t.jsx)(e.code,{children:"Promise<[]>"})," in the event no bindings are bound to ",(0,t.jsx)(e.code,{children:"serviceIdentifier"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"unbind",children:"unbind"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"unbind(serviceIdentifier: interfaces.ServiceIdentifier): void;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Remove all bindings binded in this container to the service identifier. This will result in the ",(0,t.jsx)(e.a,{href:"/docs/fundamentals/lifecycle/deactivation",children:"deactivation process"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"unbindasync",children:"unbindAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"unbindAsync(serviceIdentifier: interfaces.ServiceIdentifier): Promise;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["This is the asynchronous version of unbind. If any deactivation realated to this service identifier is asynchronous then this method should be used instead of ",(0,t.jsx)(e.code,{children:"container.unbind"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"unbindall",children:"unbindAll"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"unbindAll(): void;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Remove all bindings binded in this container. This will result in the ",(0,t.jsx)(e.a,{href:"/docs/fundamentals/lifecycle/deactivation",children:"deactivation process"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"unbindallasync",children:"unbindAllAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"unbindAllAsync(): Promise;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["This is the asynchronous version of unbindAll. If any of the container's deactivations is asynchronous then this method should be used instead of ",(0,t.jsx)(e.code,{children:"container.unbindAll"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"unload",children:"unload"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"unload(...modules: interfaces.ContainerModuleBase[]): void;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Removes bindings and handlers added by the modules. This will result in the ",(0,t.jsx)(e.a,{href:"/docs/fundamentals/lifecycle/deactivation",children:"deactivation process"}),".\nSee ",(0,t.jsx)(e.a,{href:"/docs/api/container-module",children:"ContainerModule API docs"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"unloadasync",children:"unloadAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"unloadAsync(...modules: interfaces.ContainerModuleBase[]): Promise;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Asynchronous version of unload. If any of the container modules's deactivations is asynchronous then this method should be used instead of ",(0,t.jsx)(e.code,{children:"container.unload"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"parent",children:"parent"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"parent: Container | null;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Access the parent container."}),"\n",(0,t.jsx)(e.h2,{id:"id",children:"id"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"id: number;\n"})}),"\n",(0,t.jsx)(e.p,{children:"The container's unique identifier."})]})}function _(n={}){const{wrapper:e}={...(0,r.R)(),...n.components};return e?(0,t.jsx)(e,{...n,children:(0,t.jsx)(R,{...n})}):R(n)}},9466:n=>{n.exports="interface Weapon {\n damage: number;\n}\n\nexport class Katana implements Weapon {\n #damage: number = 10;\n\n public get damage(): number {\n return this.#damage;\n }\n\n public improve(): void {\n this.#damage += 2;\n }\n}\n\nconst container: Container = new Container();\ncontainer.bind('Weapon').to(Katana);\ncontainer.onActivation(\n 'Weapon',\n (_context: interfaces.Context, katana: Katana): Katana | Promise => {\n katana.improve();\n\n return katana;\n },\n);\n\n// Katana.damage is 12\nconst katana: Weapon = container.get('Weapon');"},2969:n=>{n.exports="interface Weapon {\n damage: number;\n}\n\nexport class Katana implements Weapon {\n #damage: number = 10;\n\n public get damage(): number {\n return this.#damage;\n }\n\n public improve(): void {\n this.#damage += 2;\n }\n}\n\nconst container: Container = new Container();\n\ncontainer.bind('Weapon').to(Katana).inSingletonScope();\n\ncontainer.get('Weapon');\ncontainer.onDeactivation('Weapon', (weapon: Weapon): void | Promise => {\n console.log(`Deactivating weapon with damage ${weapon.damage.toString()}`);\n});\n\ncontainer.unbind('Weapon');"}}]); \ No newline at end of file diff --git a/assets/js/9fbf92dd.e06a33dc.js b/assets/js/9fbf92dd.e06a33dc.js deleted file mode 100644 index a944a8fc..00000000 --- a/assets/js/9fbf92dd.e06a33dc.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_inversifyjs_inversify_docs_site=self.webpackChunk_inversifyjs_inversify_docs_site||[]).push([[871],{348:(n,e,i)=>{i.r(e),i.d(e,{assets:()=>G,contentTitle:()=>D,default:()=>_,frontMatter:()=>K,metadata:()=>a,toc:()=>V});const a=JSON.parse('{"id":"api/container","title":"Container","description":"The InversifyJS container is where dependencies are first configured through bind and, possibly later, reconfigured and removed. The container can be worked on directly in this regard or container modules can be utilized.","source":"@site/docs/api/container.mdx","sourceDirName":"api","slug":"/api/container","permalink":"/monorepo/docs/api/container","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":1,"frontMatter":{"sidebar_position":1,"title":"Container"},"sidebar":"tutorialSidebar","previous":{"title":"Deactivation","permalink":"/monorepo/docs/fundamentals/lifecycle/deactivation"},"next":{"title":"Binding Syntax","permalink":"/monorepo/docs/api/binding-syntax"}}');var t=i(9793),r=i(1425);const s="const container: Container = new Container();\ncontainer.bind('Weapon').to(Katana);\ncontainer.bind('Weapon').to(Shuriken);\n\nconst weapons: Weapon[] = container.getAll('Weapon');",o="const container: Container = new Container();\ncontainer.bind('Weapon').toDynamicValue(async () => new Katana());\ncontainer.bind('Weapon').to(Shuriken);\n\nconst weapons: Promise = container.getAllAsync('Weapon');",d="const container: Container = new Container();\ncontainer\n .bind('Weapon')\n .toDynamicValue(async () => new Katana())\n .when(() => true);\ncontainer\n .bind('Weapon')\n .to(Shuriken)\n .when(() => false);\n\n// returns [new Katana(), new Shuriken()]\nconst allWeapons: Promise = container.getAllAsync('Weapon');\n\n// returns [new Katana()]\nconst notAllWeapons: Promise = container.getAllAsync(\n 'Weapon',\n {\n enforceBindingConstraints: true,\n },\n);",l="const container: Container = new Container();\ncontainer\n .bind('Weapon')\n .to(Katana)\n .when(() => true);\ncontainer\n .bind('Weapon')\n .to(Shuriken)\n .when(() => false);\n\n// returns [new Katana(), new Shuriken()]\nconst allWeapons: Weapon[] = container.getAll('Weapon');\n\n// returns [new Katana()]\nconst notAllWeapons: Weapon[] = container.getAll('Weapon', {\n enforceBindingConstraints: true,\n});",c="const container: Container = new Container();\n\ninterface Intl {\n hello?: string;\n goodbye?: string;\n}\n\ncontainer\n .bind('Intl')\n .toConstantValue({ hello: 'bonjour' })\n .whenTargetNamed('fr');\ncontainer\n .bind('Intl')\n .toConstantValue({ goodbye: 'au revoir' })\n .whenTargetNamed('fr');\n\ncontainer\n .bind('Intl')\n .toConstantValue({ hello: 'hola' })\n .whenTargetNamed('es');\ncontainer\n .bind('Intl')\n .toConstantValue({ goodbye: 'adios' })\n .whenTargetNamed('es');\n\nconst fr: Intl[] = container.getAllNamed('Intl', 'fr');\n\nconst es: Intl[] = container.getAllNamed('Intl', 'es');",h="const container: Container = new Container();\n\ninterface Intl {\n hello?: string;\n goodbye?: string;\n}\n\ncontainer\n .bind('Intl')\n .toDynamicValue(async () => ({ hello: 'bonjour' }))\n .whenTargetNamed('fr');\ncontainer\n .bind('Intl')\n .toDynamicValue(async () => ({ goodbye: 'au revoir' }))\n .whenTargetNamed('fr');\n\ncontainer\n .bind('Intl')\n .toDynamicValue(async () => ({ hello: 'hola' }))\n .whenTargetNamed('es');\ncontainer\n .bind('Intl')\n .toDynamicValue(async () => ({ goodbye: 'adios' }))\n .whenTargetNamed('es');\n\nconst fr: Promise = container.getAllNamedAsync('Intl', 'fr');\n\nconst es: Promise = container.getAllNamedAsync('Intl', 'es');",g="const container: Container = new Container();\n\ninterface Intl {\n hello?: string;\n goodbye?: string;\n}\n\ncontainer\n .bind('Intl')\n .toConstantValue({ hello: 'bonjour' })\n .whenTargetTagged('lang', 'fr');\ncontainer\n .bind('Intl')\n .toConstantValue({ goodbye: 'au revoir' })\n .whenTargetTagged('lang', 'fr');\n\ncontainer\n .bind('Intl')\n .toConstantValue({ hello: 'hola' })\n .whenTargetTagged('lang', 'es');\ncontainer\n .bind('Intl')\n .toConstantValue({ goodbye: 'adios' })\n .whenTargetTagged('lang', 'es');\n\nconst fr: Intl[] = container.getAllTagged('Intl', 'lang', 'fr');\n\nconst es: Intl[] = container.getAllTagged('Intl', 'lang', 'es');",u="const container: Container = new Container();\n\ninterface Intl {\n hello?: string;\n goodbye?: string;\n}\n\ncontainer\n .bind('Intl')\n .toDynamicValue(async () => ({ hello: 'bonjour' }))\n .whenTargetTagged('lang', 'fr');\ncontainer\n .bind('Intl')\n .toDynamicValue(async () => ({ goodbye: 'au revoir' }))\n .whenTargetTagged('lang', 'fr');\n\ncontainer\n .bind('Intl')\n .toDynamicValue(async () => ({ hello: 'hola' }))\n .whenTargetTagged('lang', 'es');\ncontainer\n .bind('Intl')\n .toDynamicValue(async () => ({ goodbye: 'adios' }))\n .whenTargetTagged('lang', 'es');\n\nconst fr: Promise = container.getAllTaggedAsync(\n 'Intl',\n 'lang',\n 'fr',\n);\n\nconst es: Promise = container.getAllTaggedAsync(\n 'Intl',\n 'lang',\n 'es',\n);",m="async function buildLevel1(): Promise {\n return new Level1();\n}\n\nconst container: Container = new Container();\ncontainer\n .bind('Level1')\n .toDynamicValue(async (): Promise => buildLevel1());\n\nconst level1: Promise = container.getAsync('Level1');",v="const container: Container = new Container();\ncontainer\n .bind('Weapon')\n .toDynamicValue(async () => new Katana())\n .whenTargetNamed('melee');\ncontainer\n .bind('Weapon')\n .toDynamicValue(async () => new Shuriken())\n .whenTargetNamed('ranged');\n\nconst katana: Promise = container.getNamedAsync(\n 'Weapon',\n 'melee',\n);\nconst shuriken: Promise = container.getNamedAsync(\n 'Weapon',\n 'ranged',\n);",b="const container: Container = new Container();\ncontainer.bind('Weapon').to(Katana).whenTargetNamed('japanese');\ncontainer.bind('Weapon').to(Shuriken).whenTargetNamed('chinese');\n\nconst katana: Weapon = container.getNamed('Weapon', 'japanese');\nconst shuriken: Weapon = container.getNamed('Weapon', 'chinese');",p="const container: Container = new Container();\ncontainer.bind('Weapon').to(Katana);\n\nconst katana: Weapon = container.get('Weapon');",j="const container: Container = new Container();\ncontainer\n .bind('Weapon')\n .toDynamicValue(async () => new Katana())\n .whenTargetTagged('faction', 'samurai');\ncontainer\n .bind('Weapon')\n .toDynamicValue(async () => new Shuriken())\n .whenTargetTagged('faction', 'ninja');\n\nconst katana: Promise = container.getTaggedAsync(\n 'Weapon',\n 'faction',\n 'samurai',\n);\nconst shuriken: Promise = container.getTaggedAsync(\n 'Weapon',\n 'faction',\n 'ninja',\n);",y="const container: Container = new Container();\ncontainer\n .bind('Weapon')\n .to(Katana)\n .whenTargetTagged('faction', 'samurai');\ncontainer\n .bind('Weapon')\n .to(Shuriken)\n .whenTargetTagged('faction', 'ninja');\n\nconst katana: Weapon = container.getTagged(\n 'Weapon',\n 'faction',\n 'samurai',\n);\nconst shuriken: Weapon = container.getTagged(\n 'Weapon',\n 'faction',\n 'ninja',\n);",f="interface Warrior {\n kind: string;\n}\n\nconst katanaSymbol: symbol = Symbol.for('Katana');\nconst warriorSymbol: symbol = Symbol.for('Warrior');\n\n@injectable()\nclass Ninja implements Warrior {\n public readonly kind: string = 'ninja';\n}\n\n@injectable()\nclass Katana {}\n\nconst container: Container = new Container();\ncontainer.bind(Ninja).to(Ninja);\ncontainer.bind(warriorSymbol).to(Ninja);\n\n// returns true\nconst isNinjaBound: boolean = container.isBound(Ninja);\n// returns true\nconst isWarriorSymbolBound: boolean = container.isBound(warriorSymbol);\n// returns false\nconst isKatanaBound: boolean = container.isBound(Katana);\n// returns false\nconst isKatanaSymbolBound: boolean = container.isBound(katanaSymbol);",x="const divisor: string = 'divisor';\nconst invalidDivisor: string = 'InvalidDivisor';\nconst validDivisor: string = 'ValidDivisor';\nconst container: Container = new Container();\n\ncontainer\n .bind(divisor)\n .toConstantValue(0)\n .whenTargetNamed(invalidDivisor);\n\n// returns true\nconst isDivisorBoundInInvalidDivisorName: boolean = container.isBoundNamed(\n divisor,\n invalidDivisor,\n);\n\ncontainer\n .bind(divisor)\n .toConstantValue(1)\n .whenTargetNamed(validDivisor);\n\n// returns true\nconst isDivisorBoundInValidDivisorName: boolean = container.isBoundNamed(\n divisor,\n validDivisor,\n);",T="const divisor: string = 'divisor';\nconst container: Container = new Container();\n\ncontainer\n .bind(divisor)\n .toConstantValue(0)\n .whenTargetTagged('isValidDivisor', false);\n\n// returns true\nconst isDivisorBoundInIsValidDivisorFalseTag: boolean = container.isBoundTagged(\n divisor,\n 'isValidDivisor',\n false,\n);\n\ncontainer\n .bind(divisor)\n .toConstantValue(1)\n .whenTargetTagged('isValidDivisor', true);\n\n// returns true\nconst isDivisorBoundInIsValidDivisorTrueTag: boolean = container.isBoundTagged(\n divisor,\n 'isValidDivisor',\n true,\n);",A="interface Warrior {\n kind: string;\n}\n\nconst katanaSymbol: symbol = Symbol.for('Katana');\nconst warriorSymbol: symbol = Symbol.for('Warrior');\n\n@injectable()\nclass Ninja implements Warrior {\n public readonly kind: string = 'ninja';\n}\n\n@injectable()\nclass Katana {}\n\nconst container: Container = new Container();\ncontainer.bind(Ninja).to(Ninja);\ncontainer.bind(warriorSymbol).to(Ninja);\n\nconst containerChild: Container = container.createChild();\n\ncontainerChild.bind(Katana).to(Katana);\ncontainerChild.bind(katanaSymbol).to(Katana);\n\n// returns false\nconst isNinjaBound: boolean = containerChild.isCurrentBound(Ninja);\n// returns false\nconst isWarriorSymbolBound: boolean =\n containerChild.isCurrentBound(warriorSymbol);\n// returns true\nconst isKatanaBound: boolean = containerChild.isCurrentBound(Katana);\n// returns true\nconst isKatanaSymbolBound: boolean =\n containerChild.isCurrentBound(katanaSymbol);",I="@injectable()\nclass Ninja {\n public readonly name: string = 'Ninja';\n}\n\n@injectable()\nclass Shuriken {\n public readonly name: string = 'Shuriken';\n}\n\nconst NINJA_EXPANSION_TYPES = {\n Ninja: 'Ninja',\n Shuriken: 'Shuriken',\n} satisfies Record;\n\nconst ninjaExpansionContainer: Container = new Container();\n\nninjaExpansionContainer.bind(NINJA_EXPANSION_TYPES.Ninja).to(Ninja);\nninjaExpansionContainer\n .bind(NINJA_EXPANSION_TYPES.Shuriken)\n .to(Shuriken);\n\n@injectable()\nclass Samurai {\n public readonly name: string = 'Samurai';\n}\n\n@injectable()\nclass Katana {\n public name = 'Katana';\n}\n\nconst SAMURAI_EXPANSION_TYPES = {\n Katana: 'Katana',\n Samurai: 'Samurai',\n} satisfies Record;\n\nconst samuraiExpansionContainer: Container = new Container();\nsamuraiExpansionContainer\n .bind(SAMURAI_EXPANSION_TYPES.Samurai)\n .to(Samurai);\nsamuraiExpansionContainer\n .bind(SAMURAI_EXPANSION_TYPES.Katana)\n .to(Katana);\n\nconst gameContainer: interfaces.Container = Container.merge(\n ninjaExpansionContainer,\n samuraiExpansionContainer,\n);",w="const container: Container = new Container({ autoBindInjectable: true });\n\n// returns a Ninja\ncontainer.bind(Ninja).to(NinjaMaster);\n// returns NinjaMaster\ncontainer.get(Ninja);",N="const container: Container = new Container({ autoBindInjectable: true });\n// returns false\ncontainer.isBound(Ninja);\n// returns a Ninja\ncontainer.get(Ninja);\n// returns true\ncontainer.isBound(Ninja);",C="const container: Container = new Container({ defaultScope: 'Singleton' });\n\n// You can configure the scope when declaring bindings:\ncontainer.bind(warriorServiceId).to(Ninja).inTransientScope();";var S=i(9466),W=i(2969);const k="const serviceId: string = 'serviceId';\n\nconst container: Container = new Container();\ncontainer.bind(serviceId).toConstantValue(1);\ncontainer.bind(serviceId).toConstantValue(2);\n\n// returns [1, 2]\nconst valuesBeforeRebind: number[] = container.getAll(serviceId);\n\ncontainer.rebind(serviceId).toConstantValue(3);\n\n// returns [3]\nconst valuesAfterRebind: number[] = container.getAll(serviceId);",B="import { Container, injectable } from 'inversify';\n\n@injectable()\nclass Katana {\n public hit() {\n return 'cut!';\n }\n}\n\n@injectable()\nclass Ninja implements Ninja {\n public katana: Katana;\n\n constructor(katana: Katana) {\n this.katana = katana;\n }\n\n public fight() {\n return this.katana.hit();\n }\n}\n\nconst container: Container = new Container();\ncontainer.bind(Katana).toSelf();\n\n// Ninja is provided and a Ninja bindong is added to the container\nconst ninja: Ninja = container.resolve(Ninja);";var P=i(2848);const K={sidebar_position:1,title:"Container"},D="Container",G={},V=[{value:"Container Options",id:"container-options",level:2},{value:"defaultScope",id:"defaultscope",level:3},{value:"autoBindInjectable",id:"autobindinjectable",level:3},{value:"skipBaseClassChecks",id:"skipbaseclasschecks",level:3},{value:"Container.merge",id:"containermerge",level:2},{value:"applyCustomMetadataReader",id:"applycustommetadatareader",level:2},{value:"applyMiddleware",id:"applymiddleware",level:2},{value:"bind",id:"bind",level:2},{value:"createChild",id:"createchild",level:2},{value:"get",id:"get",level:2},{value:"getAsync",id:"getasync",level:2},{value:"getNamed",id:"getnamed",level:2},{value:"getNamedAsync",id:"getnamedasync",level:2},{value:"getTagged",id:"gettagged",level:2},{value:"getTaggedAsync",id:"gettaggedasync",level:2},{value:"getAll",id:"getall",level:2},{value:"getAllAsync",id:"getallasync",level:2},{value:"getAllNamed",id:"getallnamed",level:2},{value:"getAllNamedAsync",id:"getallnamedasync",level:2},{value:"getAllTagged",id:"getalltagged",level:2},{value:"getAllTaggedAsync",id:"getalltaggedasync",level:2},{value:"isBound",id:"isbound",level:2},{value:"isCurrentBound",id:"iscurrentbound",level:2},{value:"isBoundNamed",id:"isboundnamed",level:2},{value:"isBoundTagged",id:"isboundtagged",level:2},{value:"load",id:"load",level:2},{value:"loadAsync",id:"loadasync",level:2},{value:"rebind",id:"rebind",level:2},{value:"rebindAsync",id:"rebindasync",level:2},{value:"resolve",id:"resolve",level:2},{value:"onActivation",id:"onactivation",level:2},{value:"onDeactivation",id:"ondeactivation",level:2},{value:"restore",id:"restore",level:2},{value:"snapshot",id:"snapshot",level:2},{value:"tryGet",id:"tryget",level:2},{value:"tryGetAsync",id:"trygetasync",level:2},{value:"tryGetNamed",id:"trygetnamed",level:2},{value:"tryGetNamedAsync",id:"trygetnamedasync",level:2},{value:"tryGetTagged",id:"trygettagged",level:2},{value:"tryGetTaggedAsync",id:"trygettaggedasync",level:2},{value:"tryGetAll",id:"trygetall",level:2},{value:"tryGetAllAsync",id:"trygetallasync",level:2},{value:"tryGetAllNamed",id:"trygetallnamed",level:2},{value:"tryGetAllNamedAsync",id:"trygetallnamedasync",level:2},{value:"tryGetAllTagged",id:"trygetalltagged",level:2},{value:"tryGetAllTaggedAsync",id:"trygetalltaggedasync",level:2},{value:"unbind",id:"unbind",level:2},{value:"unbindAsync",id:"unbindasync",level:2},{value:"unbindAll",id:"unbindall",level:2},{value:"unbindAllAsync",id:"unbindallasync",level:2},{value:"unload",id:"unload",level:2},{value:"unloadAsync",id:"unloadasync",level:2},{value:"parent;",id:"parent",level:2},{value:"id",id:"id",level:2}];function R(n){const e={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",...(0,r.R)(),...n.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e.header,{children:(0,t.jsx)(e.h1,{id:"container",children:"Container"})}),"\n",(0,t.jsx)(e.p,{children:"The InversifyJS container is where dependencies are first configured through bind and, possibly later, reconfigured and removed. The container can be worked on directly in this regard or container modules can be utilized.\nYou can query the configuration and resolve configured dependencies with resolved and the 'get' methods.\nYou can react to resolutions with container activation handlers and unbinding with container deactivation handlers.\nYou can create container hierarchies where container ascendants can supply the dependencies for descendants.\nFor testing, state can be saved as a snapshot on a stack and later restored.\nFor advanced control you can apply middleware to intercept the resolution request and the resolved dependency.\nYou can even provide your own annotation solution."}),"\n",(0,t.jsx)(e.h2,{id:"container-options",children:"Container Options"}),"\n",(0,t.jsx)(e.p,{children:"Container options can be passed to the Container constructor and defaults will be provided if you do not or if you do but omit an option.\nOptions can be changed after construction and will be shared by child containers created from the Container if you do not provide options for them."}),"\n",(0,t.jsx)(e.h3,{id:"defaultscope",children:"defaultScope"}),"\n",(0,t.jsxs)(e.p,{children:["The default scope is ",(0,t.jsx)(e.code,{children:"transient"})," when binding to/toSelf/toDynamicValue/toService.\nOther bindings can only be bound in ",(0,t.jsx)(e.code,{children:"singleton"})," scope."]}),"\n",(0,t.jsxs)(e.p,{children:["You can use container options to change the default scope for the bindings that default to ",(0,t.jsx)(e.code,{children:"transient"})," at application level:"]}),"\n",(0,t.jsx)(P.A,{language:"ts",children:C}),"\n",(0,t.jsx)(e.h3,{id:"autobindinjectable",children:"autoBindInjectable"}),"\n",(0,t.jsxs)(e.p,{children:["You can use this to activate automatic binding for ",(0,t.jsx)(e.code,{children:"@injectable()"})," decorated classes.\nWhenever an instance is requested via ",(0,t.jsx)(e.code,{children:"get"}),", the container attempts to add a binding if no binding is found for the requested service."]}),"\n",(0,t.jsx)(P.A,{language:"ts",children:N}),"\n",(0,t.jsx)(e.p,{children:"Manually defined bindings will take precedence:"}),"\n",(0,t.jsx)(P.A,{language:"ts",children:w}),"\n",(0,t.jsx)(e.h3,{id:"skipbaseclasschecks",children:"skipBaseClassChecks"}),"\n",(0,t.jsxs)(e.p,{children:["You can use this to skip checking base classes for the @injectable property, which is\nespecially useful if any of your @injectable classes extend classes that you don't control\n(third party classes). By default, this value is ",(0,t.jsx)(e.code,{children:"false"}),"."]}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"const container = new Container({ skipBaseClassChecks: true });\n"})}),"\n",(0,t.jsx)(e.h2,{id:"containermerge",children:"Container.merge"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"Container.merge(a: interfaces.Container, b: interfaces.Container, ...containers: interfaces.Container[]): interfaces.Container;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Creates a new Container containing the bindings ( cloned bindings ) of two or more containers:"}),"\n",(0,t.jsx)(P.A,{language:"ts",children:I}),"\n",(0,t.jsx)(e.h2,{id:"applycustommetadatareader",children:"applyCustomMetadataReader"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"applyCustomMetadataReader(metadataReader: interfaces.MetadataReader): void;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Sets a custom metadata reader. See ",(0,t.jsx)(e.a,{href:"https://github.com/inversify/InversifyJS/blob/master/wiki/middleware.md",children:"middleware"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"applymiddleware",children:"applyMiddleware"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"applyMiddleware(...middleware: interfaces.Middleware[]): void;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["An advanced feature that can be used for cross cutting concerns. See ",(0,t.jsx)(e.a,{href:"https://github.com/inversify/InversifyJS/blob/master/wiki/middleware.md",children:"middleware"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"bind",children:"bind"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"bind(serviceIdentifier: interfaces.ServiceIdentifier): interfaces.BindingToSyntax\n"})}),"\n",(0,t.jsx)(e.p,{children:"Sets a new binding."}),"\n",(0,t.jsx)(e.h2,{id:"createchild",children:"createChild"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"createChild(containerOptions?: interfaces.ContainerOptions): Container;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Create a ",(0,t.jsx)(e.a,{href:"https://github.com/inversify/InversifyJS/blob/master/wiki/hierarchical_di.md",children:"container hierarchy"}),". Parent ",(0,t.jsx)(e.code,{children:"ContainerOptions"})," are provided by default."]}),"\n",(0,t.jsx)(e.h2,{id:"get",children:"get"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"get(serviceIdentifier: interfaces.ServiceIdentifier): T;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Resolves a dependency by its runtime identifier. The runtime identifier must be associated with only one binding and the binding must be synchronously resolved, otherwise an error is thrown."}),"\n",(0,t.jsx)(P.A,{language:"ts",children:p}),"\n",(0,t.jsx)(e.h2,{id:"getasync",children:"getAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"getAsync(serviceIdentifier: interfaces.ServiceIdentifier): Promise;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Resolves a dependency by its runtime identifier. The runtime identifier must be associated with only one binding, otherwise an error is thrown."}),"\n",(0,t.jsx)(P.A,{language:"ts",children:m}),"\n",(0,t.jsx)(e.h2,{id:"getnamed",children:"getNamed"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"getNamed(serviceIdentifier: interfaces.ServiceIdentifier, named: string | number | symbol): T;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Resolves a dependency by its runtime identifier that matches the given named constraint. The runtime identifier must be associated with only one binding and the binding must be synchronously resolved, otherwise an error is thrown:"}),"\n",(0,t.jsx)(P.A,{language:"ts",children:b}),"\n",(0,t.jsx)(e.h2,{id:"getnamedasync",children:"getNamedAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"getNamedAsync(serviceIdentifier: interfaces.ServiceIdentifier, named: string | number | symbol): Promise;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Resolves a dependency by its runtime identifier that matches the given named constraint. The runtime identifier must be associated with only one binding, otherwise an error is thrown:"}),"\n",(0,t.jsx)(P.A,{language:"ts",children:v}),"\n",(0,t.jsx)(e.h2,{id:"gettagged",children:"getTagged"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"getTagged(serviceIdentifier: interfaces.ServiceIdentifier, key: string | number | symbol, value: unknown): T;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Resolves a dependency by its runtime identifier that matches the given tagged constraint. The runtime identifier must be associated with only one binding and the binding must be synchronously resolved, otherwise an error is thrown:"}),"\n",(0,t.jsx)(P.A,{language:"ts",children:y}),"\n",(0,t.jsx)(e.h2,{id:"gettaggedasync",children:"getTaggedAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"getTaggedAsync(serviceIdentifier: interfaces.ServiceIdentifier, key: string | number | symbol, value: unknown): Promise;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Resolves a dependency by its runtime identifier that matches the given tagged constraint. The runtime identifier must be associated with only one binding, otherwise an error is thrown:"}),"\n",(0,t.jsx)(P.A,{language:"ts",children:j}),"\n",(0,t.jsx)(e.h2,{id:"getall",children:"getAll"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"getAll(serviceIdentifier: interfaces.ServiceIdentifier, options?: interfaces.GetAllOptions): T[];\n"})}),"\n",(0,t.jsx)(e.p,{children:"Get all available bindings for a given identifier. All the bindings must be synchronously resolved, otherwise an error is thrown:"}),"\n",(0,t.jsx)(P.A,{language:"ts",children:s}),"\n",(0,t.jsxs)(e.p,{children:["Keep in mind ",(0,t.jsx)(e.code,{children:"container.getAll"})," doesn't enforce binding contraints by default in the root level, enable the ",(0,t.jsx)(e.code,{children:"enforceBindingConstraints"})," flag to force this binding constraint check:"]}),"\n",(0,t.jsx)(P.A,{language:"ts",children:l}),"\n",(0,t.jsx)(e.h2,{id:"getallasync",children:"getAllAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"getAllAsync(serviceIdentifier: interfaces.ServiceIdentifier, options?: interfaces.GetAllOptions): Promise\n"})}),"\n",(0,t.jsx)(e.p,{children:"Get all available bindings for a given identifier:"}),"\n",(0,t.jsx)(P.A,{language:"ts",children:o}),"\n",(0,t.jsxs)(e.p,{children:["Keep in mind ",(0,t.jsx)(e.code,{children:"container.getAll"})," doesn't enforce binding contraints by default in the root level, enable the ",(0,t.jsx)(e.code,{children:"enforceBindingConstraints"})," flag to force this binding constraint check:"]}),"\n",(0,t.jsx)(P.A,{language:"ts",children:d}),"\n",(0,t.jsx)(e.h2,{id:"getallnamed",children:"getAllNamed"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"getAllNamed(serviceIdentifier: interfaces.ServiceIdentifier, named: string | number | symbol): T[];\n"})}),"\n",(0,t.jsx)(e.p,{children:"Resolves all the dependencies by its runtime identifier that matches the given named constraint. All the binding must be synchronously resolved, otherwise an error is thrown:"}),"\n",(0,t.jsx)(P.A,{language:"ts",children:c}),"\n",(0,t.jsx)(e.h2,{id:"getallnamedasync",children:"getAllNamedAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"getAllNamedAsync(serviceIdentifier: interfaces.ServiceIdentifier, named: string | number | symbol): Promise;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Resolves all the dependencies by its runtime identifier that matches the given named constraint:"}),"\n",(0,t.jsx)(P.A,{language:"ts",children:h}),"\n",(0,t.jsx)(e.h2,{id:"getalltagged",children:"getAllTagged"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"getAllTagged(serviceIdentifier: interfaces.ServiceIdentifier, key: string | number | symbol, value: unknown): T[];\n"})}),"\n",(0,t.jsx)(e.p,{children:"Resolves all the dependencies by its runtime identifier that matches the given tagged constraint. All the binding must be synchronously resolved, otherwise an error is thrown:"}),"\n",(0,t.jsx)(P.A,{language:"ts",children:g}),"\n",(0,t.jsx)(e.h2,{id:"getalltaggedasync",children:"getAllTaggedAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"getAllTaggedAsync(serviceIdentifier: interfaces.ServiceIdentifier, key: string | number | symbol, value: unknown): Promise;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Resolves all the dependencies by its runtime identifier that matches the given tagged constraint:"}),"\n",(0,t.jsx)(P.A,{language:"ts",children:u}),"\n",(0,t.jsx)(e.h2,{id:"isbound",children:"isBound"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"isBound(serviceIdentifier: interfaces.ServiceIdentifier): boolean;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["You can use the ",(0,t.jsx)(e.code,{children:"isBound"})," method to check if there are registered bindings for a given service identifier."]}),"\n",(0,t.jsx)(P.A,{language:"ts",children:f}),"\n",(0,t.jsx)(e.h2,{id:"iscurrentbound",children:"isCurrentBound"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"isCurrentBound(serviceIdentifier: interfaces.ServiceIdentifier\\): boolean\n"})}),"\n",(0,t.jsxs)(e.p,{children:["You can use the ",(0,t.jsx)(e.code,{children:"isCurrentBound"})," method to check if there are registered bindings for a given service identifier only in the current container."]}),"\n",(0,t.jsx)(P.A,{language:"ts",children:A}),"\n",(0,t.jsx)(e.h2,{id:"isboundnamed",children:"isBoundNamed"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"isBoundNamed(serviceIdentifier: interfaces.ServiceIdentifier, named: string): boolean;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["You can use the ",(0,t.jsx)(e.code,{children:"isBoundNamed"})," method to check if there are registered bindings for a given service identifier with a given named constraint."]}),"\n",(0,t.jsx)(P.A,{language:"ts",children:x}),"\n",(0,t.jsx)(e.h2,{id:"isboundtagged",children:"isBoundTagged"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"isBoundTagged(serviceIdentifier: interfaces.ServiceIdentifier, key: string, value: unknown): boolean;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["You can use the ",(0,t.jsx)(e.code,{children:"isBoundTagged"})," method to check if there are registered bindings for a given service identifier with a given tagged constraint."]}),"\n",(0,t.jsx)(P.A,{language:"ts",children:T}),"\n",(0,t.jsx)(e.h2,{id:"load",children:"load"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"load(...modules: interfaces.ContainerModule[]): void;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Calls the registration method of each module. See ",(0,t.jsx)(e.a,{href:"/docs/api/container-module",children:"ContainerModule API docs"})]}),"\n",(0,t.jsx)(e.h2,{id:"loadasync",children:"loadAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"loadAsync(...modules: interfaces.AsyncContainerModule[]): Promise;\n"})}),"\n",(0,t.jsx)(e.p,{children:"As per load but for asynchronous registration."}),"\n",(0,t.jsx)(e.h2,{id:"rebind",children:"rebind"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"rebind(serviceIdentifier: interfaces.ServiceIdentifier): interfaces.BindingToSyntax;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Replaces all the existing bindings for a given ",(0,t.jsx)(e.code,{children:"serviceIdentifier"}),".\nThe function returns an instance of ",(0,t.jsx)(e.code,{children:"BindingToSyntax"})," which allows to create the replacement binding."]}),"\n",(0,t.jsx)(P.A,{language:"ts",children:k}),"\n",(0,t.jsx)(e.h2,{id:"rebindasync",children:"rebindAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"rebindAsync(serviceIdentifier: interfaces.ServiceIdentifier): Promise>;\n"})}),"\n",(0,t.jsx)(e.p,{children:"This is an asynchronous version of rebind. If you know deactivation is asynchronous then this should be used."}),"\n",(0,t.jsx)(e.h2,{id:"resolve",children:"resolve"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"resolve(constructor: interfaces.Newable): T;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Resolve works the same way ",(0,t.jsx)(e.code,{children:"container.get"}),", but an automatic binding will be added to the container if no bindings are found for the type provided."]}),"\n",(0,t.jsx)(P.A,{language:"ts",children:B}),"\n",(0,t.jsxs)(e.p,{children:["Please note that it only allows to skip declaring a binding for the root element in the dependency graph (composition root). All the sub-dependencies (e.g. ",(0,t.jsx)(e.code,{children:"Katana"})," in the preceding example) will require a binding to be declared."]}),"\n",(0,t.jsx)(e.h2,{id:"onactivation",children:"onActivation"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"onActivation(serviceIdentifier: interfaces.ServiceIdentifier, onActivation: interfaces.BindingActivation): void;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Adds an activation handler for all services associated to the service identifier."}),"\n",(0,t.jsx)(P.A,{language:"ts",children:S}),"\n",(0,t.jsx)(e.h2,{id:"ondeactivation",children:"onDeactivation"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"onDeactivation(serviceIdentifier: interfaces.ServiceIdentifier, onDeactivation: interfaces.BindingDeactivation): void;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Adds a deactivation handler for a service identifier."}),"\n",(0,t.jsx)(P.A,{language:"ts",children:W}),"\n",(0,t.jsx)(e.h2,{id:"restore",children:"restore"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"restore(): void;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Restore container state to last snapshot."}),"\n",(0,t.jsx)(e.h2,{id:"snapshot",children:"snapshot"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"snapshot(): void;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Save the state of the container to be later restored with the restore method."}),"\n",(0,t.jsx)(e.h2,{id:"tryget",children:"tryGet"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"tryGet(serviceIdentifier: interfaces.ServiceIdentifier): T | undefined;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Same as ",(0,t.jsx)(e.code,{children:"container.get"}),", but returns ",(0,t.jsx)(e.code,{children:"undefined"})," in the event no bindings are bound to ",(0,t.jsx)(e.code,{children:"serviceIdentifier"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"trygetasync",children:"tryGetAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"tryGetAsync(serviceIdentifier: interfaces.ServiceIdentifier): Promise;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Same as ",(0,t.jsx)(e.code,{children:"container.getAsync"}),", but returns ",(0,t.jsx)(e.code,{children:"Promise"})," in the event no bindings are bound to ",(0,t.jsx)(e.code,{children:"serviceIdentifier"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"trygetnamed",children:"tryGetNamed"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"tryGetNamed(serviceIdentifier: interfaces.ServiceIdentifier, named: string | number | symbol): T | undefined;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Same as ",(0,t.jsx)(e.code,{children:"container.getNamed"}),", but returns ",(0,t.jsx)(e.code,{children:"undefined"})," in the event no bindings are bound to ",(0,t.jsx)(e.code,{children:"serviceIdentifier"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"trygetnamedasync",children:"tryGetNamedAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"tryGetNamedAsync(serviceIdentifier: interfaces.ServiceIdentifier, named: string | number | symbol): Promise;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Same as ",(0,t.jsx)(e.code,{children:"container.getNamedAsync"}),", but returns ",(0,t.jsx)(e.code,{children:"Promise"})," in the event no bindings are bound to ",(0,t.jsx)(e.code,{children:"serviceIdentifier"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"trygettagged",children:"tryGetTagged"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"tryGetTagged(serviceIdentifier: interfaces.ServiceIdentifier, key: string | number | symbol, value: unknown): T | undefined;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Same as ",(0,t.jsx)(e.code,{children:"container.getTagged"}),", but returns ",(0,t.jsx)(e.code,{children:"undefined"})," in the event no bindings are bound to ",(0,t.jsx)(e.code,{children:"serviceIdentifier"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"trygettaggedasync",children:"tryGetTaggedAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"tryGetTaggedAsync(serviceIdentifier: interfaces.ServiceIdentifier, key: string | number | symbol, value: unknown): Promise\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Same as ",(0,t.jsx)(e.code,{children:"container.getTaggedAsync"}),", but returns ",(0,t.jsx)(e.code,{children:"Promise"})," in the event no bindings are bound to ",(0,t.jsx)(e.code,{children:"serviceIdentifier"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"trygetall",children:"tryGetAll"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"tryGetAll(serviceIdentifier: interfaces.ServiceIdentifier, options?: interfaces.GetAllOptions): T[]\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Same as ",(0,t.jsx)(e.code,{children:"container.getAll"}),", but returns ",(0,t.jsx)(e.code,{children:"[]"})," in the event no bindings are bound to ",(0,t.jsx)(e.code,{children:"serviceIdentifier"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"trygetallasync",children:"tryGetAllAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"tryGetAllAsync(serviceIdentifier: interfaces.ServiceIdentifier, options?: interfaces.GetAllOptions): Promise;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Same as ",(0,t.jsx)(e.code,{children:"container.getAllAsync"}),", but returns ",(0,t.jsx)(e.code,{children:"Promise<[]>"})," in the event no bindings are bound to ",(0,t.jsx)(e.code,{children:"serviceIdentifier"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"trygetallnamed",children:"tryGetAllNamed"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"tryGetAllNamed(serviceIdentifier: interfaces.ServiceIdentifier, named: string | number | symbol): T[];\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Same as ",(0,t.jsx)(e.code,{children:"container.getAllNamed"}),", but returns ",(0,t.jsx)(e.code,{children:"[]"})," in the event no bindings are bound to ",(0,t.jsx)(e.code,{children:"serviceIdentifier"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"trygetallnamedasync",children:"tryGetAllNamedAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"tryGetAllNamedAsync(serviceIdentifier: interfaces.ServiceIdentifier, named: string | number | symbol): Promise;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Same as ",(0,t.jsx)(e.code,{children:"container.getAllNamedAsync"}),", but returns ",(0,t.jsx)(e.code,{children:"Promise<[]>"})," in the event no bindings are bound to ",(0,t.jsx)(e.code,{children:"serviceIdentifier"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"trygetalltagged",children:"tryGetAllTagged"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"tryGetAllTagged(serviceIdentifier: interfaces.ServiceIdentifier, key: string | number | symbol, value: unknown): T[];\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Same as ",(0,t.jsx)(e.code,{children:"container.getAllTagged"}),", but returns ",(0,t.jsx)(e.code,{children:"[]"})," in the event no bindings are bound to ",(0,t.jsx)(e.code,{children:"serviceIdentifier"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"trygetalltaggedasync",children:"tryGetAllTaggedAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"tryGetAllTaggedAsync(serviceIdentifier: interfaces.ServiceIdentifier, key: string | number | symbol, value: unknown): Promise;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Same as ",(0,t.jsx)(e.code,{children:"container.getAllTaggedAsync"}),", but returns ",(0,t.jsx)(e.code,{children:"Promise<[]>"})," in the event no bindings are bound to ",(0,t.jsx)(e.code,{children:"serviceIdentifier"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"unbind",children:"unbind"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"unbind(serviceIdentifier: interfaces.ServiceIdentifier): void;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Remove all bindings binded in this container to the service identifier. This will result in the ",(0,t.jsx)(e.a,{href:"/docs/fundamentals/lifecycle/deactivation",children:"deactivation process"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"unbindasync",children:"unbindAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"unbindAsync(serviceIdentifier: interfaces.ServiceIdentifier): Promise;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["This is the asynchronous version of unbind. If any deactivation realated to this service identifier is asynchronous then this method should be used instead of ",(0,t.jsx)(e.code,{children:"container.unbind"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"unbindall",children:"unbindAll"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"unbindAll(): void;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Remove all bindings binded in this container. This will result in the ",(0,t.jsx)(e.a,{href:"/docs/fundamentals/lifecycle/deactivation",children:"deactivation process"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"unbindallasync",children:"unbindAllAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"unbindAllAsync(): Promise;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["This is the asynchronous version of unbindAll. If any of the container's deactivations is asynchronous then this method should be used instead of ",(0,t.jsx)(e.code,{children:"container.unbindAll"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"unload",children:"unload"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"unload(...modules: interfaces.ContainerModuleBase[]): void;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Removes bindings and handlers added by the modules. This will result in the ",(0,t.jsx)(e.a,{href:"/docs/fundamentals/lifecycle/deactivation",children:"deactivation process"}),".\nSee ",(0,t.jsx)(e.a,{href:"/docs/api/container-module",children:"ContainerModule API docs"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"unloadasync",children:"unloadAsync"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"unloadAsync(...modules: interfaces.ContainerModuleBase[]): Promise;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Asynchronous version of unload. If any of the container modules's deactivations is asynchronous then this method should be used instead of ",(0,t.jsx)(e.code,{children:"container.unload"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"parent",children:"parent;"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"parent: Container | null;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Access the parent container."}),"\n",(0,t.jsx)(e.h2,{id:"id",children:"id"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"id: number;\n"})}),"\n",(0,t.jsx)(e.p,{children:"The container's unique identifier."})]})}function _(n={}){const{wrapper:e}={...(0,r.R)(),...n.components};return e?(0,t.jsx)(e,{...n,children:(0,t.jsx)(R,{...n})}):R(n)}},9466:n=>{n.exports="interface Weapon {\n damage: number;\n}\n\nexport class Katana implements Weapon {\n #damage: number = 10;\n\n public get damage(): number {\n return this.#damage;\n }\n\n public improve(): void {\n this.#damage += 2;\n }\n}\n\nconst container: Container = new Container();\ncontainer.bind('Weapon').to(Katana);\ncontainer.onActivation(\n 'Weapon',\n (_context: interfaces.Context, katana: Katana): Katana | Promise => {\n katana.improve();\n\n return katana;\n },\n);\n\n// Katana.damage is 12\nconst katana: Weapon = container.get('Weapon');"},2969:n=>{n.exports="interface Weapon {\n damage: number;\n}\n\nexport class Katana implements Weapon {\n #damage: number = 10;\n\n public get damage(): number {\n return this.#damage;\n }\n\n public improve(): void {\n this.#damage += 2;\n }\n}\n\nconst container: Container = new Container();\n\ncontainer.bind('Weapon').to(Katana).inSingletonScope();\n\ncontainer.get('Weapon');\ncontainer.onDeactivation('Weapon', (weapon: Weapon): void | Promise => {\n console.log(`Deactivating weapon with damage ${weapon.damage.toString()}`);\n});\n\ncontainer.unbind('Weapon');"}}]); \ No newline at end of file diff --git a/assets/js/cc0cca13.13b6825e.js b/assets/js/cc0cca13.13b6825e.js new file mode 100644 index 00000000..7945b487 --- /dev/null +++ b/assets/js/cc0cca13.13b6825e.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_inversifyjs_inversify_docs_site=self.webpackChunk_inversifyjs_inversify_docs_site||[]).push([[874],{227:(n,e,a)=>{a.r(e),a.d(e,{assets:()=>b,contentTitle:()=>f,default:()=>T,frontMatter:()=>m,metadata:()=>i,toc:()=>w});const i=JSON.parse('{"id":"api/binding-syntax","title":"Binding Syntax","description":"Binding syntax is provided as a fluent interface provided as the result of using the container API or the container module API","source":"@site/docs/api/binding-syntax.mdx","sourceDirName":"api","slug":"/api/binding-syntax","permalink":"/monorepo/docs/api/binding-syntax","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":1,"frontMatter":{"sidebar_position":1,"title":"Binding Syntax"},"sidebar":"tutorialSidebar","previous":{"title":"Deactivation","permalink":"/monorepo/docs/fundamentals/lifecycle/deactivation"},"next":{"title":"Container","permalink":"/monorepo/docs/api/container"}}');var t=a(9793),r=a(1425);const s="@injectable()\nclass Katana {\n public use(): string {\n return 'hit!';\n }\n}\n\ncontainer\n .bind('Katana')\n .to(Katana)\n .onActivation((_context: interfaces.Context, katana: Katana) => {\n const handler: ProxyHandler<() => string> = {\n apply: function (\n target: () => string,\n thisArgument: unknown,\n argumentsList: [],\n ) {\n console.log(`Starting: ${new Date().getTime().toString()}`);\n const result: string = target.apply(thisArgument, argumentsList);\n console.log(`Finished: ${new Date().getTime().toString()}`);\n return result;\n },\n };\n\n katana.use = new Proxy(katana.use.bind(katana), handler);\n\n return katana;\n });",o="const container: Container = new Container();\ncontainer.bind('Weapon').to(Katana);\n\nconst katana: Weapon = container.get('Weapon');",d="@injectable()\nclass Ninja implements Ninja {\n readonly #katana: Katana;\n readonly #shuriken: Shuriken;\n\n constructor(\n @inject('Factory') katanaFactory: interfaces.AutoFactory,\n @inject('Shuriken') shuriken: Shuriken,\n ) {\n this.#katana = katanaFactory();\n this.#shuriken = shuriken;\n }\n\n public fight() {\n return this.#katana.hit();\n }\n\n public sneak() {\n return this.#shuriken.throw();\n }\n}\ncontainer.bind('Katana').to(Katana);\ncontainer.bind('Shuriken').to(Shuriken);\n\ncontainer\n .bind>('Factory')\n .toAutoFactory('Katana');\n\ncontainer.bind(Ninja).toSelf();",c="@injectable()\nclass Ninja implements Ninja {\n readonly #katana: Katana;\n readonly #shuriken: Shuriken;\n\n constructor(\n @inject('Factory')\n katanaFactory: interfaces.AutoNamedFactory,\n ) {\n this.#katana = katanaFactory('katana') as Katana;\n this.#shuriken = katanaFactory('shuriken') as Shuriken;\n }\n\n public fight() {\n return this.#katana.hit();\n }\n\n public sneak() {\n return this.#shuriken.throw();\n }\n}\ncontainer.bind('Weapon').to(Katana).whenTargetNamed('katana');\ncontainer.bind('Weapon').to(Shuriken).whenTargetNamed('shuriken');\ncontainer\n .bind>('Factory')\n .toAutoNamedFactory('Weapon');\n\ncontainer.bind(Ninja).toSelf();",l="const container: Container = new Container();\ncontainer.bind('Weapon').toConstantValue(new Katana());\n\nconst katana: Weapon = container.get('Weapon');",h="const container: Container = new Container();\ncontainer.bind('WeaponConstructor').toConstructor(Katana);\n\nconst katanaConstructor: interfaces.Newable =\n container.get>('WeaponConstructor');",g="const container: Container = new Container();\ncontainer.bind('Weapon').toDynamicValue((): Weapon => new Katana());\n\nconst katana: Weapon = container.get('Weapon');",u="container.bind('Engine').to(PetrolEngine).whenTargetNamed('petrol');\ncontainer.bind('Engine').to(DieselEngine).whenTargetNamed('diesel');\n\ncontainer\n .bind>('Factory')\n .toFactory((context: interfaces.Context) => {\n return (named: string) => (displacement: number) => {\n const engine: Engine = context.container.getNamed(\n 'Engine',\n named,\n );\n engine.displacement = displacement;\n return engine;\n };\n });\n\n@injectable()\nclass DieselCarFactory implements CarFactory {\n readonly #dieselFactory: (displacement: number) => Engine;\n\n constructor(\n @inject('Factory')\n factory: (category: string) => (displacement: number) => Engine, // Injecting an engine factory\n ) {\n // Creating a diesel engine factory\n this.#dieselFactory = factory('diesel');\n }\n\n public createEngine(displacement: number): Engine {\n // Creating a concrete diesel engine\n return this.#dieselFactory(displacement);\n }\n}",x="const container: Container = new Container();\n\ninterface Sword {\n material: string;\n damage: number;\n}\n\n@injectable()\nclass Katana implements Sword {\n public material!: string;\n public damage!: number;\n}\n\ntype SwordProvider = (material: string, damage: number) => Promise;\n\ncontainer.bind('Sword').to(Katana);\n\ncontainer\n .bind('SwordProvider')\n .toProvider((context: interfaces.Context) => {\n return async (material: string, damage: number): Promise => {\n // Custom args!\n return new Promise(\n (resolve: (value: Sword | PromiseLike) => void) => {\n setTimeout(() => {\n const katana: Sword = context.container.get('Sword');\n katana.material = material;\n katana.damage = damage;\n resolve(katana);\n }, 10);\n },\n );\n };\n });\n\nconst katanaProvider: SwordProvider =\n container.get('SwordProvider');\n\nconst powerfulGoldKatana: Promise = katanaProvider('gold', 100);\n\nconst notSoPowerfulGoldKatana: Promise = katanaProvider('gold', 10);",v="const container: Container = new Container();\ncontainer.bind(Katana).toSelf();\n\nconst katana: Weapon = container.get(Katana);",p="const container: Container = new Container();\n\ncontainer.bind(lorcanaCardCatalogProviderSymbol).to(LorcanaCardCatalogProvider);\ncontainer.bind(mtgCardCatalogProviderSymbol).to(MtgCardCatalogProvider);\n\ncontainer\n .bind(cardCatalogProviderSymbol)\n .toService(lorcanaCardCatalogProviderSymbol);\ncontainer\n .bind(cardCatalogProviderSymbol)\n .toService(mtgCardCatalogProviderSymbol);\n\nconst cardCatalogProviders: CardCatalogProvider[] = container.getAll(\n cardCatalogProviderSymbol,\n);",y="const ninjaId: symbol = Symbol.for('Ninja');\nconst weaponId: symbol = Symbol.for('Weapon');\n\n@injectable()\nclass Ninja {\n constructor(\n @inject(weaponId)\n @named('shuriken')\n public readonly weapon: Weapon,\n ) {}\n}\n\ncontainer.bind(ninjaId).to(Ninja);\n\nconst whenTargetNamedConstraint: (\n name: string,\n) => (request: interfaces.Request) => boolean =\n (name: string) =>\n (request: interfaces.Request): boolean =>\n request.target.matchesNamedTag(name);\n\ncontainer\n .bind(weaponId)\n .to(Katana)\n .when(whenTargetNamedConstraint('katana'));\n\ncontainer\n .bind(weaponId)\n .to(Shuriken)\n .when(whenTargetNamedConstraint('shuriken'));\n\nconst ninja: Ninja = container.get(ninjaId);\n\n// Returns 5\nconst ninjaDamage: number = ninja.weapon.damage;";var j=a(2848);const m={sidebar_position:1,title:"Binding Syntax"},f="Binding Syntax",b={},w=[{value:"BindingToSyntax",id:"bindingtosyntax",level:2},{value:"to",id:"to",level:3},{value:"toSelf",id:"toself",level:3},{value:"toConstantValue",id:"toconstantvalue",level:3},{value:"toDynamicValue",id:"todynamicvalue",level:3},{value:"toConstructor",id:"toconstructor",level:3},{value:"toFactory",id:"tofactory",level:3},{value:"toFunction",id:"tofunction",level:3},{value:"toAutoFactory",id:"toautofactory",level:3},{value:"toAutoNamedFactory",id:"toautonamedfactory",level:3},{value:"toProvider",id:"toprovider",level:3},{value:"toService",id:"toservice",level:3},{value:"BindingInSyntax",id:"bindinginsyntax",level:2},{value:"inSingletonScope",id:"insingletonscope",level:3},{value:"inTransientScope",id:"intransientscope",level:3},{value:"inRequestScope",id:"inrequestscope",level:3},{value:"BindingOnSyntax",id:"bindingonsyntax",level:2},{value:"onActivation",id:"onactivation",level:3},{value:"onDeactivation",id:"ondeactivation",level:3},{value:"BindingWhenSyntax",id:"bindingwhensyntax",level:2},{value:"when",id:"when",level:3},{value:"whenTargetNamed",id:"whentargetnamed",level:3},{value:"whenTargetIsDefault",id:"whentargetisdefault",level:3},{value:"whenTargetTagged",id:"whentargettagged",level:3},{value:"whenInjectedInto",id:"wheninjectedinto",level:3},{value:"whenParentNamed",id:"whenparentnamed",level:3},{value:"whenParentTagged",id:"whenparenttagged",level:3},{value:"whenAnyAncestorIs",id:"whenanyancestoris",level:3},{value:"whenNoAncestorIs",id:"whennoancestoris",level:3},{value:"whenAnyAncestorNamed",id:"whenanyancestornamed",level:3},{value:"whenAnyAncestorTagged",id:"whenanyancestortagged",level:3},{value:"whenNoAncestorNamed",id:"whennoancestornamed",level:3},{value:"whenNoAncestorTagged",id:"whennoancestortagged",level:3},{value:"whenAnyAncestorMatches",id:"whenanyancestormatches",level:3},{value:"whenNoAncestorMatches",id:"whennoancestormatches",level:3},{value:"BindingWhenOnSyntax",id:"bindingwhenonsyntax",level:2},{value:"BindingInWhenOnSyntax",id:"bindinginwhenonsyntax",level:2}];function S(n){const e={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",...(0,r.R)(),...n.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e.header,{children:(0,t.jsx)(e.h1,{id:"binding-syntax",children:"Binding Syntax"})}),"\n",(0,t.jsxs)(e.p,{children:["Binding syntax is provided as a fluent interface provided as the result of using the ",(0,t.jsx)(e.a,{href:"/docs/api/container#bind",children:"container API"})," or the ",(0,t.jsx)(e.a,{href:"/docs/api/container-module#bind",children:"container module API"})]}),"\n",(0,t.jsx)(e.h2,{id:"bindingtosyntax",children:"BindingToSyntax"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"interface BindingToSyntax {\n // ...\n}\n"})}),"\n",(0,t.jsx)(e.p,{children:"Represents a service binding given a service identifier."}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"const bindingToSyntax = container.bind('service-id');\n"})}),"\n",(0,t.jsx)(e.p,{children:'Further docs refers to this service identifier as the "given service identifier".'}),"\n",(0,t.jsx)(e.h3,{id:"to",children:"to"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"to(constructor: interfaces.Newable): interfaces.BindingInWhenOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Binds a class instantiation to the given service binding. Whenever the service is resolved, the class constructor will be invoked in order to build the resolved value."}),"\n",(0,t.jsx)(j.A,{language:"ts",children:o}),"\n",(0,t.jsx)(e.h3,{id:"toself",children:"toSelf"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"toSelf(): interfaces.BindingInWhenOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"If the given service identifier is a class, establish a type binding to that class."}),"\n",(0,t.jsx)(j.A,{language:"ts",children:v}),"\n",(0,t.jsx)(e.h3,{id:"toconstantvalue",children:"toConstantValue"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"toConstantValue(value: T): interfaces.BindingWhenOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Binds a value in singleton scope to the given service identifier."}),"\n",(0,t.jsx)(j.A,{language:"ts",children:l}),"\n",(0,t.jsx)(e.h3,{id:"todynamicvalue",children:"toDynamicValue"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"toDynamicValue(func: interfaces.DynamicValue): interfaces.BindingInWhenOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Binds a function to the given service id. Whenever the service is resolved, the function passed will be invoked in order to build the resolved value."}),"\n",(0,t.jsx)(e.admonition,{type:"info",children:(0,t.jsx)(e.p,{children:"Keep in mind a service is not resolved if it's cached in the current scope."})}),"\n",(0,t.jsx)(j.A,{language:"ts",children:g}),"\n",(0,t.jsx)(e.h3,{id:"toconstructor",children:"toConstructor"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"toConstructor(constructor: interfaces.Newable): interfaces.BindingWhenOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Binds a class to the given service id. Whenever the service is resolved, the class constructor will be passed as the resolved value."}),"\n",(0,t.jsx)(j.A,{language:"ts",children:h}),"\n",(0,t.jsx)(e.h3,{id:"tofactory",children:"toFactory"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"toFactory(factory: interfaces.FactoryCreator): interfaces.BindingWhenOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Binds a factory to the given service identifier. Whenever the service is resolved, the factory will be passed as the resolved value."}),"\n",(0,t.jsx)(j.A,{language:"ts",children:u}),"\n",(0,t.jsx)(e.h3,{id:"tofunction",children:"toFunction"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"toFunction(func: T): interfaces.BindingWhenOnSyntax;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["An alias of ",(0,t.jsx)(e.code,{children:"BindingToSyntax.toConstantValue"})," restricted to functions."]}),"\n",(0,t.jsx)(e.h3,{id:"toautofactory",children:"toAutoFactory"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"toAutoFactory(serviceIdentifier: interfaces.ServiceIdentifier): interfaces.BindingWhenOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Binds a factory of services asociated a target service identifier to the given service identifier."}),"\n",(0,t.jsx)(j.A,{language:"ts",children:d}),"\n",(0,t.jsx)(e.h3,{id:"toautonamedfactory",children:"toAutoNamedFactory"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"toAutoNamedFactory(serviceIdentifier: interfaces.ServiceIdentifier): BindingWhenOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Binds a factory of services asociated a target service identifier and a name to the given service identifier."}),"\n",(0,t.jsx)(j.A,{language:"ts",children:c}),"\n",(0,t.jsx)(e.h3,{id:"toprovider",children:"toProvider"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"toProvider(provider: interfaces.ProviderCreator): interfaces.BindingWhenOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Binds a provider of services asociated a target service identifier to the given service identifier. A provider is just an asyncronous factory."}),"\n",(0,t.jsx)(j.A,{language:"ts",children:x}),"\n",(0,t.jsx)(e.h3,{id:"toservice",children:"toService"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"toService(service: interfaces.ServiceIdentifier): void;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Binds the services bound to a target service identifier to the given service identifier."}),"\n",(0,t.jsx)(j.A,{language:"ts",children:p}),"\n",(0,t.jsx)(e.h2,{id:"bindinginsyntax",children:"BindingInSyntax"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"interface BindingInSyntax {\n // ...\n}\n"})}),"\n",(0,t.jsx)(e.p,{children:"Represents a service binding given a service identifier and a service resolution such as a contructor, a factory or a provider."}),"\n",(0,t.jsx)(e.h3,{id:"insingletonscope",children:"inSingletonScope"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"inSingletonScope(): BindingWhenOnSyntax;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Sets the binding scope to singleton. Consider ",(0,t.jsx)(e.a,{href:"/docs/fundamentals/binding#singleton",children:"docs"})," as reference."]}),"\n",(0,t.jsx)(e.h3,{id:"intransientscope",children:"inTransientScope"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"inTransientScope(): BindingWhenOnSyntax;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Sets the binding scope to transient. Consider ",(0,t.jsx)(e.a,{href:"/docs/fundamentals/binding#transient",children:"docs"})," as reference."]}),"\n",(0,t.jsx)(e.h3,{id:"inrequestscope",children:"inRequestScope"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"inRequestScope(): BindingWhenOnSyntax;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Sets the binding scope to request. Consider ",(0,t.jsx)(e.a,{href:"/docs/fundamentals/binding#request",children:"docs"})," as reference."]}),"\n",(0,t.jsx)(e.h2,{id:"bindingonsyntax",children:"BindingOnSyntax"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"interface BindingOnSyntax {\n // ...\n}\n"})}),"\n",(0,t.jsx)(e.p,{children:"Allows setting binding activation and deactivation handlers."}),"\n",(0,t.jsx)(e.h3,{id:"onactivation",children:"onActivation"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"onActivation(fn: (context: Context, injectable: T) => T | Promise): BindingWhenSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Sets a binding activation handler. The activation handler is invoked after a dependency has been resolved and before it is added to a scope cache. The activation handler will not be invoked if the dependency is taken from a scope cache."}),"\n",(0,t.jsx)(j.A,{language:"ts",children:s}),"\n",(0,t.jsx)(e.h3,{id:"ondeactivation",children:"onDeactivation"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"onDeactivation(fn: (injectable: T) => void | Promise): BindingWhenSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Sets a binding deactivation handler on a singleton scope binding. The deactivation handler is caled when the binding is unbound from a container."}),"\n",(0,t.jsx)(e.h2,{id:"bindingwhensyntax",children:"BindingWhenSyntax"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"interface BindingWhenSyntax {\n // ...\n}\n"})}),"\n",(0,t.jsx)(e.p,{children:"Allows setting binding constraints."}),"\n",(0,t.jsx)(e.h3,{id:"when",children:"when"}),"\n",(0,t.jsx)(e.p,{children:"Sets a constraint for the current binding."}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"when(constraint: (request: Request) => boolean): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(j.A,{language:"ts",children:y}),"\n",(0,t.jsx)(e.p,{children:"In the previous example, a custom constraint is implemented to use the binding if and only if the target name is a certain one."}),"\n",(0,t.jsx)(e.h3,{id:"whentargetnamed",children:"whenTargetNamed"}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if the target name is a certain one."}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenTargetNamed(name: string | number | symbol): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.h3,{id:"whentargetisdefault",children:"whenTargetIsDefault"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenTargetIsDefault(): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if the target has no name nor tags."}),"\n",(0,t.jsx)(e.h3,{id:"whentargettagged",children:"whenTargetTagged"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenTargetTagged(tag: string | number | symbol, value: unknown): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if the target tag is a certain one."}),"\n",(0,t.jsx)(e.h3,{id:"wheninjectedinto",children:"whenInjectedInto"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenInjectedInto(parent: NewableFunction | string): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if the parent target service identifier is a certain one."}),"\n",(0,t.jsx)(e.h3,{id:"whenparentnamed",children:"whenParentNamed"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenParentNamed(name: string | number | symbol): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if the parent target name is a certain one."}),"\n",(0,t.jsx)(e.h3,{id:"whenparenttagged",children:"whenParentTagged"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenParentTagged(tag: string | number | symbol, value: unknown): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if the parent target tag is a certain one."}),"\n",(0,t.jsx)(e.h3,{id:"whenanyancestoris",children:"whenAnyAncestorIs"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenAnyAncestorIs(ancestor: NewableFunction | string): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if any ancestor target service identifier is a certain one."}),"\n",(0,t.jsx)(e.h3,{id:"whennoancestoris",children:"whenNoAncestorIs"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenNoAncestorIs(ancestor: NewableFunction | string): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if no ancestor target service identifier is a certain one."}),"\n",(0,t.jsx)(e.h3,{id:"whenanyancestornamed",children:"whenAnyAncestorNamed"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenAnyAncestorNamed(name: string | number | symbol): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if any ancestor target name is a certain one."}),"\n",(0,t.jsx)(e.h3,{id:"whenanyancestortagged",children:"whenAnyAncestorTagged"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenAnyAncestorTagged(tag: string | number | symbol, value: unknown): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if any ancestor target tag is a certain one."}),"\n",(0,t.jsx)(e.h3,{id:"whennoancestornamed",children:"whenNoAncestorNamed"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenNoAncestorNamed(name: string | number | symbol): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if no ancestor target name is a certain one."}),"\n",(0,t.jsx)(e.h3,{id:"whennoancestortagged",children:"whenNoAncestorTagged"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenNoAncestorTagged(tag: string | number | symbol, value: unknown): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if no ancestor target tag is a certain one."}),"\n",(0,t.jsx)(e.h3,{id:"whenanyancestormatches",children:"whenAnyAncestorMatches"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenAnyAncestorMatches(constraint: (request: Request) => boolean): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if any ancestor matches a certain constraint."}),"\n",(0,t.jsx)(e.h3,{id:"whennoancestormatches",children:"whenNoAncestorMatches"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenNoAncestorMatches(constraint: (request: Request) => boolean): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if no ancestor matches a certain constraint."}),"\n",(0,t.jsx)(e.h2,{id:"bindingwhenonsyntax",children:"BindingWhenOnSyntax"}),"\n",(0,t.jsxs)(e.p,{children:["The union of ",(0,t.jsx)(e.a,{href:"#bindingwhensyntax",children:"BindingWhenSyntax"})," and ",(0,t.jsx)(e.a,{href:"#bindingonsyntax",children:"BindingOnSyntax"})]}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"export interface BindingWhenOnSyntax\n extends BindingWhenSyntax,\n BindingOnSyntax {}\n"})}),"\n",(0,t.jsx)(e.h2,{id:"bindinginwhenonsyntax",children:"BindingInWhenOnSyntax"}),"\n",(0,t.jsxs)(e.p,{children:["The union of ",(0,t.jsx)(e.a,{href:"#bindinginsyntax",children:"BindingInSyntax"})," and ",(0,t.jsx)(e.a,{href:"#bindingwhenonsyntax",children:"BindingWhenOnSyntax"}),"."]}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"export interface BindingInWhenOnSyntax\n extends BindingInSyntax,\n BindingWhenOnSyntax {}\n"})})]})}function T(n={}){const{wrapper:e}={...(0,r.R)(),...n.components};return e?(0,t.jsx)(e,{...n,children:(0,t.jsx)(S,{...n})}):S(n)}}}]); \ No newline at end of file diff --git a/assets/js/cc0cca13.b9e43a64.js b/assets/js/cc0cca13.b9e43a64.js deleted file mode 100644 index 0a2718e0..00000000 --- a/assets/js/cc0cca13.b9e43a64.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_inversifyjs_inversify_docs_site=self.webpackChunk_inversifyjs_inversify_docs_site||[]).push([[874],{227:(n,e,a)=>{a.r(e),a.d(e,{assets:()=>b,contentTitle:()=>f,default:()=>T,frontMatter:()=>m,metadata:()=>i,toc:()=>w});const i=JSON.parse('{"id":"api/binding-syntax","title":"Binding Syntax","description":"Binding syntax is provided as a fluent interface provided as the result of using the container API or the container module API","source":"@site/docs/api/binding-syntax.mdx","sourceDirName":"api","slug":"/api/binding-syntax","permalink":"/monorepo/docs/api/binding-syntax","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":2,"frontMatter":{"sidebar_position":2,"title":"Binding Syntax"},"sidebar":"tutorialSidebar","previous":{"title":"Container","permalink":"/monorepo/docs/api/container"},"next":{"title":"Container Module","permalink":"/monorepo/docs/api/container-module"}}');var t=a(9793),r=a(1425);const s="@injectable()\nclass Katana {\n public use(): string {\n return 'hit!';\n }\n}\n\ncontainer\n .bind('Katana')\n .to(Katana)\n .onActivation((_context: interfaces.Context, katana: Katana) => {\n const handler: ProxyHandler<() => string> = {\n apply: function (\n target: () => string,\n thisArgument: unknown,\n argumentsList: [],\n ) {\n console.log(`Starting: ${new Date().getTime().toString()}`);\n const result: string = target.apply(thisArgument, argumentsList);\n console.log(`Finished: ${new Date().getTime().toString()}`);\n return result;\n },\n };\n\n katana.use = new Proxy(katana.use.bind(katana), handler);\n\n return katana;\n });",o="const container: Container = new Container();\ncontainer.bind('Weapon').to(Katana);\n\nconst katana: Weapon = container.get('Weapon');",d="@injectable()\nclass Ninja implements Ninja {\n readonly #katana: Katana;\n readonly #shuriken: Shuriken;\n\n constructor(\n @inject('Factory') katanaFactory: interfaces.AutoFactory,\n @inject('Shuriken') shuriken: Shuriken,\n ) {\n this.#katana = katanaFactory();\n this.#shuriken = shuriken;\n }\n\n public fight() {\n return this.#katana.hit();\n }\n\n public sneak() {\n return this.#shuriken.throw();\n }\n}\ncontainer.bind('Katana').to(Katana);\ncontainer.bind('Shuriken').to(Shuriken);\n\ncontainer\n .bind>('Factory')\n .toAutoFactory('Katana');\n\ncontainer.bind(Ninja).toSelf();",c="@injectable()\nclass Ninja implements Ninja {\n readonly #katana: Katana;\n readonly #shuriken: Shuriken;\n\n constructor(\n @inject('Factory')\n katanaFactory: interfaces.AutoNamedFactory,\n ) {\n this.#katana = katanaFactory('katana') as Katana;\n this.#shuriken = katanaFactory('shuriken') as Shuriken;\n }\n\n public fight() {\n return this.#katana.hit();\n }\n\n public sneak() {\n return this.#shuriken.throw();\n }\n}\ncontainer.bind('Weapon').to(Katana).whenTargetNamed('katana');\ncontainer.bind('Weapon').to(Shuriken).whenTargetNamed('shuriken');\ncontainer\n .bind>('Factory')\n .toAutoNamedFactory('Weapon');\n\ncontainer.bind(Ninja).toSelf();",l="const container: Container = new Container();\ncontainer.bind('Weapon').toConstantValue(new Katana());\n\nconst katana: Weapon = container.get('Weapon');",h="const container: Container = new Container();\ncontainer.bind('WeaponConstructor').toConstructor(Katana);\n\nconst katanaConstructor: interfaces.Newable =\n container.get>('WeaponConstructor');",g="const container: Container = new Container();\ncontainer.bind('Weapon').toDynamicValue((): Weapon => new Katana());\n\nconst katana: Weapon = container.get('Weapon');",u="container.bind('Engine').to(PetrolEngine).whenTargetNamed('petrol');\ncontainer.bind('Engine').to(DieselEngine).whenTargetNamed('diesel');\n\ncontainer\n .bind>('Factory')\n .toFactory((context: interfaces.Context) => {\n return (named: string) => (displacement: number) => {\n const engine: Engine = context.container.getNamed(\n 'Engine',\n named,\n );\n engine.displacement = displacement;\n return engine;\n };\n });\n\n@injectable()\nclass DieselCarFactory implements CarFactory {\n readonly #dieselFactory: (displacement: number) => Engine;\n\n constructor(\n @inject('Factory')\n factory: (category: string) => (displacement: number) => Engine, // Injecting an engine factory\n ) {\n // Creating a diesel engine factory\n this.#dieselFactory = factory('diesel');\n }\n\n public createEngine(displacement: number): Engine {\n // Creating a concrete diesel engine\n return this.#dieselFactory(displacement);\n }\n}",x="const container: Container = new Container();\n\ninterface Sword {\n material: string;\n damage: number;\n}\n\n@injectable()\nclass Katana implements Sword {\n public material!: string;\n public damage!: number;\n}\n\ntype SwordProvider = (material: string, damage: number) => Promise;\n\ncontainer.bind('Sword').to(Katana);\n\ncontainer\n .bind('SwordProvider')\n .toProvider((context: interfaces.Context) => {\n return async (material: string, damage: number): Promise => {\n // Custom args!\n return new Promise(\n (resolve: (value: Sword | PromiseLike) => void) => {\n setTimeout(() => {\n const katana: Sword = context.container.get('Sword');\n katana.material = material;\n katana.damage = damage;\n resolve(katana);\n }, 10);\n },\n );\n };\n });\n\nconst katanaProvider: SwordProvider =\n container.get('SwordProvider');\n\nconst powerfulGoldKatana: Promise = katanaProvider('gold', 100);\n\nconst notSoPowerfulGoldKatana: Promise = katanaProvider('gold', 10);",p="const container: Container = new Container();\ncontainer.bind(Katana).toSelf();\n\nconst katana: Weapon = container.get(Katana);",v="const container: Container = new Container();\n\ncontainer.bind(lorcanaCardCatalogProviderSymbol).to(LorcanaCardCatalogProvider);\ncontainer.bind(mtgCardCatalogProviderSymbol).to(MtgCardCatalogProvider);\n\ncontainer\n .bind(cardCatalogProviderSymbol)\n .toService(lorcanaCardCatalogProviderSymbol);\ncontainer\n .bind(cardCatalogProviderSymbol)\n .toService(mtgCardCatalogProviderSymbol);\n\nconst cardCatalogProviders: CardCatalogProvider[] = container.getAll(\n cardCatalogProviderSymbol,\n);",y="const ninjaId: symbol = Symbol.for('Ninja');\nconst weaponId: symbol = Symbol.for('Weapon');\n\n@injectable()\nclass Ninja {\n constructor(\n @inject(weaponId)\n @named('shuriken')\n public readonly weapon: Weapon,\n ) {}\n}\n\ncontainer.bind(ninjaId).to(Ninja);\n\nconst whenTargetNamedConstraint: (\n name: string,\n) => (request: interfaces.Request) => boolean =\n (name: string) =>\n (request: interfaces.Request): boolean =>\n request.target.matchesNamedTag(name);\n\ncontainer\n .bind(weaponId)\n .to(Katana)\n .when(whenTargetNamedConstraint('katana'));\n\ncontainer\n .bind(weaponId)\n .to(Shuriken)\n .when(whenTargetNamedConstraint('shuriken'));\n\nconst ninja: Ninja = container.get(ninjaId);\n\n// Returns 5\nconst ninjaDamage: number = ninja.weapon.damage;";var j=a(2848);const m={sidebar_position:2,title:"Binding Syntax"},f="Binding Syntax",b={},w=[{value:"BindingToSyntax",id:"bindingtosyntax",level:2},{value:"to",id:"to",level:3},{value:"toSelf",id:"toself",level:3},{value:"toConstantValue",id:"toconstantvalue",level:3},{value:"toDynamicValue",id:"todynamicvalue",level:3},{value:"toConstructor",id:"toconstructor",level:3},{value:"toFactory",id:"tofactory",level:3},{value:"toFunction",id:"tofunction",level:3},{value:"toAutoFactory",id:"toautofactory",level:3},{value:"toAutoNamedFactory",id:"toautonamedfactory",level:3},{value:"toProvider",id:"toprovider",level:3},{value:"toService",id:"toservice",level:3},{value:"BindingInSyntax",id:"bindinginsyntax",level:2},{value:"inSingletonScope",id:"insingletonscope",level:3},{value:"inTransientScope",id:"intransientscope",level:3},{value:"inRequestScope",id:"inrequestscope",level:3},{value:"BindingOnSyntax",id:"bindingonsyntax",level:2},{value:"onActivation",id:"onactivation",level:3},{value:"onDeactivation",id:"ondeactivation",level:3},{value:"BindingWhenSyntax",id:"bindingwhensyntax",level:2},{value:"when",id:"when",level:3},{value:"whenTargetNamed",id:"whentargetnamed",level:3},{value:"whenTargetIsDefault",id:"whentargetisdefault",level:3},{value:"whenTargetTagged",id:"whentargettagged",level:3},{value:"whenInjectedInto",id:"wheninjectedinto",level:3},{value:"whenParentNamed",id:"whenparentnamed",level:3},{value:"whenParentTagged",id:"whenparenttagged",level:3},{value:"whenAnyAncestorIs",id:"whenanyancestoris",level:3},{value:"whenNoAncestorIs",id:"whennoancestoris",level:3},{value:"whenAnyAncestorNamed",id:"whenanyancestornamed",level:3},{value:"whenAnyAncestorTagged",id:"whenanyancestortagged",level:3},{value:"whenNoAncestorNamed",id:"whennoancestornamed",level:3},{value:"whenNoAncestorTagged",id:"whennoancestortagged",level:3},{value:"whenAnyAncestorMatches",id:"whenanyancestormatches",level:3},{value:"whenNoAncestorMatches",id:"whennoancestormatches",level:3},{value:"BindingWhenOnSyntax",id:"bindingwhenonsyntax",level:2},{value:"BindingInWhenOnSyntax",id:"bindinginwhenonsyntax",level:2}];function S(n){const e={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",...(0,r.R)(),...n.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e.header,{children:(0,t.jsx)(e.h1,{id:"binding-syntax",children:"Binding Syntax"})}),"\n",(0,t.jsxs)(e.p,{children:["Binding syntax is provided as a fluent interface provided as the result of using the ",(0,t.jsx)(e.a,{href:"/docs/api/container#bind",children:"container API"})," or the ",(0,t.jsx)(e.a,{href:"/docs/api/container-module#bind",children:"container module API"})]}),"\n",(0,t.jsx)(e.h2,{id:"bindingtosyntax",children:"BindingToSyntax"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"interface BindingToSyntax {\n // ...\n}\n"})}),"\n",(0,t.jsx)(e.p,{children:"Represents a service binding given a service identifier."}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"const bindingToSyntax = container.bind('service-id');\n"})}),"\n",(0,t.jsx)(e.p,{children:'Further docs refers to this service identifier as the "given service identifier".'}),"\n",(0,t.jsx)(e.h3,{id:"to",children:"to"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"to(constructor: interfaces.Newable): interfaces.BindingInWhenOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Binds a class instantiation to the given service binding. Whenever the service is resolved, the class constructor will be invoked in order to build the resolved value."}),"\n",(0,t.jsx)(j.A,{language:"ts",children:o}),"\n",(0,t.jsx)(e.h3,{id:"toself",children:"toSelf"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"toSelf(): interfaces.BindingInWhenOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"If the given service identifier is a class, establish a type binding to that class."}),"\n",(0,t.jsx)(j.A,{language:"ts",children:p}),"\n",(0,t.jsx)(e.h3,{id:"toconstantvalue",children:"toConstantValue"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"toConstantValue(value: T): interfaces.BindingWhenOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Binds a value in singleton scope to the given service identifier."}),"\n",(0,t.jsx)(j.A,{language:"ts",children:l}),"\n",(0,t.jsx)(e.h3,{id:"todynamicvalue",children:"toDynamicValue"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"toDynamicValue(func: interfaces.DynamicValue): interfaces.BindingInWhenOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Binds a function to the given service id. Whenever the service is resolved, the function passed will be invoked in order to build the resolved value."}),"\n",(0,t.jsx)(e.admonition,{type:"info",children:(0,t.jsx)(e.p,{children:"Keep in mind a service is not resolved if it's cached in the current scope."})}),"\n",(0,t.jsx)(j.A,{language:"ts",children:g}),"\n",(0,t.jsx)(e.h3,{id:"toconstructor",children:"toConstructor"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"toConstructor(constructor: interfaces.Newable): interfaces.BindingWhenOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Binds a class to the given service id. Whenever the service is resolved, the class constructor will be passed as the resolved value."}),"\n",(0,t.jsx)(j.A,{language:"ts",children:h}),"\n",(0,t.jsx)(e.h3,{id:"tofactory",children:"toFactory"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"toFactory(factory: interfaces.FactoryCreator): interfaces.BindingWhenOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Binds a factory to the given service identifier. Whenever the service is resolved, the factory will be passed as the resolved value."}),"\n",(0,t.jsx)(j.A,{language:"ts",children:u}),"\n",(0,t.jsx)(e.h3,{id:"tofunction",children:"toFunction"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"toFunction(func: T): interfaces.BindingWhenOnSyntax;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["An alias of ",(0,t.jsx)(e.code,{children:"BindingToSyntax.toConstantValue"})," restricted to functions."]}),"\n",(0,t.jsx)(e.h3,{id:"toautofactory",children:"toAutoFactory"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"toAutoFactory(serviceIdentifier: interfaces.ServiceIdentifier): interfaces.BindingWhenOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Binds a factory of services asociated a target service identifier to the given service identifier."}),"\n",(0,t.jsx)(j.A,{language:"ts",children:d}),"\n",(0,t.jsx)(e.h3,{id:"toautonamedfactory",children:"toAutoNamedFactory"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"toAutoNamedFactory(serviceIdentifier: interfaces.ServiceIdentifier): BindingWhenOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Binds a factory of services asociated a target service identifier and a name to the given service identifier."}),"\n",(0,t.jsx)(j.A,{language:"ts",children:c}),"\n",(0,t.jsx)(e.h3,{id:"toprovider",children:"toProvider"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"toProvider(provider: interfaces.ProviderCreator): interfaces.BindingWhenOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Binds a provider of services asociated a target service identifier to the given service identifier. A provider is just an asyncronous factory."}),"\n",(0,t.jsx)(j.A,{language:"ts",children:x}),"\n",(0,t.jsx)(e.h3,{id:"toservice",children:"toService"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"toService(service: interfaces.ServiceIdentifier): void;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Binds the services bound to a target service identifier to the given service identifier."}),"\n",(0,t.jsx)(j.A,{language:"ts",children:v}),"\n",(0,t.jsx)(e.h2,{id:"bindinginsyntax",children:"BindingInSyntax"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"interface BindingInSyntax {\n // ...\n}\n"})}),"\n",(0,t.jsx)(e.p,{children:"Represents a service binding given a service identifier and a service resolution such as a contructor, a factory or a provider."}),"\n",(0,t.jsx)(e.h3,{id:"insingletonscope",children:"inSingletonScope"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"inSingletonScope(): BindingWhenOnSyntax;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Sets the binding scope to singleton. Consider ",(0,t.jsx)(e.a,{href:"/docs/fundamentals/binding#singleton",children:"docs"})," as reference."]}),"\n",(0,t.jsx)(e.h3,{id:"intransientscope",children:"inTransientScope"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"inTransientScope(): BindingWhenOnSyntax;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Sets the binding scope to transient. Consider ",(0,t.jsx)(e.a,{href:"/docs/fundamentals/binding#transient",children:"docs"})," as reference."]}),"\n",(0,t.jsx)(e.h3,{id:"inrequestscope",children:"inRequestScope"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"inRequestScope(): BindingWhenOnSyntax;\n"})}),"\n",(0,t.jsxs)(e.p,{children:["Sets the binding scope to request. Consider ",(0,t.jsx)(e.a,{href:"/docs/fundamentals/binding#request",children:"docs"})," as reference."]}),"\n",(0,t.jsx)(e.h2,{id:"bindingonsyntax",children:"BindingOnSyntax"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"interface BindingOnSyntax {\n // ...\n}\n"})}),"\n",(0,t.jsx)(e.p,{children:"Allows setting binding activation and deactivation handlers."}),"\n",(0,t.jsx)(e.h3,{id:"onactivation",children:"onActivation"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"onActivation(fn: (context: Context, injectable: T) => T | Promise): BindingWhenSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Sets a binding activation handler. The activation handler is invoked after a dependency has been resolved and before it is added to a scope cache. The activation handler will not be invoked if the dependency is taken from a scope cache."}),"\n",(0,t.jsx)(j.A,{language:"ts",children:s}),"\n",(0,t.jsx)(e.h3,{id:"ondeactivation",children:"onDeactivation"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"onDeactivation(fn: (injectable: T) => void | Promise): BindingWhenSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Sets a binding deactivation handler on a singleton scope binding. The deactivation handler is caled when the binding is unbound from a container."}),"\n",(0,t.jsx)(e.h2,{id:"bindingwhensyntax",children:"BindingWhenSyntax"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"interface BindingWhenSyntax {\n // ...\n}\n"})}),"\n",(0,t.jsx)(e.p,{children:"Allows setting binding constraints."}),"\n",(0,t.jsx)(e.h3,{id:"when",children:"when"}),"\n",(0,t.jsx)(e.p,{children:"Sets a constraint for the current binding."}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"when(constraint: (request: Request) => boolean): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(j.A,{language:"ts",children:y}),"\n",(0,t.jsx)(e.p,{children:"In the previous example, a custom constraint is implemented to use the binding if and only if the target name is a certain one."}),"\n",(0,t.jsx)(e.h3,{id:"whentargetnamed",children:"whenTargetNamed"}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if the target name is a certain one."}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenTargetNamed(name: string | number | symbol): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.h3,{id:"whentargetisdefault",children:"whenTargetIsDefault"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenTargetIsDefault(): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if the target has no name nor tags."}),"\n",(0,t.jsx)(e.h3,{id:"whentargettagged",children:"whenTargetTagged"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenTargetTagged(tag: string | number | symbol, value: unknown): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if the target tag is a certain one."}),"\n",(0,t.jsx)(e.h3,{id:"wheninjectedinto",children:"whenInjectedInto"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenInjectedInto(parent: NewableFunction | string): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if the parent target service identifier is a certain one."}),"\n",(0,t.jsx)(e.h3,{id:"whenparentnamed",children:"whenParentNamed"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenParentNamed(name: string | number | symbol): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if the parent target name is a certain one."}),"\n",(0,t.jsx)(e.h3,{id:"whenparenttagged",children:"whenParentTagged"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenParentTagged(tag: string | number | symbol, value: unknown): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if the parent target tag is a certain one."}),"\n",(0,t.jsx)(e.h3,{id:"whenanyancestoris",children:"whenAnyAncestorIs"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenAnyAncestorIs(ancestor: NewableFunction | string): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if any ancestor target service identifier is a certain one."}),"\n",(0,t.jsx)(e.h3,{id:"whennoancestoris",children:"whenNoAncestorIs"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenNoAncestorIs(ancestor: NewableFunction | string): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if no ancestor target service identifier is a certain one."}),"\n",(0,t.jsx)(e.h3,{id:"whenanyancestornamed",children:"whenAnyAncestorNamed"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenAnyAncestorNamed(name: string | number | symbol): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if any ancestor target name is a certain one."}),"\n",(0,t.jsx)(e.h3,{id:"whenanyancestortagged",children:"whenAnyAncestorTagged"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenAnyAncestorTagged(tag: string | number | symbol, value: unknown): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if any ancestor target tag is a certain one."}),"\n",(0,t.jsx)(e.h3,{id:"whennoancestornamed",children:"whenNoAncestorNamed"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenNoAncestorNamed(name: string | number | symbol): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if no ancestor target name is a certain one."}),"\n",(0,t.jsx)(e.h3,{id:"whennoancestortagged",children:"whenNoAncestorTagged"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenNoAncestorTagged(tag: string | number | symbol, value: unknown): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if no ancestor target tag is a certain one."}),"\n",(0,t.jsx)(e.h3,{id:"whenanyancestormatches",children:"whenAnyAncestorMatches"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenAnyAncestorMatches(constraint: (request: Request) => boolean): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if any ancestor matches a certain constraint."}),"\n",(0,t.jsx)(e.h3,{id:"whennoancestormatches",children:"whenNoAncestorMatches"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"whenNoAncestorMatches(constraint: (request: Request) => boolean): BindingOnSyntax;\n"})}),"\n",(0,t.jsx)(e.p,{children:"Constraints the binding to be used if and only if no ancestor matches a certain constraint."}),"\n",(0,t.jsx)(e.h2,{id:"bindingwhenonsyntax",children:"BindingWhenOnSyntax"}),"\n",(0,t.jsxs)(e.p,{children:["The union of ",(0,t.jsx)(e.a,{href:"#bindingwhensyntax",children:"BindingWhenSyntax"})," and ",(0,t.jsx)(e.a,{href:"#bindingonsyntax",children:"BindingOnSyntax"})]}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"export interface BindingWhenOnSyntax\n extends BindingWhenSyntax,\n BindingOnSyntax {}\n"})}),"\n",(0,t.jsx)(e.h2,{id:"bindinginwhenonsyntax",children:"BindingInWhenOnSyntax"}),"\n",(0,t.jsxs)(e.p,{children:["The union of ",(0,t.jsx)(e.a,{href:"#bindinginsyntax",children:"BindingInSyntax"})," and ",(0,t.jsx)(e.a,{href:"#bindingwhenonsyntax",children:"BindingWhenOnSyntax"}),"."]}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-ts",children:"export interface BindingInWhenOnSyntax\n extends BindingInSyntax,\n BindingWhenOnSyntax {}\n"})})]})}function T(n={}){const{wrapper:e}={...(0,r.R)(),...n.components};return e?(0,t.jsx)(e,{...n,children:(0,t.jsx)(S,{...n})}):S(n)}}}]); \ No newline at end of file diff --git a/assets/js/e33fc578.811f8833.js b/assets/js/e33fc578.811f8833.js deleted file mode 100644 index de64b20f..00000000 --- a/assets/js/e33fc578.811f8833.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_inversifyjs_inversify_docs_site=self.webpackChunk_inversifyjs_inversify_docs_site||[]).push([[630],{7488:(n,e,i)=>{i.r(e),i.d(e,{assets:()=>l,contentTitle:()=>c,default:()=>p,frontMatter:()=>t,metadata:()=>a,toc:()=>h});const a=JSON.parse('{"id":"api/container-module","title":"Container Module","description":"Container modules can help you to manage the complexity of your bindings in large applications.","source":"@site/docs/api/container-module.mdx","sourceDirName":"api","slug":"/api/container-module","permalink":"/monorepo/docs/api/container-module","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":3,"frontMatter":{"sidebar_position":3,"title":"Container Module"},"sidebar":"tutorialSidebar","previous":{"title":"Binding Syntax","permalink":"/monorepo/docs/api/binding-syntax"}}');var o=i(9793),r=i(1425);const s="const warriorsModule: ContainerModule = new ContainerModule(\n (bind: interfaces.Bind) => {\n bind('Ninja').to(Ninja);\n },\n);\n\nconst weaponsModule: ContainerModule = new ContainerModule(\n (\n bind: interfaces.Bind,\n _unbind: interfaces.Unbind,\n _isBound: interfaces.IsBound,\n _rebind: interfaces.Rebind,\n _unbindAsync: interfaces.UnbindAsync,\n _onActivation: interfaces.Container['onActivation'],\n _onDeactivation: interfaces.Container['onDeactivation'],\n ) => {\n bind('Weapon').to(Katana).whenTargetNamed('Melee');\n bind('Weapon').to(Shuriken).whenTargetNamed('Ranged');\n },\n);\n\nconst container: Container = new Container();\ncontainer.load(warriorsModule, weaponsModule);\n\nconst ninja: Ninja = container.get('Ninja');";var d=i(2848);const t={sidebar_position:3,title:"Container Module"},c="ContainerModule",l={},h=[{value:"Constructor",id:"constructor",level:2},{value:"bind",id:"bind",level:3},{value:"unbind",id:"unbind",level:3},{value:"isBound",id:"isbound",level:3},{value:"rebind",id:"rebind",level:3},{value:"unbindAsync",id:"unbindasync",level:3},{value:"onActivation",id:"onactivation",level:3},{value:"onDeactivation",id:"ondeactivation",level:3},{value:"Example: binding services through ContainerModule API",id:"example-binding-services-through-containermodule-api",level:2}];function u(n){const e={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",...(0,r.R)(),...n.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(e.header,{children:(0,o.jsx)(e.h1,{id:"containermodule",children:"ContainerModule"})}),"\n",(0,o.jsx)(e.p,{children:"Container modules can help you to manage the complexity of your bindings in large applications."}),"\n",(0,o.jsx)(e.h2,{id:"constructor",children:"Constructor"}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-ts",children:"constructor(registry: interfaces.ContainerModuleCallBack)\n"})}),"\n",(0,o.jsxs)(e.p,{children:["The constructor argument for ",(0,o.jsx)(e.code,{children:"ContainerModule"})," is a registration callback with function parameters to manage bindings in the scope of the container module."]}),"\n",(0,o.jsx)(e.h3,{id:"bind",children:"bind"}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-ts",children:"bind: interfaces.Bind\n"})}),"\n",(0,o.jsxs)(e.p,{children:["Consider ",(0,o.jsx)(e.a,{href:"/docs/api/container#bind",children:"docs"})," as reference."]}),"\n",(0,o.jsx)(e.h3,{id:"unbind",children:"unbind"}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{children:"unbind: interfaces.Unbind\n"})}),"\n",(0,o.jsxs)(e.p,{children:["Consider ",(0,o.jsx)(e.a,{href:"/docs/api/container#unbind",children:"docs"})," as reference."]}),"\n",(0,o.jsx)(e.h3,{id:"isbound",children:"isBound"}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-ts",children:"isBound: interfaces.IsBound\n"})}),"\n",(0,o.jsxs)(e.p,{children:["Consider ",(0,o.jsx)(e.a,{href:"/docs/api/container#isbound",children:"docs"})," as reference."]}),"\n",(0,o.jsx)(e.h3,{id:"rebind",children:"rebind"}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-ts",children:"rebind: interfaces.Rebind\n"})}),"\n",(0,o.jsxs)(e.p,{children:["Consider ",(0,o.jsx)(e.a,{href:"/docs/api/container#rebind",children:"docs"})," as reference."]}),"\n",(0,o.jsx)(e.h3,{id:"unbindasync",children:"unbindAsync"}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-ts",children:"unbindAsync: interfaces.UnbindAsync\n"})}),"\n",(0,o.jsxs)(e.p,{children:["Consider ",(0,o.jsx)(e.a,{href:"/docs/api/container#unbindasync",children:"docs"})," as reference."]}),"\n",(0,o.jsx)(e.h3,{id:"onactivation",children:"onActivation"}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-ts",children:"onActivation: interfaces.Container['onActivation']\n"})}),"\n",(0,o.jsxs)(e.p,{children:["Consider ",(0,o.jsx)(e.a,{href:"/docs/api/container#onactivation",children:"docs"})," as reference."]}),"\n",(0,o.jsx)(e.h3,{id:"ondeactivation",children:"onDeactivation"}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-ts",children:"onDeactivation: interfaces.Container['onDeactivation']\n"})}),"\n",(0,o.jsxs)(e.p,{children:["Consider ",(0,o.jsx)(e.a,{href:"/docs/api/container#ondeactivation",children:"docs"})," as reference."]}),"\n",(0,o.jsx)(e.h2,{id:"example-binding-services-through-containermodule-api",children:"Example: binding services through ContainerModule API"}),"\n",(0,o.jsx)(e.p,{children:"When a container module is loaded into a Container the registration callback is invoked. This is the opportunity for the container module to register bindings and handlers. Use the Container load method for ContainerModule instances and the Container loadAsync method for AsyncContainerModule instances."}),"\n",(0,o.jsxs)(e.p,{children:["When a container module is unloaded from a Container the bindings added by that container will be removed and the ",(0,o.jsx)(e.a,{href:"https://github.com/inversify/InversifyJS/blob/master/wiki/deactivation_handler.md",children:"deactivation process"})," will occur for each of them. Container deactivation and ",(0,o.jsx)(e.a,{href:"/docs/fundamentals/lifecycle/activation",children:"activation handlers"})," will also be removed.\r\nUse the unloadAsync method to unload when there will be an async deactivation handler or async ",(0,o.jsx)(e.a,{href:"https://github.com/inversify/InversifyJS/blob/master/wiki/pre_destroy.md",children:"pre destroy"})]}),"\n",(0,o.jsx)(d.A,{language:"ts",children:s})]})}function p(n={}){const{wrapper:e}={...(0,r.R)(),...n.components};return e?(0,o.jsx)(e,{...n,children:(0,o.jsx)(u,{...n})}):u(n)}}}]); \ No newline at end of file diff --git a/assets/js/e33fc578.a72ff7e4.js b/assets/js/e33fc578.a72ff7e4.js new file mode 100644 index 00000000..486a52a7 --- /dev/null +++ b/assets/js/e33fc578.a72ff7e4.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_inversifyjs_inversify_docs_site=self.webpackChunk_inversifyjs_inversify_docs_site||[]).push([[630],{7488:(n,e,i)=>{i.r(e),i.d(e,{assets:()=>l,contentTitle:()=>c,default:()=>p,frontMatter:()=>d,metadata:()=>a,toc:()=>h});const a=JSON.parse('{"id":"api/container-module","title":"Container Module","description":"Container modules can help you to manage the complexity of your bindings in large applications.","source":"@site/docs/api/container-module.mdx","sourceDirName":"api","slug":"/api/container-module","permalink":"/monorepo/docs/api/container-module","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":3,"frontMatter":{"sidebar_position":3,"title":"Container Module"},"sidebar":"tutorialSidebar","previous":{"title":"Container","permalink":"/monorepo/docs/api/container"},"next":{"title":"Decorator","permalink":"/monorepo/docs/api/decorator"}}');var o=i(9793),r=i(1425);const s="const warriorsModule: ContainerModule = new ContainerModule(\n (bind: interfaces.Bind) => {\n bind('Ninja').to(Ninja);\n },\n);\n\nconst weaponsModule: ContainerModule = new ContainerModule(\n (\n bind: interfaces.Bind,\n _unbind: interfaces.Unbind,\n _isBound: interfaces.IsBound,\n _rebind: interfaces.Rebind,\n _unbindAsync: interfaces.UnbindAsync,\n _onActivation: interfaces.Container['onActivation'],\n _onDeactivation: interfaces.Container['onDeactivation'],\n ) => {\n bind('Weapon').to(Katana).whenTargetNamed('Melee');\n bind('Weapon').to(Shuriken).whenTargetNamed('Ranged');\n },\n);\n\nconst container: Container = new Container();\ncontainer.load(warriorsModule, weaponsModule);\n\nconst ninja: Ninja = container.get('Ninja');";var t=i(2848);const d={sidebar_position:3,title:"Container Module"},c="ContainerModule",l={},h=[{value:"Constructor",id:"constructor",level:2},{value:"bind",id:"bind",level:3},{value:"unbind",id:"unbind",level:3},{value:"isBound",id:"isbound",level:3},{value:"rebind",id:"rebind",level:3},{value:"unbindAsync",id:"unbindasync",level:3},{value:"onActivation",id:"onactivation",level:3},{value:"onDeactivation",id:"ondeactivation",level:3},{value:"Example: binding services through ContainerModule API",id:"example-binding-services-through-containermodule-api",level:2}];function u(n){const e={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",...(0,r.R)(),...n.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(e.header,{children:(0,o.jsx)(e.h1,{id:"containermodule",children:"ContainerModule"})}),"\n",(0,o.jsx)(e.p,{children:"Container modules can help you to manage the complexity of your bindings in large applications."}),"\n",(0,o.jsx)(e.h2,{id:"constructor",children:"Constructor"}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-ts",children:"constructor(registry: interfaces.ContainerModuleCallBack)\n"})}),"\n",(0,o.jsxs)(e.p,{children:["The constructor argument for ",(0,o.jsx)(e.code,{children:"ContainerModule"})," is a registration callback with function parameters to manage bindings in the scope of the container module."]}),"\n",(0,o.jsx)(e.h3,{id:"bind",children:"bind"}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-ts",children:"bind: interfaces.Bind\n"})}),"\n",(0,o.jsxs)(e.p,{children:["Consider ",(0,o.jsx)(e.a,{href:"/docs/api/container#bind",children:"docs"})," as reference."]}),"\n",(0,o.jsx)(e.h3,{id:"unbind",children:"unbind"}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{children:"unbind: interfaces.Unbind\n"})}),"\n",(0,o.jsxs)(e.p,{children:["Consider ",(0,o.jsx)(e.a,{href:"/docs/api/container#unbind",children:"docs"})," as reference."]}),"\n",(0,o.jsx)(e.h3,{id:"isbound",children:"isBound"}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-ts",children:"isBound: interfaces.IsBound\n"})}),"\n",(0,o.jsxs)(e.p,{children:["Consider ",(0,o.jsx)(e.a,{href:"/docs/api/container#isbound",children:"docs"})," as reference."]}),"\n",(0,o.jsx)(e.h3,{id:"rebind",children:"rebind"}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-ts",children:"rebind: interfaces.Rebind\n"})}),"\n",(0,o.jsxs)(e.p,{children:["Consider ",(0,o.jsx)(e.a,{href:"/docs/api/container#rebind",children:"docs"})," as reference."]}),"\n",(0,o.jsx)(e.h3,{id:"unbindasync",children:"unbindAsync"}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-ts",children:"unbindAsync: interfaces.UnbindAsync\n"})}),"\n",(0,o.jsxs)(e.p,{children:["Consider ",(0,o.jsx)(e.a,{href:"/docs/api/container#unbindasync",children:"docs"})," as reference."]}),"\n",(0,o.jsx)(e.h3,{id:"onactivation",children:"onActivation"}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-ts",children:"onActivation: interfaces.Container['onActivation']\n"})}),"\n",(0,o.jsxs)(e.p,{children:["Consider ",(0,o.jsx)(e.a,{href:"/docs/api/container#onactivation",children:"docs"})," as reference."]}),"\n",(0,o.jsx)(e.h3,{id:"ondeactivation",children:"onDeactivation"}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-ts",children:"onDeactivation: interfaces.Container['onDeactivation']\n"})}),"\n",(0,o.jsxs)(e.p,{children:["Consider ",(0,o.jsx)(e.a,{href:"/docs/api/container#ondeactivation",children:"docs"})," as reference."]}),"\n",(0,o.jsx)(e.h2,{id:"example-binding-services-through-containermodule-api",children:"Example: binding services through ContainerModule API"}),"\n",(0,o.jsx)(e.p,{children:"When a container module is loaded into a Container the registration callback is invoked. This is the opportunity for the container module to register bindings and handlers. Use the Container load method for ContainerModule instances and the Container loadAsync method for AsyncContainerModule instances."}),"\n",(0,o.jsxs)(e.p,{children:["When a container module is unloaded from a Container the bindings added by that container will be removed and the ",(0,o.jsx)(e.a,{href:"https://github.com/inversify/InversifyJS/blob/master/wiki/deactivation_handler.md",children:"deactivation process"})," will occur for each of them. Container deactivation and ",(0,o.jsx)(e.a,{href:"/docs/fundamentals/lifecycle/activation",children:"activation handlers"})," will also be removed.\r\nUse the unloadAsync method to unload when there will be an async deactivation handler or async ",(0,o.jsx)(e.a,{href:"https://github.com/inversify/InversifyJS/blob/master/wiki/pre_destroy.md",children:"pre destroy"})]}),"\n",(0,o.jsx)(t.A,{language:"ts",children:s})]})}function p(n={}){const{wrapper:e}={...(0,r.R)(),...n.components};return e?(0,o.jsx)(e,{...n,children:(0,o.jsx)(u,{...n})}):u(n)}}}]); \ No newline at end of file diff --git a/assets/js/f9dfc0ac.59b9f013.js b/assets/js/f9dfc0ac.59b9f013.js new file mode 100644 index 00000000..c7494f57 --- /dev/null +++ b/assets/js/f9dfc0ac.59b9f013.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_inversifyjs_inversify_docs_site=self.webpackChunk_inversifyjs_inversify_docs_site||[]).push([[999],{5554:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"tutorialSidebar":[{"type":"category","label":"Introduction","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Getting started","href":"/monorepo/docs/introduction/getting-started","docId":"introduction/getting-started","unlisted":false},{"type":"link","label":"Dependency inversion","href":"/monorepo/docs/introduction/dependency-inversion","docId":"introduction/dependency-inversion","unlisted":false}]},{"type":"category","label":"Fundamentals","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Binding","href":"/monorepo/docs/fundamentals/binding","docId":"fundamentals/binding","unlisted":false},{"type":"category","label":"Lifecycle","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Activation","href":"/monorepo/docs/fundamentals/lifecycle/activation","docId":"fundamentals/lifecycle/activation","unlisted":false},{"type":"link","label":"Deactivation","href":"/monorepo/docs/fundamentals/lifecycle/deactivation","docId":"fundamentals/lifecycle/deactivation","unlisted":false}]}]},{"type":"category","label":"API","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Binding Syntax","href":"/monorepo/docs/api/binding-syntax","docId":"api/binding-syntax","unlisted":false},{"type":"link","label":"Container","href":"/monorepo/docs/api/container","docId":"api/container","unlisted":false},{"type":"link","label":"Container Module","href":"/monorepo/docs/api/container-module","docId":"api/container-module","unlisted":false},{"type":"link","label":"Decorator","href":"/monorepo/docs/api/decorator","docId":"api/decorator","unlisted":false}]}]},"docs":{"api/binding-syntax":{"id":"api/binding-syntax","title":"Binding Syntax","description":"Binding syntax is provided as a fluent interface provided as the result of using the container API or the container module API","sidebar":"tutorialSidebar"},"api/container":{"id":"api/container","title":"Container","description":"The InversifyJS container is where dependencies are first configured through bind and, possibly later, reconfigured and removed. The container can be worked on directly in this regard or container modules can be utilized.","sidebar":"tutorialSidebar"},"api/container-module":{"id":"api/container-module","title":"Container Module","description":"Container modules can help you to manage the complexity of your bindings in large applications.","sidebar":"tutorialSidebar"},"api/decorator":{"id":"api/decorator","title":"Decorator","description":"This section covers inversify decorators used to provide class metadata.","sidebar":"tutorialSidebar"},"fundamentals/binding":{"id":"fundamentals/binding","title":"Binding","description":"A binding represents a relation between a service identifier and a service resolution. Bindings are added to a container in order to configure it to provide services.","sidebar":"tutorialSidebar"},"fundamentals/lifecycle/activation":{"id":"fundamentals/lifecycle/activation","title":"Activation","description":"Whenever a service is resolved, the activation event is dispatched. An activation handler receives a context and a resolved value and returns the handled resolved value.","sidebar":"tutorialSidebar"},"fundamentals/lifecycle/deactivation":{"id":"fundamentals/lifecycle/deactivation","title":"Deactivation","description":"Whenever a service is unbound, the deactivation event is dispatched. A deactivation handler receives a resolved value and returns nothing.","sidebar":"tutorialSidebar"},"introduction/dependency-inversion":{"id":"introduction/dependency-inversion","title":"Dependency inversion","description":"In order to apply the dependency inversion principle, we can rely on injection symbols:","sidebar":"tutorialSidebar"},"introduction/getting-started":{"id":"introduction/getting-started","title":"Getting started","description":"Start by installing inversify:","sidebar":"tutorialSidebar"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/f9dfc0ac.8cd6096d.js b/assets/js/f9dfc0ac.8cd6096d.js deleted file mode 100644 index d1011882..00000000 --- a/assets/js/f9dfc0ac.8cd6096d.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_inversifyjs_inversify_docs_site=self.webpackChunk_inversifyjs_inversify_docs_site||[]).push([[999],{5554:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"tutorialSidebar":[{"type":"category","label":"Introduction","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Getting started","href":"/monorepo/docs/introduction/getting-started","docId":"introduction/getting-started","unlisted":false},{"type":"link","label":"Dependency inversion","href":"/monorepo/docs/introduction/dependency-inversion","docId":"introduction/dependency-inversion","unlisted":false}]},{"type":"category","label":"Fundamentals","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Binding","href":"/monorepo/docs/fundamentals/binding","docId":"fundamentals/binding","unlisted":false},{"type":"category","label":"Lifecycle","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Activation","href":"/monorepo/docs/fundamentals/lifecycle/activation","docId":"fundamentals/lifecycle/activation","unlisted":false},{"type":"link","label":"Deactivation","href":"/monorepo/docs/fundamentals/lifecycle/deactivation","docId":"fundamentals/lifecycle/deactivation","unlisted":false}]}]},{"type":"category","label":"API","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Container","href":"/monorepo/docs/api/container","docId":"api/container","unlisted":false},{"type":"link","label":"Binding Syntax","href":"/monorepo/docs/api/binding-syntax","docId":"api/binding-syntax","unlisted":false},{"type":"link","label":"Container Module","href":"/monorepo/docs/api/container-module","docId":"api/container-module","unlisted":false}]}]},"docs":{"api/binding-syntax":{"id":"api/binding-syntax","title":"Binding Syntax","description":"Binding syntax is provided as a fluent interface provided as the result of using the container API or the container module API","sidebar":"tutorialSidebar"},"api/container":{"id":"api/container","title":"Container","description":"The InversifyJS container is where dependencies are first configured through bind and, possibly later, reconfigured and removed. The container can be worked on directly in this regard or container modules can be utilized.","sidebar":"tutorialSidebar"},"api/container-module":{"id":"api/container-module","title":"Container Module","description":"Container modules can help you to manage the complexity of your bindings in large applications.","sidebar":"tutorialSidebar"},"fundamentals/binding":{"id":"fundamentals/binding","title":"Binding","description":"A binding represents a relation between a service identifier and a service resolution. Bindings are added to a container in order to configure it to provide services.","sidebar":"tutorialSidebar"},"fundamentals/lifecycle/activation":{"id":"fundamentals/lifecycle/activation","title":"Activation","description":"Whenever a service is resolved, the activation event is dispatched. An activation handler receives a context and a resolved value and returns the handled resolved value.","sidebar":"tutorialSidebar"},"fundamentals/lifecycle/deactivation":{"id":"fundamentals/lifecycle/deactivation","title":"Deactivation","description":"Whenever a service is unbound, the deactivation event is dispatched. A deactivation handler receives a resolved value and returns nothing.","sidebar":"tutorialSidebar"},"introduction/dependency-inversion":{"id":"introduction/dependency-inversion","title":"Dependency inversion","description":"In order to apply the dependency inversion principle, we can rely on injection symbols:","sidebar":"tutorialSidebar"},"introduction/getting-started":{"id":"introduction/getting-started","title":"Getting started","description":"Start by installing inversify:","sidebar":"tutorialSidebar"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/main.056c0904.js b/assets/js/main.056c0904.js new file mode 100644 index 00000000..20cd6f67 --- /dev/null +++ b/assets/js/main.056c0904.js @@ -0,0 +1,2 @@ +/*! For license information please see main.056c0904.js.LICENSE.txt */ +(self.webpackChunk_inversifyjs_inversify_docs_site=self.webpackChunk_inversifyjs_inversify_docs_site||[]).push([[792],{9914:(e,t,n)=>{"use strict";n.d(t,{Bc:()=>A,E8:()=>Jn,a1:()=>Yn});var r=n(2581);n(162);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:I(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function b(e,t){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},b(e,t)}function w(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){u=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw o}}return l}}(e,t)||k(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||k(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(e,t){if(e){if("string"==typeof e)return o(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}function x(e){var t="function"==typeof Map?new Map:void 0;return x=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(m())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&b(o,n.prototype),o}(e,arguments,d(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),b(n,e)},x(e)}function E(){return r.createElement("svg",{width:"15",height:"15",className:"DocSearch-Control-Key-Icon"},r.createElement("path",{d:"M4.505 4.496h2M5.505 5.496v5M8.216 4.496l.055 5.993M10 7.5c.333.333.5.667.5 1v2M12.326 4.5v5.996M8.384 4.496c1.674 0 2.116 0 2.116 1.5s-.442 1.5-2.116 1.5M3.205 9.303c-.09.448-.277 1.21-1.241 1.203C1 10.5.5 9.513.5 8V7c0-1.57.5-2.5 1.464-2.494.964.006 1.134.598 1.24 1.342M12.553 10.5h1.953",strokeWidth:"1.2",stroke:"currentColor",fill:"none",strokeLinecap:"square"}))}function _(){return r.createElement("svg",{width:"20",height:"20",className:"DocSearch-Search-Icon",viewBox:"0 0 20 20","aria-hidden":"true"},r.createElement("path",{d:"M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}var O=["translations"],j="Ctrl",A=r.forwardRef((function(e,t){var n=e.translations,o=void 0===n?{}:n,a=v(e,O),i=o.buttonText,l=void 0===i?"Search":i,s=o.buttonAriaLabel,u=void 0===s?"Search":s,c=w((0,r.useState)(null),2),d=c[0],p=c[1];(0,r.useEffect)((function(){"undefined"!=typeof navigator&&(/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)?p("\u2318"):p(j))}),[]);var m=w(d===j?[j,"Ctrl",r.createElement(E,null)]:["Meta","Command",d],3),h=m[0],g=m[1],y=m[2];return r.createElement("button",f({type:"button",className:"DocSearch DocSearch-Button","aria-label":"".concat(u," (").concat(g,"+K)")},a,{ref:t}),r.createElement("span",{className:"DocSearch-Button-Container"},r.createElement(_,null),r.createElement("span",{className:"DocSearch-Button-Placeholder"},l)),r.createElement("span",{className:"DocSearch-Button-Keys"},null!==d&&r.createElement(r.Fragment,null,r.createElement(C,{reactsToKey:h},y),r.createElement(C,{reactsToKey:"k"},"K"))))}));function C(e){var t=e.reactsToKey,n=e.children,o=w((0,r.useState)(!1),2),a=o[0],i=o[1];return(0,r.useEffect)((function(){if(t)return window.addEventListener("keydown",e),window.addEventListener("keyup",n),function(){window.removeEventListener("keydown",e),window.removeEventListener("keyup",n)};function e(e){e.key===t&&i(!0)}function n(e){e.key!==t&&"Meta"!==e.key||i(!1)}}),[t]),r.createElement("kbd",{className:a?"DocSearch-Button-Key DocSearch-Button-Key--pressed":"DocSearch-Button-Key"},n)}function T(e,t){var n=void 0;return function(){for(var r=arguments.length,o=new Array(r),a=0;ae.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function G(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function W(e){for(var t=1;t=3||2===n&&r>=4||1===n&&r>=10);function a(t,n,r){if(o&&void 0!==r){var a=r[0].__autocomplete_algoliaCredentials,i={"X-Algolia-Application-Id":a.appId,"X-Algolia-API-Key":a.apiKey};e.apply(void 0,[t].concat(H(n),[{headers:i}]))}else e.apply(void 0,[t].concat(H(n)))}return{init:function(t,n){e("init",{appId:t,apiKey:n})},setAuthenticatedUserToken:function(t){e("setAuthenticatedUserToken",t)},setUserToken:function(t){e("setUserToken",t)},clickedObjectIDsAfterSearch:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&a("clickedObjectIDsAfterSearch",Q(t),t[0].items)},clickedObjectIDs:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&a("clickedObjectIDs",Q(t),t[0].items)},clickedFilters:function(){for(var t=arguments.length,n=new Array(t),r=0;r0&&e.apply(void 0,["clickedFilters"].concat(n))},convertedObjectIDsAfterSearch:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&a("convertedObjectIDsAfterSearch",Q(t),t[0].items)},convertedObjectIDs:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&a("convertedObjectIDs",Q(t),t[0].items)},convertedFilters:function(){for(var t=arguments.length,n=new Array(t),r=0;r0&&e.apply(void 0,["convertedFilters"].concat(n))},viewedObjectIDs:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&t.reduce((function(e,t){var n=t.items,r=V(t,U);return[].concat(H(e),H(function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,n=[],r=0;r0&&e.apply(void 0,["viewedFilters"].concat(n))}}}function J(e){var t=e.items.reduce((function(e,t){var n;return e[t.__autocomplete_indexName]=(null!==(n=e[t.__autocomplete_indexName])&&void 0!==n?n:[]).concat(t),e}),{});return Object.keys(t).map((function(e){return{index:e,items:t[e],algoliaSource:["autocomplete"]}}))}function Z(e){return e.objectID&&e.__autocomplete_indexName&&e.__autocomplete_queryID}function X(e){return X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},X(e)}function ee(e){return function(e){if(Array.isArray(e))return te(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return te(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?te(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function te(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&le({onItemsChange:o,items:n,insights:u,state:t}))}}),0);return{name:"aa.algoliaInsightsPlugin",subscribe:function(e){var t=e.setContext,n=e.onSelect,r=e.onActive,o=!1;function c(e){t({algoliaInsightsPlugin:{__algoliaSearchParameters:re(re({},l?{clickAnalytics:!0}:{}),e?{userToken:ce(e)}:{}),insights:u}})}s("addAlgoliaAgent","insights-plugin"),c(),s("onUserTokenChange",(function(e){o||c(e)})),s("getUserToken",null,(function(e,t){o||c(t)})),s("onAuthenticatedUserTokenChange",(function(e){e?(o=!0,c(e)):(o=!1,s("getUserToken",null,(function(e,t){return c(t)})))})),s("getAuthenticatedUserToken",null,(function(e,t){t&&(o=!0,c(t))})),n((function(e){var t=e.item,n=e.state,r=e.event,o=e.source;Z(t)&&a({state:n,event:r,insights:u,item:t,insightsEvents:[re({eventName:"Item Selected"},F({item:t,items:o.getItems().filter(Z)}))]})})),r((function(e){var t=e.item,n=e.source,r=e.state,o=e.event;Z(t)&&i({state:r,event:o,insights:u,item:t,insightsEvents:[re({eventName:"Item Active"},F({item:t,items:n.getItems().filter(Z)}))]})}))},onStateChange:function(e){var t=e.state;f({state:t})},__autocomplete_pluginOptions:e}}function ue(){var e,t=arguments.length>1?arguments[1]:void 0;return[].concat(ee(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]),["autocomplete-internal"],ee(null!==(e=t.algoliaInsightsPlugin)&&void 0!==e&&e.__automaticInsights?["autocomplete-automatic"]:[]))}function ce(e){return"number"==typeof e?e.toString():e}function fe(e,t){var n=t;return{then:function(t,r){return fe(e.then(pe(t,n,e),pe(r,n,e)),n)},catch:function(t){return fe(e.catch(pe(t,n,e)),n)},finally:function(t){return t&&n.onCancelList.push(t),fe(e.finally(pe(t&&function(){return n.onCancelList=[],t()},n,e)),n)},cancel:function(){n.isCanceled=!0;var e=n.onCancelList;n.onCancelList=[],e.forEach((function(e){e()}))},isCanceled:function(){return!0===n.isCanceled}}}function de(e){return fe(e,{isCanceled:!1,onCancelList:[]})}function pe(e,t,n){return e?function(n){return t.isCanceled?n:e(n)}:n}function me(e,t,n,r){if(!n)return null;if(e<0&&(null===t||null!==r&&0===t))return n+e;var o=(null===t?-1:t)+e;return o<=-1||o>=n?null===r?null:0:o}function he(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ge(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0},reshape:function(e){return e.sources}},e),{},{id:null!==(n=e.id)&&void 0!==n?n:"autocomplete-".concat(I++),plugins:o,initialState:Ne({activeItemId:null,query:"",completion:null,collections:[],isOpen:!1,status:"idle",context:{}},e.initialState),onStateChange:function(t){var n;null===(n=e.onStateChange)||void 0===n||n.call(e,t),o.forEach((function(e){var n;return null===(n=e.onStateChange)||void 0===n?void 0:n.call(e,t)}))},onSubmit:function(t){var n;null===(n=e.onSubmit)||void 0===n||n.call(e,t),o.forEach((function(e){var n;return null===(n=e.onSubmit)||void 0===n?void 0:n.call(e,t)}))},onReset:function(t){var n;null===(n=e.onReset)||void 0===n||n.call(e,t),o.forEach((function(e){var n;return null===(n=e.onReset)||void 0===n?void 0:n.call(e,t)}))},getSources:function(n){return Promise.all([].concat(function(e){return function(e){if(Array.isArray(e))return Pe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Pe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pe(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(o.map((function(e){return e.getSources}))),[e.getSources]).filter(Boolean).map((function(e){return function(e,t){var n=[];return Promise.resolve(e(t)).then((function(e){return Promise.all(e.filter((function(e){return Boolean(e)})).map((function(e){if(e.sourceId,n.includes(e.sourceId))throw new Error("[Autocomplete] The `sourceId` ".concat(JSON.stringify(e.sourceId)," is not unique."));n.push(e.sourceId);var t={getItemInputValue:function(e){return e.state.query},getItemUrl:function(){},onSelect:function(e){(0,e.setIsOpen)(!1)},onActive:L,onResolve:L};Object.keys(t).forEach((function(e){t[e].__default=!0}));var r=ge(ge({},t),e);return Promise.resolve(r)})))}))}(e,n)}))).then((function(e){return P(e)})).then((function(e){return e.map((function(e){return Ne(Ne({},e),{},{onSelect:function(n){e.onSelect(n),t.forEach((function(e){var t;return null===(t=e.onSelect)||void 0===t?void 0:t.call(e,n)}))},onActive:function(n){e.onActive(n),t.forEach((function(e){var t;return null===(t=e.onActive)||void 0===t?void 0:t.call(e,n)}))},onResolve:function(n){e.onResolve(n),t.forEach((function(e){var t;return null===(t=e.onResolve)||void 0===t?void 0:t.call(e,n)}))}})}))}))},navigator:Ne({navigate:function(e){var t=e.itemUrl;r.location.assign(t)},navigateNewTab:function(e){var t=e.itemUrl,n=r.open(t,"_blank","noopener");null==n||n.focus()},navigateNewWindow:function(e){var t=e.itemUrl;r.open(t,"_blank","noopener")}},e.navigator)})}function Le(e){return Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Le(e)}function Me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fe(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Qe);nt&&o.environment.clearTimeout(nt);var u=s.setCollections,c=s.setIsOpen,f=s.setQuery,d=s.setActiveItemId,p=s.setStatus,m=s.setContext;if(f(a),d(o.defaultActiveItemId),!a&&!1===o.openOnFocus){var h,g=l.getState().collections.map((function(e){return Je(Je({},e),{},{items:[]})}));p("idle"),u(g),c(null!==(h=r.isOpen)&&void 0!==h?h:o.shouldPanelOpen({state:l.getState()}));var v=de(rt(g).then((function(){return Promise.resolve()})));return l.pendingRequests.add(v)}p("loading"),nt=o.environment.setTimeout((function(){p("stalled")}),o.stallThreshold);var y=de(rt(o.getSources(Je({query:a,refresh:i,state:l.getState()},s)).then((function(e){return Promise.all(e.map((function(e){return Promise.resolve(e.getItems(Je({query:a,refresh:i,state:l.getState()},s))).then((function(t){return function(e,t,n){if(o=e,Boolean(null==o?void 0:o.execute)){var r="algolia"===e.requesterId?Object.assign.apply(Object,[{}].concat($e(Object.keys(n.context).map((function(e){var t;return null===(t=n.context[e])||void 0===t?void 0:t.__algoliaSearchParameters}))))):{};return qe(qe({},e),{},{requests:e.queries.map((function(n){return{query:"algolia"===e.requesterId?qe(qe({},n),{},{params:qe(qe({},r),n.params)}):n,sourceId:t,transformResponse:e.transformResponse}}))})}var o;return{items:e,sourceId:t}}(t,e.sourceId,l.getState())}))}))).then(We).then((function(t){var n,r=t.some((function(e){return function(e){return!Array.isArray(e)&&Boolean(null==e?void 0:e._automaticInsights)}(e.items)}));return r&&m({algoliaInsightsPlugin:Je(Je({},(null===(n=l.getState().context)||void 0===n?void 0:n.algoliaInsightsPlugin)||{}),{},{__automaticInsights:r})}),function(e,t,n){return t.map((function(t){var r,o=e.filter((function(e){return e.sourceId===t.sourceId})),a=o.map((function(e){return e.items})),i=o[0].transformResponse,l=i?i({results:r=a,hits:r.map((function(e){return e.hits})).filter(Boolean),facetHits:r.map((function(e){var t;return null===(t=e.facetHits)||void 0===t?void 0:t.map((function(e){return{label:e.value,count:e.count,_highlightResult:{label:{value:e.highlighted}}}}))})).filter(Boolean)}):a;return t.onResolve({source:t,results:a,items:l,state:n.getState()}),l.every(Boolean),'The `getItems` function from source "'.concat(t.sourceId,'" must return an array of items but returned ').concat(JSON.stringify(void 0),".\n\nDid you forget to return items?\n\nSee: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/#param-getitems"),{source:t,items:l}}))}(t,e,l)})).then((function(e){return function(e){var t=e.props,n=e.state,r=e.collections.reduce((function(e,t){return Fe(Fe({},e),{},Be({},t.source.sourceId,Fe(Fe({},t.source),{},{getItems:function(){return P(t.items)}})))}),{}),o=t.plugins.reduce((function(e,t){return t.reshape?t.reshape(e):e}),{sourcesBySourceId:r,state:n}).sourcesBySourceId;return P(t.reshape({sourcesBySourceId:o,sources:Object.values(o),state:n})).filter(Boolean).map((function(e){return{source:e,items:e.getItems()}}))}({collections:e,props:o,state:l.getState()})}))})))).then((function(e){var n;p("idle"),u(e);var f=o.shouldPanelOpen({state:l.getState()});c(null!==(n=r.isOpen)&&void 0!==n?n:o.openOnFocus&&!a&&f||f);var d=be(l.getState());if(null!==l.getState().activeItemId&&d){var m=d.item,h=d.itemInputValue,g=d.itemUrl,v=d.source;v.onActive(Je({event:t,item:m,itemInputValue:h,itemUrl:g,refresh:i,source:v,state:l.getState()},s))}})).finally((function(){p("idle"),nt&&o.environment.clearTimeout(nt)}));return l.pendingRequests.add(y)}function at(e){return at="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},at(e)}var it=["event","props","refresh","store"];function lt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function st(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function St(e){var t=e.props,n=e.refresh,r=e.store,o=wt(e,ft);return{getEnvironmentProps:function(e){var n=e.inputElement,o=e.formElement,a=e.panelElement;function i(e){!r.getState().isOpen&&r.pendingRequests.isEmpty()||e.target===n||!1===[o,a].some((function(t){return(n=t)===(r=e.target)||n.contains(r);var n,r}))&&(r.dispatch("blur",null),t.debug||r.pendingRequests.cancelAll())}return yt({onTouchStart:i,onMouseDown:i,onTouchMove:function(e){!1!==r.getState().isOpen&&n===t.environment.document.activeElement&&e.target!==n&&n.blur()}},wt(e,dt))},getRootProps:function(e){return yt({role:"combobox","aria-expanded":r.getState().isOpen,"aria-haspopup":"listbox","aria-controls":r.getState().isOpen?r.getState().collections.map((function(e){var n=e.source;return we(t.id,"list",n)})).join(" "):void 0,"aria-labelledby":we(t.id,"label")},e)},getFormProps:function(e){return e.inputElement,yt({action:"",noValidate:!0,role:"search",onSubmit:function(a){var i;a.preventDefault(),t.onSubmit(yt({event:a,refresh:n,state:r.getState()},o)),r.dispatch("submit",null),null===(i=e.inputElement)||void 0===i||i.blur()},onReset:function(a){var i;a.preventDefault(),t.onReset(yt({event:a,refresh:n,state:r.getState()},o)),r.dispatch("reset",null),null===(i=e.inputElement)||void 0===i||i.focus()}},wt(e,pt))},getLabelProps:function(e){return yt({htmlFor:we(t.id,"input"),id:we(t.id,"label")},e)},getInputProps:function(e){var a;function i(e){(t.openOnFocus||Boolean(r.getState().query))&&ot(yt({event:e,props:t,query:r.getState().completion||r.getState().query,refresh:n,store:r},o)),r.dispatch("focus",null)}var l=e||{};l.inputElement;var s=l.maxLength,u=void 0===s?512:s,c=wt(l,mt),f=be(r.getState()),d=function(e){return Boolean(e&&e.match(Se))}((null===(a=t.environment.navigator)||void 0===a?void 0:a.userAgent)||""),p=t.enterKeyHint||(null!=f&&f.itemUrl&&!d?"go":"search");return yt({"aria-autocomplete":"both","aria-activedescendant":r.getState().isOpen&&null!==r.getState().activeItemId?we(t.id,"item-".concat(r.getState().activeItemId),null==f?void 0:f.source):void 0,"aria-controls":r.getState().isOpen?r.getState().collections.map((function(e){var n=e.source;return we(t.id,"list",n)})).join(" "):void 0,"aria-labelledby":we(t.id,"label"),value:r.getState().completion||r.getState().query,id:we(t.id,"input"),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",enterKeyHint:p,spellCheck:"false",autoFocus:t.autoFocus,placeholder:t.placeholder,maxLength:u,type:"search",onChange:function(e){var a=e.currentTarget.value;t.ignoreCompositionEvents&&ke(e).isComposing?o.setQuery(a):ot(yt({event:e,props:t,query:a.slice(0,u),refresh:n,store:r},o))},onCompositionEnd:function(e){ot(yt({event:e,props:t,query:e.currentTarget.value.slice(0,u),refresh:n,store:r},o))},onKeyDown:function(e){ke(e).isComposing||function(e){var t=e.event,n=e.props,r=e.refresh,o=e.store,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,it);if("ArrowUp"===t.key||"ArrowDown"===t.key){var i=function(){var e=be(o.getState()),t=n.environment.document.getElementById(we(n.id,"item-".concat(o.getState().activeItemId),null==e?void 0:e.source));t&&(t.scrollIntoViewIfNeeded?t.scrollIntoViewIfNeeded(!1):t.scrollIntoView(!1))},l=function(){var e=be(o.getState());if(null!==o.getState().activeItemId&&e){var n=e.item,i=e.itemInputValue,l=e.itemUrl,s=e.source;s.onActive(st({event:t,item:n,itemInputValue:i,itemUrl:l,refresh:r,source:s,state:o.getState()},a))}};t.preventDefault(),!1===o.getState().isOpen&&(n.openOnFocus||Boolean(o.getState().query))?ot(st({event:t,props:n,query:o.getState().query,refresh:r,store:o},a)).then((function(){o.dispatch(t.key,{nextActiveItemId:n.defaultActiveItemId}),l(),setTimeout(i,0)})):(o.dispatch(t.key,{}),l(),i())}else if("Escape"===t.key)t.preventDefault(),o.dispatch(t.key,null),o.pendingRequests.cancelAll();else if("Tab"===t.key)o.dispatch("blur",null),o.pendingRequests.cancelAll();else if("Enter"===t.key){if(null===o.getState().activeItemId||o.getState().collections.every((function(e){return 0===e.items.length})))return void(n.debug||o.pendingRequests.cancelAll());t.preventDefault();var s=be(o.getState()),u=s.item,c=s.itemInputValue,f=s.itemUrl,d=s.source;if(t.metaKey||t.ctrlKey)void 0!==f&&(d.onSelect(st({event:t,item:u,itemInputValue:c,itemUrl:f,refresh:r,source:d,state:o.getState()},a)),n.navigator.navigateNewTab({itemUrl:f,item:u,state:o.getState()}));else if(t.shiftKey)void 0!==f&&(d.onSelect(st({event:t,item:u,itemInputValue:c,itemUrl:f,refresh:r,source:d,state:o.getState()},a)),n.navigator.navigateNewWindow({itemUrl:f,item:u,state:o.getState()}));else if(t.altKey);else{if(void 0!==f)return d.onSelect(st({event:t,item:u,itemInputValue:c,itemUrl:f,refresh:r,source:d,state:o.getState()},a)),void n.navigator.navigate({itemUrl:f,item:u,state:o.getState()});ot(st({event:t,nextState:{isOpen:!1},props:n,query:c,refresh:r,store:o},a)).then((function(){d.onSelect(st({event:t,item:u,itemInputValue:c,itemUrl:f,refresh:r,source:d,state:o.getState()},a))}))}}}(yt({event:e,props:t,refresh:n,store:r},o))},onFocus:i,onBlur:L,onClick:function(n){e.inputElement!==t.environment.document.activeElement||r.getState().isOpen||i(n)}},c)},getPanelProps:function(e){return yt({onMouseDown:function(e){e.preventDefault()},onMouseLeave:function(){r.dispatch("mouseleave",null)}},e)},getListProps:function(e){var n=e||{},r=n.source,o=wt(n,ht);return yt({role:"listbox","aria-labelledby":we(t.id,"label"),id:we(t.id,"list",r)},o)},getItemProps:function(e){var a=e.item,i=e.source,l=wt(e,gt);return yt({id:we(t.id,"item-".concat(a.__autocomplete_id),i),role:"option","aria-selected":r.getState().activeItemId===a.__autocomplete_id,onMouseMove:function(e){if(a.__autocomplete_id!==r.getState().activeItemId){r.dispatch("mousemove",a.__autocomplete_id);var t=be(r.getState());if(null!==r.getState().activeItemId&&t){var i=t.item,l=t.itemInputValue,s=t.itemUrl,u=t.source;u.onActive(yt({event:e,item:i,itemInputValue:l,itemUrl:s,refresh:n,source:u,state:r.getState()},o))}}},onMouseDown:function(e){e.preventDefault()},onClick:function(e){var l=i.getItemInputValue({item:a,state:r.getState()}),s=i.getItemUrl({item:a,state:r.getState()});(s?Promise.resolve():ot(yt({event:e,nextState:{isOpen:!1},props:t,query:l,refresh:n,store:r},o))).then((function(){i.onSelect(yt({event:e,item:a,itemInputValue:l,itemUrl:s,refresh:n,source:i,state:r.getState()},o))}))}},l)}}}function kt(e){return kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kt(e)}function xt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Et(e){for(var t=1;t0&&r.createElement("div",{className:"DocSearch-NoResults-Prefill-List"},r.createElement("p",{className:"DocSearch-Help"},s,":"),r.createElement("ul",null,p.slice(0,3).reduce((function(e,t){return[].concat(S(e),[r.createElement("li",{key:t},r.createElement("button",{className:"DocSearch-Prefill",key:t,type:"button",onClick:function(){o.setQuery(t.toLowerCase()+" "),o.refresh(),o.inputRef.current.focus()}},t))])}),[]))),o.getMissingResultsUrl&&r.createElement("p",{className:"DocSearch-Help"},"".concat(c," "),r.createElement("a",{href:o.getMissingResultsUrl({query:o.state.query}),target:"_blank",rel:"noopener noreferrer"},d)))}var nn=["hit","attribute","tagName"];function rn(e,t){return t.split(".").reduce((function(e,t){return null!=e&&e[t]?e[t]:null}),e)}function on(e){var t=e.hit,n=e.attribute,o=e.tagName,a=void 0===o?"span":o,i=v(e,nn);return(0,r.createElement)(a,g(g({},i),{},{dangerouslySetInnerHTML:{__html:rn(t,"_snippetResult.".concat(n,".value"))||rn(t,n)}}))}function an(e){return e.collection&&0!==e.collection.items.length?r.createElement("section",{className:"DocSearch-Hits"},r.createElement("div",{className:"DocSearch-Hit-source"},e.title),r.createElement("ul",e.getListProps(),e.collection.items.map((function(t,n){return r.createElement(ln,f({key:[e.title,t.objectID].join(":"),item:t,index:n},e))})))):null}function ln(e){var t=e.item,n=e.index,o=e.renderIcon,a=e.renderAction,i=e.getItemProps,l=e.onItemClick,s=e.collection,u=e.hitComponent,c=w(r.useState(!1),2),d=c[0],p=c[1],m=w(r.useState(!1),2),h=m[0],g=m[1],v=r.useRef(null),y=u;return r.createElement("li",f({className:["DocSearch-Hit",t.__docsearch_parent&&"DocSearch-Hit--Child",d&&"DocSearch-Hit--deleting",h&&"DocSearch-Hit--favoriting"].filter(Boolean).join(" "),onTransitionEnd:function(){v.current&&v.current()}},i({item:t,source:s.source,onClick:function(e){l(t,e)}})),r.createElement(y,{hit:t},r.createElement("div",{className:"DocSearch-Hit-Container"},o({item:t,index:n}),t.hierarchy[t.type]&&"lvl1"===t.type&&r.createElement("div",{className:"DocSearch-Hit-content-wrapper"},r.createElement(on,{className:"DocSearch-Hit-title",hit:t,attribute:"hierarchy.lvl1"}),t.content&&r.createElement(on,{className:"DocSearch-Hit-path",hit:t,attribute:"content"})),t.hierarchy[t.type]&&("lvl2"===t.type||"lvl3"===t.type||"lvl4"===t.type||"lvl5"===t.type||"lvl6"===t.type)&&r.createElement("div",{className:"DocSearch-Hit-content-wrapper"},r.createElement(on,{className:"DocSearch-Hit-title",hit:t,attribute:"hierarchy.".concat(t.type)}),r.createElement(on,{className:"DocSearch-Hit-path",hit:t,attribute:"hierarchy.lvl1"})),"content"===t.type&&r.createElement("div",{className:"DocSearch-Hit-content-wrapper"},r.createElement(on,{className:"DocSearch-Hit-title",hit:t,attribute:"content"}),r.createElement(on,{className:"DocSearch-Hit-path",hit:t,attribute:"hierarchy.lvl1"})),a({item:t,runDeleteTransition:function(e){p(!0),v.current=e},runFavoriteTransition:function(e){g(!0),v.current=e}}))))}function sn(e,t,n){return e.reduce((function(e,r){var o=t(r);return e.hasOwnProperty(o)||(e[o]=[]),e[o].length<(n||5)&&e[o].push(r),e}),{})}function un(e){return e}function cn(e){return 1===e.button||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}function fn(){}var dn=/(|<\/mark>)/g,pn=RegExp(dn.source);function mn(e){var t,n,r=e;if(!r.__docsearch_parent&&!e._highlightResult)return e.hierarchy.lvl0;var o=r.__docsearch_parent?null===(t=r.__docsearch_parent)||void 0===t||null===(t=t._highlightResult)||void 0===t||null===(t=t.hierarchy)||void 0===t?void 0:t.lvl0:null===(n=e._highlightResult)||void 0===n||null===(n=n.hierarchy)||void 0===n?void 0:n.lvl0;return o?o.value&&pn.test(o.value)?o.value.replace(dn,""):o.value:e.hierarchy.lvl0}function hn(e){return r.createElement("div",{className:"DocSearch-Dropdown-Container"},e.state.collections.map((function(t){if(0===t.items.length)return null;var n=mn(t.items[0]);return r.createElement(an,f({},e,{key:t.source.sourceId,title:n,collection:t,renderIcon:function(e){var n,o=e.item,a=e.index;return r.createElement(r.Fragment,null,o.__docsearch_parent&&r.createElement("svg",{className:"DocSearch-Hit-Tree",viewBox:"0 0 24 54"},r.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},o.__docsearch_parent!==(null===(n=t.items[a+1])||void 0===n?void 0:n.__docsearch_parent)?r.createElement("path",{d:"M8 6v21M20 27H8.3"}):r.createElement("path",{d:"M8 6v42M20 27H8.3"}))),r.createElement("div",{className:"DocSearch-Hit-icon"},r.createElement(Wt,{type:o.type})))},renderAction:function(){return r.createElement("div",{className:"DocSearch-Hit-action"},r.createElement(Vt,null))}}))})),e.resultsFooterComponent&&r.createElement("section",{className:"DocSearch-HitsFooter"},r.createElement(e.resultsFooterComponent,{state:e.state})))}var gn=["translations"];function vn(e){var t=e.translations,n=void 0===t?{}:t,o=v(e,gn),a=n.recentSearchesTitle,i=void 0===a?"Recent":a,l=n.noRecentSearchesText,s=void 0===l?"No recent searches":l,u=n.saveRecentSearchButtonTitle,c=void 0===u?"Save this search":u,d=n.removeRecentSearchButtonTitle,p=void 0===d?"Remove this search from history":d,m=n.favoriteSearchesTitle,h=void 0===m?"Favorite":m,g=n.removeFavoriteSearchButtonTitle,y=void 0===g?"Remove this search from favorites":g;return"idle"===o.state.status&&!1===o.hasCollections?o.disableUserPersonalization?null:r.createElement("div",{className:"DocSearch-StartScreen"},r.createElement("p",{className:"DocSearch-Help"},s)):!1===o.hasCollections?null:r.createElement("div",{className:"DocSearch-Dropdown-Container"},r.createElement(an,f({},o,{title:i,collection:o.state.collections[0],renderIcon:function(){return r.createElement("div",{className:"DocSearch-Hit-icon"},r.createElement(Ht,null))},renderAction:function(e){var t=e.item,n=e.runFavoriteTransition,a=e.runDeleteTransition;return r.createElement(r.Fragment,null,r.createElement("div",{className:"DocSearch-Hit-action"},r.createElement("button",{className:"DocSearch-Hit-action-button",title:c,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),n((function(){o.favoriteSearches.add(t),o.recentSearches.remove(t),o.refresh()}))}},r.createElement(Yt,null))),r.createElement("div",{className:"DocSearch-Hit-action"},r.createElement("button",{className:"DocSearch-Hit-action-button",title:p,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),a((function(){o.recentSearches.remove(t),o.refresh()}))}},r.createElement($t,null))))}})),r.createElement(an,f({},o,{title:h,collection:o.state.collections[1],renderIcon:function(){return r.createElement("div",{className:"DocSearch-Hit-icon"},r.createElement(Yt,null))},renderAction:function(e){var t=e.item,n=e.runDeleteTransition;return r.createElement("div",{className:"DocSearch-Hit-action"},r.createElement("button",{className:"DocSearch-Hit-action-button",title:y,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),n((function(){o.favoriteSearches.remove(t),o.refresh()}))}},r.createElement($t,null)))}})))}var yn=["translations"],bn=r.memo((function(e){var t=e.translations,n=void 0===t?{}:t,o=v(e,yn);if("error"===o.state.status)return r.createElement(Xt,{translations:null==n?void 0:n.errorScreen});var a=o.state.collections.some((function(e){return e.items.length>0}));return o.state.query?!1===a?r.createElement(tn,f({},o,{translations:null==n?void 0:n.noResultsScreen})):r.createElement(hn,o):r.createElement(vn,f({},o,{hasCollections:a,translations:null==n?void 0:n.startScreen}))}),(function(e,t){return"loading"===t.state.status||"stalled"===t.state.status})),wn=["translations"];function Sn(e){var t=e.translations,n=void 0===t?{}:t,o=v(e,wn),a=n.resetButtonTitle,i=void 0===a?"Clear the query":a,l=n.resetButtonAriaLabel,s=void 0===l?"Clear the query":l,u=n.cancelButtonText,c=void 0===u?"Cancel":u,d=n.cancelButtonAriaLabel,p=void 0===d?"Cancel":d,m=n.searchInputLabel,h=void 0===m?"Search":m,g=o.getFormProps({inputElement:o.inputRef.current}).onReset;return r.useEffect((function(){o.autoFocus&&o.inputRef.current&&o.inputRef.current.focus()}),[o.autoFocus,o.inputRef]),r.useEffect((function(){o.isFromSelection&&o.inputRef.current&&o.inputRef.current.select()}),[o.isFromSelection,o.inputRef]),r.createElement(r.Fragment,null,r.createElement("form",{className:"DocSearch-Form",onSubmit:function(e){e.preventDefault()},onReset:g},r.createElement("label",f({className:"DocSearch-MagnifierLabel"},o.getLabelProps()),r.createElement(_,null),r.createElement("span",{className:"DocSearch-VisuallyHiddenForAccessibility"},h)),r.createElement("div",{className:"DocSearch-LoadingIndicator"},r.createElement(qt,null)),r.createElement("input",f({className:"DocSearch-Input",ref:o.inputRef},o.getInputProps({inputElement:o.inputRef.current,autoFocus:o.autoFocus,maxLength:64}))),r.createElement("button",{type:"reset",title:i,className:"DocSearch-Reset","aria-label":s,hidden:!o.state.query},r.createElement($t,null))),r.createElement("button",{className:"DocSearch-Cancel",type:"reset","aria-label":p,onClick:o.onClose},c))}var kn=["_highlightResult","_snippetResult"];function xn(e){var t=e.key,n=e.limit,r=void 0===n?5:n,o=function(e){return!1===function(){var e="__TEST_KEY__";try{return localStorage.setItem(e,""),localStorage.removeItem(e),!0}catch(e){return!1}}()?{setItem:function(){},getItem:function(){return[]}}:{setItem:function(t){return window.localStorage.setItem(e,JSON.stringify(t))},getItem:function(){var t=window.localStorage.getItem(e);return t?JSON.parse(t):[]}}}(t),a=o.getItem().slice(0,r);return{add:function(e){var t=e;t._highlightResult,t._snippetResult;var n=v(t,kn),i=a.findIndex((function(e){return e.objectID===n.objectID}));i>-1&&a.splice(i,1),a.unshift(n),a=a.slice(0,r),o.setItem(a)},remove:function(e){a=a.filter((function(t){return t.objectID!==e.objectID})),o.setItem(a)},getAll:function(){return a}}}function En(e){var t,n="algolia-client-js-".concat(e.key);function r(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function o(){return JSON.parse(r().getItem(n)||"{}")}function a(e){r().setItem(n,JSON.stringify(e))}return{get:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then((function(){var n,r,i;return n=e.timeToLive?1e3*e.timeToLive:null,r=o(),a(i=Object.fromEntries(Object.entries(r).filter((function(e){return void 0!==w(e,2)[1].timestamp})))),n&&a(Object.fromEntries(Object.entries(i).filter((function(e){var t=w(e,2)[1],r=(new Date).getTime();return!(t.timestamp+n2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return t().then((function(e){return Promise.all([e,n.miss(e)])})).then((function(e){return w(e,1)[0]}))},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return n.get(e,r,o).catch((function(){return _n({caches:t}).get(e,r,o)}))},set:function(e,r){return n.set(e,r).catch((function(){return _n({caches:t}).set(e,r)}))},delete:function(e){return n.delete(e).catch((function(){return _n({caches:t}).delete(e)}))},clear:function(){return n.clear().catch((function(){return _n({caches:t}).clear()}))}}}function On(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},t={};return{get:function(n,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},a=JSON.stringify(n);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);var i=r();return i.then((function(e){return o.miss(e)})).then((function(){return i}))},set:function(n,r){return t[JSON.stringify(n)]=e.serializable?JSON.stringify(r):r,Promise.resolve(r)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function jn(e){var t=e.algoliaAgents,n=e.client,r=e.version,o=function(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(e){var n="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===t.value.indexOf(n)&&(t.value="".concat(t.value).concat(n)),t}};return t}(r).add({segment:n,version:r});return t.forEach((function(e){return o.add(e)})),o}var An=12e4;function Cn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"up",n=Date.now();return g(g({},e),{},{status:t,lastUpdate:n,isUp:function(){return"up"===t||Date.now()-n>An},isTimedOut:function(){return"timed out"===t&&Date.now()-n<=An}})}var Tn=function(){function e(t,n){var r;return s(this,e),c(r=l(this,e,[t]),"name","AlgoliaError"),n&&(r.name=n),r}return p(e,x(Error)),u(e)}(),Pn=function(){function e(t,n,r){var o;return s(this,e),c(o=l(this,e,[t,r]),"stackTrace",void 0),o.stackTrace=n,o}return p(e,Tn),u(e)}(),In=function(){function e(t){return s(this,e),l(this,e,["Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.",t,"RetryError"])}return p(e,Pn),u(e)}(),Nn=function(){function e(t,n,r){var o,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"ApiError";return s(this,e),c(o=l(this,e,[t,r,a]),"status",void 0),o.status=n,o}return p(e,Pn),u(e)}(),Rn=function(){function e(t,n){var r;return s(this,e),c(r=l(this,e,[t,"DeserializationError"]),"response",void 0),r.response=n,r}return p(e,Tn),u(e)}(),Dn=function(){function e(t,n,r,o){var a;return s(this,e),c(a=l(this,e,[t,n,o,"DetailedApiError"]),"error",void 0),a.error=r,a}return p(e,Nn),u(e)}();function Ln(e,t,n){var r,o=(r=n,Object.keys(r).filter((function(e){return void 0!==r[e]})).sort().map((function(e){return"".concat(e,"=").concat(encodeURIComponent("[object Array]"===Object.prototype.toString.call(r[e])?r[e].join(","):r[e]).replace(/\+/g,"%20"))})).join("&")),a="".concat(e.protocol,"://").concat(e.url).concat(e.port?":".concat(e.port):"","/").concat("/"===t.charAt(0)?t.substring(1):t);return o.length&&(a+="?".concat(o)),a}function Mn(e,t){if("GET"!==e.method&&(void 0!==e.data||void 0!==t.data)){var n=Array.isArray(e.data)?e.data:g(g({},e.data),t.data);return JSON.stringify(n)}}function Fn(e,t,n){var r=g(g(g({Accept:"application/json"},e),t),n),o={};return Object.keys(r).forEach((function(e){var t=r[e];o[e.toLowerCase()]=t})),o}function Bn(e){try{return JSON.parse(e.content)}catch(t){throw new Rn(t.message,e)}}function zn(e,t){var n=e.content,r=e.status;try{var o=JSON.parse(n);return"error"in o?new Dn(o.message,r,o.error,t):new Nn(o.message,r,t)}catch(e){}return new Nn(n,r,t)}function Un(e){return e.map((function(e){return qn(e)}))}function qn(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return g(g({},e),{},{request:g(g({},e.request),{},{headers:g(g({},e.request.headers),t)})})}var Hn=["appId","apiKey","authMode","algoliaAgents"],$n=["params"],Vn="5.14.2";function Gn(e){return[{url:"".concat(e,"-dsn.algolia.net"),accept:"read",protocol:"https"},{url:"".concat(e,".algolia.net"),accept:"write",protocol:"https"}].concat(function(e){for(var t=e,n=e.length-1;n>0;n--){var r=Math.floor(Math.random()*(n+1)),o=e[n];t[n]=e[r],t[r]=o}return t}([{url:"".concat(e,"-1.algolianet.com"),accept:"readWrite",protocol:"https"},{url:"".concat(e,"-2.algolianet.com"),accept:"readWrite",protocol:"https"},{url:"".concat(e,"-3.algolianet.com"),accept:"readWrite",protocol:"https"}]))}var Wn="3.8.2";function Kn(e,t,n){return r.useMemo((function(){var r=function(e,t){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!t||"string"!=typeof t)throw new Error("`apiKey` is missing.");return function(e){var t=e.appId,n=e.apiKey,r=e.authMode,o=e.algoliaAgents,a=v(e,Hn),l=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"WithinHeaders",r={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:function(){return"WithinHeaders"===n?r:{}},queryParameters:function(){return"WithinQueryParameters"===n?r:{}}}}(t,n,r),s=function(e){var t=e.hosts,n=e.hostsCache,r=e.baseHeaders,o=e.logger,a=e.baseQueryParameters,l=e.algoliaAgent,s=e.timeouts,u=e.requester,c=e.requestsCache,f=e.responsesCache;function d(e){return p.apply(this,arguments)}function p(){return(p=i(y().mark((function e(t){var r,o,a,i,l;return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map((function(e){return n.get(e,(function(){return Promise.resolve(Cn(e))}))})));case 2:return r=e.sent,o=r.filter((function(e){return e.isUp()})),a=r.filter((function(e){return e.isTimedOut()})),i=[].concat(S(o),S(a)),l=i.length>0?i:t,e.abrupt("return",{hosts:l,getTimeout:function(e,t){return(0===a.length&&0===e?1:a.length+3+e)*t}});case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function m(e,t){return h.apply(this,arguments)}function h(){return h=i(y().mark((function e(c,f){var p,m,h,v,b,w,k,x,E,_,O,j,A,C=arguments;return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(p=!(C.length>2&&void 0!==C[2])||C[2],m=[],h=Mn(c,f),v=Fn(r,c.headers,f.headers),b="GET"===c.method?g(g({},c.data),f.data):{},w=g(g(g({},a),c.queryParameters),b),l.value&&(w["x-algolia-agent"]=l.value),f&&f.queryParameters)for(k=0,x=Object.keys(f.queryParameters);k1&&void 0!==arguments[1]?arguments[1]:{},n=e.useReadTransporter||"GET"===e.method;if(!n)return m(e,t,n);var o=function(){return m(e,t)};if(!0!==(t.cacheable||e.cacheable))return o();var i={request:e,requestOptions:t,transporter:{queryParameters:a,headers:r}};return f.get(i,(function(){return c.get(i,(function(){return c.set(i,o()).then((function(e){return Promise.all([c.delete(i),e])}),(function(e){return Promise.all([c.delete(i),Promise.reject(e)])})).then((function(e){var t=w(e,2);return t[0],t[1]}))}))}),{miss:function(e){return f.set(i,e)}})},requestsCache:c,responsesCache:f}}(g(g({hosts:Gn(t)},a),{},{algoliaAgent:jn({algoliaAgents:o,client:"Lite",version:Vn}),baseHeaders:g(g({"content-type":"text/plain"},l.headers()),a.baseHeaders),baseQueryParameters:g(g({},l.queryParameters()),a.baseQueryParameters)}));return{transporter:s,appId:t,clearCache:function(){return Promise.all([s.requestsCache.clear(),s.responsesCache.clear()]).then((function(){}))},get _ua(){return s.algoliaAgent.value},addAlgoliaAgent:function(e,t){s.algoliaAgent.add({segment:e,version:t})},setClientApiKey:function(e){var t=e.apiKey;r&&"WithinHeaders"!==r?s.baseQueryParameters["x-algolia-api-key"]=t:s.baseHeaders["x-algolia-api-key"]=t},searchForHits:function(e,t){return this.search(e,t)},searchForFacets:function(e,t){return this.search(e,t)},customPost:function(e,t){var n=e.path,r=e.parameters,o=e.body;if(!n)throw new Error("Parameter `path` is required when calling `customPost`.");var a={method:"POST",path:"/{path}".replace("{path}",n),queryParameters:r||{},headers:{},data:o||{}};return s.request(a,t)},getRecommendations:function(e,t){if(e&&Array.isArray(e)&&(e={requests:e}),!e)throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");if(!e.requests)throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");var n={method:"POST",path:"/1/indexes/*/recommendations",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return s.request(n,t)},search:function(e,t){if(e&&Array.isArray(e)){var n={requests:e.map((function(e){var t=e.params,n=v(e,$n);return"facet"===n.type?g(g(g({},n),t),{},{type:"facet"}):g(g(g({},n),t),{},{facet:void 0,maxFacetHits:void 0,facetQuery:void 0})}))};e=n}if(!e)throw new Error("Parameter `searchMethodParams` is required when calling `search`.");if(!e.requests)throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`.");var r={method:"POST",path:"/1/indexes/*/queries",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return s.request(r,t)}}}(g({appId:e,apiKey:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:{debug:function(e,t){return Promise.resolve()},info:function(e,t){return Promise.resolve()},error:function(e,t){return Promise.resolve()}},requester:{send:function(e){return new Promise((function(t){var n=new XMLHttpRequest;n.open(e.method,e.url,!0),Object.keys(e.headers).forEach((function(t){return n.setRequestHeader(t,e.headers[t])}));var r,o=function(e,r){return setTimeout((function(){n.abort(),t({status:0,content:r,isTimedOut:!0})}),e)},a=o(e.connectTimeout,"Connection timeout");n.onreadystatechange=function(){n.readyState>n.OPENED&&void 0===r&&(clearTimeout(a),r=o(e.responseTimeout,"Socket timeout"))},n.onerror=function(){0===n.status&&(clearTimeout(a),clearTimeout(r),t({content:n.responseText||"Network request failed",status:n.status,isTimedOut:!1}))},n.onload=function(){clearTimeout(a),clearTimeout(r),t({content:n.responseText,status:n.status,isTimedOut:!1})},n.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:On(),requestsCache:On({serializable:!1}),hostsCache:_n({caches:[En({key:"".concat(Vn,"-").concat(e)}),On()]})},void 0))}(e,t);return r.addAlgoliaAgent("docsearch",Wn),!1===/docsearch.js \(.*\)/.test(r.transporter.algoliaAgent.value)&&r.addAlgoliaAgent("docsearch-react",Wn),n(r)}),[e,t,n])}var Qn=["footer","searchBox"];function Yn(e){var t=e.appId,n=e.apiKey,o=e.indexName,a=e.placeholder,i=void 0===a?"Search docs":a,l=e.searchParameters,s=e.maxResultsPerGroup,u=e.onClose,c=void 0===u?fn:u,d=e.transformItems,p=void 0===d?un:d,m=e.hitComponent,h=void 0===m?Ut:m,y=e.resultsFooterComponent,b=void 0===y?function(){return null}:y,S=e.navigator,k=e.initialScrollY,x=void 0===k?0:k,E=e.transformSearchClient,_=void 0===E?un:E,O=e.disableUserPersonalization,j=void 0!==O&&O,A=e.initialQuery,C=void 0===A?"":A,T=e.translations,P=void 0===T?{}:T,I=e.getMissingResultsUrl,N=e.insights,R=void 0!==N&&N,D=P.footer,L=P.searchBox,M=v(P,Qn),F=w(r.useState({query:"",collections:[],completion:null,context:{},isOpen:!1,activeItemId:null,status:"idle"}),2),B=F[0],z=F[1],U=r.useRef(null),q=r.useRef(null),H=r.useRef(null),$=r.useRef(null),V=r.useRef(null),G=r.useRef(10),W=r.useRef("undefined"!=typeof window?window.getSelection().toString().slice(0,64):"").current,K=r.useRef(C||W).current,Q=Kn(t,n,_),Y=r.useRef(xn({key:"__DOCSEARCH_FAVORITE_SEARCHES__".concat(o),limit:10})).current,J=r.useRef(xn({key:"__DOCSEARCH_RECENT_SEARCHES__".concat(o),limit:0===Y.getAll().length?7:4})).current,Z=r.useCallback((function(e){if(!j){var t="content"===e.type?e.__docsearch_parent:e;t&&-1===Y.getAll().findIndex((function(e){return e.objectID===t.objectID}))&&J.add(t)}}),[Y,J,j]),X=r.useCallback((function(e){if(B.context.algoliaInsightsPlugin&&e.__autocomplete_id){var t=e,n={eventName:"Item Selected",index:t.__autocomplete_indexName,items:[t],positions:[e.__autocomplete_id],queryID:t.__autocomplete_queryID};B.context.algoliaInsightsPlugin.insights.clickedObjectIDsAfterSearch(n)}}),[B.context.algoliaInsightsPlugin]),ee=r.useMemo((function(){return Mt({id:"docsearch",defaultActiveItemId:0,placeholder:i,openOnFocus:!0,initialState:{query:K,context:{searchSuggestions:[]}},insights:R,navigator:S,onStateChange:function(e){z(e.state)},getSources:function(e){var r=e.query,a=e.state,i=e.setContext,u=e.setStatus;if(!r)return j?[]:[{sourceId:"recentSearches",onSelect:function(e){var t=e.item,n=e.event;Z(t),cn(n)||c()},getItemUrl:function(e){return e.item.url},getItems:function(){return J.getAll()}},{sourceId:"favoriteSearches",onSelect:function(e){var t=e.item,n=e.event;Z(t),cn(n)||c()},getItemUrl:function(e){return e.item.url},getItems:function(){return Y.getAll()}}];var f=Boolean(R);return Q.search({requests:[g({query:r,indexName:o,attributesToRetrieve:["hierarchy.lvl0","hierarchy.lvl1","hierarchy.lvl2","hierarchy.lvl3","hierarchy.lvl4","hierarchy.lvl5","hierarchy.lvl6","content","type","url"],attributesToSnippet:["hierarchy.lvl1:".concat(G.current),"hierarchy.lvl2:".concat(G.current),"hierarchy.lvl3:".concat(G.current),"hierarchy.lvl4:".concat(G.current),"hierarchy.lvl5:".concat(G.current),"hierarchy.lvl6:".concat(G.current),"content:".concat(G.current)],snippetEllipsisText:"\u2026",highlightPreTag:"",highlightPostTag:"",hitsPerPage:20,clickAnalytics:f},l)]}).catch((function(e){throw"RetryError"===e.name&&u("error"),e})).then((function(e){var r=e.results[0],l=r.hits,u=r.nbHits,d=sn(l,(function(e){return mn(e)}),s);a.context.searchSuggestions.length0&&(re(),V.current&&V.current.focus())}),[K,re]),r.useEffect((function(){function e(){if(q.current){var e=.01*window.innerHeight;q.current.style.setProperty("--docsearch-vh","".concat(e,"px"))}}return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]),r.createElement("div",f({ref:U},ne({"aria-expanded":!0}),{className:["DocSearch","DocSearch-Container","stalled"===B.status&&"DocSearch-Container--Stalled","error"===B.status&&"DocSearch-Container--Errored"].filter(Boolean).join(" "),role:"button",tabIndex:0,onMouseDown:function(e){e.target===e.currentTarget&&c()}}),r.createElement("div",{className:"DocSearch-Modal",ref:q},r.createElement("header",{className:"DocSearch-SearchBar",ref:H},r.createElement(Sn,f({},ee,{state:B,autoFocus:0===K.length,inputRef:V,isFromSelection:Boolean(K)&&K===W,translations:L,onClose:c}))),r.createElement("div",{className:"DocSearch-Dropdown",ref:$},r.createElement(bn,f({},ee,{indexName:o,state:B,hitComponent:h,resultsFooterComponent:b,disableUserPersonalization:j,recentSearches:J,favoriteSearches:Y,inputRef:V,translations:M,getMissingResultsUrl:I,onItemClick:function(e,t){X(e),Z(e),cn(t)||c()}}))),r.createElement("footer",{className:"DocSearch-Footer"},r.createElement(zt,{translations:D}))))}function Jn(e){var t=e.isOpen,n=e.onOpen,o=e.onClose,a=e.onInput,i=e.searchButtonRef;r.useEffect((function(){function e(e){var r;if("Escape"===e.code&&t||"k"===(null===(r=e.key)||void 0===r?void 0:r.toLowerCase())&&(e.metaKey||e.ctrlKey)||!function(e){var t=e.target,n=t.tagName;return t.isContentEditable||"INPUT"===n||"SELECT"===n||"TEXTAREA"===n}(e)&&"/"===e.key&&!t)return e.preventDefault(),void(t?o():document.body.classList.contains("DocSearch--active")||n());i&&i.current===document.activeElement&&a&&/[a-zA-Z0-9]/.test(String.fromCharCode(e.keyCode))&&a(e)}return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}),[t,n,o,a,i])}},4944:(e,t,n)=>{var r={"./":4505};function o(e){var t=a(e);return n(t)}function a(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}o.keys=function(){return Object.keys(r)},o.resolve=a,e.exports=o,o.id=4944},1599:(e,t,n)=>{"use strict";n.d(t,{o:()=>a,x:()=>i});var r=n(2581),o=n(9793),a=r.createContext(!1);function i(e){var t=e.children,n=(0,r.useState)(!1),i=n[0],l=n[1];return(0,r.useEffect)((function(){l(!0)}),[]),(0,o.jsx)(a.Provider,{value:i,children:t})}},5237:(e,t,n)=>{"use strict";var r=n(2581),o=n(5643),a=n(5571),i=n(8715),l=n(4784),s=n(2651);const u=[n(8197),n(6821),n(7204),n(5202)];var c=n(7276),f=n(8516),d=n(3020),p=n(9793);function m(e){var t=e.children;return(0,p.jsx)(p.Fragment,{children:t})}var h=n(8498),g=n(9068),v=n(4447),y=n(6938),b=n(1448),w=n(4183),S=n(1296),k=n(1923),x=n(4969),E=n(3381);function _(){var e=(0,g.A)().i18n,t=e.currentLocale,n=e.defaultLocale,r=e.localeConfigs,o=(0,w.o)(),a=r[t].htmlLang,i=function(e){return e.replace("-","_")};return(0,p.jsxs)(h.A,{children:[Object.entries(r).map((function(e){var t=e[0],n=e[1].htmlLang;return(0,p.jsx)("link",{rel:"alternate",href:o.createUrl({locale:t,fullyQualified:!0}),hrefLang:n},t)})),(0,p.jsx)("link",{rel:"alternate",href:o.createUrl({locale:n,fullyQualified:!0}),hrefLang:"x-default"}),(0,p.jsx)("meta",{property:"og:locale",content:i(a)}),Object.values(r).filter((function(e){return a!==e.htmlLang})).map((function(e){return(0,p.jsx)("meta",{property:"og:locale:alternate",content:i(e.htmlLang)},"meta-og-"+e.htmlLang)}))]})}function O(e){var t=e.permalink,n=(0,g.A)().siteConfig.url,r=function(){var e=(0,g.A)().siteConfig,t=e.url,n=e.baseUrl,r=e.trailingSlash,o=(0,f.zy)().pathname;return t+(0,x.Ks)((0,v.Ay)(o),{trailingSlash:r,baseUrl:n})}(),o=t?""+n+t:r;return(0,p.jsxs)(h.A,{children:[(0,p.jsx)("meta",{property:"og:url",content:o}),(0,p.jsx)("link",{rel:"canonical",href:o})]})}function j(){var e=(0,g.A)().i18n.currentLocale,t=(0,y.p)(),n=t.metadata,r=t.image;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(h.A,{children:[(0,p.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,p.jsx)("body",{className:S.w})]}),r&&(0,p.jsx)(b.be,{image:r}),(0,p.jsx)(O,{}),(0,p.jsx)(_,{}),(0,p.jsx)(E.A,{tag:k.C,locale:e}),(0,p.jsx)(h.A,{children:n.map((function(e,t){return(0,p.jsx)("meta",Object.assign({},e),t)}))})]})}var A=new Map;var C=n(1599),T=n(3874),P=n(6710),I=n(9847);function N(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r\n

Your Docusaurus site did not load properly.

\n

A very common reason is a wrong site baseUrl configuration.

\n

Current configured baseUrl = '+e+" "+("/"===e?" (default value)":"")+'

\n

We suggest trying baseUrl =

\n\n'}(e)).replace(/{"use strict";n.d(t,{o:()=>f,l:()=>d});var r=n(2581),o=n(4784);const a=JSON.parse('{"docusaurus-plugin-content-docs":{"default":{"path":"/monorepo/docs","versions":[{"name":"current","label":"Next","isLast":true,"path":"/monorepo/docs","mainDocId":"introduction/getting-started","docs":[{"id":"api/binding-syntax","path":"/monorepo/docs/api/binding-syntax","sidebar":"tutorialSidebar"},{"id":"api/container","path":"/monorepo/docs/api/container","sidebar":"tutorialSidebar"},{"id":"api/container-module","path":"/monorepo/docs/api/container-module","sidebar":"tutorialSidebar"},{"id":"api/decorator","path":"/monorepo/docs/api/decorator","sidebar":"tutorialSidebar"},{"id":"fundamentals/binding","path":"/monorepo/docs/fundamentals/binding","sidebar":"tutorialSidebar"},{"id":"fundamentals/lifecycle/activation","path":"/monorepo/docs/fundamentals/lifecycle/activation","sidebar":"tutorialSidebar"},{"id":"fundamentals/lifecycle/deactivation","path":"/monorepo/docs/fundamentals/lifecycle/deactivation","sidebar":"tutorialSidebar"},{"id":"introduction/dependency-inversion","path":"/monorepo/docs/introduction/dependency-inversion","sidebar":"tutorialSidebar"},{"id":"introduction/getting-started","path":"/monorepo/docs/introduction/getting-started","sidebar":"tutorialSidebar"}],"draftIds":[],"sidebars":{"tutorialSidebar":{"link":{"path":"/monorepo/docs/introduction/getting-started","label":"introduction/getting-started"}}}}],"breadcrumbs":true}}}'),i=JSON.parse('{"defaultLocale":"en","locales":["en"],"path":"i18n","currentLocale":"en","localeConfigs":{"en":{"label":"English","direction":"ltr","htmlLang":"en","calendar":"gregory","path":"en"}}}');var l=n(2654);const s=JSON.parse('{"docusaurusVersion":"3.6.3","siteVersion":"1.0.0","pluginVersions":{"docusaurus-plugin-content-docs":{"type":"package","name":"@docusaurus/plugin-content-docs","version":"3.6.3"},"docusaurus-plugin-content-blog":{"type":"package","name":"@docusaurus/plugin-content-blog","version":"3.6.3"},"docusaurus-plugin-content-pages":{"type":"package","name":"@docusaurus/plugin-content-pages","version":"3.6.3"},"docusaurus-plugin-sitemap":{"type":"package","name":"@docusaurus/plugin-sitemap","version":"3.6.3"},"docusaurus-theme-classic":{"type":"package","name":"@docusaurus/theme-classic","version":"3.6.3"},"docusaurus-theme-search-algolia":{"type":"package","name":"@docusaurus/theme-search-algolia","version":"3.6.3"},"custom-asset-modules":{"type":"local"}}}');var u=n(9793),c={siteConfig:o.default,siteMetadata:s,globalData:a,i18n:i,codeTranslations:l},f=r.createContext(c);function d(e){var t=e.children;return(0,u.jsx)(f.Provider,{value:c,children:t})}},9245:(e,t,n)=>{"use strict";n.d(t,{A:()=>g});var r=n(6710),o=n(2581),a=n(2651),i=n(8498),l=n(4969),s=n(8711),u=n(6064),c=n(9793);function f(e){var t=e.error,n=e.tryAgain;return(0,c.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",minHeight:"100vh",width:"100%",maxWidth:"80ch",fontSize:"20px",margin:"0 auto",padding:"1rem"},children:[(0,c.jsx)("h1",{style:{fontSize:"3rem"},children:"This page crashed"}),(0,c.jsx)("button",{type:"button",onClick:n,style:{margin:"1rem 0",fontSize:"2rem",cursor:"pointer",borderRadius:20,padding:"1rem"},children:"Try again"}),(0,c.jsx)(d,{error:t})]})}function d(e){var t=e.error,n=(0,l.rA)(t).map((function(e){return e.message})).join("\n\nCause:\n");return(0,c.jsx)("p",{style:{whiteSpace:"pre-wrap"},children:n})}function p(e){var t=e.children;return(0,c.jsx)(u.W,{value:{plugin:{name:"docusaurus-core-error-boundary",id:"default"}},children:t})}function m(e){var t=e.error,n=e.tryAgain;return(0,c.jsx)(p,{children:(0,c.jsxs)(g,{fallback:function(){return(0,c.jsx)(f,{error:t,tryAgain:n})},children:[(0,c.jsx)(i.A,{children:(0,c.jsx)("title",{children:"Page Error"})}),(0,c.jsx)(s.A,{children:(0,c.jsx)(f,{error:t,tryAgain:n})})]})})}var h=function(e){return(0,c.jsx)(m,Object.assign({},e))},g=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={error:null},n}(0,r.A)(t,e);var n=t.prototype;return n.componentDidCatch=function(e){a.A.canUseDOM&&this.setState({error:e})},n.render=function(){var e=this,t=this.props.children,n=this.state.error;if(n){var r,o={error:n,tryAgain:function(){return e.setState({error:null})}};return(null!=(r=this.props.fallback)?r:h)(o)}return null!=t?t:null},t}(o.Component)},2651:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r="undefined"!=typeof window&&"document"in window&&"createElement"in window.document;const o={canUseDOM:r,canUseEventListeners:r&&("addEventListener"in window||"attachEvent"in window),canUseIntersectionObserver:r&&"IntersectionObserver"in window,canUseViewport:r&&"screen"in window}},8498:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});n(2581);var r=n(5571),o=n(9793);function a(e){return(0,o.jsx)(r.mg,Object.assign({},e))}},2772:(e,t,n)=>{"use strict";n.d(t,{A:()=>h});var r=n(4528),o=n(2581),a=n(8715),i=n(4969),l=n(9068),s=n(4028),u=n(2651),c=n(2209),f=n(4447),d=n(9793),p=["isNavLink","to","href","activeClassName","isActive","data-noBrokenLinkCheck","autoAddBaseUrl"];function m(e,t){var n,m,h,g=e.isNavLink,v=e.to,y=e.href,b=e.activeClassName,w=e.isActive,S=e["data-noBrokenLinkCheck"],k=e.autoAddBaseUrl,x=void 0===k||k,E=(0,r.A)(e,p),_=(0,l.A)().siteConfig,O=_.trailingSlash,j=_.baseUrl,A=_.future.experimental_router,C=(0,f.hH)().withBaseUrl,T=(0,c.A)(),P=(0,o.useRef)(null);(0,o.useImperativeHandle)(t,(function(){return P.current}));var I=v||y;var N,R,D=(0,s.A)(I),L=null==I?void 0:I.replace("pathname://",""),M=void 0!==L?(N=L,x&&function(e){return e.startsWith("/")}(N)?C(N):N):void 0;"hash"===A&&null!=(n=M)&&n.startsWith("./")&&(M=null==(R=M)?void 0:R.slice(1));M&&D&&(M=(0,i.Ks)(M,{trailingSlash:O,baseUrl:j}));var F=(0,o.useRef)(!1),B=g?a.k2:a.N_,z=u.A.canUseIntersectionObserver,U=(0,o.useRef)(),q=function(){F.current||null==M||(window.docusaurus.preload(M),F.current=!0)};(0,o.useEffect)((function(){return!z&&D&&u.A.canUseDOM&&null!=M&&window.docusaurus.prefetch(M),function(){z&&U.current&&U.current.disconnect()}}),[U,M,z,D]);var H=null!=(m=null==(h=M)?void 0:h.startsWith("#"))&&m,$=!E.target||"_self"===E.target,V=!M||!D||!$||H&&"hash"!==A;S||!H&&V||T.collectLink(M),E.id&&T.collectAnchor(E.id);var G={};return V?(0,d.jsx)("a",Object.assign({ref:P,href:M},I&&!D&&{target:"_blank",rel:"noopener noreferrer"},E,G)):(0,d.jsx)(B,Object.assign({},E,{onMouseEnter:q,onTouchStart:q,innerRef:function(e){P.current=e,z&&e&&D&&(U.current=new window.IntersectionObserver((function(t){t.forEach((function(t){e===t.target&&(t.isIntersecting||t.intersectionRatio>0)&&(U.current.unobserve(e),U.current.disconnect(),null!=M&&window.docusaurus.prefetch(M))}))})),U.current.observe(e))},to:M},g&&{isActive:w,activeClassName:b},G))}const h=o.forwardRef(m)},7618:(e,t,n)=>{"use strict";n.d(t,{A:()=>u,T:()=>s});var r=n(2581),o=n(9793);function a(e,t){var n=e.split(/(\{\w+\})/).map((function(e,n){if(n%2==1){var r=null==t?void 0:t[e.slice(1,-1)];if(void 0!==r)return r}return e}));return n.some((function(e){return(0,r.isValidElement)(e)}))?n.map((function(e,t){return(0,r.isValidElement)(e)?r.cloneElement(e,{key:t}):e})).filter((function(e){return""!==e})):n.join("")}var i=n(2654);function l(e){var t,n,r=e.id,o=e.message;if(void 0===r&&void 0===o)throw new Error("Docusaurus translation declarations must have at least a translation id or a default translation message");return null!=(t=null!=(n=i[null!=r?r:o])?n:o)?t:r}function s(e,t){return a(l({message:e.message,id:e.id}),t)}function u(e){var t=e.children,n=e.id,r=e.values;if(t&&"string"!=typeof t)throw console.warn("Illegal children",t),new Error("The Docusaurus component only accept simple string values");var i=l({message:t,id:n});return(0,o.jsx)(o.Fragment,{children:a(i,r)})}},1491:(e,t,n)=>{"use strict";n.d(t,{W:()=>r});var r="default"},4028:(e,t,n)=>{"use strict";function r(e){return/^(?:\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,{A:()=>o,z:()=>r})},4447:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>l,hH:()=>i});var r=n(2581),o=n(9068),a=n(4028);function i(){var e=(0,o.A)().siteConfig,t=e.baseUrl,n=e.url,i=e.future.experimental_router,l=(0,r.useCallback)((function(e,r){return function(e){var t=e.siteUrl,n=e.baseUrl,r=e.url,o=e.options,i=void 0===o?{}:o,l=i.forcePrependBaseUrl,s=void 0!==l&&l,u=i.absolute,c=void 0!==u&&u,f=e.router;if(!r||r.startsWith("#")||(0,a.z)(r))return r;if("hash"===f)return r.startsWith("/")?"."+r:"./"+r;if(s)return n+r.replace(/^\//,"");if(r===n.replace(/\/$/,""))return n;var d=r.startsWith(n)?r:n+r.replace(/^\//,"");return c?t+d:d}({siteUrl:n,baseUrl:t,url:e,options:r,router:i})}),[n,t,i]);return{withBaseUrl:l}}function l(e,t){return void 0===t&&(t={}),(0,i().withBaseUrl)(e,t)}},2209:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(2581),o=(n(9793),r.createContext({collectAnchor:function(){},collectLink:function(){}})),a=function(){return(0,r.useContext)(o)};function i(){return a()}},9068:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(2581),o=n(3874);function a(){return(0,r.useContext)(o.o)}},4069:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(2581),o=n(1599);function a(){return(0,r.useContext)(o.o)}},9847:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(2581);const o=n(2651).A.canUseDOM?r.useLayoutEffect:r.useEffect},2765:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(2581),o=n(6064);function a(){var e=r.useContext(o.o);if(!e)throw new Error("Unexpected: no Docusaurus route context found");return e}},4531:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=function(e){return"object"==typeof e&&!!e&&Object.keys(e).length>0};function o(e){var t={};return function e(n,o){Object.entries(n).forEach((function(n){var a=n[0],i=n[1],l=o?o+"."+a:a;r(i)?e(i,l):t[l]=i}))}(e),t}},6064:(e,t,n)=>{"use strict";n.d(t,{W:()=>i,o:()=>a});var r=n(2581),o=n(9793),a=r.createContext(null);function i(e){var t=e.children,n=e.value,i=r.useContext(a),l=(0,r.useMemo)((function(){return function(e){var t=e.parent,n=e.value;if(!t){if(!n)throw new Error("Unexpected: no Docusaurus route context found");if(!("plugin"in n))throw new Error("Unexpected: Docusaurus topmost route context has no `plugin` attribute");return n}var r=Object.assign({},t.data,null==n?void 0:n.data);return{plugin:t.plugin,data:r}}({parent:i,value:n})}),[i,n]);return(0,o.jsx)(a.Provider,{value:l,children:t})}},4100:(e,t,n)=>{"use strict";n.d(t,{VQ:()=>g,XK:()=>b,g1:()=>y});var r=n(2581),o=n(4858),a=n(1491),i=n(6938),l=n(4071),s=n(4222),u=n(9793),c=function(e){return"docs-preferred-version-"+e},f={save:function(e,t,n){(0,l.Wf)(c(e),{persistence:t}).set(n)},read:function(e,t){return(0,l.Wf)(c(e),{persistence:t}).get()},clear:function(e,t){(0,l.Wf)(c(e),{persistence:t}).del()}},d=function(e){return Object.fromEntries(e.map((function(e){return[e,{preferredVersionName:null}]})))};var p=r.createContext(null);function m(){var e=(0,o.Gy)(),t=(0,i.p)().docs.versionPersistence,n=(0,r.useMemo)((function(){return Object.keys(e)}),[e]),a=(0,r.useState)((function(){return d(n)})),l=a[0],s=a[1];return(0,r.useEffect)((function(){s(function(e){var t=e.pluginIds,n=e.versionPersistence,r=e.allDocsData;return Object.fromEntries(t.map((function(e){return[e,(t=e,o=f.read(t,n),r[t].versions.some((function(e){return e.name===o}))?{preferredVersionName:o}:(f.clear(t,n),{preferredVersionName:null}))];var t,o})))}({allDocsData:e,versionPersistence:t,pluginIds:n}))}),[e,t,n]),[l,(0,r.useMemo)((function(){return{savePreferredVersion:function(e,n){f.save(e,t,n),s((function(t){var r;return Object.assign({},t,((r={})[e]={preferredVersionName:n},r))}))}}}),[t])]}function h(e){var t=e.children,n=m();return(0,u.jsx)(p.Provider,{value:n,children:t})}function g(e){var t=e.children;return(0,u.jsx)(h,{children:t})}function v(){var e=(0,r.useContext)(p);if(!e)throw new s.dV("DocsPreferredVersionContextProvider");return e}function y(e){var t;void 0===e&&(e=a.W);var n=(0,o.ht)(e),i=v(),l=i[0],s=i[1],u=l[e].preferredVersionName;return{preferredVersion:null!=(t=n.versions.find((function(e){return e.name===u})))?t:null,savePreferredVersionName:(0,r.useCallback)((function(t){s.savePreferredVersion(e,t)}),[s,e])}}function b(){var e=(0,o.Gy)(),t=v()[0];var n=Object.keys(e);return Object.fromEntries(n.map((function(n){return[n,(r=n,a=e[r],i=t[r].preferredVersionName,null!=(o=a.versions.find((function(e){return e.name===i})))?o:null)];var r,o,a,i})))}},3:(e,t,n)=>{"use strict";n.d(t,{k:()=>a,v:()=>i});var r=n(4858),o=n(4100);function a(e,t){return"docs-"+e+"-"+t}function i(){var e=(0,r.Gy)(),t=(0,r.gk)(),n=(0,o.XK)();return[].concat(Object.keys(e).map((function(r){var o,i=(null==t?void 0:t.activePlugin.pluginId)===r?t.activeVersion:void 0,l=n[r],s=e[r].versions.find((function(e){return e.isLast}));return a(r,(null!=(o=null!=i?i:l)?o:s).name)})))}},6651:(e,t,n)=>{"use strict";n.d(t,{V:()=>s,t:()=>u});var r=n(2581),o=n(4222),a=n(9793),i=Symbol("EmptyContext"),l=r.createContext(i);function s(e){var t=e.children,n=e.name,o=e.items,i=(0,r.useMemo)((function(){return n&&o?{name:n,items:o}:null}),[n,o]);return(0,a.jsx)(l.Provider,{value:i,children:t})}function u(){var e=(0,r.useContext)(l);if(e===i)throw new o.dV("DocsSidebarProvider");return e}},6534:(e,t,n)=>{"use strict";n.d(t,{B5:()=>E,Nr:()=>p,OF:()=>w,QB:()=>x,Vd:()=>S,Y:()=>y,fW:()=>k,w8:()=>g});var r=n(2436),o=n(2581),a=n(8516),i=n(3020),l=n(4858),s=n(4421),u=n(582),c=n(4100),f=n(7395),d=n(6651);function p(e){return"link"!==e.type||e.unlisted?"category"===e.type?function(e){if(e.href&&!e.linkUnlisted)return e.href;for(var t,n=(0,r.A)(e.items);!(t=n()).done;){var o=p(t.value);if(o)return o}}(e):void 0:e.href}var m=function(e,t){return void 0!==e&&(0,s.ys)(e,t)},h=function(e,t){return e.some((function(e){return g(e,t)}))};function g(e,t){return"link"===e.type?m(e.href,t):"category"===e.type&&(m(e.href,t)||h(e.items,t))}function v(e,t){switch(e.type){case"category":return g(e,t)||e.items.some((function(e){return v(e,t)}));case"link":return!e.unlisted||g(e,t);default:return!0}}function y(e,t){return(0,o.useMemo)((function(){return e.filter((function(e){return v(e,t)}))}),[e,t])}function b(e){var t=e.sidebarItems,n=e.pathname,o=e.onlyCategories,a=void 0!==o&&o,i=[];return function e(t){for(var o,l=(0,r.A)(t);!(o=l()).done;){var u=o.value;if("category"===u.type&&((0,s.ys)(u.href,n)||e(u.items))||"link"===u.type&&(0,s.ys)(u.href,n))return a&&"category"!==u.type||i.unshift(u),!0}return!1}(t),i}function w(){var e,t=(0,d.t)(),n=(0,a.zy)().pathname;return!1!==(null==(e=(0,l.vT)())?void 0:e.pluginData.breadcrumbs)&&t?b({sidebarItems:t.items,pathname:n}):null}function S(e){var t=(0,l.zK)(e).activeVersion,n=(0,c.g1)(e).preferredVersion,r=(0,l.r7)(e);return(0,o.useMemo)((function(){return(0,u.sb)([t,n,r].filter(Boolean))}),[t,n,r])}function k(e,t){var n=S(t);return(0,o.useMemo)((function(){var t=n.flatMap((function(e){return e.sidebars?Object.entries(e.sidebars):[]})),r=t.find((function(t){return t[0]===e}));if(!r)throw new Error("Can't find any sidebar with id \""+e+'" in version'+(n.length>1?"s":"")+" "+n.map((function(e){return e.name})).join(", ")+'".\nAvailable sidebar ids are:\n- '+t.map((function(e){return e[0]})).join("\n- "));return r[1]}),[e,n])}function x(e,t){var n=S(t);return(0,o.useMemo)((function(){var t=n.flatMap((function(e){return e.docs})),r=t.find((function(t){return t.id===e}));if(!r){if(n.flatMap((function(e){return e.draftIds})).includes(e))return null;throw new Error("Couldn't find any doc with id \""+e+'" in version'+(n.length>1?"s":"")+' "'+n.map((function(e){return e.name})).join(", ")+'".\nAvailable doc ids are:\n- '+(0,u.sb)(t.map((function(e){return e.id}))).join("\n- "))}return r}),[e,n])}function E(e){var t=e.route,n=(0,a.zy)(),r=(0,f.r)(),o=t.routes,l=o.find((function(e){return(0,a.B6)(n.pathname,e)}));if(!l)return null;var s=l.sidebar,u=s?r.docsSidebars[s]:void 0;return{docElement:(0,i.v)(o),sidebarName:s,sidebarItems:u}}},7395:(e,t,n)=>{"use strict";n.d(t,{n:()=>l,r:()=>s});var r=n(2581),o=n(4222),a=n(9793),i=r.createContext(null);function l(e){var t=e.children,n=e.version;return(0,a.jsx)(i.Provider,{value:n,children:t})}function s(){var e=(0,r.useContext)(i);if(null===e)throw new o.dV("DocsVersionProvider");return e}},4858:(e,t,n)=>{"use strict";n.d(t,{zK:()=>v,vT:()=>p,gk:()=>m,Gy:()=>f,HW:()=>y,ht:()=>d,r7:()=>g,jh:()=>h});var r=n(8516),o=n(9068),a=n(1491);function i(e,t){void 0===t&&(t={});var n=(0,o.A)().globalData[e];if(!n&&t.failfast)throw new Error('Docusaurus plugin global data not found for "'+e+'" plugin.');return n}var l=function(e){return e.versions.find((function(e){return e.isLast}))};function s(e,t){return[].concat(e.versions).sort((function(e,t){return e.path===t.path?0:e.path.includes(t.path)?-1:t.path.includes(e.path)?1:0})).find((function(e){return!!(0,r.B6)(t,{path:e.path,exact:!1,strict:!1})}))}function u(e,t){var n,o,a=s(e,t),i=null==a?void 0:a.docs.find((function(e){return!!(0,r.B6)(t,{path:e.path,exact:!0,strict:!1})}));return{activeVersion:a,activeDoc:i,alternateDocVersions:i?(n=i.id,o={},e.versions.forEach((function(e){e.docs.forEach((function(t){t.id===n&&(o[e.name]=t)}))})),o):{}}}var c={},f=function(){var e;return null!=(e=i("docusaurus-plugin-content-docs"))?e:c},d=function(e){try{return function(e,t,n){void 0===t&&(t=a.W),void 0===n&&(n={});var r=i(e),o=null==r?void 0:r[t];if(!o&&n.failfast)throw new Error('Docusaurus plugin global data not found for "'+e+'" plugin with id "'+t+'".');return o}("docusaurus-plugin-content-docs",e,{failfast:!0})}catch(t){throw new Error("You are using a feature of the Docusaurus docs plugin, but this plugin does not seem to be enabled"+("Default"===e?"":" (pluginId="+e),{cause:t})}};function p(e){return void 0===e&&(e={}),function(e,t,n){void 0===n&&(n={});var o=Object.entries(e).sort((function(e,t){return t[1].path.localeCompare(e[1].path)})).find((function(e){var n=e[1];return!!(0,r.B6)(t,{path:n.path,exact:!1,strict:!1})})),a=o?{pluginId:o[0],pluginData:o[1]}:void 0;if(!a&&n.failfast)throw new Error("Can't find active docs plugin for \""+t+'" pathname, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: '+Object.values(e).map((function(e){return e.path})).join(", "));return a}(f(),(0,r.zy)().pathname,e)}function m(e){void 0===e&&(e={});var t=p(e),n=(0,r.zy)().pathname;if(t)return{activePlugin:t,activeVersion:s(t.pluginData,n)}}function h(e){return d(e).versions}function g(e){var t=d(e);return l(t)}function v(e){return u(d(e),(0,r.zy)().pathname)}function y(e){return function(e,t){var n=l(e);return{latestDocSuggestion:u(e,t).alternateDocVersions[n.name],latestVersionSuggestion:n}}(d(e),(0,r.zy)().pathname)}},2792:(e,t,n)=>{"use strict";function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(){return i=Object.assign||function(e){for(var t=1;t{"use strict";n.r(t),n.d(t,{default:()=>a});var r=n(9233),o=n.n(r);o().configure({showSpinner:!1});const a={onRouteUpdate:function(e){var t=e.location,n=e.previousLocation;if(n&&t.pathname!==n.pathname){var r=window.setTimeout((function(){o().start()}),200);return function(){return window.clearTimeout(r)}}},onRouteDidUpdate:function(){o().done()}}},6821:(e,t,n)=>{"use strict";var r,o,a,i=n(1077),l=n(4784);r=i.My,o=l.default.themeConfig.prism.additionalLanguages,a=globalThis.Prism,globalThis.Prism=r,o.forEach((function(e){"php"===e&&n(1143),n(4944)("./prism-"+e)})),delete globalThis.Prism,void 0!==a&&(globalThis.Prism=r)},7887:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var r=n(4528),o=(n(2581),n(4921)),a=n(7618),i=n(6938),l=n(2772),s=n(2209);const u={anchorWithStickyNavbar:"anchorWithStickyNavbar_J2y2",anchorWithHideOnScrollNavbar:"anchorWithHideOnScrollNavbar_Sk5t"};var c=n(9793),f=["as","id"];function d(e){var t=e.as,n=e.id,d=(0,r.A)(e,f),p=(0,s.A)(),m=(0,i.p)().navbar.hideOnScroll;if("h1"===t||!n)return(0,c.jsx)(t,Object.assign({},d,{id:void 0}));p.collectAnchor(n);var h=(0,a.T)({id:"theme.common.headingLinkTitle",message:"Direct link to {heading}",description:"Title for link to heading"},{heading:"string"==typeof d.children?d.children:n});return(0,c.jsxs)(t,Object.assign({},d,{className:(0,o.A)("anchor",m?u.anchorWithHideOnScrollNavbar:u.anchorWithStickyNavbar,d.className),id:n,children:[d.children,(0,c.jsx)(l.A,{className:"hash-link",to:"#"+n,"aria-label":h,title:h,children:"\u200b"})]}))}},4744:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});n(2581);const r={iconExternalLink:"iconExternalLink_B53c"};var o=n(9793);function a(e){var t=e.width,n=void 0===t?13.5:t,a=e.height,i=void 0===a?13.5:a;return(0,o.jsx)("svg",{width:n,height:i,"aria-hidden":"true",viewBox:"0 0 24 24",className:r.iconExternalLink,children:(0,o.jsx)("path",{fill:"currentColor",d:"M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"})})}},8711:(e,t,n)=>{"use strict";n.d(t,{A:()=>Gt});var r=n(2581),o=n(4921),a=n(9245),i=n(1448),l=n(8516),s=n(7618),u=n(2866),c=n(9793),f="__docusaurus_skipToContent_fallback";function d(e){e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")}function p(){var e=(0,r.useRef)(null),t=(0,l.W6)().action,n=(0,r.useCallback)((function(e){e.preventDefault();var t,n=null!=(t=document.querySelector("main:first-of-type"))?t:document.getElementById(f);n&&d(n)}),[]);return(0,u.$)((function(n){var r=n.location;e.current&&!r.hash&&"PUSH"===t&&d(e.current)})),{containerRef:e,onClick:n}}var m=(0,s.T)({id:"theme.common.skipToMainContent",description:"The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation",message:"Skip to main content"});function h(e){var t,n=null!=(t=e.children)?t:m,r=p(),o=r.containerRef,a=r.onClick;return(0,c.jsx)("div",{ref:o,role:"region","aria-label":m,children:(0,c.jsx)("a",Object.assign({},e,{href:"#"+f,onClick:a,children:n}))})}var g=n(8051),v=n(1296);const y={skipToContent:"skipToContent_L4pn"};function b(){return(0,c.jsx)(h,{className:y.skipToContent})}var w=n(6938),S=n(5701),k=n(4528),x=["width","height","color","strokeWidth","className"];function E(e){var t=e.width,n=void 0===t?21:t,r=e.height,o=void 0===r?21:r,a=e.color,i=void 0===a?"currentColor":a,l=e.strokeWidth,s=void 0===l?1.2:l,u=(e.className,(0,k.A)(e,x));return(0,c.jsx)("svg",Object.assign({viewBox:"0 0 15 15",width:n,height:o},u,{children:(0,c.jsx)("g",{stroke:i,strokeWidth:s,children:(0,c.jsx)("path",{d:"M.75.75l13.5 13.5M14.25.75L.75 14.25"})})}))}const _={closeButton:"closeButton_oyxd"};function O(e){return(0,c.jsx)("button",Object.assign({type:"button","aria-label":(0,s.T)({id:"theme.AnnouncementBar.closeButtonAriaLabel",message:"Close",description:"The ARIA label for close button of announcement bar"})},e,{className:(0,o.A)("clean-btn close",_.closeButton,e.className),children:(0,c.jsx)(E,{width:14,height:14,strokeWidth:3.1})}))}const j={content:"content_eUr1"};function A(e){var t=(0,w.p)().announcementBar.content;return(0,c.jsx)("div",Object.assign({},e,{className:(0,o.A)(j.content,e.className),dangerouslySetInnerHTML:{__html:t}}))}const C={announcementBar:"announcementBar_fi8U",announcementBarPlaceholder:"announcementBarPlaceholder_gmTt",announcementBarClose:"announcementBarClose_iFqO",announcementBarContent:"announcementBarContent_eoPb"};function T(){var e=(0,w.p)().announcementBar,t=(0,S.M)(),n=t.isActive,r=t.close;if(!n)return null;var o=e.backgroundColor,a=e.textColor,i=e.isCloseable;return(0,c.jsxs)("div",{className:C.announcementBar,style:{backgroundColor:o,color:a},role:"banner",children:[i&&(0,c.jsx)("div",{className:C.announcementBarPlaceholder}),(0,c.jsx)(A,{className:C.announcementBarContent}),i&&(0,c.jsx)(O,{onClick:r,className:C.announcementBarClose})]})}var P=n(1673),I=n(6780);var N=n(4222),R=n(3948),D=r.createContext(null);function L(e){var t,n,o,a,i,l,s,u=e.children,f=(t=(0,P.M)(),n=(0,R.YL)(),o=(0,r.useState)(!1),a=o[0],i=o[1],l=null!==n.component,s=(0,N.ZC)(l),(0,r.useEffect)((function(){l&&!s&&i(!0)}),[l,s]),(0,r.useEffect)((function(){l?t.shown||i(!0):i(!1)}),[t.shown,l]),(0,r.useMemo)((function(){return[a,i]}),[a]));return(0,c.jsx)(D.Provider,{value:f,children:u})}function M(e){if(e.component){var t=e.component;return(0,c.jsx)(t,Object.assign({},e.props))}}function F(){var e=(0,r.useContext)(D);if(!e)throw new N.dV("NavbarSecondaryMenuDisplayProvider");var t=e[0],n=e[1],o=(0,r.useCallback)((function(){return n(!1)}),[n]),a=(0,R.YL)();return(0,r.useMemo)((function(){return{shown:t,hide:o,content:M(a)}}),[o,a,t])}function B(e){var t=e.header,n=e.primaryMenu,r=e.secondaryMenu,a=F().shown;return(0,c.jsxs)("div",{className:"navbar-sidebar",children:[t,(0,c.jsxs)("div",{className:(0,o.A)("navbar-sidebar__items",{"navbar-sidebar__items--show-secondary":a}),children:[(0,c.jsx)("div",{className:"navbar-sidebar__item menu",children:n}),(0,c.jsx)("div",{className:"navbar-sidebar__item menu",children:r})]})]})}var z=n(7545),U=n(4069);function q(e){return(0,c.jsx)("svg",Object.assign({viewBox:"0 0 24 24",width:24,height:24},e,{children:(0,c.jsx)("path",{fill:"currentColor",d:"M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"})}))}function H(e){return(0,c.jsx)("svg",Object.assign({viewBox:"0 0 24 24",width:24,height:24},e,{children:(0,c.jsx)("path",{fill:"currentColor",d:"M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"})}))}const $={toggle:"toggle_szuu",toggleButton:"toggleButton_vJh4",darkToggleIcon:"darkToggleIcon_Aac9",lightToggleIcon:"lightToggleIcon_zkfB",toggleButtonDisabled:"toggleButtonDisabled_pNcF"};function V(e){var t=e.className,n=e.buttonClassName,r=e.value,a=e.onChange,i=(0,U.A)(),l=(0,s.T)({message:"Switch between dark and light mode (currently {mode})",id:"theme.colorToggle.ariaLabel",description:"The ARIA label for the navbar color mode toggle"},{mode:"dark"===r?(0,s.T)({message:"dark mode",id:"theme.colorToggle.ariaLabel.mode.dark",description:"The name for the dark color mode"}):(0,s.T)({message:"light mode",id:"theme.colorToggle.ariaLabel.mode.light",description:"The name for the light color mode"})});return(0,c.jsx)("div",{className:(0,o.A)($.toggle,t),children:(0,c.jsxs)("button",{className:(0,o.A)("clean-btn",$.toggleButton,!i&&$.toggleButtonDisabled,n),type:"button",onClick:function(){return a("dark"===r?"light":"dark")},disabled:!i,title:l,"aria-label":l,"aria-live":"polite","aria-pressed":"dark"===r?"true":"false",children:[(0,c.jsx)(q,{className:(0,o.A)($.toggleIcon,$.lightToggleIcon)}),(0,c.jsx)(H,{className:(0,o.A)($.toggleIcon,$.darkToggleIcon)})]})})}const G=r.memo(V),W={darkNavbarColorModeToggle:"darkNavbarColorModeToggle_h7B0"};function K(e){var t=e.className,n=(0,w.p)().navbar.style,r=(0,w.p)().colorMode.disableSwitch,o=(0,z.G)(),a=o.colorMode,i=o.setColorMode;return r?null:(0,c.jsx)(G,{className:t,buttonClassName:"dark"===n?W.darkNavbarColorModeToggle:void 0,value:a,onChange:i})}var Q=n(1167);function Y(){return(0,c.jsx)(Q.A,{className:"navbar__brand",imageClassName:"navbar__logo",titleClassName:"navbar__title text--truncate"})}function J(){var e=(0,P.M)();return(0,c.jsx)("button",{type:"button","aria-label":(0,s.T)({id:"theme.docs.sidebar.closeSidebarButtonAriaLabel",message:"Close navigation bar",description:"The ARIA label for close button of mobile sidebar"}),className:"clean-btn navbar-sidebar__close",onClick:function(){return e.toggle()},children:(0,c.jsx)(E,{color:"var(--ifm-color-emphasis-600)"})})}function Z(){return(0,c.jsxs)("div",{className:"navbar-sidebar__brand",children:[(0,c.jsx)(Y,{}),(0,c.jsx)(K,{className:"margin-right--md"}),(0,c.jsx)(J,{})]})}var X=n(2772),ee=n(4447),te=n(4028),ne=n(5424),re=n(4744),oe=["activeBasePath","activeBaseRegex","to","href","label","html","isDropdownLink","prependBaseUrlToHref"];function ae(e){var t=e.activeBasePath,n=e.activeBaseRegex,r=e.to,o=e.href,a=e.label,i=e.html,l=e.isDropdownLink,s=e.prependBaseUrlToHref,u=(0,k.A)(e,oe),f=(0,ee.Ay)(r),d=(0,ee.Ay)(t),p=(0,ee.Ay)(o,{forcePrependBaseUrl:!0}),m=a&&o&&!(0,te.A)(o),h=i?{dangerouslySetInnerHTML:{__html:i}}:{children:(0,c.jsxs)(c.Fragment,{children:[a,m&&(0,c.jsx)(re.A,Object.assign({},l&&{width:12,height:12}))]})};return o?(0,c.jsx)(X.A,Object.assign({href:s?p:o},u,h)):(0,c.jsx)(X.A,Object.assign({to:f,isNavLink:!0},(t||n)&&{isActive:function(e,t){return n?(0,ne.G)(n,t.pathname):t.pathname.startsWith(d)}},u,h))}var ie=["className","isDropdownItem"],le=["className","isDropdownItem"],se=["mobile","position"];function ue(e){var t=e.className,n=e.isDropdownItem,r=void 0!==n&&n,a=(0,k.A)(e,ie),i=(0,c.jsx)(ae,Object.assign({className:(0,o.A)(r?"dropdown__link":"navbar__item navbar__link",t),isDropdownLink:r},a));return r?(0,c.jsx)("li",{children:i}):i}function ce(e){var t=e.className,n=(e.isDropdownItem,(0,k.A)(e,le));return(0,c.jsx)("li",{className:"menu__list-item",children:(0,c.jsx)(ae,Object.assign({className:(0,o.A)("menu__link",t)},n))})}function fe(e){var t,n=e.mobile,r=void 0!==n&&n,o=(e.position,(0,k.A)(e,se)),a=r?ce:ue;return(0,c.jsx)(a,Object.assign({},o,{activeClassName:null!=(t=o.activeClassName)?t:r?"menu__link--active":"navbar__link--active"}))}var de=n(7818),pe=n(4421),me=n(9068);const he="dropdownNavbarItemMobile_m4vp";var ge=["items","position","className","onClick"],ve=["items","className","position","onClick"],ye=["mobile"];function be(e,t){return e.some((function(e){return function(e,t){return!!(0,pe.ys)(e.to,t)||!!(0,ne.G)(e.activeBaseRegex,t)||!(!e.activeBasePath||!t.startsWith(e.activeBasePath))}(e,t)}))}function we(e){var t,n=e.items,a=e.position,i=e.className,l=(e.onClick,(0,k.A)(e,ge)),s=(0,r.useRef)(null),u=(0,r.useState)(!1),f=u[0],d=u[1];return(0,r.useEffect)((function(){var e=function(e){s.current&&!s.current.contains(e.target)&&d(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),document.addEventListener("focusin",e),function(){document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e),document.removeEventListener("focusin",e)}}),[s]),(0,c.jsxs)("div",{ref:s,className:(0,o.A)("navbar__item","dropdown","dropdown--hoverable",{"dropdown--right":"right"===a,"dropdown--show":f}),children:[(0,c.jsx)(ae,Object.assign({"aria-haspopup":"true","aria-expanded":f,role:"button",href:l.to?void 0:"#",className:(0,o.A)("navbar__link",i)},l,{onClick:l.to?void 0:function(e){return e.preventDefault()},onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),d(!f))},children:null!=(t=l.children)?t:l.label})),(0,c.jsx)("ul",{className:"dropdown__menu",children:n.map((function(e,t){return(0,r.createElement)(tt,Object.assign({isDropdownItem:!0,activeClassName:"dropdown__link--active"},e,{key:t}))}))})]})}function Se(e){var t,n,a=e.items,i=e.className,s=(e.position,e.onClick),u=(0,k.A)(e,ve),f=(n=(0,me.A)().siteConfig.baseUrl,(0,l.zy)().pathname.replace(n,"/")),d=be(a,f),p=(0,de.u)({initialState:function(){return!d}}),m=p.collapsed,h=p.toggleCollapsed,g=p.setCollapsed;return(0,r.useEffect)((function(){d&&g(!d)}),[f,d,g]),(0,c.jsxs)("li",{className:(0,o.A)("menu__list-item",{"menu__list-item--collapsed":m}),children:[(0,c.jsx)(ae,Object.assign({role:"button",className:(0,o.A)(he,"menu__link menu__link--sublist menu__link--sublist-caret",i)},u,{onClick:function(e){e.preventDefault(),h()},children:null!=(t=u.children)?t:u.label})),(0,c.jsx)(de.N,{lazy:!0,as:"ul",className:"menu__list",collapsed:m,children:a.map((function(e,t){return(0,r.createElement)(tt,Object.assign({mobile:!0,isDropdownItem:!0,onClick:s,activeClassName:"menu__link--active"},e,{key:t}))}))})]})}function ke(e){var t=e.mobile,n=void 0!==t&&t,r=(0,k.A)(e,ye),o=n?Se:we;return(0,c.jsx)(o,Object.assign({},r))}var xe=n(4183),Ee=["width","height"];function _e(e){var t=e.width,n=void 0===t?20:t,r=e.height,o=void 0===r?20:r,a=(0,k.A)(e,Ee);return(0,c.jsx)("svg",Object.assign({viewBox:"0 0 24 24",width:n,height:o,"aria-hidden":!0},a,{children:(0,c.jsx)("path",{fill:"currentColor",d:"M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"})}))}const Oe="iconLanguage_Y2gS";var je=["mobile","dropdownItemsBefore","dropdownItemsAfter","queryString"];var Ae=n(162),Ce=n(9914),Te=n(8498),Pe=n(2939),Ie=n(1527),Ne=n(1923),Re=n(3);function De(){var e;return["language:"+(0,me.A)().i18n.currentLocale,(e=(0,Re.v)(),[Ne.C].concat(e)).map((function(e){return"docusaurus_tag:"+e}))]}const Le={button:{buttonText:(0,s.T)({id:"theme.SearchBar.label",message:"Search",description:"The ARIA label and placeholder for search button"}),buttonAriaLabel:(0,s.T)({id:"theme.SearchBar.label",message:"Search",description:"The ARIA label and placeholder for search button"})},modal:{searchBox:{resetButtonTitle:(0,s.T)({id:"theme.SearchModal.searchBox.resetButtonTitle",message:"Clear the query",description:"The label and ARIA label for search box reset button"}),resetButtonAriaLabel:(0,s.T)({id:"theme.SearchModal.searchBox.resetButtonTitle",message:"Clear the query",description:"The label and ARIA label for search box reset button"}),cancelButtonText:(0,s.T)({id:"theme.SearchModal.searchBox.cancelButtonText",message:"Cancel",description:"The label and ARIA label for search box cancel button"}),cancelButtonAriaLabel:(0,s.T)({id:"theme.SearchModal.searchBox.cancelButtonText",message:"Cancel",description:"The label and ARIA label for search box cancel button"})},startScreen:{recentSearchesTitle:(0,s.T)({id:"theme.SearchModal.startScreen.recentSearchesTitle",message:"Recent",description:"The title for recent searches"}),noRecentSearchesText:(0,s.T)({id:"theme.SearchModal.startScreen.noRecentSearchesText",message:"No recent searches",description:"The text when no recent searches"}),saveRecentSearchButtonTitle:(0,s.T)({id:"theme.SearchModal.startScreen.saveRecentSearchButtonTitle",message:"Save this search",description:"The label for save recent search button"}),removeRecentSearchButtonTitle:(0,s.T)({id:"theme.SearchModal.startScreen.removeRecentSearchButtonTitle",message:"Remove this search from history",description:"The label for remove recent search button"}),favoriteSearchesTitle:(0,s.T)({id:"theme.SearchModal.startScreen.favoriteSearchesTitle",message:"Favorite",description:"The title for favorite searches"}),removeFavoriteSearchButtonTitle:(0,s.T)({id:"theme.SearchModal.startScreen.removeFavoriteSearchButtonTitle",message:"Remove this search from favorites",description:"The label for remove favorite search button"})},errorScreen:{titleText:(0,s.T)({id:"theme.SearchModal.errorScreen.titleText",message:"Unable to fetch results",description:"The title for error screen of search modal"}),helpText:(0,s.T)({id:"theme.SearchModal.errorScreen.helpText",message:"You might want to check your network connection.",description:"The help text for error screen of search modal"})},footer:{selectText:(0,s.T)({id:"theme.SearchModal.footer.selectText",message:"to select",description:"The explanatory text of the action for the enter key"}),selectKeyAriaLabel:(0,s.T)({id:"theme.SearchModal.footer.selectKeyAriaLabel",message:"Enter key",description:"The ARIA label for the Enter key button that makes the selection"}),navigateText:(0,s.T)({id:"theme.SearchModal.footer.navigateText",message:"to navigate",description:"The explanatory text of the action for the Arrow up and Arrow down key"}),navigateUpKeyAriaLabel:(0,s.T)({id:"theme.SearchModal.footer.navigateUpKeyAriaLabel",message:"Arrow up",description:"The ARIA label for the Arrow up key button that makes the navigation"}),navigateDownKeyAriaLabel:(0,s.T)({id:"theme.SearchModal.footer.navigateDownKeyAriaLabel",message:"Arrow down",description:"The ARIA label for the Arrow down key button that makes the navigation"}),closeText:(0,s.T)({id:"theme.SearchModal.footer.closeText",message:"to close",description:"The explanatory text of the action for Escape key"}),closeKeyAriaLabel:(0,s.T)({id:"theme.SearchModal.footer.closeKeyAriaLabel",message:"Escape key",description:"The ARIA label for the Escape key button that close the modal"}),searchByText:(0,s.T)({id:"theme.SearchModal.footer.searchByText",message:"Search by",description:"The text explain that the search is making by Algolia"})},noResultsScreen:{noResultsText:(0,s.T)({id:"theme.SearchModal.noResultsScreen.noResultsText",message:"No results for",description:"The text explains that there are no results for the following search"}),suggestedQueryText:(0,s.T)({id:"theme.SearchModal.noResultsScreen.suggestedQueryText",message:"Try searching for",description:"The text for the suggested query when no results are found for the following search"}),reportMissingResultsText:(0,s.T)({id:"theme.SearchModal.noResultsScreen.reportMissingResultsText",message:"Believe this query should return results?",description:"The text for the question where the user thinks there are missing results"}),reportMissingResultsLinkText:(0,s.T)({id:"theme.SearchModal.noResultsScreen.reportMissingResultsLinkText",message:"Let us know.",description:"The text for the link to report missing results"})}},placeholder:(0,s.T)({id:"theme.SearchModal.placeholder",message:"Search docs",description:"The placeholder of the input of the DocSearch pop-up modal"})};var Me=["contextualSearch","externalUrlRegex"],Fe=null;function Be(e){var t=e.hit,n=e.children;return(0,c.jsx)(X.A,{to:t.url,children:n})}function ze(e){var t=e.state,n=e.onClose,r=(0,Pe.w)();return(0,c.jsx)(X.A,{to:r(t.query),onClick:n,children:(0,c.jsx)(s.A,{id:"theme.SearchBar.seeAll",values:{count:t.context.nbHits},children:"See all {count} results"})})}function Ue(e){var t,o,a,i,s=e.contextualSearch,u=e.externalUrlRegex,f=(0,k.A)(e,Me),d=(0,me.A)().siteMetadata,p=(0,Ie.C)(),m=De(),h=null!=(t=null==(o=f.searchParameters)?void 0:o.facetFilters)?t:[],g=s?(a=h,[].concat((i=function(e){return"string"==typeof e?[e]:e})(m),i(a))):h,v=Object.assign({},f.searchParameters,{facetFilters:g}),y=(0,l.W6)(),b=(0,r.useRef)(null),w=(0,r.useRef)(null),S=(0,r.useState)(!1),x=S[0],E=S[1],_=(0,r.useState)(void 0),O=_[0],j=_[1],A=(0,r.useCallback)((function(){return Fe?Promise.resolve():Promise.all([n.e(284).then(n.bind(n,8284)),Promise.all([n.e(869),n.e(879)]).then(n.bind(n,5879)),Promise.all([n.e(869),n.e(808)]).then(n.bind(n,7808))]).then((function(e){var t=e[0].DocSearchModal;Fe=t}))}),[]),C=(0,r.useCallback)((function(){if(!b.current){var e=document.createElement("div");b.current=e,document.body.insertBefore(e,document.body.firstChild)}}),[]),T=(0,r.useCallback)((function(){C(),A().then((function(){return E(!0)}))}),[A,C]),P=(0,r.useCallback)((function(){var e;E(!1),null==(e=w.current)||e.focus()}),[]),I=(0,r.useCallback)((function(e){"f"===e.key&&(e.metaKey||e.ctrlKey)||(e.preventDefault(),j(e.key),T())}),[T]),N=(0,r.useRef)({navigate:function(e){var t=e.itemUrl;(0,ne.G)(u,t)?window.location.href=t:y.push(t)}}).current,R=(0,r.useRef)((function(e){return f.transformItems?f.transformItems(e):e.map((function(e){return Object.assign({},e,{url:p(e.url)})}))})).current,D=(0,r.useMemo)((function(){return function(e){return(0,c.jsx)(ze,Object.assign({},e,{onClose:P}))}}),[P]),L=(0,r.useCallback)((function(e){return e.addAlgoliaAgent("docusaurus",d.docusaurusVersion),e}),[d.docusaurusVersion]);return(0,Ce.E8)({isOpen:x,onOpen:T,onClose:P,onInput:I,searchButtonRef:w}),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Te.A,{children:(0,c.jsx)("link",{rel:"preconnect",href:"https://"+f.appId+"-dsn.algolia.net",crossOrigin:"anonymous"})}),(0,c.jsx)(Ce.Bc,{onTouchStart:A,onFocus:A,onMouseOver:A,onClick:T,ref:w,translations:Le.button}),x&&Fe&&b.current&&(0,Ae.createPortal)((0,c.jsx)(Fe,Object.assign({onClose:P,initialScrollY:window.scrollY,initialQuery:O,navigator:N,transformItems:R,hitComponent:Be,transformSearchClient:L},f.searchPagePath&&{resultsFooterComponent:D},f,{searchParameters:v,placeholder:Le.placeholder,translations:Le.modal})),b.current)]})}function qe(){var e=(0,me.A)().siteConfig;return(0,c.jsx)(Ue,Object.assign({},e.themeConfig.algolia))}const He={navbarSearchContainer:"navbarSearchContainer_Uox2"};function $e(e){var t=e.children,n=e.className;return(0,c.jsx)("div",{className:(0,o.A)(n,He.navbarSearchContainer),children:t})}var Ve=n(4858),Ge=n(6534),We=["docId","label","docsPluginId"];var Ke=["sidebarId","label","docsPluginId"];var Qe=["label","to","docsPluginId"];var Ye=n(4100),Je=["mobile","docsPluginId","dropdownActiveClassDisabled","dropdownItemsBefore","dropdownItemsAfter"];function Ze(e,t){var n;return null!=(n=t.alternateDocVersions[e.name])?n:function(e){return e.docs.find((function(t){return t.id===e.mainDocId}))}(e)}const Xe={default:fe,localeDropdown:function(e){var t=e.mobile,n=e.dropdownItemsBefore,r=e.dropdownItemsAfter,o=e.queryString,a=void 0===o?"":o,i=(0,k.A)(e,je),u=(0,me.A)().i18n,f=u.currentLocale,d=u.locales,p=u.localeConfigs,m=(0,xe.o)(),h=(0,l.zy)(),g=h.search,v=h.hash,y=d.map((function(e){var n=""+("pathname://"+m.createUrl({locale:e,fullyQualified:!1}))+g+v+a;return{label:p[e].label,lang:p[e].htmlLang,to:n,target:"_self",autoAddBaseUrl:!1,className:e===f?t?"menu__link--active":"dropdown__link--active":""}})),b=[].concat(n,y,r),w=t?(0,s.T)({message:"Languages",id:"theme.navbar.mobileLanguageDropdown.label",description:"The label for the mobile language switcher dropdown"}):p[f].label;return(0,c.jsx)(ke,Object.assign({},i,{mobile:t,label:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(_e,{className:Oe}),w]}),items:b}))},search:function(e){var t=e.mobile,n=e.className;return t?null:(0,c.jsx)($e,{className:n,children:(0,c.jsx)(qe,{})})},dropdown:ke,html:function(e){var t=e.value,n=e.className,r=e.mobile,a=void 0!==r&&r,i=e.isDropdownItem,l=void 0!==i&&i,s=l?"li":"div";return(0,c.jsx)(s,{className:(0,o.A)({navbar__item:!a&&!l,"menu__list-item":a},n),dangerouslySetInnerHTML:{__html:t}})},doc:function(e){var t=e.docId,n=e.label,r=e.docsPluginId,o=(0,k.A)(e,We),a=(0,Ve.zK)(r).activeDoc,i=(0,Ge.QB)(t,r),l=(null==a?void 0:a.path)===(null==i?void 0:i.path);return null===i||i.unlisted&&!l?null:(0,c.jsx)(fe,Object.assign({exact:!0},o,{isActive:function(){return l||!(null==a||!a.sidebar)&&a.sidebar===i.sidebar},label:null!=n?n:i.id,to:i.path}))},docSidebar:function(e){var t=e.sidebarId,n=e.label,r=e.docsPluginId,o=(0,k.A)(e,Ke),a=(0,Ve.zK)(r).activeDoc,i=(0,Ge.fW)(t,r).link;if(!i)throw new Error('DocSidebarNavbarItem: Sidebar with ID "'+t+"\" doesn't have anything to be linked to.");return(0,c.jsx)(fe,Object.assign({exact:!0},o,{isActive:function(){return(null==a?void 0:a.sidebar)===t},label:null!=n?n:i.label,to:i.path}))},docsVersion:function(e){var t=e.label,n=e.to,r=e.docsPluginId,o=(0,k.A)(e,Qe),a=(0,Ge.Vd)(r)[0],i=null!=t?t:a.label,l=null!=n?n:function(e){return e.docs.find((function(t){return t.id===e.mainDocId}))}(a).path;return(0,c.jsx)(fe,Object.assign({},o,{label:i,to:l}))},docsVersionDropdown:function(e){var t=e.mobile,n=e.docsPluginId,r=e.dropdownActiveClassDisabled,o=e.dropdownItemsBefore,a=e.dropdownItemsAfter,i=(0,k.A)(e,Je),u=(0,l.zy)(),f=u.search,d=u.hash,p=(0,Ve.zK)(n),m=(0,Ve.jh)(n),h=(0,Ye.g1)(n).savePreferredVersionName,g=[].concat(o,m.map((function(e){var t=Ze(e,p);return{label:e.label,to:""+t.path+f+d,isActive:function(){return e===p.activeVersion},onClick:function(){return h(e.name)}}})),a),v=(0,Ge.Vd)(n)[0],y=t&&g.length>1?(0,s.T)({id:"theme.navbar.mobileVersionsDropdown.label",message:"Versions",description:"The label for the navbar versions dropdown on mobile view"}):v.label,b=t&&g.length>1?void 0:Ze(v,p).path;return g.length<=1?(0,c.jsx)(fe,Object.assign({},i,{mobile:t,label:y,to:b,isActive:r?function(){return!1}:void 0})):(0,c.jsx)(ke,Object.assign({},i,{mobile:t,label:y,to:b,items:g,isActive:r?function(){return!1}:void 0}))}};var et=["type"];function tt(e){var t=e.type,n=(0,k.A)(e,et),r=function(e,t){return e&&"default"!==e?e:"items"in t?"dropdown":"default"}(t,n),o=Xe[r];if(!o)throw new Error('No NavbarItem component found for type "'+t+'".');return(0,c.jsx)(o,Object.assign({},n))}function nt(){var e=(0,P.M)(),t=(0,w.p)().navbar.items;return(0,c.jsx)("ul",{className:"menu__list",children:t.map((function(t,n){return(0,r.createElement)(tt,Object.assign({mobile:!0},t,{onClick:function(){return e.toggle()},key:n}))}))})}function rt(e){return(0,c.jsx)("button",Object.assign({},e,{type:"button",className:"clean-btn navbar-sidebar__back",children:(0,c.jsx)(s.A,{id:"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel",description:"The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)",children:"\u2190 Back to main menu"})}))}function ot(){var e=0===(0,w.p)().navbar.items.length,t=F();return(0,c.jsxs)(c.Fragment,{children:[!e&&(0,c.jsx)(rt,{onClick:function(){return t.hide()}}),t.content]})}function at(){var e,t=(0,P.M)();return void 0===(e=t.shown)&&(e=!0),(0,r.useEffect)((function(){return document.body.style.overflow=e?"hidden":"visible",function(){document.body.style.overflow="visible"}}),[e]),t.shouldRender?(0,c.jsx)(B,{header:(0,c.jsx)(Z,{}),primaryMenu:(0,c.jsx)(nt,{}),secondaryMenu:(0,c.jsx)(ot,{})}):null}const it={navbarHideable:"navbarHideable_RgjD",navbarHidden:"navbarHidden_PyO1"};function lt(e){return(0,c.jsx)("div",Object.assign({role:"presentation"},e,{className:(0,o.A)("navbar-sidebar__backdrop",e.className)}))}function st(e){var t=e.children,n=(0,w.p)().navbar,a=n.hideOnScroll,i=n.style,l=(0,P.M)(),f=function(e){var t=(0,r.useState)(e),n=t[0],o=t[1],a=(0,r.useRef)(!1),i=(0,r.useRef)(0),l=(0,r.useCallback)((function(e){null!==e&&(i.current=e.getBoundingClientRect().height)}),[]);return(0,I.Mq)((function(t,n){var r=t.scrollY;if(e)if(r=l?o(!1):r+u0&&(0,c.jsx)(It,{links:n}),logo:r&&(0,c.jsx)(Lt,{logo:r}),copyright:t&&(0,c.jsx)(Mt,{copyright:t})})}const zt=r.memo(Bt);var Ut=(0,N.fM)([z.a,S.o,I.Tv,Ye.VQ,i.Jx,function(e){var t=e.children;return(0,c.jsx)(R.y_,{children:(0,c.jsx)(P.e,{children:(0,c.jsx)(L,{children:t})})})}]);function qt(e){var t=e.children;return(0,c.jsx)(Ut,{children:t})}var Ht=n(7887);function $t(e){var t=e.error,n=e.tryAgain;return(0,c.jsx)("main",{className:"container margin-vert--xl",children:(0,c.jsx)("div",{className:"row",children:(0,c.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,c.jsx)(Ht.A,{as:"h1",className:"hero__title",children:(0,c.jsx)(s.A,{id:"theme.ErrorPageContent.title",description:"The title of the fallback page when the page crashed",children:"This page crashed."})}),(0,c.jsx)("div",{className:"margin-vert--lg",children:(0,c.jsx)(dt,{onClick:n,className:"button button--primary shadow--lw"})}),(0,c.jsx)("hr",{}),(0,c.jsx)("div",{className:"margin-vert--md",children:(0,c.jsx)(pt,{error:t})})]})})})}const Vt={mainWrapper:"mainWrapper_eDIG"};function Gt(e){var t=e.children,n=e.noFooter,r=e.wrapperClassName,l=e.title,s=e.description;return(0,v.J)(),(0,c.jsxs)(qt,{children:[(0,c.jsx)(i.be,{title:l,description:s}),(0,c.jsx)(b,{}),(0,c.jsx)(T,{}),(0,c.jsx)(xt,{}),(0,c.jsx)("div",{id:f,className:(0,o.A)(g.G.wrapper.main,Vt.mainWrapper,r),children:(0,c.jsx)(a.A,{fallback:function(e){return(0,c.jsx)($t,Object.assign({},e))},children:t})}),!n&&(0,c.jsx)(zt,{})]})}},1167:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var r=n(4528),o=(n(2581),n(2772)),a=n(4447),i=n(9068),l=n(6938),s=n(9817),u=n(9793),c=["imageClassName","titleClassName"];function f(e){var t=e.logo,n=e.alt,r=e.imageClassName,o={light:(0,a.Ay)(t.src),dark:(0,a.Ay)(t.srcDark||t.src)},i=(0,u.jsx)(s.A,{className:t.className,sources:o,height:t.height,width:t.width,alt:n,style:t.style});return r?(0,u.jsx)("div",{className:r,children:i}):i}function d(e){var t,n=(0,i.A)().siteConfig.title,s=(0,l.p)().navbar,d=s.title,p=s.logo,m=e.imageClassName,h=e.titleClassName,g=(0,r.A)(e,c),v=(0,a.Ay)((null==p?void 0:p.href)||"/"),y=d?"":n,b=null!=(t=null==p?void 0:p.alt)?t:y;return(0,u.jsxs)(o.A,Object.assign({to:v},g,(null==p?void 0:p.target)&&{target:p.target},{children:[p&&(0,u.jsx)(f,{logo:p,alt:b,imageClassName:m}),null!=d&&(0,u.jsx)("b",{className:h,children:d})]}))}},3381:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});n(2581);var r=n(8498),o=n(9793);function a(e){var t=e.locale,n=e.version,a=e.tag,i=t;return(0,o.jsxs)(r.A,{children:[t&&(0,o.jsx)("meta",{name:"docusaurus_locale",content:t}),n&&(0,o.jsx)("meta",{name:"docusaurus_version",content:n}),a&&(0,o.jsx)("meta",{name:"docusaurus_tag",content:a}),i&&(0,o.jsx)("meta",{name:"docsearch:language",content:i}),n&&(0,o.jsx)("meta",{name:"docsearch:version",content:n}),a&&(0,o.jsx)("meta",{name:"docsearch:docusaurus_tag",content:a})]})}},9817:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var r=n(4528),o=n(2581),a=n(4921),i=n(4069),l=n(7545);const s={themedComponent:"themedComponent_GVQ4","themedComponent--light":"themedComponent--light_TJu1","themedComponent--dark":"themedComponent--dark_NwPQ"};var u=n(9793);function c(e){var t=e.className,n=e.children,r=(0,i.A)(),c=(0,l.G)().colorMode;return(0,u.jsx)(u.Fragment,{children:(r?"dark"===c?["dark"]:["light"]:["light","dark"]).map((function(e){var r=n({theme:e,className:(0,a.A)(t,s.themedComponent,s["themedComponent--"+e])});return(0,u.jsx)(o.Fragment,{children:r},e)}))})}var f=["sources","className","alt"];function d(e){var t=e.sources,n=e.className,o=e.alt,a=(0,r.A)(e,f);return(0,u.jsx)(c,{className:n,children:function(e){var n=e.theme,r=e.className;return(0,u.jsx)("img",Object.assign({src:t[n],alt:o,className:r},a))}})}},7818:(e,t,n)=>{"use strict";n.d(t,{N:()=>w,u:()=>d});var r=n(4528),o=n(2581),a=n(2651),i=n(9847),l=n(9497),s=n(9793),u=["collapsed"],c=["lazy"],f="ease-in-out";function d(e){var t=e.initialState,n=(0,o.useState)(null!=t&&t),r=n[0],a=n[1],i=(0,o.useCallback)((function(){a((function(e){return!e}))}),[]);return{collapsed:r,setCollapsed:a,toggleCollapsed:i}}var p={display:"none",overflow:"hidden",height:"0px"},m={display:"block",overflow:"visible",height:"auto"};function h(e,t){var n=t?p:m;e.style.display=n.display,e.style.overflow=n.overflow,e.style.height=n.height}function g(e){var t=e.collapsibleRef,n=e.collapsed,r=e.animation,a=(0,o.useRef)(!1);(0,o.useEffect)((function(){var e,o=t.current;function i(){var e,t,n=o.scrollHeight,a=null!=(e=null==r?void 0:r.duration)?e:function(e){if((0,l.O)())return 1;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}(n);return{transition:"height "+a+"ms "+(null!=(t=null==r?void 0:r.easing)?t:f),height:n+"px"}}function s(){var e=i();o.style.transition=e.transition,o.style.height=e.height}if(!a.current)return h(o,n),void(a.current=!0);return o.style.willChange="height",e=requestAnimationFrame((function(){n?(s(),requestAnimationFrame((function(){o.style.height=p.height,o.style.overflow=p.overflow}))):(o.style.display="block",requestAnimationFrame((function(){s()})))})),function(){return cancelAnimationFrame(e)}}),[t,n,r])}function v(e){if(!a.A.canUseDOM)return e?p:m}function y(e){var t=e.as,n=void 0===t?"div":t,r=e.collapsed,a=e.children,i=e.animation,l=e.onCollapseTransitionEnd,u=e.className,c=e.disableSSRStyle,f=(0,o.useRef)(null);return g({collapsibleRef:f,collapsed:r,animation:i}),(0,s.jsx)(n,{ref:f,style:c?void 0:v(r),onTransitionEnd:function(e){"height"===e.propertyName&&(h(f.current,r),null==l||l(r))},className:u,children:a})}function b(e){var t=e.collapsed,n=(0,r.A)(e,u),a=(0,o.useState)(!t),l=a[0],c=a[1],f=(0,o.useState)(t),d=f[0],p=f[1];return(0,i.A)((function(){t||c(!0)}),[t]),(0,i.A)((function(){l&&p(t)}),[l,t]),l?(0,s.jsx)(y,Object.assign({},n,{collapsed:d})):null}function w(e){var t=e.lazy,n=(0,r.A)(e,c),o=t?b:y;return(0,s.jsx)(o,Object.assign({},n))}},5701:(e,t,n)=>{"use strict";n.d(t,{M:()=>h,o:()=>m});var r=n(2581),o=n(4069),a=n(4071),i=n(4222),l=n(6938),s=n(9793),u=(0,a.Wf)("docusaurus.announcement.dismiss"),c=(0,a.Wf)("docusaurus.announcement.id"),f=function(){return"true"===u.get()},d=function(e){return u.set(String(e))},p=r.createContext(null);function m(e){var t=e.children,n=function(){var e=(0,l.p)().announcementBar,t=(0,o.A)(),n=(0,r.useState)((function(){return!!t&&f()})),a=n[0],i=n[1];(0,r.useEffect)((function(){i(f())}),[]);var s=(0,r.useCallback)((function(){d(!0),i(!0)}),[]);return(0,r.useEffect)((function(){if(e){var t=e.id,n=c.get();"annoucement-bar"===n&&(n="announcement-bar");var r=t!==n;c.set(t),r&&d(!1),!r&&f()||i(!1)}}),[e]),(0,r.useMemo)((function(){return{isActive:!!e&&!a,close:s}}),[e,a,s])}();return(0,s.jsx)(p.Provider,{value:n,children:t})}function h(){var e=(0,r.useContext)(p);if(!e)throw new i.dV("AnnouncementBarProvider");return e}},7545:(e,t,n)=>{"use strict";n.d(t,{G:()=>v,a:()=>g});var r=n(2581),o=n(2651),a=n(4222),i=n(4071),l=n(6938),s=n(9793),u=r.createContext(void 0),c="theme",f=(0,i.Wf)(c),d={light:"light",dark:"dark"},p=function(e){return e===d.dark?d.dark:d.light},m=function(e){return o.A.canUseDOM?p(document.documentElement.getAttribute("data-theme")):p(e)},h=function(e){f.set(p(e))};function g(e){var t=e.children,n=function(){var e=(0,l.p)().colorMode,t=e.defaultMode,n=e.disableSwitch,o=e.respectPrefersColorScheme,a=(0,r.useState)(m(t)),i=a[0],s=a[1];(0,r.useEffect)((function(){n&&f.del()}),[n]);var u=(0,r.useCallback)((function(e,n){void 0===n&&(n={});var r=n.persist,a=void 0===r||r;e?(s(e),a&&h(e)):(s(o?window.matchMedia("(prefers-color-scheme: dark)").matches?d.dark:d.light:t),f.del())}),[o,t]);(0,r.useEffect)((function(){document.documentElement.setAttribute("data-theme",p(i))}),[i]),(0,r.useEffect)((function(){if(!n){var e=function(e){if(e.key===c){var t=f.get();null!==t&&u(p(t))}};return window.addEventListener("storage",e),function(){return window.removeEventListener("storage",e)}}}),[n,u]);var g=(0,r.useRef)(!1);return(0,r.useEffect)((function(){if(!n||o){var e=window.matchMedia("(prefers-color-scheme: dark)"),t=function(){window.matchMedia("print").matches||g.current?g.current=window.matchMedia("print").matches:u(null)};return e.addListener(t),function(){return e.removeListener(t)}}}),[u,n,o]),(0,r.useMemo)((function(){return{colorMode:i,setColorMode:u,get isDarkTheme(){return i===d.dark},setLightTheme:function(){u(d.light)},setDarkTheme:function(){u(d.dark)}}}),[i,u])}();return(0,s.jsx)(u.Provider,{value:n,children:t})}function v(){var e=(0,r.useContext)(u);if(null==e)throw new a.dV("ColorModeProvider","Please see https://docusaurus.io/docs/api/themes/configuration#use-color-mode.");return e}},1673:(e,t,n)=>{"use strict";n.d(t,{M:()=>p,e:()=>d});var r=n(2581),o=n(3948),a=n(1721),i=n(6809),l=n(6938),s=n(4222),u=n(9793),c=r.createContext(void 0);function f(){var e,t=(e=(0,o.YL)(),0===(0,l.p)().navbar.items.length&&!e.component),n=(0,a.l)(),s=!t&&"mobile"===n,u=(0,r.useState)(!1),c=u[0],f=u[1];(0,i.$Z)((function(){if(c)return f(!1),!1}));var d=(0,r.useCallback)((function(){f((function(e){return!e}))}),[]);return(0,r.useEffect)((function(){"desktop"===n&&f(!1)}),[n]),(0,r.useMemo)((function(){return{disabled:t,shouldRender:s,toggle:d,shown:c}}),[t,s,d,c])}function d(e){var t=e.children,n=f();return(0,u.jsx)(c.Provider,{value:n,children:t})}function p(){var e=r.useContext(c);if(void 0===e)throw new s.dV("NavbarMobileSidebarProvider");return e}},3948:(e,t,n)=>{"use strict";n.d(t,{GX:()=>u,YL:()=>s,y_:()=>l});var r=n(2581),o=n(4222),a=n(9793),i=r.createContext(null);function l(e){var t=e.children,n=(0,r.useState)({component:null,props:null});return(0,a.jsx)(i.Provider,{value:n,children:t})}function s(){var e=(0,r.useContext)(i);if(!e)throw new o.dV("NavbarSecondaryMenuContentProvider");return e[0]}function u(e){var t=e.component,n=e.props,a=(0,r.useContext)(i);if(!a)throw new o.dV("NavbarSecondaryMenuContentProvider");var l=a[1],s=(0,o.Be)(n);return(0,r.useEffect)((function(){l({component:t,props:s})}),[l,t,s]),(0,r.useEffect)((function(){return function(){return l({component:null,props:null})}}),[l]),null}},1296:(e,t,n)=>{"use strict";n.d(t,{w:()=>o,J:()=>a});var r=n(2581),o="navigation-with-keyboard";function a(){(0,r.useEffect)((function(){function e(e){"keydown"===e.type&&"Tab"===e.key&&document.body.classList.add(o),"mousedown"===e.type&&document.body.classList.remove(o)}return document.addEventListener("keydown",e),document.addEventListener("mousedown",e),function(){document.body.classList.remove(o),document.removeEventListener("keydown",e),document.removeEventListener("mousedown",e)}}),[])}},2939:(e,t,n)=>{"use strict";n.d(t,{b:()=>l,w:()=>s});var r=n(2581),o=n(9068),a=n(6809),i="q";function l(){return(0,a.l)(i)}function s(){var e=(0,o.A)().siteConfig,t=e.baseUrl,n=e.themeConfig.algolia.searchPagePath;return(0,r.useCallback)((function(e){return""+t+n+"?"+i+"="+encodeURIComponent(e)}),[t,n])}},1721:(e,t,n)=>{"use strict";n.d(t,{l:()=>l});var r=n(2581),o=n(2651),a={desktop:"desktop",mobile:"mobile",ssr:"ssr"},i=996;function l(e){var t=(void 0===e?{}:e).desktopBreakpoint,n=void 0===t?i:t,l=(0,r.useState)((function(){return"ssr"})),s=l[0],u=l[1];return(0,r.useEffect)((function(){function e(){u(function(e){if(!o.A.canUseDOM)throw new Error("getWindowSize() should only be called after React hydration");return window.innerWidth>e?a.desktop:a.mobile}(n))}return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[n]),s}},8051:(e,t,n)=>{"use strict";n.d(t,{G:()=>r});var r={page:{blogListPage:"blog-list-page",blogPostPage:"blog-post-page",blogTagsListPage:"blog-tags-list-page",blogTagPostListPage:"blog-tags-post-list-page",blogAuthorsListPage:"blog-authors-list-page",blogAuthorsPostsPage:"blog-authors-posts-page",docsDocPage:"docs-doc-page",docsTagsListPage:"docs-tags-list-page",docsTagDocListPage:"docs-tags-doc-list-page",mdxPage:"mdx-page"},wrapper:{main:"main-wrapper",blogPages:"blog-wrapper",docsPages:"docs-wrapper",mdxPages:"mdx-wrapper"},common:{editThisPage:"theme-edit-this-page",lastUpdated:"theme-last-updated",backToTopButton:"theme-back-to-top-button",codeBlock:"theme-code-block",admonition:"theme-admonition",unlistedBanner:"theme-unlisted-banner",draftBanner:"theme-draft-banner",admonitionType:function(e){return"theme-admonition-"+e}},layout:{},docs:{docVersionBanner:"theme-doc-version-banner",docVersionBadge:"theme-doc-version-badge",docBreadcrumbs:"theme-doc-breadcrumbs",docMarkdown:"theme-doc-markdown",docTocMobile:"theme-doc-toc-mobile",docTocDesktop:"theme-doc-toc-desktop",docFooter:"theme-doc-footer",docFooterTagsRow:"theme-doc-footer-tags-row",docFooterEditMetaRow:"theme-doc-footer-edit-meta-row",docSidebarContainer:"theme-doc-sidebar-container",docSidebarMenu:"theme-doc-sidebar-menu",docSidebarItemCategory:"theme-doc-sidebar-item-category",docSidebarItemLink:"theme-doc-sidebar-item-link",docSidebarItemCategoryLevel:function(e){return"theme-doc-sidebar-item-category-level-"+e},docSidebarItemLinkLevel:function(e){return"theme-doc-sidebar-item-link-level-"+e}},blog:{blogFooterTagsRow:"theme-blog-footer-tags-row",blogFooterEditMetaRow:"theme-blog-footer-edit-meta-row"},pages:{pageFooterEditMetaRow:"theme-pages-footer-edit-meta-row"}}},9497:(e,t,n)=>{"use strict";function r(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}n.d(t,{O:()=>r})},5381:(e,t,n)=>{"use strict";n.d(t,{s:()=>o});var r=n(9068);function o(e){var t=(0,r.A)().siteConfig,n=t.title,o=t.titleDelimiter;return null!=e&&e.trim().length?e.trim()+" "+o+" "+n:n}},6809:(e,t,n)=>{"use strict";n.d(t,{$Z:()=>i,l:()=>s});var r=n(2581),o=n(8516),a=n(4222);function i(e){!function(e){var t=(0,o.W6)(),n=(0,a._q)(e);(0,r.useEffect)((function(){return t.block((function(e,t){return n(e,t)}))}),[t,n])}((function(t,n){if("POP"===n)return e(t,n)}))}function l(e){var t=(0,o.W6)();return(0,r.useSyncExternalStore)(t.listen,(function(){return e(t)}),(function(){return e(t)}))}function s(e){var t,n=null!=(t=function(e){return l((function(t){return null===e?null:new URLSearchParams(t.location.search).get(e)}))}(e))?t:"",a=function(e){var t=(0,o.W6)();return(0,r.useCallback)((function(n,r){var o=new URLSearchParams(t.location.search);n?o.set(e,n):o.delete(e),(null!=r&&r.push?t.push:t.replace)({search:o.toString()})}),[e,t])}(e);return[n,a]}},582:(e,t,n)=>{"use strict";n.d(t,{$z:()=>a,sb:()=>o});var r=n(2436);function o(e){return Array.from(new Set(e))}function a(e,t){for(var n,o={},a=0,i=(0,r.A)(e);!(n=i()).done;){var l=n.value,s=t(l,a);null!=o[s]||(o[s]=[]),o[s].push(l),a+=1}return o}},1448:(e,t,n)=>{"use strict";n.d(t,{Jx:()=>p,be:()=>c,e3:()=>d});var r=n(2581),o=n(4921),a=n(8498),i=n(2765),l=n(4447),s=n(5381),u=n(9793);function c(e){var t=e.title,n=e.description,r=e.keywords,o=e.image,i=e.children,c=(0,s.s)(t),f=(0,l.hH)().withBaseUrl,d=o?f(o,{absolute:!0}):void 0;return(0,u.jsxs)(a.A,{children:[t&&(0,u.jsx)("title",{children:c}),t&&(0,u.jsx)("meta",{property:"og:title",content:c}),n&&(0,u.jsx)("meta",{name:"description",content:n}),n&&(0,u.jsx)("meta",{property:"og:description",content:n}),r&&(0,u.jsx)("meta",{name:"keywords",content:Array.isArray(r)?r.join(","):r}),d&&(0,u.jsx)("meta",{property:"og:image",content:d}),d&&(0,u.jsx)("meta",{name:"twitter:image",content:d}),i]})}var f=r.createContext(void 0);function d(e){var t=e.className,n=e.children,i=r.useContext(f),l=(0,o.A)(i,t);return(0,u.jsxs)(f.Provider,{value:l,children:[(0,u.jsx)(a.A,{children:(0,u.jsx)("html",{className:l})}),n]})}function p(e){var t=e.children,n=(0,i.A)(),r="plugin-"+n.plugin.name.replace(/docusaurus-(?:plugin|theme)-(?:content-)?/gi,""),a="plugin-id-"+n.plugin.id;return(0,u.jsx)(d,{className:(0,o.A)(r,a),children:t})}},4222:(e,t,n)=>{"use strict";n.d(t,{dV:()=>m,fM:()=>g,_q:()=>d,ZC:()=>p,Be:()=>h});var r=n(1627),o=n(6710);function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}var i=n(8413);function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}function s(e){var t="function"==typeof Map?new Map:void 0;return s=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(l())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&(0,i.A)(o,n.prototype),o}(e,arguments,a(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),(0,i.A)(n,e)},s(e)}var u=n(2581),c=n(9847),f=n(9793);function d(e){var t=(0,u.useRef)(e);return(0,c.A)((function(){t.current=e}),[e]),(0,u.useCallback)((function(){return t.current.apply(t,arguments)}),[])}function p(e){var t=(0,u.useRef)();return(0,c.A)((function(){t.current=e})),t.current}var m=function(e){function t(t,n){var o,a,i;return(i=e.call(this)||this).name="ReactContextError",i.message="Hook "+(null!=(o=null==(a=i.stack)||null==(a=a.split("\n")[1])||null==(a=a.match((0,r.A)(/at (?:\w+\.)?(\w+)/,{name:1})))?void 0:a.groups.name)?o:"")+" is called outside the <"+t+">. "+(null!=n?n:""),i}return(0,o.A)(t,e),t}(s(Error));function h(e){var t=Object.entries(e);return t.sort((function(e,t){return e[0].localeCompare(t[0])})),(0,u.useMemo)((function(){return e}),t.flat())}function g(e){return function(t){var n=t.children;return(0,f.jsx)(f.Fragment,{children:e.reduceRight((function(e,t){return(0,f.jsx)(t,{children:e})}),n)})}}},5424:(e,t,n)=>{"use strict";function r(e,t){return void 0!==e&&void 0!==t&&new RegExp(e,"gi").test(t)}n.d(t,{G:()=>r})},4421:(e,t,n)=>{"use strict";n.d(t,{Dt:()=>l,ys:()=>i});var r=n(2581),o=n(7276),a=n(9068);function i(e,t){var n=function(e){var t;return null==(t=!e||e.endsWith("/")?e:e+"/")?void 0:t.toLowerCase()};return n(e)===n(t)}function l(){var e=(0,a.A)().siteConfig.baseUrl;return(0,r.useMemo)((function(){return function(e){var t=e.baseUrl;function n(e){return e.path===t&&!0===e.exact}function r(e){return e.path===t&&!e.exact}return function e(t){if(0!==t.length)return t.find(n)||e(t.filter(r).flatMap((function(e){var t;return null!=(t=e.routes)?t:[]})))}(e.routes)}({routes:o.A,baseUrl:e})}),[e])}},6780:(e,t,n)=>{"use strict";n.d(t,{Mq:()=>d,Tv:()=>u,gk:()=>p});var r=n(2581),o=n(2651),a=n(4069),i=(n(9847),n(4222)),l=n(9793);var s=r.createContext(void 0);function u(e){var t,n=e.children,o=(t=(0,r.useRef)(!0),(0,r.useMemo)((function(){return{scrollEventsEnabledRef:t,enableScrollEvents:function(){t.current=!0},disableScrollEvents:function(){t.current=!1}}}),[]));return(0,l.jsx)(s.Provider,{value:o,children:n})}function c(){var e=(0,r.useContext)(s);if(null==e)throw new i.dV("ScrollControllerProvider");return e}var f=function(){return o.A.canUseDOM?{scrollX:window.pageXOffset,scrollY:window.pageYOffset}:null};function d(e,t){void 0===t&&(t=[]);var n=c().scrollEventsEnabledRef,o=(0,r.useRef)(f()),a=(0,i._q)(e);(0,r.useEffect)((function(){var e=function(){if(n.current){var e=f();a(e,o.current),o.current=e}},t={passive:!0};return e(),window.addEventListener("scroll",e,t),function(){return window.removeEventListener("scroll",e,t)}}),[a,n].concat(t))}function p(){var e=(0,r.useRef)(null),t=(0,a.A)()&&"smooth"===getComputedStyle(document.documentElement).scrollBehavior;return{startScroll:function(n){e.current=t?function(e){return window.scrollTo({top:e,behavior:"smooth"}),function(){}}(n):function(e){var t=null,n=document.documentElement.scrollTop>e;return function r(){var o=document.documentElement.scrollTop;(n&&o>e||!n&&o{"use strict";n.d(t,{C:()=>r});var r="default"},4071:(e,t,n)=>{"use strict";n.d(t,{Wf:()=>u});n(2581);const r=JSON.parse('{"N":"localStorage","M":""}');var o=r.N;function a(e){var t=e.key,n=e.oldValue,r=e.newValue,o=e.storage;if(n!==r){var a=document.createEvent("StorageEvent");a.initStorageEvent("storage",!1,!1,t,n,r,window.location.href,o),window.dispatchEvent(a)}}function i(e){if(void 0===e&&(e=o),"undefined"==typeof window)throw new Error("Browser storage is not available on Node.js/Docusaurus SSR process.");if("none"===e)return null;try{return window[e]}catch(n){return t=n,l||(console.warn("Docusaurus browser storage is not available.\nPossible reasons: running Docusaurus in an iframe, in an incognito browser session, or using too strict browser privacy settings.",t),l=!0),null}var t}var l=!1;var s={get:function(){return null},set:function(){},del:function(){},listen:function(){return function(){}}};function u(e,t){var n=""+e+r.M;if("undefined"==typeof window)return function(e){function t(){throw new Error('Illegal storage API usage for storage key "'+e+'".\nDocusaurus storage APIs are not supposed to be called on the server-rendering process.\nPlease only call storage APIs in effects and event handlers.')}return{get:t,set:t,del:t,listen:t}}(n);var o=i(null==t?void 0:t.persistence);return null===o?s:{get:function(){try{return o.getItem(n)}catch(e){return console.error("Docusaurus storage error, can't get key="+n,e),null}},set:function(e){try{var t=o.getItem(n);o.setItem(n,e),a({key:n,oldValue:t,newValue:e,storage:o})}catch(r){console.error("Docusaurus storage error, can't set "+n+"="+e,r)}},del:function(){try{var e=o.getItem(n);o.removeItem(n),a({key:n,oldValue:e,newValue:null,storage:o})}catch(t){console.error("Docusaurus storage error, can't delete key="+n,t)}},listen:function(e){try{var t=function(t){t.storageArea===o&&t.key===n&&e(t)};return window.addEventListener("storage",t),function(){return window.removeEventListener("storage",t)}}catch(r){return console.error("Docusaurus storage error, can't listen for changes of key="+n,r),function(){}}}}}},4183:(e,t,n)=>{"use strict";n.d(t,{o:()=>i});var r=n(9068),o=n(8516),a=n(4969);function i(){var e=(0,r.A)(),t=e.siteConfig,n=t.baseUrl,i=t.url,l=t.trailingSlash,s=e.i18n,u=s.defaultLocale,c=s.currentLocale,f=(0,o.zy)().pathname,d=(0,a.Ks)(f,{trailingSlash:l,baseUrl:n}),p=c===u?n:n.replace("/"+c+"/","/"),m=d.replace(n,"");return{createUrl:function(e){var t=e.locale;return""+(e.fullyQualified?i:"")+function(e){return e===u?""+p:""+p+e+"/"}(t)+m}}}},2866:(e,t,n)=>{"use strict";n.d(t,{$:()=>i});var r=n(2581),o=n(8516),a=n(4222);function i(e){var t=(0,o.zy)(),n=(0,a.ZC)(t),i=(0,a._q)(e);(0,r.useEffect)((function(){n&&t!==n&&i({location:t,previousLocation:n})}),[i,t,n])}},6938:(e,t,n)=>{"use strict";n.d(t,{p:()=>o});var r=n(9068);function o(){return(0,r.A)().siteConfig.themeConfig}},7643:(e,t,n)=>{"use strict";n.d(t,{c:()=>o});var r=n(9068);function o(){return(0,r.A)().siteConfig.themeConfig}},1527:(e,t,n)=>{"use strict";n.d(t,{C:()=>l});var r=n(2581),o=n(5424),a=n(4447),i=n(7643);function l(){var e=(0,a.hH)().withBaseUrl,t=(0,i.c)().algolia,n=t.externalUrlRegex,l=t.replaceSearchResultPathname;return(0,r.useCallback)((function(t){var r=new URL(t);if((0,o.G)(n,r.href))return t;var a=""+(r.pathname+r.hash);return e(function(e,t){return t?e.replaceAll(new RegExp(t.from,"g"),t.to):e}(a,l))}),[e,n,l])}},220:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addTrailingSlash=o,t.default=function(e,t){var n=t.trailingSlash,r=t.baseUrl;if(e.startsWith("#"))return e;if(void 0===n)return e;var i=e.split(/[#?]/)[0],l="/"===i||i===r?i:(s=i,u=n,u?o(s):a(s));var s,u;return e.replace(i,l)},t.addLeadingSlash=function(e){return(0,r.addPrefix)(e,"/")},t.removeTrailingSlash=a;var r=n(363);function o(e){return e.endsWith("/")?e:e+"/"}function a(e){return(0,r.removeSuffix)(e,"/")}},3066:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=function e(t){if(t.cause)return[t].concat(e(t.cause));return[t]}},4969:(e,t,n)=>{"use strict";t.rA=t.Ks=t.LU=void 0;var r=n(1177);t.LU="__blog-post-container";var o=n(220);Object.defineProperty(t,"Ks",{enumerable:!0,get:function(){return r.__importDefault(o).default}});var a=n(363);var i=n(3066);Object.defineProperty(t,"rA",{enumerable:!0,get:function(){return i.getErrorCausalChain}})},363:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addPrefix=function(e,t){return e.startsWith(t)?e:""+t+e},t.removeSuffix=function(e,t){if(""===t)return e;return e.endsWith(t)?e.slice(0,-t.length):e},t.addSuffix=function(e,t){return e.endsWith(t)?e:""+e+t},t.removePrefix=function(e,t){return e.startsWith(t)?e.slice(t.length):e}},7276:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});n(2581);var r=n(2792),o=n.n(r),a=n(4054);const i={17896441:[function(){return Promise.all([n.e(869),n.e(76),n.e(810),n.e(401)]).then(n.bind(n,7390))},"@theme/DocItem",7390],"1a4e3797":[function(){return Promise.all([n.e(869),n.e(138)]).then(n.bind(n,4385))},"@theme/SearchPage",4385],"1df93b7f":[function(){return Promise.all([n.e(869),n.e(583)]).then(n.bind(n,4053))},"@site/src/pages/index.tsx",4053],"29dd3281":[function(){return Promise.all([n.e(869),n.e(76),n.e(262)]).then(n.bind(n,2161))},"@site/docs/api/decorator.mdx",2161],"33fc5bb8":[function(){return Promise.all([n.e(869),n.e(76),n.e(810),n.e(65),n.e(867)]).then(n.bind(n,1484))},"@theme/Blog/Pages/BlogAuthorsPostsPage",1484],"36994c47":[function(){return n.e(858).then(n.t.bind(n,5516,19))},"@generated/docusaurus-plugin-content-blog/default/__plugin.json",5516],"3b837331":[function(){return Promise.all([n.e(869),n.e(76),n.e(577)]).then(n.bind(n,7e3))},"@site/docs/introduction/dependency-inversion.mdx",7e3],"3dc814bd":[function(){return Promise.all([n.e(869),n.e(76),n.e(742)]).then(n.bind(n,7065))},"@site/docs/fundamentals/binding.mdx",7065],"565f2789":[function(){return Promise.all([n.e(869),n.e(76),n.e(31)]).then(n.bind(n,6067))},"@site/docs/fundamentals/lifecycle/deactivation.mdx",6067],"590aafe0":[function(){return n.e(126).then(n.t.bind(n,3838,19))},"@generated/docusaurus-plugin-content-blog/default/p/monorepo-blog-fb7.json",3838],"5e95c892":[function(){return n.e(647).then(n.bind(n,7787))},"@theme/DocsRoot",7787],"5e9f5e1a":[function(){return Promise.resolve().then(n.bind(n,4784))},"@generated/docusaurus.config",4784],"621db11d":[function(){return Promise.all([n.e(869),n.e(65),n.e(212)]).then(n.bind(n,452))},"@theme/Blog/Pages/BlogAuthorsListPage",452],"675bdb9f":[function(){return Promise.all([n.e(869),n.e(76),n.e(360)]).then(n.bind(n,820))},"@site/docs/introduction/getting-started.mdx",820],"814f3328":[function(){return n.e(472).then(n.t.bind(n,5513,19))},"~blog/default/blog-post-list-prop-default.json",5513],"8bf68d0a":[function(){return n.e(368).then(n.t.bind(n,8771,19))},"@generated/docusaurus-plugin-content-blog/default/p/monorepo-blog-authors-b16.json",8771],"995cd23a":[function(){return Promise.all([n.e(76),n.e(655)]).then(n.bind(n,6387))},"@site/blog/2024-12-24-welcome/index.md?truncated=true",6387],"9e4087bc":[function(){return n.e(711).then(n.bind(n,7061))},"@theme/BlogArchivePage",7061],"9fbf92dd":[function(){return Promise.all([n.e(869),n.e(76),n.e(871)]).then(n.bind(n,348))},"@site/docs/api/container.mdx",348],a6aa9e1f:[function(){return Promise.all([n.e(869),n.e(76),n.e(810),n.e(65),n.e(643)]).then(n.bind(n,7755))},"@theme/BlogListPage",7755],a7456010:[function(){return n.e(235).then(n.t.bind(n,8552,19))},"@generated/docusaurus-plugin-content-pages/default/__plugin.json",8552],a7bd4aaa:[function(){return n.e(98).then(n.bind(n,5294))},"@theme/DocVersionRoot",5294],a94703ab:[function(){return Promise.all([n.e(869),n.e(48)]).then(n.bind(n,7261))},"@theme/DocRoot",7261],aba21aa0:[function(){return n.e(361).then(n.t.bind(n,7093,19))},"@generated/docusaurus-plugin-content-docs/default/__plugin.json",7093],abbd686b:[function(){return n.e(102).then(n.t.bind(n,2494,19))},"@generated/docusaurus-plugin-content-blog/default/p/monorepo-blog-archive-63e.json",2494],acecf23e:[function(){return n.e(903).then(n.t.bind(n,1912,19))},"~blog/default/blogMetadata-default.json",1912],c141421f:[function(){return n.e(957).then(n.t.bind(n,936,19))},"@generated/docusaurus-theme-search-algolia/default/__plugin.json",936],c207c22d:[function(){return n.e(578).then(n.t.bind(n,3876,19))},"@generated/docusaurus-plugin-content-blog/default/p/monorepo-blog-authors-notaphplover-2de.json",3876],cc0cca13:[function(){return Promise.all([n.e(869),n.e(76),n.e(874)]).then(n.bind(n,227))},"@site/docs/api/binding-syntax.mdx",227],ccc49370:[function(){return Promise.all([n.e(869),n.e(76),n.e(810),n.e(65),n.e(249)]).then(n.bind(n,6189))},"@theme/BlogPostPage",6189],e33fc578:[function(){return Promise.all([n.e(869),n.e(76),n.e(630)]).then(n.bind(n,7488))},"@site/docs/api/container-module.mdx",7488],e46f1490:[function(){return Promise.all([n.e(869),n.e(76),n.e(324)]).then(n.bind(n,2411))},"@site/docs/fundamentals/lifecycle/activation.mdx",2411],e669b475:[function(){return Promise.all([n.e(76),n.e(767)]).then(n.bind(n,2737))},"@site/blog/2024-12-24-welcome/index.md",2737],f9dfc0ac:[function(){return n.e(999).then(n.t.bind(n,5554,19))},"@generated/docusaurus-plugin-content-docs/default/p/monorepo-docs-6af.json",5554]};var l=n(9793);function s(e){var t=e.error,n=e.retry,r=e.pastDelay;return t?(0,l.jsxs)("div",{style:{textAlign:"center",color:"#fff",backgroundColor:"#fa383e",borderColor:"#fa383e",borderStyle:"solid",borderRadius:"0.25rem",borderWidth:"1px",boxSizing:"border-box",display:"block",padding:"1rem",flex:"0 0 50%",marginLeft:"25%",marginRight:"25%",marginTop:"5rem",maxWidth:"50%",width:"100%"},children:[(0,l.jsx)("p",{children:String(t)}),(0,l.jsx)("div",{children:(0,l.jsx)("button",{type:"button",onClick:n,children:"Retry"})})]}):r?(0,l.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:(0,l.jsx)("svg",{id:"loader",style:{width:128,height:110,position:"absolute",top:"calc(100vh - 64%)"},viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",stroke:"#61dafb",children:(0,l.jsxs)("g",{fill:"none",fillRule:"evenodd",transform:"translate(1 1)",strokeWidth:"2",children:[(0,l.jsxs)("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0",children:[(0,l.jsx)("animate",{attributeName:"r",begin:"1.5s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-opacity",begin:"1.5s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-width",begin:"1.5s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})]}),(0,l.jsxs)("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0",children:[(0,l.jsx)("animate",{attributeName:"r",begin:"3s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-opacity",begin:"3s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-width",begin:"3s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})]}),(0,l.jsx)("circle",{cx:"22",cy:"22",r:"8",children:(0,l.jsx)("animate",{attributeName:"r",begin:"0s",dur:"1.5s",values:"6;1;2;3;4;5;6",calcMode:"linear",repeatCount:"indefinite"})})]})})}):null}var u=n(4531),c=n(6064);function f(e,t){if("*"===e)return o()({loading:s,loader:function(){return n.e(99).then(n.bind(n,1099))},modules:["@theme/NotFound"],webpack:function(){return[1099]},render:function(e,t){var n=e.default;return(0,l.jsx)(c.W,{value:{plugin:{name:"native",id:"default"}},children:(0,l.jsx)(n,Object.assign({},t))})}});var r=a[e+"-"+t],f={},d=[],p=[],m=(0,u.A)(r);return Object.entries(m).forEach((function(e){var t=e[0],n=e[1],r=i[n];r&&(f[t]=r[0],d.push(r[1]),p.push(r[2]))})),o().Map({loading:s,loader:f,modules:d,webpack:function(){return p},render:function(t,n){var o=JSON.parse(JSON.stringify(r));Object.entries(t).forEach((function(t){var n=t[0],r=t[1],a=r.default;if(!a)throw new Error("The page component at "+e+" doesn't have a default export. This makes it impossible to render anything. Consider default-exporting a React component.");"object"!=typeof a&&"function"!=typeof a||Object.keys(r).filter((function(e){return"default"!==e})).forEach((function(e){a[e]=r[e]}));var i=o,l=n.split(".");l.slice(0,-1).forEach((function(e){i=i[e]})),i[l[l.length-1]]=a}));var a=o.__comp;delete o.__comp;var i=o.__context;delete o.__context;var s=o.__props;return delete o.__props,(0,l.jsx)(c.W,{value:i,children:(0,l.jsx)(a,Object.assign({},o,s,n))})}})}const d=[{path:"/monorepo/blog",component:f("/monorepo/blog","108"),exact:!0},{path:"/monorepo/blog/archive",component:f("/monorepo/blog/archive","a7b"),exact:!0},{path:"/monorepo/blog/authors",component:f("/monorepo/blog/authors","f37"),exact:!0},{path:"/monorepo/blog/authors/notaphplover",component:f("/monorepo/blog/authors/notaphplover","6ff"),exact:!0},{path:"/monorepo/blog/welcome",component:f("/monorepo/blog/welcome","304"),exact:!0},{path:"/monorepo/search",component:f("/monorepo/search","137"),exact:!0},{path:"/monorepo/docs",component:f("/monorepo/docs","ef3"),routes:[{path:"/monorepo/docs",component:f("/monorepo/docs","8ce"),routes:[{path:"/monorepo/docs",component:f("/monorepo/docs","340"),routes:[{path:"/monorepo/docs/api/binding-syntax",component:f("/monorepo/docs/api/binding-syntax","262"),exact:!0,sidebar:"tutorialSidebar"},{path:"/monorepo/docs/api/container",component:f("/monorepo/docs/api/container","c49"),exact:!0,sidebar:"tutorialSidebar"},{path:"/monorepo/docs/api/container-module",component:f("/monorepo/docs/api/container-module","595"),exact:!0,sidebar:"tutorialSidebar"},{path:"/monorepo/docs/api/decorator",component:f("/monorepo/docs/api/decorator","a59"),exact:!0,sidebar:"tutorialSidebar"},{path:"/monorepo/docs/fundamentals/binding",component:f("/monorepo/docs/fundamentals/binding","035"),exact:!0,sidebar:"tutorialSidebar"},{path:"/monorepo/docs/fundamentals/lifecycle/activation",component:f("/monorepo/docs/fundamentals/lifecycle/activation","be8"),exact:!0,sidebar:"tutorialSidebar"},{path:"/monorepo/docs/fundamentals/lifecycle/deactivation",component:f("/monorepo/docs/fundamentals/lifecycle/deactivation","c51"),exact:!0,sidebar:"tutorialSidebar"},{path:"/monorepo/docs/introduction/dependency-inversion",component:f("/monorepo/docs/introduction/dependency-inversion","979"),exact:!0,sidebar:"tutorialSidebar"},{path:"/monorepo/docs/introduction/getting-started",component:f("/monorepo/docs/introduction/getting-started","48a"),exact:!0,sidebar:"tutorialSidebar"}]}]}]},{path:"/monorepo/",component:f("/monorepo/","388"),exact:!0},{path:"*",component:f("*")}]},9097:(e,t,n)=>{"use strict";n.d(t,{zR:()=>w,TM:()=>O,yJ:()=>p,sC:()=>A,AO:()=>d});var r=n(8937);function o(e){return"/"===e.charAt(0)}function a(e,t){for(var n=t,r=n+1,o=e.length;r=0;d--){var p=i[d];"."===p?a(i,d):".."===p?(a(i,d),f++):f&&(a(i,d),f--)}if(!u)for(;f--;f)i.unshift("..");!u||""===i[0]||i[0]&&o(i[0])||i.unshift("");var m=i.join("/");return n&&"/"!==m.substr(-1)&&(m+="/"),m};var l=n(3712);function s(e){return"/"===e.charAt(0)?e:"/"+e}function u(e){return"/"===e.charAt(0)?e.substr(1):e}function c(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function f(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function d(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function p(e,t,n,o){var a;"string"==typeof e?(a=function(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var a=t.indexOf("?");return-1!==a&&(n=t.substr(a),t=t.substr(0,a)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),a.state=t):(void 0===(a=(0,r.A)({},e)).pathname&&(a.pathname=""),a.search?"?"!==a.search.charAt(0)&&(a.search="?"+a.search):a.search="",a.hash?"#"!==a.hash.charAt(0)&&(a.hash="#"+a.hash):a.hash="",void 0!==t&&void 0===a.state&&(a.state=t));try{a.pathname=decodeURI(a.pathname)}catch(l){throw l instanceof URIError?new URIError('Pathname "'+a.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):l}return n&&(a.key=n),o?a.pathname?"/"!==a.pathname.charAt(0)&&(a.pathname=i(a.pathname,o.pathname)):a.pathname=o.pathname:a.pathname||(a.pathname="/"),a}function m(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,o){if(null!=e){var a="function"==typeof e?e(t,n):e;"string"==typeof a?"function"==typeof r?r(a,o):o(!0):o(!1!==a)}else o(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,o):n.push(o),f({action:r,location:o,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",o=p(e,t,h(),w.location);c.confirmTransitionTo(o,r,n,(function(e){e&&(w.entries[w.index]=o,f({action:r,location:o}))}))},go:b,goBack:function(){b(-1)},goForward:function(){b(1)},canGo:function(e){var t=w.index+e;return t>=0&&t{"use strict";var r=n(502),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?i:l[e.$$typeof]||o}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=i;var u=Object.defineProperty,c=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(m){var o=p(n);o&&o!==m&&e(t,o,r)}var i=c(n);f&&(i=i.concat(f(n)));for(var l=s(t),h=s(n),g=0;g{"use strict";e.exports=function(e,t,n,r,o,a,i,l){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,o,a,i,l],c=0;(s=new Error(t.replace(/%s/g,(function(){return u[c++]})))).name="Invariant Violation"}throw s.framesToPop=1,s}}},6687:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},8197:(e,t,n)=>{"use strict";n.r(t)},5202:(e,t,n)=>{"use strict";n.r(t)},9233:function(e,t,n){var r,o;r=function(){var e,t,n={version:"0.2.0"},r=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
'};function o(e,t,n){return en?n:e}function a(e){return 100*(-1+e)}function i(e,t,n){var o;return(o="translate3d"===r.positionUsing?{transform:"translate3d("+a(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+a(e)+"%,0)"}:{"margin-left":a(e)+"%"}).transition="all "+t+"ms "+n,o}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=o(e,r.minimum,1),n.status=1===e?null:e;var a=n.render(!t),u=a.querySelector(r.barSelector),c=r.speed,f=r.easing;return a.offsetWidth,l((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),s(u,i(e,c,f)),1===e?(s(a,{transition:"none",opacity:1}),a.offsetWidth,setTimeout((function(){s(a,{transition:"all "+c+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),c)}),c)):setTimeout(t,c)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*o(Math.random()*t,.1,.95)),t=o(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");c(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var o,i=t.querySelector(r.barSelector),l=e?"-100":a(n.status||0),u=document.querySelector(r.parent);return s(i,{transition:"all 0 linear",transform:"translate3d("+l+"%,0,0)"}),r.showSpinner||(o=t.querySelector(r.spinnerSelector))&&p(o),u!=document.body&&c(u,"nprogress-custom-parent"),u.appendChild(t),t},n.remove=function(){f(document.documentElement,"nprogress-busy"),f(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&p(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var l=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),s=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()}))}function r(t){var n=document.body.style;if(t in n)return t;for(var r,o=e.length,a=t.charAt(0).toUpperCase()+t.slice(1);o--;)if((r=e[o]+a)in n)return r;return t}function o(e){return e=n(e),t[e]||(t[e]=r(e))}function a(e,t,n){t=o(t),e.style[t]=n}return function(e,t){var n,r,o=arguments;if(2==o.length)for(n in t)void 0!==(r=t[n])&&t.hasOwnProperty(n)&&a(e,n,r);else a(e,o[1],o[2])}}();function u(e,t){return("string"==typeof e?e:d(e)).indexOf(" "+t+" ")>=0}function c(e,t){var n=d(e),r=n+t;u(n,t)||(e.className=r.substring(1))}function f(e,t){var n,r=d(e);u(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function d(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function p(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n},void 0===(o="function"==typeof r?r.call(t,n,t,e):r)||(e.exports=o)},4188:(e,t,n)=>{var r=n(6687);e.exports=m,e.exports.parse=a,e.exports.compile=function(e,t){return s(a(e,t),t)},e.exports.tokensToFunction=s,e.exports.tokensToRegExp=p;var o=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function a(e,t){for(var n,r=[],a=0,l=0,s="",u=t&&t.delimiter||"/";null!=(n=o.exec(e));){var f=n[0],d=n[1],p=n.index;if(s+=e.slice(l,p),l=p+f.length,d)s+=d[1];else{var m=e[l],h=n[2],g=n[3],v=n[4],y=n[5],b=n[6],w=n[7];s&&(r.push(s),s="");var S=null!=h&&null!=m&&m!==h,k="+"===b||"*"===b,x="?"===b||"*"===b,E=h||u,_=v||y,O=h||("string"==typeof r[r.length-1]?r[r.length-1]:"");r.push({name:g||a++,prefix:h||"",delimiter:E,optional:x,repeat:k,partial:S,asterisk:!!w,pattern:_?c(_):w?".*":i(E,O)})}}return l-1?"[^"+u(e)+"]+?":u(t)+"|(?:(?!"+u(t)+")[^"+u(e)+"])+?"}function l(e){return encodeURI(e).replace(/[\/?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}function s(e,t){for(var n=new Array(e.length),o=0;o{e.exports&&(e.exports={core:{meta:{path:"components/prism-core.js",option:"mandatory"},core:"Core"},themes:{meta:{path:"themes/{id}.css",link:"index.html?theme={id}",exclusive:!0},prism:{title:"Default",option:"default"},"prism-dark":"Dark","prism-funky":"Funky","prism-okaidia":{title:"Okaidia",owner:"ocodia"},"prism-twilight":{title:"Twilight",owner:"remybach"},"prism-coy":{title:"Coy",owner:"tshedor"},"prism-solarizedlight":{title:"Solarized Light",owner:"hectormatos2011 "},"prism-tomorrow":{title:"Tomorrow Night",owner:"Rosey"}},languages:{meta:{path:"components/prism-{id}",noCSS:!0,examplesPath:"examples/prism-{id}",addCheckAll:!0},markup:{title:"Markup",alias:["html","xml","svg","mathml","ssml","atom","rss"],aliasTitles:{html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",ssml:"SSML",atom:"Atom",rss:"RSS"},option:"default"},css:{title:"CSS",option:"default",modify:"markup"},clike:{title:"C-like",option:"default"},javascript:{title:"JavaScript",require:"clike",modify:"markup",optional:"regex",alias:"js",option:"default"},abap:{title:"ABAP",owner:"dellagustin"},abnf:{title:"ABNF",owner:"RunDevelopment"},actionscript:{title:"ActionScript",require:"javascript",modify:"markup",owner:"Golmote"},ada:{title:"Ada",owner:"Lucretia"},agda:{title:"Agda",owner:"xy-ren"},al:{title:"AL",owner:"RunDevelopment"},antlr4:{title:"ANTLR4",alias:"g4",owner:"RunDevelopment"},apacheconf:{title:"Apache Configuration",owner:"GuiTeK"},apex:{title:"Apex",require:["clike","sql"],owner:"RunDevelopment"},apl:{title:"APL",owner:"ngn"},applescript:{title:"AppleScript",owner:"Golmote"},aql:{title:"AQL",owner:"RunDevelopment"},arduino:{title:"Arduino",require:"cpp",alias:"ino",owner:"dkern"},arff:{title:"ARFF",owner:"Golmote"},armasm:{title:"ARM Assembly",alias:"arm-asm",owner:"RunDevelopment"},arturo:{title:"Arturo",alias:"art",optional:["bash","css","javascript","markup","markdown","sql"],owner:"drkameleon"},asciidoc:{alias:"adoc",title:"AsciiDoc",owner:"Golmote"},aspnet:{title:"ASP.NET (C#)",require:["markup","csharp"],owner:"nauzilus"},asm6502:{title:"6502 Assembly",owner:"kzurawel"},asmatmel:{title:"Atmel AVR Assembly",owner:"cerkit"},autohotkey:{title:"AutoHotkey",owner:"aviaryan"},autoit:{title:"AutoIt",owner:"Golmote"},avisynth:{title:"AviSynth",alias:"avs",owner:"Zinfidel"},"avro-idl":{title:"Avro IDL",alias:"avdl",owner:"RunDevelopment"},awk:{title:"AWK",alias:"gawk",aliasTitles:{gawk:"GAWK"},owner:"RunDevelopment"},bash:{title:"Bash",alias:["sh","shell"],aliasTitles:{sh:"Shell",shell:"Shell"},owner:"zeitgeist87"},basic:{title:"BASIC",owner:"Golmote"},batch:{title:"Batch",owner:"Golmote"},bbcode:{title:"BBcode",alias:"shortcode",aliasTitles:{shortcode:"Shortcode"},owner:"RunDevelopment"},bbj:{title:"BBj",owner:"hyyan"},bicep:{title:"Bicep",owner:"johnnyreilly"},birb:{title:"Birb",require:"clike",owner:"Calamity210"},bison:{title:"Bison",require:"c",owner:"Golmote"},bnf:{title:"BNF",alias:"rbnf",aliasTitles:{rbnf:"RBNF"},owner:"RunDevelopment"},bqn:{title:"BQN",owner:"yewscion"},brainfuck:{title:"Brainfuck",owner:"Golmote"},brightscript:{title:"BrightScript",owner:"RunDevelopment"},bro:{title:"Bro",owner:"wayward710"},bsl:{title:"BSL (1C:Enterprise)",alias:"oscript",aliasTitles:{oscript:"OneScript"},owner:"Diversus23"},c:{title:"C",require:"clike",owner:"zeitgeist87"},csharp:{title:"C#",require:"clike",alias:["cs","dotnet"],owner:"mvalipour"},cpp:{title:"C++",require:"c",owner:"zeitgeist87"},cfscript:{title:"CFScript",require:"clike",alias:"cfc",owner:"mjclemente"},chaiscript:{title:"ChaiScript",require:["clike","cpp"],owner:"RunDevelopment"},cil:{title:"CIL",owner:"sbrl"},cilkc:{title:"Cilk/C",require:"c",alias:"cilk-c",owner:"OpenCilk"},cilkcpp:{title:"Cilk/C++",require:"cpp",alias:["cilk-cpp","cilk"],owner:"OpenCilk"},clojure:{title:"Clojure",owner:"troglotit"},cmake:{title:"CMake",owner:"mjrogozinski"},cobol:{title:"COBOL",owner:"RunDevelopment"},coffeescript:{title:"CoffeeScript",require:"javascript",alias:"coffee",owner:"R-osey"},concurnas:{title:"Concurnas",alias:"conc",owner:"jasontatton"},csp:{title:"Content-Security-Policy",owner:"ScottHelme"},cooklang:{title:"Cooklang",owner:"ahue"},coq:{title:"Coq",owner:"RunDevelopment"},crystal:{title:"Crystal",require:"ruby",owner:"MakeNowJust"},"css-extras":{title:"CSS Extras",require:"css",modify:"css",owner:"milesj"},csv:{title:"CSV",owner:"RunDevelopment"},cue:{title:"CUE",owner:"RunDevelopment"},cypher:{title:"Cypher",owner:"RunDevelopment"},d:{title:"D",require:"clike",owner:"Golmote"},dart:{title:"Dart",require:"clike",owner:"Golmote"},dataweave:{title:"DataWeave",owner:"machaval"},dax:{title:"DAX",owner:"peterbud"},dhall:{title:"Dhall",owner:"RunDevelopment"},diff:{title:"Diff",owner:"uranusjr"},django:{title:"Django/Jinja2",require:"markup-templating",alias:"jinja2",owner:"romanvm"},"dns-zone-file":{title:"DNS zone file",owner:"RunDevelopment",alias:"dns-zone"},docker:{title:"Docker",alias:"dockerfile",owner:"JustinBeckwith"},dot:{title:"DOT (Graphviz)",alias:"gv",optional:"markup",owner:"RunDevelopment"},ebnf:{title:"EBNF",owner:"RunDevelopment"},editorconfig:{title:"EditorConfig",owner:"osipxd"},eiffel:{title:"Eiffel",owner:"Conaclos"},ejs:{title:"EJS",require:["javascript","markup-templating"],owner:"RunDevelopment",alias:"eta",aliasTitles:{eta:"Eta"}},elixir:{title:"Elixir",owner:"Golmote"},elm:{title:"Elm",owner:"zwilias"},etlua:{title:"Embedded Lua templating",require:["lua","markup-templating"],owner:"RunDevelopment"},erb:{title:"ERB",require:["ruby","markup-templating"],owner:"Golmote"},erlang:{title:"Erlang",owner:"Golmote"},"excel-formula":{title:"Excel Formula",alias:["xlsx","xls"],owner:"RunDevelopment"},fsharp:{title:"F#",require:"clike",owner:"simonreynolds7"},factor:{title:"Factor",owner:"catb0t"},false:{title:"False",owner:"edukisto"},"firestore-security-rules":{title:"Firestore security rules",require:"clike",owner:"RunDevelopment"},flow:{title:"Flow",require:"javascript",owner:"Golmote"},fortran:{title:"Fortran",owner:"Golmote"},ftl:{title:"FreeMarker Template Language",require:"markup-templating",owner:"RunDevelopment"},gml:{title:"GameMaker Language",alias:"gamemakerlanguage",require:"clike",owner:"LiarOnce"},gap:{title:"GAP (CAS)",owner:"RunDevelopment"},gcode:{title:"G-code",owner:"RunDevelopment"},gdscript:{title:"GDScript",owner:"RunDevelopment"},gedcom:{title:"GEDCOM",owner:"Golmote"},gettext:{title:"gettext",alias:"po",owner:"RunDevelopment"},gherkin:{title:"Gherkin",owner:"hason"},git:{title:"Git",owner:"lgiraudel"},glsl:{title:"GLSL",require:"c",owner:"Golmote"},gn:{title:"GN",alias:"gni",owner:"RunDevelopment"},"linker-script":{title:"GNU Linker Script",alias:"ld",owner:"RunDevelopment"},go:{title:"Go",require:"clike",owner:"arnehormann"},"go-module":{title:"Go module",alias:"go-mod",owner:"RunDevelopment"},gradle:{title:"Gradle",require:"clike",owner:"zeabdelkhalek-badido18"},graphql:{title:"GraphQL",optional:"markdown",owner:"Golmote"},groovy:{title:"Groovy",require:"clike",owner:"robfletcher"},haml:{title:"Haml",require:"ruby",optional:["css","css-extras","coffeescript","erb","javascript","less","markdown","scss","textile"],owner:"Golmote"},handlebars:{title:"Handlebars",require:"markup-templating",alias:["hbs","mustache"],aliasTitles:{mustache:"Mustache"},owner:"Golmote"},haskell:{title:"Haskell",alias:"hs",owner:"bholst"},haxe:{title:"Haxe",require:"clike",optional:"regex",owner:"Golmote"},hcl:{title:"HCL",owner:"outsideris"},hlsl:{title:"HLSL",require:"c",owner:"RunDevelopment"},hoon:{title:"Hoon",owner:"matildepark"},http:{title:"HTTP",optional:["csp","css","hpkp","hsts","javascript","json","markup","uri"],owner:"danielgtaylor"},hpkp:{title:"HTTP Public-Key-Pins",owner:"ScottHelme"},hsts:{title:"HTTP Strict-Transport-Security",owner:"ScottHelme"},ichigojam:{title:"IchigoJam",owner:"BlueCocoa"},icon:{title:"Icon",owner:"Golmote"},"icu-message-format":{title:"ICU Message Format",owner:"RunDevelopment"},idris:{title:"Idris",alias:"idr",owner:"KeenS",require:"haskell"},ignore:{title:".ignore",owner:"osipxd",alias:["gitignore","hgignore","npmignore"],aliasTitles:{gitignore:".gitignore",hgignore:".hgignore",npmignore:".npmignore"}},inform7:{title:"Inform 7",owner:"Golmote"},ini:{title:"Ini",owner:"aviaryan"},io:{title:"Io",owner:"AlesTsurko"},j:{title:"J",owner:"Golmote"},java:{title:"Java",require:"clike",owner:"sherblot"},javadoc:{title:"JavaDoc",require:["markup","java","javadoclike"],modify:"java",optional:"scala",owner:"RunDevelopment"},javadoclike:{title:"JavaDoc-like",modify:["java","javascript","php"],owner:"RunDevelopment"},javastacktrace:{title:"Java stack trace",owner:"RunDevelopment"},jexl:{title:"Jexl",owner:"czosel"},jolie:{title:"Jolie",require:"clike",owner:"thesave"},jq:{title:"JQ",owner:"RunDevelopment"},jsdoc:{title:"JSDoc",require:["javascript","javadoclike","typescript"],modify:"javascript",optional:["actionscript","coffeescript"],owner:"RunDevelopment"},"js-extras":{title:"JS Extras",require:"javascript",modify:"javascript",optional:["actionscript","coffeescript","flow","n4js","typescript"],owner:"RunDevelopment"},json:{title:"JSON",alias:"webmanifest",aliasTitles:{webmanifest:"Web App Manifest"},owner:"CupOfTea696"},json5:{title:"JSON5",require:"json",owner:"RunDevelopment"},jsonp:{title:"JSONP",require:"json",owner:"RunDevelopment"},jsstacktrace:{title:"JS stack trace",owner:"sbrl"},"js-templates":{title:"JS Templates",require:"javascript",modify:"javascript",optional:["css","css-extras","graphql","markdown","markup","sql"],owner:"RunDevelopment"},julia:{title:"Julia",owner:"cdagnino"},keepalived:{title:"Keepalived Configure",owner:"dev-itsheng"},keyman:{title:"Keyman",owner:"mcdurdin"},kotlin:{title:"Kotlin",alias:["kt","kts"],aliasTitles:{kts:"Kotlin Script"},require:"clike",owner:"Golmote"},kumir:{title:"KuMir (\u041a\u0443\u041c\u0438\u0440)",alias:"kum",owner:"edukisto"},kusto:{title:"Kusto",owner:"RunDevelopment"},latex:{title:"LaTeX",alias:["tex","context"],aliasTitles:{tex:"TeX",context:"ConTeXt"},owner:"japborst"},latte:{title:"Latte",require:["clike","markup-templating","php"],owner:"nette"},less:{title:"Less",require:"css",optional:"css-extras",owner:"Golmote"},lilypond:{title:"LilyPond",require:"scheme",alias:"ly",owner:"RunDevelopment"},liquid:{title:"Liquid",require:"markup-templating",owner:"cinhtau"},lisp:{title:"Lisp",alias:["emacs","elisp","emacs-lisp"],owner:"JuanCaicedo"},livescript:{title:"LiveScript",owner:"Golmote"},llvm:{title:"LLVM IR",owner:"porglezomp"},log:{title:"Log file",optional:"javastacktrace",owner:"RunDevelopment"},lolcode:{title:"LOLCODE",owner:"Golmote"},lua:{title:"Lua",owner:"Golmote"},magma:{title:"Magma (CAS)",owner:"RunDevelopment"},makefile:{title:"Makefile",owner:"Golmote"},markdown:{title:"Markdown",require:"markup",optional:"yaml",alias:"md",owner:"Golmote"},"markup-templating":{title:"Markup templating",require:"markup",owner:"Golmote"},mata:{title:"Mata",owner:"RunDevelopment"},matlab:{title:"MATLAB",owner:"Golmote"},maxscript:{title:"MAXScript",owner:"RunDevelopment"},mel:{title:"MEL",owner:"Golmote"},mermaid:{title:"Mermaid",owner:"RunDevelopment"},metafont:{title:"METAFONT",owner:"LaeriExNihilo"},mizar:{title:"Mizar",owner:"Golmote"},mongodb:{title:"MongoDB",owner:"airs0urce",require:"javascript"},monkey:{title:"Monkey",owner:"Golmote"},moonscript:{title:"MoonScript",alias:"moon",owner:"RunDevelopment"},n1ql:{title:"N1QL",owner:"TMWilds"},n4js:{title:"N4JS",require:"javascript",optional:"jsdoc",alias:"n4jsd",owner:"bsmith-n4"},"nand2tetris-hdl":{title:"Nand To Tetris HDL",owner:"stephanmax"},naniscript:{title:"Naninovel Script",owner:"Elringus",alias:"nani"},nasm:{title:"NASM",owner:"rbmj"},neon:{title:"NEON",owner:"nette"},nevod:{title:"Nevod",owner:"nezaboodka"},nginx:{title:"nginx",owner:"volado"},nim:{title:"Nim",owner:"Golmote"},nix:{title:"Nix",owner:"Golmote"},nsis:{title:"NSIS",owner:"idleberg"},objectivec:{title:"Objective-C",require:"c",alias:"objc",owner:"uranusjr"},ocaml:{title:"OCaml",owner:"Golmote"},odin:{title:"Odin",owner:"edukisto"},opencl:{title:"OpenCL",require:"c",modify:["c","cpp"],owner:"Milania1"},openqasm:{title:"OpenQasm",alias:"qasm",owner:"RunDevelopment"},oz:{title:"Oz",owner:"Golmote"},parigp:{title:"PARI/GP",owner:"Golmote"},parser:{title:"Parser",require:"markup",owner:"Golmote"},pascal:{title:"Pascal",alias:"objectpascal",aliasTitles:{objectpascal:"Object Pascal"},owner:"Golmote"},pascaligo:{title:"Pascaligo",owner:"DefinitelyNotAGoat"},psl:{title:"PATROL Scripting Language",owner:"bertysentry"},pcaxis:{title:"PC-Axis",alias:"px",owner:"RunDevelopment"},peoplecode:{title:"PeopleCode",alias:"pcode",owner:"RunDevelopment"},perl:{title:"Perl",owner:"Golmote"},php:{title:"PHP",require:"markup-templating",owner:"milesj"},phpdoc:{title:"PHPDoc",require:["php","javadoclike"],modify:"php",owner:"RunDevelopment"},"php-extras":{title:"PHP Extras",require:"php",modify:"php",owner:"milesj"},"plant-uml":{title:"PlantUML",alias:"plantuml",owner:"RunDevelopment"},plsql:{title:"PL/SQL",require:"sql",owner:"Golmote"},powerquery:{title:"PowerQuery",alias:["pq","mscript"],owner:"peterbud"},powershell:{title:"PowerShell",owner:"nauzilus"},processing:{title:"Processing",require:"clike",owner:"Golmote"},prolog:{title:"Prolog",owner:"Golmote"},promql:{title:"PromQL",owner:"arendjr"},properties:{title:".properties",owner:"Golmote"},protobuf:{title:"Protocol Buffers",require:"clike",owner:"just-boris"},pug:{title:"Pug",require:["markup","javascript"],optional:["coffeescript","ejs","handlebars","less","livescript","markdown","scss","stylus","twig"],owner:"Golmote"},puppet:{title:"Puppet",owner:"Golmote"},pure:{title:"Pure",optional:["c","cpp","fortran"],owner:"Golmote"},purebasic:{title:"PureBasic",require:"clike",alias:"pbfasm",owner:"HeX0R101"},purescript:{title:"PureScript",require:"haskell",alias:"purs",owner:"sriharshachilakapati"},python:{title:"Python",alias:"py",owner:"multipetros"},qsharp:{title:"Q#",require:"clike",alias:"qs",owner:"fedonman"},q:{title:"Q (kdb+ database)",owner:"Golmote"},qml:{title:"QML",require:"javascript",owner:"RunDevelopment"},qore:{title:"Qore",require:"clike",owner:"temnroegg"},r:{title:"R",owner:"Golmote"},racket:{title:"Racket",require:"scheme",alias:"rkt",owner:"RunDevelopment"},cshtml:{title:"Razor C#",alias:"razor",require:["markup","csharp"],optional:["css","css-extras","javascript","js-extras"],owner:"RunDevelopment"},jsx:{title:"React JSX",require:["markup","javascript"],optional:["jsdoc","js-extras","js-templates"],owner:"vkbansal"},tsx:{title:"React TSX",require:["jsx","typescript"]},reason:{title:"Reason",require:"clike",owner:"Golmote"},regex:{title:"Regex",owner:"RunDevelopment"},rego:{title:"Rego",owner:"JordanSh"},renpy:{title:"Ren'py",alias:"rpy",owner:"HyuchiaDiego"},rescript:{title:"ReScript",alias:"res",owner:"vmarcosp"},rest:{title:"reST (reStructuredText)",owner:"Golmote"},rip:{title:"Rip",owner:"ravinggenius"},roboconf:{title:"Roboconf",owner:"Golmote"},robotframework:{title:"Robot Framework",alias:"robot",owner:"RunDevelopment"},ruby:{title:"Ruby",require:"clike",alias:"rb",owner:"samflores"},rust:{title:"Rust",owner:"Golmote"},sas:{title:"SAS",optional:["groovy","lua","sql"],owner:"Golmote"},sass:{title:"Sass (Sass)",require:"css",optional:"css-extras",owner:"Golmote"},scss:{title:"Sass (SCSS)",require:"css",optional:"css-extras",owner:"MoOx"},scala:{title:"Scala",require:"java",owner:"jozic"},scheme:{title:"Scheme",owner:"bacchus123"},"shell-session":{title:"Shell session",require:"bash",alias:["sh-session","shellsession"],owner:"RunDevelopment"},smali:{title:"Smali",owner:"RunDevelopment"},smalltalk:{title:"Smalltalk",owner:"Golmote"},smarty:{title:"Smarty",require:"markup-templating",optional:"php",owner:"Golmote"},sml:{title:"SML",alias:"smlnj",aliasTitles:{smlnj:"SML/NJ"},owner:"RunDevelopment"},solidity:{title:"Solidity (Ethereum)",alias:"sol",require:"clike",owner:"glachaud"},"solution-file":{title:"Solution file",alias:"sln",owner:"RunDevelopment"},soy:{title:"Soy (Closure Template)",require:"markup-templating",owner:"Golmote"},sparql:{title:"SPARQL",require:"turtle",owner:"Triply-Dev",alias:"rq"},"splunk-spl":{title:"Splunk SPL",owner:"RunDevelopment"},sqf:{title:"SQF: Status Quo Function (Arma 3)",require:"clike",owner:"RunDevelopment"},sql:{title:"SQL",owner:"multipetros"},squirrel:{title:"Squirrel",require:"clike",owner:"RunDevelopment"},stan:{title:"Stan",owner:"RunDevelopment"},stata:{title:"Stata Ado",require:["mata","java","python"],owner:"RunDevelopment"},iecst:{title:"Structured Text (IEC 61131-3)",owner:"serhioromano"},stylus:{title:"Stylus",owner:"vkbansal"},supercollider:{title:"SuperCollider",alias:"sclang",owner:"RunDevelopment"},swift:{title:"Swift",owner:"chrischares"},systemd:{title:"Systemd configuration file",owner:"RunDevelopment"},"t4-templating":{title:"T4 templating",owner:"RunDevelopment"},"t4-cs":{title:"T4 Text Templates (C#)",require:["t4-templating","csharp"],alias:"t4",owner:"RunDevelopment"},"t4-vb":{title:"T4 Text Templates (VB)",require:["t4-templating","vbnet"],owner:"RunDevelopment"},tap:{title:"TAP",owner:"isaacs",require:"yaml"},tcl:{title:"Tcl",owner:"PeterChaplin"},tt2:{title:"Template Toolkit 2",require:["clike","markup-templating"],owner:"gflohr"},textile:{title:"Textile",require:"markup",optional:"css",owner:"Golmote"},toml:{title:"TOML",owner:"RunDevelopment"},tremor:{title:"Tremor",alias:["trickle","troy"],owner:"darach",aliasTitles:{trickle:"trickle",troy:"troy"}},turtle:{title:"Turtle",alias:"trig",aliasTitles:{trig:"TriG"},owner:"jakubklimek"},twig:{title:"Twig",require:"markup-templating",owner:"brandonkelly"},typescript:{title:"TypeScript",require:"javascript",optional:"js-templates",alias:"ts",owner:"vkbansal"},typoscript:{title:"TypoScript",alias:"tsconfig",aliasTitles:{tsconfig:"TSConfig"},owner:"dkern"},unrealscript:{title:"UnrealScript",alias:["uscript","uc"],owner:"RunDevelopment"},uorazor:{title:"UO Razor Script",owner:"jaseowns"},uri:{title:"URI",alias:"url",aliasTitles:{url:"URL"},owner:"RunDevelopment"},v:{title:"V",require:"clike",owner:"taggon"},vala:{title:"Vala",require:"clike",optional:"regex",owner:"TemplarVolk"},vbnet:{title:"VB.Net",require:"basic",owner:"Bigsby"},velocity:{title:"Velocity",require:"markup",owner:"Golmote"},verilog:{title:"Verilog",owner:"a-rey"},vhdl:{title:"VHDL",owner:"a-rey"},vim:{title:"vim",owner:"westonganger"},"visual-basic":{title:"Visual Basic",alias:["vb","vba"],aliasTitles:{vba:"VBA"},owner:"Golmote"},warpscript:{title:"WarpScript",owner:"RunDevelopment"},wasm:{title:"WebAssembly",owner:"Golmote"},"web-idl":{title:"Web IDL",alias:"webidl",owner:"RunDevelopment"},wgsl:{title:"WGSL",owner:"Dr4gonthree"},wiki:{title:"Wiki markup",require:"markup",owner:"Golmote"},wolfram:{title:"Wolfram language",alias:["mathematica","nb","wl"],aliasTitles:{mathematica:"Mathematica",nb:"Mathematica Notebook"},owner:"msollami"},wren:{title:"Wren",owner:"clsource"},xeora:{title:"Xeora",require:"markup",alias:"xeoracube",aliasTitles:{xeoracube:"XeoraCube"},owner:"freakmaxi"},"xml-doc":{title:"XML doc (.net)",require:"markup",modify:["csharp","fsharp","vbnet"],owner:"RunDevelopment"},xojo:{title:"Xojo (REALbasic)",owner:"Golmote"},xquery:{title:"XQuery",require:"markup",owner:"Golmote"},yaml:{title:"YAML",alias:"yml",owner:"hason"},yang:{title:"YANG",owner:"RunDevelopment"},zig:{title:"Zig",owner:"RunDevelopment"}},plugins:{meta:{path:"plugins/{id}/prism-{id}",link:"plugins/{id}/"},"line-highlight":{title:"Line Highlight",description:"Highlights specific lines and/or line ranges."},"line-numbers":{title:"Line Numbers",description:"Line number at the beginning of code lines.",owner:"kuba-kubula"},"show-invisibles":{title:"Show Invisibles",description:"Show hidden characters such as tabs and line breaks.",optional:["autolinker","data-uri-highlight"]},autolinker:{title:"Autolinker",description:"Converts URLs and emails in code to clickable links. Parses Markdown links in comments."},wpd:{title:"WebPlatform Docs",description:'Makes tokens link to WebPlatform.org documentation. The links open in a new tab.'},"custom-class":{title:"Custom Class",description:"This plugin allows you to prefix Prism's default classes (.comment can become .namespace--comment) or replace them with your defined ones (like .editor__comment). You can even add new classes.",owner:"dvkndn",noCSS:!0},"file-highlight":{title:"File Highlight",description:"Fetch external files and highlight them with Prism. Used on the Prism website itself.",noCSS:!0},"show-language":{title:"Show Language",description:"Display the highlighted language in code blocks (inline code does not show the label).",owner:"nauzilus",noCSS:!0,require:"toolbar"},"jsonp-highlight":{title:"JSONP Highlight",description:"Fetch content with JSONP and highlight some interesting content (e.g. GitHub/Gists or Bitbucket API).",noCSS:!0,owner:"nauzilus"},"highlight-keywords":{title:"Highlight Keywords",description:"Adds special CSS classes for each keyword for fine-grained highlighting.",owner:"vkbansal",noCSS:!0},"remove-initial-line-feed":{title:"Remove initial line feed",description:"Removes the initial line feed in code blocks.",owner:"Golmote",noCSS:!0},"inline-color":{title:"Inline color",description:"Adds a small inline preview for colors in style sheets.",require:"css-extras",owner:"RunDevelopment"},previewers:{title:"Previewers",description:"Previewers for angles, colors, gradients, easing and time.",require:"css-extras",owner:"Golmote"},autoloader:{title:"Autoloader",description:"Automatically loads the needed languages to highlight the code blocks.",owner:"Golmote",noCSS:!0},"keep-markup":{title:"Keep Markup",description:"Prevents custom markup from being dropped out during highlighting.",owner:"Golmote",optional:"normalize-whitespace",noCSS:!0},"command-line":{title:"Command Line",description:"Display a command line with a prompt and, optionally, the output/response from the commands.",owner:"chriswells0"},"unescaped-markup":{title:"Unescaped Markup",description:"Write markup without having to escape anything."},"normalize-whitespace":{title:"Normalize Whitespace",description:"Supports multiple operations to normalize whitespace in code blocks.",owner:"zeitgeist87",optional:"unescaped-markup",noCSS:!0},"data-uri-highlight":{title:"Data-URI Highlight",description:"Highlights data-URI contents.",owner:"Golmote",noCSS:!0},toolbar:{title:"Toolbar",description:"Attach a toolbar for plugins to easily register buttons on the top of a code block.",owner:"mAAdhaTTah"},"copy-to-clipboard":{title:"Copy to Clipboard Button",description:"Add a button that copies the code block to the clipboard when clicked.",owner:"mAAdhaTTah",require:"toolbar",noCSS:!0},"download-button":{title:"Download Button",description:"A button in the toolbar of a code block adding a convenient way to download a code file.",owner:"Golmote",require:"toolbar",noCSS:!0},"match-braces":{title:"Match braces",description:"Highlights matching braces.",owner:"RunDevelopment"},"diff-highlight":{title:"Diff Highlight",description:"Highlights the code inside diff blocks.",owner:"RunDevelopment",require:"diff"},"filter-highlight-all":{title:"Filter highlightAll",description:"Filters the elements the highlightAll and highlightAllUnder methods actually highlight.",owner:"RunDevelopment",noCSS:!0},treeview:{title:"Treeview",description:"A language with special styles to highlight file system tree structures.",owner:"Golmote"}}})},4505:(e,t,n)=>{const r=n(6474),o=n(7151),a=new Set;function i(e){void 0===e?e=Object.keys(r.languages).filter((e=>"meta"!=e)):Array.isArray(e)||(e=[e]);const t=[...a,...Object.keys(Prism.languages)];o(r,e,t).load((e=>{if(!(e in r.languages))return void(i.silent||console.warn("Language does not exist: "+e));const t="./prism-"+e;delete n.c[n(9798).resolve(t)],delete Prism.languages[e],n(9798)(t),a.add(e)}))}i.silent=!1,e.exports=i},1143:()=>{!function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,o,a){if(n.language===r){var i=n.tokenStack=[];n.code=n.code.replace(o,(function(e){if("function"==typeof a&&!a(e))return e;for(var o,l=i.length;-1!==n.code.indexOf(o=t(r,l));)++l;return i[l]=e,o})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var o=0,a=Object.keys(n.tokenStack);!function i(l){for(var s=0;s=a.length);s++){var u=l[s];if("string"==typeof u||u.content&&"string"==typeof u.content){var c=a[o],f=n.tokenStack[c],d="string"==typeof u?u:u.content,p=t(r,c),m=d.indexOf(p);if(m>-1){++o;var h=d.substring(0,m),g=new e.Token(r,e.tokenize(f,n.grammar),"language-"+r,f),v=d.substring(m+p.length),y=[];h&&y.push.apply(y,i([h])),y.push(g),v&&y.push.apply(y,i([v])),"string"==typeof u?l.splice.apply(l,[s,1].concat(y)):u.content=y}}else u.content&&i(u.content)}return l}(n.tokens)}}}})}(Prism)},9798:(e,t,n)=>{var r={"./":4505};function o(e){var t=a(e);return n(t)}function a(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}o.keys=function(){return Object.keys(r)},o.resolve=a,e.exports=o,o.id=9798},7151:e=>{"use strict";var t=function(){var e=function(){};function t(e,t){Array.isArray(e)?e.forEach(t):null!=e&&t(e,0)}function n(e){for(var t={},n=0,r=e.length;n "));var l={},s=e[r];if(s){function u(t){if(!(t in e))throw new Error(r+" depends on an unknown component "+t);if(!(t in l))for(var i in o(t,a),l[t]=!0,n[t])l[i]=!0}t(s.require,u),t(s.optional,u),t(s.modify,u)}n[r]=l,a.pop()}}return function(e){var t=n[e];return t||(o(e,r),t=n[e]),t}}function o(e){for(var t in e)return!0;return!1}return function(a,i,l){var s=function(e){var t={};for(var n in e){var r=e[n];for(var o in r)if("meta"!=o){var a=r[o];t[o]="string"==typeof a?{title:a}:a}}return t}(a),u=function(e){var n;return function(r){if(r in e)return r;if(!n)for(var o in n={},e){var a=e[o];t(a&&a.alias,(function(t){if(t in n)throw new Error(t+" cannot be alias for both "+o+" and "+n[t]);if(t in e)throw new Error(t+" cannot be alias of "+o+" because it is a component.");n[t]=o}))}return n[r]||r}}(s);i=i.map(u),l=(l||[]).map(u);var c=n(i),f=n(l);i.forEach((function e(n){var r=s[n];t(r&&r.require,(function(t){t in f||(c[t]=!0,e(t))}))}));for(var d,p=r(s),m=c;o(m);){for(var h in d={},m){var g=s[h];t(g&&g.modify,(function(e){e in f&&(d[e]=!0)}))}for(var v in f)if(!(v in c))for(var y in p(v))if(y in c){d[v]=!0;break}for(var b in m=d)c[b]=!0}var w={getIds:function(){var e=[];return w.load((function(t){e.push(t)})),e},load:function(t,n){return function(t,n,r,o){var a=o?o.series:void 0,i=o?o.parallel:e,l={},s={};function u(e){if(e in l)return l[e];s[e]=!0;var o,c=[];for(var f in t(e))f in n&&c.push(f);if(0===c.length)o=r(e);else{var d=i(c.map((function(e){var t=u(e);return delete s[e],t})));a?o=a(d,(function(){return r(e)})):r(e)}return l[e]=o}for(var c in n)u(c);var f=[];for(var d in s)f.push(l[d]);return i(f)}(p,c,t,n)}};return w}}();e.exports=t},55:(e,t,n)=>{"use strict";var r=n(2528);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}},331:(e,t,n)=>{e.exports=n(55)()},2528:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},8310:(e,t,n)=>{"use strict";var r=n(2581),o=n(5515);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n