diff --git a/404.html b/404.html index 58cdab80..28c0a3c5 100644 --- a/404.html +++ b/404.html @@ -7,8 +7,8 @@ - - + +
Skip to main content
+decentralized ecosystem.

Was this page helpful?
Need some help? Check Support page
\ No newline at end of file diff --git a/architecture/node/network/index.html b/architecture/node/network/index.html index 65fc163a..23be05cc 100644 --- a/architecture/node/network/index.html +++ b/architecture/node/network/index.html @@ -7,8 +7,8 @@ - - + +
Skip to main content
+
Was this page helpful?
Need some help? Check Support page
\ No newline at end of file diff --git a/architecture/node/runtime/index.html b/architecture/node/runtime/index.html index db682571..e99a63ba 100644 --- a/architecture/node/runtime/index.html +++ b/architecture/node/runtime/index.html @@ -7,8 +7,8 @@ - - + +
Skip to main content
+
Was this page helpful?
Need some help? Check Support page
\ No newline at end of file diff --git a/architecture/node/server/index.html b/architecture/node/server/index.html index 7a99a35d..bac1b1cd 100644 --- a/architecture/node/server/index.html +++ b/architecture/node/server/index.html @@ -7,8 +7,8 @@ - - + +
Skip to main content
+
Was this page helpful?
Need some help? Check Support page
\ No newline at end of file diff --git a/architecture/node/storage/index.html b/architecture/node/storage/index.html index fb5622ee..c2ca2585 100644 --- a/architecture/node/storage/index.html +++ b/architecture/node/storage/index.html @@ -7,8 +7,8 @@ - - + +
Skip to main content
+
Was this page helpful?
Need some help? Check Support page
\ No newline at end of file diff --git a/architecture/system-overview/index.html b/architecture/system-overview/index.html index 1d12733c..f97607db 100644 --- a/architecture/system-overview/index.html +++ b/architecture/system-overview/index.html @@ -7,8 +7,8 @@ - - + +
Skip to main content
+contribute to a seamless decentralized experience.

Was this page helpful?
Need some help? Check Support page
\ No newline at end of file diff --git a/assets/js/0b74d420.232a010a.js b/assets/js/0b74d420.232a010a.js deleted file mode 100644 index 442b3d7e..00000000 --- a/assets/js/0b74d420.232a010a.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7154],{7128:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>c,default:()=>h,frontMatter:()=>o,metadata:()=>i,toc:()=>l});const i=JSON.parse('{"id":"core-concepts/encryption","title":"Encryption","description":"Encryption in Calimero ensures data security in transit over the network,","source":"@site/docs/03-core-concepts/07-encryption.mdx","sourceDirName":"03-core-concepts","slug":"/core-concepts/encryption","permalink":"/core-concepts/encryption","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/03-core-concepts/07-encryption.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":7,"frontMatter":{"id":"encryption","title":"Encryption"},"sidebar":"tutorialSidebar","previous":{"title":"Proxy Contract Interaction Guide","permalink":"/core-concepts/blockchains-integration/proxy-contract-interaction"},"next":{"title":"Specialized Nodes","permalink":"/core-concepts/specialized-nodes"}}');var r=t(6070),s=t(5248);const o={id:"encryption",title:"Encryption"},c=void 0,a={},l=[{value:"Key Principles",id:"key-principles",level:3},{value:"Double Ratchet Algorithm",id:"double-ratchet-algorithm",level:3},{value:"Tree-Based Diffie-Hellman Key Exchange",id:"tree-based-diffie-hellman-key-exchange",level:3}];function d(e){const n={h3:"h3",li:"li",ol:"ol",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.p,{children:"Encryption in Calimero ensures data security in transit over the network,\nmaintaining confidentiality and integrity."}),"\n",(0,r.jsx)(n.h3,{id:"key-principles",children:"Key Principles"}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Forward Secrecy"}),": Ensuring past messages remain secure even if a key is\ncompromised in the future."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Post-Compromise Security"}),": Ensuring future messages remain secure even\nafter any previous message has been compromised."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Zero Trust in Third Parties"}),": No reliance on intermediaries for security."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Verifiable End-to-End Encryption"}),": Confirming that only the intended\nrecipients can read the messages."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Asynchronous Communication"}),": Ability to start communications without\nrecipients being online."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Multi-Device Support"}),": Ensuring seamless use across multiple devices."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Deniability"}),": Providing plausible deniability for message authorship to\nnon-context members."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Non-Interactive Group Management"}),": Adding and removing context members\nwithout requiring interaction."]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"double-ratchet-algorithm",children:"Double Ratchet Algorithm"}),"\n",(0,r.jsx)(n.p,{children:"Each network message uses a distinct encryption key derived from the ratchet\nstate, providing forward secrecy by ensuring that the compromise of one key does\nnot affect the security of previous messages."}),"\n",(0,r.jsx)(n.p,{children:"Each context can configure Diffie-Hellman reset parameters. For one-on-one peer\ninteractions, resets can occur instantaneously, while for larger groups, resets\ncan happen at non-deterministic intervals to balance security and performance."}),"\n",(0,r.jsx)(n.h3,{id:"tree-based-diffie-hellman-key-exchange",children:"Tree-Based Diffie-Hellman Key Exchange"}),"\n",(0,r.jsx)(n.p,{children:"All contexts use a tree-based Diffie-Hellman key exchange. This method\nefficiently manages shared secrets among multiple members, ensuring that keys\nare updated and propagated correctly. The reset of keys occurs at the leaf nodes\nof the tree, guaranteeing post-compromise security."}),"\n",(0,r.jsx)(n.p,{children:"Adding a new member involves existing members using their prekeys to complete an\nX3DH (Triple Diffie-Hellman) exchange, securely adding the new member without\nrequiring direct interaction. Removing a member involves invalidating their keys\nand updating the shared secrets among remaining members, ensuring efficient and\nsecure updates."}),"\n",(0,r.jsx)(n.p,{children:"By leveraging advanced encryption techniques such as the Double Ratchet\nAlgorithm and tree-based Diffie-Hellman key exchange, Calimero ensures that all\ndata in transit is protected, maintaining the confidentiality and integrity of\nnetwork messages."})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},5248:(e,n,t)=>{t.d(n,{R:()=>o,x:()=>c});var i=t(758);const r={},s=i.createContext(r);function o(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/0b74d420.44be35e4.js b/assets/js/0b74d420.44be35e4.js new file mode 100644 index 00000000..da9a104e --- /dev/null +++ b/assets/js/0b74d420.44be35e4.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7154],{7128:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>a,contentTitle:()=>c,default:()=>h,frontMatter:()=>o,metadata:()=>t,toc:()=>l});const t=JSON.parse('{"id":"core-concepts/encryption","title":"Encryption","description":"Encryption in Calimero ensures data security in transit over the network,","source":"@site/docs/03-core-concepts/07-encryption.mdx","sourceDirName":"03-core-concepts","slug":"/core-concepts/encryption","permalink":"/core-concepts/encryption","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/03-core-concepts/07-encryption.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":7,"frontMatter":{"id":"encryption","title":"Encryption"},"sidebar":"tutorialSidebar","previous":{"title":"Blockchains Integration","permalink":"/core-concepts/blockchains-integration"},"next":{"title":"Specialized Nodes","permalink":"/core-concepts/specialized-nodes"}}');var r=i(6070),s=i(5248);const o={id:"encryption",title:"Encryption"},c=void 0,a={},l=[{value:"Key Principles",id:"key-principles",level:3},{value:"Double Ratchet Algorithm",id:"double-ratchet-algorithm",level:3},{value:"Tree-Based Diffie-Hellman Key Exchange",id:"tree-based-diffie-hellman-key-exchange",level:3}];function d(e){const n={h3:"h3",li:"li",ol:"ol",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.p,{children:"Encryption in Calimero ensures data security in transit over the network,\nmaintaining confidentiality and integrity."}),"\n",(0,r.jsx)(n.h3,{id:"key-principles",children:"Key Principles"}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Forward Secrecy"}),": Ensuring past messages remain secure even if a key is\ncompromised in the future."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Post-Compromise Security"}),": Ensuring future messages remain secure even\nafter any previous message has been compromised."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Zero Trust in Third Parties"}),": No reliance on intermediaries for security."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Verifiable End-to-End Encryption"}),": Confirming that only the intended\nrecipients can read the messages."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Asynchronous Communication"}),": Ability to start communications without\nrecipients being online."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Multi-Device Support"}),": Ensuring seamless use across multiple devices."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Deniability"}),": Providing plausible deniability for message authorship to\nnon-context members."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Non-Interactive Group Management"}),": Adding and removing context members\nwithout requiring interaction."]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"double-ratchet-algorithm",children:"Double Ratchet Algorithm"}),"\n",(0,r.jsx)(n.p,{children:"Each network message uses a distinct encryption key derived from the ratchet\nstate, providing forward secrecy by ensuring that the compromise of one key does\nnot affect the security of previous messages."}),"\n",(0,r.jsx)(n.p,{children:"Each context can configure Diffie-Hellman reset parameters. For one-on-one peer\ninteractions, resets can occur instantaneously, while for larger groups, resets\ncan happen at non-deterministic intervals to balance security and performance."}),"\n",(0,r.jsx)(n.h3,{id:"tree-based-diffie-hellman-key-exchange",children:"Tree-Based Diffie-Hellman Key Exchange"}),"\n",(0,r.jsx)(n.p,{children:"All contexts use a tree-based Diffie-Hellman key exchange. This method\nefficiently manages shared secrets among multiple members, ensuring that keys\nare updated and propagated correctly. The reset of keys occurs at the leaf nodes\nof the tree, guaranteeing post-compromise security."}),"\n",(0,r.jsx)(n.p,{children:"Adding a new member involves existing members using their prekeys to complete an\nX3DH (Triple Diffie-Hellman) exchange, securely adding the new member without\nrequiring direct interaction. Removing a member involves invalidating their keys\nand updating the shared secrets among remaining members, ensuring efficient and\nsecure updates."}),"\n",(0,r.jsx)(n.p,{children:"By leveraging advanced encryption techniques such as the Double Ratchet\nAlgorithm and tree-based Diffie-Hellman key exchange, Calimero ensures that all\ndata in transit is protected, maintaining the confidentiality and integrity of\nnetwork messages."})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},5248:(e,n,i)=>{i.d(n,{R:()=>o,x:()=>c});var t=i(758);const r={},s=t.createContext(r);function o(e){const n=t.useContext(s);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),t.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/0b99a0c5.c1a1afcb.js b/assets/js/0b99a0c5.a3e872b3.js similarity index 98% rename from assets/js/0b99a0c5.c1a1afcb.js rename to assets/js/0b99a0c5.a3e872b3.js index 1ec59986..b3529161 100644 --- a/assets/js/0b99a0c5.c1a1afcb.js +++ b/assets/js/0b99a0c5.a3e872b3.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5524],{8504:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>a,default:()=>h,frontMatter:()=>r,metadata:()=>i,toc:()=>l});const i=JSON.parse('{"id":"core-concepts/contexts","title":"Contexts","description":"Contexts are the core of the Calimero ecosystem. These are application specific","source":"@site/docs/03-core-concepts/04-context.mdx","sourceDirName":"03-core-concepts","slug":"/core-concepts/contexts","permalink":"/core-concepts/contexts","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/03-core-concepts/04-context.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":4,"frontMatter":{"id":"contexts","title":"Contexts"},"sidebar":"tutorialSidebar","previous":{"title":"Identity","permalink":"/core-concepts/identity"},"next":{"title":"Applications","permalink":"/core-concepts/applications"}}');var s=t(6070),o=t(5248);const r={id:"contexts",title:"Contexts"},a=void 0,c={},l=[{value:"How Contexts Work:",id:"how-contexts-work",level:4}];function d(e){const n={h4:"h4",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:"Contexts are the core of the Calimero ecosystem. These are application specific\nnetworks designed to enable direct communication between users, eliminating the\nneed for intermediaries. Here's a closer look at how they operate:"}),"\n",(0,s.jsx)(n.h4,{id:"how-contexts-work",children:(0,s.jsx)(n.strong,{children:"How Contexts Work:"})}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Initialization"}),": A user selects a WebAssembly (WASM) module from a\nrepository, which contains the logic and rules for the application. With\nthis, they initiate a new Application Network, creating a unique identity for\nthis specific network and setting the initial parameters and update\nstrategies."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Joining the Network"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Inviting Peers"}),": The initial user can invite others directly or set up\nAccess Control Lists (ACLs) to govern how new members can join the network."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"New Member Process"}),": When a new user joins, they generate a unique\nidentity for the network, download the relevant WASM module, and\nsynchronize with the existing data on the network. This process ensures\nthey're up to speed and ready to engage fully with the network's\nactivities."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Data Interaction"}),": Within the network, users can query and modify data\naccording to the application's rules. Each Application Network autonomously\nmanages data interactions, ensuring consistency and integrity."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Security and Privacy"}),": All communications within an Application Network\nare secured with end-to-end encryption, utilizing the Double Ratchet\nAlgorithm. This ensures that data exchanged between peers remains private and\nsecure."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Offline Capability and Consistency"}),": Calimero's design is 'offline-first,'\naccommodating the reality that peers may not always be online. When a peer\ngoes offline and later returns, they synchronize with the network to update\nand reconcile any changes, maintaining eventual consistency across the\nnetwork's state."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Governance and Updates"}),": Application Networks can be governed by the users\nthemselves, with decisions made through a consensus mechanism. Updates to the\nnetwork, including changes to the WASM module or network parameters, can be\nproposed and voted on by the network's members."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Extending network capabilities"}),": In addition to the core components of\nApplication Networks, Calimero introduces Specialized Nodes to further\nenhance network capabilities. These nodes are designed to perform specific\nfunctions that go beyond the standard operations of client nodes, such as\nheavy data processing, advanced encryption tasks, or providing additional\nstorage solutions. They play a crucial role in scaling the network's\nfunctionality and performance, ensuring that even as demand grows, the\nnetwork remains efficient and responsive. Specialized Nodes can be deployed\nby any participant in the network, including Calimero, third-party\ndevelopers, or users themselves, offering a flexible and decentralized\napproach to augmenting the network's capabilities. By leveraging these nodes,\nApplication Networks can meet the diverse needs of different applications,\nensuring that each network can be customized and optimized for its unique\nrequirements, all while maintaining the overarching principles of privacy,\nsecurity, and decentralization inherent to Calimero."]}),"\n"]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},5248:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>a});var i=t(758);const s={},o=i.createContext(s);function r(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5524],{8504:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>a,default:()=>h,frontMatter:()=>r,metadata:()=>i,toc:()=>l});const i=JSON.parse('{"id":"core-concepts/contexts","title":"Contexts","description":"Contexts are the core of the Calimero ecosystem. These are application specific","source":"@site/docs/03-core-concepts/04-context.mdx","sourceDirName":"03-core-concepts","slug":"/core-concepts/contexts","permalink":"/core-concepts/contexts","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/03-core-concepts/04-context.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":4,"frontMatter":{"id":"contexts","title":"Contexts"},"sidebar":"tutorialSidebar","previous":{"title":"Identity","permalink":"/core-concepts/identity"},"next":{"title":"Applications","permalink":"/core-concepts/applications"}}');var s=t(6070),o=t(5248);const r={id:"contexts",title:"Contexts"},a=void 0,c={},l=[{value:"How Contexts Work:",id:"how-contexts-work",level:4}];function d(e){const n={h4:"h4",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:"Contexts are the core of the Calimero ecosystem. These are application specific\nnetworks designed to enable direct communication between users, eliminating the\nneed for intermediaries. Here's a closer look at how they operate:"}),"\n",(0,s.jsx)(n.h4,{id:"how-contexts-work",children:(0,s.jsx)(n.strong,{children:"How Contexts Work:"})}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Initialization"}),": A user selects a WebAssembly (WASM) module from a\nrepository, which contains the logic and rules for the application. With\nthis, they initiate a new Application Network, creating a unique identity for\nthis specific network and setting the initial parameters and update\nstrategies."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Joining the Network"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Inviting Peers"}),": The initial user can invite others directly or set up\nAccess Control Lists (ACLs) to govern how new members can join the network."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"New Member Process"}),": When a new user joins, they generate a unique\nidentity for the network, download the relevant WASM module, and\nsynchronize with the existing data on the network. This process ensures\nthey're up to speed and ready to engage fully with the network's\nactivities."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Data Interaction"}),": Within the network, users can query and modify data\naccording to the application's rules. Each Application Network autonomously\nmanages data interactions, ensuring consistency and integrity."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Security and Privacy"}),": All communications within an Application Network\nare secured with end-to-end encryption, utilizing the Double Ratchet\nAlgorithm. This ensures that data exchanged between peers remains private and\nsecure."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Offline Capability and Consistency"}),": Calimero's design is 'offline-first,'\naccommodating the reality that peers may not always be online. When a peer\ngoes offline and later returns, they synchronize with the network to update\nand reconcile any changes, maintaining eventual consistency across the\nnetwork's state."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Governance and Updates"}),": Application Networks can be governed by the users\nthemselves, with decisions made through a consensus mechanism. Updates to the\nnetwork, including changes to the WASM module or network parameters, can be\nproposed and voted on by the network's members."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Extending network capabilities"}),": In addition to the core components of\nApplication Networks, Calimero introduces Specialized Nodes to further\nenhance network capabilities. These nodes are designed to perform specific\nfunctions that go beyond the standard operations of client nodes, such as\nheavy data processing, advanced encryption tasks, or providing additional\nstorage solutions. They play a crucial role in scaling the network's\nfunctionality and performance, ensuring that even as demand grows, the\nnetwork remains efficient and responsive. Specialized Nodes can be deployed\nby any participant in the network, including Calimero, third-party\ndevelopers, or users themselves, offering a flexible and decentralized\napproach to augmenting the network's capabilities. By leveraging these nodes,\nApplication Networks can meet the diverse needs of different applications,\nensuring that each network can be customized and optimized for its unique\nrequirements, all while maintaining the overarching principles of privacy,\nsecurity, and decentralization inherent to Calimero."]}),"\n"]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},5248:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>a});var i=t(758);const s={},o=i.createContext(s);function r(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/0c9c7602.641756d6.js b/assets/js/0c9c7602.e486e51d.js similarity index 99% rename from assets/js/0c9c7602.641756d6.js rename to assets/js/0c9c7602.e486e51d.js index ee777bf3..f826f654 100644 --- a/assets/js/0c9c7602.641756d6.js +++ b/assets/js/0c9c7602.e486e51d.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3365],{7803:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>h,frontMatter:()=>o,metadata:()=>i,toc:()=>c});const i=JSON.parse('{"id":"developer-tools/SDK/protocol-sdk/protocol-rs-sdk","title":"Rust Protocol SDK","description":"Getting Started with Calimero SDK for Rust","source":"@site/docs/05-developer-tools/02-SDK/03-protocol-sdk/02-protocol-rs-sdk.mdx","sourceDirName":"05-developer-tools/02-SDK/03-protocol-sdk","slug":"/developer-tools/SDK/protocol-sdk/protocol-rs-sdk","permalink":"/developer-tools/SDK/protocol-sdk/protocol-rs-sdk","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/05-developer-tools/02-SDK/03-protocol-sdk/02-protocol-rs-sdk.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":2,"frontMatter":{"id":"protocol-rs-sdk","title":"Rust Protocol SDK"},"sidebar":"tutorialSidebar","previous":{"title":"Protocol SDK","permalink":"/developer-tools/SDK/protocol-sdk/protocol-sdk"},"next":{"title":"TypeScript Client SDK","permalink":"/developer-tools/SDK/client-sdk/client-ts-sdk"}}');var r=t(6070),s=t(5248);const o={id:"protocol-rs-sdk",title:"Rust Protocol SDK"},a=void 0,l={},c=[{value:"Getting Started with Calimero SDK for Rust",id:"getting-started-with-calimero-sdk-for-rust",level:2},{value:"Prerequisites",id:"prerequisites",level:3},{value:"Setting Up Your Project",id:"setting-up-your-project",level:3},{value:"Writing Your Application",id:"writing-your-application",level:3},{value:"Building Your Application",id:"building-your-application",level:3},{value:"Deploying Your Application",id:"deploying-your-application",level:3},{value:"Writing Efficient Code with Calimero SDK",id:"writing-efficient-code-with-calimero-sdk",level:3},{value:"Handling Errors with Calimero SDK",id:"handling-errors-with-calimero-sdk",level:3},{value:"Error Report Comparison",id:"error-report-comparison",level:4},{value:"Emitting Events with Calimero SDK",id:"emitting-events-with-calimero-sdk",level:3},{value:"Ensuring Atomicity and Event Reliability in Calimero Applications",id:"ensuring-atomicity-and-event-reliability-in-calimero-applications",level:3},{value:"Atomic State Changes",id:"atomic-state-changes",level:4},{value:"Reliable Event Emission",id:"reliable-event-emission",level:4},{value:"Local-First Efficiency: No Network Overhead for Read-Only Calls",id:"local-first-efficiency-no-network-overhead-for-read-only-calls",level:3},{value:"Conclusion",id:"conclusion",level:3}];function d(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",...(0,s.R)(),...e.components},{Details:t}=n;return t||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h2,{id:"getting-started-with-calimero-sdk-for-rust",children:"Getting Started with Calimero SDK for Rust"}),"\n",(0,r.jsx)(n.p,{children:"The Calimero SDK for Rust empowers developers to build applications that compile\nto WebAssembly (Wasm) and run securely within the Calimero virtual machine (VM).\nThis guide will walk you through setting up a Rust project using the Calimero\nSDK, writing an application, and preparing it for deployment."}),"\n",(0,r.jsx)(n.h3,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,r.jsxs)(n.p,{children:["Before you begin, ensure you have Rust installed on your system. If not, follow\nthe official Rust installation guide for your platform:\n",(0,r.jsx)(n.a,{href:"https://www.rust-lang.org/tools/install",children:"Rust Installation Guide"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["You should ensure you have the ",(0,r.jsx)(n.code,{children:"wasm32-unknown-unknown"})," target installed. Run\nthe following command in your terminal to install the target:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"rustup target add wasm32-unknown-unknown\n"})}),"\n",(0,r.jsx)(n.h3,{id:"setting-up-your-project",children:"Setting Up Your Project"}),"\n",(0,r.jsx)(n.p,{children:"To create a new project, initialize a Rust library project using Cargo. Run the\nfollowing command in your terminal:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"cargo new --lib kv-store\n"})}),"\n",(0,r.jsx)(n.p,{children:"You should have a tree that looks like this:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"$ tree kv-store\nkv-store\n\u251c\u2500\u2500 Cargo.toml\n\u2514\u2500\u2500 src\n \u2514\u2500\u2500 lib.rs\n\n2 directories, 2 files\n"})}),"\n",(0,r.jsxs)(n.p,{children:["At this point, we can ",(0,r.jsx)(n.code,{children:"cd"})," into the ",(0,r.jsx)(n.code,{children:"kv-store"})," directory:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"cd kv-store\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Next, you need to specify the crate-type as ",(0,r.jsx)(n.code,{children:"cdylib"})," in your ",(0,r.jsx)(n.code,{children:"Cargo.toml"})," file\nto generate a dynamic library that can be compiled to Wasm:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-toml",metastring:'title="File: Cargo.toml"',children:'[lib]\ncrate-type = ["cdylib"]\n'})}),"\n",(0,r.jsxs)(n.p,{children:["You can now configure your project to use the Calimero SDK by adding it as a\ndependency in your ",(0,r.jsx)(n.code,{children:"Cargo.toml"})," file:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-toml",metastring:'title="File: Cargo.toml"',children:'[dependencies]\ncalimero-sdk = { git = "https://github.com/calimero-network/core" }\ncalimero-storage = { git = "https://github.com/calimero-network/core" }\n'})}),"\n",(0,r.jsx)(n.p,{children:"Then, we need to specify a custom build profile for the most compact Wasm\noutput:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-toml",metastring:'title="File: Cargo.toml"',children:'[profile.app-release]\ninherits = "release"\ncodegen-units = 1\nopt-level = "z"\nlto = true\ndebug = false\npanic = "abort"\noverflow-checks = true\n'})}),"\n",(0,r.jsxs)(t,{children:[(0,r.jsxs)("summary",{children:[" Your ",(0,r.jsx)(n.code,{children:"Cargo.toml"})," file should now look like this "]}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-toml",metastring:'title="File: Cargo.toml" showLineNumbers',children:'[package]\nname = "kv-store"\nversion = "0.1.0"\nedition = "2021"\n\n# highlight-start\n[lib]\ncrate-type = ["cdylib"]\n# highlight-end\n\n# highlight-start\n[dependencies]\ncalimero-sdk = { git = "https://github.com/calimero-network/core" }\ncalimero-storage = { git = "https://github.com/calimero-network/core" }\n# highlight-end\n\n# highlight-start\n[profile.app-release]\ninherits = "release"\ncodegen-units = 1\nopt-level = "z"\nlto = true\ndebug = false\npanic = "abort"\noverflow-checks = true\n# highlight-end\n'})})]}),"\n",(0,r.jsxs)(n.p,{children:["And finally, create a ",(0,r.jsx)(n.code,{children:"build.sh"})," script to compile your application into Wasm\nformat, for example:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="File: build.sh" showLineNumbers',children:'#!/bin/bash\nset -e\n\ncd "$(dirname $0)"\n\nTARGET="${CARGO_TARGET_DIR:-../../target}"\n\nrustup target add wasm32-unknown-unknown\n\ncargo build --target wasm32-unknown-unknown --profile app-release\n\nmkdir -p res\n\ncp $TARGET/wasm32-unknown-unknown/app-release/kv_store.wasm ./res/\n'})}),"\n",(0,r.jsxs)(n.p,{children:["You can optionally choose to install and use\n",(0,r.jsx)(n.a,{href:"https://github.com/WebAssembly/binaryen",children:(0,r.jsx)(n.code,{children:"wasm-opt"})}),", for an additional\noptimization step in the build script. This step is not required but can help\nreduce the size of the generated Wasm file:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="File: build.sh"',children:"if command -v wasm-opt > /dev/null; then\n wasm-opt -Oz ./res/kv_store.wasm -o ./res/kv_store.wasm\nfi\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Don't forget to make the ",(0,r.jsx)(n.code,{children:"build.sh"})," script executable:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"chmod +x build.sh\n"})}),"\n",(0,r.jsx)(n.p,{children:"At this point, your project structure should look like this:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"$ tree\n.\n\u251c\u2500\u2500 Cargo.toml\n\u251c\u2500\u2500 build.sh\n\u2514\u2500\u2500 src\n \u2514\u2500\u2500 lib.rs\n\n2 directories, 3 files\n"})}),"\n",(0,r.jsx)(n.h3,{id:"writing-your-application",children:"Writing Your Application"}),"\n",(0,r.jsxs)(n.p,{children:["Now, let's create a simple key-value store application using the Calimero SDK.\nStart by defining your application logic in ",(0,r.jsx)(n.code,{children:"lib.rs"}),":"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",metastring:'title="File: src/lib.rs" showLineNumbers',children:'use calimero_sdk::borsh::{BorshDeserialize, BorshSerialize};\nuse calimero_sdk::app;\n\n#[app::state]\n#[derive(Default, BorshSerialize, BorshDeserialize)]\n#[borsh(crate = "calimero_sdk::borsh")]\nstruct KvStore {}\n\n#[app::logic]\nimpl KvStore {\n #[app::init]\n pub fn init() -> KvStore {\n KvStore {}\n }\n}\n'})}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"KvStore"})," struct represents the state of your application, which will be\nborsh-encoded in the app-scoped state partition on the node's storage. The\n",(0,r.jsx)(n.code,{children:"#[app::state]"})," attribute macro marks the struct as the application state,\npermitting its use by Calimero SDK."]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"#[app::logic]"})," attribute macro marks the implementation block as the\napplication logic, allowing you to define the methods that interact with the\napplication state. An initializer method (named ",(0,r.jsx)(n.code,{children:"init"}),") is denoted by the\n",(0,r.jsx)(n.code,{children:"#[app::init]"})," attribute macro, which is called when the application is executed\nagainst a freshly created context."]}),"\n",(0,r.jsxs)(n.p,{children:["Consider a method like ",(0,r.jsx)(n.code,{children:"get"})," that retrieves a value from the key-value store:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",children:"pub fn get(&self, key: &str) -> Result, Error> {\n // Snip...\n}\n"})}),"\n",(0,r.jsxs)(n.p,{children:["The inputs must be deserializable from the transaction data, and the output must\nbe serializable to the response data. The ",(0,r.jsx)(n.code,{children:"Option"})," type is used to represent the\npossibility of the key not being present in the store. The ",(0,r.jsx)(n.code,{children:"Error"})," type is used\nto represent the possible error conditions that may occur during the execution\nof the method."]}),"\n",(0,r.jsx)(n.p,{children:"And now, here's a complete example of a key-value store application:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",metastring:'title="File: src/lib.rs" showLineNumbers',children:'use calimero_sdk::borsh::{BorshDeserialize, BorshSerialize};\nuse calimero_sdk::types::Error;\nuse calimero_sdk::{app, env};\nuse calimero_storage::collections::UnorderedMap;\n\n#[app::state]\n#[derive(Default, BorshSerialize, BorshDeserialize)]\n#[borsh(crate = "calimero_sdk::borsh")]\nstruct KvStore {\n entries: UnorderedMap,\n}\n\n#[app::logic]\nimpl KvStore {\n #[app::init]\n pub fn init() -> KvStore {\n // highlight-start\n KvStore {\n items: UnorderedMap::new(),\n }\n // highlight-end\n }\n\n // highlight-start\n pub fn set(&mut self, key: String, value: String) -> Result<(), Error> {\n env::log(&format!("Setting key: {:?} to value: {:?}", key, value));\n\n self.entries.insert(key, value)?;\n\n Ok(())\n }\n // highlight-end\n\n // highlight-start\n pub fn entries(&self) -> Result, Error> {\n env::log("Getting all entries");\n\n Ok(self.items.entries()?.collect())\n }\n // highlight-end\n\n // highlight-start\n pub fn get(&self, key: &str) -> Result, Error> {\n env::log(&format!("Getting key: {:?}", key));\n\n self.items.get(key).map_err(Into::into)\n }\n // highlight-end\n\n // highlight-start\n pub fn remove(&mut self, key: &str) -> Result, Error> {\n env::log(&format!("Removing key: {:?}", key));\n\n self.items.remove(key).map_err(Into::into)\n }\n // highlight-end\n}\n'})}),"\n",(0,r.jsx)(n.h3,{id:"building-your-application",children:"Building Your Application"}),"\n",(0,r.jsxs)(n.p,{children:["Once your application logic is defined, run the ",(0,r.jsx)(n.code,{children:"./build.sh"})," script to compile\nyour application into Wasm format. This script will generate ",(0,r.jsx)(n.code,{children:"kv_store.wasm"})," in\nthe ",(0,r.jsx)(n.code,{children:"res"})," folder of your application."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"$ ./build.sh\ninfo: component 'rust-std' for target 'wasm32-unknown-unknown' is up to date\n # Snip...\n Compiling calimero-sdk v0.1.0\n Compiling calimero-storage v0.1.0\n Compiling kv-store v0.1.0 (/apps/kv-store)\n Finished `app-release` profile [optimized] target(s) in 1.20s\n\n$ tree\n.\n\u251c\u2500\u2500 Cargo.toml\n\u251c\u2500\u2500 build.sh\n\u251c\u2500\u2500 res\n\u2502\xa0\xa0 \u2514\u2500\u2500 kv_store.wasm\n\u2514\u2500\u2500 src\n \u2514\u2500\u2500 lib.rs\n\n3 directories, 4 files\n"})}),"\n",(0,r.jsx)(n.h3,{id:"deploying-your-application",children:"Deploying Your Application"}),"\n",(0,r.jsxs)(n.p,{children:["After successfully building your application, you can upload the compiled\n",(0,r.jsx)(n.code,{children:"kv_store.wasm"})," to the registry for use by a live Calimero node."]}),"\n",(0,r.jsx)(n.h3,{id:"writing-efficient-code-with-calimero-sdk",children:"Writing Efficient Code with Calimero SDK"}),"\n",(0,r.jsx)(n.p,{children:"In the following code snippet:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",metastring:'title="File: src/lib.rs"',children:"pub fn get(&self, key: &str) -> Result, Error> {\n // Snip...\n}\n"})}),"\n",(0,r.jsx)(n.p,{children:"you'll notice that we prioritize using references instead of owned values. This\napproach optimizes performance and memory usage by minimizing unnecessary data\ncopying."}),"\n",(0,r.jsxs)(n.p,{children:["For input parameters, such as ",(0,r.jsx)(n.code,{children:"&str"})," and ",(0,r.jsx)(n.code,{children:"&[u8]"}),", utilizing references allows\nyou to avoid unnecessary copying of data. Similarly, for output values, you can\nreturn references to data that live as long as ",(0,r.jsx)(n.code,{children:"&self"})," or any of the input\nparameters. By doing so, you reduce memory overhead and improve the overall\nefficiency of your application."]}),"\n",(0,r.jsx)(n.h3,{id:"handling-errors-with-calimero-sdk",children:"Handling Errors with Calimero SDK"}),"\n",(0,r.jsxs)(n.p,{children:["When designing methods that may potentially fail, it's recommended to return a\n",(0,r.jsx)(n.code,{children:"Result"})," type with an error variant representing the possible failure cases.\nThis enables you to handle errors more effectively and communicate error\nconditions to users of your application. This is recommended over using the\n",(0,r.jsx)(n.code,{children:"Error"})," type exported from ",(0,r.jsx)(n.code,{children:"calimero_sdk"})," and over panicking. Both of which only\nreturn a string message."]}),"\n",(0,r.jsx)(n.h4,{id:"error-report-comparison",children:"Error Report Comparison"}),"\n",(0,r.jsx)(n.p,{children:"Let's take the following cases (all of which fail when the key does not exist);"}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Using ",(0,r.jsx)(n.code,{children:"calimero_sdk::types::Error"}),":"]}),"\n",(0,r.jsxs)(n.p,{children:["This is provided for convenience, since most errors already don't implement\n",(0,r.jsx)(n.code,{children:"Serialize"}),", and so they cannot be immediately returned. This first converts\nthe error to a string and then returns it. Which then JSON-encodes the string\nrepresentation."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",metastring:'title="File: src/lib.rs"',children:'use calimero_sdk::types::Error;\n\npub fn get(&self, key: &str) -> Result {\n self.items.get(key)?.ok_or_else(|| Error::msg("key not found"))\n}\n'})}),"\n",(0,r.jsx)(n.p,{children:"This failure will result in this outcome:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",children:"ExecutionError([ 107, 75, 101, 121, 32, 110, 111, 116, 32, 102, 111, 117, 110, 100, 34 ])\n"})}),"\n",(0,r.jsx)(n.p,{children:"which can be decoded to"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-json",children:'"key not found"\n'})}),"\n",(0,r.jsxs)(n.p,{children:["This ",(0,r.jsx)(n.code,{children:"Error"})," can be constructed with ",(0,r.jsx)(n.code,{children:"?"})," so long as the source error\nimplements ",(0,r.jsx)(n.code,{children:"std::error::Error"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["Behaviourally similar to\n",(0,r.jsx)(n.a,{href:"https://docs.rs/anyhow/latest/anyhow/struct.Error.html",children:(0,r.jsx)(n.code,{children:"anyhow::Error"})})," or\n",(0,r.jsx)(n.a,{href:"https://docs.rs/eyre/latest/eyre/struct.Report.html",children:(0,r.jsx)(n.code,{children:"eyre::Report"})}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Using a custom error type (recommended):"}),"\n",(0,r.jsx)(n.p,{children:"For structured error handling, we recommend defining a custom error type that\nencodes all the possible error variants for that method. This allows you to\nprovide more context about the error condition and handle different error\nscenarios more effectively. As opposed to string parsing."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",metastring:'title="File: src/lib.rs"',children:'use calimero_sdk::serde::Serialize;\n\n#[derive(Debug, Serialize)]\n#[serde(crate = "calimero_sdk::serde")]\n#[serde(tag = "kind", content = "data")]\npub enum Error<\'a> {\n NotFound(&\'a str),\n}\n'})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",metastring:'title="File: src/lib.rs"',children:"pub fn get<'a>(&self, key: &'a str) -> Result> {\n // Snip...\n Err(Error::NotFound(key))\n}\n"})}),"\n",(0,r.jsx)(n.p,{children:"This failure will result in this outcome:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",children:"ExecutionError([ 123, 34, 107, 105, 110, 100, 34, 58, 34, 78, 111, 116, 70, 111, 117, 110, 100, 34, 44, 34, 100, 97, 116, 97, 34, 58, 34, 116, 104, 105, 110, 103, 34, 125 ])\n"})}),"\n",(0,r.jsx)(n.p,{children:"which can be decoded to"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-json",children:'{ "kind": "NotFound", "data": "thing" }\n'})}),"\n",(0,r.jsx)(n.p,{children:"As will most likely be the case, you may need to work with storage errors\nwhile you've defined a custom error type."}),"\n",(0,r.jsxs)(n.p,{children:["In this case, you can pull in\n",(0,r.jsx)(n.a,{href:"https://docs.rs/thiserror/latest/thiserror/",children:(0,r.jsx)(n.code,{children:"thiserror"})})," to help."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",metastring:'title="File: src/lib.rs"',children:'use thiserror::Error;\n\n#[derive(Debug, Error, Serialize)]\n#[serde(crate = "calimero_sdk::serde")]\n#[serde(tag = "kind", content = "data")]\npub enum Error<\'a> {\n #[error("key not found: {0}")]\n NotFound(&\'a str),\n #[error("store error: {0}")]\n StoreError(#[from] StoreError),\n}\n'})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",metastring:'title="File: src/lib.rs"',children:"pub fn get<'a>(&self, key: &'a str) -> Result> {\n // Snip...\n self.items.get(key)?.ok_or_else(|| Error::NotFound(key))\n}\n"})}),"\n",(0,r.jsx)(n.p,{children:"An example store error would then be represented as:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",children:"ExecutionError(\n [\n 123, 34, 107, 105, 110, 100, 34, 58, 34, 83, 116, 111, 114, 101, 69, 114, 114, 111, 114, 34, 44, 34, 100, 97, 116, 97, 34, 58,\n 34, 73, 110, 100, 101, 120, 32, 110, 111, 116, 32, 102, 111, 117, 110, 100, 32, 102, 111, 114, 32, 73, 68, 58, 32, 57, 51, 49, 53,\n 97, 98, 101, 49, 101, 97, 101, 48, 102, 102, 53, 98, 48, 48, 52, 53, 51, 97, 100, 97, 102, 99, 99, 53, 102, 101, 102, 50, 49, 100,\n 55, 52, 49, 51, 57, 55, 101, 50, 49, 99, 53, 49, 53, 51, 55, 99, 51, 54, 52, 52, 50, 52, 50, 48, 56, 55, 52, 57, 99, 57, 34, 125,\n ],\n)\n"})}),"\n",(0,r.jsx)(n.p,{children:"which can be decoded to"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-json",children:'{\n "kind": "StoreError",\n "data": "Index not found for ID: 9315abe1eae0ff5b00453adafcc5fef21d741397e21c51537c364424208749c9"\n}\n'})}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Panic (ideally, development only)"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",metastring:'title="File: src/lib.rs"',children:'pub fn get(&self, key: &str) -> String {\n self.items.get(key).expect("store error").expect("key not found")\n}\n'})}),"\n",(0,r.jsx)(n.p,{children:"A non-existent key would then lead to this outcome:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",children:'HostError(\n Panic {\n context: Guest,\n message: "key not found",\n location: At {\n file: "apps/kv-store/src/lib.rs",\n line: 98,\n column: 14,\n },\n },\n)\n'})}),"\n",(0,r.jsx)(n.p,{children:"And a storage error, would produce this:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",children:'HostError(\n Panic {\n context: Guest,\n message: "store error: StorageError(IndexNotFound(Id { bytes: [123, 240, 135, 21, 77, 143, 81, 169, 15, 202, 99, 210, 167, 165, 188, 156, 87, 146, 7, 211, 100, 92, 169, 189, 124, 115, 200, 242, 240, 73, 68, 123] }))",\n location: At {\n file: "apps/kv-store/src/lib.rs",\n line: 98,\n column: 14,\n },\n },\n)\n'})}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"By following the second (recommended) approach, you can handle errors more\ngracefully and provide meaningful feedback to users of your Calimero\napplication."}),"\n",(0,r.jsx)(n.p,{children:"And the first approach, if you want a hassle-free method of dealing with errors."}),"\n",(0,r.jsx)(n.h3,{id:"emitting-events-with-calimero-sdk",children:"Emitting Events with Calimero SDK"}),"\n",(0,r.jsxs)(n.p,{children:["To facilitate real-time monitoring of state transitions within your Calimero\napplication, you can emit events using the ",(0,r.jsx)(n.code,{children:"app::emit!"})," macro provided by the\nCalimero SDK. Event emission is particularly useful for handling live state\ntransitions triggered by other actors, allowing subscribed clients to receive\nimmediate updates about relevant actions."]}),"\n",(0,r.jsxs)(n.p,{children:["Let's focus on emitting events for mutating calls, specifically ",(0,r.jsx)(n.code,{children:"set"})," and\n",(0,r.jsx)(n.code,{children:"remove"})," methods:"]}),"\n",(0,r.jsxs)(n.p,{children:["First, define your custom events using the ",(0,r.jsx)(n.code,{children:"#[app::event]"})," proc macro. In this\nexample, we'll define events for setting a new key-value pair (",(0,r.jsx)(n.code,{children:"Inserted"}),"),\nupdating an existing value (",(0,r.jsx)(n.code,{children:"Updated"}),"), and removing a key-value pair\n(",(0,r.jsx)(n.code,{children:"Removed"}),"):"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",metastring:'title="File: src/lib.rs"',children:"use calimero_sdk::app;\n\n#[app::event]\npub enum Event<'a> {\n Inserted { key: &'a str, value: &'a str },\n Updated { key: &'a str, value: &'a str },\n Removed { key: &'a str },\n}\n"})}),"\n",(0,r.jsx)(n.p,{children:"Each event variant can carry additional data to provide context about the event."}),"\n",(0,r.jsx)(n.p,{children:"Now, you need to associate the event with the application logic by annotating\nthe application state."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",metastring:'title="File: src/lib.rs"',children:"// highlight-start\n#[app::state(emits = for<'a> Event<'a>)]\n// highlight-end\n#[derive(Default, BorshSerialize, BorshDeserialize)]\n#[borsh(crate = \"calimero_sdk::borsh\")]\nstruct KvStore {\n // Snip...\n}\n"})}),"\n",(0,r.jsxs)(n.p,{children:["And finally, within your application logic methods, emit events using the\n",(0,r.jsx)(n.code,{children:"app::emit!"})," macro:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",metastring:'title="File: src/lib.rs"',children:'pub fn set(&mut self, key: String, value: String) -> Result<(), Error> {\n if self.items.contains(&key)? {\n app::emit!(Event::Updated {\n key: &key,\n value: &value,\n });\n } else {\n app::emit!(Event::Inserted {\n key: &key,\n value: &value,\n });\n }\n\n self.items.insert(key, value)?;\n\n Ok(())\n}\n\npub fn remove(&mut self, key: &str) -> Result {\n app::emit!(Event::Removed { key });\n\n self.entries.remove(key)?.ok_or_else(|| Error::msg("key not found"))\n}\n'})}),"\n",(0,r.jsx)(n.p,{children:"In each method, we emit the corresponding event with relevant data. This allows\nexternal observers to react to these events and take appropriate actions."}),"\n",(0,r.jsx)(n.p,{children:"By emitting events, you can ensure connected clients receive real-time updates\nabout state transitions within your Calimero application, enabling them to\nrespond to changes as they occur."}),"\n",(0,r.jsx)(n.h3,{id:"ensuring-atomicity-and-event-reliability-in-calimero-applications",children:"Ensuring Atomicity and Event Reliability in Calimero Applications"}),"\n",(0,r.jsx)(n.p,{children:"In Calimero applications, ensuring atomicity of state changes and reliability of\nevent emission is crucial for maintaining data consistency and facilitating\nreliable communication between actors. Here's how atomicity and event\nreliability are enforced:"}),"\n",(0,r.jsx)(n.h4,{id:"atomic-state-changes",children:"Atomic State Changes"}),"\n",(0,r.jsxs)(n.p,{children:["When a method call fails, whether due to panics or returning an ",(0,r.jsx)(n.code,{children:"Err"}),", all state\nchanges made up to that point are discarded. This ensures that if an operation\ncannot be completed successfully, the application's state remains consistent and\nunaffected by partial updates. By enforcing atomicity, Calimero promotes data\nintegrity and prevents inconsistencies that may arise from incomplete\ntransactions."]}),"\n",(0,r.jsx)(n.h4,{id:"reliable-event-emission",children:"Reliable Event Emission"}),"\n",(0,r.jsx)(n.p,{children:"Similarly, event emission in Calimero applications is tied to the successful\nexecution of transactions. Events are only relayed when a transaction has been\nsuccessfully executed, ensuring that external observers receive updates about\nstate changes reliably. By linking event emission to transaction execution,\nCalimero guarantees that event notifications accurately reflect the\napplication's current state, enhancing the reliability and consistency of\ncommunication between actors."}),"\n",(0,r.jsx)(n.p,{children:"This also means it doesn't matter if the event emission is done before or after\nthe state change, as the event will only be emitted if the state change is\nsuccessful."}),"\n",(0,r.jsx)(n.p,{children:"By adhering to these principles of atomicity and event reliability, Calimero\napplications maintain data integrity and enable robust interaction between\ndifferent components, facilitating the development of secure and dependable\ndecentralized systems."}),"\n",(0,r.jsx)(n.h3,{id:"local-first-efficiency-no-network-overhead-for-read-only-calls",children:"Local-First Efficiency: No Network Overhead for Read-Only Calls"}),"\n",(0,r.jsx)(n.p,{children:"In Calimero, adherence to the local-first principle eliminates the need for\nnetwork communication in read-only calls. Since read-only operations don't\nmodify the state, there's no associated network overhead. This local-first\napproach streamlines data access, promoting efficient and responsive application\nperformance without unnecessary network activity."}),"\n",(0,r.jsx)(n.h3,{id:"conclusion",children:"Conclusion"}),"\n",(0,r.jsx)(n.p,{children:"You've now learned how to set up a Rust project using the Calimero SDK, write a\nsimple application, build it into Wasm, and prepare it for deployment.\nExperiment with different features and functionalities to create powerful and\nsecure applications with Calimero."}),"\n",(0,r.jsx)(n.p,{children:"Happy coding! \ud83d\ude80"})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},5248:(e,n,t)=>{t.d(n,{R:()=>o,x:()=>a});var i=t(758);const r={},s=i.createContext(r);function o(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3365],{7803:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>h,frontMatter:()=>o,metadata:()=>i,toc:()=>c});const i=JSON.parse('{"id":"developer-tools/SDK/protocol-sdk/protocol-rs-sdk","title":"Rust Protocol SDK","description":"Getting Started with Calimero SDK for Rust","source":"@site/docs/05-developer-tools/02-SDK/03-protocol-sdk/02-protocol-rs-sdk.mdx","sourceDirName":"05-developer-tools/02-SDK/03-protocol-sdk","slug":"/developer-tools/SDK/protocol-sdk/protocol-rs-sdk","permalink":"/developer-tools/SDK/protocol-sdk/protocol-rs-sdk","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/05-developer-tools/02-SDK/03-protocol-sdk/02-protocol-rs-sdk.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":2,"frontMatter":{"id":"protocol-rs-sdk","title":"Rust Protocol SDK"},"sidebar":"tutorialSidebar","previous":{"title":"Protocol SDK","permalink":"/developer-tools/SDK/protocol-sdk/protocol-sdk"},"next":{"title":"TypeScript Client SDK","permalink":"/developer-tools/SDK/client-sdk/client-ts-sdk"}}');var r=t(6070),s=t(5248);const o={id:"protocol-rs-sdk",title:"Rust Protocol SDK"},a=void 0,l={},c=[{value:"Getting Started with Calimero SDK for Rust",id:"getting-started-with-calimero-sdk-for-rust",level:2},{value:"Prerequisites",id:"prerequisites",level:3},{value:"Setting Up Your Project",id:"setting-up-your-project",level:3},{value:"Writing Your Application",id:"writing-your-application",level:3},{value:"Building Your Application",id:"building-your-application",level:3},{value:"Deploying Your Application",id:"deploying-your-application",level:3},{value:"Writing Efficient Code with Calimero SDK",id:"writing-efficient-code-with-calimero-sdk",level:3},{value:"Handling Errors with Calimero SDK",id:"handling-errors-with-calimero-sdk",level:3},{value:"Error Report Comparison",id:"error-report-comparison",level:4},{value:"Emitting Events with Calimero SDK",id:"emitting-events-with-calimero-sdk",level:3},{value:"Ensuring Atomicity and Event Reliability in Calimero Applications",id:"ensuring-atomicity-and-event-reliability-in-calimero-applications",level:3},{value:"Atomic State Changes",id:"atomic-state-changes",level:4},{value:"Reliable Event Emission",id:"reliable-event-emission",level:4},{value:"Local-First Efficiency: No Network Overhead for Read-Only Calls",id:"local-first-efficiency-no-network-overhead-for-read-only-calls",level:3},{value:"Conclusion",id:"conclusion",level:3}];function d(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",...(0,s.R)(),...e.components},{Details:t}=n;return t||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h2,{id:"getting-started-with-calimero-sdk-for-rust",children:"Getting Started with Calimero SDK for Rust"}),"\n",(0,r.jsx)(n.p,{children:"The Calimero SDK for Rust empowers developers to build applications that compile\nto WebAssembly (Wasm) and run securely within the Calimero virtual machine (VM).\nThis guide will walk you through setting up a Rust project using the Calimero\nSDK, writing an application, and preparing it for deployment."}),"\n",(0,r.jsx)(n.h3,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,r.jsxs)(n.p,{children:["Before you begin, ensure you have Rust installed on your system. If not, follow\nthe official Rust installation guide for your platform:\n",(0,r.jsx)(n.a,{href:"https://www.rust-lang.org/tools/install",children:"Rust Installation Guide"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["You should ensure you have the ",(0,r.jsx)(n.code,{children:"wasm32-unknown-unknown"})," target installed. Run\nthe following command in your terminal to install the target:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"rustup target add wasm32-unknown-unknown\n"})}),"\n",(0,r.jsx)(n.h3,{id:"setting-up-your-project",children:"Setting Up Your Project"}),"\n",(0,r.jsx)(n.p,{children:"To create a new project, initialize a Rust library project using Cargo. Run the\nfollowing command in your terminal:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"cargo new --lib kv-store\n"})}),"\n",(0,r.jsx)(n.p,{children:"You should have a tree that looks like this:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"$ tree kv-store\nkv-store\n\u251c\u2500\u2500 Cargo.toml\n\u2514\u2500\u2500 src\n \u2514\u2500\u2500 lib.rs\n\n2 directories, 2 files\n"})}),"\n",(0,r.jsxs)(n.p,{children:["At this point, we can ",(0,r.jsx)(n.code,{children:"cd"})," into the ",(0,r.jsx)(n.code,{children:"kv-store"})," directory:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"cd kv-store\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Next, you need to specify the crate-type as ",(0,r.jsx)(n.code,{children:"cdylib"})," in your ",(0,r.jsx)(n.code,{children:"Cargo.toml"})," file\nto generate a dynamic library that can be compiled to Wasm:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-toml",metastring:'title="File: Cargo.toml"',children:'[lib]\ncrate-type = ["cdylib"]\n'})}),"\n",(0,r.jsxs)(n.p,{children:["You can now configure your project to use the Calimero SDK by adding it as a\ndependency in your ",(0,r.jsx)(n.code,{children:"Cargo.toml"})," file:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-toml",metastring:'title="File: Cargo.toml"',children:'[dependencies]\ncalimero-sdk = { git = "https://github.com/calimero-network/core" }\ncalimero-storage = { git = "https://github.com/calimero-network/core" }\n'})}),"\n",(0,r.jsx)(n.p,{children:"Then, we need to specify a custom build profile for the most compact Wasm\noutput:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-toml",metastring:'title="File: Cargo.toml"',children:'[profile.app-release]\ninherits = "release"\ncodegen-units = 1\nopt-level = "z"\nlto = true\ndebug = false\npanic = "abort"\noverflow-checks = true\n'})}),"\n",(0,r.jsxs)(t,{children:[(0,r.jsxs)("summary",{children:[" Your ",(0,r.jsx)(n.code,{children:"Cargo.toml"})," file should now look like this "]}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-toml",metastring:'title="File: Cargo.toml" showLineNumbers',children:'[package]\nname = "kv-store"\nversion = "0.1.0"\nedition = "2021"\n\n# highlight-start\n[lib]\ncrate-type = ["cdylib"]\n# highlight-end\n\n# highlight-start\n[dependencies]\ncalimero-sdk = { git = "https://github.com/calimero-network/core" }\ncalimero-storage = { git = "https://github.com/calimero-network/core" }\n# highlight-end\n\n# highlight-start\n[profile.app-release]\ninherits = "release"\ncodegen-units = 1\nopt-level = "z"\nlto = true\ndebug = false\npanic = "abort"\noverflow-checks = true\n# highlight-end\n'})})]}),"\n",(0,r.jsxs)(n.p,{children:["And finally, create a ",(0,r.jsx)(n.code,{children:"build.sh"})," script to compile your application into Wasm\nformat, for example:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="File: build.sh" showLineNumbers',children:'#!/bin/bash\nset -e\n\ncd "$(dirname $0)"\n\nTARGET="${CARGO_TARGET_DIR:-../../target}"\n\nrustup target add wasm32-unknown-unknown\n\ncargo build --target wasm32-unknown-unknown --profile app-release\n\nmkdir -p res\n\ncp $TARGET/wasm32-unknown-unknown/app-release/kv_store.wasm ./res/\n'})}),"\n",(0,r.jsxs)(n.p,{children:["You can optionally choose to install and use\n",(0,r.jsx)(n.a,{href:"https://github.com/WebAssembly/binaryen",children:(0,r.jsx)(n.code,{children:"wasm-opt"})}),", for an additional\noptimization step in the build script. This step is not required but can help\nreduce the size of the generated Wasm file:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="File: build.sh"',children:"if command -v wasm-opt > /dev/null; then\n wasm-opt -Oz ./res/kv_store.wasm -o ./res/kv_store.wasm\nfi\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Don't forget to make the ",(0,r.jsx)(n.code,{children:"build.sh"})," script executable:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"chmod +x build.sh\n"})}),"\n",(0,r.jsx)(n.p,{children:"At this point, your project structure should look like this:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"$ tree\n.\n\u251c\u2500\u2500 Cargo.toml\n\u251c\u2500\u2500 build.sh\n\u2514\u2500\u2500 src\n \u2514\u2500\u2500 lib.rs\n\n2 directories, 3 files\n"})}),"\n",(0,r.jsx)(n.h3,{id:"writing-your-application",children:"Writing Your Application"}),"\n",(0,r.jsxs)(n.p,{children:["Now, let's create a simple key-value store application using the Calimero SDK.\nStart by defining your application logic in ",(0,r.jsx)(n.code,{children:"lib.rs"}),":"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",metastring:'title="File: src/lib.rs" showLineNumbers',children:'use calimero_sdk::borsh::{BorshDeserialize, BorshSerialize};\nuse calimero_sdk::app;\n\n#[app::state]\n#[derive(Default, BorshSerialize, BorshDeserialize)]\n#[borsh(crate = "calimero_sdk::borsh")]\nstruct KvStore {}\n\n#[app::logic]\nimpl KvStore {\n #[app::init]\n pub fn init() -> KvStore {\n KvStore {}\n }\n}\n'})}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"KvStore"})," struct represents the state of your application, which will be\nborsh-encoded in the app-scoped state partition on the node's storage. The\n",(0,r.jsx)(n.code,{children:"#[app::state]"})," attribute macro marks the struct as the application state,\npermitting its use by Calimero SDK."]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"#[app::logic]"})," attribute macro marks the implementation block as the\napplication logic, allowing you to define the methods that interact with the\napplication state. An initializer method (named ",(0,r.jsx)(n.code,{children:"init"}),") is denoted by the\n",(0,r.jsx)(n.code,{children:"#[app::init]"})," attribute macro, which is called when the application is executed\nagainst a freshly created context."]}),"\n",(0,r.jsxs)(n.p,{children:["Consider a method like ",(0,r.jsx)(n.code,{children:"get"})," that retrieves a value from the key-value store:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",children:"pub fn get(&self, key: &str) -> Result, Error> {\n // Snip...\n}\n"})}),"\n",(0,r.jsxs)(n.p,{children:["The inputs must be deserializable from the transaction data, and the output must\nbe serializable to the response data. The ",(0,r.jsx)(n.code,{children:"Option"})," type is used to represent the\npossibility of the key not being present in the store. The ",(0,r.jsx)(n.code,{children:"Error"})," type is used\nto represent the possible error conditions that may occur during the execution\nof the method."]}),"\n",(0,r.jsx)(n.p,{children:"And now, here's a complete example of a key-value store application:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",metastring:'title="File: src/lib.rs" showLineNumbers',children:'use calimero_sdk::borsh::{BorshDeserialize, BorshSerialize};\nuse calimero_sdk::types::Error;\nuse calimero_sdk::{app, env};\nuse calimero_storage::collections::UnorderedMap;\n\n#[app::state]\n#[derive(Default, BorshSerialize, BorshDeserialize)]\n#[borsh(crate = "calimero_sdk::borsh")]\nstruct KvStore {\n entries: UnorderedMap,\n}\n\n#[app::logic]\nimpl KvStore {\n #[app::init]\n pub fn init() -> KvStore {\n // highlight-start\n KvStore {\n items: UnorderedMap::new(),\n }\n // highlight-end\n }\n\n // highlight-start\n pub fn set(&mut self, key: String, value: String) -> Result<(), Error> {\n env::log(&format!("Setting key: {:?} to value: {:?}", key, value));\n\n self.entries.insert(key, value)?;\n\n Ok(())\n }\n // highlight-end\n\n // highlight-start\n pub fn entries(&self) -> Result, Error> {\n env::log("Getting all entries");\n\n Ok(self.items.entries()?.collect())\n }\n // highlight-end\n\n // highlight-start\n pub fn get(&self, key: &str) -> Result, Error> {\n env::log(&format!("Getting key: {:?}", key));\n\n self.items.get(key).map_err(Into::into)\n }\n // highlight-end\n\n // highlight-start\n pub fn remove(&mut self, key: &str) -> Result, Error> {\n env::log(&format!("Removing key: {:?}", key));\n\n self.items.remove(key).map_err(Into::into)\n }\n // highlight-end\n}\n'})}),"\n",(0,r.jsx)(n.h3,{id:"building-your-application",children:"Building Your Application"}),"\n",(0,r.jsxs)(n.p,{children:["Once your application logic is defined, run the ",(0,r.jsx)(n.code,{children:"./build.sh"})," script to compile\nyour application into Wasm format. This script will generate ",(0,r.jsx)(n.code,{children:"kv_store.wasm"})," in\nthe ",(0,r.jsx)(n.code,{children:"res"})," folder of your application."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"$ ./build.sh\ninfo: component 'rust-std' for target 'wasm32-unknown-unknown' is up to date\n # Snip...\n Compiling calimero-sdk v0.1.0\n Compiling calimero-storage v0.1.0\n Compiling kv-store v0.1.0 (/apps/kv-store)\n Finished `app-release` profile [optimized] target(s) in 1.20s\n\n$ tree\n.\n\u251c\u2500\u2500 Cargo.toml\n\u251c\u2500\u2500 build.sh\n\u251c\u2500\u2500 res\n\u2502\xa0\xa0 \u2514\u2500\u2500 kv_store.wasm\n\u2514\u2500\u2500 src\n \u2514\u2500\u2500 lib.rs\n\n3 directories, 4 files\n"})}),"\n",(0,r.jsx)(n.h3,{id:"deploying-your-application",children:"Deploying Your Application"}),"\n",(0,r.jsxs)(n.p,{children:["After successfully building your application, you can upload the compiled\n",(0,r.jsx)(n.code,{children:"kv_store.wasm"})," to the registry for use by a live Calimero node."]}),"\n",(0,r.jsx)(n.h3,{id:"writing-efficient-code-with-calimero-sdk",children:"Writing Efficient Code with Calimero SDK"}),"\n",(0,r.jsx)(n.p,{children:"In the following code snippet:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",metastring:'title="File: src/lib.rs"',children:"pub fn get(&self, key: &str) -> Result, Error> {\n // Snip...\n}\n"})}),"\n",(0,r.jsx)(n.p,{children:"you'll notice that we prioritize using references instead of owned values. This\napproach optimizes performance and memory usage by minimizing unnecessary data\ncopying."}),"\n",(0,r.jsxs)(n.p,{children:["For input parameters, such as ",(0,r.jsx)(n.code,{children:"&str"})," and ",(0,r.jsx)(n.code,{children:"&[u8]"}),", utilizing references allows\nyou to avoid unnecessary copying of data. Similarly, for output values, you can\nreturn references to data that live as long as ",(0,r.jsx)(n.code,{children:"&self"})," or any of the input\nparameters. By doing so, you reduce memory overhead and improve the overall\nefficiency of your application."]}),"\n",(0,r.jsx)(n.h3,{id:"handling-errors-with-calimero-sdk",children:"Handling Errors with Calimero SDK"}),"\n",(0,r.jsxs)(n.p,{children:["When designing methods that may potentially fail, it's recommended to return a\n",(0,r.jsx)(n.code,{children:"Result"})," type with an error variant representing the possible failure cases.\nThis enables you to handle errors more effectively and communicate error\nconditions to users of your application. This is recommended over using the\n",(0,r.jsx)(n.code,{children:"Error"})," type exported from ",(0,r.jsx)(n.code,{children:"calimero_sdk"})," and over panicking. Both of which only\nreturn a string message."]}),"\n",(0,r.jsx)(n.h4,{id:"error-report-comparison",children:"Error Report Comparison"}),"\n",(0,r.jsx)(n.p,{children:"Let's take the following cases (all of which fail when the key does not exist);"}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Using ",(0,r.jsx)(n.code,{children:"calimero_sdk::types::Error"}),":"]}),"\n",(0,r.jsxs)(n.p,{children:["This is provided for convenience, since most errors already don't implement\n",(0,r.jsx)(n.code,{children:"Serialize"}),", and so they cannot be immediately returned. This first converts\nthe error to a string and then returns it. Which then JSON-encodes the string\nrepresentation."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",metastring:'title="File: src/lib.rs"',children:'use calimero_sdk::types::Error;\n\npub fn get(&self, key: &str) -> Result {\n self.items.get(key)?.ok_or_else(|| Error::msg("key not found"))\n}\n'})}),"\n",(0,r.jsx)(n.p,{children:"This failure will result in this outcome:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",children:"ExecutionError([ 107, 75, 101, 121, 32, 110, 111, 116, 32, 102, 111, 117, 110, 100, 34 ])\n"})}),"\n",(0,r.jsx)(n.p,{children:"which can be decoded to"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-json",children:'"key not found"\n'})}),"\n",(0,r.jsxs)(n.p,{children:["This ",(0,r.jsx)(n.code,{children:"Error"})," can be constructed with ",(0,r.jsx)(n.code,{children:"?"})," so long as the source error\nimplements ",(0,r.jsx)(n.code,{children:"std::error::Error"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["Behaviourally similar to\n",(0,r.jsx)(n.a,{href:"https://docs.rs/anyhow/latest/anyhow/struct.Error.html",children:(0,r.jsx)(n.code,{children:"anyhow::Error"})})," or\n",(0,r.jsx)(n.a,{href:"https://docs.rs/eyre/latest/eyre/struct.Report.html",children:(0,r.jsx)(n.code,{children:"eyre::Report"})}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Using a custom error type (recommended):"}),"\n",(0,r.jsx)(n.p,{children:"For structured error handling, we recommend defining a custom error type that\nencodes all the possible error variants for that method. This allows you to\nprovide more context about the error condition and handle different error\nscenarios more effectively. As opposed to string parsing."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",metastring:'title="File: src/lib.rs"',children:'use calimero_sdk::serde::Serialize;\n\n#[derive(Debug, Serialize)]\n#[serde(crate = "calimero_sdk::serde")]\n#[serde(tag = "kind", content = "data")]\npub enum Error<\'a> {\n NotFound(&\'a str),\n}\n'})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",metastring:'title="File: src/lib.rs"',children:"pub fn get<'a>(&self, key: &'a str) -> Result> {\n // Snip...\n Err(Error::NotFound(key))\n}\n"})}),"\n",(0,r.jsx)(n.p,{children:"This failure will result in this outcome:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",children:"ExecutionError([ 123, 34, 107, 105, 110, 100, 34, 58, 34, 78, 111, 116, 70, 111, 117, 110, 100, 34, 44, 34, 100, 97, 116, 97, 34, 58, 34, 116, 104, 105, 110, 103, 34, 125 ])\n"})}),"\n",(0,r.jsx)(n.p,{children:"which can be decoded to"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-json",children:'{ "kind": "NotFound", "data": "thing" }\n'})}),"\n",(0,r.jsx)(n.p,{children:"As will most likely be the case, you may need to work with storage errors\nwhile you've defined a custom error type."}),"\n",(0,r.jsxs)(n.p,{children:["In this case, you can pull in\n",(0,r.jsx)(n.a,{href:"https://docs.rs/thiserror/latest/thiserror/",children:(0,r.jsx)(n.code,{children:"thiserror"})})," to help."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",metastring:'title="File: src/lib.rs"',children:'use thiserror::Error;\n\n#[derive(Debug, Error, Serialize)]\n#[serde(crate = "calimero_sdk::serde")]\n#[serde(tag = "kind", content = "data")]\npub enum Error<\'a> {\n #[error("key not found: {0}")]\n NotFound(&\'a str),\n #[error("store error: {0}")]\n StoreError(#[from] StoreError),\n}\n'})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",metastring:'title="File: src/lib.rs"',children:"pub fn get<'a>(&self, key: &'a str) -> Result> {\n // Snip...\n self.items.get(key)?.ok_or_else(|| Error::NotFound(key))\n}\n"})}),"\n",(0,r.jsx)(n.p,{children:"An example store error would then be represented as:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",children:"ExecutionError(\n [\n 123, 34, 107, 105, 110, 100, 34, 58, 34, 83, 116, 111, 114, 101, 69, 114, 114, 111, 114, 34, 44, 34, 100, 97, 116, 97, 34, 58,\n 34, 73, 110, 100, 101, 120, 32, 110, 111, 116, 32, 102, 111, 117, 110, 100, 32, 102, 111, 114, 32, 73, 68, 58, 32, 57, 51, 49, 53,\n 97, 98, 101, 49, 101, 97, 101, 48, 102, 102, 53, 98, 48, 48, 52, 53, 51, 97, 100, 97, 102, 99, 99, 53, 102, 101, 102, 50, 49, 100,\n 55, 52, 49, 51, 57, 55, 101, 50, 49, 99, 53, 49, 53, 51, 55, 99, 51, 54, 52, 52, 50, 52, 50, 48, 56, 55, 52, 57, 99, 57, 34, 125,\n ],\n)\n"})}),"\n",(0,r.jsx)(n.p,{children:"which can be decoded to"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-json",children:'{\n "kind": "StoreError",\n "data": "Index not found for ID: 9315abe1eae0ff5b00453adafcc5fef21d741397e21c51537c364424208749c9"\n}\n'})}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Panic (ideally, development only)"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",metastring:'title="File: src/lib.rs"',children:'pub fn get(&self, key: &str) -> String {\n self.items.get(key).expect("store error").expect("key not found")\n}\n'})}),"\n",(0,r.jsx)(n.p,{children:"A non-existent key would then lead to this outcome:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",children:'HostError(\n Panic {\n context: Guest,\n message: "key not found",\n location: At {\n file: "apps/kv-store/src/lib.rs",\n line: 98,\n column: 14,\n },\n },\n)\n'})}),"\n",(0,r.jsx)(n.p,{children:"And a storage error, would produce this:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",children:'HostError(\n Panic {\n context: Guest,\n message: "store error: StorageError(IndexNotFound(Id { bytes: [123, 240, 135, 21, 77, 143, 81, 169, 15, 202, 99, 210, 167, 165, 188, 156, 87, 146, 7, 211, 100, 92, 169, 189, 124, 115, 200, 242, 240, 73, 68, 123] }))",\n location: At {\n file: "apps/kv-store/src/lib.rs",\n line: 98,\n column: 14,\n },\n },\n)\n'})}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"By following the second (recommended) approach, you can handle errors more\ngracefully and provide meaningful feedback to users of your Calimero\napplication."}),"\n",(0,r.jsx)(n.p,{children:"And the first approach, if you want a hassle-free method of dealing with errors."}),"\n",(0,r.jsx)(n.h3,{id:"emitting-events-with-calimero-sdk",children:"Emitting Events with Calimero SDK"}),"\n",(0,r.jsxs)(n.p,{children:["To facilitate real-time monitoring of state transitions within your Calimero\napplication, you can emit events using the ",(0,r.jsx)(n.code,{children:"app::emit!"})," macro provided by the\nCalimero SDK. Event emission is particularly useful for handling live state\ntransitions triggered by other actors, allowing subscribed clients to receive\nimmediate updates about relevant actions."]}),"\n",(0,r.jsxs)(n.p,{children:["Let's focus on emitting events for mutating calls, specifically ",(0,r.jsx)(n.code,{children:"set"})," and\n",(0,r.jsx)(n.code,{children:"remove"})," methods:"]}),"\n",(0,r.jsxs)(n.p,{children:["First, define your custom events using the ",(0,r.jsx)(n.code,{children:"#[app::event]"})," proc macro. In this\nexample, we'll define events for setting a new key-value pair (",(0,r.jsx)(n.code,{children:"Inserted"}),"),\nupdating an existing value (",(0,r.jsx)(n.code,{children:"Updated"}),"), and removing a key-value pair\n(",(0,r.jsx)(n.code,{children:"Removed"}),"):"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",metastring:'title="File: src/lib.rs"',children:"use calimero_sdk::app;\n\n#[app::event]\npub enum Event<'a> {\n Inserted { key: &'a str, value: &'a str },\n Updated { key: &'a str, value: &'a str },\n Removed { key: &'a str },\n}\n"})}),"\n",(0,r.jsx)(n.p,{children:"Each event variant can carry additional data to provide context about the event."}),"\n",(0,r.jsx)(n.p,{children:"Now, you need to associate the event with the application logic by annotating\nthe application state."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",metastring:'title="File: src/lib.rs"',children:"// highlight-start\n#[app::state(emits = for<'a> Event<'a>)]\n// highlight-end\n#[derive(Default, BorshSerialize, BorshDeserialize)]\n#[borsh(crate = \"calimero_sdk::borsh\")]\nstruct KvStore {\n // Snip...\n}\n"})}),"\n",(0,r.jsxs)(n.p,{children:["And finally, within your application logic methods, emit events using the\n",(0,r.jsx)(n.code,{children:"app::emit!"})," macro:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-rust",metastring:'title="File: src/lib.rs"',children:'pub fn set(&mut self, key: String, value: String) -> Result<(), Error> {\n if self.items.contains(&key)? {\n app::emit!(Event::Updated {\n key: &key,\n value: &value,\n });\n } else {\n app::emit!(Event::Inserted {\n key: &key,\n value: &value,\n });\n }\n\n self.items.insert(key, value)?;\n\n Ok(())\n}\n\npub fn remove(&mut self, key: &str) -> Result {\n app::emit!(Event::Removed { key });\n\n self.entries.remove(key)?.ok_or_else(|| Error::msg("key not found"))\n}\n'})}),"\n",(0,r.jsx)(n.p,{children:"In each method, we emit the corresponding event with relevant data. This allows\nexternal observers to react to these events and take appropriate actions."}),"\n",(0,r.jsx)(n.p,{children:"By emitting events, you can ensure connected clients receive real-time updates\nabout state transitions within your Calimero application, enabling them to\nrespond to changes as they occur."}),"\n",(0,r.jsx)(n.h3,{id:"ensuring-atomicity-and-event-reliability-in-calimero-applications",children:"Ensuring Atomicity and Event Reliability in Calimero Applications"}),"\n",(0,r.jsx)(n.p,{children:"In Calimero applications, ensuring atomicity of state changes and reliability of\nevent emission is crucial for maintaining data consistency and facilitating\nreliable communication between actors. Here's how atomicity and event\nreliability are enforced:"}),"\n",(0,r.jsx)(n.h4,{id:"atomic-state-changes",children:"Atomic State Changes"}),"\n",(0,r.jsxs)(n.p,{children:["When a method call fails, whether due to panics or returning an ",(0,r.jsx)(n.code,{children:"Err"}),", all state\nchanges made up to that point are discarded. This ensures that if an operation\ncannot be completed successfully, the application's state remains consistent and\nunaffected by partial updates. By enforcing atomicity, Calimero promotes data\nintegrity and prevents inconsistencies that may arise from incomplete\ntransactions."]}),"\n",(0,r.jsx)(n.h4,{id:"reliable-event-emission",children:"Reliable Event Emission"}),"\n",(0,r.jsx)(n.p,{children:"Similarly, event emission in Calimero applications is tied to the successful\nexecution of transactions. Events are only relayed when a transaction has been\nsuccessfully executed, ensuring that external observers receive updates about\nstate changes reliably. By linking event emission to transaction execution,\nCalimero guarantees that event notifications accurately reflect the\napplication's current state, enhancing the reliability and consistency of\ncommunication between actors."}),"\n",(0,r.jsx)(n.p,{children:"This also means it doesn't matter if the event emission is done before or after\nthe state change, as the event will only be emitted if the state change is\nsuccessful."}),"\n",(0,r.jsx)(n.p,{children:"By adhering to these principles of atomicity and event reliability, Calimero\napplications maintain data integrity and enable robust interaction between\ndifferent components, facilitating the development of secure and dependable\ndecentralized systems."}),"\n",(0,r.jsx)(n.h3,{id:"local-first-efficiency-no-network-overhead-for-read-only-calls",children:"Local-First Efficiency: No Network Overhead for Read-Only Calls"}),"\n",(0,r.jsx)(n.p,{children:"In Calimero, adherence to the local-first principle eliminates the need for\nnetwork communication in read-only calls. Since read-only operations don't\nmodify the state, there's no associated network overhead. This local-first\napproach streamlines data access, promoting efficient and responsive application\nperformance without unnecessary network activity."}),"\n",(0,r.jsx)(n.h3,{id:"conclusion",children:"Conclusion"}),"\n",(0,r.jsx)(n.p,{children:"You've now learned how to set up a Rust project using the Calimero SDK, write a\nsimple application, build it into Wasm, and prepare it for deployment.\nExperiment with different features and functionalities to create powerful and\nsecure applications with Calimero."}),"\n",(0,r.jsx)(n.p,{children:"Happy coding! \ud83d\ude80"})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},5248:(e,n,t)=>{t.d(n,{R:()=>o,x:()=>a});var i=t(758);const r={},s=i.createContext(r);function o(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/0fd0086a.20330983.js b/assets/js/0fd0086a.20330983.js new file mode 100644 index 00000000..11f9bd50 --- /dev/null +++ b/assets/js/0fd0086a.20330983.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6114],{3133:(e,o,t)=>{t.r(o),t.d(o,{assets:()=>c,contentTitle:()=>a,default:()=>u,frontMatter:()=>i,metadata:()=>s,toc:()=>p});const s=JSON.parse('{"id":"tutorials/awesome-projects/rock-paper-scissors","title":"Rock Paper Scissors","description":"A popular game we all know and love, but this time played online and enforcing","source":"@site/docs/06-tutorials/07-awesome-projects/02-rock-paper-scissors.mdx","sourceDirName":"06-tutorials/07-awesome-projects","slug":"/tutorials/awesome-projects/rock-paper-scissors","permalink":"/tutorials/awesome-projects/rock-paper-scissors","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/06-tutorials/07-awesome-projects/02-rock-paper-scissors.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":2,"frontMatter":{"id":"rock-paper-scissors","title":"Rock Paper Scissors"},"sidebar":"tutorialSidebar","previous":{"title":"Only Peers","permalink":"/tutorials/awesome-projects/only-peers"},"next":{"title":"Blockchain interaction with Proxy Contract","permalink":"/tutorials/proxy-contract-interaction"}}');var r=t(6070),n=t(5248);const i={id:"rock-paper-scissors",title:"Rock Paper Scissors"},a=void 0,c={},p=[];function l(e){const o={a:"a",p:"p",...(0,n.R)(),...e.components};return(0,r.jsxs)(o.p,{children:["A popular game we all know and love, but this time played online and enforcing\ncomplete security using the commit - reveal scheme. After you pick your choice\nof either rock, paper or scissors, you encrypt your choice with a password. This\nensures the other player can\u2019t see your choice. After your opponent has also\ndecided, it is time to reveal your password and determine the winner. You cannot\nchange your mind between choosing and revealing because your choice is locked\nwith the special password. This prevents any bad actors from changing their\nminds in the middle of the game.Have fun with a classic game that is completely\nfair and private! Explore the source code on\n",(0,r.jsx)(o.a,{href:"https://github.com/calimero-network/rock-paper-scissors",children:"GitHub repository"})]})}function u(e={}){const{wrapper:o}={...(0,n.R)(),...e.components};return o?(0,r.jsx)(o,{...e,children:(0,r.jsx)(l,{...e})}):l(e)}},5248:(e,o,t)=>{t.d(o,{R:()=>i,x:()=>a});var s=t(758);const r={},n=s.createContext(r);function i(e){const o=s.useContext(n);return s.useMemo((function(){return"function"==typeof e?e(o):{...o,...e}}),[o,e])}function a(e){let o;return o=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),s.createElement(n.Provider,{value:o},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/0fd0086a.d23c6153.js b/assets/js/0fd0086a.d23c6153.js deleted file mode 100644 index eb071744..00000000 --- a/assets/js/0fd0086a.d23c6153.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6114],{3133:(e,o,t)=>{t.r(o),t.d(o,{assets:()=>c,contentTitle:()=>a,default:()=>u,frontMatter:()=>i,metadata:()=>s,toc:()=>p});const s=JSON.parse('{"id":"tutorials/awesome-projects/rock-paper-scissors","title":"Rock Paper Scissors","description":"A popular game we all know and love, but this time played online and enforcing","source":"@site/docs/06-tutorials/07-awesome-projects/02-rock-paper-scissors.mdx","sourceDirName":"06-tutorials/07-awesome-projects","slug":"/tutorials/awesome-projects/rock-paper-scissors","permalink":"/tutorials/awesome-projects/rock-paper-scissors","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/06-tutorials/07-awesome-projects/02-rock-paper-scissors.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":2,"frontMatter":{"id":"rock-paper-scissors","title":"Rock Paper Scissors"},"sidebar":"tutorialSidebar","previous":{"title":"Only Peers","permalink":"/tutorials/awesome-projects/only-peers"},"next":{"title":"The Data Sovereignty Manifesto","permalink":"/resources/manifesto"}}');var r=t(6070),n=t(5248);const i={id:"rock-paper-scissors",title:"Rock Paper Scissors"},a=void 0,c={},p=[];function l(e){const o={a:"a",p:"p",...(0,n.R)(),...e.components};return(0,r.jsxs)(o.p,{children:["A popular game we all know and love, but this time played online and enforcing\ncomplete security using the commit - reveal scheme. After you pick your choice\nof either rock, paper or scissors, you encrypt your choice with a password. This\nensures the other player can\u2019t see your choice. After your opponent has also\ndecided, it is time to reveal your password and determine the winner. You cannot\nchange your mind between choosing and revealing because your choice is locked\nwith the special password. This prevents any bad actors from changing their\nminds in the middle of the game.Have fun with a classic game that is completely\nfair and private! Explore the source code on\n",(0,r.jsx)(o.a,{href:"https://github.com/calimero-network/rock-paper-scissors",children:"GitHub repository"})]})}function u(e={}){const{wrapper:o}={...(0,n.R)(),...e.components};return o?(0,r.jsx)(o,{...e,children:(0,r.jsx)(l,{...e})}):l(e)}},5248:(e,o,t)=>{t.d(o,{R:()=>i,x:()=>a});var s=t(758);const r={},n=s.createContext(r);function i(e){const o=s.useContext(n);return s.useMemo((function(){return"function"==typeof e?e(o):{...o,...e}}),[o,e])}function a(e){let o;return o=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),s.createElement(n.Provider,{value:o},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/100c5efa.93ea76ea.js b/assets/js/100c5efa.bb8a7aad.js similarity index 96% rename from assets/js/100c5efa.93ea76ea.js rename to assets/js/100c5efa.bb8a7aad.js index 760f89a6..d05d59d6 100644 --- a/assets/js/100c5efa.93ea76ea.js +++ b/assets/js/100c5efa.bb8a7aad.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3490],{8934:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>a,contentTitle:()=>l,default:()=>d,frontMatter:()=>i,metadata:()=>n,toc:()=>c});const n=JSON.parse('{"id":"throubleshooting/overview","title":"General","description":"This section offers guidance on resolving common issues with Calimero Network","source":"@site/docs/08-throubleshooting/01-overview.mdx","sourceDirName":"08-throubleshooting","slug":"/throubleshooting/overview","permalink":"/throubleshooting/overview","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/08-throubleshooting/01-overview.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":1,"frontMatter":{"id":"overview","title":"General"},"sidebar":"tutorialSidebar","previous":{"title":"ELI5","permalink":"/resources/eli5"},"next":{"title":"SSL/TLS","permalink":"/throubleshooting/ssl-tls"}}');var r=o(6070),s=o(5248);const i={id:"overview",title:"General"},l=void 0,a={},c=[];function u(e){const t={p:"p",...(0,s.R)(),...e.components};return(0,r.jsx)(t.p,{children:"This section offers guidance on resolving common issues with Calimero Network\nfeatures. As the platform evolves, additional troubleshooting topics will be\nadded to help address various challenges. For further assistance, consult our\ncommunity forums or reach out through official support channels."})}function d(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(u,{...e})}):u(e)}},5248:(e,t,o)=>{o.d(t,{R:()=>i,x:()=>l});var n=o(758);const r={},s=n.createContext(r);function i(e){const t=n.useContext(s);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),n.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3490],{8934:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>a,contentTitle:()=>l,default:()=>d,frontMatter:()=>i,metadata:()=>n,toc:()=>c});const n=JSON.parse('{"id":"throubleshooting/overview","title":"General","description":"This section offers guidance on resolving common issues with Calimero Network","source":"@site/docs/08-throubleshooting/01-overview.mdx","sourceDirName":"08-throubleshooting","slug":"/throubleshooting/overview","permalink":"/throubleshooting/overview","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/08-throubleshooting/01-overview.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":1,"frontMatter":{"id":"overview","title":"General"},"sidebar":"tutorialSidebar","previous":{"title":"ELI5","permalink":"/resources/eli5"},"next":{"title":"SSL/TLS","permalink":"/throubleshooting/ssl-tls"}}');var r=o(6070),s=o(5248);const i={id:"overview",title:"General"},l=void 0,a={},c=[];function u(e){const t={p:"p",...(0,s.R)(),...e.components};return(0,r.jsx)(t.p,{children:"This section offers guidance on resolving common issues with Calimero Network\nfeatures. As the platform evolves, additional troubleshooting topics will be\nadded to help address various challenges. For further assistance, consult our\ncommunity forums or reach out through official support channels."})}function d(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(u,{...e})}):u(e)}},5248:(e,t,o)=>{o.d(t,{R:()=>i,x:()=>l});var n=o(758);const r={},s=n.createContext(r);function i(e){const t=n.useContext(s);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),n.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/1307.ffe4e65b.js b/assets/js/1307.68614d34.js similarity index 59% rename from assets/js/1307.ffe4e65b.js rename to assets/js/1307.68614d34.js index fd1100f1..4ca68ce5 100644 --- a/assets/js/1307.ffe4e65b.js +++ b/assets/js/1307.68614d34.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1307],{3688:(e,s,c)=>{c.d(s,{createGitGraphServices:()=>a.b});var a=c(4105);c(5409)}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1307],{1307:(e,s,c)=>{c.d(s,{createGitGraphServices:()=>a.b});var a=c(4105);c(5409)}}]); \ No newline at end of file diff --git a/assets/js/13e31531.fc8a2f08.js b/assets/js/13e31531.fc8a2f08.js deleted file mode 100644 index 987d0cc1..00000000 --- a/assets/js/13e31531.fc8a2f08.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6189],{2002:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>c,default:()=>h,frontMatter:()=>a,metadata:()=>o,toc:()=>l});const o=JSON.parse('{"id":"core-concepts/blockchains-integration/blockchain-integrations","title":"Blockchain Integrations","description":"Calimero offers integration with multiple blockchain protocols, allowing users","source":"@site/docs/03-core-concepts/06-blockchains-integration/01-blockchain-integration-general.mdx","sourceDirName":"03-core-concepts/06-blockchains-integration","slug":"/core-concepts/blockchains-integration/blockchain-integrations","permalink":"/core-concepts/blockchains-integration/blockchain-integrations","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/03-core-concepts/06-blockchains-integration/01-blockchain-integration-general.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":1,"frontMatter":{"id":"blockchain-integrations","title":"Blockchain Integrations"},"sidebar":"tutorialSidebar","previous":{"title":"Applications","permalink":"/core-concepts/applications"},"next":{"title":"Context Contract","permalink":"/core-concepts/blockchains-integration/context-contract"}}');var r=t(6070),i=t(5248);const a={id:"blockchain-integrations",title:"Blockchain Integrations"},c="Blockchain Integrations",s={},l=[{value:"Current Blockchain Integrations",id:"current-blockchain-integrations",level:2},{value:"Operations",id:"operations",level:2},{value:"Functionalities",id:"functionalities",level:2},{value:"Functionality Details",id:"functionality-details",level:2},{value:"Calimero Contracts",id:"calimero-contracts",level:2},{value:"Context Contract",id:"context-contract",level:3},{value:"Proxy Contract",id:"proxy-contract",level:3},{value:"Deployment of Contracts",id:"deployment-of-contracts",level:3},{value:"Context Contract",id:"context-contract-1",level:4},{value:"Proxy Contract",id:"proxy-contract-1",level:4},{value:"Example Application",id:"example-application",level:3}];function d(e){const n={a:"a",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",li:"li",mermaid:"mermaid",p:"p",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"blockchain-integrations",children:"Blockchain Integrations"})}),"\n",(0,r.jsx)(n.p,{children:"Calimero offers integration with multiple blockchain protocols, allowing users\nto interact with the blockchain and perform read and write operations."}),"\n",(0,r.jsx)(n.h2,{id:"current-blockchain-integrations",children:"Current Blockchain Integrations"}),"\n",(0,r.jsx)(n.p,{children:"Calimero currently supports the following blockchain protocols:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"NEAR"}),"\n",(0,r.jsx)(n.li,{children:"Starknet"}),"\n",(0,r.jsx)(n.li,{children:"Internet Computer (ICP)"}),"\n"]}),"\n",(0,r.jsx)("div",{style:{display:"flex",justifyContent:"center"},children:(0,r.jsx)(n.mermaid,{value:"graph TD\nA[Calimero] --\x3e B[Integrations]\nB --\x3e C[NEAR]\nB --\x3e D[Starknet]\nB --\x3e E[ICP]"})}),"\n",(0,r.jsx)(n.h2,{id:"operations",children:"Operations"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Read"}),"\n",(0,r.jsx)(n.li,{children:"Read the data from the Calimero contracts."}),"\n",(0,r.jsx)(n.li,{children:"Write"}),"\n",(0,r.jsx)(n.li,{children:"Write data to any contract on the same blockchain protocol through\ncross-contract calls in the Proxy Contract."}),"\n"]}),"\n",(0,r.jsx)("div",{style:{display:"flex",justifyContent:"center"},children:(0,r.jsx)(n.mermaid,{value:"graph TD\nA[Calimero]\nB[Context Contract]\nC[Proxy Contract]\nD[Transfers]\nE[Cross-Contract Calls]\n\nA <--\x3e B\nA <--\x3e C\nC --\x3e D\nC --\x3e E"})}),"\n",(0,r.jsx)(n.h2,{id:"functionalities",children:"Functionalities"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Cross-contract calls"}),"\n",(0,r.jsx)(n.li,{children:"Transfers"}),"\n",(0,r.jsx)(n.li,{children:"Storage of arbitrary data"}),"\n",(0,r.jsx)(n.li,{children:"Configuration of the internal configuration variables"}),"\n",(0,r.jsx)(n.li,{children:"Proposal creation and execution"}),"\n"]}),"\n",(0,r.jsx)("div",{style:{display:"flex",justifyContent:"center"},children:(0,r.jsx)(n.mermaid,{value:"graph TD\nA[Proxy Contract] --\x3e|Cross-contract Calls| B[Other Contracts]\nA --\x3e|Transfers| C[Token Transfers]\nA --\x3e|Data Storage| D[Key-Value Storage]\nA --\x3e|Configuration| E[Internal Variables]\nE --\x3e|Change Votes Required| F[Vote Configuration]\nE --\x3e|Change Proposal Limits| G[Proposal Limits]"})}),"\n",(0,r.jsx)(n.h2,{id:"functionality-details",children:"Functionality Details"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Cross-contract calls"}),": Proxy contract allows making cross-contract calls to\nother contracts on the same blockchain protocol. Users need to specify the\ncontract address, the method to call, and the arguments for that method."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Transfers"}),": Proxy contract allows transferring tokens to the specified\naddress. Users need to specify the recipient address and the amount of tokens\nto transfer."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Storage of arbitrary data"}),": Proxy contract allows storing arbitrary data in\nthe context storage. Users need to specify the key and the value for the data\nto be stored."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Configuration of the internal configuration variables"}),": Configure the\ninternal configuration variables of the Calimero contracts:"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Vote configuration"}),": Number of votes required for a proposals to be\napproved (u32)"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Proposal limits"}),": Maximum number of proposals that one user can have at the\nsame time(u32)"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Proposal creation and execution"}),": Proposals are created by users and\ncontain one or multiple actions that are voted on by the users of the context.\nIf a proposal is approved, it is automatically executed by the Calimero Proxy\nContract."]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"calimero-contracts",children:"Calimero Contracts"}),"\n",(0,r.jsx)(n.p,{children:"Calimero integrates two types of contracts for each blockchain protocol:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Context Contract"}),"\n",(0,r.jsx)(n.li,{children:"Proxy Contract"}),"\n"]}),"\n",(0,r.jsx)("div",{style:{display:"flex",justifyContent:"center"},children:(0,r.jsx)(n.mermaid,{value:"graph TD\nA[User] --\x3e|Creates Context| B[Context Contract]\nB --\x3e|Creates| C[Context]\nB --\x3e|Adds Admin| D[User as Admin]\nB --\x3e|Deploys| E[Proxy Contract]\nE --\x3e|Handles| F[Proposals, Votes, Execution]\nF --\x3e|Executes Actions| G[Blockchain Operations]"})}),"\n",(0,r.jsx)(n.h3,{id:"context-contract",children:"Context Contract"}),"\n",(0,r.jsx)(n.p,{children:"The Context Contract is responsible for creating contexts, adding and removing\nmembers, editing their privileges, and associating specific applications with a\ncontext."}),"\n",(0,r.jsx)(n.h3,{id:"proxy-contract",children:"Proxy Contract"}),"\n",(0,r.jsx)(n.p,{children:"Each context has its own Proxy Contract instance which is deployed during the\ncontext creation."}),"\n",(0,r.jsx)("div",{style:{display:"flex",justifyContent:"center"},children:(0,r.jsx)(n.mermaid,{value:"graph TD\nA[User] --\x3e|Creates Proposal| B[Proxy Contract]\nB --\x3e|Stores Proposal| C[Proposal Storage]\nC --\x3e|Voting by Members| D{Required Votes Met?}\nD --\x3e|Yes| E[Execute Proposal]\nD --\x3e|No| F[Store Vote Count]"})}),"\n",(0,r.jsx)(n.h3,{id:"deployment-of-contracts",children:"Deployment of Contracts"}),"\n",(0,r.jsx)(n.h4,{id:"context-contract-1",children:"Context Contract"}),"\n",(0,r.jsx)(n.p,{children:"Context Contract is predeployed on each blockchain by the Calimero team."}),"\n",(0,r.jsx)(n.h4,{id:"proxy-contract-1",children:"Proxy Contract"}),"\n",(0,r.jsx)(n.p,{children:"Proxy Contract is deployed during the context creation."}),"\n",(0,r.jsx)("div",{style:{display:"flex",justifyContent:"center"},children:(0,r.jsx)(n.mermaid,{value:"graph TD\nA[Calimero Team] --\x3e|Pre-deploys| B[Context Contract]\nB --\x3e|During Context Creation| C[Proxy Contract]\nC --\x3e|Unique Instance| D[Context-specific Proxy]"})}),"\n",(0,r.jsx)(n.h3,{id:"example-application",children:"Example Application"}),"\n",(0,r.jsx)(n.p,{children:"We have an example application that connects to Calimero Proxy Contract and\nallows creating proposals, voting on them, and executing the approved proposals."}),"\n",(0,r.jsx)("div",{style:{display:"flex",justifyContent:"center"},children:(0,r.jsx)(n.mermaid,{value:"graph TD\nA[Application] --\x3e|Connects to| B[Calimero Proxy Contract]\nB --\x3e|Handles| C[Proposals]\nC --\x3e|Create| D[New Proposals]\nC --\x3e|Approve| E[Proposal Voting]\nC --\x3e|Delete| J[Delete Proposal]\nE --\x3e|Check Votes| F{Required Votes Met?}\nF --\x3e|Yes| G[Execute Proposal]\nG --\x3e|Perform Actions| H[Blockchain Operations]\nF --\x3e|No| I[Store Vote Count]"})}),"\n",(0,r.jsxs)(n.p,{children:["Application code can be found\n",(0,r.jsx)(n.a,{href:"https://github.com/calimero-network/demo-blockchain-integrations",children:"here"}),"."]})]})}function h(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},5248:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>c});var o=t(758);const r={},i=o.createContext(r);function a(e){const n=o.useContext(i);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),o.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/20df42f5.9f0b7736.js b/assets/js/20df42f5.f4c7191b.js similarity index 99% rename from assets/js/20df42f5.9f0b7736.js rename to assets/js/20df42f5.f4c7191b.js index 8aad3cc7..6a8e47f2 100644 --- a/assets/js/20df42f5.9f0b7736.js +++ b/assets/js/20df42f5.f4c7191b.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3690],{5046:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>d,default:()=>h,frontMatter:()=>o,metadata:()=>i,toc:()=>l});const i=JSON.parse('{"id":"core-concepts/identity","title":"Identity","description":"Calimero Decentralized Identity","source":"@site/docs/03-core-concepts/03-identity.mdx","sourceDirName":"03-core-concepts","slug":"/core-concepts/identity","permalink":"/core-concepts/identity","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/03-core-concepts/03-identity.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":3,"frontMatter":{"id":"identity","title":"Identity"},"sidebar":"tutorialSidebar","previous":{"title":"Terminology","permalink":"/core-concepts/terminology"},"next":{"title":"Contexts","permalink":"/core-concepts/contexts"}}');var r=t(6070),s=t(5248);const o={id:"identity",title:"Identity"},d=void 0,c={},l=[{value:"Calimero Decentralized Identity",id:"calimero-decentralized-identity",level:2},{value:"Network identity",id:"network-identity",level:3},{value:"Network Keys",id:"network-keys",level:4},{value:"Context identity",id:"context-identity",level:3},{value:"Decentralized Identity (DID) document",id:"decentralized-identity-did-document",level:3},{value:"Root keys",id:"root-keys",level:4},{value:"Client keys",id:"client-keys",level:4},{value:"Runtime keys",id:"runtime-keys",level:4},{value:"Encryption keys",id:"encryption-keys",level:4}];function a(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h2,{id:"calimero-decentralized-identity",children:"Calimero Decentralized Identity"}),"\n",(0,r.jsx)(n.p,{children:"Calimero\u2019s decentralized identity framework is designed to provide secure,\nanonymous, and decentralized control across the network. It leverages multiple\ntypes of cryptographic keys to manage identities and ensure the integrity of\noperations within the network."}),"\n",(0,r.jsx)(n.h3,{id:"network-identity",children:"Network identity"}),"\n",(0,r.jsxs)(n.p,{children:["Network identity is defined within the configuration file on each node. This\nidentity is derived from ",(0,r.jsx)(n.a,{href:"#network-keys",children:"network keys"}),", which generate a unique\n",(0,r.jsx)(n.code,{children:"Peer ID"})," for each node, allowing peers to identify themselves to other peers in\nthe network."]}),"\n",(0,r.jsx)(n.h4,{id:"network-keys",children:"Network Keys"}),"\n",(0,r.jsxs)(n.p,{children:["Network keys are used to authenticate nodes within the network, with each node\nhaving a unique private-public key pair that it uses to verify its identity to\nother nodes. During connection setup, nodes exchange public keys to ensure they\nare communicating with the intended parties. More in\n",(0,r.jsx)(n.a,{href:"../architecture/node/network#identify",children:"Network"})]}),"\n",(0,r.jsx)(n.h3,{id:"context-identity",children:"Context identity"}),"\n",(0,r.jsxs)(n.p,{children:["Context identity allows users to identify themselves within a specific context.\nUsers can have arbitrary number of identities within a specific context which\nremains encapsulated within the context. These identities are linked to\n",(0,r.jsx)(n.a,{href:"#runtime-keys",children:"runtime keys"}),", with each context identity connected to one\nruntime key."]}),"\n",(0,r.jsx)(n.h3,{id:"decentralized-identity-did-document",children:"Decentralized Identity (DID) document"}),"\n",(0,r.jsx)(n.p,{children:"All context-specific identities and node keys are managed through a\nDecentralized Identity (DID) document stored on the node. This document\nincludes:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#root-keys",children:"Root Keys"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#client-keys",children:"Client Keys"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#runtime-keys",children:"Runtime Keys"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#encryption-keys",children:"Encryption Keys"})}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Calimero's key management utilizes multiple keys for various purposes, ensuring\nsecure, anonymous, and decentralized control across the network. This structure\nunderpins secure and efficient operations within the Calimero Network,\nfacilitating both node and application functionalities."}),"\n",(0,r.jsx)(n.h4,{id:"root-keys",children:"Root keys"}),"\n",(0,r.jsx)(n.p,{children:"Root keys provide full access for node operations, including managing root keys,\nlisting identifiers, and generating new client keys. Web3 wallets can be used as\nfundamental for root keys, simplifying the setup process."}),"\n",(0,r.jsx)(n.h4,{id:"client-keys",children:"Client keys"}),"\n",(0,r.jsx)(n.p,{children:"Client keys are generated on login and used by the frontend. Stored in browser\nlocal storage, these keys initiate applications and server as permissioned\naccess to the node."}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Client Key Usage"}),":"]}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Key Creation"}),": Users generate a new keypair in their browser."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Verification"}),":","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"A Verifiable Presentation Request is sent to the node, which responds with\na challenge."}),"\n",(0,r.jsx)(n.li,{children:"The challenge and public key are signed using the root key."}),"\n",(0,r.jsx)(n.li,{children:"Upon node verification of the request and signature, the new key is cleared\nfor JSONRPC API communication from the browser to the node."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Calimero's TypeScript SDK supports developers in building browser and CLI\napplications by simplifying interaction with the network."}),"\n",(0,r.jsx)(n.h4,{id:"runtime-keys",children:"Runtime keys"}),"\n",(0,r.jsx)(n.p,{children:"Runtime keys are used for signing transactions within a context, with the\nappropriate key selected based on the context identity."}),"\n",(0,r.jsx)(n.h4,{id:"encryption-keys",children:"Encryption keys"}),"\n",(0,r.jsxs)(n.p,{children:["Keys used for encrypting and decrypting messages between peers in the context.\nEach context has its own encryption key. More in ",(0,r.jsx)(n.a,{href:"./encryption",children:"Encryption"})]})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},5248:(e,n,t)=>{t.d(n,{R:()=>o,x:()=>d});var i=t(758);const r={},s=i.createContext(r);function o(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3690],{5046:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>d,default:()=>h,frontMatter:()=>o,metadata:()=>i,toc:()=>l});const i=JSON.parse('{"id":"core-concepts/identity","title":"Identity","description":"Calimero Decentralized Identity","source":"@site/docs/03-core-concepts/03-identity.mdx","sourceDirName":"03-core-concepts","slug":"/core-concepts/identity","permalink":"/core-concepts/identity","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/03-core-concepts/03-identity.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":3,"frontMatter":{"id":"identity","title":"Identity"},"sidebar":"tutorialSidebar","previous":{"title":"Terminology","permalink":"/core-concepts/terminology"},"next":{"title":"Contexts","permalink":"/core-concepts/contexts"}}');var r=t(6070),s=t(5248);const o={id:"identity",title:"Identity"},d=void 0,c={},l=[{value:"Calimero Decentralized Identity",id:"calimero-decentralized-identity",level:2},{value:"Network identity",id:"network-identity",level:3},{value:"Network Keys",id:"network-keys",level:4},{value:"Context identity",id:"context-identity",level:3},{value:"Decentralized Identity (DID) document",id:"decentralized-identity-did-document",level:3},{value:"Root keys",id:"root-keys",level:4},{value:"Client keys",id:"client-keys",level:4},{value:"Runtime keys",id:"runtime-keys",level:4},{value:"Encryption keys",id:"encryption-keys",level:4}];function a(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h2,{id:"calimero-decentralized-identity",children:"Calimero Decentralized Identity"}),"\n",(0,r.jsx)(n.p,{children:"Calimero\u2019s decentralized identity framework is designed to provide secure,\nanonymous, and decentralized control across the network. It leverages multiple\ntypes of cryptographic keys to manage identities and ensure the integrity of\noperations within the network."}),"\n",(0,r.jsx)(n.h3,{id:"network-identity",children:"Network identity"}),"\n",(0,r.jsxs)(n.p,{children:["Network identity is defined within the configuration file on each node. This\nidentity is derived from ",(0,r.jsx)(n.a,{href:"#network-keys",children:"network keys"}),", which generate a unique\n",(0,r.jsx)(n.code,{children:"Peer ID"})," for each node, allowing peers to identify themselves to other peers in\nthe network."]}),"\n",(0,r.jsx)(n.h4,{id:"network-keys",children:"Network Keys"}),"\n",(0,r.jsxs)(n.p,{children:["Network keys are used to authenticate nodes within the network, with each node\nhaving a unique private-public key pair that it uses to verify its identity to\nother nodes. During connection setup, nodes exchange public keys to ensure they\nare communicating with the intended parties. More in\n",(0,r.jsx)(n.a,{href:"../architecture/node/network#identify",children:"Network"})]}),"\n",(0,r.jsx)(n.h3,{id:"context-identity",children:"Context identity"}),"\n",(0,r.jsxs)(n.p,{children:["Context identity allows users to identify themselves within a specific context.\nUsers can have arbitrary number of identities within a specific context which\nremains encapsulated within the context. These identities are linked to\n",(0,r.jsx)(n.a,{href:"#runtime-keys",children:"runtime keys"}),", with each context identity connected to one\nruntime key."]}),"\n",(0,r.jsx)(n.h3,{id:"decentralized-identity-did-document",children:"Decentralized Identity (DID) document"}),"\n",(0,r.jsx)(n.p,{children:"All context-specific identities and node keys are managed through a\nDecentralized Identity (DID) document stored on the node. This document\nincludes:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#root-keys",children:"Root Keys"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#client-keys",children:"Client Keys"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#runtime-keys",children:"Runtime Keys"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#encryption-keys",children:"Encryption Keys"})}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Calimero's key management utilizes multiple keys for various purposes, ensuring\nsecure, anonymous, and decentralized control across the network. This structure\nunderpins secure and efficient operations within the Calimero Network,\nfacilitating both node and application functionalities."}),"\n",(0,r.jsx)(n.h4,{id:"root-keys",children:"Root keys"}),"\n",(0,r.jsx)(n.p,{children:"Root keys provide full access for node operations, including managing root keys,\nlisting identifiers, and generating new client keys. Web3 wallets can be used as\nfundamental for root keys, simplifying the setup process."}),"\n",(0,r.jsx)(n.h4,{id:"client-keys",children:"Client keys"}),"\n",(0,r.jsx)(n.p,{children:"Client keys are generated on login and used by the frontend. Stored in browser\nlocal storage, these keys initiate applications and server as permissioned\naccess to the node."}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Client Key Usage"}),":"]}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Key Creation"}),": Users generate a new keypair in their browser."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Verification"}),":","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"A Verifiable Presentation Request is sent to the node, which responds with\na challenge."}),"\n",(0,r.jsx)(n.li,{children:"The challenge and public key are signed using the root key."}),"\n",(0,r.jsx)(n.li,{children:"Upon node verification of the request and signature, the new key is cleared\nfor JSONRPC API communication from the browser to the node."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Calimero's TypeScript SDK supports developers in building browser and CLI\napplications by simplifying interaction with the network."}),"\n",(0,r.jsx)(n.h4,{id:"runtime-keys",children:"Runtime keys"}),"\n",(0,r.jsx)(n.p,{children:"Runtime keys are used for signing transactions within a context, with the\nappropriate key selected based on the context identity."}),"\n",(0,r.jsx)(n.h4,{id:"encryption-keys",children:"Encryption keys"}),"\n",(0,r.jsxs)(n.p,{children:["Keys used for encrypting and decrypting messages between peers in the context.\nEach context has its own encryption key. More in ",(0,r.jsx)(n.a,{href:"./encryption",children:"Encryption"})]})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},5248:(e,n,t)=>{t.d(n,{R:()=>o,x:()=>d});var i=t(758);const r={},s=i.createContext(r);function o(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/22dd74f7.252be362.js b/assets/js/22dd74f7.252be362.js new file mode 100644 index 00000000..e90d58c5 --- /dev/null +++ b/assets/js/22dd74f7.252be362.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1567],{5226:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"current","label":"0.2.0","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":"What is Calimero","href":"/introduction/what-is-calimero","docId":"introduction/what-is-calimero","unlisted":false},{"type":"link","label":"Use Cases","href":"/introduction/use-cases","docId":"introduction/use-cases","unlisted":false},{"type":"link","label":"Key Features","href":"/introduction/key-features","docId":"introduction/key-features","unlisted":false}]},{"type":"category","label":"Getting Started","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Setup","href":"/getting-started/setup","docId":"getting-started/setup","unlisted":false},{"type":"link","label":"Build From Source","href":"/getting-started/build-from-source","docId":"getting-started/build-from-source","unlisted":false}]},{"type":"category","label":"Core Concepts","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Terminology","href":"/core-concepts/terminology","docId":"core-concepts/terminology","unlisted":false},{"type":"link","label":"Identity","href":"/core-concepts/identity","docId":"core-concepts/identity","unlisted":false},{"type":"link","label":"Contexts","href":"/core-concepts/contexts","docId":"core-concepts/contexts","unlisted":false},{"type":"link","label":"Applications","href":"/core-concepts/applications","docId":"core-concepts/applications","unlisted":false},{"type":"link","label":"Blockchains Integration","href":"/core-concepts/blockchains-integration","docId":"core-concepts/blockchains-integration","unlisted":false},{"type":"link","label":"Encryption","href":"/core-concepts/encryption","docId":"core-concepts/encryption","unlisted":false},{"type":"link","label":"Specialized Nodes","href":"/core-concepts/specialized-nodes","docId":"core-concepts/specialized-nodes","unlisted":false}]},{"type":"category","label":"Architecture","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"System Overview","href":"/architecture/system-overview","docId":"architecture/system-overview","unlisted":false},{"type":"category","label":"Node","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Client Node","href":"/architecture/node/client-node","docId":"architecture/node/client-node","unlisted":false},{"type":"link","label":"Runtime","href":"/architecture/node/runtime","docId":"architecture/node/runtime","unlisted":false},{"type":"link","label":"Server","href":"/architecture/node/server","docId":"architecture/node/server","unlisted":false},{"type":"link","label":"Storage","href":"/architecture/node/storage","docId":"architecture/node/storage","unlisted":false},{"type":"link","label":"Network","href":"/architecture/node/network","docId":"architecture/node/network","unlisted":false}]}]},{"type":"category","label":"Developer Tools","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Developer Tools","href":"/developer-tools/overview","docId":"developer-tools/overview","unlisted":false},{"type":"category","label":"CLI","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Merod","href":"/developer-tools/CLI/merod","docId":"developer-tools/CLI/merod","unlisted":false},{"type":"link","label":"Meroctl","href":"/developer-tools/CLI/meroctl","docId":"developer-tools/CLI/meroctl","unlisted":false}]},{"type":"category","label":"SDK","collapsible":true,"collapsed":true,"items":[{"type":"category","label":"Protocol SDKs","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Protocol SDK","href":"/developer-tools/SDK/protocol-sdk/protocol-sdk","docId":"developer-tools/SDK/protocol-sdk/protocol-sdk","unlisted":false},{"type":"link","label":"Rust Protocol SDK","href":"/developer-tools/SDK/protocol-sdk/protocol-rs-sdk","docId":"developer-tools/SDK/protocol-sdk/protocol-rs-sdk","unlisted":false}]},{"type":"category","label":"Client SDKs","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"TypeScript Client SDK","href":"/developer-tools/SDK/client-sdk/client-ts-sdk","docId":"developer-tools/SDK/client-sdk/client-ts-sdk","unlisted":false}]}]},{"type":"category","label":"Apps","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Admin Dashboard","href":"/developer-tools/apps/admin-dashboard","docId":"developer-tools/apps/admin-dashboard","unlisted":false},{"type":"link","label":"Desktop App","href":"/developer-tools/apps/desktop-app","docId":"developer-tools/apps/desktop-app","unlisted":false}]},{"type":"link","label":"Tests","href":"/developer-tools/tests","docId":"developer-tools/tests","unlisted":false}]},{"type":"category","label":"Tutorials","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Overview","href":"/tutorials/overview","docId":"tutorials/overview","unlisted":false},{"type":"category","label":"Login with Wallets","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Near Wallet","href":"/tutorials/login-with-wallets/near-wallet","docId":"tutorials/login-with-wallets/near-wallet","unlisted":false},{"type":"link","label":"Starknet Wallet","href":"/tutorials/login-with-wallets/starknet-wallet","docId":"tutorials/login-with-wallets/starknet-wallet","unlisted":false},{"type":"link","label":"ICP Wallet","href":"/tutorials/login-with-wallets/icp-wallet","docId":"tutorials/login-with-wallets/icp-wallet","unlisted":false}]},{"type":"link","label":"Create Context","href":"/tutorials/create-context","docId":"tutorials/create-context","unlisted":false},{"type":"link","label":"Invitations and Joinings","href":"/tutorials/invitations-and-joinings","docId":"tutorials/invitations-and-joinings","unlisted":false},{"type":"link","label":"Publish App","href":"/tutorials/publish-app","docId":"tutorials/publish-app","unlisted":false},{"type":"link","label":"Install application","href":"/tutorials/install-application","docId":"tutorials/install-application","unlisted":false},{"type":"category","label":"Awesome Projects (DEMOs)","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Only Peers","href":"/tutorials/awesome-projects/only-peers","docId":"tutorials/awesome-projects/only-peers","unlisted":false},{"type":"link","label":"Rock Paper Scissors","href":"/tutorials/awesome-projects/rock-paper-scissors","docId":"tutorials/awesome-projects/rock-paper-scissors","unlisted":false}]},{"type":"link","label":"Blockchain interaction with Proxy Contract","href":"/tutorials/proxy-contract-interaction","docId":"tutorials/proxy-contract-interaction","unlisted":false}]},{"type":"category","label":"Resources","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"The Data Sovereignty Manifesto","href":"/resources/manifesto","docId":"resources/manifesto","unlisted":false},{"type":"link","label":"ELI5","href":"/resources/eli5","docId":"resources/eli5","unlisted":false}]},{"type":"category","label":"Throubleshooting","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"General","href":"/throubleshooting/overview","docId":"throubleshooting/overview","unlisted":false},{"type":"link","label":"SSL/TLS","href":"/throubleshooting/ssl-tls","docId":"throubleshooting/ssl-tls","unlisted":false}]},{"type":"category","label":"Contributing","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"GitHub","href":"/contributing/github","docId":"contributing/github","unlisted":false},{"type":"link","label":"Hackathons","href":"/contributing/hackathons","docId":"contributing/hackathons","unlisted":false},{"type":"link","label":"Bounty Program","href":"/contributing/bounty-program","docId":"contributing/bounty-program","unlisted":false}]},{"type":"category","label":"Support","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Community and Support","href":"/support/community-and-support","docId":"support/community-and-support","unlisted":false},{"type":"link","label":"Learning","href":"/support/learning","docId":"support/learning","unlisted":false}]},{"type":"category","label":"shared","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"install-meroctl","href":"/shared/install-meroctl","docId":"shared/install-meroctl","unlisted":false},{"type":"link","label":"install-merod","href":"/shared/install-merod","docId":"shared/install-merod","unlisted":false},{"type":"link","label":"node-init-binary","href":"/shared/node-init-binary","docId":"shared/node-init-binary","unlisted":false},{"type":"link","label":"node-init-source","href":"/shared/node-init-source","docId":"shared/node-init-source","unlisted":false}]}]},"docs":{"architecture/node/client-node":{"id":"architecture/node/client-node","title":"Client Node","description":"Runtime","sidebar":"tutorialSidebar"},"architecture/node/network":{"id":"architecture/node/network","title":"Network","description":"Overview","sidebar":"tutorialSidebar"},"architecture/node/runtime":{"id":"architecture/node/runtime","title":"Runtime","description":"The runtime environment in the Calimero Network is essential for executing","sidebar":"tutorialSidebar"},"architecture/node/server":{"id":"architecture/node/server","title":"Server","description":"The server is a core component for interacting with a Calimero node. Calimero","sidebar":"tutorialSidebar"},"architecture/node/storage":{"id":"architecture/node/storage","title":"Storage","description":"The storage component in the Calimero Network is essential for managing and","sidebar":"tutorialSidebar"},"architecture/system-overview":{"id":"architecture/system-overview","title":"System Overview","description":"Calimero Network offers a robust framework for developing and running","sidebar":"tutorialSidebar"},"contributing/bounty-program":{"id":"contributing/bounty-program","title":"Bounty Program","description":"We\'re excited to announce that Calimero will soon be launching a bounty program!","sidebar":"tutorialSidebar"},"contributing/github":{"id":"contributing/github","title":"GitHub","description":"All work on Calimero happens directly on GitHub. Both core team members and","sidebar":"tutorialSidebar"},"contributing/hackathons":{"id":"contributing/hackathons","title":"Hackathons","description":"At Calimero, we love innovation and collaboration, which is why we plan to","sidebar":"tutorialSidebar"},"core-concepts/applications":{"id":"core-concepts/applications","title":"Applications","description":"Applications in Calimero define the core logic governing how peers interact","sidebar":"tutorialSidebar"},"core-concepts/blockchains-integration":{"id":"core-concepts/blockchains-integration","title":"Blockchains Integration","description":"Calimero offers integration with multiple blockchain protocols, allowing users","sidebar":"tutorialSidebar"},"core-concepts/contexts":{"id":"core-concepts/contexts","title":"Contexts","description":"Contexts are the core of the Calimero ecosystem. These are application specific","sidebar":"tutorialSidebar"},"core-concepts/encryption":{"id":"core-concepts/encryption","title":"Encryption","description":"Encryption in Calimero ensures data security in transit over the network,","sidebar":"tutorialSidebar"},"core-concepts/identity":{"id":"core-concepts/identity","title":"Identity","description":"Calimero Decentralized Identity","sidebar":"tutorialSidebar"},"core-concepts/specialized-nodes":{"id":"core-concepts/specialized-nodes","title":"Specialized Nodes","description":"Specialized nodes in the Calimero Network are third-party nodes that augment a","sidebar":"tutorialSidebar"},"core-concepts/terminology":{"id":"core-concepts/terminology","title":"Terminology","description":"As projects grow, it\'s important to have a shared vocabulary to help communicate","sidebar":"tutorialSidebar"},"developer-tools/apps/admin-dashboard":{"id":"developer-tools/apps/admin-dashboard","title":"Admin Dashboard","description":"Node is gated with authentication. In order to interact with the node from any","sidebar":"tutorialSidebar"},"developer-tools/apps/desktop-app":{"id":"developer-tools/apps/desktop-app","title":"Desktop App","description":"Calimero Node Manager Desktop app is a simple desktop application that allows","sidebar":"tutorialSidebar"},"developer-tools/CLI/meroctl":{"id":"developer-tools/CLI/meroctl","title":"Meroctl","description":"Meroctl is a command-line tool that enables you to interact with your Calimero","sidebar":"tutorialSidebar"},"developer-tools/CLI/merod":{"id":"developer-tools/CLI/merod","title":"Merod","description":"Merod is a command-line tool that allows you to initialize, configure and run","sidebar":"tutorialSidebar"},"developer-tools/overview":{"id":"developer-tools/overview","title":"Developer Tools","description":"We provide different tools for building decentralized applications.","sidebar":"tutorialSidebar"},"developer-tools/SDK/client-sdk/client-ts-sdk":{"id":"developer-tools/SDK/client-sdk/client-ts-sdk","title":"TypeScript Client SDK","description":"Getting Started with Calimero SDK for Typescript","sidebar":"tutorialSidebar"},"developer-tools/SDK/protocol-sdk/protocol-rs-sdk":{"id":"developer-tools/SDK/protocol-sdk/protocol-rs-sdk","title":"Rust Protocol SDK","description":"Getting Started with Calimero SDK for Rust","sidebar":"tutorialSidebar"},"developer-tools/SDK/protocol-sdk/protocol-sdk":{"id":"developer-tools/SDK/protocol-sdk/protocol-sdk","title":"Protocol SDK","description":"The Protocol SDK within the Calimero Network serves as a foundational tool for","sidebar":"tutorialSidebar"},"developer-tools/tests":{"id":"developer-tools/tests","title":"Tests","description":"","sidebar":"tutorialSidebar"},"getting-started/build-from-source":{"id":"getting-started/build-from-source","title":"Build From Source","description":"Setup For Contributors","sidebar":"tutorialSidebar"},"getting-started/setup":{"id":"getting-started/setup","title":"Setup","description":"This guide will help you set up Calimero in your device.","sidebar":"tutorialSidebar"},"introduction/key-features":{"id":"introduction/key-features","title":"Key Features","description":"No Central Authority","sidebar":"tutorialSidebar"},"introduction/use-cases":{"id":"introduction/use-cases","title":"Use Cases","description":"There are a lot of use cases where Calimero can be used and here are some of","sidebar":"tutorialSidebar"},"introduction/what-is-calimero":{"id":"introduction/what-is-calimero","title":"What is Calimero","description":"What is Calimero","sidebar":"tutorialSidebar"},"resources/eli5":{"id":"resources/eli5","title":"ELI5","description":"Explain Like I\'m Five","sidebar":"tutorialSidebar"},"resources/manifesto":{"id":"resources/manifesto","title":"The Data Sovereignty Manifesto","description":"Vision & Mission","sidebar":"tutorialSidebar"},"shared/install-meroctl":{"id":"shared/install-meroctl","title":"install-meroctl","description":"You can choose to install meroctl using either the installation script or","sidebar":"tutorialSidebar"},"shared/install-merod":{"id":"shared/install-merod","title":"install-merod","description":"You can choose to install merod using either the installation script or","sidebar":"tutorialSidebar"},"shared/node-init-binary":{"id":"shared/node-init-binary","title":"node-init-binary","description":"{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"current","label":"0.2.0","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":"What is Calimero","href":"/introduction/what-is-calimero","docId":"introduction/what-is-calimero","unlisted":false},{"type":"link","label":"Use Cases","href":"/introduction/use-cases","docId":"introduction/use-cases","unlisted":false},{"type":"link","label":"Key Features","href":"/introduction/key-features","docId":"introduction/key-features","unlisted":false}]},{"type":"category","label":"Getting Started","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Setup","href":"/getting-started/setup","docId":"getting-started/setup","unlisted":false},{"type":"link","label":"Build From Source","href":"/getting-started/build-from-source","docId":"getting-started/build-from-source","unlisted":false}]},{"type":"category","label":"Core Concepts","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Terminology","href":"/core-concepts/terminology","docId":"core-concepts/terminology","unlisted":false},{"type":"link","label":"Identity","href":"/core-concepts/identity","docId":"core-concepts/identity","unlisted":false},{"type":"link","label":"Contexts","href":"/core-concepts/contexts","docId":"core-concepts/contexts","unlisted":false},{"type":"link","label":"Applications","href":"/core-concepts/applications","docId":"core-concepts/applications","unlisted":false},{"type":"category","label":"Blockchains Integration","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Blockchain Integrations","href":"/core-concepts/blockchains-integration/blockchain-integrations","docId":"core-concepts/blockchains-integration/blockchain-integrations","unlisted":false},{"type":"link","label":"Context Contract","href":"/core-concepts/blockchains-integration/context-contract","docId":"core-concepts/blockchains-integration/context-contract","unlisted":false},{"type":"link","label":"Proxy Contract","href":"/core-concepts/blockchains-integration/proxy-contract","docId":"core-concepts/blockchains-integration/proxy-contract","unlisted":false},{"type":"link","label":"Proxy Contract Interaction Guide","href":"/core-concepts/blockchains-integration/proxy-contract-interaction","docId":"core-concepts/blockchains-integration/proxy-contract-interaction","unlisted":false}]},{"type":"link","label":"Encryption","href":"/core-concepts/encryption","docId":"core-concepts/encryption","unlisted":false},{"type":"link","label":"Specialized Nodes","href":"/core-concepts/specialized-nodes","docId":"core-concepts/specialized-nodes","unlisted":false}]},{"type":"category","label":"Architecture","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"System Overview","href":"/architecture/system-overview","docId":"architecture/system-overview","unlisted":false},{"type":"category","label":"Node","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Client Node","href":"/architecture/node/client-node","docId":"architecture/node/client-node","unlisted":false},{"type":"link","label":"Runtime","href":"/architecture/node/runtime","docId":"architecture/node/runtime","unlisted":false},{"type":"link","label":"Server","href":"/architecture/node/server","docId":"architecture/node/server","unlisted":false},{"type":"link","label":"Storage","href":"/architecture/node/storage","docId":"architecture/node/storage","unlisted":false},{"type":"link","label":"Network","href":"/architecture/node/network","docId":"architecture/node/network","unlisted":false}]}]},{"type":"category","label":"Developer Tools","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Developer Tools","href":"/developer-tools/overview","docId":"developer-tools/overview","unlisted":false},{"type":"category","label":"CLI","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Merod","href":"/developer-tools/CLI/merod","docId":"developer-tools/CLI/merod","unlisted":false},{"type":"link","label":"Meroctl","href":"/developer-tools/CLI/meroctl","docId":"developer-tools/CLI/meroctl","unlisted":false}]},{"type":"category","label":"SDK","collapsible":true,"collapsed":true,"items":[{"type":"category","label":"Protocol SDKs","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Protocol SDK","href":"/developer-tools/SDK/protocol-sdk/protocol-sdk","docId":"developer-tools/SDK/protocol-sdk/protocol-sdk","unlisted":false},{"type":"link","label":"Rust Protocol SDK","href":"/developer-tools/SDK/protocol-sdk/protocol-rs-sdk","docId":"developer-tools/SDK/protocol-sdk/protocol-rs-sdk","unlisted":false}]},{"type":"category","label":"Client SDKs","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"TypeScript Client SDK","href":"/developer-tools/SDK/client-sdk/client-ts-sdk","docId":"developer-tools/SDK/client-sdk/client-ts-sdk","unlisted":false}]}]},{"type":"category","label":"Apps","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Admin Dashboard","href":"/developer-tools/apps/admin-dashboard","docId":"developer-tools/apps/admin-dashboard","unlisted":false},{"type":"link","label":"Desktop App","href":"/developer-tools/apps/desktop-app","docId":"developer-tools/apps/desktop-app","unlisted":false}]},{"type":"link","label":"Tests","href":"/developer-tools/tests","docId":"developer-tools/tests","unlisted":false}]},{"type":"category","label":"Tutorials","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Tutorials","href":"/tutorials/overview","docId":"tutorials/overview","unlisted":false},{"type":"category","label":"Login with Wallets","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Near Wallet","href":"/tutorials/login-with-wallets/near-wallet","docId":"tutorials/login-with-wallets/near-wallet","unlisted":false},{"type":"link","label":"Starknet Wallet","href":"/tutorials/login-with-wallets/starknet-wallet","docId":"tutorials/login-with-wallets/starknet-wallet","unlisted":false},{"type":"link","label":"ICP Wallet","href":"/tutorials/login-with-wallets/icp-wallet","docId":"tutorials/login-with-wallets/icp-wallet","unlisted":false}]},{"type":"link","label":"Create Context","href":"/tutorials/create-context","docId":"tutorials/create-context","unlisted":false},{"type":"link","label":"Invitations and Joinings","href":"/tutorials/invitations-and-joinings","docId":"tutorials/invitations-and-joinings","unlisted":false},{"type":"link","label":"Publish App","href":"/tutorials/publish-app","docId":"tutorials/publish-app","unlisted":false},{"type":"link","label":"Install application","href":"/tutorials/install-application","docId":"tutorials/install-application","unlisted":false},{"type":"category","label":"Awesome Projects (DEMOs)","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Only Peers","href":"/tutorials/awesome-projects/only-peers","docId":"tutorials/awesome-projects/only-peers","unlisted":false},{"type":"link","label":"Rock Paper Scissors","href":"/tutorials/awesome-projects/rock-paper-scissors","docId":"tutorials/awesome-projects/rock-paper-scissors","unlisted":false}]}]},{"type":"category","label":"Resources","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"The Data Sovereignty Manifesto","href":"/resources/manifesto","docId":"resources/manifesto","unlisted":false},{"type":"link","label":"ELI5","href":"/resources/eli5","docId":"resources/eli5","unlisted":false}]},{"type":"category","label":"Throubleshooting","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"General","href":"/throubleshooting/overview","docId":"throubleshooting/overview","unlisted":false},{"type":"link","label":"SSL/TLS","href":"/throubleshooting/ssl-tls","docId":"throubleshooting/ssl-tls","unlisted":false}]},{"type":"category","label":"Contributing","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"GitHub","href":"/contributing/github","docId":"contributing/github","unlisted":false},{"type":"link","label":"Hackathons","href":"/contributing/hackathons","docId":"contributing/hackathons","unlisted":false},{"type":"link","label":"Bounty Program","href":"/contributing/bounty-program","docId":"contributing/bounty-program","unlisted":false}]},{"type":"category","label":"Support","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Community and Support","href":"/support/community-and-support","docId":"support/community-and-support","unlisted":false},{"type":"link","label":"Learning","href":"/support/learning","docId":"support/learning","unlisted":false}]},{"type":"category","label":"shared","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"install-meroctl","href":"/shared/install-meroctl","docId":"shared/install-meroctl","unlisted":false},{"type":"link","label":"install-merod","href":"/shared/install-merod","docId":"shared/install-merod","unlisted":false}]}]},"docs":{"architecture/node/client-node":{"id":"architecture/node/client-node","title":"Client Node","description":"Runtime","sidebar":"tutorialSidebar"},"architecture/node/network":{"id":"architecture/node/network","title":"Network","description":"Overview","sidebar":"tutorialSidebar"},"architecture/node/runtime":{"id":"architecture/node/runtime","title":"Runtime","description":"The runtime environment in the Calimero Network is essential for executing","sidebar":"tutorialSidebar"},"architecture/node/server":{"id":"architecture/node/server","title":"Server","description":"The server is a core component for interacting with a Calimero node. Calimero","sidebar":"tutorialSidebar"},"architecture/node/storage":{"id":"architecture/node/storage","title":"Storage","description":"The storage component in the Calimero Network is essential for managing and","sidebar":"tutorialSidebar"},"architecture/system-overview":{"id":"architecture/system-overview","title":"System Overview","description":"Calimero Network offers a robust framework for developing and running","sidebar":"tutorialSidebar"},"contributing/bounty-program":{"id":"contributing/bounty-program","title":"Bounty Program","description":"We\'re excited to announce that Calimero will soon be launching a bounty program!","sidebar":"tutorialSidebar"},"contributing/github":{"id":"contributing/github","title":"GitHub","description":"All work on Calimero happens directly on GitHub. Both core team members and","sidebar":"tutorialSidebar"},"contributing/hackathons":{"id":"contributing/hackathons","title":"Hackathons","description":"At Calimero, we love innovation and collaboration, which is why we plan to","sidebar":"tutorialSidebar"},"core-concepts/applications":{"id":"core-concepts/applications","title":"Applications","description":"Applications in Calimero define the core logic governing how peers interact","sidebar":"tutorialSidebar"},"core-concepts/blockchains-integration/blockchain-integrations":{"id":"core-concepts/blockchains-integration/blockchain-integrations","title":"Blockchain Integrations","description":"Calimero offers integration with multiple blockchain protocols, allowing users","sidebar":"tutorialSidebar"},"core-concepts/blockchains-integration/context-contract":{"id":"core-concepts/blockchains-integration/context-contract","title":"Context Contract","description":"Calimero Context Contract is used to manage the context on the blockchain. It is","sidebar":"tutorialSidebar"},"core-concepts/blockchains-integration/proxy-contract":{"id":"core-concepts/blockchains-integration/proxy-contract","title":"Proxy Contract","description":"Proxy Contract is used to enable users to do actions on the blockchain. Proxy","sidebar":"tutorialSidebar"},"core-concepts/blockchains-integration/proxy-contract-interaction":{"id":"core-concepts/blockchains-integration/proxy-contract-interaction","title":"Proxy Contract Interaction Guide","description":"Overview","sidebar":"tutorialSidebar"},"core-concepts/contexts":{"id":"core-concepts/contexts","title":"Contexts","description":"Contexts are the core of the Calimero ecosystem. These are application specific","sidebar":"tutorialSidebar"},"core-concepts/encryption":{"id":"core-concepts/encryption","title":"Encryption","description":"Encryption in Calimero ensures data security in transit over the network,","sidebar":"tutorialSidebar"},"core-concepts/identity":{"id":"core-concepts/identity","title":"Identity","description":"Calimero Decentralized Identity","sidebar":"tutorialSidebar"},"core-concepts/specialized-nodes":{"id":"core-concepts/specialized-nodes","title":"Specialized Nodes","description":"Specialized nodes in the Calimero Network are third-party nodes that augment a","sidebar":"tutorialSidebar"},"core-concepts/terminology":{"id":"core-concepts/terminology","title":"Terminology","description":"As projects grow, it\'s important to have a shared vocabulary to help communicate","sidebar":"tutorialSidebar"},"developer-tools/apps/admin-dashboard":{"id":"developer-tools/apps/admin-dashboard","title":"Admin Dashboard","description":"Node is gated with authentication. In order to interact with the node from any","sidebar":"tutorialSidebar"},"developer-tools/apps/desktop-app":{"id":"developer-tools/apps/desktop-app","title":"Desktop App","description":"Calimero Node Manager Desktop app is a simple desktop application that allows","sidebar":"tutorialSidebar"},"developer-tools/CLI/meroctl":{"id":"developer-tools/CLI/meroctl","title":"Meroctl","description":"Meroctl is a command-line tool that enables you to interact with your Calimero node directly from the shell.","sidebar":"tutorialSidebar"},"developer-tools/CLI/merod":{"id":"developer-tools/CLI/merod","title":"Merod","description":"Merod is a command-line tool that allows you to initialize, configure and run Calimero nodes.","sidebar":"tutorialSidebar"},"developer-tools/overview":{"id":"developer-tools/overview","title":"Developer Tools","description":"We provide different tools for building decentralized applications.","sidebar":"tutorialSidebar"},"developer-tools/SDK/client-sdk/client-ts-sdk":{"id":"developer-tools/SDK/client-sdk/client-ts-sdk","title":"TypeScript Client SDK","description":"Getting Started with Calimero SDK for Typescript","sidebar":"tutorialSidebar"},"developer-tools/SDK/protocol-sdk/protocol-rs-sdk":{"id":"developer-tools/SDK/protocol-sdk/protocol-rs-sdk","title":"Rust Protocol SDK","description":"Getting Started with Calimero SDK for Rust","sidebar":"tutorialSidebar"},"developer-tools/SDK/protocol-sdk/protocol-sdk":{"id":"developer-tools/SDK/protocol-sdk/protocol-sdk","title":"Protocol SDK","description":"The Protocol SDK within the Calimero Network serves as a foundational tool for","sidebar":"tutorialSidebar"},"developer-tools/tests":{"id":"developer-tools/tests","title":"Tests","description":"","sidebar":"tutorialSidebar"},"getting-started/build-from-source":{"id":"getting-started/build-from-source","title":"Build From Source","description":"Setup For Contributors","sidebar":"tutorialSidebar"},"getting-started/setup":{"id":"getting-started/setup","title":"Setup","description":"This guide will help you set up Calimero in your device.","sidebar":"tutorialSidebar"},"introduction/key-features":{"id":"introduction/key-features","title":"Key Features","description":"No Central Authority","sidebar":"tutorialSidebar"},"introduction/use-cases":{"id":"introduction/use-cases","title":"Use Cases","description":"There are a lot of use cases where Calimero can be used and here are some of","sidebar":"tutorialSidebar"},"introduction/what-is-calimero":{"id":"introduction/what-is-calimero","title":"What is Calimero","description":"What is Calimero","sidebar":"tutorialSidebar"},"resources/eli5":{"id":"resources/eli5","title":"ELI5","description":"Explain Like I\'m Five","sidebar":"tutorialSidebar"},"resources/manifesto":{"id":"resources/manifesto","title":"The Data Sovereignty Manifesto","description":"Vision & Mission","sidebar":"tutorialSidebar"},"shared/install-meroctl":{"id":"shared/install-meroctl","title":"install-meroctl","description":"You can choose to install meroctl using either the installation script or","sidebar":"tutorialSidebar"},"shared/install-merod":{"id":"shared/install-merod","title":"install-merod","description":"You can choose to install merod using either the installation script or","sidebar":"tutorialSidebar"},"support/community-and-support":{"id":"support/community-and-support","title":"Community and Support","description":"We value our community and are here to support you. Here are the best ways to","sidebar":"tutorialSidebar"},"support/learning":{"id":"support/learning","title":"Learning","description":"Expand your knowledge and stay informed by exploring the following resources:","sidebar":"tutorialSidebar"},"throubleshooting/overview":{"id":"throubleshooting/overview","title":"General","description":"This section offers guidance on resolving common issues with Calimero Network","sidebar":"tutorialSidebar"},"throubleshooting/ssl-tls":{"id":"throubleshooting/ssl-tls","title":"SSL/TLS","description":"SSL/TLS Support","sidebar":"tutorialSidebar"},"tutorials/awesome-projects/only-peers":{"id":"tutorials/awesome-projects/only-peers","title":"Only Peers","description":"Only Peers is a decentralized social networking app that empowers you to share","sidebar":"tutorialSidebar"},"tutorials/awesome-projects/rock-paper-scissors":{"id":"tutorials/awesome-projects/rock-paper-scissors","title":"Rock Paper Scissors","description":"A popular game we all know and love, but this time played online and enforcing","sidebar":"tutorialSidebar"},"tutorials/create-context":{"id":"tutorials/create-context","title":"Create Context","description":"Create a context using the Admin Dashboard","sidebar":"tutorialSidebar"},"tutorials/install-application":{"id":"tutorials/install-application","title":"Install application","description":"We have created simple and easy to use example application called only-peers.","sidebar":"tutorialSidebar"},"tutorials/invitations-and-joinings":{"id":"tutorials/invitations-and-joinings","title":"Invitations and Joinings","description":"Invite to context with Admin Dashboard","sidebar":"tutorialSidebar"},"tutorials/login-with-wallets/icp-wallet":{"id":"tutorials/login-with-wallets/icp-wallet","title":"ICP Wallet","description":"Logging in with Internet Identity","sidebar":"tutorialSidebar"},"tutorials/login-with-wallets/near-wallet":{"id":"tutorials/login-with-wallets/near-wallet","title":"Near Wallet","description":"Logging in with NEAR Wallet","sidebar":"tutorialSidebar"},"tutorials/login-with-wallets/starknet-wallet":{"id":"tutorials/login-with-wallets/starknet-wallet","title":"Starknet Wallet","description":"Logging in with Starknet","sidebar":"tutorialSidebar"},"tutorials/overview":{"id":"tutorials/overview","title":"Tutorials","description":"Welcome to the Tutorials section of the Calimero Network documentation! Here,","sidebar":"tutorialSidebar"},"tutorials/publish-app":{"id":"tutorials/publish-app","title":"Publish App","description":"After you have built your application, you can publish it to the network. This","sidebar":"tutorialSidebar"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/24413269.6d55f2b2.js b/assets/js/24413269.6d55f2b2.js new file mode 100644 index 00000000..76831e61 --- /dev/null +++ b/assets/js/24413269.6d55f2b2.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5512],{7133:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>c,default:()=>h,frontMatter:()=>i,metadata:()=>r,toc:()=>d});const r=JSON.parse('{"id":"shared/node-init-source","title":"node-init-source","description":"{n.d(t,{A:()=>s});n(758);var r=n(3526);const a={tabItem:"tabItem_KLga"};var o=n(6070);function s(e){let{children:t,hidden:n,className:s}=e;return(0,o.jsx)("div",{role:"tabpanel",className:(0,r.A)(a.tabItem,s),hidden:n,children:t})}},3505:(e,t,n)=>{n.d(t,{A:()=>w});var r=n(758),a=n(3526),o=n(8155),s=n(5557),l=n(5536),i=n(7852),c=n(1381),u=n(4012);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:a}}=e;return{value:t,label:n,attributes:r,default:a}}))}(n);return function(e){const t=(0,c.XI)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function h(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function f(e){let{queryString:t=!1,groupId:n}=e;const a=(0,s.W6)(),o=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,i.aZ)(o),(0,r.useCallback)((e=>{if(!o)return;const t=new URLSearchParams(a.location.search);t.set(o,e),a.replace({...a.location,search:t.toString()})}),[o,a])]}function m(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,o=p(e),[s,i]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!h({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:o}))),[c,d]=f({queryString:n,groupId:a}),[m,b]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,o]=(0,u.Dv)(n);return[a,(0,r.useCallback)((e=>{n&&o.set(e)}),[n,o])]}({groupId:a}),g=(()=>{const e=c??m;return h({value:e,tabValues:o})?e:null})();(0,l.A)((()=>{g&&i(g)}),[g]);return{selectedValue:s,selectValue:(0,r.useCallback)((e=>{if(!h({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),b(e)}),[d,b,o]),tabValues:o}}var b=n(2236);const g={tabList:"tabList_B3_y",tabItem:"tabItem_z210"};var v=n(6070);function x(e){let{className:t,block:n,selectedValue:r,selectValue:s,tabValues:l}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,o.a_)(),u=e=>{const t=e.currentTarget,n=i.indexOf(t),a=l[n].value;a!==r&&(c(t),s(a))},d=e=>{let t=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const n=i.indexOf(e.currentTarget)+1;t=i[n]??i[0];break}case"ArrowLeft":{const n=i.indexOf(e.currentTarget)-1;t=i[n]??i[i.length-1];break}}t?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":n},t),children:l.map((e=>{let{value:t,label:n,attributes:o}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>i.push(e),onKeyDown:d,onClick:u,...o,className:(0,a.A)("tabs__item",g.tabItem,o?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function j(e){let{lazy:t,children:n,selectedValue:o}=e;const s=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=s.find((e=>e.props.value===o));return e?(0,r.cloneElement)(e,{className:(0,a.A)("margin-top--md",e.props.className)}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:s.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==o})))})}function A(e){const t=m(e);return(0,v.jsxs)("div",{className:(0,a.A)("tabs-container",g.tabList),children:[(0,v.jsx)(x,{...t,...e}),(0,v.jsx)(j,{...t,...e})]})}function w(e){const t=(0,b.A)();return(0,v.jsx)(A,{...e,children:d(e.children)},String(t))}},5383:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/icp-config-ceda025dead6d3c8de0513840466dd31.png"},391:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/near-config-7f7de7e5e857b8d6dca8bda6b8a39f0d.png"},2524:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/sn-config-a1900f2dc94f3dcd2cd7204c62421de2.png"},5248:(e,t,n)=>{n.d(t,{R:()=>s,x:()=>l});var r=n(758);const a={},o=r.createContext(a);function s(e){const t=r.useContext(o);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:s(e.components),r.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/2dc47f99.d89e3f3b.js b/assets/js/2dc47f99.c19a669c.js similarity index 98% rename from assets/js/2dc47f99.d89e3f3b.js rename to assets/js/2dc47f99.c19a669c.js index 3108b4fd..d0291fef 100644 --- a/assets/js/2dc47f99.d89e3f3b.js +++ b/assets/js/2dc47f99.c19a669c.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9413],{4580:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>h,frontMatter:()=>a,metadata:()=>r,toc:()=>l});const r=JSON.parse('{"id":"architecture/node/server","title":"Server","description":"The server is a core component for interacting with a Calimero node. Calimero","source":"@site/docs/04-architecture/03-node/03-server.mdx","sourceDirName":"04-architecture/03-node","slug":"/architecture/node/server","permalink":"/architecture/node/server","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/04-architecture/03-node/03-server.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":3,"frontMatter":{"id":"server","title":"Server"},"sidebar":"tutorialSidebar","previous":{"title":"Runtime","permalink":"/architecture/node/runtime"},"next":{"title":"Storage","permalink":"/architecture/node/storage"}}');var i=n(6070),s=n(5248);const a={id:"server",title:"Server"},o=void 0,c={},l=[{value:"Core Capabilities",id:"core-capabilities",level:3}];function d(e){const t={h3:"h3",li:"li",p:"p",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.p,{children:"The server is a core component for interacting with a Calimero node. Calimero\ncan be embedded with your client to make it a self-contained node, or it can run\nas a remote node that multiple clients can connect to, allowing centralized\nstate management."}),"\n",(0,i.jsx)(t.h3,{id:"core-capabilities",children:"Core Capabilities"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"JSON-RPC API"}),": Provides a standardized way for clients to query or mutate\nthe state of their counterpart applications on the node, ensuring seamless\nintegration and communication."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"WebSocket Interface"}),": Allows clients to subscribe to events emitted from\napplications, enabling real-time reactions to activity triggered by other\npeers in the network."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"Admin API"}),": Manages various aspects of the node, including:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Context Administration"}),": Create, delete, invite others to contexts, and\naccept invitations."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Storage Management"}),": Track usage, view raw state storage for each\ncontext, and view encrypted blobs."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"State Management"}),": Manually garbage collect state-transitional\ntransactions."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Network Management"}),": Manually connect to peers and manage blocklists."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Application Management"}),": Manage installed applications, create contexts\nfrom applications, delete applications if no contexts are associated, and\nmanually sideload applications."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Peer Identity Management"}),": Rotate peer identities without affecting\ncontext identities."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Node Metrics"}),": Track network bandwidth usage, both total and by context,\nto manage resource usage effectively."]}),"\n"]}),"\n"]}),"\n"]})]})}function h(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},5248:(e,t,n)=>{n.d(t,{R:()=>a,x:()=>o});var r=n(758);const i={},s=r.createContext(i);function a(e){const t=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),r.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9413],{4580:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>h,frontMatter:()=>a,metadata:()=>r,toc:()=>l});const r=JSON.parse('{"id":"architecture/node/server","title":"Server","description":"The server is a core component for interacting with a Calimero node. Calimero","source":"@site/docs/04-architecture/03-node/03-server.mdx","sourceDirName":"04-architecture/03-node","slug":"/architecture/node/server","permalink":"/architecture/node/server","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/04-architecture/03-node/03-server.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":3,"frontMatter":{"id":"server","title":"Server"},"sidebar":"tutorialSidebar","previous":{"title":"Runtime","permalink":"/architecture/node/runtime"},"next":{"title":"Storage","permalink":"/architecture/node/storage"}}');var i=n(6070),s=n(5248);const a={id:"server",title:"Server"},o=void 0,c={},l=[{value:"Core Capabilities",id:"core-capabilities",level:3}];function d(e){const t={h3:"h3",li:"li",p:"p",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.p,{children:"The server is a core component for interacting with a Calimero node. Calimero\ncan be embedded with your client to make it a self-contained node, or it can run\nas a remote node that multiple clients can connect to, allowing centralized\nstate management."}),"\n",(0,i.jsx)(t.h3,{id:"core-capabilities",children:"Core Capabilities"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"JSON-RPC API"}),": Provides a standardized way for clients to query or mutate\nthe state of their counterpart applications on the node, ensuring seamless\nintegration and communication."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"WebSocket Interface"}),": Allows clients to subscribe to events emitted from\napplications, enabling real-time reactions to activity triggered by other\npeers in the network."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"Admin API"}),": Manages various aspects of the node, including:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Context Administration"}),": Create, delete, invite others to contexts, and\naccept invitations."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Storage Management"}),": Track usage, view raw state storage for each\ncontext, and view encrypted blobs."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"State Management"}),": Manually garbage collect state-transitional\ntransactions."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Network Management"}),": Manually connect to peers and manage blocklists."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Application Management"}),": Manage installed applications, create contexts\nfrom applications, delete applications if no contexts are associated, and\nmanually sideload applications."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Peer Identity Management"}),": Rotate peer identities without affecting\ncontext identities."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Node Metrics"}),": Track network bandwidth usage, both total and by context,\nto manage resource usage effectively."]}),"\n"]}),"\n"]}),"\n"]})]})}function h(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},5248:(e,t,n)=>{n.d(t,{R:()=>a,x:()=>o});var r=n(758);const i={},s=r.createContext(i);function a(e){const t=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),r.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/381aad9e.920c6ecb.js b/assets/js/381aad9e.920c6ecb.js deleted file mode 100644 index e0b02b14..00000000 --- a/assets/js/381aad9e.920c6ecb.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4005],{7228:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>r,default:()=>h,frontMatter:()=>o,metadata:()=>i,toc:()=>c});const i=JSON.parse('{"id":"resources/manifesto","title":"The Data Sovereignty Manifesto","description":"Vision & Mission","source":"@site/docs/07-resources/01-manifesto.mdx","sourceDirName":"07-resources","slug":"/resources/manifesto","permalink":"/resources/manifesto","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/07-resources/01-manifesto.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":1,"frontMatter":{"id":"manifesto","title":"The Data Sovereignty Manifesto"},"sidebar":"tutorialSidebar","previous":{"title":"Rock Paper Scissors","permalink":"/tutorials/awesome-projects/rock-paper-scissors"},"next":{"title":"ELI5","permalink":"/resources/eli5"}}');var a=t(6070),s=t(5248);const o={id:"manifesto",title:"The Data Sovereignty Manifesto"},r=void 0,d={},c=[{value:"Vision & Mission",id:"vision--mission",level:2},{value:"Rationale and Addressing the Problem",id:"rationale-and-addressing-the-problem",level:2},{value:"Core Values and Beliefs",id:"core-values-and-beliefs",level:2},{value:"Goals and Objectives",id:"goals-and-objectives",level:2},{value:"Join the Movement",id:"join-the-movement",level:2}];function l(e){const n={h2:"h2",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.h2,{id:"vision--mission",children:"Vision & Mission"}),"\n",(0,a.jsx)(n.p,{children:"We envision a digital world where users decide how and when their data is\nstored, processed, and accessed. In such a future, individuals will be\ncompensated with a share of the profit, if they provide consent for their data\nto be utilized by a specific entity for a specific context. Our framework will\nensure that data sharing is consensual, secure, and transparent, allowing users\nto reclaim their privacy and digital autonomy."}),"\n",(0,a.jsx)(n.p,{children:"In the digital age, the concept of privacy has evolved significantly.\nTraditional notions of privacy, often centred around the control of personal\ninformation, have been challenged by the pervasive nature of digital\ntechnologies. In a world where your data flows freely across the internet, and\nis processed by centralized servers, the control over your personal information\nis often lost. A future dominated by AI, where your digital personalities can be\nreplicated and exploited, calls for urgent safeguarding of contextual integrity\nand data privacy. We aim to empower individuals to take charge of their digital\nidentities."}),"\n",(0,a.jsx)(n.p,{children:"Contextual integrity is a theory developed by Helen Nissenbaum, that suggests\nprivacy is preserved when information flows appropriately according to social\nnorms within specific contexts. Rather than focusing solely on the individual's\ncontrol over their data, contextual integrity considers the context-specific\nnorms that govern information sharing and usage. Different social settings or\nspheres (e.g., healthcare, financial records, personal relationships and\nsimilar), different actors, attributes and conditions under which information is\nshared, each have their own expectations for information flow. By examining\nthese parameters, contextual integrity provides a nuanced understanding of\nprivacy that is sensitive to the specific social contexts in which information\nis used."}),"\n",(0,a.jsx)(n.p,{children:"The digital environment involves numerous actors, including users, service\nproviders, third-party advertisers, and data brokers. This complexity increases\nthe difficulty of tracking and managing information flows. Bad actors exploit\ndata streams, leading to breaches of privacy and trust. We believe that every\nindividual should have the power to control their personal data. Our mission is\nto build a peer-to-peer ecosystem that enables users to dictate who they share\ntheir data with and how data access is managed."}),"\n",(0,a.jsx)(n.p,{children:"Digital platforms often merge multiple contexts, making it difficult to\ndistinguish appropriate information flows. For example, social media combines\npersonal, professional and public spheres, challenging traditional privacy\nnorms. Digital technologies enable the collection and analysis of vast amounts\nof diverse data, often beyond what individuals explicitly share. This includes\nmetadata, behavioral data, and similar, which complicates consent and control\nand often gives away much more about the user than the user actually understands\nor wants to share. The principles governing data transmission in the digital\nworld are often non-transparent and dynamic. Terms of service and privacy\npolicies frequently change, and the mechanisms of data sharing and processing\nare not always transparent to users."}),"\n",(0,a.jsx)(n.h2,{id:"rationale-and-addressing-the-problem",children:"Rationale and Addressing the Problem"}),"\n",(0,a.jsx)(n.p,{children:"\u25e6 Legal frameworks should consider the specific contexts in which data is used.\nThis means creating sector-specific privacy regulations that account for the\nunique norms and expectations of each context."}),"\n",(0,a.jsx)(n.p,{children:"\u25e6 Digital platforms must be transparent about their data practices and\naccountable for maintaining appropriate information flows. This includes clear\ncommunication about how data is collected, used, and shared, as well as\nmechanisms for users to hold platforms accountable."}),"\n",(0,a.jsx)(n.p,{children:"\u25e6 Empowering users with tools to manage their privacy in context-specific ways\nis crucial. This can involve granular privacy settings, consent mechanisms that\nreflect contextual norms, and educational initiatives to inform users about\ntheir privacy rights and risks."}),"\n",(0,a.jsx)(n.p,{children:"\u25e6 Designers and developers of digital technologies should incorporate contextual\nintegrity principles into the design of systems and services. This means\nconsidering the social contexts in which their technologies will be used and\nensuring that information flows align with context-specific norms."}),"\n",(0,a.jsx)(n.p,{children:"\u25e6 Regulators have tried to address this issue by implementing data protection\nlaws. However, in practice, there are no effective tools to solve the problem\neasily, and the regulations are prone to human error. This results in\nunnecessary bureaucracy, without solving the problem at its core."}),"\n",(0,a.jsx)(n.h2,{id:"core-values-and-beliefs",children:"Core Values and Beliefs"}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Privacy"})}),"\n",(0,a.jsx)(n.p,{children:"We believe that privacy is a fundamental human right."}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Ownership & Control"})}),"\n",(0,a.jsx)(n.p,{children:"Data should be owned and managed by the user whose data it is, not by large\ncorporations, big tech, or the government. Individuals should have complete\ncontrol over their digital footprint."}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Transparency & Security"})}),"\n",(0,a.jsx)(n.p,{children:"Data management processes must be transparent and understandable. Personal data\nshould be protected against unauthorized access and misuse."}),"\n",(0,a.jsx)(n.h2,{id:"goals-and-objectives",children:"Goals and Objectives"}),"\n",(0,a.jsx)(n.p,{children:"The need for data sovereignty is urgent. Daily data breaches compromise medical\nrecords, putting lives at risk, financial records are disclosed, leading to\ntheft, and personal secrets can be exposed without consent. In a world where\ndata is a valuable asset, it is essential to create a fair and secure\nenvironment. Contextual integrity, which addresses data privacy in the digital\nage, must be upheld to protect individual rights and foster trust in digital\ninteractions. Our goals include:"}),"\n",(0,a.jsx)(n.p,{children:"\u25e6 Creating a robust, secure, and user-friendly peer-to-peer protocol for data\naccess control."}),"\n",(0,a.jsx)(n.p,{children:"\u25e6 Providing tools and resources to enable builders to develop Self Sovereign\nApps, where users can manage their data independently."}),"\n",(0,a.jsx)(n.p,{children:"\u25e6 Target developers to raise awareness, join the movement, and build products\nwithin this new framework."}),"\n",(0,a.jsx)(n.p,{children:"\u25e6 Educating the public about the importance of data sovereignty and how to\nprotect their digital identity."}),"\n",(0,a.jsx)(n.p,{children:"\u25e6 Developing user economy models, for the users to be compensated when their\ndata is used by profit-making entities."}),"\n",(0,a.jsx)(n.h2,{id:"join-the-movement",children:"Join the Movement"}),"\n",(0,a.jsx)(n.p,{children:"The future of our digital world depends on the actions we take today. By\nreclaiming control over our personal data, we can ensure privacy, security, and\nfairness for all. We call on developers to build innovative solutions that\nprioritize user-controlled data management. We urge individuals to take greater\ncare of their digital identity and privacy, advocating for a future where\npersonal data is respected and protected. Join us in creating a fair and secure\ndigital world. Let us rise to the challenge and create a digital environment\nwhere data sovereignty is the norm, not the exception. Because it is YOUR data,\nand YOU should control what happens to it!"})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(l,{...e})}):l(e)}},5248:(e,n,t)=>{t.d(n,{R:()=>o,x:()=>r});var i=t(758);const a={},s=i.createContext(a);function o(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:o(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/381aad9e.d2871193.js b/assets/js/381aad9e.d2871193.js new file mode 100644 index 00000000..b6dcefdc --- /dev/null +++ b/assets/js/381aad9e.d2871193.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4005],{7228:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>r,default:()=>h,frontMatter:()=>o,metadata:()=>i,toc:()=>c});const i=JSON.parse('{"id":"resources/manifesto","title":"The Data Sovereignty Manifesto","description":"Vision & Mission","source":"@site/docs/07-resources/01-manifesto.mdx","sourceDirName":"07-resources","slug":"/resources/manifesto","permalink":"/resources/manifesto","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/07-resources/01-manifesto.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":1,"frontMatter":{"id":"manifesto","title":"The Data Sovereignty Manifesto"},"sidebar":"tutorialSidebar","previous":{"title":"Blockchain interaction with Proxy Contract","permalink":"/tutorials/proxy-contract-interaction"},"next":{"title":"ELI5","permalink":"/resources/eli5"}}');var a=t(6070),s=t(5248);const o={id:"manifesto",title:"The Data Sovereignty Manifesto"},r=void 0,d={},c=[{value:"Vision & Mission",id:"vision--mission",level:2},{value:"Rationale and Addressing the Problem",id:"rationale-and-addressing-the-problem",level:2},{value:"Core Values and Beliefs",id:"core-values-and-beliefs",level:2},{value:"Goals and Objectives",id:"goals-and-objectives",level:2},{value:"Join the Movement",id:"join-the-movement",level:2}];function l(e){const n={h2:"h2",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.h2,{id:"vision--mission",children:"Vision & Mission"}),"\n",(0,a.jsx)(n.p,{children:"We envision a digital world where users decide how and when their data is\nstored, processed, and accessed. In such a future, individuals will be\ncompensated with a share of the profit, if they provide consent for their data\nto be utilized by a specific entity for a specific context. Our framework will\nensure that data sharing is consensual, secure, and transparent, allowing users\nto reclaim their privacy and digital autonomy."}),"\n",(0,a.jsx)(n.p,{children:"In the digital age, the concept of privacy has evolved significantly.\nTraditional notions of privacy, often centred around the control of personal\ninformation, have been challenged by the pervasive nature of digital\ntechnologies. In a world where your data flows freely across the internet, and\nis processed by centralized servers, the control over your personal information\nis often lost. A future dominated by AI, where your digital personalities can be\nreplicated and exploited, calls for urgent safeguarding of contextual integrity\nand data privacy. We aim to empower individuals to take charge of their digital\nidentities."}),"\n",(0,a.jsx)(n.p,{children:"Contextual integrity is a theory developed by Helen Nissenbaum, that suggests\nprivacy is preserved when information flows appropriately according to social\nnorms within specific contexts. Rather than focusing solely on the individual's\ncontrol over their data, contextual integrity considers the context-specific\nnorms that govern information sharing and usage. Different social settings or\nspheres (e.g., healthcare, financial records, personal relationships and\nsimilar), different actors, attributes and conditions under which information is\nshared, each have their own expectations for information flow. By examining\nthese parameters, contextual integrity provides a nuanced understanding of\nprivacy that is sensitive to the specific social contexts in which information\nis used."}),"\n",(0,a.jsx)(n.p,{children:"The digital environment involves numerous actors, including users, service\nproviders, third-party advertisers, and data brokers. This complexity increases\nthe difficulty of tracking and managing information flows. Bad actors exploit\ndata streams, leading to breaches of privacy and trust. We believe that every\nindividual should have the power to control their personal data. Our mission is\nto build a peer-to-peer ecosystem that enables users to dictate who they share\ntheir data with and how data access is managed."}),"\n",(0,a.jsx)(n.p,{children:"Digital platforms often merge multiple contexts, making it difficult to\ndistinguish appropriate information flows. For example, social media combines\npersonal, professional and public spheres, challenging traditional privacy\nnorms. Digital technologies enable the collection and analysis of vast amounts\nof diverse data, often beyond what individuals explicitly share. This includes\nmetadata, behavioral data, and similar, which complicates consent and control\nand often gives away much more about the user than the user actually understands\nor wants to share. The principles governing data transmission in the digital\nworld are often non-transparent and dynamic. Terms of service and privacy\npolicies frequently change, and the mechanisms of data sharing and processing\nare not always transparent to users."}),"\n",(0,a.jsx)(n.h2,{id:"rationale-and-addressing-the-problem",children:"Rationale and Addressing the Problem"}),"\n",(0,a.jsx)(n.p,{children:"\u25e6 Legal frameworks should consider the specific contexts in which data is used.\nThis means creating sector-specific privacy regulations that account for the\nunique norms and expectations of each context."}),"\n",(0,a.jsx)(n.p,{children:"\u25e6 Digital platforms must be transparent about their data practices and\naccountable for maintaining appropriate information flows. This includes clear\ncommunication about how data is collected, used, and shared, as well as\nmechanisms for users to hold platforms accountable."}),"\n",(0,a.jsx)(n.p,{children:"\u25e6 Empowering users with tools to manage their privacy in context-specific ways\nis crucial. This can involve granular privacy settings, consent mechanisms that\nreflect contextual norms, and educational initiatives to inform users about\ntheir privacy rights and risks."}),"\n",(0,a.jsx)(n.p,{children:"\u25e6 Designers and developers of digital technologies should incorporate contextual\nintegrity principles into the design of systems and services. This means\nconsidering the social contexts in which their technologies will be used and\nensuring that information flows align with context-specific norms."}),"\n",(0,a.jsx)(n.p,{children:"\u25e6 Regulators have tried to address this issue by implementing data protection\nlaws. However, in practice, there are no effective tools to solve the problem\neasily, and the regulations are prone to human error. This results in\nunnecessary bureaucracy, without solving the problem at its core."}),"\n",(0,a.jsx)(n.h2,{id:"core-values-and-beliefs",children:"Core Values and Beliefs"}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Privacy"})}),"\n",(0,a.jsx)(n.p,{children:"We believe that privacy is a fundamental human right."}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Ownership & Control"})}),"\n",(0,a.jsx)(n.p,{children:"Data should be owned and managed by the user whose data it is, not by large\ncorporations, big tech, or the government. Individuals should have complete\ncontrol over their digital footprint."}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Transparency & Security"})}),"\n",(0,a.jsx)(n.p,{children:"Data management processes must be transparent and understandable. Personal data\nshould be protected against unauthorized access and misuse."}),"\n",(0,a.jsx)(n.h2,{id:"goals-and-objectives",children:"Goals and Objectives"}),"\n",(0,a.jsx)(n.p,{children:"The need for data sovereignty is urgent. Daily data breaches compromise medical\nrecords, putting lives at risk, financial records are disclosed, leading to\ntheft, and personal secrets can be exposed without consent. In a world where\ndata is a valuable asset, it is essential to create a fair and secure\nenvironment. Contextual integrity, which addresses data privacy in the digital\nage, must be upheld to protect individual rights and foster trust in digital\ninteractions. Our goals include:"}),"\n",(0,a.jsx)(n.p,{children:"\u25e6 Creating a robust, secure, and user-friendly peer-to-peer protocol for data\naccess control."}),"\n",(0,a.jsx)(n.p,{children:"\u25e6 Providing tools and resources to enable builders to develop Self Sovereign\nApps, where users can manage their data independently."}),"\n",(0,a.jsx)(n.p,{children:"\u25e6 Target developers to raise awareness, join the movement, and build products\nwithin this new framework."}),"\n",(0,a.jsx)(n.p,{children:"\u25e6 Educating the public about the importance of data sovereignty and how to\nprotect their digital identity."}),"\n",(0,a.jsx)(n.p,{children:"\u25e6 Developing user economy models, for the users to be compensated when their\ndata is used by profit-making entities."}),"\n",(0,a.jsx)(n.h2,{id:"join-the-movement",children:"Join the Movement"}),"\n",(0,a.jsx)(n.p,{children:"The future of our digital world depends on the actions we take today. By\nreclaiming control over our personal data, we can ensure privacy, security, and\nfairness for all. We call on developers to build innovative solutions that\nprioritize user-controlled data management. We urge individuals to take greater\ncare of their digital identity and privacy, advocating for a future where\npersonal data is respected and protected. Join us in creating a fair and secure\ndigital world. Let us rise to the challenge and create a digital environment\nwhere data sovereignty is the norm, not the exception. Because it is YOUR data,\nand YOU should control what happens to it!"})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(l,{...e})}):l(e)}},5248:(e,n,t)=>{t.d(n,{R:()=>o,x:()=>r});var i=t(758);const a={},s=i.createContext(a);function o(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:o(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/3b243cb4.0ff86deb.js b/assets/js/3b243cb4.0ff86deb.js new file mode 100644 index 00000000..275217d8 --- /dev/null +++ b/assets/js/3b243cb4.0ff86deb.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8870],{7753:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>l,contentTitle:()=>r,default:()=>p,frontMatter:()=>a,metadata:()=>s,toc:()=>c});const s=JSON.parse('{"id":"core-concepts/applications","title":"Applications","description":"Applications in Calimero define the core logic governing how peers interact","source":"@site/docs/03-core-concepts/05-applications.mdx","sourceDirName":"03-core-concepts","slug":"/core-concepts/applications","permalink":"/core-concepts/applications","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/03-core-concepts/05-applications.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":5,"frontMatter":{"id":"applications","title":"Applications"},"sidebar":"tutorialSidebar","previous":{"title":"Contexts","permalink":"/core-concepts/contexts"},"next":{"title":"Blockchains Integration","permalink":"/core-concepts/blockchains-integration"}}');var t=i(6070),o=i(5248);const a={id:"applications",title:"Applications"},r=void 0,l={},c=[{value:"Examples of Applications",id:"examples-of-applications",level:3},{value:"Benefits of Decentralized Applications",id:"benefits-of-decentralized-applications",level:3},{value:"Security and Data Management",id:"security-and-data-management",level:3},{value:"Building Applications",id:"building-applications",level:3}];function d(e){const n={h3:"h3",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,o.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.p,{children:"Applications in Calimero define the core logic governing how peers interact\nwithin a decentralized network. Developers can programmatically augment the\nprotocol to create customized functionalities, supporting a wide range of\napplications tailored to various use cases, from direct messaging and\ncommunication channels to interactive games and collaborative editing."}),"\n",(0,t.jsx)(n.h3,{id:"examples-of-applications",children:"Examples of Applications"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.strong,{children:"Communication Platforms"})}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Direct Messages and Channels"}),": Support for private, encrypted messaging\nbetween users and group communications in shared, secure spaces. This setup\ncan scale from one-on-one conversations to large group discussions, similar\nto Slack channels or Discord communities."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Community Platforms"}),": Decentralized alternatives to platforms like\nReddit or Hacker News, enabling independent contexts for different\npurposes, fostering discussions, and sharing content securely."]}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.strong,{children:"Interactive Games"})}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Privacy-Focused Games"}),": These games require the privacy of each player's\nmoves until both have played, ensuring fair play and maintaining the\nconfidentiality of strategies. Examples include:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Rock-Paper-Scissors"}),": Players' choices are revealed simultaneously\nafter both have made their moves."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Battleship"}),": The positions of ships are kept secret until revealed\nthrough gameplay."]}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Non-Privacy Games"}),": These games do not require concealment of moves and\nallow all actions to be visible to both players. Examples include:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Chess"}),": A strategy game where all moves are visible to both players,\nwith game logic running locally."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Checkers"}),": Another strategy game where all moves are open and visible\nto both players."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.strong,{children:"Collaborative Work"})}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Document Collaboration"}),": Real-time collaboration on documents, akin to\nGoogle Docs, but decentralized and secure."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Creative Projects"}),": Shared canvases or environments for drawing,\ndesigning, or working on various creative projects, where all contributions\nare securely encrypted."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"benefits-of-decentralized-applications",children:"Benefits of Decentralized Applications"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Resilience"}),": Distributed application logic ensures the system functions\nsmoothly even if some devices go offline."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Autonomy"}),": Users control their data and activities without relying on a\ncentral authority."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Scalability"}),": The system scales effectively as more users join due to\noptimistic execution, with state being conflict-free and eventually\nreconciled."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Privacy"}),": Keeping data local and encrypted prevents exposure to third\nparties, crucial for sensitive information."]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"security-and-data-management",children:"Security and Data Management"}),"\n",(0,t.jsx)(n.p,{children:"All non-state-transitional data, such as attached files in DMs, collaborative\ndocument assets, and game resources, inherit the same level of security as\nstate-transitional transactions. This ensures that all forms of data within the\nCalimero network are encrypted and secure."}),"\n",(0,t.jsx)(n.p,{children:"Calimero also functions as a decentralized filesystem for these\nnon-state-transitional, encrypted blobs of data. Similar to BitTorrent or IPFS,\nnodes can lazily share the data without needing any centralized storage options.\nThis decentralized approach allows for efficient and secure data distribution\nacross the network."}),"\n",(0,t.jsx)(n.h3,{id:"building-applications",children:"Building Applications"}),"\n",(0,t.jsx)(n.p,{children:"Developers can leverage Calimero's framework to programmatically build and\naugment a wide range of applications using provided tools and documentation.\nThis includes setting up the development environment and deploying applications\nwithin the network."}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Development Tools"})," Calimero offers the Rust SDK and intuitive APIs,\nenabling developers to create applications that integrate seamlessly with the\nnetwork."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Documentation and Support"})," Comprehensive documentation and community\nsupport assist developers in every step of the application development\nprocess, ensuring that they can build and deploy high-quality, secure\napplications efficiently."]}),"\n"]}),"\n"]})]})}function p(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},5248:(e,n,i)=>{i.d(n,{R:()=>a,x:()=>r});var s=i(758);const t={},o=s.createContext(t);function a(e){const n=s.useContext(o);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:a(e.components),s.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/3b243cb4.732288c6.js b/assets/js/3b243cb4.732288c6.js deleted file mode 100644 index 0ffae4e0..00000000 --- a/assets/js/3b243cb4.732288c6.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8870],{7753:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>l,contentTitle:()=>r,default:()=>p,frontMatter:()=>a,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"core-concepts/applications","title":"Applications","description":"Applications in Calimero define the core logic governing how peers interact","source":"@site/docs/03-core-concepts/05-applications.mdx","sourceDirName":"03-core-concepts","slug":"/core-concepts/applications","permalink":"/core-concepts/applications","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/03-core-concepts/05-applications.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":5,"frontMatter":{"id":"applications","title":"Applications"},"sidebar":"tutorialSidebar","previous":{"title":"Contexts","permalink":"/core-concepts/contexts"},"next":{"title":"Blockchain Integrations","permalink":"/core-concepts/blockchains-integration/blockchain-integrations"}}');var s=i(6070),o=i(5248);const a={id:"applications",title:"Applications"},r=void 0,l={},c=[{value:"Examples of Applications",id:"examples-of-applications",level:3},{value:"Benefits of Decentralized Applications",id:"benefits-of-decentralized-applications",level:3},{value:"Security and Data Management",id:"security-and-data-management",level:3},{value:"Building Applications",id:"building-applications",level:3}];function d(e){const n={h3:"h3",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:"Applications in Calimero define the core logic governing how peers interact\nwithin a decentralized network. Developers can programmatically augment the\nprotocol to create customized functionalities, supporting a wide range of\napplications tailored to various use cases, from direct messaging and\ncommunication channels to interactive games and collaborative editing."}),"\n",(0,s.jsx)(n.h3,{id:"examples-of-applications",children:"Examples of Applications"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"Communication Platforms"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Direct Messages and Channels"}),": Support for private, encrypted messaging\nbetween users and group communications in shared, secure spaces. This setup\ncan scale from one-on-one conversations to large group discussions, similar\nto Slack channels or Discord communities."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Community Platforms"}),": Decentralized alternatives to platforms like\nReddit or Hacker News, enabling independent contexts for different\npurposes, fostering discussions, and sharing content securely."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"Interactive Games"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Privacy-Focused Games"}),": These games require the privacy of each player's\nmoves until both have played, ensuring fair play and maintaining the\nconfidentiality of strategies. Examples include:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Rock-Paper-Scissors"}),": Players' choices are revealed simultaneously\nafter both have made their moves."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Battleship"}),": The positions of ships are kept secret until revealed\nthrough gameplay."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Non-Privacy Games"}),": These games do not require concealment of moves and\nallow all actions to be visible to both players. Examples include:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Chess"}),": A strategy game where all moves are visible to both players,\nwith game logic running locally."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Checkers"}),": Another strategy game where all moves are open and visible\nto both players."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"Collaborative Work"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Document Collaboration"}),": Real-time collaboration on documents, akin to\nGoogle Docs, but decentralized and secure."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Creative Projects"}),": Shared canvases or environments for drawing,\ndesigning, or working on various creative projects, where all contributions\nare securely encrypted."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"benefits-of-decentralized-applications",children:"Benefits of Decentralized Applications"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Resilience"}),": Distributed application logic ensures the system functions\nsmoothly even if some devices go offline."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Autonomy"}),": Users control their data and activities without relying on a\ncentral authority."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Scalability"}),": The system scales effectively as more users join due to\noptimistic execution, with state being conflict-free and eventually\nreconciled."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Privacy"}),": Keeping data local and encrypted prevents exposure to third\nparties, crucial for sensitive information."]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"security-and-data-management",children:"Security and Data Management"}),"\n",(0,s.jsx)(n.p,{children:"All non-state-transitional data, such as attached files in DMs, collaborative\ndocument assets, and game resources, inherit the same level of security as\nstate-transitional transactions. This ensures that all forms of data within the\nCalimero network are encrypted and secure."}),"\n",(0,s.jsx)(n.p,{children:"Calimero also functions as a decentralized filesystem for these\nnon-state-transitional, encrypted blobs of data. Similar to BitTorrent or IPFS,\nnodes can lazily share the data without needing any centralized storage options.\nThis decentralized approach allows for efficient and secure data distribution\nacross the network."}),"\n",(0,s.jsx)(n.h3,{id:"building-applications",children:"Building Applications"}),"\n",(0,s.jsx)(n.p,{children:"Developers can leverage Calimero's framework to programmatically build and\naugment a wide range of applications using provided tools and documentation.\nThis includes setting up the development environment and deploying applications\nwithin the network."}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Development Tools"})," Calimero offers the Rust SDK and intuitive APIs,\nenabling developers to create applications that integrate seamlessly with the\nnetwork."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Documentation and Support"})," Comprehensive documentation and community\nsupport assist developers in every step of the application development\nprocess, ensuring that they can build and deploy high-quality, secure\napplications efficiently."]}),"\n"]}),"\n"]})]})}function p(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},5248:(e,n,i)=>{i.d(n,{R:()=>a,x:()=>r});var t=i(758);const s={},o=t.createContext(s);function a(e){const n=t.useContext(o);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),t.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/3e581231.f15a5b67.js b/assets/js/3e581231.984fa8bf.js similarity index 98% rename from assets/js/3e581231.f15a5b67.js rename to assets/js/3e581231.984fa8bf.js index 71adf074..e08cd8da 100644 --- a/assets/js/3e581231.f15a5b67.js +++ b/assets/js/3e581231.984fa8bf.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2897],{945:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>h,frontMatter:()=>a,metadata:()=>r,toc:()=>l});const r=JSON.parse('{"id":"architecture/node/storage","title":"Storage","description":"The storage component in the Calimero Network is essential for managing and","source":"@site/docs/04-architecture/03-node/04-storage.mdx","sourceDirName":"04-architecture/03-node","slug":"/architecture/node/storage","permalink":"/architecture/node/storage","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/04-architecture/03-node/04-storage.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":4,"frontMatter":{"id":"storage","title":"Storage"},"sidebar":"tutorialSidebar","previous":{"title":"Server","permalink":"/architecture/node/server"},"next":{"title":"Network","permalink":"/architecture/node/network"}}');var i=n(6070),s=n(5248);const a={id:"storage",title:"Storage"},o=void 0,c={},l=[{value:"Core Capabilities",id:"core-capabilities",level:3}];function d(e){const t={h3:"h3",li:"li",p:"p",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.p,{children:"The storage component in the Calimero Network is essential for managing and\nmaintaining the data generated and utilized by decentralized applications\n(DApps). It ensures data integrity, security, and efficient access, enabling\nseamless operation of applications within the network."}),"\n",(0,i.jsx)(t.h3,{id:"core-capabilities",children:"Core Capabilities"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"Generic Storage Interface"}),": Calimero provides a flexible storage interface\nthat allows app developers to choose their preferred database. By default,\nCalimero uses RocksDB, but it can also support LevelDB, Sled, TigerBeetle,\nSQLite, or even cloud storage solutions like S3."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"Context State Storage"}),": The context state is backed by a Patricia-Trie\nstructure flattened into the key-value map of the datastore. This structure\nensures efficient state management and retrieval."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"Data Blobs"}),": The storage system handles non-state-transitional, encrypted\nblobs of data, similar to BitTorrent or IPFS. Nodes can lazily share these\ndata blobs without needing centralized storage, ensuring efficient and secure\ndata distribution across the network. By default, the blobstore is the local\nfilesystem, but it can be configured to use any cloud storage option or\ncontent-addressed storage like IPFS."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"Data Encryption"}),": All data stored within the network is encrypted at rest,\nensuring that sensitive information remains protected. This includes both\nstate-transitional data and non-state-transitional data like attached files in\nDMs or collaborative document assets."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"Efficient Data Operations"}),": The storage component is optimized for quick\ndata operations, ensuring that applications can access, retrieve, and update\nthe data they need promptly. Caching mechanisms are employed to further\nimprove data access speeds."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"Garbage Collection"}),": The system includes mechanisms for garbage collection\nusing reference counting for trie data, allowing for the cleanup of obsolete\nor redundant data. This helps in maintaining optimal storage performance and\nresource utilization."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"Metrics and Monitoring"}),": The storage component provides detailed metrics on\nstorage usage, including total usage and breakdowns by context. This allows\nfor effective monitoring and management of storage resources."]}),"\n"]}),"\n"]})]})}function h(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},5248:(e,t,n)=>{n.d(t,{R:()=>a,x:()=>o});var r=n(758);const i={},s=r.createContext(i);function a(e){const t=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),r.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2897],{945:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>h,frontMatter:()=>a,metadata:()=>r,toc:()=>l});const r=JSON.parse('{"id":"architecture/node/storage","title":"Storage","description":"The storage component in the Calimero Network is essential for managing and","source":"@site/docs/04-architecture/03-node/04-storage.mdx","sourceDirName":"04-architecture/03-node","slug":"/architecture/node/storage","permalink":"/architecture/node/storage","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/04-architecture/03-node/04-storage.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":4,"frontMatter":{"id":"storage","title":"Storage"},"sidebar":"tutorialSidebar","previous":{"title":"Server","permalink":"/architecture/node/server"},"next":{"title":"Network","permalink":"/architecture/node/network"}}');var i=n(6070),s=n(5248);const a={id:"storage",title:"Storage"},o=void 0,c={},l=[{value:"Core Capabilities",id:"core-capabilities",level:3}];function d(e){const t={h3:"h3",li:"li",p:"p",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.p,{children:"The storage component in the Calimero Network is essential for managing and\nmaintaining the data generated and utilized by decentralized applications\n(DApps). It ensures data integrity, security, and efficient access, enabling\nseamless operation of applications within the network."}),"\n",(0,i.jsx)(t.h3,{id:"core-capabilities",children:"Core Capabilities"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"Generic Storage Interface"}),": Calimero provides a flexible storage interface\nthat allows app developers to choose their preferred database. By default,\nCalimero uses RocksDB, but it can also support LevelDB, Sled, TigerBeetle,\nSQLite, or even cloud storage solutions like S3."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"Context State Storage"}),": The context state is backed by a Patricia-Trie\nstructure flattened into the key-value map of the datastore. This structure\nensures efficient state management and retrieval."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"Data Blobs"}),": The storage system handles non-state-transitional, encrypted\nblobs of data, similar to BitTorrent or IPFS. Nodes can lazily share these\ndata blobs without needing centralized storage, ensuring efficient and secure\ndata distribution across the network. By default, the blobstore is the local\nfilesystem, but it can be configured to use any cloud storage option or\ncontent-addressed storage like IPFS."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"Data Encryption"}),": All data stored within the network is encrypted at rest,\nensuring that sensitive information remains protected. This includes both\nstate-transitional data and non-state-transitional data like attached files in\nDMs or collaborative document assets."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"Efficient Data Operations"}),": The storage component is optimized for quick\ndata operations, ensuring that applications can access, retrieve, and update\nthe data they need promptly. Caching mechanisms are employed to further\nimprove data access speeds."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"Garbage Collection"}),": The system includes mechanisms for garbage collection\nusing reference counting for trie data, allowing for the cleanup of obsolete\nor redundant data. This helps in maintaining optimal storage performance and\nresource utilization."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"Metrics and Monitoring"}),": The storage component provides detailed metrics on\nstorage usage, including total usage and breakdowns by context. This allows\nfor effective monitoring and management of storage resources."]}),"\n"]}),"\n"]})]})}function h(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},5248:(e,t,n)=>{n.d(t,{R:()=>a,x:()=>o});var r=n(758);const i={},s=r.createContext(i);function a(e){const t=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),r.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/4098c589.b03229f2.js b/assets/js/4098c589.fd74f096.js similarity index 96% rename from assets/js/4098c589.b03229f2.js rename to assets/js/4098c589.fd74f096.js index 3d415181..db112f92 100644 --- a/assets/js/4098c589.b03229f2.js +++ b/assets/js/4098c589.fd74f096.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6093],{9740:(e,t,i)=>{i.r(t),i.d(t,{assets:()=>c,contentTitle:()=>a,default:()=>d,frontMatter:()=>o,metadata:()=>n,toc:()=>l});const n=JSON.parse('{"id":"resources/eli5","title":"ELI5","description":"Explain Like I\'m Five","source":"@site/docs/07-resources/02-eli5.mdx","sourceDirName":"07-resources","slug":"/resources/eli5","permalink":"/resources/eli5","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/07-resources/02-eli5.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":2,"frontMatter":{"id":"eli5","title":"ELI5"},"sidebar":"tutorialSidebar","previous":{"title":"The Data Sovereignty Manifesto","permalink":"/resources/manifesto"},"next":{"title":"General","permalink":"/throubleshooting/overview"}}');var r=i(6070),s=i(5248);const o={id:"eli5",title:"ELI5"},a=void 0,c={},l=[{value:"Explain Like I'm Five",id:"explain-like-im-five",level:2}];function u(e){const t={h2:"h2",img:"img",p:"p",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h2,{id:"explain-like-im-five",children:"Explain Like I'm Five"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"ELI5",src:i(827).A+"",width:"2480",height:"2424"})})]})}function d(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(u,{...e})}):u(e)}},827:(e,t,i)=>{i.d(t,{A:()=>n});const n=i.p+"assets/images/eli5withtrademark-93319f8188e2e443b6164f4e6e96f60a.png"},5248:(e,t,i)=>{i.d(t,{R:()=>o,x:()=>a});var n=i(758);const r={},s=n.createContext(r);function o(e){const t=n.useContext(s);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),n.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6093],{9740:(e,t,i)=>{i.r(t),i.d(t,{assets:()=>c,contentTitle:()=>a,default:()=>d,frontMatter:()=>o,metadata:()=>n,toc:()=>l});const n=JSON.parse('{"id":"resources/eli5","title":"ELI5","description":"Explain Like I\'m Five","source":"@site/docs/07-resources/02-eli5.mdx","sourceDirName":"07-resources","slug":"/resources/eli5","permalink":"/resources/eli5","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/07-resources/02-eli5.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":2,"frontMatter":{"id":"eli5","title":"ELI5"},"sidebar":"tutorialSidebar","previous":{"title":"The Data Sovereignty Manifesto","permalink":"/resources/manifesto"},"next":{"title":"General","permalink":"/throubleshooting/overview"}}');var r=i(6070),s=i(5248);const o={id:"eli5",title:"ELI5"},a=void 0,c={},l=[{value:"Explain Like I'm Five",id:"explain-like-im-five",level:2}];function u(e){const t={h2:"h2",img:"img",p:"p",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h2,{id:"explain-like-im-five",children:"Explain Like I'm Five"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"ELI5",src:i(827).A+"",width:"2480",height:"2424"})})]})}function d(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(u,{...e})}):u(e)}},827:(e,t,i)=>{i.d(t,{A:()=>n});const n=i.p+"assets/images/eli5withtrademark-93319f8188e2e443b6164f4e6e96f60a.png"},5248:(e,t,i)=>{i.d(t,{R:()=>o,x:()=>a});var n=i(758);const r={},s=n.createContext(r);function o(e){const t=n.useContext(s);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),n.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/42106303.0f07b864.js b/assets/js/42106303.0f07b864.js new file mode 100644 index 00000000..7cb94fb9 --- /dev/null +++ b/assets/js/42106303.0f07b864.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7284],{4354:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>l,contentTitle:()=>i,default:()=>d,frontMatter:()=>a,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"tutorials/proxy-contract-interaction","title":"Blockchain interaction with Proxy Contract","description":"Overview","source":"@site/docs/06-tutorials/07-proxy-contract-interaction.mdx","sourceDirName":"06-tutorials","slug":"/tutorials/proxy-contract-interaction","permalink":"/tutorials/proxy-contract-interaction","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/06-tutorials/07-proxy-contract-interaction.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":7,"frontMatter":{"id":"proxy-contract-interaction","title":"Blockchain interaction with Proxy Contract"},"sidebar":"tutorialSidebar","previous":{"title":"Rock Paper Scissors","permalink":"/tutorials/awesome-projects/rock-paper-scissors"},"next":{"title":"The Data Sovereignty Manifesto","permalink":"/resources/manifesto"}}');var o=r(6070),s=r(5248);const a={id:"proxy-contract-interaction",title:"Blockchain interaction with Proxy Contract"},i=void 0,l={},c=[{value:"Overview",id:"overview",level:2},{value:"Backend Implementation",id:"backend-implementation",level:2},{value:"API Types",id:"api-types",level:2},{value:"API Implementation",id:"api-implementation",level:2},{value:"Creating Proposals",id:"creating-proposals",level:2},{value:"1. External Function Call",id:"1-external-function-call",level:3},{value:"2. Token Transfer",id:"2-token-transfer",level:3},{value:"3. Set Context Value",id:"3-set-context-value",level:3},{value:"4. Set Number of Approvals",id:"4-set-number-of-approvals",level:3},{value:"5. Set Active Proposals Limit",id:"5-set-active-proposals-limit",level:3},{value:"Approving Proposals",id:"approving-proposals",level:2},{value:"Error Handling",id:"error-handling",level:2},{value:"Best Practices",id:"best-practices",level:2}];function p(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h2,{id:"overview",children:"Overview"}),"\n",(0,o.jsx)(n.p,{children:"The Calimero proxy contract enables cross-chain interactions through a\nproposal-based system. The integration consists of:"}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsx)(n.li,{children:"Backend Application (Rust)"}),"\n",(0,o.jsx)(n.li,{children:"Frontend Application (TypeScript/React)"}),"\n"]}),"\n",(0,o.jsx)(n.admonition,{type:"tip",children:(0,o.jsxs)(n.p,{children:["More info on blockchain integrations can be found in the\n",(0,o.jsx)(n.a,{href:"../core-concepts/blockchains-integration",children:"Blockchains Integration"})," section."]})}),"\n",(0,o.jsx)(n.h2,{id:"backend-implementation",children:"Backend Implementation"}),"\n",(0,o.jsx)(n.p,{children:"The backend contract handles proposal creation and management. Here's the core\nfunctionality:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-rust",children:"#[app::logic]\nimpl AppState {\n pub fn create_new_proposal(&mut self, request: CreateProposalRequest) -> Result {\n // Implementation handles different types of proposals:\n // 1. ExternalFunctionCall\n // 2. Transfer\n // 3. SetContextValue\n // 4. SetNumApprovals\n // 5. SetActiveProposalsLimit\n }\n\n pub fn approve_proposal(&self, proposal_id: ProposalId) -> Result<(), Error> {\n Self::external().approve(proposal_id);\n env::emit(&Event::ApprovedProposal { id: proposal_id });\n Ok(())\n }\n}\n"})}),"\n",(0,o.jsx)(n.h2,{id:"api-types",children:"API Types"}),"\n",(0,o.jsx)(n.p,{children:"Define your types for the integration:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typescript",children:"// types.ts\nexport enum ProposalActionType {\n ExternalFunctionCall = 'ExternalFunctionCall',\n Transfer = 'Transfer',\n SetNumApprovals = 'SetNumApprovals',\n SetActiveProposalsLimit = 'SetActiveProposalsLimit',\n SetContextValue = 'SetContextValue',\n}\n\nexport interface CreateProposalRequest {\n action_type: ProposalActionType;\n params: {\n receiver_id?: string;\n method_name?: string;\n args?: string;\n deposit?: string;\n gas?: string;\n amount?: string;\n num_approvals?: number;\n active_proposals_limit?: number;\n key?: string;\n value?: string;\n };\n}\n"})}),"\n",(0,o.jsx)(n.h2,{id:"api-implementation",children:"API Implementation"}),"\n",(0,o.jsx)(n.p,{children:"Create a data source to handle API calls:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typescript",children:"// LogicApiDataSource.ts\nexport class LogicApiDataSource implements ClientApi {\n async createProposal(\n request: CreateProposalRequest,\n ): ApiResponse {\n const params: RpcQueryParams = {\n contextId: getContextId(),\n method: ClientMethod.CREATE_PROPOSAL,\n argsJson: { request },\n executorPublicKey: jwtObject.executor_public_key,\n };\n\n return await getJsonRpcClient().execute(params, config);\n }\n\n async approveProposal(\n request: ApproveProposalRequest,\n ): ApiResponse {\n // Implementation\n }\n}\n"})}),"\n",(0,o.jsx)(n.h2,{id:"creating-proposals",children:"Creating Proposals"}),"\n",(0,o.jsx)(n.p,{children:"Here are examples of creating different types of proposals:"}),"\n",(0,o.jsx)(n.h3,{id:"1-external-function-call",children:"1. External Function Call"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typescript",children:"const request: CreateProposalRequest = {\n action_type: 'ExternalFunctionCall',\n params: {\n receiver_id: 'contract.near',\n method_name: 'transfer',\n args: JSON.stringify({ amount: '100' }),\n deposit: '1000000000000000000000', // 1 NEAR\n gas: '30000000000000', // 30 TGas\n },\n};\n"})}),"\n",(0,o.jsx)(n.h3,{id:"2-token-transfer",children:"2. Token Transfer"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typescript",children:"const request: CreateProposalRequest = {\n action_type: 'Transfer',\n params: {\n receiver_id: 'recipient.near',\n amount: '1000000000000000000000', // 1 NEAR\n },\n};\n"})}),"\n",(0,o.jsx)(n.h3,{id:"3-set-context-value",children:"3. Set Context Value"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typescript",children:"const request: CreateProposalRequest = {\n action_type: 'SetContextValue',\n params: {\n key: 'my_key',\n value: 'my_value',\n },\n};\n"})}),"\n",(0,o.jsx)(n.h3,{id:"4-set-number-of-approvals",children:"4. Set Number of Approvals"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typescript",children:"const request: CreateProposalRequest = {\n action_type: 'SetNumApprovals',\n params: {\n num_approvals: 3,\n },\n};\n"})}),"\n",(0,o.jsx)(n.h3,{id:"5-set-active-proposals-limit",children:"5. Set Active Proposals Limit"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typescript",children:"const request: CreateProposalRequest = {\n action_type: 'SetActiveProposalsLimit',\n params: {\n active_proposals_limit: 10,\n },\n};\n"})}),"\n",(0,o.jsx)(n.h2,{id:"approving-proposals",children:"Approving Proposals"}),"\n",(0,o.jsx)(n.p,{children:"To approve a proposal:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typescript",children:"const approvalRequest: ApproveProposalRequest = {\n proposal_id: 'proposal-id-here',\n};\n\nawait logicApiDataSource.approveProposal(approvalRequest);\n"})}),"\n",(0,o.jsx)(n.h2,{id:"error-handling",children:"Error Handling"}),"\n",(0,o.jsx)(n.p,{children:"The implementation includes comprehensive error handling:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typescript",children:"try {\n const result = await logicApiDataSource.createProposal(request);\n if (result?.error) {\n console.error('Error:', result.error);\n // Handle error appropriately\n }\n} catch (error) {\n console.error('Unexpected error:', error);\n // Handle unexpected errors\n}\n"})}),"\n",(0,o.jsx)(n.h2,{id:"best-practices",children:"Best Practices"}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Input Validation"})}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"Validate all parameters before sending"}),"\n",(0,o.jsx)(n.li,{children:"Use appropriate types for amounts (strings for large numbers)"}),"\n",(0,o.jsx)(n.li,{children:"Format JSON strings properly"}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Error Handling"})}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"Implement proper error handling"}),"\n",(0,o.jsx)(n.li,{children:"Log important operations"}),"\n",(0,o.jsx)(n.li,{children:"Handle all possible error cases"}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Gas Management"})}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"Use appropriate gas limits"}),"\n",(0,o.jsx)(n.li,{children:"Default to 30 TGas for NEAR"}),"\n",(0,o.jsx)(n.li,{children:"Monitor gas usage"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:["Need help? Join our ",(0,o.jsx)(n.a,{href:"https://discord.gg/calimero",children:"Discord"})," or check our\n",(0,o.jsx)(n.a,{href:"https://github.com/calimero-network/docs",children:"GitHub"}),"."]})]})}function d(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(p,{...e})}):p(e)}},5248:(e,n,r)=>{r.d(n,{R:()=>a,x:()=>i});var t=r(758);const o={},s=t.createContext(o);function a(e){const n=t.useContext(s);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:a(e.components),t.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/4406af8f.30d06a74.js b/assets/js/4406af8f.eb9e5b8f.js similarity index 98% rename from assets/js/4406af8f.30d06a74.js rename to assets/js/4406af8f.eb9e5b8f.js index 14b743fb..dee260b6 100644 --- a/assets/js/4406af8f.30d06a74.js +++ b/assets/js/4406af8f.eb9e5b8f.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7302],{2018:(e,i,n)=>{n.r(i),n.d(i,{assets:()=>o,contentTitle:()=>a,default:()=>d,frontMatter:()=>r,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"tutorials/login-with-wallets/icp-wallet","title":"ICP Wallet","description":"Logging in with Internet Identity","source":"@site/docs/06-tutorials/01-login-with-wallets/03-icp-wallet.mdx","sourceDirName":"06-tutorials/01-login-with-wallets","slug":"/tutorials/login-with-wallets/icp-wallet","permalink":"/tutorials/login-with-wallets/icp-wallet","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/06-tutorials/01-login-with-wallets/03-icp-wallet.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":3,"frontMatter":{"id":"icp-wallet","title":"ICP Wallet"},"sidebar":"tutorialSidebar","previous":{"title":"Starknet Wallet","permalink":"/tutorials/login-with-wallets/starknet-wallet"},"next":{"title":"Create Context","permalink":"/tutorials/create-context"}}');var l=n(6070),s=n(5248);const r={id:"icp-wallet",title:"ICP Wallet"},a=void 0,o={},c=[{value:"Logging in with Internet Identity",id:"logging-in-with-internet-identity",level:2},{value:"1. User Initiates Login",id:"1-user-initiates-login",level:3},{value:"2. Challenge Preparation",id:"2-challenge-preparation",level:3},{value:"3. Internet Identity Authentication",id:"3-internet-identity-authentication",level:3},{value:"4. Delegation Chain Retrieval",id:"4-delegation-chain-retrieval",level:3},{value:"5. Processing the Authentication Result",id:"5-processing-the-authentication-result",level:3},{value:"6. Login Request Preparation",id:"6-login-request-preparation",level:3},{value:"7. Server-side Verification",id:"7-server-side-verification",level:3},{value:"8. Successful Login",id:"8-successful-login",level:3}];function h(e){const i={h2:"h2",h3:"h3",li:"li",p:"p",ul:"ul",...(0,s.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(i.h2,{id:"logging-in-with-internet-identity",children:"Logging in with Internet Identity"}),"\n",(0,l.jsx)(i.p,{children:"The login process with Internet Identity involves these key steps:"}),"\n",(0,l.jsx)(i.h3,{id:"1-user-initiates-login",children:"1. User Initiates Login"}),"\n",(0,l.jsxs)(i.ul,{children:["\n",(0,l.jsx)(i.li,{children:'The user navigates to the Admin Dashboard and selects the option to "Login\nwith Internet Identity."'}),"\n"]}),"\n",(0,l.jsx)(i.h3,{id:"2-challenge-preparation",children:"2. Challenge Preparation"}),"\n",(0,l.jsxs)(i.ul,{children:["\n",(0,l.jsx)(i.li,{children:"The system prepares a challenge (encoded as a session public key) before\ninitiating the authentication process."}),"\n"]}),"\n",(0,l.jsx)(i.h3,{id:"3-internet-identity-authentication",children:"3. Internet Identity Authentication"}),"\n",(0,l.jsxs)(i.ul,{children:["\n",(0,l.jsx)(i.li,{children:"A popup window opens, connecting to the Internet Identity service."}),"\n",(0,l.jsx)(i.li,{children:"The user authenticates through this popup."}),"\n",(0,l.jsx)(i.li,{children:"The challenge (session public key) is sent to the II service."}),"\n"]}),"\n",(0,l.jsx)(i.h3,{id:"4-delegation-chain-retrieval",children:"4. Delegation Chain Retrieval"}),"\n",(0,l.jsxs)(i.ul,{children:["\n",(0,l.jsx)(i.li,{children:"Upon successful authentication, the II service creates and returns a\ndelegation chain."}),"\n",(0,l.jsx)(i.li,{children:"This delegation chain includes cryptographic proofs of the user's\nauthentication."}),"\n"]}),"\n",(0,l.jsx)(i.h3,{id:"5-processing-the-authentication-result",children:"5. Processing the Authentication Result"}),"\n",(0,l.jsxs)(i.ul,{children:["\n",(0,l.jsx)(i.li,{children:"The application receives the delegation chain from the II service."}),"\n",(0,l.jsx)(i.li,{children:"It processes this data, extracting necessary information like the user's\npublic key."}),"\n"]}),"\n",(0,l.jsx)(i.h3,{id:"6-login-request-preparation",children:"6. Login Request Preparation"}),"\n",(0,l.jsxs)(i.ul,{children:["\n",(0,l.jsxs)(i.li,{children:["The application prepares a login request including:","\n",(0,l.jsxs)(i.ul,{children:["\n",(0,l.jsx)(i.li,{children:"The serialized delegation chain"}),"\n",(0,l.jsx)(i.li,{children:"The original challenge payload"}),"\n",(0,l.jsx)(i.li,{children:"Wallet metadata (ICP canister ID and wallet name)"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,l.jsx)(i.h3,{id:"7-server-side-verification",children:"7. Server-side Verification"}),"\n",(0,l.jsxs)(i.ul,{children:["\n",(0,l.jsx)(i.li,{children:"The login request is sent to the Calimero server."}),"\n",(0,l.jsx)(i.li,{children:"The server verifies the delegation chain and challenge."}),"\n"]}),"\n",(0,l.jsx)(i.h3,{id:"8-successful-login",children:"8. Successful Login"}),"\n",(0,l.jsxs)(i.ul,{children:["\n",(0,l.jsx)(i.li,{children:"Upon successful verification, the user is logged in and directed to the\nidentity page."}),"\n",(0,l.jsx)(i.li,{children:"The user's Internet Identity becomes their unique identifier for future\ninteractions within the Calimero ecosystem."}),"\n"]}),"\n",(0,l.jsx)(i.p,{children:"This process leverages ICP's delegation chain mechanism for secure,\ndecentralized authentication."})]})}function d(e={}){const{wrapper:i}={...(0,s.R)(),...e.components};return i?(0,l.jsx)(i,{...e,children:(0,l.jsx)(h,{...e})}):h(e)}},5248:(e,i,n)=>{n.d(i,{R:()=>r,x:()=>a});var t=n(758);const l={},s=t.createContext(l);function r(e){const i=t.useContext(s);return t.useMemo((function(){return"function"==typeof e?e(i):{...i,...e}}),[i,e])}function a(e){let i;return i=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:r(e.components),t.createElement(s.Provider,{value:i},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7302],{2018:(e,i,n)=>{n.r(i),n.d(i,{assets:()=>o,contentTitle:()=>a,default:()=>d,frontMatter:()=>r,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"tutorials/login-with-wallets/icp-wallet","title":"ICP Wallet","description":"Logging in with Internet Identity","source":"@site/docs/06-tutorials/01-login-with-wallets/03-icp-wallet.mdx","sourceDirName":"06-tutorials/01-login-with-wallets","slug":"/tutorials/login-with-wallets/icp-wallet","permalink":"/tutorials/login-with-wallets/icp-wallet","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/06-tutorials/01-login-with-wallets/03-icp-wallet.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":3,"frontMatter":{"id":"icp-wallet","title":"ICP Wallet"},"sidebar":"tutorialSidebar","previous":{"title":"Starknet Wallet","permalink":"/tutorials/login-with-wallets/starknet-wallet"},"next":{"title":"Create Context","permalink":"/tutorials/create-context"}}');var l=n(6070),s=n(5248);const r={id:"icp-wallet",title:"ICP Wallet"},a=void 0,o={},c=[{value:"Logging in with Internet Identity",id:"logging-in-with-internet-identity",level:2},{value:"1. User Initiates Login",id:"1-user-initiates-login",level:3},{value:"2. Challenge Preparation",id:"2-challenge-preparation",level:3},{value:"3. Internet Identity Authentication",id:"3-internet-identity-authentication",level:3},{value:"4. Delegation Chain Retrieval",id:"4-delegation-chain-retrieval",level:3},{value:"5. Processing the Authentication Result",id:"5-processing-the-authentication-result",level:3},{value:"6. Login Request Preparation",id:"6-login-request-preparation",level:3},{value:"7. Server-side Verification",id:"7-server-side-verification",level:3},{value:"8. Successful Login",id:"8-successful-login",level:3}];function h(e){const i={h2:"h2",h3:"h3",li:"li",p:"p",ul:"ul",...(0,s.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(i.h2,{id:"logging-in-with-internet-identity",children:"Logging in with Internet Identity"}),"\n",(0,l.jsx)(i.p,{children:"The login process with Internet Identity involves these key steps:"}),"\n",(0,l.jsx)(i.h3,{id:"1-user-initiates-login",children:"1. User Initiates Login"}),"\n",(0,l.jsxs)(i.ul,{children:["\n",(0,l.jsx)(i.li,{children:'The user navigates to the Admin Dashboard and selects the option to "Login\nwith Internet Identity."'}),"\n"]}),"\n",(0,l.jsx)(i.h3,{id:"2-challenge-preparation",children:"2. Challenge Preparation"}),"\n",(0,l.jsxs)(i.ul,{children:["\n",(0,l.jsx)(i.li,{children:"The system prepares a challenge (encoded as a session public key) before\ninitiating the authentication process."}),"\n"]}),"\n",(0,l.jsx)(i.h3,{id:"3-internet-identity-authentication",children:"3. Internet Identity Authentication"}),"\n",(0,l.jsxs)(i.ul,{children:["\n",(0,l.jsx)(i.li,{children:"A popup window opens, connecting to the Internet Identity service."}),"\n",(0,l.jsx)(i.li,{children:"The user authenticates through this popup."}),"\n",(0,l.jsx)(i.li,{children:"The challenge (session public key) is sent to the II service."}),"\n"]}),"\n",(0,l.jsx)(i.h3,{id:"4-delegation-chain-retrieval",children:"4. Delegation Chain Retrieval"}),"\n",(0,l.jsxs)(i.ul,{children:["\n",(0,l.jsx)(i.li,{children:"Upon successful authentication, the II service creates and returns a\ndelegation chain."}),"\n",(0,l.jsx)(i.li,{children:"This delegation chain includes cryptographic proofs of the user's\nauthentication."}),"\n"]}),"\n",(0,l.jsx)(i.h3,{id:"5-processing-the-authentication-result",children:"5. Processing the Authentication Result"}),"\n",(0,l.jsxs)(i.ul,{children:["\n",(0,l.jsx)(i.li,{children:"The application receives the delegation chain from the II service."}),"\n",(0,l.jsx)(i.li,{children:"It processes this data, extracting necessary information like the user's\npublic key."}),"\n"]}),"\n",(0,l.jsx)(i.h3,{id:"6-login-request-preparation",children:"6. Login Request Preparation"}),"\n",(0,l.jsxs)(i.ul,{children:["\n",(0,l.jsxs)(i.li,{children:["The application prepares a login request including:","\n",(0,l.jsxs)(i.ul,{children:["\n",(0,l.jsx)(i.li,{children:"The serialized delegation chain"}),"\n",(0,l.jsx)(i.li,{children:"The original challenge payload"}),"\n",(0,l.jsx)(i.li,{children:"Wallet metadata (ICP canister ID and wallet name)"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,l.jsx)(i.h3,{id:"7-server-side-verification",children:"7. Server-side Verification"}),"\n",(0,l.jsxs)(i.ul,{children:["\n",(0,l.jsx)(i.li,{children:"The login request is sent to the Calimero server."}),"\n",(0,l.jsx)(i.li,{children:"The server verifies the delegation chain and challenge."}),"\n"]}),"\n",(0,l.jsx)(i.h3,{id:"8-successful-login",children:"8. Successful Login"}),"\n",(0,l.jsxs)(i.ul,{children:["\n",(0,l.jsx)(i.li,{children:"Upon successful verification, the user is logged in and directed to the\nidentity page."}),"\n",(0,l.jsx)(i.li,{children:"The user's Internet Identity becomes their unique identifier for future\ninteractions within the Calimero ecosystem."}),"\n"]}),"\n",(0,l.jsx)(i.p,{children:"This process leverages ICP's delegation chain mechanism for secure,\ndecentralized authentication."})]})}function d(e={}){const{wrapper:i}={...(0,s.R)(),...e.components};return i?(0,l.jsx)(i,{...e,children:(0,l.jsx)(h,{...e})}):h(e)}},5248:(e,i,n)=>{n.d(i,{R:()=>r,x:()=>a});var t=n(758);const l={},s=t.createContext(l);function r(e){const i=t.useContext(s);return t.useMemo((function(){return"function"==typeof e?e(i):{...i,...e}}),[i,e])}function a(e){let i;return i=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:r(e.components),t.createElement(s.Provider,{value:i},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/4be05fc7.6fecd9c1.js b/assets/js/4be05fc7.4d544f8a.js similarity index 98% rename from assets/js/4be05fc7.6fecd9c1.js rename to assets/js/4be05fc7.4d544f8a.js index 0579374a..e8ff62fb 100644 --- a/assets/js/4be05fc7.6fecd9c1.js +++ b/assets/js/4be05fc7.4d544f8a.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5013],{7068:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>r,default:()=>h,frontMatter:()=>a,metadata:()=>i,toc:()=>l});const i=JSON.parse('{"id":"core-concepts/specialized-nodes","title":"Specialized Nodes","description":"Specialized nodes in the Calimero Network are third-party nodes that augment a","source":"@site/docs/03-core-concepts/08-specialized-nodes.mdx","sourceDirName":"03-core-concepts","slug":"/core-concepts/specialized-nodes","permalink":"/core-concepts/specialized-nodes","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/03-core-concepts/08-specialized-nodes.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":8,"frontMatter":{"id":"specialized-nodes","title":"Specialized Nodes"},"sidebar":"tutorialSidebar","previous":{"title":"Encryption","permalink":"/core-concepts/encryption"},"next":{"title":"System Overview","permalink":"/architecture/system-overview"}}');var s=t(6070),o=t(5248);const a={id:"specialized-nodes",title:"Specialized Nodes"},r=void 0,c={},l=[{value:"Key Concepts",id:"key-concepts",level:3},{value:"Types of Specialized Nodes",id:"types-of-specialized-nodes",level:3},{value:"Reliability Through Decentralization",id:"reliability-through-decentralization",level:3}];function d(e){const n={h3:"h3",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:"Specialized nodes in the Calimero Network are third-party nodes that augment a\ncontext's capacity and reliability. They participate in a context but have\nadditional capabilities, providing various services while maintaining the\ndecentralized nature of the network."}),"\n",(0,s.jsx)(n.h3,{id:"key-concepts",children:"Key Concepts"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Incentivization"}),": These nodes can be incentivized through contracts on\nblockchains that pay them for their services, ensuring they remain motivated\nto perform their roles effectively."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Permissions and Roles"}),": Specialized nodes can have different levels of\npermissions, ranging from being subscribed to encrypted network events to\nfully participating as part of the context."]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"types-of-specialized-nodes",children:"Types of Specialized Nodes"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Storage Nodes"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Encrypted Transaction Storage"}),": These nodes store encrypted transactions\nwithout the ability to read them. They guarantee 100% uptime, ensuring that\nall transactions are available even when peers are offline. When peers come\nback online, the node provides missed transactions and new transactions for\nreplication."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Blob Storage"}),": These nodes also store encrypted blobs of\nnon-state-transitional data, ensuring that all necessary data is always\navailable without holding decryption keys."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Delegated Execution Nodes"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Context Maintenance"}),": These nodes fully join a context and maintain the\ncontext state on their end. They can handle resource-intensive executions,\ndelegating specific calls to optimize performance and resource utilization."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Administrative Nodes"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Event Observation and Action"}),": These nodes observe real-world events and\nact on them within the context. For example, in a billionaire's club\ncontext, an administrative node could monitor members' accounts on a\nblockchain and evict them if their balance falls below a certain threshold."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"reliability-through-decentralization",children:"Reliability Through Decentralization"}),"\n",(0,s.jsx)(n.p,{children:"Specialized nodes ensure that the context remains operational and consistent,\neven when primary peers are offline. They provide the necessary data and\ntransactions to keep the context up-to-date. The decentralized nature ensures\nthat the state is eventually consistent. Fragmentation does not cause issues as\nthe system reconciles itself when peers come back online, highlighting the\nnetwork's reliability without reliance on any single specialized node."})]})}function h(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},5248:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>r});var i=t(758);const s={},o=i.createContext(s);function a(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5013],{7068:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>r,default:()=>h,frontMatter:()=>a,metadata:()=>i,toc:()=>l});const i=JSON.parse('{"id":"core-concepts/specialized-nodes","title":"Specialized Nodes","description":"Specialized nodes in the Calimero Network are third-party nodes that augment a","source":"@site/docs/03-core-concepts/08-specialized-nodes.mdx","sourceDirName":"03-core-concepts","slug":"/core-concepts/specialized-nodes","permalink":"/core-concepts/specialized-nodes","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/03-core-concepts/08-specialized-nodes.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":8,"frontMatter":{"id":"specialized-nodes","title":"Specialized Nodes"},"sidebar":"tutorialSidebar","previous":{"title":"Encryption","permalink":"/core-concepts/encryption"},"next":{"title":"System Overview","permalink":"/architecture/system-overview"}}');var s=t(6070),o=t(5248);const a={id:"specialized-nodes",title:"Specialized Nodes"},r=void 0,c={},l=[{value:"Key Concepts",id:"key-concepts",level:3},{value:"Types of Specialized Nodes",id:"types-of-specialized-nodes",level:3},{value:"Reliability Through Decentralization",id:"reliability-through-decentralization",level:3}];function d(e){const n={h3:"h3",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:"Specialized nodes in the Calimero Network are third-party nodes that augment a\ncontext's capacity and reliability. They participate in a context but have\nadditional capabilities, providing various services while maintaining the\ndecentralized nature of the network."}),"\n",(0,s.jsx)(n.h3,{id:"key-concepts",children:"Key Concepts"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Incentivization"}),": These nodes can be incentivized through contracts on\nblockchains that pay them for their services, ensuring they remain motivated\nto perform their roles effectively."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Permissions and Roles"}),": Specialized nodes can have different levels of\npermissions, ranging from being subscribed to encrypted network events to\nfully participating as part of the context."]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"types-of-specialized-nodes",children:"Types of Specialized Nodes"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Storage Nodes"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Encrypted Transaction Storage"}),": These nodes store encrypted transactions\nwithout the ability to read them. They guarantee 100% uptime, ensuring that\nall transactions are available even when peers are offline. When peers come\nback online, the node provides missed transactions and new transactions for\nreplication."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Blob Storage"}),": These nodes also store encrypted blobs of\nnon-state-transitional data, ensuring that all necessary data is always\navailable without holding decryption keys."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Delegated Execution Nodes"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Context Maintenance"}),": These nodes fully join a context and maintain the\ncontext state on their end. They can handle resource-intensive executions,\ndelegating specific calls to optimize performance and resource utilization."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Administrative Nodes"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Event Observation and Action"}),": These nodes observe real-world events and\nact on them within the context. For example, in a billionaire's club\ncontext, an administrative node could monitor members' accounts on a\nblockchain and evict them if their balance falls below a certain threshold."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"reliability-through-decentralization",children:"Reliability Through Decentralization"}),"\n",(0,s.jsx)(n.p,{children:"Specialized nodes ensure that the context remains operational and consistent,\neven when primary peers are offline. They provide the necessary data and\ntransactions to keep the context up-to-date. The decentralized nature ensures\nthat the state is eventually consistent. Fragmentation does not cause issues as\nthe system reconciles itself when peers come back online, highlighting the\nnetwork's reliability without reliance on any single specialized node."})]})}function h(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},5248:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>r});var i=t(758);const s={},o=i.createContext(s);function a(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/4c2451ff.f0efe9c4.js b/assets/js/4c2451ff.7c62e562.js similarity index 98% rename from assets/js/4c2451ff.f0efe9c4.js rename to assets/js/4c2451ff.7c62e562.js index 59ae533c..3614a210 100644 --- a/assets/js/4c2451ff.f0efe9c4.js +++ b/assets/js/4c2451ff.7c62e562.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1420],{5578:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>a,metadata:()=>i,toc:()=>l});const i=JSON.parse('{"id":"architecture/node/runtime","title":"Runtime","description":"The runtime environment in the Calimero Network is essential for executing","source":"@site/docs/04-architecture/03-node/02-runtime.mdx","sourceDirName":"04-architecture/03-node","slug":"/architecture/node/runtime","permalink":"/architecture/node/runtime","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/04-architecture/03-node/02-runtime.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":2,"frontMatter":{"id":"runtime","title":"Runtime"},"sidebar":"tutorialSidebar","previous":{"title":"Client Node","permalink":"/architecture/node/client-node"},"next":{"title":"Server","permalink":"/architecture/node/server"}}');var s=t(6070),r=t(5248);const a={id:"runtime",title:"Runtime"},o=void 0,c={},l=[{value:"Core Capabilities",id:"core-capabilities",level:3}];function d(e){const n={h3:"h3",li:"li",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:"The runtime environment in the Calimero Network is essential for executing\ndecentralized applications (DApps). It acts as a bridge between the application\nlogic, the network, and storage layers, ensuring seamless operation and\nintegration. The runtime ensures secure, isolated, and efficient execution of\napplications by managing resources effectively, supporting real-time event\nhandling, enabling scalability, and providing robust storage and transaction\nmanagement."}),"\n",(0,s.jsx)(n.h3,{id:"core-capabilities",children:"Core Capabilities"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Security and Isolation"}),": The runtime provides a secure execution\nenvironment for Calimero applications using WebAssembly (WASM). Each\napplication is sandboxed in the WASM VM, ensuring proper isolation and\npreventing interference between applications. This setup also ensures that\napplications cannot access unauthorized resources, maintaining a secure\nenvironment."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Multi-Application Support"}),": The runtime allows multiple applications to run\nconcurrently on the same node and supports multiple instances (contexts) of\nthe same application, each with its own state. This capability enhances the\nflexibility and scalability of the network."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Scoped Storage"}),": The runtime manages storage by partitioning it and\ngoverning where each context stores its state. These implementation details\nare abstracted from the app developer, ensuring that storage management is\nhandled seamlessly and securely."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Atomic Transactions"}),": The runtime guarantees atomic transactions, ensuring\nthat if a transaction fails, it is completely rolled back with no state\nupdates or side effects detected. This guarantees consistency and reliability\nin the application's state and any connected clients."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Log Collection and Relaying Events"}),": The runtime facilitates log collection\nand relays events emitted by the applications to connected clients, enabling\nreal-time monitoring and interaction."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Resource Management"}),": The runtime defines resource limits for applications\nto ensure fair usage and prevent malicious behavior. This includes limiting\nCPU, memory, and network usage to prevent any single application from\nmonopolizing system resources or compromising the host system."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Task Management and Performance"}),": The runtime keeps track of WASM instances\nup to a defined threshold, effortlessly queueing transactions to reuse live\ninstances and shutting down stale ones to reclaim system resources. These\noptimizations ensure efficient resource utilization and improved performance."]}),"\n"]}),"\n"]})]})}function u(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},5248:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>o});var i=t(758);const s={},r=i.createContext(s);function a(e){const n=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1420],{5578:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>a,metadata:()=>i,toc:()=>l});const i=JSON.parse('{"id":"architecture/node/runtime","title":"Runtime","description":"The runtime environment in the Calimero Network is essential for executing","source":"@site/docs/04-architecture/03-node/02-runtime.mdx","sourceDirName":"04-architecture/03-node","slug":"/architecture/node/runtime","permalink":"/architecture/node/runtime","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/04-architecture/03-node/02-runtime.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":2,"frontMatter":{"id":"runtime","title":"Runtime"},"sidebar":"tutorialSidebar","previous":{"title":"Client Node","permalink":"/architecture/node/client-node"},"next":{"title":"Server","permalink":"/architecture/node/server"}}');var s=t(6070),r=t(5248);const a={id:"runtime",title:"Runtime"},o=void 0,c={},l=[{value:"Core Capabilities",id:"core-capabilities",level:3}];function d(e){const n={h3:"h3",li:"li",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:"The runtime environment in the Calimero Network is essential for executing\ndecentralized applications (DApps). It acts as a bridge between the application\nlogic, the network, and storage layers, ensuring seamless operation and\nintegration. The runtime ensures secure, isolated, and efficient execution of\napplications by managing resources effectively, supporting real-time event\nhandling, enabling scalability, and providing robust storage and transaction\nmanagement."}),"\n",(0,s.jsx)(n.h3,{id:"core-capabilities",children:"Core Capabilities"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Security and Isolation"}),": The runtime provides a secure execution\nenvironment for Calimero applications using WebAssembly (WASM). Each\napplication is sandboxed in the WASM VM, ensuring proper isolation and\npreventing interference between applications. This setup also ensures that\napplications cannot access unauthorized resources, maintaining a secure\nenvironment."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Multi-Application Support"}),": The runtime allows multiple applications to run\nconcurrently on the same node and supports multiple instances (contexts) of\nthe same application, each with its own state. This capability enhances the\nflexibility and scalability of the network."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Scoped Storage"}),": The runtime manages storage by partitioning it and\ngoverning where each context stores its state. These implementation details\nare abstracted from the app developer, ensuring that storage management is\nhandled seamlessly and securely."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Atomic Transactions"}),": The runtime guarantees atomic transactions, ensuring\nthat if a transaction fails, it is completely rolled back with no state\nupdates or side effects detected. This guarantees consistency and reliability\nin the application's state and any connected clients."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Log Collection and Relaying Events"}),": The runtime facilitates log collection\nand relays events emitted by the applications to connected clients, enabling\nreal-time monitoring and interaction."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Resource Management"}),": The runtime defines resource limits for applications\nto ensure fair usage and prevent malicious behavior. This includes limiting\nCPU, memory, and network usage to prevent any single application from\nmonopolizing system resources or compromising the host system."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Task Management and Performance"}),": The runtime keeps track of WASM instances\nup to a defined threshold, effortlessly queueing transactions to reuse live\ninstances and shutting down stale ones to reclaim system resources. These\noptimizations ensure efficient resource utilization and improved performance."]}),"\n"]}),"\n"]})]})}function u(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},5248:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>o});var i=t(758);const s={},r=i.createContext(s);function a(e){const n=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/50c4ee78.757bd39a.js b/assets/js/50c4ee78.c8e6d1ba.js similarity index 98% rename from assets/js/50c4ee78.757bd39a.js rename to assets/js/50c4ee78.c8e6d1ba.js index 17ba6908..9f0bc11a 100644 --- a/assets/js/50c4ee78.757bd39a.js +++ b/assets/js/50c4ee78.c8e6d1ba.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4594],{5108:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>r,contentTitle:()=>s,default:()=>d,frontMatter:()=>l,metadata:()=>a,toc:()=>c});const a=JSON.parse('{"id":"tutorials/install-application","title":"Install application","description":"We have created simple and easy to use example application called only-peers.","source":"@site/docs/06-tutorials/06-install-application.mdx","sourceDirName":"06-tutorials","slug":"/tutorials/install-application","permalink":"/tutorials/install-application","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/06-tutorials/06-install-application.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":6,"frontMatter":{"id":"install-application","title":"Install application"},"sidebar":"tutorialSidebar","previous":{"title":"Publish App","permalink":"/tutorials/publish-app"},"next":{"title":"Only Peers","permalink":"/tutorials/awesome-projects/only-peers"}}');var i=n(6070),o=n(5248);const l={id:"install-application",title:"Install application"},s=void 0,r={},c=[{value:"Create new context",id:"create-new-context",level:3},{value:"Try out Only-peers application",id:"try-out-only-peers-application",level:3}];function p(e){const t={a:"a",blockquote:"blockquote",code:"code",em:"em",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(t.p,{children:["We have created simple and easy to use example application called ",(0,i.jsx)(t.code,{children:"only-peers"}),".\nApplication enables writing posts and leaving comments. To try out application\nyou need to create new context where application will be installed."]}),"\n",(0,i.jsx)(t.h3,{id:"create-new-context",children:"Create new context"}),"\n",(0,i.jsx)(t.p,{children:"To create new context, node CLI has to be used. There are two possible options\nof creating new context."}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsx)(t.li,{children:"If the node already has application installed, create new context using\ncommand:"}),"\n"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",metastring:'title="Terminal"',children:"$ meroctl context create --application \n>> \n"})}),"\n",(0,i.jsxs)(t.ol,{start:"2",children:["\n",(0,i.jsx)(t.li,{children:"If application is not installed then install the application and create new\ncontext using commands:"}),"\n"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",metastring:'title="Terminal"',children:"$ meroctl app install --path /path/to/app\n>> \n$ meroctl context create --application \n>> \n"})}),"\n",(0,i.jsx)(t.p,{children:"You are now part of the context and can start using the application."}),"\n",(0,i.jsx)(t.h3,{id:"try-out-only-peers-application",children:"Try out Only-peers application"}),"\n",(0,i.jsx)(t.p,{children:"We have built and deployed a demo app so you can try it out immediately."}),"\n",(0,i.jsxs)(t.p,{children:["Navigate to ",(0,i.jsx)(t.a,{href:"https://calimero-network.github.io/only-peers-client/",children:"https://calimero-network.github.io/only-peers-client/"})," to access app\nfrontend."]}),"\n",(0,i.jsxs)(t.p,{children:["You will be asked to setup the app by the adding the node url. It is the same\nurl you used while starting the node in\n",(0,i.jsx)(t.a,{href:"../getting-started/setup",children:"Getting-started"})," ",(0,i.jsx)(t.code,{children:"http://localhost:NODE_PORT"})," After\nsetting up node url, you will be asked to login."]}),"\n",(0,i.jsxs)(t.blockquote,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:(0,i.jsx)(t.em,{children:"NOTE:"})})," Use your wallet which you have already added as root key in\n",(0,i.jsx)(t.a,{href:"../developer-tools/apps/admin-dashboard",children:"Admin Dashboard"})]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"You are now ready to use the app. Enjoy!"})]})}function d(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(p,{...e})}):p(e)}},5248:(e,t,n)=>{n.d(t,{R:()=>l,x:()=>s});var a=n(758);const i={},o=a.createContext(i);function l(e){const t=a.useContext(o);return a.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),a.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4594],{5108:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>r,contentTitle:()=>s,default:()=>d,frontMatter:()=>l,metadata:()=>a,toc:()=>c});const a=JSON.parse('{"id":"tutorials/install-application","title":"Install application","description":"We have created simple and easy to use example application called only-peers.","source":"@site/docs/06-tutorials/06-install-application.mdx","sourceDirName":"06-tutorials","slug":"/tutorials/install-application","permalink":"/tutorials/install-application","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/06-tutorials/06-install-application.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":6,"frontMatter":{"id":"install-application","title":"Install application"},"sidebar":"tutorialSidebar","previous":{"title":"Publish App","permalink":"/tutorials/publish-app"},"next":{"title":"Only Peers","permalink":"/tutorials/awesome-projects/only-peers"}}');var i=n(6070),o=n(5248);const l={id:"install-application",title:"Install application"},s=void 0,r={},c=[{value:"Create new context",id:"create-new-context",level:3},{value:"Try out Only-peers application",id:"try-out-only-peers-application",level:3}];function p(e){const t={a:"a",blockquote:"blockquote",code:"code",em:"em",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(t.p,{children:["We have created simple and easy to use example application called ",(0,i.jsx)(t.code,{children:"only-peers"}),".\nApplication enables writing posts and leaving comments. To try out application\nyou need to create new context where application will be installed."]}),"\n",(0,i.jsx)(t.h3,{id:"create-new-context",children:"Create new context"}),"\n",(0,i.jsx)(t.p,{children:"To create new context, node CLI has to be used. There are two possible options\nof creating new context."}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsx)(t.li,{children:"If the node already has application installed, create new context using\ncommand:"}),"\n"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",metastring:'title="Terminal"',children:"$ meroctl context create --application \n>> \n"})}),"\n",(0,i.jsxs)(t.ol,{start:"2",children:["\n",(0,i.jsx)(t.li,{children:"If application is not installed then install the application and create new\ncontext using commands:"}),"\n"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",metastring:'title="Terminal"',children:"$ meroctl app install --path /path/to/app\n>> \n$ meroctl context create --application \n>> \n"})}),"\n",(0,i.jsx)(t.p,{children:"You are now part of the context and can start using the application."}),"\n",(0,i.jsx)(t.h3,{id:"try-out-only-peers-application",children:"Try out Only-peers application"}),"\n",(0,i.jsx)(t.p,{children:"We have built and deployed a demo app so you can try it out immediately."}),"\n",(0,i.jsxs)(t.p,{children:["Navigate to ",(0,i.jsx)(t.a,{href:"https://calimero-network.github.io/only-peers-client/",children:"https://calimero-network.github.io/only-peers-client/"})," to access app\nfrontend."]}),"\n",(0,i.jsxs)(t.p,{children:["You will be asked to setup the app by the adding the node url. It is the same\nurl you used while starting the node in\n",(0,i.jsx)(t.a,{href:"../getting-started/setup",children:"Getting-started"})," ",(0,i.jsx)(t.code,{children:"http://localhost:NODE_PORT"})," After\nsetting up node url, you will be asked to login."]}),"\n",(0,i.jsxs)(t.blockquote,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:(0,i.jsx)(t.em,{children:"NOTE:"})})," Use your wallet which you have already added as root key in\n",(0,i.jsx)(t.a,{href:"../developer-tools/apps/admin-dashboard",children:"Admin Dashboard"})]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"You are now ready to use the app. Enjoy!"})]})}function d(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(p,{...e})}):p(e)}},5248:(e,t,n)=>{n.d(t,{R:()=>l,x:()=>s});var a=n(758);const i={},o=a.createContext(i);function l(e){const t=a.useContext(o);return a.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),a.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/52c33f34.d7c0182e.js b/assets/js/52c33f34.d7c0182e.js deleted file mode 100644 index 1495dd08..00000000 --- a/assets/js/52c33f34.d7c0182e.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8282,8934],{8096:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>d,contentTitle:()=>a,default:()=>u,frontMatter:()=>i,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"developer-tools/CLI/merod","title":"Merod","description":"Merod is a command-line tool that allows you to initialize, configure and run Calimero nodes.","source":"@site/docs/05-developer-tools/01-CLI/01-merod.mdx","sourceDirName":"05-developer-tools/01-CLI","slug":"/developer-tools/CLI/merod","permalink":"/developer-tools/CLI/merod","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/05-developer-tools/01-CLI/01-merod.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":1,"frontMatter":{"id":"merod","title":"Merod"},"sidebar":"tutorialSidebar","previous":{"title":"Developer Tools","permalink":"/developer-tools/overview"},"next":{"title":"Meroctl","permalink":"/developer-tools/CLI/meroctl"}}');var s=r(6070),l=r(5248),o=r(1531);const i={id:"merod",title:"Merod"},a=void 0,d={},c=[...o.toc,{value:"Usage",id:"usage",level:2},{value:"Commands:",id:"commands",level:3},{value:"Options:",id:"options",level:3},{value:"Examples:",id:"examples",level:3}];function h(e){const n={admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,l.R)(),...e.components},{Details:r}=n;return r||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:"Merod is a command-line tool that allows you to initialize, configure and run Calimero nodes."}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"Installation"}),(0,s.jsx)("p",{children:(0,s.jsx)(o.default,{})})]}),"\n",(0,s.jsx)(n.h2,{id:"usage",children:"Usage"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"merod [OPTIONS] --node-name \n"})}),"\n",(0,s.jsx)(n.h3,{id:"commands",children:"Commands:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"config"})," Configure the node"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"init"})," Initialize node configuration"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"run"})," Run a node"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"relay"})," Relay incoming requests to specific location"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"help"})," Print this message or the help of the given subcommand(s)"]}),"\n"]}),"\n",(0,s.jsxs)(n.admonition,{type:"tip",children:[(0,s.jsx)(n.p,{children:"Run help to get more information about the available options and commands."}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"merod --help\n"})})]}),"\n",(0,s.jsx)(n.h3,{id:"options",children:"Options:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"--home "})," Directory for config and data"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"-n"}),", ",(0,s.jsx)(n.code,{children:"--node-name "})," Name of node"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"-h"}),", ",(0,s.jsx)(n.code,{children:"--help"})," Print help"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"-V"}),", ",(0,s.jsx)(n.code,{children:"--version"})," Print version"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["Default location of the config and data directory is ",(0,s.jsx)(n.code,{children:"~/.calimero"}),". You can\nchange the location by using the ",(0,s.jsx)(n.code,{children:"--home"})," option."]})}),"\n",(0,s.jsx)(n.h3,{id:"examples",children:"Examples:"}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:(0,s.jsx)(n.strong,{children:"Command"})}),(0,s.jsx)(n.th,{children:(0,s.jsx)(n.strong,{children:"Description"})})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"merod --node-name node1 init"})}),(0,s.jsx)(n.td,{children:"Initialize a node with default settings. (server-port = 2428 and swarm-port = 2528`)"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"merod --node-name node1 init --server-port 2429 --swarm-port 2529"})}),(0,s.jsx)(n.td,{children:"Initialize a node with custom ports."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"mkdir data && merod --home data/ --node-name node1 init"})}),(0,s.jsx)(n.td,{children:"Initialize a node with a custom home directory."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"merod --node-name node1 config --server-host 143.34.182.202 --server-port 3000"})}),(0,s.jsx)(n.td,{children:"Configure an existing node with a specific server host and port."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"merod --node-name node1 run"})}),(0,s.jsx)(n.td,{children:"Run a node."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"merod --node-name node2 relay --listen 127.0.0.1:3333"})}),(0,s.jsx)(n.td,{children:"Relay incoming requests to a specific location."})]})]})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{})})]})}function u(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},1531:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>c,contentTitle:()=>d,default:()=>m,frontMatter:()=>a,metadata:()=>t,toc:()=>h});const t=JSON.parse('{"id":"shared/install-merod","title":"install-merod","description":"You can choose to install merod using either the installation script or","source":"@site/docs/shared/install-merod.mdx","sourceDirName":"shared","slug":"/shared/install-merod","permalink":"/shared/install-merod","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/shared/install-merod.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"install-meroctl","permalink":"/shared/install-meroctl"}}');var s=r(6070),l=r(5248),o=r(3505),i=r(7576);const a={},d=void 0,c={},h=[{value:"Steps",id:"steps",level:4},{value:"Steps",id:"steps-1",level:4},{value:"Notes for Shell Environments",id:"notes-for-shell-environments",level:4}];function u(e){const n={code:"code",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,l.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["You can choose to install ",(0,s.jsx)(n.code,{children:"merod"})," using either the installation script or\nHomebrew."]}),"\n","\n",(0,s.jsxs)(o.A,{defaultValue:"homebrew",values:[{label:"Homebrew",value:"homebrew"},{label:"Installation Script",value:"script"}],children:[(0,s.jsxs)(i.A,{value:"homebrew",children:[(0,s.jsxs)(n.p,{children:["If you use Homebrew, you can install ",(0,s.jsx)(n.code,{children:"merod"})," directly with the following\nsteps:"]}),(0,s.jsx)(n.h4,{id:"steps",children:"Steps"}),(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Add the Calimero Homebrew tap:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"brew tap calimero-network/homebrew-tap\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Install ",(0,s.jsx)(n.code,{children:"merod"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"brew install merod\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Verify the installation:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"merod --version\n"})}),"\n"]}),"\n"]}),(0,s.jsx)(n.p,{children:"If the version number appears, the installation was successful."})]}),(0,s.jsxs)(i.A,{value:"script",children:[(0,s.jsx)(n.p,{children:"The installation script supports multiple terminal environments and will\nautomatically configure your PATH based on your shell."}),(0,s.jsx)(n.h4,{id:"steps-1",children:"Steps"}),(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Open your terminal and run:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"curl -sSf https://raw.githubusercontent.com/calimero-network/core/master/scripts/install-merod.sh | bash\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Source the updated PATH:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"source \n"})}),"\n",(0,s.jsxs)(n.p,{children:["Replace ",(0,s.jsx)(n.code,{children:""})," with ",(0,s.jsx)(n.code,{children:".bashrc"}),", ",(0,s.jsx)(n.code,{children:".zshrc"}),", or the relevant\nconfiguration file for your shell."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Verify the installation:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"merod --version\n"})}),"\n"]}),"\n"]}),(0,s.jsx)(n.p,{children:"If the version number appears, the installation was successful."}),(0,s.jsx)(n.h4,{id:"notes-for-shell-environments",children:"Notes for Shell Environments"}),(0,s.jsx)(n.p,{children:"The script automatically updates your PATH based on your shell configuration:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Bash"}),": Updates ",(0,s.jsx)(n.code,{children:".bashrc"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Zsh"}),": Updates ",(0,s.jsx)(n.code,{children:".zshrc"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Fish"}),": Modifies ",(0,s.jsx)(n.code,{children:"~/.config/fish/config.fish"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Csh/Tcsh"}),": Updates ",(0,s.jsx)(n.code,{children:".cshrc"}),"."]}),"\n"]}),(0,s.jsxs)(n.p,{children:["To apply the changes immediately, use the ",(0,s.jsx)(n.code,{children:"source"})," command as described in step\n2 above."]})]})]})]})}function m(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(u,{...e})}):u(e)}},7576:(e,n,r)=>{r.d(n,{A:()=>o});r(758);var t=r(3526);const s={tabItem:"tabItem_KLga"};var l=r(6070);function o(e){let{children:n,hidden:r,className:o}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,t.A)(s.tabItem,o),hidden:r,children:n})}},3505:(e,n,r)=>{r.d(n,{A:()=>w});var t=r(758),s=r(3526),l=r(8155),o=r(5557),i=r(5536),a=r(7852),d=r(1381),c=r(4012);function h(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function u(e){const{values:n,children:r}=e;return(0,t.useMemo)((()=>{const e=n??function(e){return h(e).map((e=>{let{props:{value:n,label:r,attributes:t,default:s}}=e;return{value:n,label:r,attributes:t,default:s}}))}(r);return function(e){const n=(0,d.XI)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,r])}function m(e){let{value:n,tabValues:r}=e;return r.some((e=>e.value===n))}function p(e){let{queryString:n=!1,groupId:r}=e;const s=(0,o.W6)(),l=function(e){let{queryString:n=!1,groupId:r}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:n,groupId:r});return[(0,a.aZ)(l),(0,t.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(s.location.search);n.set(l,e),s.replace({...s.location,search:n.toString()})}),[l,s])]}function x(e){const{defaultValue:n,queryString:r=!1,groupId:s}=e,l=u(e),[o,a]=(0,t.useState)((()=>function(e){let{defaultValue:n,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!m({value:n,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const t=r.find((e=>e.default))??r[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:l}))),[d,h]=p({queryString:r,groupId:s}),[x,j]=function(e){let{groupId:n}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(n),[s,l]=(0,c.Dv)(r);return[s,(0,t.useCallback)((e=>{r&&l.set(e)}),[r,l])]}({groupId:s}),f=(()=>{const e=d??x;return m({value:e,tabValues:l})?e:null})();(0,i.A)((()=>{f&&a(f)}),[f]);return{selectedValue:o,selectValue:(0,t.useCallback)((e=>{if(!m({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);a(e),h(e),j(e)}),[h,j,l]),tabValues:l}}var j=r(2236);const f={tabList:"tabList_B3_y",tabItem:"tabItem_z210"};var b=r(6070);function v(e){let{className:n,block:r,selectedValue:t,selectValue:o,tabValues:i}=e;const a=[],{blockElementScrollPositionUntilNextRender:d}=(0,l.a_)(),c=e=>{const n=e.currentTarget,r=a.indexOf(n),s=i[r].value;s!==t&&(d(n),o(s))},h=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const r=a.indexOf(e.currentTarget)+1;n=a[r]??a[0];break}case"ArrowLeft":{const r=a.indexOf(e.currentTarget)-1;n=a[r]??a[a.length-1];break}}n?.focus()};return(0,b.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":r},n),children:i.map((e=>{let{value:n,label:r,attributes:l}=e;return(0,b.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>a.push(e),onKeyDown:h,onClick:c,...l,className:(0,s.A)("tabs__item",f.tabItem,l?.className,{"tabs__item--active":t===n}),children:r??n},n)}))})}function g(e){let{lazy:n,children:r,selectedValue:l}=e;const o=(Array.isArray(r)?r:[r]).filter(Boolean);if(n){const e=o.find((e=>e.props.value===l));return e?(0,t.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,b.jsx)("div",{className:"margin-top--md",children:o.map(((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==l})))})}function y(e){const n=x(e);return(0,b.jsxs)("div",{className:(0,s.A)("tabs-container",f.tabList),children:[(0,b.jsx)(v,{...n,...e}),(0,b.jsx)(g,{...n,...e})]})}function w(e){const n=(0,j.A)();return(0,b.jsx)(y,{...e,children:h(e.children)},String(n))}},5248:(e,n,r)=>{r.d(n,{R:()=>o,x:()=>i});var t=r(758);const s={},l=t.createContext(s);function o(e){const n=t.useContext(l);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/52c33f34.f8430b99.js b/assets/js/52c33f34.f8430b99.js new file mode 100644 index 00000000..91a94de6 --- /dev/null +++ b/assets/js/52c33f34.f8430b99.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8282,8934],{8096:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>d,contentTitle:()=>a,default:()=>u,frontMatter:()=>o,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"developer-tools/CLI/merod","title":"Merod","description":"Merod is a command-line tool that allows you to initialize, configure and run","source":"@site/docs/05-developer-tools/01-CLI/01-merod.mdx","sourceDirName":"05-developer-tools/01-CLI","slug":"/developer-tools/CLI/merod","permalink":"/developer-tools/CLI/merod","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/05-developer-tools/01-CLI/01-merod.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":1,"frontMatter":{"id":"merod","title":"Merod"},"sidebar":"tutorialSidebar","previous":{"title":"Developer Tools","permalink":"/developer-tools/overview"},"next":{"title":"Meroctl","permalink":"/developer-tools/CLI/meroctl"}}');var s=r(6070),l=r(5248),i=r(1531);const o={id:"merod",title:"Merod"},a=void 0,d={},c=[...i.toc,{value:"Usage",id:"usage",level:2},{value:"Commands:",id:"commands",level:3},{value:"Options:",id:"options",level:3},{value:"Examples:",id:"examples",level:3}];function h(e){const n={admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,l.R)(),...e.components},{Details:r}=n;return r||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:"Merod is a command-line tool that allows you to initialize, configure and run\nCalimero nodes."}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"Installation"}),(0,s.jsx)("p",{children:(0,s.jsx)(i.default,{})})]}),"\n",(0,s.jsx)(n.h2,{id:"usage",children:"Usage"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"merod [OPTIONS] --node-name \n"})}),"\n",(0,s.jsx)(n.h3,{id:"commands",children:"Commands:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"config"})," Configure the node"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"init"})," Initialize node configuration"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"run"})," Run a node"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"relay"})," Relay incoming requests to specific location"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"help"})," Print this message or the help of the given subcommand(s)"]}),"\n"]}),"\n",(0,s.jsxs)(n.admonition,{type:"tip",children:[(0,s.jsx)(n.p,{children:"Run help to get more information about the available options and commands."}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"merod --help\n"})})]}),"\n",(0,s.jsx)(n.h3,{id:"options",children:"Options:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"--home "})," Directory for config and data"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"-n"}),", ",(0,s.jsx)(n.code,{children:"--node-name "})," Name of node"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"-h"}),", ",(0,s.jsx)(n.code,{children:"--help"})," Print help"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"-V"}),", ",(0,s.jsx)(n.code,{children:"--version"})," Print version"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["Default location of the config and data directory is ",(0,s.jsx)(n.code,{children:"~/.calimero"}),". You can\nchange the location by using the ",(0,s.jsx)(n.code,{children:"--home"})," option."]})}),"\n",(0,s.jsx)(n.h3,{id:"examples",children:"Examples:"}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:(0,s.jsx)(n.strong,{children:"Command"})}),(0,s.jsx)(n.th,{children:(0,s.jsx)(n.strong,{children:"Description"})})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"merod --node-name node1 init"})}),(0,s.jsx)(n.td,{children:"Initialize a node with default settings. (server-port = 2428 and swarm-port = 2528`)"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"merod --node-name node1 init --server-port 2429 --swarm-port 2529"})}),(0,s.jsx)(n.td,{children:"Initialize a node with custom ports."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"mkdir data && merod --home data/ --node-name node1 init"})}),(0,s.jsx)(n.td,{children:"Initialize a node with a custom home directory."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"merod --node-name node1 config --server-host 143.34.182.202 --server-port 3000"})}),(0,s.jsx)(n.td,{children:"Configure an existing node with a specific server host and port."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"merod --node-name node1 run"})}),(0,s.jsx)(n.td,{children:"Run a node."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"merod --node-name node2 relay --listen 127.0.0.1:3333"})}),(0,s.jsx)(n.td,{children:"Relay incoming requests to a specific location."})]})]})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{})})]})}function u(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},1531:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>c,contentTitle:()=>d,default:()=>m,frontMatter:()=>a,metadata:()=>t,toc:()=>h});const t=JSON.parse('{"id":"shared/install-merod","title":"install-merod","description":"You can choose to install merod using either the installation script or","source":"@site/docs/shared/install-merod.mdx","sourceDirName":"shared","slug":"/shared/install-merod","permalink":"/shared/install-merod","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/shared/install-merod.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"install-meroctl","permalink":"/shared/install-meroctl"},"next":{"title":"node-init-binary","permalink":"/shared/node-init-binary"}}');var s=r(6070),l=r(5248),i=r(3505),o=r(7576);const a={},d=void 0,c={},h=[{value:"Steps",id:"steps",level:4},{value:"Steps",id:"steps-1",level:4},{value:"Notes for Shell Environments",id:"notes-for-shell-environments",level:4}];function u(e){const n={code:"code",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,l.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["You can choose to install ",(0,s.jsx)(n.code,{children:"merod"})," using either the installation script or\nHomebrew."]}),"\n","\n",(0,s.jsxs)(i.A,{defaultValue:"homebrew",values:[{label:"Homebrew",value:"homebrew"},{label:"Installation Script",value:"script"}],children:[(0,s.jsxs)(o.A,{value:"homebrew",children:[(0,s.jsxs)(n.p,{children:["If you use Homebrew, you can install ",(0,s.jsx)(n.code,{children:"merod"})," directly with the following\nsteps:"]}),(0,s.jsx)(n.h4,{id:"steps",children:"Steps"}),(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Add the Calimero Homebrew tap:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"brew tap calimero-network/homebrew-tap\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Install ",(0,s.jsx)(n.code,{children:"merod"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"brew install merod\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Verify the installation:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"merod --version\n"})}),"\n"]}),"\n"]}),(0,s.jsx)(n.p,{children:"If the version number appears, the installation was successful."})]}),(0,s.jsxs)(o.A,{value:"script",children:[(0,s.jsx)(n.p,{children:"The installation script supports multiple terminal environments and will\nautomatically configure your PATH based on your shell."}),(0,s.jsx)(n.h4,{id:"steps-1",children:"Steps"}),(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Open your terminal and run:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"curl -sSf https://raw.githubusercontent.com/calimero-network/core/master/scripts/install-merod.sh | bash\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Source the updated PATH:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"source \n"})}),"\n",(0,s.jsxs)(n.p,{children:["Replace ",(0,s.jsx)(n.code,{children:""})," with ",(0,s.jsx)(n.code,{children:".bashrc"}),", ",(0,s.jsx)(n.code,{children:".zshrc"}),", or the relevant\nconfiguration file for your shell."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Verify the installation:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"merod --version\n"})}),"\n"]}),"\n"]}),(0,s.jsx)(n.p,{children:"If the version number appears, the installation was successful."}),(0,s.jsx)(n.h4,{id:"notes-for-shell-environments",children:"Notes for Shell Environments"}),(0,s.jsx)(n.p,{children:"The script automatically updates your PATH based on your shell configuration:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Bash"}),": Updates ",(0,s.jsx)(n.code,{children:".bashrc"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Zsh"}),": Updates ",(0,s.jsx)(n.code,{children:".zshrc"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Fish"}),": Modifies ",(0,s.jsx)(n.code,{children:"~/.config/fish/config.fish"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Csh/Tcsh"}),": Updates ",(0,s.jsx)(n.code,{children:".cshrc"}),"."]}),"\n"]}),(0,s.jsxs)(n.p,{children:["To apply the changes immediately, use the ",(0,s.jsx)(n.code,{children:"source"})," command as described in step\n2 above."]})]})]})]})}function m(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(u,{...e})}):u(e)}},7576:(e,n,r)=>{r.d(n,{A:()=>i});r(758);var t=r(3526);const s={tabItem:"tabItem_KLga"};var l=r(6070);function i(e){let{children:n,hidden:r,className:i}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,t.A)(s.tabItem,i),hidden:r,children:n})}},3505:(e,n,r)=>{r.d(n,{A:()=>w});var t=r(758),s=r(3526),l=r(8155),i=r(5557),o=r(5536),a=r(7852),d=r(1381),c=r(4012);function h(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function u(e){const{values:n,children:r}=e;return(0,t.useMemo)((()=>{const e=n??function(e){return h(e).map((e=>{let{props:{value:n,label:r,attributes:t,default:s}}=e;return{value:n,label:r,attributes:t,default:s}}))}(r);return function(e){const n=(0,d.XI)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,r])}function m(e){let{value:n,tabValues:r}=e;return r.some((e=>e.value===n))}function p(e){let{queryString:n=!1,groupId:r}=e;const s=(0,i.W6)(),l=function(e){let{queryString:n=!1,groupId:r}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:n,groupId:r});return[(0,a.aZ)(l),(0,t.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(s.location.search);n.set(l,e),s.replace({...s.location,search:n.toString()})}),[l,s])]}function x(e){const{defaultValue:n,queryString:r=!1,groupId:s}=e,l=u(e),[i,a]=(0,t.useState)((()=>function(e){let{defaultValue:n,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!m({value:n,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const t=r.find((e=>e.default))??r[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:l}))),[d,h]=p({queryString:r,groupId:s}),[x,j]=function(e){let{groupId:n}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(n),[s,l]=(0,c.Dv)(r);return[s,(0,t.useCallback)((e=>{r&&l.set(e)}),[r,l])]}({groupId:s}),f=(()=>{const e=d??x;return m({value:e,tabValues:l})?e:null})();(0,o.A)((()=>{f&&a(f)}),[f]);return{selectedValue:i,selectValue:(0,t.useCallback)((e=>{if(!m({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);a(e),h(e),j(e)}),[h,j,l]),tabValues:l}}var j=r(2236);const f={tabList:"tabList_B3_y",tabItem:"tabItem_z210"};var b=r(6070);function v(e){let{className:n,block:r,selectedValue:t,selectValue:i,tabValues:o}=e;const a=[],{blockElementScrollPositionUntilNextRender:d}=(0,l.a_)(),c=e=>{const n=e.currentTarget,r=a.indexOf(n),s=o[r].value;s!==t&&(d(n),i(s))},h=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const r=a.indexOf(e.currentTarget)+1;n=a[r]??a[0];break}case"ArrowLeft":{const r=a.indexOf(e.currentTarget)-1;n=a[r]??a[a.length-1];break}}n?.focus()};return(0,b.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":r},n),children:o.map((e=>{let{value:n,label:r,attributes:l}=e;return(0,b.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>a.push(e),onKeyDown:h,onClick:c,...l,className:(0,s.A)("tabs__item",f.tabItem,l?.className,{"tabs__item--active":t===n}),children:r??n},n)}))})}function g(e){let{lazy:n,children:r,selectedValue:l}=e;const i=(Array.isArray(r)?r:[r]).filter(Boolean);if(n){const e=i.find((e=>e.props.value===l));return e?(0,t.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,b.jsx)("div",{className:"margin-top--md",children:i.map(((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==l})))})}function y(e){const n=x(e);return(0,b.jsxs)("div",{className:(0,s.A)("tabs-container",f.tabList),children:[(0,b.jsx)(v,{...n,...e}),(0,b.jsx)(g,{...n,...e})]})}function w(e){const n=(0,j.A)();return(0,b.jsx)(y,{...e,children:h(e.children)},String(n))}},5248:(e,n,r)=>{r.d(n,{R:()=>i,x:()=>o});var t=r(758);const s={},l=t.createContext(s);function i(e){const n=t.useContext(l);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/5ccd261d.29d5e7ad.js b/assets/js/5ccd261d.29d5e7ad.js deleted file mode 100644 index 22e70965..00000000 --- a/assets/js/5ccd261d.29d5e7ad.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3001],{9631:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>d,frontMatter:()=>s,metadata:()=>r,toc:()=>u});const r=JSON.parse('{"id":"tutorials/overview","title":"Tutorials","description":"Welcome to the Tutorials section of the Calimero Network documentation! Here,","source":"@site/docs/06-tutorials/00-overview.mdx","sourceDirName":"06-tutorials","slug":"/tutorials/overview","permalink":"/tutorials/overview","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/06-tutorials/00-overview.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":0,"frontMatter":{"id":"overview","title":"Tutorials"},"sidebar":"tutorialSidebar","previous":{"title":"Tests","permalink":"/developer-tools/tests"},"next":{"title":"Near Wallet","permalink":"/tutorials/login-with-wallets/near-wallet"}}');var n=o(6070),i=o(5248);const s={id:"overview",title:"Tutorials"},a=void 0,l={},u=[];function c(e){const t={p:"p",...(0,i.R)(),...e.components};return(0,n.jsx)(t.p,{children:"Welcome to the Tutorials section of the Calimero Network documentation! Here,\nyou\u2019ll find step-by-step guides to help you build, deploy, and integrate\napplications using Calimero's features. Whether you're a beginner setting up\nyour first environment or an experienced developer exploring advanced use cases,\nthese tutorials are designed to provide practical insights and hands-on\nexperience. Let's get started!"})}function d(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(c,{...e})}):c(e)}},5248:(e,t,o)=>{o.d(t,{R:()=>s,x:()=>a});var r=o(758);const n={},i=r.createContext(n);function s(e){const t=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:s(e.components),r.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/5ccd261d.322aeb5e.js b/assets/js/5ccd261d.322aeb5e.js new file mode 100644 index 00000000..199e1d55 --- /dev/null +++ b/assets/js/5ccd261d.322aeb5e.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3001],{9631:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>d,frontMatter:()=>s,metadata:()=>r,toc:()=>c});const r=JSON.parse('{"id":"tutorials/overview","title":"Overview","description":"Welcome to the Tutorials section of the Calimero Network documentation! Here,","source":"@site/docs/06-tutorials/00-overview.mdx","sourceDirName":"06-tutorials","slug":"/tutorials/overview","permalink":"/tutorials/overview","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/06-tutorials/00-overview.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":0,"frontMatter":{"id":"overview","title":"Overview"},"sidebar":"tutorialSidebar","previous":{"title":"Tests","permalink":"/developer-tools/tests"},"next":{"title":"Near Wallet","permalink":"/tutorials/login-with-wallets/near-wallet"}}');var n=o(6070),i=o(5248);const s={id:"overview",title:"Overview"},a=void 0,l={},c=[];function u(e){const t={p:"p",...(0,i.R)(),...e.components};return(0,n.jsx)(t.p,{children:"Welcome to the Tutorials section of the Calimero Network documentation! Here,\nyou\u2019ll find step-by-step guides to help you build, deploy, and integrate\napplications using Calimero's features. Whether you're a beginner setting up\nyour first environment or an experienced developer exploring advanced use cases,\nthese tutorials are designed to provide practical insights and hands-on\nexperience. Let's get started!"})}function d(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(u,{...e})}):u(e)}},5248:(e,t,o)=>{o.d(t,{R:()=>s,x:()=>a});var r=o(758);const n={},i=r.createContext(n);function s(e){const t=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:s(e.components),r.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/63333f6c.211ed62b.js b/assets/js/63333f6c.211ed62b.js deleted file mode 100644 index f1b49c7d..00000000 --- a/assets/js/63333f6c.211ed62b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3574],{1652:(t,e,n)=>{n.r(e),n.d(e,{assets:()=>i,contentTitle:()=>s,default:()=>p,frontMatter:()=>a,metadata:()=>o,toc:()=>l});const o=JSON.parse('{"id":"core-concepts/blockchains-integration/proxy-contract","title":"Proxy Contract","description":"Proxy Contract is used to enable users to do actions on the blockchain. Proxy","source":"@site/docs/03-core-concepts/06-blockchains-integration/03-proxy-contract.mdx","sourceDirName":"03-core-concepts/06-blockchains-integration","slug":"/core-concepts/blockchains-integration/proxy-contract","permalink":"/core-concepts/blockchains-integration/proxy-contract","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/03-core-concepts/06-blockchains-integration/03-proxy-contract.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":3,"frontMatter":{"id":"proxy-contract","title":"Proxy Contract"},"sidebar":"tutorialSidebar","previous":{"title":"Context Contract","permalink":"/core-concepts/blockchains-integration/context-contract"},"next":{"title":"Proxy Contract Interaction Guide","permalink":"/core-concepts/blockchains-integration/proxy-contract-interaction"}}');var c=n(6070),r=n(5248);const a={id:"proxy-contract",title:"Proxy Contract"},s="Proxy Contract",i={},l=[{value:"Setup",id:"setup",level:2}];function d(t){const e={a:"a",h1:"h1",h2:"h2",header:"header",p:"p",strong:"strong",...(0,r.R)(),...t.components};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(e.header,{children:(0,c.jsx)(e.h1,{id:"proxy-contract",children:"Proxy Contract"})}),"\n",(0,c.jsx)(e.p,{children:"Proxy Contract is used to enable users to do actions on the blockchain. Proxy\nContract is deployed during the context creation."}),"\n",(0,c.jsxs)(e.p,{children:[(0,c.jsx)(e.strong,{children:"Note"}),": Proxy Contract is deployed on the same blockchain as the Context\nContract. ",(0,c.jsx)(e.strong,{children:"Note"}),": Users are responsible for funding the Proxy Contract."]}),"\n",(0,c.jsx)(e.h2,{id:"setup",children:"Setup"}),"\n",(0,c.jsxs)(e.p,{children:["Since Proxy Contract is deployed during the context creation, user needs to\ncreate a context. Please follow the ",(0,c.jsx)(e.a,{href:"./context-contract#setup",children:"Setup"})," section to\nlearn how create install the demo application and create the context."]}),"\n",(0,c.jsx)(e.p,{children:"After the context is created, user needs to connect with Application frontend to\nthe node. After connection is established, user can start interacting with the\nProxy Contract."}),"\n",(0,c.jsx)(e.p,{children:"Demo application enables user to create proposals and vote on them. Application\nshowcases all the actions that can be done on the Proxy Contract."})]})}function p(t={}){const{wrapper:e}={...(0,r.R)(),...t.components};return e?(0,c.jsx)(e,{...t,children:(0,c.jsx)(d,{...t})}):d(t)}},5248:(t,e,n)=>{n.d(e,{R:()=>a,x:()=>s});var o=n(758);const c={},r=o.createContext(c);function a(t){const e=o.useContext(r);return o.useMemo((function(){return"function"==typeof t?t(e):{...e,...t}}),[e,t])}function s(t){let e;return e=t.disableParentContext?"function"==typeof t.components?t.components(c):t.components||c:a(t.components),o.createElement(r.Provider,{value:e},t.children)}}}]); \ No newline at end of file diff --git a/assets/js/6c1330ae.31266d3e.js b/assets/js/6c1330ae.31266d3e.js new file mode 100644 index 00000000..a267c5d3 --- /dev/null +++ b/assets/js/6c1330ae.31266d3e.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8493],{6846:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>c,default:()=>h,frontMatter:()=>i,metadata:()=>r,toc:()=>d});const r=JSON.parse('{"id":"shared/node-init-binary","title":"node-init-binary","description":"{n.d(t,{A:()=>o});n(758);var r=n(3526);const a={tabItem:"tabItem_KLga"};var s=n(6070);function o(e){let{children:t,hidden:n,className:o}=e;return(0,s.jsx)("div",{role:"tabpanel",className:(0,r.A)(a.tabItem,o),hidden:n,children:t})}},3505:(e,t,n)=>{n.d(t,{A:()=>A});var r=n(758),a=n(3526),s=n(8155),o=n(5557),l=n(5536),i=n(7852),c=n(1381),u=n(4012);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:a}}=e;return{value:t,label:n,attributes:r,default:a}}))}(n);return function(e){const t=(0,c.XI)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function h(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function m(e){let{queryString:t=!1,groupId:n}=e;const a=(0,o.W6)(),s=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,i.aZ)(s),(0,r.useCallback)((e=>{if(!s)return;const t=new URLSearchParams(a.location.search);t.set(s,e),a.replace({...a.location,search:t.toString()})}),[s,a])]}function f(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,s=p(e),[o,i]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!h({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:s}))),[c,d]=m({queryString:n,groupId:a}),[f,b]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,s]=(0,u.Dv)(n);return[a,(0,r.useCallback)((e=>{n&&s.set(e)}),[n,s])]}({groupId:a}),g=(()=>{const e=c??f;return h({value:e,tabValues:s})?e:null})();(0,l.A)((()=>{g&&i(g)}),[g]);return{selectedValue:o,selectValue:(0,r.useCallback)((e=>{if(!h({value:e,tabValues:s}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),b(e)}),[d,b,s]),tabValues:s}}var b=n(2236);const g={tabList:"tabList_B3_y",tabItem:"tabItem_z210"};var v=n(6070);function x(e){let{className:t,block:n,selectedValue:r,selectValue:o,tabValues:l}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,s.a_)(),u=e=>{const t=e.currentTarget,n=i.indexOf(t),a=l[n].value;a!==r&&(c(t),o(a))},d=e=>{let t=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const n=i.indexOf(e.currentTarget)+1;t=i[n]??i[0];break}case"ArrowLeft":{const n=i.indexOf(e.currentTarget)-1;t=i[n]??i[i.length-1];break}}t?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":n},t),children:l.map((e=>{let{value:t,label:n,attributes:s}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>i.push(e),onKeyDown:d,onClick:u,...s,className:(0,a.A)("tabs__item",g.tabItem,s?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function j(e){let{lazy:t,children:n,selectedValue:s}=e;const o=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=o.find((e=>e.props.value===s));return e?(0,r.cloneElement)(e,{className:(0,a.A)("margin-top--md",e.props.className)}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:o.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==s})))})}function y(e){const t=f(e);return(0,v.jsxs)("div",{className:(0,a.A)("tabs-container",g.tabList),children:[(0,v.jsx)(x,{...t,...e}),(0,v.jsx)(j,{...t,...e})]})}function A(e){const t=(0,b.A)();return(0,v.jsx)(y,{...e,children:d(e.children)},String(t))}},5383:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/icp-config-ceda025dead6d3c8de0513840466dd31.png"},391:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/near-config-7f7de7e5e857b8d6dca8bda6b8a39f0d.png"},2524:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/sn-config-a1900f2dc94f3dcd2cd7204c62421de2.png"},5248:(e,t,n)=>{n.d(t,{R:()=>o,x:()=>l});var r=n(758);const a={},s=r.createContext(a);function o(e){const t=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:o(e.components),r.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/6e6ab436.64889ba9.js b/assets/js/6e6ab436.64889ba9.js deleted file mode 100644 index d91720e9..00000000 --- a/assets/js/6e6ab436.64889ba9.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8934],{1531:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>u,contentTitle:()=>c,default:()=>p,frontMatter:()=>i,metadata:()=>t,toc:()=>d});const t=JSON.parse('{"id":"shared/install-merod","title":"install-merod","description":"You can choose to install merod using either the installation script or","source":"@site/docs/shared/install-merod.mdx","sourceDirName":"shared","slug":"/shared/install-merod","permalink":"/shared/install-merod","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/shared/install-merod.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"install-meroctl","permalink":"/shared/install-meroctl"}}');var s=r(6070),l=r(5248),a=r(3505),o=r(7576);const i={},c=void 0,u={},d=[{value:"Steps",id:"steps",level:4},{value:"Steps",id:"steps-1",level:4},{value:"Notes for Shell Environments",id:"notes-for-shell-environments",level:4}];function h(e){const n={code:"code",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,l.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["You can choose to install ",(0,s.jsx)(n.code,{children:"merod"})," using either the installation script or\nHomebrew."]}),"\n","\n",(0,s.jsxs)(a.A,{defaultValue:"homebrew",values:[{label:"Homebrew",value:"homebrew"},{label:"Installation Script",value:"script"}],children:[(0,s.jsxs)(o.A,{value:"homebrew",children:[(0,s.jsxs)(n.p,{children:["If you use Homebrew, you can install ",(0,s.jsx)(n.code,{children:"merod"})," directly with the following\nsteps:"]}),(0,s.jsx)(n.h4,{id:"steps",children:"Steps"}),(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Add the Calimero Homebrew tap:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"brew tap calimero-network/homebrew-tap\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Install ",(0,s.jsx)(n.code,{children:"merod"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"brew install merod\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Verify the installation:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"merod --version\n"})}),"\n"]}),"\n"]}),(0,s.jsx)(n.p,{children:"If the version number appears, the installation was successful."})]}),(0,s.jsxs)(o.A,{value:"script",children:[(0,s.jsx)(n.p,{children:"The installation script supports multiple terminal environments and will\nautomatically configure your PATH based on your shell."}),(0,s.jsx)(n.h4,{id:"steps-1",children:"Steps"}),(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Open your terminal and run:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"curl -sSf https://raw.githubusercontent.com/calimero-network/core/master/scripts/install-merod.sh | bash\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Source the updated PATH:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"source \n"})}),"\n",(0,s.jsxs)(n.p,{children:["Replace ",(0,s.jsx)(n.code,{children:""})," with ",(0,s.jsx)(n.code,{children:".bashrc"}),", ",(0,s.jsx)(n.code,{children:".zshrc"}),", or the relevant\nconfiguration file for your shell."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Verify the installation:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"merod --version\n"})}),"\n"]}),"\n"]}),(0,s.jsx)(n.p,{children:"If the version number appears, the installation was successful."}),(0,s.jsx)(n.h4,{id:"notes-for-shell-environments",children:"Notes for Shell Environments"}),(0,s.jsx)(n.p,{children:"The script automatically updates your PATH based on your shell configuration:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Bash"}),": Updates ",(0,s.jsx)(n.code,{children:".bashrc"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Zsh"}),": Updates ",(0,s.jsx)(n.code,{children:".zshrc"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Fish"}),": Modifies ",(0,s.jsx)(n.code,{children:"~/.config/fish/config.fish"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Csh/Tcsh"}),": Updates ",(0,s.jsx)(n.code,{children:".cshrc"}),"."]}),"\n"]}),(0,s.jsxs)(n.p,{children:["To apply the changes immediately, use the ",(0,s.jsx)(n.code,{children:"source"})," command as described in step\n2 above."]})]})]})]})}function p(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},7576:(e,n,r)=>{r.d(n,{A:()=>a});r(758);var t=r(3526);const s={tabItem:"tabItem_KLga"};var l=r(6070);function a(e){let{children:n,hidden:r,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,t.A)(s.tabItem,a),hidden:r,children:n})}},3505:(e,n,r)=>{r.d(n,{A:()=>y});var t=r(758),s=r(3526),l=r(8155),a=r(5557),o=r(5536),i=r(7852),c=r(1381),u=r(4012);function d(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:r}=e;return(0,t.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:r,attributes:t,default:s}}=e;return{value:n,label:r,attributes:t,default:s}}))}(r);return function(e){const n=(0,c.XI)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,r])}function p(e){let{value:n,tabValues:r}=e;return r.some((e=>e.value===n))}function m(e){let{queryString:n=!1,groupId:r}=e;const s=(0,a.W6)(),l=function(e){let{queryString:n=!1,groupId:r}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:n,groupId:r});return[(0,i.aZ)(l),(0,t.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(s.location.search);n.set(l,e),s.replace({...s.location,search:n.toString()})}),[l,s])]}function f(e){const{defaultValue:n,queryString:r=!1,groupId:s}=e,l=h(e),[a,i]=(0,t.useState)((()=>function(e){let{defaultValue:n,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const t=r.find((e=>e.default))??r[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:l}))),[c,d]=m({queryString:r,groupId:s}),[f,b]=function(e){let{groupId:n}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(n),[s,l]=(0,u.Dv)(r);return[s,(0,t.useCallback)((e=>{r&&l.set(e)}),[r,l])]}({groupId:s}),x=(()=>{const e=c??f;return p({value:e,tabValues:l})?e:null})();(0,o.A)((()=>{x&&i(x)}),[x]);return{selectedValue:a,selectValue:(0,t.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),b(e)}),[d,b,l]),tabValues:l}}var b=r(2236);const x={tabList:"tabList_B3_y",tabItem:"tabItem_z210"};var j=r(6070);function v(e){let{className:n,block:r,selectedValue:t,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.a_)(),u=e=>{const n=e.currentTarget,r=i.indexOf(n),s=o[r].value;s!==t&&(c(n),a(s))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const r=i.indexOf(e.currentTarget)+1;n=i[r]??i[0];break}case"ArrowLeft":{const r=i.indexOf(e.currentTarget)-1;n=i[r]??i[i.length-1];break}}n?.focus()};return(0,j.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":r},n),children:o.map((e=>{let{value:n,label:r,attributes:l}=e;return(0,j.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,s.A)("tabs__item",x.tabItem,l?.className,{"tabs__item--active":t===n}),children:r??n},n)}))})}function g(e){let{lazy:n,children:r,selectedValue:l}=e;const a=(Array.isArray(r)?r:[r]).filter(Boolean);if(n){const e=a.find((e=>e.props.value===l));return e?(0,t.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,j.jsx)("div",{className:"margin-top--md",children:a.map(((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==l})))})}function w(e){const n=f(e);return(0,j.jsxs)("div",{className:(0,s.A)("tabs-container",x.tabList),children:[(0,j.jsx)(v,{...n,...e}),(0,j.jsx)(g,{...n,...e})]})}function y(e){const n=(0,b.A)();return(0,j.jsx)(w,{...e,children:d(e.children)},String(n))}},5248:(e,n,r)=>{r.d(n,{R:()=>a,x:()=>o});var t=r(758);const s={},l=t.createContext(s);function a(e){const n=t.useContext(l);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/6e6ab436.872cc54a.js b/assets/js/6e6ab436.872cc54a.js new file mode 100644 index 00000000..112ff713 --- /dev/null +++ b/assets/js/6e6ab436.872cc54a.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8934],{1531:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>u,contentTitle:()=>c,default:()=>p,frontMatter:()=>o,metadata:()=>t,toc:()=>d});const t=JSON.parse('{"id":"shared/install-merod","title":"install-merod","description":"You can choose to install merod using either the installation script or","source":"@site/docs/shared/install-merod.mdx","sourceDirName":"shared","slug":"/shared/install-merod","permalink":"/shared/install-merod","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/shared/install-merod.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"install-meroctl","permalink":"/shared/install-meroctl"},"next":{"title":"node-init-binary","permalink":"/shared/node-init-binary"}}');var s=r(6070),l=r(5248),a=r(3505),i=r(7576);const o={},c=void 0,u={},d=[{value:"Steps",id:"steps",level:4},{value:"Steps",id:"steps-1",level:4},{value:"Notes for Shell Environments",id:"notes-for-shell-environments",level:4}];function h(e){const n={code:"code",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,l.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["You can choose to install ",(0,s.jsx)(n.code,{children:"merod"})," using either the installation script or\nHomebrew."]}),"\n","\n",(0,s.jsxs)(a.A,{defaultValue:"homebrew",values:[{label:"Homebrew",value:"homebrew"},{label:"Installation Script",value:"script"}],children:[(0,s.jsxs)(i.A,{value:"homebrew",children:[(0,s.jsxs)(n.p,{children:["If you use Homebrew, you can install ",(0,s.jsx)(n.code,{children:"merod"})," directly with the following\nsteps:"]}),(0,s.jsx)(n.h4,{id:"steps",children:"Steps"}),(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Add the Calimero Homebrew tap:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"brew tap calimero-network/homebrew-tap\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Install ",(0,s.jsx)(n.code,{children:"merod"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"brew install merod\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Verify the installation:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"merod --version\n"})}),"\n"]}),"\n"]}),(0,s.jsx)(n.p,{children:"If the version number appears, the installation was successful."})]}),(0,s.jsxs)(i.A,{value:"script",children:[(0,s.jsx)(n.p,{children:"The installation script supports multiple terminal environments and will\nautomatically configure your PATH based on your shell."}),(0,s.jsx)(n.h4,{id:"steps-1",children:"Steps"}),(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Open your terminal and run:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"curl -sSf https://raw.githubusercontent.com/calimero-network/core/master/scripts/install-merod.sh | bash\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Source the updated PATH:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"source \n"})}),"\n",(0,s.jsxs)(n.p,{children:["Replace ",(0,s.jsx)(n.code,{children:""})," with ",(0,s.jsx)(n.code,{children:".bashrc"}),", ",(0,s.jsx)(n.code,{children:".zshrc"}),", or the relevant\nconfiguration file for your shell."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Verify the installation:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"merod --version\n"})}),"\n"]}),"\n"]}),(0,s.jsx)(n.p,{children:"If the version number appears, the installation was successful."}),(0,s.jsx)(n.h4,{id:"notes-for-shell-environments",children:"Notes for Shell Environments"}),(0,s.jsx)(n.p,{children:"The script automatically updates your PATH based on your shell configuration:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Bash"}),": Updates ",(0,s.jsx)(n.code,{children:".bashrc"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Zsh"}),": Updates ",(0,s.jsx)(n.code,{children:".zshrc"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Fish"}),": Modifies ",(0,s.jsx)(n.code,{children:"~/.config/fish/config.fish"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Csh/Tcsh"}),": Updates ",(0,s.jsx)(n.code,{children:".cshrc"}),"."]}),"\n"]}),(0,s.jsxs)(n.p,{children:["To apply the changes immediately, use the ",(0,s.jsx)(n.code,{children:"source"})," command as described in step\n2 above."]})]})]})]})}function p(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},7576:(e,n,r)=>{r.d(n,{A:()=>a});r(758);var t=r(3526);const s={tabItem:"tabItem_KLga"};var l=r(6070);function a(e){let{children:n,hidden:r,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,t.A)(s.tabItem,a),hidden:r,children:n})}},3505:(e,n,r)=>{r.d(n,{A:()=>w});var t=r(758),s=r(3526),l=r(8155),a=r(5557),i=r(5536),o=r(7852),c=r(1381),u=r(4012);function d(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:r}=e;return(0,t.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:r,attributes:t,default:s}}=e;return{value:n,label:r,attributes:t,default:s}}))}(r);return function(e){const n=(0,c.XI)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,r])}function p(e){let{value:n,tabValues:r}=e;return r.some((e=>e.value===n))}function m(e){let{queryString:n=!1,groupId:r}=e;const s=(0,a.W6)(),l=function(e){let{queryString:n=!1,groupId:r}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:n,groupId:r});return[(0,o.aZ)(l),(0,t.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(s.location.search);n.set(l,e),s.replace({...s.location,search:n.toString()})}),[l,s])]}function f(e){const{defaultValue:n,queryString:r=!1,groupId:s}=e,l=h(e),[a,o]=(0,t.useState)((()=>function(e){let{defaultValue:n,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const t=r.find((e=>e.default))??r[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:l}))),[c,d]=m({queryString:r,groupId:s}),[f,b]=function(e){let{groupId:n}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(n),[s,l]=(0,u.Dv)(r);return[s,(0,t.useCallback)((e=>{r&&l.set(e)}),[r,l])]}({groupId:s}),x=(()=>{const e=c??f;return p({value:e,tabValues:l})?e:null})();(0,i.A)((()=>{x&&o(x)}),[x]);return{selectedValue:a,selectValue:(0,t.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);o(e),d(e),b(e)}),[d,b,l]),tabValues:l}}var b=r(2236);const x={tabList:"tabList_B3_y",tabItem:"tabItem_z210"};var j=r(6070);function v(e){let{className:n,block:r,selectedValue:t,selectValue:a,tabValues:i}=e;const o=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.a_)(),u=e=>{const n=e.currentTarget,r=o.indexOf(n),s=i[r].value;s!==t&&(c(n),a(s))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const r=o.indexOf(e.currentTarget)+1;n=o[r]??o[0];break}case"ArrowLeft":{const r=o.indexOf(e.currentTarget)-1;n=o[r]??o[o.length-1];break}}n?.focus()};return(0,j.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":r},n),children:i.map((e=>{let{value:n,label:r,attributes:l}=e;return(0,j.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>o.push(e),onKeyDown:d,onClick:u,...l,className:(0,s.A)("tabs__item",x.tabItem,l?.className,{"tabs__item--active":t===n}),children:r??n},n)}))})}function g(e){let{lazy:n,children:r,selectedValue:l}=e;const a=(Array.isArray(r)?r:[r]).filter(Boolean);if(n){const e=a.find((e=>e.props.value===l));return e?(0,t.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,j.jsx)("div",{className:"margin-top--md",children:a.map(((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==l})))})}function y(e){const n=f(e);return(0,j.jsxs)("div",{className:(0,s.A)("tabs-container",x.tabList),children:[(0,j.jsx)(v,{...n,...e}),(0,j.jsx)(g,{...n,...e})]})}function w(e){const n=(0,b.A)();return(0,j.jsx)(y,{...e,children:d(e.children)},String(n))}},5248:(e,n,r)=>{r.d(n,{R:()=>a,x:()=>i});var t=r(758);const s={},l=t.createContext(s);function a(e){const n=t.useContext(l);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/6e6cd14f.8728f2bc.js b/assets/js/6e6cd14f.8728f2bc.js deleted file mode 100644 index 8a7372e6..00000000 --- a/assets/js/6e6cd14f.8728f2bc.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1050],{9627:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>a,contentTitle:()=>l,default:()=>p,frontMatter:()=>i,metadata:()=>o,toc:()=>c});const o=JSON.parse('{"id":"developer-tools/tests","title":"Tests","description":"","source":"@site/docs/05-developer-tools/06-testing.mdx","sourceDirName":"05-developer-tools","slug":"/developer-tools/tests","permalink":"/developer-tools/tests","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/05-developer-tools/06-testing.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":6,"frontMatter":{"id":"tests","title":"Tests"},"sidebar":"tutorialSidebar","previous":{"title":"Desktop App","permalink":"/developer-tools/apps/desktop-app"},"next":{"title":"Tutorials","permalink":"/tutorials/overview"}}');var n=s(6070),r=s(5248);const i={id:"tests",title:"Tests"},l="Run tests",a={},c=[];function d(e){const t={code:"code",h1:"h1",header:"header",pre:"pre",...(0,r.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.header,{children:(0,n.jsx)(t.h1,{id:"run-tests",children:"Run tests"})}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-bash",metastring:'title="Terminal"',children:"./scripts/test.sh\n"})})]})}function p(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(d,{...e})}):d(e)}},5248:(e,t,s)=>{s.d(t,{R:()=>i,x:()=>l});var o=s(758);const n={},r=o.createContext(n);function i(e){const t=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:i(e.components),o.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/6e6cd14f.97738a5d.js b/assets/js/6e6cd14f.97738a5d.js new file mode 100644 index 00000000..e6e4c7d6 --- /dev/null +++ b/assets/js/6e6cd14f.97738a5d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1050],{9627:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>a,contentTitle:()=>l,default:()=>p,frontMatter:()=>i,metadata:()=>o,toc:()=>c});const o=JSON.parse('{"id":"developer-tools/tests","title":"Tests","description":"","source":"@site/docs/05-developer-tools/06-testing.mdx","sourceDirName":"05-developer-tools","slug":"/developer-tools/tests","permalink":"/developer-tools/tests","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/05-developer-tools/06-testing.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":6,"frontMatter":{"id":"tests","title":"Tests"},"sidebar":"tutorialSidebar","previous":{"title":"Desktop App","permalink":"/developer-tools/apps/desktop-app"},"next":{"title":"Overview","permalink":"/tutorials/overview"}}');var n=s(6070),r=s(5248);const i={id:"tests",title:"Tests"},l="Run tests",a={},c=[];function d(e){const t={code:"code",h1:"h1",header:"header",pre:"pre",...(0,r.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.header,{children:(0,n.jsx)(t.h1,{id:"run-tests",children:"Run tests"})}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-bash",metastring:'title="Terminal"',children:"./scripts/test.sh\n"})})]})}function p(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(d,{...e})}):d(e)}},5248:(e,t,s)=>{s.d(t,{R:()=>i,x:()=>l});var o=s(758);const n={},r=o.createContext(n);function i(e){const t=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:i(e.components),o.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/6fe37e69.78c73c9c.js b/assets/js/6fe37e69.2794ecdc.js similarity index 98% rename from assets/js/6fe37e69.78c73c9c.js rename to assets/js/6fe37e69.2794ecdc.js index 3691c393..02d76062 100644 --- a/assets/js/6fe37e69.78c73c9c.js +++ b/assets/js/6fe37e69.2794ecdc.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5088],{7747:(n,t,e)=>{e.r(t),e.d(t,{assets:()=>h,contentTitle:()=>s,default:()=>d,frontMatter:()=>r,metadata:()=>o,toc:()=>c});const o=JSON.parse('{"id":"contributing/hackathons","title":"Hackathons","description":"At Calimero, we love innovation and collaboration, which is why we plan to","source":"@site/docs/09-contributing/02-hackathons.mdx","sourceDirName":"09-contributing","slug":"/contributing/hackathons","permalink":"/contributing/hackathons","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/09-contributing/02-hackathons.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":2,"frontMatter":{"id":"hackathons","title":"Hackathons"},"sidebar":"tutorialSidebar","previous":{"title":"GitHub","permalink":"/contributing/github"},"next":{"title":"Bounty Program","permalink":"/contributing/bounty-program"}}');var a=e(6070),i=e(5248);const r={id:"hackathons",title:"Hackathons"},s="Hackathons",h={},c=[{value:"What is a Hackathon?",id:"what-is-a-hackathon",level:2},{value:"How to Get Involved",id:"how-to-get-involved",level:2},{value:"Stay Updated",id:"stay-updated",level:3}];function l(n){const t={h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,i.R)(),...n.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.header,{children:(0,a.jsx)(t.h1,{id:"hackathons",children:"Hackathons"})}),"\n",(0,a.jsx)(t.p,{children:"At Calimero, we love innovation and collaboration, which is why we plan to\nregularly organize hackathons that include our product. We have exciting events\nplanned for the future. Stay tuned by following us on our social media channels\nto get the latest updates."}),"\n",(0,a.jsx)(t.h2,{id:"what-is-a-hackathon",children:"What is a Hackathon?"}),"\n",(0,a.jsx)(t.p,{children:"A hackathon is an event where developers, designers, and other tech enthusiasts\ncome together to create innovative solutions in a short amount of time.\nParticipants work in teams to build projects, often centered around a specific\ntheme or technology. Hackathons are a great opportunity to:"}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsxs)(t.li,{children:[(0,a.jsx)(t.strong,{children:"Learn New Skills:"})," Whether you\u2019re a beginner or an expert, hackathons\nprovide a platform to learn new technologies and tools."]}),"\n",(0,a.jsxs)(t.li,{children:[(0,a.jsx)(t.strong,{children:"Collaborate:"})," Work with other passionate individuals, share ideas, and\ncollaborate on projects."]}),"\n",(0,a.jsxs)(t.li,{children:[(0,a.jsx)(t.strong,{children:"Showcase Your Talent:"})," Present your project to a panel of judges and other\nparticipants, winning prizes and recognition."]}),"\n",(0,a.jsxs)(t.li,{children:[(0,a.jsx)(t.strong,{children:"Network:"})," Meet like-minded individuals, industry experts, and potential\nemployers or collaborators."]}),"\n"]}),"\n",(0,a.jsx)(t.h2,{id:"how-to-get-involved",children:"How to Get Involved"}),"\n",(0,a.jsx)(t.p,{children:"When we announce a new hackathon, here\u2019s how you can participate:"}),"\n",(0,a.jsxs)(t.ol,{children:["\n",(0,a.jsxs)(t.li,{children:[(0,a.jsx)(t.strong,{children:"Register for the Event:"})," Sign up through the event link provided in our\nannouncements."]}),"\n",(0,a.jsxs)(t.li,{children:[(0,a.jsx)(t.strong,{children:"Form a Team:"})," Join with friends or team up with other participants."]}),"\n",(0,a.jsxs)(t.li,{children:[(0,a.jsx)(t.strong,{children:"Build Your Project:"})," Use our product and other tools to create something\namazing."]}),"\n",(0,a.jsxs)(t.li,{children:[(0,a.jsx)(t.strong,{children:"Submit Your Work:"})," Present your project at the end of the hackathon for a\nchance to win prizes and gain recognition."]}),"\n"]}),"\n",(0,a.jsx)(t.h3,{id:"stay-updated",children:"Stay Updated"}),"\n",(0,a.jsx)(t.p,{children:"Follow us on social media to be the first to know about our upcoming hackathons\nand other events. We\u2019ll share all the details, including how to register and\nparticipate."}),"\n",(0,a.jsx)(t.p,{children:"Thank you for your interest in contributing to our project through hackathons.\nWe look forward to seeing your innovative ideas and solutions!"})]})}function d(n={}){const{wrapper:t}={...(0,i.R)(),...n.components};return t?(0,a.jsx)(t,{...n,children:(0,a.jsx)(l,{...n})}):l(n)}},5248:(n,t,e)=>{e.d(t,{R:()=>r,x:()=>s});var o=e(758);const a={},i=o.createContext(a);function r(n){const t=o.useContext(i);return o.useMemo((function(){return"function"==typeof n?n(t):{...t,...n}}),[t,n])}function s(n){let t;return t=n.disableParentContext?"function"==typeof n.components?n.components(a):n.components||a:r(n.components),o.createElement(i.Provider,{value:t},n.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5088],{7747:(n,t,e)=>{e.r(t),e.d(t,{assets:()=>h,contentTitle:()=>s,default:()=>d,frontMatter:()=>r,metadata:()=>o,toc:()=>c});const o=JSON.parse('{"id":"contributing/hackathons","title":"Hackathons","description":"At Calimero, we love innovation and collaboration, which is why we plan to","source":"@site/docs/09-contributing/02-hackathons.mdx","sourceDirName":"09-contributing","slug":"/contributing/hackathons","permalink":"/contributing/hackathons","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/09-contributing/02-hackathons.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":2,"frontMatter":{"id":"hackathons","title":"Hackathons"},"sidebar":"tutorialSidebar","previous":{"title":"GitHub","permalink":"/contributing/github"},"next":{"title":"Bounty Program","permalink":"/contributing/bounty-program"}}');var a=e(6070),i=e(5248);const r={id:"hackathons",title:"Hackathons"},s="Hackathons",h={},c=[{value:"What is a Hackathon?",id:"what-is-a-hackathon",level:2},{value:"How to Get Involved",id:"how-to-get-involved",level:2},{value:"Stay Updated",id:"stay-updated",level:3}];function l(n){const t={h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,i.R)(),...n.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.header,{children:(0,a.jsx)(t.h1,{id:"hackathons",children:"Hackathons"})}),"\n",(0,a.jsx)(t.p,{children:"At Calimero, we love innovation and collaboration, which is why we plan to\nregularly organize hackathons that include our product. We have exciting events\nplanned for the future. Stay tuned by following us on our social media channels\nto get the latest updates."}),"\n",(0,a.jsx)(t.h2,{id:"what-is-a-hackathon",children:"What is a Hackathon?"}),"\n",(0,a.jsx)(t.p,{children:"A hackathon is an event where developers, designers, and other tech enthusiasts\ncome together to create innovative solutions in a short amount of time.\nParticipants work in teams to build projects, often centered around a specific\ntheme or technology. Hackathons are a great opportunity to:"}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsxs)(t.li,{children:[(0,a.jsx)(t.strong,{children:"Learn New Skills:"})," Whether you\u2019re a beginner or an expert, hackathons\nprovide a platform to learn new technologies and tools."]}),"\n",(0,a.jsxs)(t.li,{children:[(0,a.jsx)(t.strong,{children:"Collaborate:"})," Work with other passionate individuals, share ideas, and\ncollaborate on projects."]}),"\n",(0,a.jsxs)(t.li,{children:[(0,a.jsx)(t.strong,{children:"Showcase Your Talent:"})," Present your project to a panel of judges and other\nparticipants, winning prizes and recognition."]}),"\n",(0,a.jsxs)(t.li,{children:[(0,a.jsx)(t.strong,{children:"Network:"})," Meet like-minded individuals, industry experts, and potential\nemployers or collaborators."]}),"\n"]}),"\n",(0,a.jsx)(t.h2,{id:"how-to-get-involved",children:"How to Get Involved"}),"\n",(0,a.jsx)(t.p,{children:"When we announce a new hackathon, here\u2019s how you can participate:"}),"\n",(0,a.jsxs)(t.ol,{children:["\n",(0,a.jsxs)(t.li,{children:[(0,a.jsx)(t.strong,{children:"Register for the Event:"})," Sign up through the event link provided in our\nannouncements."]}),"\n",(0,a.jsxs)(t.li,{children:[(0,a.jsx)(t.strong,{children:"Form a Team:"})," Join with friends or team up with other participants."]}),"\n",(0,a.jsxs)(t.li,{children:[(0,a.jsx)(t.strong,{children:"Build Your Project:"})," Use our product and other tools to create something\namazing."]}),"\n",(0,a.jsxs)(t.li,{children:[(0,a.jsx)(t.strong,{children:"Submit Your Work:"})," Present your project at the end of the hackathon for a\nchance to win prizes and gain recognition."]}),"\n"]}),"\n",(0,a.jsx)(t.h3,{id:"stay-updated",children:"Stay Updated"}),"\n",(0,a.jsx)(t.p,{children:"Follow us on social media to be the first to know about our upcoming hackathons\nand other events. We\u2019ll share all the details, including how to register and\nparticipate."}),"\n",(0,a.jsx)(t.p,{children:"Thank you for your interest in contributing to our project through hackathons.\nWe look forward to seeing your innovative ideas and solutions!"})]})}function d(n={}){const{wrapper:t}={...(0,i.R)(),...n.components};return t?(0,a.jsx)(t,{...n,children:(0,a.jsx)(l,{...n})}):l(n)}},5248:(n,t,e)=>{e.d(t,{R:()=>r,x:()=>s});var o=e(758);const a={},i=o.createContext(a);function r(n){const t=o.useContext(i);return o.useMemo((function(){return"function"==typeof n?n(t):{...t,...n}}),[t,n])}function s(n){let t;return t=n.disableParentContext?"function"==typeof n.components?n.components(a):n.components||a:r(n.components),o.createElement(i.Provider,{value:t},n.children)}}}]); \ No newline at end of file diff --git a/assets/js/7161e778.0ae8d160.js b/assets/js/7161e778.0ae8d160.js new file mode 100644 index 00000000..4e88c68d --- /dev/null +++ b/assets/js/7161e778.0ae8d160.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4101,7718],{1961:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>a,metadata:()=>l,toc:()=>d});const l=JSON.parse('{"id":"developer-tools/CLI/meroctl","title":"Meroctl","description":"Meroctl is a command-line tool that enables you to interact with your Calimero","source":"@site/docs/05-developer-tools/01-CLI/02-meroctl.mdx","sourceDirName":"05-developer-tools/01-CLI","slug":"/developer-tools/CLI/meroctl","permalink":"/developer-tools/CLI/meroctl","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/05-developer-tools/01-CLI/02-meroctl.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":2,"frontMatter":{"id":"meroctl","title":"Meroctl"},"sidebar":"tutorialSidebar","previous":{"title":"Merod","permalink":"/developer-tools/CLI/merod"},"next":{"title":"Protocol SDK","permalink":"/developer-tools/SDK/protocol-sdk/protocol-sdk"}}');var r=t(6070),s=t(5248),i=t(6486);const a={id:"meroctl",title:"Meroctl"},o=void 0,c={},d=[...i.toc,{value:"Usage",id:"usage",level:2},{value:"Commands:",id:"commands",level:3},{value:"Options:",id:"options",level:3},{value:"Examples:",id:"examples",level:3},{value:"Manage Applications",id:"manage-applications",level:3},{value:"Manage Contexts",id:"manage-contexts",level:3},{value:"Manage Identities",id:"manage-identities",level:3},{value:"Command for managing proxy contract",id:"command-for-managing-proxy-contract",level:3},{value:"Executing read and write RPC calls",id:"executing-read-and-write-rpc-calls",level:3}];function h(e){const n={admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components},{Details:t}=n;return t||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.p,{children:"Meroctl is a command-line tool that enables you to interact with your Calimero\nnode directly from the shell."}),"\n",(0,r.jsxs)(t,{children:[(0,r.jsx)("summary",{children:"Installation"}),(0,r.jsx)("p",{children:(0,r.jsx)(i.default,{})})]}),"\n",(0,r.jsx)(n.h2,{id:"usage",children:"Usage"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"meroctl [OPTIONS] --node-name \n"})}),"\n",(0,r.jsx)(n.h3,{id:"commands",children:"Commands:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"app"})," Command for managing applications"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"context"})," Command for managing contexts"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"identity"})," Command for managing applications"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"proxy"})," Command for managing proxy contract"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"call"})," Executing read and write RPC calls"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"help"})," Print this message or the help of the given subcommand(s)"]}),"\n"]}),"\n",(0,r.jsxs)(n.admonition,{type:"tip",children:[(0,r.jsx)(n.p,{children:"Run help to get more information about the available options and commands."}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"meroctl --help\n"})})]}),"\n",(0,r.jsx)(n.h3,{id:"options",children:"Options:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"--home "})," Directory for config and data"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"-n"}),", ",(0,r.jsx)(n.code,{children:"--node-name "})," Name of node"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"-h"}),", ",(0,r.jsx)(n.code,{children:"--help"})," Print help"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"-output-format "})," [default: plain-text] [possible values:\njson, plain-text]"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"-V"}),", ",(0,r.jsx)(n.code,{children:"--version"})," Print version"]}),"\n"]}),"\n",(0,r.jsx)(n.admonition,{type:"tip",children:(0,r.jsxs)(n.p,{children:["Default location of the config and data directory is ",(0,r.jsx)(n.code,{children:"~/.calimero"}),". You can\nchange the location by using the ",(0,r.jsx)(n.code,{children:"--home"})," option."]})}),"\n",(0,r.jsx)(n.admonition,{type:"note",children:(0,r.jsx)(n.p,{children:"All of the communication with your node through the meroctl CLI is protected by\nyour nodes private key."})}),"\n",(0,r.jsx)(n.h3,{id:"examples",children:"Examples:"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:(0,r.jsx)(n.strong,{children:"Command"})}),(0,r.jsx)(n.th,{children:(0,r.jsx)(n.strong,{children:"Description"})})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"meroctl --node-name app "})}),(0,r.jsx)(n.td,{children:"Command for managing applications"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"meroctl --node-name context "})}),(0,r.jsx)(n.td,{children:"Command for managing contexts"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"meroctl --node-name identity "})}),(0,r.jsx)(n.td,{children:"Command for managing identities"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"meroctl --node-name proxy "})}),(0,r.jsx)(n.td,{children:"Command for managing proxy contract"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"meroctl --node-name call [OPTIONS] --as "})}),(0,r.jsx)(n.td,{children:"Executing read and write RPC calls"})]})]})]}),"\n",(0,r.jsx)(n.h3,{id:"manage-applications",children:"Manage Applications"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"meroctl --node-name app \n"})}),"\n",(0,r.jsx)(n.p,{children:"Commands:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"get"})," Fetch application details"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"install"})," Install an application"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"list"})," List installed applications"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"manage-contexts",children:"Manage Contexts"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"meroctl --node-name context \n"})}),"\n",(0,r.jsx)(n.p,{children:"Commands:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"list"})," List all contexts"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"create"})," Create a new context"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"join"})," Join an application context"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"invite"})," Create invitation to a context for a invitee"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"get"})," Fetch details about the context"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"delete"})," Delete an context"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"watch"})," Watch events from a context"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"update"})," Update app in context"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"manage-identities",children:"Manage Identities"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"meroctl --node-name identity \n"})}),"\n",(0,r.jsx)(n.p,{children:"Commands:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"generate"})," Generate public/private key pair used for context identity"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"command-for-managing-proxy-contract",children:"Command for managing proxy contract"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:" meroctl --node-name proxy \n"})}),"\n",(0,r.jsx)(n.p,{children:"Commands:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"get"})," Fetch details about the proxy contract"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"executing-read-and-write-rpc-calls",children:"Executing read and write RPC calls"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"meroctl --node-name call [OPTIONS] --as \n"})}),"\n",(0,r.jsx)(n.p,{children:"Arguments:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:""})," ContextId of the context"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:""})," Method to fetch details"]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Options:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"--args "})," JSON arguments to pass to the method"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"--as "})," Public key of the executor"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"--id "})," Id of the RPC execute call [default: dontcare]"]}),"\n"]})]})}function u(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},6486:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>c,default:()=>m,frontMatter:()=>o,metadata:()=>l,toc:()=>h});const l=JSON.parse('{"id":"shared/install-meroctl","title":"install-meroctl","description":"You can choose to install meroctl using either the installation script or","source":"@site/docs/shared/install-meroctl.mdx","sourceDirName":"shared","slug":"/shared/install-meroctl","permalink":"/shared/install-meroctl","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/shared/install-meroctl.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"Learning","permalink":"/support/learning"},"next":{"title":"install-merod","permalink":"/shared/install-merod"}}');var r=t(6070),s=t(5248),i=t(3505),a=t(7576);const o={},c=void 0,d={},h=[{value:"Steps",id:"steps",level:4},{value:"Steps",id:"steps-1",level:4},{value:"Notes for Shell Environments",id:"notes-for-shell-environments",level:4}];function u(e){const n={code:"code",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(n.p,{children:["You can choose to install ",(0,r.jsx)(n.code,{children:"meroctl"})," using either the installation script or\nHomebrew."]}),"\n","\n",(0,r.jsxs)(i.A,{defaultValue:"homebrew",values:[{label:"Homebrew",value:"homebrew"},{label:"Installation Script",value:"script"}],children:[(0,r.jsxs)(a.A,{value:"homebrew",children:[(0,r.jsxs)(n.p,{children:["If you use Homebrew, you can install ",(0,r.jsx)(n.code,{children:"meroctl"})," directly with the following\nsteps:"]}),(0,r.jsx)(n.h4,{id:"steps",children:"Steps"}),(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Add the Calimero Homebrew tap:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"brew tap calimero-network/homebrew-tap\n"})}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Install ",(0,r.jsx)(n.code,{children:"merod"}),":"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"brew install meroctl\n"})}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Verify the installation:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"meroctl --version\n"})}),"\n"]}),"\n"]}),(0,r.jsx)(n.p,{children:"If the version number appears, the installation was successful."})]}),(0,r.jsxs)(a.A,{value:"script",children:[(0,r.jsx)(n.p,{children:"The installation script supports multiple terminal environments and will\nautomatically configure your PATH based on your shell."}),(0,r.jsx)(n.h4,{id:"steps-1",children:"Steps"}),(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Open your terminal and run:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"curl -sSf https://raw.githubusercontent.com/calimero-network/core/master/scripts/install-meroctl.sh | bash\n"})}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Source the updated PATH:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"source \n"})}),"\n",(0,r.jsxs)(n.p,{children:["Replace ",(0,r.jsx)(n.code,{children:""})," with ",(0,r.jsx)(n.code,{children:".bashrc"}),", ",(0,r.jsx)(n.code,{children:".zshrc"}),", or the relevant\nconfiguration file for your shell."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Verify the installation:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"meroctl --version\n"})}),"\n"]}),"\n"]}),(0,r.jsx)(n.p,{children:"If the version number appears, the installation was successful."}),(0,r.jsx)(n.h4,{id:"notes-for-shell-environments",children:"Notes for Shell Environments"}),(0,r.jsx)(n.p,{children:"The script automatically updates your PATH based on your shell configuration:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Bash"}),": Updates ",(0,r.jsx)(n.code,{children:".bashrc"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Zsh"}),": Updates ",(0,r.jsx)(n.code,{children:".zshrc"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Fish"}),": Modifies ",(0,r.jsx)(n.code,{children:"~/.config/fish/config.fish"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Csh/Tcsh"}),": Updates ",(0,r.jsx)(n.code,{children:".cshrc"}),"."]}),"\n"]}),(0,r.jsxs)(n.p,{children:["To apply the changes immediately, use the ",(0,r.jsx)(n.code,{children:"source"})," command as described in step\n2 above."]})]})]})]})}function m(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(u,{...e})}):u(e)}},7576:(e,n,t)=>{t.d(n,{A:()=>i});t(758);var l=t(3526);const r={tabItem:"tabItem_KLga"};var s=t(6070);function i(e){let{children:n,hidden:t,className:i}=e;return(0,s.jsx)("div",{role:"tabpanel",className:(0,l.A)(r.tabItem,i),hidden:t,children:n})}},3505:(e,n,t)=>{t.d(n,{A:()=>C});var l=t(758),r=t(3526),s=t(8155),i=t(5557),a=t(5536),o=t(7852),c=t(1381),d=t(4012);function h(e){return l.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,l.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function u(e){const{values:n,children:t}=e;return(0,l.useMemo)((()=>{const e=n??function(e){return h(e).map((e=>{let{props:{value:n,label:t,attributes:l,default:r}}=e;return{value:n,label:t,attributes:l,default:r}}))}(t);return function(e){const n=(0,c.XI)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function m(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:t}=e;const r=(0,i.W6)(),s=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,o.aZ)(s),(0,l.useCallback)((e=>{if(!s)return;const n=new URLSearchParams(r.location.search);n.set(s,e),r.replace({...r.location,search:n.toString()})}),[s,r])]}function p(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,s=u(e),[i,o]=(0,l.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!m({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const l=t.find((e=>e.default))??t[0];if(!l)throw new Error("Unexpected error: 0 tabValues");return l.value}({defaultValue:n,tabValues:s}))),[c,h]=x({queryString:t,groupId:r}),[p,j]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,s]=(0,d.Dv)(t);return[r,(0,l.useCallback)((e=>{t&&s.set(e)}),[t,s])]}({groupId:r}),g=(()=>{const e=c??p;return m({value:e,tabValues:s})?e:null})();(0,a.A)((()=>{g&&o(g)}),[g]);return{selectedValue:i,selectValue:(0,l.useCallback)((e=>{if(!m({value:e,tabValues:s}))throw new Error(`Can't select invalid tab value=${e}`);o(e),h(e),j(e)}),[h,j,s]),tabValues:s}}var j=t(2236);const g={tabList:"tabList_B3_y",tabItem:"tabItem_z210"};var f=t(6070);function b(e){let{className:n,block:t,selectedValue:l,selectValue:i,tabValues:a}=e;const o=[],{blockElementScrollPositionUntilNextRender:c}=(0,s.a_)(),d=e=>{const n=e.currentTarget,t=o.indexOf(n),r=a[t].value;r!==l&&(c(n),i(r))},h=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const t=o.indexOf(e.currentTarget)+1;n=o[t]??o[0];break}case"ArrowLeft":{const t=o.indexOf(e.currentTarget)-1;n=o[t]??o[o.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":t},n),children:a.map((e=>{let{value:n,label:t,attributes:s}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:l===n?0:-1,"aria-selected":l===n,ref:e=>o.push(e),onKeyDown:h,onClick:d,...s,className:(0,r.A)("tabs__item",g.tabItem,s?.className,{"tabs__item--active":l===n}),children:t??n},n)}))})}function v(e){let{lazy:n,children:t,selectedValue:s}=e;const i=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=i.find((e=>e.props.value===s));return e?(0,l.cloneElement)(e,{className:(0,r.A)("margin-top--md",e.props.className)}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:i.map(((e,n)=>(0,l.cloneElement)(e,{key:n,hidden:e.props.value!==s})))})}function y(e){const n=p(e);return(0,f.jsxs)("div",{className:(0,r.A)("tabs-container",g.tabList),children:[(0,f.jsx)(b,{...n,...e}),(0,f.jsx)(v,{...n,...e})]})}function C(e){const n=(0,j.A)();return(0,f.jsx)(y,{...e,children:h(e.children)},String(n))}},5248:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>a});var l=t(758);const r={},s=l.createContext(r);function i(e){const n=l.useContext(s);return l.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),l.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/7161e778.b5b59b5f.js b/assets/js/7161e778.b5b59b5f.js deleted file mode 100644 index 0f2d3452..00000000 --- a/assets/js/7161e778.b5b59b5f.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4101,7718],{1961:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>a,metadata:()=>l,toc:()=>d});const l=JSON.parse('{"id":"developer-tools/CLI/meroctl","title":"Meroctl","description":"Meroctl is a command-line tool that enables you to interact with your Calimero node directly from the shell.","source":"@site/docs/05-developer-tools/01-CLI/02-meroctl.mdx","sourceDirName":"05-developer-tools/01-CLI","slug":"/developer-tools/CLI/meroctl","permalink":"/developer-tools/CLI/meroctl","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/05-developer-tools/01-CLI/02-meroctl.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":2,"frontMatter":{"id":"meroctl","title":"Meroctl"},"sidebar":"tutorialSidebar","previous":{"title":"Merod","permalink":"/developer-tools/CLI/merod"},"next":{"title":"Protocol SDK","permalink":"/developer-tools/SDK/protocol-sdk/protocol-sdk"}}');var r=t(6070),s=t(5248),i=t(6486);const a={id:"meroctl",title:"Meroctl"},o=void 0,c={},d=[...i.toc,{value:"Usage",id:"usage",level:2},{value:"Commands:",id:"commands",level:3},{value:"Options:",id:"options",level:3},{value:"Examples:",id:"examples",level:3},{value:"Manage Applications",id:"manage-applications",level:3},{value:"Manage Contexts",id:"manage-contexts",level:3},{value:"Manage Identities",id:"manage-identities",level:3},{value:"Command for managing proxy contract",id:"command-for-managing-proxy-contract",level:3},{value:"Executing read and write RPC calls",id:"executing-read-and-write-rpc-calls",level:3}];function h(e){const n={admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components},{Details:t}=n;return t||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.p,{children:"Meroctl is a command-line tool that enables you to interact with your Calimero node directly from the shell."}),"\n",(0,r.jsxs)(t,{children:[(0,r.jsx)("summary",{children:"Installation"}),(0,r.jsx)("p",{children:(0,r.jsx)(i.default,{})})]}),"\n",(0,r.jsx)(n.h2,{id:"usage",children:"Usage"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"meroctl [OPTIONS] --node-name \n"})}),"\n",(0,r.jsx)(n.h3,{id:"commands",children:"Commands:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"app"})," Command for managing applications"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"context"})," Command for managing contexts"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"identity"})," Command for managing applications"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"proxy"})," Command for managing proxy contract"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"call"})," Executing read and write RPC calls"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"help"})," Print this message or the help of the given subcommand(s)"]}),"\n"]}),"\n",(0,r.jsxs)(n.admonition,{type:"tip",children:[(0,r.jsx)(n.p,{children:"Run help to get more information about the available options and commands."}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"meroctl --help\n"})})]}),"\n",(0,r.jsx)(n.h3,{id:"options",children:"Options:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"--home "})," Directory for config and data"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"-n"}),", ",(0,r.jsx)(n.code,{children:"--node-name "})," Name of node"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"-h"}),", ",(0,r.jsx)(n.code,{children:"--help"})," Print help"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"-output-format "})," [default: plain-text] [possible values:\njson, plain-text]"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"-V"}),", ",(0,r.jsx)(n.code,{children:"--version"})," Print version"]}),"\n"]}),"\n",(0,r.jsx)(n.admonition,{type:"tip",children:(0,r.jsxs)(n.p,{children:["Default location of the config and data directory is ",(0,r.jsx)(n.code,{children:"~/.calimero"}),". You can\nchange the location by using the ",(0,r.jsx)(n.code,{children:"--home"})," option."]})}),"\n",(0,r.jsx)(n.admonition,{type:"note",children:(0,r.jsx)(n.p,{children:"All of the communication with your node through the meroctl CLI is protected by\nyour nodes private key."})}),"\n",(0,r.jsx)(n.h3,{id:"examples",children:"Examples:"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:(0,r.jsx)(n.strong,{children:"Command"})}),(0,r.jsx)(n.th,{children:(0,r.jsx)(n.strong,{children:"Description"})})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"meroctl --node-name app "})}),(0,r.jsx)(n.td,{children:"Command for managing applications"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"meroctl --node-name context "})}),(0,r.jsx)(n.td,{children:"Command for managing contexts"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"meroctl --node-name identity "})}),(0,r.jsx)(n.td,{children:"Command for managing identities"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"meroctl --node-name proxy "})}),(0,r.jsx)(n.td,{children:"Command for managing proxy contract"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"meroctl --node-name call [OPTIONS] --as "})}),(0,r.jsx)(n.td,{children:"Executing read and write RPC calls"})]})]})]}),"\n",(0,r.jsx)(n.h3,{id:"manage-applications",children:"Manage Applications"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"meroctl --node-name app \n"})}),"\n",(0,r.jsx)(n.p,{children:"Commands:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"get"})," Fetch application details"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"install"})," Install an application"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"list"})," List installed applications"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"manage-contexts",children:"Manage Contexts"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"meroctl --node-name context \n"})}),"\n",(0,r.jsx)(n.p,{children:"Commands:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"list"})," List all contexts"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"create"})," Create a new context"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"join"})," Join an application context"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"invite"})," Create invitation to a context for a invitee"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"get"})," Fetch details about the context"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"delete"})," Delete an context"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"watch"})," Watch events from a context"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"update"})," Update app in context"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"manage-identities",children:"Manage Identities"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"meroctl --node-name identity \n"})}),"\n",(0,r.jsx)(n.p,{children:"Commands:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"generate"})," Generate public/private key pair used for context identity"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"command-for-managing-proxy-contract",children:"Command for managing proxy contract"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:" meroctl --node-name proxy \n"})}),"\n",(0,r.jsx)(n.p,{children:"Commands:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"get"})," Fetch details about the proxy contract"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"executing-read-and-write-rpc-calls",children:"Executing read and write RPC calls"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"meroctl --node-name call [OPTIONS] --as \n"})}),"\n",(0,r.jsx)(n.p,{children:"Arguments:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:""})," ContextId of the context"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:""})," Method to fetch details"]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Options:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"--args "})," JSON arguments to pass to the method"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"--as "})," Public key of the executor"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"--id "})," Id of the RPC execute call [default: dontcare]"]}),"\n"]})]})}function u(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},6486:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>c,default:()=>m,frontMatter:()=>o,metadata:()=>l,toc:()=>h});const l=JSON.parse('{"id":"shared/install-meroctl","title":"install-meroctl","description":"You can choose to install meroctl using either the installation script or","source":"@site/docs/shared/install-meroctl.mdx","sourceDirName":"shared","slug":"/shared/install-meroctl","permalink":"/shared/install-meroctl","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/shared/install-meroctl.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"Learning","permalink":"/support/learning"},"next":{"title":"install-merod","permalink":"/shared/install-merod"}}');var r=t(6070),s=t(5248),i=t(3505),a=t(7576);const o={},c=void 0,d={},h=[{value:"Steps",id:"steps",level:4},{value:"Steps",id:"steps-1",level:4},{value:"Notes for Shell Environments",id:"notes-for-shell-environments",level:4}];function u(e){const n={code:"code",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(n.p,{children:["You can choose to install ",(0,r.jsx)(n.code,{children:"meroctl"})," using either the installation script or\nHomebrew."]}),"\n","\n",(0,r.jsxs)(i.A,{defaultValue:"homebrew",values:[{label:"Homebrew",value:"homebrew"},{label:"Installation Script",value:"script"}],children:[(0,r.jsxs)(a.A,{value:"homebrew",children:[(0,r.jsxs)(n.p,{children:["If you use Homebrew, you can install ",(0,r.jsx)(n.code,{children:"meroctl"})," directly with the following\nsteps:"]}),(0,r.jsx)(n.h4,{id:"steps",children:"Steps"}),(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Add the Calimero Homebrew tap:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"brew tap calimero-network/homebrew-tap\n"})}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Install ",(0,r.jsx)(n.code,{children:"merod"}),":"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"brew install meroctl\n"})}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Verify the installation:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"meroctl --version\n"})}),"\n"]}),"\n"]}),(0,r.jsx)(n.p,{children:"If the version number appears, the installation was successful."})]}),(0,r.jsxs)(a.A,{value:"script",children:[(0,r.jsx)(n.p,{children:"The installation script supports multiple terminal environments and will\nautomatically configure your PATH based on your shell."}),(0,r.jsx)(n.h4,{id:"steps-1",children:"Steps"}),(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Open your terminal and run:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"curl -sSf https://raw.githubusercontent.com/calimero-network/core/master/scripts/install-meroctl.sh | bash\n"})}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Source the updated PATH:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"source \n"})}),"\n",(0,r.jsxs)(n.p,{children:["Replace ",(0,r.jsx)(n.code,{children:""})," with ",(0,r.jsx)(n.code,{children:".bashrc"}),", ",(0,r.jsx)(n.code,{children:".zshrc"}),", or the relevant\nconfiguration file for your shell."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Verify the installation:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"meroctl --version\n"})}),"\n"]}),"\n"]}),(0,r.jsx)(n.p,{children:"If the version number appears, the installation was successful."}),(0,r.jsx)(n.h4,{id:"notes-for-shell-environments",children:"Notes for Shell Environments"}),(0,r.jsx)(n.p,{children:"The script automatically updates your PATH based on your shell configuration:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Bash"}),": Updates ",(0,r.jsx)(n.code,{children:".bashrc"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Zsh"}),": Updates ",(0,r.jsx)(n.code,{children:".zshrc"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Fish"}),": Modifies ",(0,r.jsx)(n.code,{children:"~/.config/fish/config.fish"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Csh/Tcsh"}),": Updates ",(0,r.jsx)(n.code,{children:".cshrc"}),"."]}),"\n"]}),(0,r.jsxs)(n.p,{children:["To apply the changes immediately, use the ",(0,r.jsx)(n.code,{children:"source"})," command as described in step\n2 above."]})]})]})]})}function m(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(u,{...e})}):u(e)}},7576:(e,n,t)=>{t.d(n,{A:()=>i});t(758);var l=t(3526);const r={tabItem:"tabItem_KLga"};var s=t(6070);function i(e){let{children:n,hidden:t,className:i}=e;return(0,s.jsx)("div",{role:"tabpanel",className:(0,l.A)(r.tabItem,i),hidden:t,children:n})}},3505:(e,n,t)=>{t.d(n,{A:()=>C});var l=t(758),r=t(3526),s=t(8155),i=t(5557),a=t(5536),o=t(7852),c=t(1381),d=t(4012);function h(e){return l.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,l.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function u(e){const{values:n,children:t}=e;return(0,l.useMemo)((()=>{const e=n??function(e){return h(e).map((e=>{let{props:{value:n,label:t,attributes:l,default:r}}=e;return{value:n,label:t,attributes:l,default:r}}))}(t);return function(e){const n=(0,c.XI)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function m(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:t}=e;const r=(0,i.W6)(),s=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,o.aZ)(s),(0,l.useCallback)((e=>{if(!s)return;const n=new URLSearchParams(r.location.search);n.set(s,e),r.replace({...r.location,search:n.toString()})}),[s,r])]}function p(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,s=u(e),[i,o]=(0,l.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!m({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const l=t.find((e=>e.default))??t[0];if(!l)throw new Error("Unexpected error: 0 tabValues");return l.value}({defaultValue:n,tabValues:s}))),[c,h]=x({queryString:t,groupId:r}),[p,j]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,s]=(0,d.Dv)(t);return[r,(0,l.useCallback)((e=>{t&&s.set(e)}),[t,s])]}({groupId:r}),g=(()=>{const e=c??p;return m({value:e,tabValues:s})?e:null})();(0,a.A)((()=>{g&&o(g)}),[g]);return{selectedValue:i,selectValue:(0,l.useCallback)((e=>{if(!m({value:e,tabValues:s}))throw new Error(`Can't select invalid tab value=${e}`);o(e),h(e),j(e)}),[h,j,s]),tabValues:s}}var j=t(2236);const g={tabList:"tabList_B3_y",tabItem:"tabItem_z210"};var f=t(6070);function b(e){let{className:n,block:t,selectedValue:l,selectValue:i,tabValues:a}=e;const o=[],{blockElementScrollPositionUntilNextRender:c}=(0,s.a_)(),d=e=>{const n=e.currentTarget,t=o.indexOf(n),r=a[t].value;r!==l&&(c(n),i(r))},h=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const t=o.indexOf(e.currentTarget)+1;n=o[t]??o[0];break}case"ArrowLeft":{const t=o.indexOf(e.currentTarget)-1;n=o[t]??o[o.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":t},n),children:a.map((e=>{let{value:n,label:t,attributes:s}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:l===n?0:-1,"aria-selected":l===n,ref:e=>o.push(e),onKeyDown:h,onClick:d,...s,className:(0,r.A)("tabs__item",g.tabItem,s?.className,{"tabs__item--active":l===n}),children:t??n},n)}))})}function v(e){let{lazy:n,children:t,selectedValue:s}=e;const i=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=i.find((e=>e.props.value===s));return e?(0,l.cloneElement)(e,{className:(0,r.A)("margin-top--md",e.props.className)}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:i.map(((e,n)=>(0,l.cloneElement)(e,{key:n,hidden:e.props.value!==s})))})}function y(e){const n=p(e);return(0,f.jsxs)("div",{className:(0,r.A)("tabs-container",g.tabList),children:[(0,f.jsx)(b,{...n,...e}),(0,f.jsx)(v,{...n,...e})]})}function C(e){const n=(0,j.A)();return(0,f.jsx)(y,{...e,children:h(e.children)},String(n))}},5248:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>a});var l=t(758);const r={},s=l.createContext(r);function i(e){const n=l.useContext(s);return l.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),l.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/71e069fb.48a4422a.js b/assets/js/71e069fb.2ec1aa9a.js similarity index 99% rename from assets/js/71e069fb.48a4422a.js rename to assets/js/71e069fb.2ec1aa9a.js index 661be4af..ff7ae433 100644 --- a/assets/js/71e069fb.48a4422a.js +++ b/assets/js/71e069fb.2ec1aa9a.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1663],{7151:(t,e,n)=>{n.r(e),n.d(e,{assets:()=>d,contentTitle:()=>c,default:()=>h,frontMatter:()=>o,metadata:()=>i,toc:()=>r});const i=JSON.parse('{"id":"tutorials/invitations-and-joinings","title":"Invitations and Joinings","description":"Invite to context with Admin Dashboard","source":"@site/docs/06-tutorials/03-invitations-and-joinings.mdx","sourceDirName":"06-tutorials","slug":"/tutorials/invitations-and-joinings","permalink":"/tutorials/invitations-and-joinings","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/06-tutorials/03-invitations-and-joinings.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":3,"frontMatter":{"id":"invitations-and-joinings","title":"Invitations and Joinings"},"sidebar":"tutorialSidebar","previous":{"title":"Create Context","permalink":"/tutorials/create-context"},"next":{"title":"Publish App","permalink":"/tutorials/publish-app"}}');var s=n(6070),a=n(5248);const o={id:"invitations-and-joinings",title:"Invitations and Joinings"},c=void 0,d={},r=[{value:"Invite to context with Admin Dashboard",id:"invite-to-context-with-admin-dashboard",level:2},{value:"Invite node to context using interactive CLI",id:"invite-node-to-context-using-interactive-cli",level:2},{value:"Step-by-Step Process",id:"step-by-step-process",level:3}];function l(t){const e={blockquote:"blockquote",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",...(0,a.R)(),...t.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(e.h2,{id:"invite-to-context-with-admin-dashboard",children:"Invite to context with Admin Dashboard"}),"\n",(0,s.jsxs)(e.blockquote,{children:["\n",(0,s.jsx)(e.p,{children:"Currently not available"}),"\n"]}),"\n",(0,s.jsx)(e.h2,{id:"invite-node-to-context-using-interactive-cli",children:"Invite node to context using interactive CLI"}),"\n",(0,s.jsx)(e.p,{children:"Inviting to the context consists of 3 steps:"}),"\n",(0,s.jsxs)(e.ol,{children:["\n",(0,s.jsx)(e.li,{children:"Identity Exchange: The peer wishing to join (invitee) shares their identity\nwith the existing member (invitor)."}),"\n",(0,s.jsx)(e.li,{children:"Create Invitation: The invitor generates an invitation payload for the\ncontext."}),"\n",(0,s.jsx)(e.li,{children:"Accept Invitation: The invitee signs the invitation payload to confirm their\nidentity and join the context."}),"\n"]}),"\n",(0,s.jsx)(e.p,{children:"In the example below, Node 2 is the invitee, and Node 1 is the invitor."}),"\n",(0,s.jsx)(e.h3,{id:"step-by-step-process",children:"Step-by-Step Process"}),"\n",(0,s.jsxs)(e.ol,{children:["\n",(0,s.jsx)(e.li,{children:"Invitee Generates and Shares Identity To join the context, the invitee must\nfirst create and share their identity with the invitor. This can be done\nusing the following command:"}),"\n"]}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-bash",metastring:'title="Node 2"',children:"identity new\n"})}),"\n",(0,s.jsx)(e.p,{children:"This generates a private and public key pair, where the public key is the\ninviteeContextIdentity. Share this public key with the invitor."}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-bash",metastring:'title="Example"',children:"identity new\n\u2502 Private Key: 6i52ykNTqSqCgfDPYiKktListssSP9YwxLMzApDZe5U7\n\u2502 Public Key: 3yBQQvn2G8ghWk2ZwmLFYxJQgM1YmDtiigi84nGpZBb9\n"})}),"\n",(0,s.jsx)(e.p,{children:(0,s.jsx)(e.img,{alt:"Create Identity",src:n(1333).A+"",width:"2142",height:"1388"})}),"\n",(0,s.jsxs)(e.ol,{start:"2",children:["\n",(0,s.jsx)(e.li,{children:"Invitor Creates an Invitation Once the invitee\u2019s public key is shared, the\ninvitor generates an invitation to the context using the following command:"}),"\n"]}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-bash",metastring:'title="Node 1"',children:"context invite {contextId} {invitorContextIdentity} {inviteeContextIdentity}\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-bash",metastring:'title="Example"',children:"context invite 567C5Gg4mxHMPKy2wLJ4uvb3DHsbcpVDYUsuAWgTPgXn DaSkad6DK7f6fUhjz1CvNW7L4TkWZmWqAcwysZHG3Xs5 3yBQQvn2G8ghWk2ZwmLFYxJQgM1YmDtiigi84nGpZBb9\n\u2502 Invited 3yBQQvn2G8ghWk2ZwmLFYxJQgM1YmDtiigi84nGpZBb9 to context 567C5Gg4mxHMPKy2wLJ4uvb3DHsbcpVDYUsuAWgTPgXn\n\u2502 Invitation Payload: axDfZcWCw7jc3i7MeG9JqhsYrNXRSvg6hXVWYpdsxNRhAjKD35S5FruCzyRWHYHzQyN1QbSVyRKRiTwz8Kbq4aj2dSdmi7HNxwcjTS5JkK1xwJMA8ogYuWHhDj4jfLdukPZb2SavC8cq3npFydinVZ\n"})}),"\n",(0,s.jsx)(e.p,{children:(0,s.jsx)(e.img,{alt:"Context Invite",src:n(2664).A+"",width:"2128",height:"1516"})}),"\n",(0,s.jsx)(e.p,{children:"To check the invitor's identity, use this command:"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-bash",metastring:'title="Node 1"',children:"identity ls {contextId}\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-bash",metastring:'title="Example"',children:"identity ls 567C5Gg4mxHMPKy2wLJ4uvb3DHsbcpVDYUsuAWgTPgXn\n\u2502 Identity | Owned \u2502\n| DaSkad6DK7f6fUhjz1CvNW7L4TkWZmWqAcwysZHG3Xs5 | *\n"})}),"\n",(0,s.jsx)(e.p,{children:"Listed identity is invitorContextIdentity used above."}),"\n",(0,s.jsxs)(e.ol,{start:"3",children:["\n",(0,s.jsx)(e.li,{children:"Invitee Accepts the Invitation After receiving the invitation payload from\nthe invitor, the invitee can accept the invitation by signing it with their\nprivate key:"}),"\n"]}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-bash",metastring:'title="Node 2"',children:"context join {inviteePrivateKey} {invitationPayload}\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-bash",metastring:'title="Example"',children:"context join 6i52ykNTqSqCgfDPYiKktListssSP9YwxLMzApDZe5U7 axDfZcWCw7jc3i7MeG9JqhsYrNXRSvg6hXVWYpdsxNRhAjKD35S5FruCzyRWHYHzQyN1QbSVyRKRiTwz8Kbq4aj2dSdmi7HNxwcjTS5JkK1xwJMA8ogYuWHhDj4jfLdukPZb2SavC8cq3npFydinVZ\n2024-10-07T12:18:51.809231Z INFO calimero_context: Subscribed to context context_id=567C5Gg4mxHMPKy2wLJ4uvb3DHsbcpVDYUsuAWgTPgXn\n2024-10-07T12:18:51.811102Z INFO calimero_context: Joined context with pending catchup context_id=567C5Gg4mxHMPKy2wLJ4uvb3DHsbcpVDYUsuAWgTPgXn\n\u2502 Joined context 567C5Gg4mxHMPKy2wLJ4uvb3DHsbcpVDYUsuAWgTPgXn as 3yBQQvn2G8ghWk2ZwmLFYxJQgM1YmDtiigi84nGpZBb9, waiting for catchup to complete...\n"})}),"\n",(0,s.jsx)(e.p,{children:(0,s.jsx)(e.img,{alt:"Context Join",src:n(2660).A+"",width:"2134",height:"1292"})}),"\n",(0,s.jsxs)(e.ol,{start:"4",children:["\n",(0,s.jsx)(e.li,{children:"Verifying Context Membership To confirm successful joining of the context,\nthe invitee can list their contexts with the following command:"}),"\n"]}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-bash",metastring:'title="Node 2"',children:"context ls\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-bash",metastring:'title="Example"',children:"context ls\n\u2502 Context ID | Application ID | Last Transaction\n\u2502 567C5Gg4mxHMPKy2wLJ4uvb3DHsbcpVDYUsuAWgTPgXn | Ahe2vLWLgswJARv5LsafXp7uJyb2Ba9GjzUSeLc71gUF | b3ipivssRRm1ehRTSpUD3GKdUpvi3vq311pCT4iLvui\n"})}),"\n",(0,s.jsx)(e.p,{children:(0,s.jsx)(e.img,{alt:"Context List",src:n(1575).A+"",width:"2136",height:"170"})}),"\n",(0,s.jsxs)(e.ol,{start:"5",children:["\n",(0,s.jsx)(e.li,{children:"The invitee can also list identities in the context"}),"\n"]}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-bash",metastring:'title="Node 2"',children:"identity ls {contextId}\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-bash",metastring:'title="Example"',children:"identity ls 567C5Gg4mxHMPKy2wLJ4uvb3DHsbcpVDYUsuAWgTPgXn\n\u2502 Identity | Owned\n\u2502 3yBQQvn2G8ghWk2ZwmLFYxJQgM1YmDtiigi84nGpZBb9 | *\n\u2502 DaSkad6DK7f6fUhjz1CvNW7L4TkWZmWqAcwysZHG3Xs5 |\n"})}),"\n",(0,s.jsx)(e.p,{children:(0,s.jsx)(e.img,{alt:"Context Identity List",src:n(7644).A+"",width:"982",height:"138"})})]})}function h(t={}){const{wrapper:e}={...(0,a.R)(),...t.components};return e?(0,s.jsx)(e,{...t,children:(0,s.jsx)(l,{...t})}):l(t)}},1333:(t,e,n)=>{n.d(e,{A:()=>i});const i=n.p+"assets/images/3-create-identity-da349b463a046d0b8330b7b1449280f1.png"},2664:(t,e,n)=>{n.d(e,{A:()=>i});const i=n.p+"assets/images/4-context-invite-db1950a8fb0a6c93914618946ef325fc.png"},2660:(t,e,n)=>{n.d(e,{A:()=>i});const i=n.p+"assets/images/5-context-join-f28f7dbdb96d1eee6698a1f2ac7b3e95.png"},7644:(t,e,n)=>{n.d(e,{A:()=>i});const i=n.p+"assets/images/6-identity-list-65e6bedbf9a5e5dd214dd08a5aab547b.png"},1575:(t,e,n)=>{n.d(e,{A:()=>i});const i=n.p+"assets/images/8-context-list-ebd87670b93106c3917a01cb28c2d8ef.png"},5248:(t,e,n)=>{n.d(e,{R:()=>o,x:()=>c});var i=n(758);const s={},a=i.createContext(s);function o(t){const e=i.useContext(a);return i.useMemo((function(){return"function"==typeof t?t(e):{...e,...t}}),[e,t])}function c(t){let e;return e=t.disableParentContext?"function"==typeof t.components?t.components(s):t.components||s:o(t.components),i.createElement(a.Provider,{value:e},t.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1663],{7151:(t,e,n)=>{n.r(e),n.d(e,{assets:()=>d,contentTitle:()=>c,default:()=>h,frontMatter:()=>o,metadata:()=>i,toc:()=>r});const i=JSON.parse('{"id":"tutorials/invitations-and-joinings","title":"Invitations and Joinings","description":"Invite to context with Admin Dashboard","source":"@site/docs/06-tutorials/03-invitations-and-joinings.mdx","sourceDirName":"06-tutorials","slug":"/tutorials/invitations-and-joinings","permalink":"/tutorials/invitations-and-joinings","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/06-tutorials/03-invitations-and-joinings.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":3,"frontMatter":{"id":"invitations-and-joinings","title":"Invitations and Joinings"},"sidebar":"tutorialSidebar","previous":{"title":"Create Context","permalink":"/tutorials/create-context"},"next":{"title":"Publish App","permalink":"/tutorials/publish-app"}}');var s=n(6070),a=n(5248);const o={id:"invitations-and-joinings",title:"Invitations and Joinings"},c=void 0,d={},r=[{value:"Invite to context with Admin Dashboard",id:"invite-to-context-with-admin-dashboard",level:2},{value:"Invite node to context using interactive CLI",id:"invite-node-to-context-using-interactive-cli",level:2},{value:"Step-by-Step Process",id:"step-by-step-process",level:3}];function l(t){const e={blockquote:"blockquote",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",...(0,a.R)(),...t.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(e.h2,{id:"invite-to-context-with-admin-dashboard",children:"Invite to context with Admin Dashboard"}),"\n",(0,s.jsxs)(e.blockquote,{children:["\n",(0,s.jsx)(e.p,{children:"Currently not available"}),"\n"]}),"\n",(0,s.jsx)(e.h2,{id:"invite-node-to-context-using-interactive-cli",children:"Invite node to context using interactive CLI"}),"\n",(0,s.jsx)(e.p,{children:"Inviting to the context consists of 3 steps:"}),"\n",(0,s.jsxs)(e.ol,{children:["\n",(0,s.jsx)(e.li,{children:"Identity Exchange: The peer wishing to join (invitee) shares their identity\nwith the existing member (invitor)."}),"\n",(0,s.jsx)(e.li,{children:"Create Invitation: The invitor generates an invitation payload for the\ncontext."}),"\n",(0,s.jsx)(e.li,{children:"Accept Invitation: The invitee signs the invitation payload to confirm their\nidentity and join the context."}),"\n"]}),"\n",(0,s.jsx)(e.p,{children:"In the example below, Node 2 is the invitee, and Node 1 is the invitor."}),"\n",(0,s.jsx)(e.h3,{id:"step-by-step-process",children:"Step-by-Step Process"}),"\n",(0,s.jsxs)(e.ol,{children:["\n",(0,s.jsx)(e.li,{children:"Invitee Generates and Shares Identity To join the context, the invitee must\nfirst create and share their identity with the invitor. This can be done\nusing the following command:"}),"\n"]}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-bash",metastring:'title="Node 2"',children:"identity new\n"})}),"\n",(0,s.jsx)(e.p,{children:"This generates a private and public key pair, where the public key is the\ninviteeContextIdentity. Share this public key with the invitor."}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-bash",metastring:'title="Example"',children:"identity new\n\u2502 Private Key: 6i52ykNTqSqCgfDPYiKktListssSP9YwxLMzApDZe5U7\n\u2502 Public Key: 3yBQQvn2G8ghWk2ZwmLFYxJQgM1YmDtiigi84nGpZBb9\n"})}),"\n",(0,s.jsx)(e.p,{children:(0,s.jsx)(e.img,{alt:"Create Identity",src:n(1333).A+"",width:"2142",height:"1388"})}),"\n",(0,s.jsxs)(e.ol,{start:"2",children:["\n",(0,s.jsx)(e.li,{children:"Invitor Creates an Invitation Once the invitee\u2019s public key is shared, the\ninvitor generates an invitation to the context using the following command:"}),"\n"]}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-bash",metastring:'title="Node 1"',children:"context invite {contextId} {invitorContextIdentity} {inviteeContextIdentity}\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-bash",metastring:'title="Example"',children:"context invite 567C5Gg4mxHMPKy2wLJ4uvb3DHsbcpVDYUsuAWgTPgXn DaSkad6DK7f6fUhjz1CvNW7L4TkWZmWqAcwysZHG3Xs5 3yBQQvn2G8ghWk2ZwmLFYxJQgM1YmDtiigi84nGpZBb9\n\u2502 Invited 3yBQQvn2G8ghWk2ZwmLFYxJQgM1YmDtiigi84nGpZBb9 to context 567C5Gg4mxHMPKy2wLJ4uvb3DHsbcpVDYUsuAWgTPgXn\n\u2502 Invitation Payload: axDfZcWCw7jc3i7MeG9JqhsYrNXRSvg6hXVWYpdsxNRhAjKD35S5FruCzyRWHYHzQyN1QbSVyRKRiTwz8Kbq4aj2dSdmi7HNxwcjTS5JkK1xwJMA8ogYuWHhDj4jfLdukPZb2SavC8cq3npFydinVZ\n"})}),"\n",(0,s.jsx)(e.p,{children:(0,s.jsx)(e.img,{alt:"Context Invite",src:n(2664).A+"",width:"2128",height:"1516"})}),"\n",(0,s.jsx)(e.p,{children:"To check the invitor's identity, use this command:"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-bash",metastring:'title="Node 1"',children:"identity ls {contextId}\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-bash",metastring:'title="Example"',children:"identity ls 567C5Gg4mxHMPKy2wLJ4uvb3DHsbcpVDYUsuAWgTPgXn\n\u2502 Identity | Owned \u2502\n| DaSkad6DK7f6fUhjz1CvNW7L4TkWZmWqAcwysZHG3Xs5 | *\n"})}),"\n",(0,s.jsx)(e.p,{children:"Listed identity is invitorContextIdentity used above."}),"\n",(0,s.jsxs)(e.ol,{start:"3",children:["\n",(0,s.jsx)(e.li,{children:"Invitee Accepts the Invitation After receiving the invitation payload from\nthe invitor, the invitee can accept the invitation by signing it with their\nprivate key:"}),"\n"]}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-bash",metastring:'title="Node 2"',children:"context join {inviteePrivateKey} {invitationPayload}\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-bash",metastring:'title="Example"',children:"context join 6i52ykNTqSqCgfDPYiKktListssSP9YwxLMzApDZe5U7 axDfZcWCw7jc3i7MeG9JqhsYrNXRSvg6hXVWYpdsxNRhAjKD35S5FruCzyRWHYHzQyN1QbSVyRKRiTwz8Kbq4aj2dSdmi7HNxwcjTS5JkK1xwJMA8ogYuWHhDj4jfLdukPZb2SavC8cq3npFydinVZ\n2024-10-07T12:18:51.809231Z INFO calimero_context: Subscribed to context context_id=567C5Gg4mxHMPKy2wLJ4uvb3DHsbcpVDYUsuAWgTPgXn\n2024-10-07T12:18:51.811102Z INFO calimero_context: Joined context with pending catchup context_id=567C5Gg4mxHMPKy2wLJ4uvb3DHsbcpVDYUsuAWgTPgXn\n\u2502 Joined context 567C5Gg4mxHMPKy2wLJ4uvb3DHsbcpVDYUsuAWgTPgXn as 3yBQQvn2G8ghWk2ZwmLFYxJQgM1YmDtiigi84nGpZBb9, waiting for catchup to complete...\n"})}),"\n",(0,s.jsx)(e.p,{children:(0,s.jsx)(e.img,{alt:"Context Join",src:n(2660).A+"",width:"2134",height:"1292"})}),"\n",(0,s.jsxs)(e.ol,{start:"4",children:["\n",(0,s.jsx)(e.li,{children:"Verifying Context Membership To confirm successful joining of the context,\nthe invitee can list their contexts with the following command:"}),"\n"]}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-bash",metastring:'title="Node 2"',children:"context ls\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-bash",metastring:'title="Example"',children:"context ls\n\u2502 Context ID | Application ID | Last Transaction\n\u2502 567C5Gg4mxHMPKy2wLJ4uvb3DHsbcpVDYUsuAWgTPgXn | Ahe2vLWLgswJARv5LsafXp7uJyb2Ba9GjzUSeLc71gUF | b3ipivssRRm1ehRTSpUD3GKdUpvi3vq311pCT4iLvui\n"})}),"\n",(0,s.jsx)(e.p,{children:(0,s.jsx)(e.img,{alt:"Context List",src:n(1575).A+"",width:"2136",height:"170"})}),"\n",(0,s.jsxs)(e.ol,{start:"5",children:["\n",(0,s.jsx)(e.li,{children:"The invitee can also list identities in the context"}),"\n"]}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-bash",metastring:'title="Node 2"',children:"identity ls {contextId}\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-bash",metastring:'title="Example"',children:"identity ls 567C5Gg4mxHMPKy2wLJ4uvb3DHsbcpVDYUsuAWgTPgXn\n\u2502 Identity | Owned\n\u2502 3yBQQvn2G8ghWk2ZwmLFYxJQgM1YmDtiigi84nGpZBb9 | *\n\u2502 DaSkad6DK7f6fUhjz1CvNW7L4TkWZmWqAcwysZHG3Xs5 |\n"})}),"\n",(0,s.jsx)(e.p,{children:(0,s.jsx)(e.img,{alt:"Context Identity List",src:n(7644).A+"",width:"982",height:"138"})})]})}function h(t={}){const{wrapper:e}={...(0,a.R)(),...t.components};return e?(0,s.jsx)(e,{...t,children:(0,s.jsx)(l,{...t})}):l(t)}},1333:(t,e,n)=>{n.d(e,{A:()=>i});const i=n.p+"assets/images/3-create-identity-da349b463a046d0b8330b7b1449280f1.png"},2664:(t,e,n)=>{n.d(e,{A:()=>i});const i=n.p+"assets/images/4-context-invite-db1950a8fb0a6c93914618946ef325fc.png"},2660:(t,e,n)=>{n.d(e,{A:()=>i});const i=n.p+"assets/images/5-context-join-f28f7dbdb96d1eee6698a1f2ac7b3e95.png"},7644:(t,e,n)=>{n.d(e,{A:()=>i});const i=n.p+"assets/images/6-identity-list-65e6bedbf9a5e5dd214dd08a5aab547b.png"},1575:(t,e,n)=>{n.d(e,{A:()=>i});const i=n.p+"assets/images/8-context-list-ebd87670b93106c3917a01cb28c2d8ef.png"},5248:(t,e,n)=>{n.d(e,{R:()=>o,x:()=>c});var i=n(758);const s={},a=i.createContext(s);function o(t){const e=i.useContext(a);return i.useMemo((function(){return"function"==typeof t?t(e):{...e,...t}}),[e,t])}function c(t){let e;return e=t.disableParentContext?"function"==typeof t.components?t.components(s):t.components||s:o(t.components),i.createElement(a.Provider,{value:e},t.children)}}}]); \ No newline at end of file diff --git a/assets/js/788edaf7.b1f97b96.js b/assets/js/788edaf7.b1f97b96.js deleted file mode 100644 index abcd8070..00000000 --- a/assets/js/788edaf7.b1f97b96.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4259],{4207:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>l,default:()=>p,frontMatter:()=>s,metadata:()=>r,toc:()=>d});const r=JSON.parse('{"id":"core-concepts/blockchains-integration/context-contract","title":"Context Contract","description":"Calimero Context Contract is used to manage the context on the blockchain. It is","source":"@site/docs/03-core-concepts/06-blockchains-integration/02-context-contract.mdx","sourceDirName":"03-core-concepts/06-blockchains-integration","slug":"/core-concepts/blockchains-integration/context-contract","permalink":"/core-concepts/blockchains-integration/context-contract","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/03-core-concepts/06-blockchains-integration/02-context-contract.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":2,"frontMatter":{"id":"context-contract","title":"Context Contract"},"sidebar":"tutorialSidebar","previous":{"title":"Blockchain Integrations","permalink":"/core-concepts/blockchains-integration/blockchain-integrations"},"next":{"title":"Proxy Contract","permalink":"/core-concepts/blockchains-integration/proxy-contract"}}');var o=n(6070),a=n(5248),c=n(3505),i=n(7576);const s={id:"context-contract",title:"Context Contract"},l="Context Contract",u={},d=[{value:"Setup",id:"setup",level:2}];function h(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",strong:"strong",...(0,a.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.header,{children:(0,o.jsx)(t.h1,{id:"context-contract",children:"Context Contract"})}),"\n",(0,o.jsx)(t.p,{children:"Calimero Context Contract is used to manage the context on the blockchain. It is\npredeployed on each blockchain by the Calimero team. It is used to create the\ncontext, add members to the context, and configure the context."}),"\n",(0,o.jsx)(t.h2,{id:"setup",children:"Setup"}),"\n",(0,o.jsxs)(t.p,{children:["To create context on specific blockchain user will need to add the ",(0,o.jsx)(t.code,{children:"--protocol"}),"\nflag to the ",(0,o.jsx)(t.code,{children:"calimero-cli"})," when initializing the node as explained in the\n",(0,o.jsx)(t.a,{href:"/getting-started/setup",children:"Setup"})," section."]}),"\n","\n",(0,o.jsxs)(c.A,{defaultValue:"starknet",values:[{label:"Starknet",value:"starknet"},{label:"ICP",value:"icp"}],children:[(0,o.jsx)(i.A,{value:"starknet",children:(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",metastring:'title="Start node with Starknet protocol"',children:"cargo run -p merod -- --node-name node1 init --server-port 2428 --swarm-port 2528 --protocol starknet\n"})})}),(0,o.jsx)(i.A,{value:"icp",children:(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",metastring:'title="Start node with Internet Computer (ICP)"',children:"cargo run -p merod -- --node-name node1 init --server-port 2428 --swarm-port 2528 --protocol icp\n"})})})]}),"\n",(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.strong,{children:"Note"}),": NEAR protocol is set by default, so if user wants to use NEAR\nprotocol, he doesn't need to specify the ",(0,o.jsx)(t.code,{children:"--protocol"})," flag."]}),"\n",(0,o.jsxs)(t.p,{children:["After the node is initialized, user can see the Context Contract address in the\n",(0,o.jsx)(t.code,{children:"config.toml"})," file located in the node folder."]}),"\n",(0,o.jsx)(t.p,{children:"After initialization, user needs to start the node by running the following\ncommand:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",metastring:'title="Start node"',children:"cargo run -p merod -- --node-name node1 run\n"})}),"\n",(0,o.jsxs)(t.p,{children:["Before creating the context, user needs to compile the\ndemo-blockchain-integrations application. To compile the application, please\nclone the\n",(0,o.jsx)(t.a,{href:"https://github.com/calimero-network/demo-blockchain-integrations",children:"demo-blockchain-integrations"}),"\nrepository and follow the instructions in the\n",(0,o.jsx)(t.a,{href:"https://github.com/calimero-network/demo-blockchain-integrations/blob/main/README.md",children:"README"}),"."]}),"\n",(0,o.jsxs)(t.p,{children:["After the application is compiled, user needs to install the application on the\nnode and then create the context with the application. To create the context and\ninstall the application, please follow the\n",(0,o.jsx)(t.a,{href:"/tutorials/create-context",children:"Create Context"})," tutorial."]})]})}function p(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(h,{...e})}):h(e)}},7576:(e,t,n)=>{n.d(t,{A:()=>c});n(758);var r=n(3526);const o={tabItem:"tabItem_KLga"};var a=n(6070);function c(e){let{children:t,hidden:n,className:c}=e;return(0,a.jsx)("div",{role:"tabpanel",className:(0,r.A)(o.tabItem,c),hidden:n,children:t})}},3505:(e,t,n)=>{n.d(t,{A:()=>w});var r=n(758),o=n(3526),a=n(8155),c=n(5557),i=n(5536),s=n(7852),l=n(1381),u=n(4012);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:o}}=e;return{value:t,label:n,attributes:r,default:o}}))}(n);return function(e){const t=(0,l.XI)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function p(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function m(e){let{queryString:t=!1,groupId:n}=e;const o=(0,c.W6)(),a=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,s.aZ)(a),(0,r.useCallback)((e=>{if(!a)return;const t=new URLSearchParams(o.location.search);t.set(a,e),o.replace({...o.location,search:t.toString()})}),[a,o])]}function b(e){const{defaultValue:t,queryString:n=!1,groupId:o}=e,a=h(e),[c,s]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!p({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:a}))),[l,d]=m({queryString:n,groupId:o}),[b,f]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[o,a]=(0,u.Dv)(n);return[o,(0,r.useCallback)((e=>{n&&a.set(e)}),[n,a])]}({groupId:o}),x=(()=>{const e=l??b;return p({value:e,tabValues:a})?e:null})();(0,i.A)((()=>{x&&s(x)}),[x]);return{selectedValue:c,selectValue:(0,r.useCallback)((e=>{if(!p({value:e,tabValues:a}))throw new Error(`Can't select invalid tab value=${e}`);s(e),d(e),f(e)}),[d,f,a]),tabValues:a}}var f=n(2236);const x={tabList:"tabList_B3_y",tabItem:"tabItem_z210"};var g=n(6070);function v(e){let{className:t,block:n,selectedValue:r,selectValue:c,tabValues:i}=e;const s=[],{blockElementScrollPositionUntilNextRender:l}=(0,a.a_)(),u=e=>{const t=e.currentTarget,n=s.indexOf(t),o=i[n].value;o!==r&&(l(t),c(o))},d=e=>{let t=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const n=s.indexOf(e.currentTarget)+1;t=s[n]??s[0];break}case"ArrowLeft":{const n=s.indexOf(e.currentTarget)-1;t=s[n]??s[s.length-1];break}}t?.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.A)("tabs",{"tabs--block":n},t),children:i.map((e=>{let{value:t,label:n,attributes:a}=e;return(0,g.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>s.push(e),onKeyDown:d,onClick:u,...a,className:(0,o.A)("tabs__item",x.tabItem,a?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function k(e){let{lazy:t,children:n,selectedValue:a}=e;const c=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=c.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:(0,o.A)("margin-top--md",e.props.className)}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:c.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a})))})}function j(e){const t=b(e);return(0,g.jsxs)("div",{className:(0,o.A)("tabs-container",x.tabList),children:[(0,g.jsx)(v,{...t,...e}),(0,g.jsx)(k,{...t,...e})]})}function w(e){const t=(0,f.A)();return(0,g.jsx)(j,{...e,children:d(e.children)},String(t))}},5248:(e,t,n)=>{n.d(t,{R:()=>c,x:()=>i});var r=n(758);const o={},a=r.createContext(o);function c(e){const t=r.useContext(a);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function i(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:c(e.components),r.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/7d19853e.e7cbb24e.js b/assets/js/7d19853e.b1e73c48.js similarity index 98% rename from assets/js/7d19853e.e7cbb24e.js rename to assets/js/7d19853e.b1e73c48.js index c2502017..aa6369d1 100644 --- a/assets/js/7d19853e.e7cbb24e.js +++ b/assets/js/7d19853e.b1e73c48.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3917],{4425:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>u,contentTitle:()=>a,default:()=>d,frontMatter:()=>s,metadata:()=>o,toc:()=>l});const o=JSON.parse('{"id":"contributing/bounty-program","title":"Bounty Program","description":"We\'re excited to announce that Calimero will soon be launching a bounty program!","source":"@site/docs/09-contributing/03-bounty-program.mdx","sourceDirName":"09-contributing","slug":"/contributing/bounty-program","permalink":"/contributing/bounty-program","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/09-contributing/03-bounty-program.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":3,"frontMatter":{"id":"bounty-program","title":"Bounty Program"},"sidebar":"tutorialSidebar","previous":{"title":"Hackathons","permalink":"/contributing/hackathons"},"next":{"title":"Community and Support","permalink":"/support/community-and-support"}}');var r=t(6070),i=t(5248);const s={id:"bounty-program",title:"Bounty Program"},a="Bounty Program",u={},l=[{value:"What is a Bounty Program?",id:"what-is-a-bounty-program",level:2},{value:"How it Works",id:"how-it-works",level:2},{value:"Exceptional Contributions",id:"exceptional-contributions",level:3},{value:"Stay Tuned",id:"stay-tuned",level:2}];function c(e){const n={a:"a",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",ol:"ol",p:"p",strong:"strong",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"bounty-program",children:"Bounty Program"})}),"\n",(0,r.jsx)(n.p,{children:"We're excited to announce that Calimero will soon be launching a bounty program!\nThis program is designed to reward contributors who help us tackle various\nissues and enhance our project."}),"\n",(0,r.jsx)(n.h2,{id:"what-is-a-bounty-program",children:"What is a Bounty Program?"}),"\n",(0,r.jsx)(n.p,{children:"A bounty program is an initiative where contributors can earn rewards for\ncompleting specific tasks or resolving issues. These tasks can range from fixing\nbugs to adding new features, improving documentation, or optimizing performance.\nThe rewards can vary and may include monetary compensation, swag, exclusive\naccess to new features, or public recognition."}),"\n",(0,r.jsx)(n.h2,{id:"how-it-works",children:"How it Works"}),"\n",(0,r.jsx)(n.p,{children:"While we are still in the process of finalizing the details of our bounty\nprogram, here\u2019s an overview of how it will function:"}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Identify Bounty Issues:"})," We will mark specific\n",(0,r.jsx)(n.a,{href:"https://github.com/calimero-network/core/issues",children:"issues"}),' in our repository\nwith a "bounty" label. These issues will be eligible for rewards.']}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Contribute:"})," Choose a bounty-labeled issue that interests you, solve it,\nand submit a pull request."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Review:"})," Our team will review your contribution. If your solution meets\nthe requirements and quality standards, it will be merged."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Reward:"})," Once the issue is resolved and your contribution is accepted, you\nwill receive a reward. The exact nature of the reward will be specified in\nthe issue description."]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"exceptional-contributions",children:"Exceptional Contributions"}),"\n",(0,r.jsx)(n.p,{children:"While not all issues may be marked with a bounty label, we recognize that\nexceptional solutions deserve recognition. If you provide a particularly\noutstanding solution to an issue not marked as a bounty, we may still decide to\nreward your contribution."}),"\n",(0,r.jsx)(n.h2,{id:"stay-tuned",children:"Stay Tuned"}),"\n",(0,r.jsx)(n.p,{children:"We are currently refining the details of our bounty program, including the\nreward system. Follow us on social media and keep an eye on our announcements to\nbe the first to know when the bounty program goes live."}),"\n",(0,r.jsx)(n.p,{children:"Thank you for your patience and continued support. We look forward to\ncollaborating with you and rewarding your valuable contributions!"})]})}function d(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},5248:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>a});var o=t(758);const r={},i=o.createContext(r);function s(e){const n=o.useContext(i);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:s(e.components),o.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3917],{4425:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>u,contentTitle:()=>a,default:()=>d,frontMatter:()=>s,metadata:()=>o,toc:()=>l});const o=JSON.parse('{"id":"contributing/bounty-program","title":"Bounty Program","description":"We\'re excited to announce that Calimero will soon be launching a bounty program!","source":"@site/docs/09-contributing/03-bounty-program.mdx","sourceDirName":"09-contributing","slug":"/contributing/bounty-program","permalink":"/contributing/bounty-program","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/09-contributing/03-bounty-program.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":3,"frontMatter":{"id":"bounty-program","title":"Bounty Program"},"sidebar":"tutorialSidebar","previous":{"title":"Hackathons","permalink":"/contributing/hackathons"},"next":{"title":"Community and Support","permalink":"/support/community-and-support"}}');var r=t(6070),i=t(5248);const s={id:"bounty-program",title:"Bounty Program"},a="Bounty Program",u={},l=[{value:"What is a Bounty Program?",id:"what-is-a-bounty-program",level:2},{value:"How it Works",id:"how-it-works",level:2},{value:"Exceptional Contributions",id:"exceptional-contributions",level:3},{value:"Stay Tuned",id:"stay-tuned",level:2}];function c(e){const n={a:"a",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",ol:"ol",p:"p",strong:"strong",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"bounty-program",children:"Bounty Program"})}),"\n",(0,r.jsx)(n.p,{children:"We're excited to announce that Calimero will soon be launching a bounty program!\nThis program is designed to reward contributors who help us tackle various\nissues and enhance our project."}),"\n",(0,r.jsx)(n.h2,{id:"what-is-a-bounty-program",children:"What is a Bounty Program?"}),"\n",(0,r.jsx)(n.p,{children:"A bounty program is an initiative where contributors can earn rewards for\ncompleting specific tasks or resolving issues. These tasks can range from fixing\nbugs to adding new features, improving documentation, or optimizing performance.\nThe rewards can vary and may include monetary compensation, swag, exclusive\naccess to new features, or public recognition."}),"\n",(0,r.jsx)(n.h2,{id:"how-it-works",children:"How it Works"}),"\n",(0,r.jsx)(n.p,{children:"While we are still in the process of finalizing the details of our bounty\nprogram, here\u2019s an overview of how it will function:"}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Identify Bounty Issues:"})," We will mark specific\n",(0,r.jsx)(n.a,{href:"https://github.com/calimero-network/core/issues",children:"issues"}),' in our repository\nwith a "bounty" label. These issues will be eligible for rewards.']}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Contribute:"})," Choose a bounty-labeled issue that interests you, solve it,\nand submit a pull request."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Review:"})," Our team will review your contribution. If your solution meets\nthe requirements and quality standards, it will be merged."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Reward:"})," Once the issue is resolved and your contribution is accepted, you\nwill receive a reward. The exact nature of the reward will be specified in\nthe issue description."]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"exceptional-contributions",children:"Exceptional Contributions"}),"\n",(0,r.jsx)(n.p,{children:"While not all issues may be marked with a bounty label, we recognize that\nexceptional solutions deserve recognition. If you provide a particularly\noutstanding solution to an issue not marked as a bounty, we may still decide to\nreward your contribution."}),"\n",(0,r.jsx)(n.h2,{id:"stay-tuned",children:"Stay Tuned"}),"\n",(0,r.jsx)(n.p,{children:"We are currently refining the details of our bounty program, including the\nreward system. Follow us on social media and keep an eye on our announcements to\nbe the first to know when the bounty program goes live."}),"\n",(0,r.jsx)(n.p,{children:"Thank you for your patience and continued support. We look forward to\ncollaborating with you and rewarding your valuable contributions!"})]})}function d(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},5248:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>a});var o=t(758);const r={},i=o.createContext(r);function s(e){const n=o.useContext(i);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:s(e.components),o.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/811bcaba.a7425146.js b/assets/js/811bcaba.78f0bcf9.js similarity index 99% rename from assets/js/811bcaba.a7425146.js rename to assets/js/811bcaba.78f0bcf9.js index e3ddd1b2..1a1befce 100644 --- a/assets/js/811bcaba.a7425146.js +++ b/assets/js/811bcaba.78f0bcf9.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4420],{7331:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>c,default:()=>d,frontMatter:()=>r,metadata:()=>i,toc:()=>l});const i=JSON.parse('{"id":"developer-tools/SDK/client-sdk/client-ts-sdk","title":"TypeScript Client SDK","description":"Getting Started with Calimero SDK for Typescript","source":"@site/docs/05-developer-tools/02-SDK/04-client-sdk/calimero-client-js.mdx","sourceDirName":"05-developer-tools/02-SDK/04-client-sdk","slug":"/developer-tools/SDK/client-sdk/client-ts-sdk","permalink":"/developer-tools/SDK/client-sdk/client-ts-sdk","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/05-developer-tools/02-SDK/04-client-sdk/calimero-client-js.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"frontMatter":{"id":"client-ts-sdk","title":"TypeScript Client SDK"},"sidebar":"tutorialSidebar","previous":{"title":"Rust Protocol SDK","permalink":"/developer-tools/SDK/protocol-sdk/protocol-rs-sdk"},"next":{"title":"Admin Dashboard","permalink":"/developer-tools/apps/admin-dashboard"}}');var s=t(6070),o=t(5248);const r={id:"client-ts-sdk",title:"TypeScript Client SDK"},c=void 0,a={},l=[{value:"Getting Started with Calimero SDK for Typescript",id:"getting-started-with-calimero-sdk-for-typescript",level:2},{value:"Components",id:"components",level:3},{value:"RpcClient interface",id:"rpcclient-interface",level:4},{value:"SubscriptionsClient",id:"subscriptionsclient",level:4},{value:"Examples",id:"examples",level:3},{value:"JsonRpcClient",id:"jsonrpcclient",level:4},{value:"WsSubscriptionsClient",id:"wssubscriptionsclient",level:4}];function p(e){const n={code:"code",h2:"h2",h3:"h3",h4:"h4",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h2,{id:"getting-started-with-calimero-sdk-for-typescript",children:"Getting Started with Calimero SDK for Typescript"}),"\n",(0,s.jsx)(n.p,{children:"Our TypeScript Client SDK is a powerful tool designed to simplify the process of\ninteracting with decentralized peer-to-peer applications installed on the node.\nIt serves as an efficient conduit for communication between the client and the\nnode\u2019s server. This SDK is particularly beneficial for developers as it\nabstracts the complexities of server communication, allowing them to concentrate\non the core application logic."}),"\n",(0,s.jsx)(n.p,{children:"The SDK is built with the modern features of TypeScript, a language that is\ngaining popularity for its static typing and advanced capabilities. By using our\nSDK, developers can write applications in TypeScript, and the SDK takes care of\nthe rest. It handles all the interactions with the server, making the\ndevelopment process more streamlined and efficient."}),"\n",(0,s.jsx)(n.p,{children:"This not only enhances the overall development experience but also accelerates\nthe deployment of innovative decentralized applications on our network. In\nessence, our TypeScript SDK is a comprehensive solution that makes building and\ninteracting with decentralized applications a breeze. It\u2019s all about making the\ndevelopment process more enjoyable and productive for developers worldwide."}),"\n",(0,s.jsx)(n.h3,{id:"components",children:"Components"}),"\n",(0,s.jsxs)(n.p,{children:["Our TypeScript Client SDK is composed of two main components: ",(0,s.jsx)(n.code,{children:"RpcClient"})," and\n",(0,s.jsx)(n.code,{children:"SubscriptionsClient"}),". Each of these components has an interface and a class\nthat implements the interface. The ",(0,s.jsx)(n.code,{children:"RpcClient"})," interface is implemented by the\n",(0,s.jsx)(n.code,{children:"JsonRpcClient"})," class, and the ",(0,s.jsx)(n.code,{children:"SubscriptionsClient"})," interface is implemented by\nthe ",(0,s.jsx)(n.code,{children:"WsSubscriptionsClient"})," class."]}),"\n",(0,s.jsx)(n.p,{children:"These components are designed with flexibility and future growth in mind. While\ncurrently there is only one implementation of each interface, we anticipate\nmultiple implementations in the future. This is because our server will have\nmultiple implementations of both the Rpc server and the Subscriptions server.\nThis design allows us to easily add new classes that implement these interfaces\nas our server capabilities expand."}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"RpcClient"})," and ",(0,s.jsx)(n.code,{children:"SubscriptionsClient"})," interfaces define a standard set of\nmethods that all implementations must provide. This ensures consistency across\ndifferent implementations, making it easier for developers to switch between\ndifferent Rpc and Subscriptions servers as needed."]}),"\n",(0,s.jsx)(n.p,{children:"By designing our SDK in this way, we ensure that it remains flexible, scalable,\nand easy to use, regardless of how our server implementations evolve in the\nfuture."}),"\n",(0,s.jsx)(n.h4,{id:"rpcclient-interface",children:"RpcClient interface"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:"export interface RpcClient {\n query(\n params: RpcQueryParams,\n config?: RequestConfig,\n ): Promise>;\n mutate(\n params: RpcMutateParams,\n config?: RequestConfig,\n ): Promise>;\n}\n\nexport interface RequestConfig {\n timeout?: number;\n}\n\nexport interface RpcQueryParams {\n applicationId: ApplicationId;\n method: string;\n argsJson: Args;\n}\n\nexport interface RpcQueryResponse {\n output?: Output;\n}\n\nexport interface RpcMutateParams {\n applicationId: ApplicationId;\n method: string;\n argsJson: Args;\n}\n\nexport interface RpcMutateResponse {\n output?: Output;\n}\n"})}),"\n",(0,s.jsx)(n.h4,{id:"subscriptionsclient",children:"SubscriptionsClient"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:"export interface SubscriptionsClient {\n connect(connectionId?: string): Promise;\n disconnect(connectionId?: string): void;\n subscribe(contextIds: string[], connectionId?: string): void;\n unsubscribe(contextIds: string[], connectionId?: string): void;\n addCallback(\n callback: (event: NodeEvent) => void,\n connectionId?: string,\n ): void;\n removeCallback(\n callback: (event: NodeEvent) => void,\n connectionId?: string,\n ): void;\n}\n\nexport type NodeEvent = ContextEvent;\n\nexport type ContextEvent = ContextEventPayload & {\n contextId: ContextId;\n};\n\ntype ContextEventPayload =\n | {\n type: 'StateMutation';\n data: StateMutation;\n }\n | {\n type: 'ExecutionEvent';\n data: ExecutionEvent;\n };\n\nexport interface StateMutation {\n newRoot: string;\n}\n\nexport interface ExecutionEvent {\n kind: string;\n data: any;\n}\n"})}),"\n",(0,s.jsx)(n.h3,{id:"examples",children:"Examples"}),"\n",(0,s.jsx)(n.h4,{id:"jsonrpcclient",children:"JsonRpcClient"}),"\n",(0,s.jsx)(n.p,{children:"Here's an example of how to use it:"}),"\n",(0,s.jsx)(n.p,{children:"Define application endpoint and application id. You can find application id in\nthe Admin Dashboard -> Contexts -> select application id from the context where\nyour app logic is installed"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{children:'NEXT_PUBLIC_API_URL=http://localhost:{NODE_PORT}\nNEXT_PUBLIC_APPLICATION_ID="my-application-id"\n'})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:'// Import the necessary classes and interfaces from the SDK\nimport {\n RpcClient,\n JsonRpcClient,\n RpcMutateParams,\n RpcMutateResponse,\n} from "@calimero-is-near/calimero-p2p-sdk";\n\n// Define the Args and Output interfaces\ninterface CreatePost {\n title: string;\n text: string;\n}\n\ninterface Post {\n id: string;\n title: string;\n text: string;\n}\n\n// Create an instance of JsonRpcClient\nconst rpcClient: RpcClient = new JsonRpcClient(\n process.env["NEXT_PUBLIC_API_URL],\n "/jsonrpc"\n);\n\n// Define the parameters for the mutate\nconst params: RpcMutateParams = {\n applicationId: process.env["NEXT_PUBLIC_APPLICATION_ID"],\n method: "create_post",\n argsJson: {\n title: "My First Post",\n text: "This is my first post using the TypeScript Client SDK",\n },\n};\n\n// Use the execute method\nconst respone: RpcMutateResponse = await rpcClient.execute<\nCreatePost,\nPost\n\n> (params);\n\nconsole.log(response);\n\n'})}),"\n",(0,s.jsx)(n.h4,{id:"wssubscriptionsclient",children:"WsSubscriptionsClient"}),"\n",(0,s.jsx)(n.p,{children:"Here's an example of how to use it:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:'// Import the necessary classes and interfaces from the SDK\nimport {\n SubscriptionsClient,\n WsSubscriptionsClient,\n NodeEvent,\n} from "@calimero-is-near/calimero-p2p-sdk";\n\n// Create an instance of WsSubscriptionsClient\nconst subscriptionsClient: SubscriptionsClient = new WsSubscriptionsClient(\n process.env["NEXT_PUBLIC_API_URL],\n "/ws"\n);\n\n// Create (default) connection to the server\nawait subscriptionsClient.connect();\n\n// Subscribe to an application events\nsubscriptionsClient.subscribe([process.env["NEXT_PUBLIC_APPLICATION_ID"]]);\n\n// Add a callback to process messages\nsubscriptionsClient.addCallback((data: NodeEvent) => {\n console.log(data);\n});\n'})})]})}function d(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},5248:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>c});var i=t(758);const s={},o=i.createContext(s);function r(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4420],{7331:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>c,default:()=>d,frontMatter:()=>r,metadata:()=>i,toc:()=>l});const i=JSON.parse('{"id":"developer-tools/SDK/client-sdk/client-ts-sdk","title":"TypeScript Client SDK","description":"Getting Started with Calimero SDK for Typescript","source":"@site/docs/05-developer-tools/02-SDK/04-client-sdk/calimero-client-js.mdx","sourceDirName":"05-developer-tools/02-SDK/04-client-sdk","slug":"/developer-tools/SDK/client-sdk/client-ts-sdk","permalink":"/developer-tools/SDK/client-sdk/client-ts-sdk","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/05-developer-tools/02-SDK/04-client-sdk/calimero-client-js.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"frontMatter":{"id":"client-ts-sdk","title":"TypeScript Client SDK"},"sidebar":"tutorialSidebar","previous":{"title":"Rust Protocol SDK","permalink":"/developer-tools/SDK/protocol-sdk/protocol-rs-sdk"},"next":{"title":"Admin Dashboard","permalink":"/developer-tools/apps/admin-dashboard"}}');var s=t(6070),o=t(5248);const r={id:"client-ts-sdk",title:"TypeScript Client SDK"},c=void 0,a={},l=[{value:"Getting Started with Calimero SDK for Typescript",id:"getting-started-with-calimero-sdk-for-typescript",level:2},{value:"Components",id:"components",level:3},{value:"RpcClient interface",id:"rpcclient-interface",level:4},{value:"SubscriptionsClient",id:"subscriptionsclient",level:4},{value:"Examples",id:"examples",level:3},{value:"JsonRpcClient",id:"jsonrpcclient",level:4},{value:"WsSubscriptionsClient",id:"wssubscriptionsclient",level:4}];function p(e){const n={code:"code",h2:"h2",h3:"h3",h4:"h4",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h2,{id:"getting-started-with-calimero-sdk-for-typescript",children:"Getting Started with Calimero SDK for Typescript"}),"\n",(0,s.jsx)(n.p,{children:"Our TypeScript Client SDK is a powerful tool designed to simplify the process of\ninteracting with decentralized peer-to-peer applications installed on the node.\nIt serves as an efficient conduit for communication between the client and the\nnode\u2019s server. This SDK is particularly beneficial for developers as it\nabstracts the complexities of server communication, allowing them to concentrate\non the core application logic."}),"\n",(0,s.jsx)(n.p,{children:"The SDK is built with the modern features of TypeScript, a language that is\ngaining popularity for its static typing and advanced capabilities. By using our\nSDK, developers can write applications in TypeScript, and the SDK takes care of\nthe rest. It handles all the interactions with the server, making the\ndevelopment process more streamlined and efficient."}),"\n",(0,s.jsx)(n.p,{children:"This not only enhances the overall development experience but also accelerates\nthe deployment of innovative decentralized applications on our network. In\nessence, our TypeScript SDK is a comprehensive solution that makes building and\ninteracting with decentralized applications a breeze. It\u2019s all about making the\ndevelopment process more enjoyable and productive for developers worldwide."}),"\n",(0,s.jsx)(n.h3,{id:"components",children:"Components"}),"\n",(0,s.jsxs)(n.p,{children:["Our TypeScript Client SDK is composed of two main components: ",(0,s.jsx)(n.code,{children:"RpcClient"})," and\n",(0,s.jsx)(n.code,{children:"SubscriptionsClient"}),". Each of these components has an interface and a class\nthat implements the interface. The ",(0,s.jsx)(n.code,{children:"RpcClient"})," interface is implemented by the\n",(0,s.jsx)(n.code,{children:"JsonRpcClient"})," class, and the ",(0,s.jsx)(n.code,{children:"SubscriptionsClient"})," interface is implemented by\nthe ",(0,s.jsx)(n.code,{children:"WsSubscriptionsClient"})," class."]}),"\n",(0,s.jsx)(n.p,{children:"These components are designed with flexibility and future growth in mind. While\ncurrently there is only one implementation of each interface, we anticipate\nmultiple implementations in the future. This is because our server will have\nmultiple implementations of both the Rpc server and the Subscriptions server.\nThis design allows us to easily add new classes that implement these interfaces\nas our server capabilities expand."}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"RpcClient"})," and ",(0,s.jsx)(n.code,{children:"SubscriptionsClient"})," interfaces define a standard set of\nmethods that all implementations must provide. This ensures consistency across\ndifferent implementations, making it easier for developers to switch between\ndifferent Rpc and Subscriptions servers as needed."]}),"\n",(0,s.jsx)(n.p,{children:"By designing our SDK in this way, we ensure that it remains flexible, scalable,\nand easy to use, regardless of how our server implementations evolve in the\nfuture."}),"\n",(0,s.jsx)(n.h4,{id:"rpcclient-interface",children:"RpcClient interface"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:"export interface RpcClient {\n query(\n params: RpcQueryParams,\n config?: RequestConfig,\n ): Promise>;\n mutate(\n params: RpcMutateParams,\n config?: RequestConfig,\n ): Promise>;\n}\n\nexport interface RequestConfig {\n timeout?: number;\n}\n\nexport interface RpcQueryParams {\n applicationId: ApplicationId;\n method: string;\n argsJson: Args;\n}\n\nexport interface RpcQueryResponse {\n output?: Output;\n}\n\nexport interface RpcMutateParams {\n applicationId: ApplicationId;\n method: string;\n argsJson: Args;\n}\n\nexport interface RpcMutateResponse {\n output?: Output;\n}\n"})}),"\n",(0,s.jsx)(n.h4,{id:"subscriptionsclient",children:"SubscriptionsClient"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:"export interface SubscriptionsClient {\n connect(connectionId?: string): Promise;\n disconnect(connectionId?: string): void;\n subscribe(contextIds: string[], connectionId?: string): void;\n unsubscribe(contextIds: string[], connectionId?: string): void;\n addCallback(\n callback: (event: NodeEvent) => void,\n connectionId?: string,\n ): void;\n removeCallback(\n callback: (event: NodeEvent) => void,\n connectionId?: string,\n ): void;\n}\n\nexport type NodeEvent = ContextEvent;\n\nexport type ContextEvent = ContextEventPayload & {\n contextId: ContextId;\n};\n\ntype ContextEventPayload =\n | {\n type: 'StateMutation';\n data: StateMutation;\n }\n | {\n type: 'ExecutionEvent';\n data: ExecutionEvent;\n };\n\nexport interface StateMutation {\n newRoot: string;\n}\n\nexport interface ExecutionEvent {\n kind: string;\n data: any;\n}\n"})}),"\n",(0,s.jsx)(n.h3,{id:"examples",children:"Examples"}),"\n",(0,s.jsx)(n.h4,{id:"jsonrpcclient",children:"JsonRpcClient"}),"\n",(0,s.jsx)(n.p,{children:"Here's an example of how to use it:"}),"\n",(0,s.jsx)(n.p,{children:"Define application endpoint and application id. You can find application id in\nthe Admin Dashboard -> Contexts -> select application id from the context where\nyour app logic is installed"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{children:'NEXT_PUBLIC_API_URL=http://localhost:{NODE_PORT}\nNEXT_PUBLIC_APPLICATION_ID="my-application-id"\n'})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:'// Import the necessary classes and interfaces from the SDK\nimport {\n RpcClient,\n JsonRpcClient,\n RpcMutateParams,\n RpcMutateResponse,\n} from "@calimero-is-near/calimero-p2p-sdk";\n\n// Define the Args and Output interfaces\ninterface CreatePost {\n title: string;\n text: string;\n}\n\ninterface Post {\n id: string;\n title: string;\n text: string;\n}\n\n// Create an instance of JsonRpcClient\nconst rpcClient: RpcClient = new JsonRpcClient(\n process.env["NEXT_PUBLIC_API_URL],\n "/jsonrpc"\n);\n\n// Define the parameters for the mutate\nconst params: RpcMutateParams = {\n applicationId: process.env["NEXT_PUBLIC_APPLICATION_ID"],\n method: "create_post",\n argsJson: {\n title: "My First Post",\n text: "This is my first post using the TypeScript Client SDK",\n },\n};\n\n// Use the execute method\nconst respone: RpcMutateResponse = await rpcClient.execute<\nCreatePost,\nPost\n\n> (params);\n\nconsole.log(response);\n\n'})}),"\n",(0,s.jsx)(n.h4,{id:"wssubscriptionsclient",children:"WsSubscriptionsClient"}),"\n",(0,s.jsx)(n.p,{children:"Here's an example of how to use it:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:'// Import the necessary classes and interfaces from the SDK\nimport {\n SubscriptionsClient,\n WsSubscriptionsClient,\n NodeEvent,\n} from "@calimero-is-near/calimero-p2p-sdk";\n\n// Create an instance of WsSubscriptionsClient\nconst subscriptionsClient: SubscriptionsClient = new WsSubscriptionsClient(\n process.env["NEXT_PUBLIC_API_URL],\n "/ws"\n);\n\n// Create (default) connection to the server\nawait subscriptionsClient.connect();\n\n// Subscribe to an application events\nsubscriptionsClient.subscribe([process.env["NEXT_PUBLIC_APPLICATION_ID"]]);\n\n// Add a callback to process messages\nsubscriptionsClient.addCallback((data: NodeEvent) => {\n console.log(data);\n});\n'})})]})}function d(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},5248:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>c});var i=t(758);const s={},o=i.createContext(s);function r(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/85fabe5c.ca9e7a00.js b/assets/js/85fabe5c.d39cbefc.js similarity index 99% rename from assets/js/85fabe5c.ca9e7a00.js rename to assets/js/85fabe5c.d39cbefc.js index e215035c..4cc42d09 100644 --- a/assets/js/85fabe5c.ca9e7a00.js +++ b/assets/js/85fabe5c.d39cbefc.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7718],{6486:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>u,contentTitle:()=>c,default:()=>p,frontMatter:()=>i,metadata:()=>t,toc:()=>d});const t=JSON.parse('{"id":"shared/install-meroctl","title":"install-meroctl","description":"You can choose to install meroctl using either the installation script or","source":"@site/docs/shared/install-meroctl.mdx","sourceDirName":"shared","slug":"/shared/install-meroctl","permalink":"/shared/install-meroctl","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/shared/install-meroctl.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"Learning","permalink":"/support/learning"},"next":{"title":"install-merod","permalink":"/shared/install-merod"}}');var s=r(6070),l=r(5248),a=r(3505),o=r(7576);const i={},c=void 0,u={},d=[{value:"Steps",id:"steps",level:4},{value:"Steps",id:"steps-1",level:4},{value:"Notes for Shell Environments",id:"notes-for-shell-environments",level:4}];function h(e){const n={code:"code",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,l.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["You can choose to install ",(0,s.jsx)(n.code,{children:"meroctl"})," using either the installation script or\nHomebrew."]}),"\n","\n",(0,s.jsxs)(a.A,{defaultValue:"homebrew",values:[{label:"Homebrew",value:"homebrew"},{label:"Installation Script",value:"script"}],children:[(0,s.jsxs)(o.A,{value:"homebrew",children:[(0,s.jsxs)(n.p,{children:["If you use Homebrew, you can install ",(0,s.jsx)(n.code,{children:"meroctl"})," directly with the following\nsteps:"]}),(0,s.jsx)(n.h4,{id:"steps",children:"Steps"}),(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Add the Calimero Homebrew tap:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"brew tap calimero-network/homebrew-tap\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Install ",(0,s.jsx)(n.code,{children:"merod"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"brew install meroctl\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Verify the installation:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"meroctl --version\n"})}),"\n"]}),"\n"]}),(0,s.jsx)(n.p,{children:"If the version number appears, the installation was successful."})]}),(0,s.jsxs)(o.A,{value:"script",children:[(0,s.jsx)(n.p,{children:"The installation script supports multiple terminal environments and will\nautomatically configure your PATH based on your shell."}),(0,s.jsx)(n.h4,{id:"steps-1",children:"Steps"}),(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Open your terminal and run:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"curl -sSf https://raw.githubusercontent.com/calimero-network/core/master/scripts/install-meroctl.sh | bash\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Source the updated PATH:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"source \n"})}),"\n",(0,s.jsxs)(n.p,{children:["Replace ",(0,s.jsx)(n.code,{children:""})," with ",(0,s.jsx)(n.code,{children:".bashrc"}),", ",(0,s.jsx)(n.code,{children:".zshrc"}),", or the relevant\nconfiguration file for your shell."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Verify the installation:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"meroctl --version\n"})}),"\n"]}),"\n"]}),(0,s.jsx)(n.p,{children:"If the version number appears, the installation was successful."}),(0,s.jsx)(n.h4,{id:"notes-for-shell-environments",children:"Notes for Shell Environments"}),(0,s.jsx)(n.p,{children:"The script automatically updates your PATH based on your shell configuration:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Bash"}),": Updates ",(0,s.jsx)(n.code,{children:".bashrc"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Zsh"}),": Updates ",(0,s.jsx)(n.code,{children:".zshrc"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Fish"}),": Modifies ",(0,s.jsx)(n.code,{children:"~/.config/fish/config.fish"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Csh/Tcsh"}),": Updates ",(0,s.jsx)(n.code,{children:".cshrc"}),"."]}),"\n"]}),(0,s.jsxs)(n.p,{children:["To apply the changes immediately, use the ",(0,s.jsx)(n.code,{children:"source"})," command as described in step\n2 above."]})]})]})]})}function p(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},7576:(e,n,r)=>{r.d(n,{A:()=>a});r(758);var t=r(3526);const s={tabItem:"tabItem_KLga"};var l=r(6070);function a(e){let{children:n,hidden:r,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,t.A)(s.tabItem,a),hidden:r,children:n})}},3505:(e,n,r)=>{r.d(n,{A:()=>y});var t=r(758),s=r(3526),l=r(8155),a=r(5557),o=r(5536),i=r(7852),c=r(1381),u=r(4012);function d(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:r}=e;return(0,t.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:r,attributes:t,default:s}}=e;return{value:n,label:r,attributes:t,default:s}}))}(r);return function(e){const n=(0,c.XI)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,r])}function p(e){let{value:n,tabValues:r}=e;return r.some((e=>e.value===n))}function m(e){let{queryString:n=!1,groupId:r}=e;const s=(0,a.W6)(),l=function(e){let{queryString:n=!1,groupId:r}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:n,groupId:r});return[(0,i.aZ)(l),(0,t.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(s.location.search);n.set(l,e),s.replace({...s.location,search:n.toString()})}),[l,s])]}function f(e){const{defaultValue:n,queryString:r=!1,groupId:s}=e,l=h(e),[a,i]=(0,t.useState)((()=>function(e){let{defaultValue:n,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const t=r.find((e=>e.default))??r[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:l}))),[c,d]=m({queryString:r,groupId:s}),[f,b]=function(e){let{groupId:n}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(n),[s,l]=(0,u.Dv)(r);return[s,(0,t.useCallback)((e=>{r&&l.set(e)}),[r,l])]}({groupId:s}),x=(()=>{const e=c??f;return p({value:e,tabValues:l})?e:null})();(0,o.A)((()=>{x&&i(x)}),[x]);return{selectedValue:a,selectValue:(0,t.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),b(e)}),[d,b,l]),tabValues:l}}var b=r(2236);const x={tabList:"tabList_B3_y",tabItem:"tabItem_z210"};var j=r(6070);function v(e){let{className:n,block:r,selectedValue:t,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.a_)(),u=e=>{const n=e.currentTarget,r=i.indexOf(n),s=o[r].value;s!==t&&(c(n),a(s))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const r=i.indexOf(e.currentTarget)+1;n=i[r]??i[0];break}case"ArrowLeft":{const r=i.indexOf(e.currentTarget)-1;n=i[r]??i[i.length-1];break}}n?.focus()};return(0,j.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":r},n),children:o.map((e=>{let{value:n,label:r,attributes:l}=e;return(0,j.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,s.A)("tabs__item",x.tabItem,l?.className,{"tabs__item--active":t===n}),children:r??n},n)}))})}function g(e){let{lazy:n,children:r,selectedValue:l}=e;const a=(Array.isArray(r)?r:[r]).filter(Boolean);if(n){const e=a.find((e=>e.props.value===l));return e?(0,t.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,j.jsx)("div",{className:"margin-top--md",children:a.map(((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==l})))})}function w(e){const n=f(e);return(0,j.jsxs)("div",{className:(0,s.A)("tabs-container",x.tabList),children:[(0,j.jsx)(v,{...n,...e}),(0,j.jsx)(g,{...n,...e})]})}function y(e){const n=(0,b.A)();return(0,j.jsx)(w,{...e,children:d(e.children)},String(n))}},5248:(e,n,r)=>{r.d(n,{R:()=>a,x:()=>o});var t=r(758);const s={},l=t.createContext(s);function a(e){const n=t.useContext(l);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7718],{6486:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>u,contentTitle:()=>c,default:()=>p,frontMatter:()=>i,metadata:()=>t,toc:()=>d});const t=JSON.parse('{"id":"shared/install-meroctl","title":"install-meroctl","description":"You can choose to install meroctl using either the installation script or","source":"@site/docs/shared/install-meroctl.mdx","sourceDirName":"shared","slug":"/shared/install-meroctl","permalink":"/shared/install-meroctl","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/shared/install-meroctl.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"Learning","permalink":"/support/learning"},"next":{"title":"install-merod","permalink":"/shared/install-merod"}}');var s=r(6070),l=r(5248),a=r(3505),o=r(7576);const i={},c=void 0,u={},d=[{value:"Steps",id:"steps",level:4},{value:"Steps",id:"steps-1",level:4},{value:"Notes for Shell Environments",id:"notes-for-shell-environments",level:4}];function h(e){const n={code:"code",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,l.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["You can choose to install ",(0,s.jsx)(n.code,{children:"meroctl"})," using either the installation script or\nHomebrew."]}),"\n","\n",(0,s.jsxs)(a.A,{defaultValue:"homebrew",values:[{label:"Homebrew",value:"homebrew"},{label:"Installation Script",value:"script"}],children:[(0,s.jsxs)(o.A,{value:"homebrew",children:[(0,s.jsxs)(n.p,{children:["If you use Homebrew, you can install ",(0,s.jsx)(n.code,{children:"meroctl"})," directly with the following\nsteps:"]}),(0,s.jsx)(n.h4,{id:"steps",children:"Steps"}),(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Add the Calimero Homebrew tap:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"brew tap calimero-network/homebrew-tap\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Install ",(0,s.jsx)(n.code,{children:"merod"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"brew install meroctl\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Verify the installation:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"meroctl --version\n"})}),"\n"]}),"\n"]}),(0,s.jsx)(n.p,{children:"If the version number appears, the installation was successful."})]}),(0,s.jsxs)(o.A,{value:"script",children:[(0,s.jsx)(n.p,{children:"The installation script supports multiple terminal environments and will\nautomatically configure your PATH based on your shell."}),(0,s.jsx)(n.h4,{id:"steps-1",children:"Steps"}),(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Open your terminal and run:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"curl -sSf https://raw.githubusercontent.com/calimero-network/core/master/scripts/install-meroctl.sh | bash\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Source the updated PATH:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"source \n"})}),"\n",(0,s.jsxs)(n.p,{children:["Replace ",(0,s.jsx)(n.code,{children:""})," with ",(0,s.jsx)(n.code,{children:".bashrc"}),", ",(0,s.jsx)(n.code,{children:".zshrc"}),", or the relevant\nconfiguration file for your shell."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Verify the installation:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"meroctl --version\n"})}),"\n"]}),"\n"]}),(0,s.jsx)(n.p,{children:"If the version number appears, the installation was successful."}),(0,s.jsx)(n.h4,{id:"notes-for-shell-environments",children:"Notes for Shell Environments"}),(0,s.jsx)(n.p,{children:"The script automatically updates your PATH based on your shell configuration:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Bash"}),": Updates ",(0,s.jsx)(n.code,{children:".bashrc"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Zsh"}),": Updates ",(0,s.jsx)(n.code,{children:".zshrc"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Fish"}),": Modifies ",(0,s.jsx)(n.code,{children:"~/.config/fish/config.fish"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Csh/Tcsh"}),": Updates ",(0,s.jsx)(n.code,{children:".cshrc"}),"."]}),"\n"]}),(0,s.jsxs)(n.p,{children:["To apply the changes immediately, use the ",(0,s.jsx)(n.code,{children:"source"})," command as described in step\n2 above."]})]})]})]})}function p(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},7576:(e,n,r)=>{r.d(n,{A:()=>a});r(758);var t=r(3526);const s={tabItem:"tabItem_KLga"};var l=r(6070);function a(e){let{children:n,hidden:r,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,t.A)(s.tabItem,a),hidden:r,children:n})}},3505:(e,n,r)=>{r.d(n,{A:()=>y});var t=r(758),s=r(3526),l=r(8155),a=r(5557),o=r(5536),i=r(7852),c=r(1381),u=r(4012);function d(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:r}=e;return(0,t.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:r,attributes:t,default:s}}=e;return{value:n,label:r,attributes:t,default:s}}))}(r);return function(e){const n=(0,c.XI)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,r])}function p(e){let{value:n,tabValues:r}=e;return r.some((e=>e.value===n))}function m(e){let{queryString:n=!1,groupId:r}=e;const s=(0,a.W6)(),l=function(e){let{queryString:n=!1,groupId:r}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:n,groupId:r});return[(0,i.aZ)(l),(0,t.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(s.location.search);n.set(l,e),s.replace({...s.location,search:n.toString()})}),[l,s])]}function f(e){const{defaultValue:n,queryString:r=!1,groupId:s}=e,l=h(e),[a,i]=(0,t.useState)((()=>function(e){let{defaultValue:n,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const t=r.find((e=>e.default))??r[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:l}))),[c,d]=m({queryString:r,groupId:s}),[f,b]=function(e){let{groupId:n}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(n),[s,l]=(0,u.Dv)(r);return[s,(0,t.useCallback)((e=>{r&&l.set(e)}),[r,l])]}({groupId:s}),x=(()=>{const e=c??f;return p({value:e,tabValues:l})?e:null})();(0,o.A)((()=>{x&&i(x)}),[x]);return{selectedValue:a,selectValue:(0,t.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),b(e)}),[d,b,l]),tabValues:l}}var b=r(2236);const x={tabList:"tabList_B3_y",tabItem:"tabItem_z210"};var j=r(6070);function v(e){let{className:n,block:r,selectedValue:t,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.a_)(),u=e=>{const n=e.currentTarget,r=i.indexOf(n),s=o[r].value;s!==t&&(c(n),a(s))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const r=i.indexOf(e.currentTarget)+1;n=i[r]??i[0];break}case"ArrowLeft":{const r=i.indexOf(e.currentTarget)-1;n=i[r]??i[i.length-1];break}}n?.focus()};return(0,j.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":r},n),children:o.map((e=>{let{value:n,label:r,attributes:l}=e;return(0,j.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,s.A)("tabs__item",x.tabItem,l?.className,{"tabs__item--active":t===n}),children:r??n},n)}))})}function g(e){let{lazy:n,children:r,selectedValue:l}=e;const a=(Array.isArray(r)?r:[r]).filter(Boolean);if(n){const e=a.find((e=>e.props.value===l));return e?(0,t.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,j.jsx)("div",{className:"margin-top--md",children:a.map(((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==l})))})}function w(e){const n=f(e);return(0,j.jsxs)("div",{className:(0,s.A)("tabs-container",x.tabList),children:[(0,j.jsx)(v,{...n,...e}),(0,j.jsx)(g,{...n,...e})]})}function y(e){const n=(0,b.A)();return(0,j.jsx)(w,{...e,children:d(e.children)},String(n))}},5248:(e,n,r)=>{r.d(n,{R:()=>a,x:()=>o});var t=r(758);const s={},l=t.createContext(s);function a(e){const n=t.useContext(l);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/877e5bd4.035ff7df.js b/assets/js/877e5bd4.035ff7df.js deleted file mode 100644 index 5de4a17d..00000000 --- a/assets/js/877e5bd4.035ff7df.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5413,8934],{2180:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>u,contentTitle:()=>d,default:()=>m,frontMatter:()=>c,metadata:()=>r,toc:()=>h});const r=JSON.parse('{"id":"getting-started/setup","title":"Setup","description":"This guide will help you set up Calimero in your device.","source":"@site/docs/02-getting-started/01-setup.mdx","sourceDirName":"02-getting-started","slug":"/getting-started/setup","permalink":"/getting-started/setup","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/02-getting-started/01-setup.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":1,"frontMatter":{"id":"setup","title":"Setup"},"sidebar":"tutorialSidebar","previous":{"title":"Key Features","permalink":"/introduction/key-features"},"next":{"title":"Build From Source","permalink":"/getting-started/build-from-source"}}');var s=t(6070),l=t(5248),i=t(1531),a=t(3505),o=t(7576);const c={id:"setup",title:"Setup"},d="Setup",u={},h=[{value:"Supported Platforms",id:"supported-platforms",level:3},{value:"Installation",id:"installation",level:3},...i.toc,{value:"Next Steps",id:"next-steps",level:3},{value:"1. Initialize node",id:"1-initialize-node",level:4},{value:"2. Run node",id:"2-run-node",level:4}];function p(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h3:"h3",h4:"h4",header:"header",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,l.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.header,{children:(0,s.jsx)(n.h1,{id:"setup",children:"Setup"})}),"\n",(0,s.jsx)(n.p,{children:"This guide will help you set up Calimero in your device."}),"\n",(0,s.jsx)(n.p,{children:"There are two main paths:"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Install via Script or Homebrew"})," (Recommended): Quickly install ",(0,s.jsx)(n.code,{children:"meroctl"}),"\nfor most users."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.a,{href:"./build-from-source",children:(0,s.jsx)(n.strong,{children:"Build from Source"})}),": For developers who want to\ncontribute or modify the framework."]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"supported-platforms",children:"Supported Platforms"}),"\n",(0,s.jsx)(n.p,{children:"Calimero currently supports the following operating systems and architectures:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Operating Systems"}),": macOS, Linux"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Architectures"}),": x86_64, arm64 (Apple Silicon)"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"note",children:(0,s.jsxs)(n.p,{children:["If your platform is not supported, please\n",(0,s.jsx)(n.a,{href:"https://github.com/calimero-network/core/issues",children:"create an issue on GitHub"}),"."]})}),"\n",(0,s.jsx)(n.h3,{id:"installation",children:"Installation"}),"\n",(0,s.jsx)(i.default,{}),"\n",(0,s.jsx)(n.h3,{id:"next-steps",children:"Next Steps"}),"\n",(0,s.jsx)(n.p,{children:"Initialize and run node"}),"\n",(0,s.jsx)(n.p,{children:"If this is your first time initializing the node, the process may take a little\nbit more time until all dependencies are downloaded. It will take around 7\nminutes but can vary depending on your internet connection."}),"\n",(0,s.jsx)(n.h4,{id:"1-initialize-node",children:"1. Initialize node"}),"\n",(0,s.jsxs)(a.A,{defaultValue:"near",groupId:"protocol",values:[{label:"NEAR",value:"near"},{label:"Starknet",value:"starknet"},{label:"ICP",value:"icp"}],children:[(0,s.jsx)(o.A,{value:"near",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"merod --node-name node1 init --server-port 2428 --swarm-port 2528\n"})})}),(0,s.jsx)(o.A,{value:"starknet",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"merod --node-name node1 init --server-port 2428 --swarm-port 2528 --protocol starknet\n"})})}),(0,s.jsx)(o.A,{value:"icp",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"merod --node-name node1 init --server-port 2428 --swarm-port 2528 --protocol icp\n"})})})]}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["A ",(0,s.jsx)(n.code,{children:"--protocol"})," flag defines protocol for the node contexts."]})}),"\n",(0,s.jsxs)(n.p,{children:["Node configuration file contains protocol defined metada. Node file is located\nunder ",(0,s.jsx)(n.code,{children:"~/.calimero"})," folder."]}),"\n",(0,s.jsxs)(a.A,{defaultValue:"near",groupId:"protocol",values:[{label:"NEAR",value:"near"},{label:"Starknet",value:"starknet"},{label:"ICP",value:"icp"}],children:[(0,s.jsx)(o.A,{value:"near",children:(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"NearConfig",src:t(391).A+"",width:"834",height:"306"})})}),(0,s.jsx)(o.A,{value:"starknet",children:(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"SnConfig",src:t(2524).A+"",width:"1320",height:"310"})})}),(0,s.jsx)(o.A,{value:"icp",children:(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"ICPConfig",src:t(5383).A+"",width:"778",height:"316"})})})]}),"\n",(0,s.jsx)(n.h4,{id:"2-run-node",children:"2. Run node"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"merod --node-name node1 run\n"})}),"\n",(0,s.jsx)(n.p,{children:"Wait for a few moments and node logs should appear."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Node running",src:t(4481).A+"",width:"1712",height:"602"})}),"\n",(0,s.jsx)(n.p,{children:"When you see something like this that means that node is now ready for use."})]})}function m(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},1531:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>c,default:()=>p,frontMatter:()=>o,metadata:()=>r,toc:()=>u});const r=JSON.parse('{"id":"shared/install-merod","title":"install-merod","description":"You can choose to install merod using either the installation script or","source":"@site/docs/shared/install-merod.mdx","sourceDirName":"shared","slug":"/shared/install-merod","permalink":"/shared/install-merod","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/shared/install-merod.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"install-meroctl","permalink":"/shared/install-meroctl"}}');var s=t(6070),l=t(5248),i=t(3505),a=t(7576);const o={},c=void 0,d={},u=[{value:"Steps",id:"steps",level:4},{value:"Steps",id:"steps-1",level:4},{value:"Notes for Shell Environments",id:"notes-for-shell-environments",level:4}];function h(e){const n={code:"code",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,l.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["You can choose to install ",(0,s.jsx)(n.code,{children:"merod"})," using either the installation script or\nHomebrew."]}),"\n","\n",(0,s.jsxs)(i.A,{defaultValue:"homebrew",values:[{label:"Homebrew",value:"homebrew"},{label:"Installation Script",value:"script"}],children:[(0,s.jsxs)(a.A,{value:"homebrew",children:[(0,s.jsxs)(n.p,{children:["If you use Homebrew, you can install ",(0,s.jsx)(n.code,{children:"merod"})," directly with the following\nsteps:"]}),(0,s.jsx)(n.h4,{id:"steps",children:"Steps"}),(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Add the Calimero Homebrew tap:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"brew tap calimero-network/homebrew-tap\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Install ",(0,s.jsx)(n.code,{children:"merod"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"brew install merod\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Verify the installation:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"merod --version\n"})}),"\n"]}),"\n"]}),(0,s.jsx)(n.p,{children:"If the version number appears, the installation was successful."})]}),(0,s.jsxs)(a.A,{value:"script",children:[(0,s.jsx)(n.p,{children:"The installation script supports multiple terminal environments and will\nautomatically configure your PATH based on your shell."}),(0,s.jsx)(n.h4,{id:"steps-1",children:"Steps"}),(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Open your terminal and run:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"curl -sSf https://raw.githubusercontent.com/calimero-network/core/master/scripts/install-merod.sh | bash\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Source the updated PATH:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"source \n"})}),"\n",(0,s.jsxs)(n.p,{children:["Replace ",(0,s.jsx)(n.code,{children:""})," with ",(0,s.jsx)(n.code,{children:".bashrc"}),", ",(0,s.jsx)(n.code,{children:".zshrc"}),", or the relevant\nconfiguration file for your shell."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Verify the installation:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"merod --version\n"})}),"\n"]}),"\n"]}),(0,s.jsx)(n.p,{children:"If the version number appears, the installation was successful."}),(0,s.jsx)(n.h4,{id:"notes-for-shell-environments",children:"Notes for Shell Environments"}),(0,s.jsx)(n.p,{children:"The script automatically updates your PATH based on your shell configuration:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Bash"}),": Updates ",(0,s.jsx)(n.code,{children:".bashrc"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Zsh"}),": Updates ",(0,s.jsx)(n.code,{children:".zshrc"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Fish"}),": Modifies ",(0,s.jsx)(n.code,{children:"~/.config/fish/config.fish"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Csh/Tcsh"}),": Updates ",(0,s.jsx)(n.code,{children:".cshrc"}),"."]}),"\n"]}),(0,s.jsxs)(n.p,{children:["To apply the changes immediately, use the ",(0,s.jsx)(n.code,{children:"source"})," command as described in step\n2 above."]})]})]})]})}function p(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},7576:(e,n,t)=>{t.d(n,{A:()=>i});t(758);var r=t(3526);const s={tabItem:"tabItem_KLga"};var l=t(6070);function i(e){let{children:n,hidden:t,className:i}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,r.A)(s.tabItem,i),hidden:t,children:n})}},3505:(e,n,t)=>{t.d(n,{A:()=>y});var r=t(758),s=t(3526),l=t(8155),i=t(5557),a=t(5536),o=t(7852),c=t(1381),d=t(4012);function u(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:t}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return u(e).map((e=>{let{props:{value:n,label:t,attributes:r,default:s}}=e;return{value:n,label:t,attributes:r,default:s}}))}(t);return function(e){const n=(0,c.XI)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function p(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function m(e){let{queryString:n=!1,groupId:t}=e;const s=(0,i.W6)(),l=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,o.aZ)(l),(0,r.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(s.location.search);n.set(l,e),s.replace({...s.location,search:n.toString()})}),[l,s])]}function x(e){const{defaultValue:n,queryString:t=!1,groupId:s}=e,l=h(e),[i,o]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=t.find((e=>e.default))??t[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:l}))),[c,u]=m({queryString:t,groupId:s}),[x,f]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[s,l]=(0,d.Dv)(t);return[s,(0,r.useCallback)((e=>{t&&l.set(e)}),[t,l])]}({groupId:s}),g=(()=>{const e=c??x;return p({value:e,tabValues:l})?e:null})();(0,a.A)((()=>{g&&o(g)}),[g]);return{selectedValue:i,selectValue:(0,r.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);o(e),u(e),f(e)}),[u,f,l]),tabValues:l}}var f=t(2236);const g={tabList:"tabList_B3_y",tabItem:"tabItem_z210"};var j=t(6070);function b(e){let{className:n,block:t,selectedValue:r,selectValue:i,tabValues:a}=e;const o=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.a_)(),d=e=>{const n=e.currentTarget,t=o.indexOf(n),s=a[t].value;s!==r&&(c(n),i(s))},u=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const t=o.indexOf(e.currentTarget)+1;n=o[t]??o[0];break}case"ArrowLeft":{const t=o.indexOf(e.currentTarget)-1;n=o[t]??o[o.length-1];break}}n?.focus()};return(0,j.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":t},n),children:a.map((e=>{let{value:n,label:t,attributes:l}=e;return(0,j.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>o.push(e),onKeyDown:u,onClick:d,...l,className:(0,s.A)("tabs__item",g.tabItem,l?.className,{"tabs__item--active":r===n}),children:t??n},n)}))})}function v(e){let{lazy:n,children:t,selectedValue:l}=e;const i=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=i.find((e=>e.props.value===l));return e?(0,r.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,j.jsx)("div",{className:"margin-top--md",children:i.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==l})))})}function w(e){const n=x(e);return(0,j.jsxs)("div",{className:(0,s.A)("tabs-container",g.tabList),children:[(0,j.jsx)(b,{...n,...e}),(0,j.jsx)(v,{...n,...e})]})}function y(e){const n=(0,f.A)();return(0,j.jsx)(w,{...e,children:u(e.children)},String(n))}},5383:(e,n,t)=>{t.d(n,{A:()=>r});const r=t.p+"assets/images/icp-config-ceda025dead6d3c8de0513840466dd31.png"},391:(e,n,t)=>{t.d(n,{A:()=>r});const r=t.p+"assets/images/near-config-7f7de7e5e857b8d6dca8bda6b8a39f0d.png"},2524:(e,n,t)=>{t.d(n,{A:()=>r});const r=t.p+"assets/images/sn-config-a1900f2dc94f3dcd2cd7204c62421de2.png"},4481:(e,n,t)=>{t.d(n,{A:()=>r});const r=t.p+"assets/images/node-running-50b1a27fb9d7f62407382281da4692ab.png"},5248:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>a});var r=t(758);const s={},l=r.createContext(s);function i(e){const n=r.useContext(l);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),r.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/877e5bd4.deec8845.js b/assets/js/877e5bd4.deec8845.js new file mode 100644 index 00000000..049413ca --- /dev/null +++ b/assets/js/877e5bd4.deec8845.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5413,8934],{2180:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>u,contentTitle:()=>d,default:()=>m,frontMatter:()=>c,metadata:()=>r,toc:()=>h});const r=JSON.parse('{"id":"getting-started/setup","title":"Setup","description":"This guide will help you set up Calimero in your device.","source":"@site/docs/02-getting-started/01-setup.mdx","sourceDirName":"02-getting-started","slug":"/getting-started/setup","permalink":"/getting-started/setup","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/02-getting-started/01-setup.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":1,"frontMatter":{"id":"setup","title":"Setup"},"sidebar":"tutorialSidebar","previous":{"title":"Key Features","permalink":"/introduction/key-features"},"next":{"title":"Build From Source","permalink":"/getting-started/build-from-source"}}');var s=t(6070),l=t(5248),i=t(1531),a=t(3505),o=t(7576);const c={id:"setup",title:"Setup"},d="Setup",u={},h=[{value:"Supported Platforms",id:"supported-platforms",level:3},{value:"Installation",id:"installation",level:3},...i.toc,{value:"Next Steps",id:"next-steps",level:3},{value:"1. Initialize node",id:"1-initialize-node",level:4},{value:"2. Run node",id:"2-run-node",level:4}];function p(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h3:"h3",h4:"h4",header:"header",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,l.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.header,{children:(0,s.jsx)(n.h1,{id:"setup",children:"Setup"})}),"\n",(0,s.jsx)(n.p,{children:"This guide will help you set up Calimero in your device."}),"\n",(0,s.jsx)(n.p,{children:"There are two main paths:"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Install via Script or Homebrew"})," (Recommended): Quickly install ",(0,s.jsx)(n.code,{children:"meroctl"}),"\nfor most users."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.a,{href:"./build-from-source",children:(0,s.jsx)(n.strong,{children:"Build from Source"})}),": For developers who want to\ncontribute or modify the framework."]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"supported-platforms",children:"Supported Platforms"}),"\n",(0,s.jsx)(n.p,{children:"Calimero currently supports the following operating systems and architectures:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Operating Systems"}),": macOS, Linux"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Architectures"}),": x86_64, arm64 (Apple Silicon)"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"note",children:(0,s.jsxs)(n.p,{children:["If your platform is not supported, please\n",(0,s.jsx)(n.a,{href:"https://github.com/calimero-network/core/issues",children:"create an issue on GitHub"}),"."]})}),"\n",(0,s.jsx)(n.h3,{id:"installation",children:"Installation"}),"\n",(0,s.jsx)(i.default,{}),"\n",(0,s.jsx)(n.h3,{id:"next-steps",children:"Next Steps"}),"\n",(0,s.jsx)(n.p,{children:"Initialize and run node"}),"\n",(0,s.jsx)(n.p,{children:"If this is your first time initializing the node, the process may take a little\nbit more time until all dependencies are downloaded. It will take around 7\nminutes but can vary depending on your internet connection."}),"\n",(0,s.jsx)(n.h4,{id:"1-initialize-node",children:"1. Initialize node"}),"\n",(0,s.jsxs)(a.A,{defaultValue:"near",groupId:"protocol",values:[{label:"NEAR",value:"near"},{label:"Starknet",value:"starknet"},{label:"ICP",value:"icp"}],children:[(0,s.jsx)(o.A,{value:"near",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"merod --node-name node1 init --server-port 2428 --swarm-port 2528\n"})})}),(0,s.jsx)(o.A,{value:"starknet",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"merod --node-name node1 init --server-port 2428 --swarm-port 2528 --protocol starknet\n"})})}),(0,s.jsx)(o.A,{value:"icp",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"merod --node-name node1 init --server-port 2428 --swarm-port 2528 --protocol icp\n"})})})]}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["A ",(0,s.jsx)(n.code,{children:"--protocol"})," flag defines protocol for the node contexts."]})}),"\n",(0,s.jsxs)(n.p,{children:["Node configuration file contains protocol defined metada. Node file is located\nunder ",(0,s.jsx)(n.code,{children:"~/.calimero"})," folder."]}),"\n",(0,s.jsxs)(a.A,{defaultValue:"near",groupId:"protocol",values:[{label:"NEAR",value:"near"},{label:"Starknet",value:"starknet"},{label:"ICP",value:"icp"}],children:[(0,s.jsx)(o.A,{value:"near",children:(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"NearConfig",src:t(391).A+"",width:"834",height:"306"})})}),(0,s.jsx)(o.A,{value:"starknet",children:(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"SnConfig",src:t(2524).A+"",width:"1320",height:"310"})})}),(0,s.jsx)(o.A,{value:"icp",children:(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"ICPConfig",src:t(5383).A+"",width:"778",height:"316"})})})]}),"\n",(0,s.jsx)(n.h4,{id:"2-run-node",children:"2. Run node"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"merod --node-name node1 run\n"})}),"\n",(0,s.jsx)(n.p,{children:"Wait for a few moments and node logs should appear."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Node running",src:t(4481).A+"",width:"1712",height:"602"})}),"\n",(0,s.jsx)(n.p,{children:"When you see something like this that means that node is now ready for use."})]})}function m(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},1531:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>c,default:()=>p,frontMatter:()=>o,metadata:()=>r,toc:()=>u});const r=JSON.parse('{"id":"shared/install-merod","title":"install-merod","description":"You can choose to install merod using either the installation script or","source":"@site/docs/shared/install-merod.mdx","sourceDirName":"shared","slug":"/shared/install-merod","permalink":"/shared/install-merod","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/shared/install-merod.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"install-meroctl","permalink":"/shared/install-meroctl"},"next":{"title":"node-init-binary","permalink":"/shared/node-init-binary"}}');var s=t(6070),l=t(5248),i=t(3505),a=t(7576);const o={},c=void 0,d={},u=[{value:"Steps",id:"steps",level:4},{value:"Steps",id:"steps-1",level:4},{value:"Notes for Shell Environments",id:"notes-for-shell-environments",level:4}];function h(e){const n={code:"code",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,l.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["You can choose to install ",(0,s.jsx)(n.code,{children:"merod"})," using either the installation script or\nHomebrew."]}),"\n","\n",(0,s.jsxs)(i.A,{defaultValue:"homebrew",values:[{label:"Homebrew",value:"homebrew"},{label:"Installation Script",value:"script"}],children:[(0,s.jsxs)(a.A,{value:"homebrew",children:[(0,s.jsxs)(n.p,{children:["If you use Homebrew, you can install ",(0,s.jsx)(n.code,{children:"merod"})," directly with the following\nsteps:"]}),(0,s.jsx)(n.h4,{id:"steps",children:"Steps"}),(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Add the Calimero Homebrew tap:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"brew tap calimero-network/homebrew-tap\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Install ",(0,s.jsx)(n.code,{children:"merod"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"brew install merod\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Verify the installation:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"merod --version\n"})}),"\n"]}),"\n"]}),(0,s.jsx)(n.p,{children:"If the version number appears, the installation was successful."})]}),(0,s.jsxs)(a.A,{value:"script",children:[(0,s.jsx)(n.p,{children:"The installation script supports multiple terminal environments and will\nautomatically configure your PATH based on your shell."}),(0,s.jsx)(n.h4,{id:"steps-1",children:"Steps"}),(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Open your terminal and run:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"curl -sSf https://raw.githubusercontent.com/calimero-network/core/master/scripts/install-merod.sh | bash\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Source the updated PATH:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"source \n"})}),"\n",(0,s.jsxs)(n.p,{children:["Replace ",(0,s.jsx)(n.code,{children:""})," with ",(0,s.jsx)(n.code,{children:".bashrc"}),", ",(0,s.jsx)(n.code,{children:".zshrc"}),", or the relevant\nconfiguration file for your shell."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Verify the installation:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"merod --version\n"})}),"\n"]}),"\n"]}),(0,s.jsx)(n.p,{children:"If the version number appears, the installation was successful."}),(0,s.jsx)(n.h4,{id:"notes-for-shell-environments",children:"Notes for Shell Environments"}),(0,s.jsx)(n.p,{children:"The script automatically updates your PATH based on your shell configuration:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Bash"}),": Updates ",(0,s.jsx)(n.code,{children:".bashrc"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Zsh"}),": Updates ",(0,s.jsx)(n.code,{children:".zshrc"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Fish"}),": Modifies ",(0,s.jsx)(n.code,{children:"~/.config/fish/config.fish"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Csh/Tcsh"}),": Updates ",(0,s.jsx)(n.code,{children:".cshrc"}),"."]}),"\n"]}),(0,s.jsxs)(n.p,{children:["To apply the changes immediately, use the ",(0,s.jsx)(n.code,{children:"source"})," command as described in step\n2 above."]})]})]})]})}function p(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},7576:(e,n,t)=>{t.d(n,{A:()=>i});t(758);var r=t(3526);const s={tabItem:"tabItem_KLga"};var l=t(6070);function i(e){let{children:n,hidden:t,className:i}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,r.A)(s.tabItem,i),hidden:t,children:n})}},3505:(e,n,t)=>{t.d(n,{A:()=>y});var r=t(758),s=t(3526),l=t(8155),i=t(5557),a=t(5536),o=t(7852),c=t(1381),d=t(4012);function u(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:t}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return u(e).map((e=>{let{props:{value:n,label:t,attributes:r,default:s}}=e;return{value:n,label:t,attributes:r,default:s}}))}(t);return function(e){const n=(0,c.XI)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function p(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function m(e){let{queryString:n=!1,groupId:t}=e;const s=(0,i.W6)(),l=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,o.aZ)(l),(0,r.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(s.location.search);n.set(l,e),s.replace({...s.location,search:n.toString()})}),[l,s])]}function x(e){const{defaultValue:n,queryString:t=!1,groupId:s}=e,l=h(e),[i,o]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=t.find((e=>e.default))??t[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:l}))),[c,u]=m({queryString:t,groupId:s}),[x,f]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[s,l]=(0,d.Dv)(t);return[s,(0,r.useCallback)((e=>{t&&l.set(e)}),[t,l])]}({groupId:s}),g=(()=>{const e=c??x;return p({value:e,tabValues:l})?e:null})();(0,a.A)((()=>{g&&o(g)}),[g]);return{selectedValue:i,selectValue:(0,r.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);o(e),u(e),f(e)}),[u,f,l]),tabValues:l}}var f=t(2236);const g={tabList:"tabList_B3_y",tabItem:"tabItem_z210"};var j=t(6070);function b(e){let{className:n,block:t,selectedValue:r,selectValue:i,tabValues:a}=e;const o=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.a_)(),d=e=>{const n=e.currentTarget,t=o.indexOf(n),s=a[t].value;s!==r&&(c(n),i(s))},u=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const t=o.indexOf(e.currentTarget)+1;n=o[t]??o[0];break}case"ArrowLeft":{const t=o.indexOf(e.currentTarget)-1;n=o[t]??o[o.length-1];break}}n?.focus()};return(0,j.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":t},n),children:a.map((e=>{let{value:n,label:t,attributes:l}=e;return(0,j.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>o.push(e),onKeyDown:u,onClick:d,...l,className:(0,s.A)("tabs__item",g.tabItem,l?.className,{"tabs__item--active":r===n}),children:t??n},n)}))})}function v(e){let{lazy:n,children:t,selectedValue:l}=e;const i=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=i.find((e=>e.props.value===l));return e?(0,r.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,j.jsx)("div",{className:"margin-top--md",children:i.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==l})))})}function w(e){const n=x(e);return(0,j.jsxs)("div",{className:(0,s.A)("tabs-container",g.tabList),children:[(0,j.jsx)(b,{...n,...e}),(0,j.jsx)(v,{...n,...e})]})}function y(e){const n=(0,f.A)();return(0,j.jsx)(w,{...e,children:u(e.children)},String(n))}},5383:(e,n,t)=>{t.d(n,{A:()=>r});const r=t.p+"assets/images/icp-config-ceda025dead6d3c8de0513840466dd31.png"},391:(e,n,t)=>{t.d(n,{A:()=>r});const r=t.p+"assets/images/near-config-7f7de7e5e857b8d6dca8bda6b8a39f0d.png"},2524:(e,n,t)=>{t.d(n,{A:()=>r});const r=t.p+"assets/images/sn-config-a1900f2dc94f3dcd2cd7204c62421de2.png"},4481:(e,n,t)=>{t.d(n,{A:()=>r});const r=t.p+"assets/images/node-running-50b1a27fb9d7f62407382281da4692ab.png"},5248:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>a});var r=t(758);const s={},l=r.createContext(s);function i(e){const n=r.useContext(l);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),r.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/87ab5444.4321df4c.js b/assets/js/87ab5444.cd97b054.js similarity index 99% rename from assets/js/87ab5444.4321df4c.js rename to assets/js/87ab5444.cd97b054.js index 973e92e0..c64f34a3 100644 --- a/assets/js/87ab5444.4321df4c.js +++ b/assets/js/87ab5444.cd97b054.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3174],{3333:(e,o,t)=>{t.r(o),t.d(o,{assets:()=>a,contentTitle:()=>l,default:()=>p,frontMatter:()=>s,metadata:()=>n,toc:()=>c});const n=JSON.parse('{"id":"developer-tools/SDK/protocol-sdk/protocol-sdk","title":"Protocol SDK","description":"The Protocol SDK within the Calimero Network serves as a foundational tool for","source":"@site/docs/05-developer-tools/02-SDK/03-protocol-sdk/01-protocol-sdk.mdx","sourceDirName":"05-developer-tools/02-SDK/03-protocol-sdk","slug":"/developer-tools/SDK/protocol-sdk/protocol-sdk","permalink":"/developer-tools/SDK/protocol-sdk/protocol-sdk","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/05-developer-tools/02-SDK/03-protocol-sdk/01-protocol-sdk.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":1,"frontMatter":{"id":"protocol-sdk","title":"Protocol SDK"},"sidebar":"tutorialSidebar","previous":{"title":"Meroctl","permalink":"/developer-tools/CLI/meroctl"},"next":{"title":"Rust Protocol SDK","permalink":"/developer-tools/SDK/protocol-sdk/protocol-rs-sdk"}}');var i=t(6070),r=t(5248);const s={id:"protocol-sdk",title:"Protocol SDK"},l=void 0,a={},c=[{value:"Features and Functionalities",id:"features-and-functionalities",level:3},{value:"Role in DApp Development",id:"role-in-dapp-development",level:3},{value:"Integration with Other Calimero Components",id:"integration-with-other-calimero-components",level:3},{value:"Use Cases",id:"use-cases",level:3}];function d(e){const o={h3:"h3",li:"li",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.p,{children:"The Protocol SDK within the Calimero Network serves as a foundational tool for\ndevelopers, enabling them to design, develop, and deploy the specific protocols\nthat govern the operation of their decentralized applications (DApps). This SDK\nis particularly crucial in a network like Calimero, where privacy, security, and\ndecentralized communication are paramount. Here's an overview of the Protocol\nSDK, highlighting its features, functionalities, and its role in the development\nlifecycle of DApps:"}),"\n",(0,i.jsx)(o.h3,{id:"features-and-functionalities",children:"Features and Functionalities"}),"\n",(0,i.jsxs)(o.ul,{children:["\n",(0,i.jsxs)(o.li,{children:[(0,i.jsx)(o.strong,{children:"Protocol Definition"}),": Allows developers to define the rules and behaviors\nof their application networks, including communication protocols, data\nformats, and interaction patterns among nodes."]}),"\n",(0,i.jsxs)(o.li,{children:[(0,i.jsx)(o.strong,{children:"Code Generation"}),": Automates the generation of boilerplate code required to\nimplement the defined protocols, significantly speeding up the development\nprocess and reducing the potential for errors."]}),"\n",(0,i.jsxs)(o.li,{children:[(0,i.jsx)(o.strong,{children:"Interoperability Support"}),": Facilitates the creation of protocols that can\ninteract with various blockchains and external systems, ensuring that\nCalimero-based DApps can operate within the broader blockchain ecosystem."]}),"\n",(0,i.jsxs)(o.li,{children:[(0,i.jsx)(o.strong,{children:"Security Focus"}),": Provides tools and libraries to incorporate advanced\nsecurity features into protocols, such as end-to-end encryption, secure key\nmanagement, and privacy-preserving data sharing mechanisms."]}),"\n",(0,i.jsxs)(o.li,{children:[(0,i.jsx)(o.strong,{children:"Performance Optimization"}),": Includes optimization tools and best practices\nto ensure that the protocols are efficient in terms of resource usage,\nsuitable for decentralized networks where performance can be a critical\nconcern."]}),"\n"]}),"\n",(0,i.jsx)(o.h3,{id:"role-in-dapp-development",children:"Role in DApp Development"}),"\n",(0,i.jsxs)(o.ul,{children:["\n",(0,i.jsxs)(o.li,{children:[(0,i.jsx)(o.strong,{children:"Protocol Development"}),": At the core of any DApp on the Calimero Network is a\nprotocol that dictates how the application functions, how nodes within the\napplication's network communicate, and how data is handled and stored. The\nProtocol SDK is the primary tool for developing these protocols."]}),"\n",(0,i.jsxs)(o.li,{children:[(0,i.jsx)(o.strong,{children:"Testing and Deployment"}),": The SDK provides an environment for thorough\ntesting of the protocols in simulated conditions before they are deployed on\nthe live network. This ensures that any issues can be identified and resolved\nin a controlled setting, minimizing risks."]}),"\n",(0,i.jsxs)(o.li,{children:[(0,i.jsx)(o.strong,{children:"Versioning and Updates"}),": Supports protocol versioning, enabling developers\nto iterate on their protocols and roll out updates in a structured manner.\nThis is crucial for maintaining compatibility and ensuring the longevity and\nscalability of DApps."]}),"\n"]}),"\n",(0,i.jsx)(o.h3,{id:"integration-with-other-calimero-components",children:"Integration with Other Calimero Components"}),"\n",(0,i.jsxs)(o.ul,{children:["\n",(0,i.jsxs)(o.li,{children:[(0,i.jsx)(o.strong,{children:"Client Nodes"}),": Protocols developed with the Protocol SDK are deployed on\nclient nodes, which act as the runtime environment for the DApps built on\nthese protocols."]}),"\n",(0,i.jsxs)(o.li,{children:[(0,i.jsx)(o.strong,{children:"Client SDKs"}),": These SDKs interact with the protocols at a higher level,\nproviding interfaces for end-users to interact with the DApps. The seamless\nintegration between the Protocol SDK and Client SDKs ensures a smooth user\nexperience."]}),"\n",(0,i.jsxs)(o.li,{children:[(0,i.jsx)(o.strong,{children:"Specialized Nodes"}),": Some protocols may require specialized computational\nresources or functionalities. The Protocol SDK allows for the integration of\nthese services, enabling DApps to leverage the specialized nodes within the\nCalimero Network."]}),"\n"]}),"\n",(0,i.jsx)(o.h3,{id:"use-cases",children:"Use Cases"}),"\n",(0,i.jsxs)(o.ul,{children:["\n",(0,i.jsxs)(o.li,{children:[(0,i.jsx)(o.strong,{children:"Decentralized Messaging"}),": For a messaging app, the Protocol SDK could be\nused to define the encryption protocols, message delivery mechanisms, and peer\ndiscovery protocols."]}),"\n",(0,i.jsxs)(o.li,{children:[(0,i.jsx)(o.strong,{children:"Decentralized Finance (DeFi)"}),": In a DeFi application, the SDK could define\nthe protocols for executing smart contracts, handling transactions, and\ninteracting with external blockchains for asset transfers."]}),"\n"]}),"\n",(0,i.jsx)(o.p,{children:"The Protocol SDK is a critical component of the Calimero Network, empowering\ndevelopers to build sophisticated, secure, and efficient decentralized\napplications. By abstracting much of the complexity associated with protocol\ndevelopment, the SDK enables developers to focus on the unique features and\nfunctionalities of their DApps, fostering innovation and growth within the\nCalimero ecosystem."})]})}function p(e={}){const{wrapper:o}={...(0,r.R)(),...e.components};return o?(0,i.jsx)(o,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},5248:(e,o,t)=>{t.d(o,{R:()=>s,x:()=>l});var n=t(758);const i={},r=n.createContext(i);function s(e){const o=n.useContext(r);return n.useMemo((function(){return"function"==typeof e?e(o):{...o,...e}}),[o,e])}function l(e){let o;return o=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),n.createElement(r.Provider,{value:o},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3174],{3333:(e,o,t)=>{t.r(o),t.d(o,{assets:()=>a,contentTitle:()=>l,default:()=>p,frontMatter:()=>s,metadata:()=>n,toc:()=>c});const n=JSON.parse('{"id":"developer-tools/SDK/protocol-sdk/protocol-sdk","title":"Protocol SDK","description":"The Protocol SDK within the Calimero Network serves as a foundational tool for","source":"@site/docs/05-developer-tools/02-SDK/03-protocol-sdk/01-protocol-sdk.mdx","sourceDirName":"05-developer-tools/02-SDK/03-protocol-sdk","slug":"/developer-tools/SDK/protocol-sdk/protocol-sdk","permalink":"/developer-tools/SDK/protocol-sdk/protocol-sdk","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/05-developer-tools/02-SDK/03-protocol-sdk/01-protocol-sdk.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":1,"frontMatter":{"id":"protocol-sdk","title":"Protocol SDK"},"sidebar":"tutorialSidebar","previous":{"title":"Meroctl","permalink":"/developer-tools/CLI/meroctl"},"next":{"title":"Rust Protocol SDK","permalink":"/developer-tools/SDK/protocol-sdk/protocol-rs-sdk"}}');var i=t(6070),r=t(5248);const s={id:"protocol-sdk",title:"Protocol SDK"},l=void 0,a={},c=[{value:"Features and Functionalities",id:"features-and-functionalities",level:3},{value:"Role in DApp Development",id:"role-in-dapp-development",level:3},{value:"Integration with Other Calimero Components",id:"integration-with-other-calimero-components",level:3},{value:"Use Cases",id:"use-cases",level:3}];function d(e){const o={h3:"h3",li:"li",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.p,{children:"The Protocol SDK within the Calimero Network serves as a foundational tool for\ndevelopers, enabling them to design, develop, and deploy the specific protocols\nthat govern the operation of their decentralized applications (DApps). This SDK\nis particularly crucial in a network like Calimero, where privacy, security, and\ndecentralized communication are paramount. Here's an overview of the Protocol\nSDK, highlighting its features, functionalities, and its role in the development\nlifecycle of DApps:"}),"\n",(0,i.jsx)(o.h3,{id:"features-and-functionalities",children:"Features and Functionalities"}),"\n",(0,i.jsxs)(o.ul,{children:["\n",(0,i.jsxs)(o.li,{children:[(0,i.jsx)(o.strong,{children:"Protocol Definition"}),": Allows developers to define the rules and behaviors\nof their application networks, including communication protocols, data\nformats, and interaction patterns among nodes."]}),"\n",(0,i.jsxs)(o.li,{children:[(0,i.jsx)(o.strong,{children:"Code Generation"}),": Automates the generation of boilerplate code required to\nimplement the defined protocols, significantly speeding up the development\nprocess and reducing the potential for errors."]}),"\n",(0,i.jsxs)(o.li,{children:[(0,i.jsx)(o.strong,{children:"Interoperability Support"}),": Facilitates the creation of protocols that can\ninteract with various blockchains and external systems, ensuring that\nCalimero-based DApps can operate within the broader blockchain ecosystem."]}),"\n",(0,i.jsxs)(o.li,{children:[(0,i.jsx)(o.strong,{children:"Security Focus"}),": Provides tools and libraries to incorporate advanced\nsecurity features into protocols, such as end-to-end encryption, secure key\nmanagement, and privacy-preserving data sharing mechanisms."]}),"\n",(0,i.jsxs)(o.li,{children:[(0,i.jsx)(o.strong,{children:"Performance Optimization"}),": Includes optimization tools and best practices\nto ensure that the protocols are efficient in terms of resource usage,\nsuitable for decentralized networks where performance can be a critical\nconcern."]}),"\n"]}),"\n",(0,i.jsx)(o.h3,{id:"role-in-dapp-development",children:"Role in DApp Development"}),"\n",(0,i.jsxs)(o.ul,{children:["\n",(0,i.jsxs)(o.li,{children:[(0,i.jsx)(o.strong,{children:"Protocol Development"}),": At the core of any DApp on the Calimero Network is a\nprotocol that dictates how the application functions, how nodes within the\napplication's network communicate, and how data is handled and stored. The\nProtocol SDK is the primary tool for developing these protocols."]}),"\n",(0,i.jsxs)(o.li,{children:[(0,i.jsx)(o.strong,{children:"Testing and Deployment"}),": The SDK provides an environment for thorough\ntesting of the protocols in simulated conditions before they are deployed on\nthe live network. This ensures that any issues can be identified and resolved\nin a controlled setting, minimizing risks."]}),"\n",(0,i.jsxs)(o.li,{children:[(0,i.jsx)(o.strong,{children:"Versioning and Updates"}),": Supports protocol versioning, enabling developers\nto iterate on their protocols and roll out updates in a structured manner.\nThis is crucial for maintaining compatibility and ensuring the longevity and\nscalability of DApps."]}),"\n"]}),"\n",(0,i.jsx)(o.h3,{id:"integration-with-other-calimero-components",children:"Integration with Other Calimero Components"}),"\n",(0,i.jsxs)(o.ul,{children:["\n",(0,i.jsxs)(o.li,{children:[(0,i.jsx)(o.strong,{children:"Client Nodes"}),": Protocols developed with the Protocol SDK are deployed on\nclient nodes, which act as the runtime environment for the DApps built on\nthese protocols."]}),"\n",(0,i.jsxs)(o.li,{children:[(0,i.jsx)(o.strong,{children:"Client SDKs"}),": These SDKs interact with the protocols at a higher level,\nproviding interfaces for end-users to interact with the DApps. The seamless\nintegration between the Protocol SDK and Client SDKs ensures a smooth user\nexperience."]}),"\n",(0,i.jsxs)(o.li,{children:[(0,i.jsx)(o.strong,{children:"Specialized Nodes"}),": Some protocols may require specialized computational\nresources or functionalities. The Protocol SDK allows for the integration of\nthese services, enabling DApps to leverage the specialized nodes within the\nCalimero Network."]}),"\n"]}),"\n",(0,i.jsx)(o.h3,{id:"use-cases",children:"Use Cases"}),"\n",(0,i.jsxs)(o.ul,{children:["\n",(0,i.jsxs)(o.li,{children:[(0,i.jsx)(o.strong,{children:"Decentralized Messaging"}),": For a messaging app, the Protocol SDK could be\nused to define the encryption protocols, message delivery mechanisms, and peer\ndiscovery protocols."]}),"\n",(0,i.jsxs)(o.li,{children:[(0,i.jsx)(o.strong,{children:"Decentralized Finance (DeFi)"}),": In a DeFi application, the SDK could define\nthe protocols for executing smart contracts, handling transactions, and\ninteracting with external blockchains for asset transfers."]}),"\n"]}),"\n",(0,i.jsx)(o.p,{children:"The Protocol SDK is a critical component of the Calimero Network, empowering\ndevelopers to build sophisticated, secure, and efficient decentralized\napplications. By abstracting much of the complexity associated with protocol\ndevelopment, the SDK enables developers to focus on the unique features and\nfunctionalities of their DApps, fostering innovation and growth within the\nCalimero ecosystem."})]})}function p(e={}){const{wrapper:o}={...(0,r.R)(),...e.components};return o?(0,i.jsx)(o,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},5248:(e,o,t)=>{t.d(o,{R:()=>s,x:()=>l});var n=t(758);const i={},r=n.createContext(i);function s(e){const o=n.useContext(r);return n.useMemo((function(){return"function"==typeof e?e(o):{...o,...e}}),[o,e])}function l(e){let o;return o=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),n.createElement(r.Provider,{value:o},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/87ed36b6.c04ef2ab.js b/assets/js/87ed36b6.5736a561.js similarity index 98% rename from assets/js/87ed36b6.c04ef2ab.js rename to assets/js/87ed36b6.5736a561.js index c1de4b4f..a455903f 100644 --- a/assets/js/87ed36b6.c04ef2ab.js +++ b/assets/js/87ed36b6.5736a561.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4480],{7272:(t,e,o)=>{o.r(e),o.d(e,{assets:()=>u,contentTitle:()=>c,default:()=>d,frontMatter:()=>s,metadata:()=>n,toc:()=>l});const n=JSON.parse('{"id":"contributing/github","title":"GitHub","description":"All work on Calimero happens directly on GitHub. Both core team members and","source":"@site/docs/09-contributing/01-github.mdx","sourceDirName":"09-contributing","slug":"/contributing/github","permalink":"/contributing/github","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/09-contributing/01-github.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":1,"frontMatter":{"id":"github","title":"GitHub"},"sidebar":"tutorialSidebar","previous":{"title":"SSL/TLS","permalink":"/throubleshooting/ssl-tls"},"next":{"title":"Hackathons","permalink":"/contributing/hackathons"}}');var i=o(6070),r=o(5248);const s={id:"github",title:"GitHub"},c=void 0,u={},l=[{value:"How to Contribute",id:"how-to-contribute",level:2},{value:"Additional Ways to Contribute",id:"additional-ways-to-contribute",level:2}];function a(t){const e={a:"a",h2:"h2",li:"li",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...t.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e.p,{children:"All work on Calimero happens directly on GitHub. Both core team members and\nexternal contributors send pull requests which go through the same review\nprocess."}),"\n",(0,i.jsx)(e.h2,{id:"how-to-contribute",children:"How to Contribute"}),"\n",(0,i.jsxs)(e.p,{children:["We appreciate your interest in contributing to our project! To get started with\ncontributing, please follow the instructions outlined in our\n",(0,i.jsx)(e.a,{href:"https://github.com/calimero-network/core/blob/master/CONTRIBUTING.md",children:"CONTRIBUTING"}),"\nfile."]}),"\n",(0,i.jsx)(e.h2,{id:"additional-ways-to-contribute",children:"Additional Ways to Contribute"}),"\n",(0,i.jsxs)(e.ul,{children:["\n",(0,i.jsxs)(e.li,{children:[(0,i.jsx)(e.strong,{children:"Show Your Support:"})," If you find this project helpful, please star it on\nGitHub. Your stars help the project grow and reach more developers like you."]}),"\n",(0,i.jsxs)(e.li,{children:[(0,i.jsx)(e.strong,{children:"Spread the Word:"})," Share the project with your friends and colleagues who\nmight be interested in contributing or using it."]}),"\n",(0,i.jsxs)(e.li,{children:[(0,i.jsx)(e.strong,{children:"Join Discussions:"})," Participate in discussions on GitHub\n",(0,i.jsx)(e.a,{href:"https://github.com/calimero-network/core/issues",children:"Issues"})," or\n",(0,i.jsx)(e.a,{href:"https://github.com/orgs/calimero-network/discussions",children:"Discussions"})," to share\nyour ideas and provide feedback."]}),"\n",(0,i.jsxs)(e.li,{children:[(0,i.jsx)(e.strong,{children:"Write Tutorials or Blog Posts:"})," Create tutorials or blog posts about how to\nuse the project or your experience contributing to it."]}),"\n"]})]})}function d(t={}){const{wrapper:e}={...(0,r.R)(),...t.components};return e?(0,i.jsx)(e,{...t,children:(0,i.jsx)(a,{...t})}):a(t)}},5248:(t,e,o)=>{o.d(e,{R:()=>s,x:()=>c});var n=o(758);const i={},r=n.createContext(i);function s(t){const e=n.useContext(r);return n.useMemo((function(){return"function"==typeof t?t(e):{...e,...t}}),[e,t])}function c(t){let e;return e=t.disableParentContext?"function"==typeof t.components?t.components(i):t.components||i:s(t.components),n.createElement(r.Provider,{value:e},t.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4480],{7272:(t,e,o)=>{o.r(e),o.d(e,{assets:()=>u,contentTitle:()=>c,default:()=>d,frontMatter:()=>s,metadata:()=>n,toc:()=>l});const n=JSON.parse('{"id":"contributing/github","title":"GitHub","description":"All work on Calimero happens directly on GitHub. Both core team members and","source":"@site/docs/09-contributing/01-github.mdx","sourceDirName":"09-contributing","slug":"/contributing/github","permalink":"/contributing/github","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/09-contributing/01-github.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":1,"frontMatter":{"id":"github","title":"GitHub"},"sidebar":"tutorialSidebar","previous":{"title":"SSL/TLS","permalink":"/throubleshooting/ssl-tls"},"next":{"title":"Hackathons","permalink":"/contributing/hackathons"}}');var i=o(6070),r=o(5248);const s={id:"github",title:"GitHub"},c=void 0,u={},l=[{value:"How to Contribute",id:"how-to-contribute",level:2},{value:"Additional Ways to Contribute",id:"additional-ways-to-contribute",level:2}];function a(t){const e={a:"a",h2:"h2",li:"li",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...t.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e.p,{children:"All work on Calimero happens directly on GitHub. Both core team members and\nexternal contributors send pull requests which go through the same review\nprocess."}),"\n",(0,i.jsx)(e.h2,{id:"how-to-contribute",children:"How to Contribute"}),"\n",(0,i.jsxs)(e.p,{children:["We appreciate your interest in contributing to our project! To get started with\ncontributing, please follow the instructions outlined in our\n",(0,i.jsx)(e.a,{href:"https://github.com/calimero-network/core/blob/master/CONTRIBUTING.md",children:"CONTRIBUTING"}),"\nfile."]}),"\n",(0,i.jsx)(e.h2,{id:"additional-ways-to-contribute",children:"Additional Ways to Contribute"}),"\n",(0,i.jsxs)(e.ul,{children:["\n",(0,i.jsxs)(e.li,{children:[(0,i.jsx)(e.strong,{children:"Show Your Support:"})," If you find this project helpful, please star it on\nGitHub. Your stars help the project grow and reach more developers like you."]}),"\n",(0,i.jsxs)(e.li,{children:[(0,i.jsx)(e.strong,{children:"Spread the Word:"})," Share the project with your friends and colleagues who\nmight be interested in contributing or using it."]}),"\n",(0,i.jsxs)(e.li,{children:[(0,i.jsx)(e.strong,{children:"Join Discussions:"})," Participate in discussions on GitHub\n",(0,i.jsx)(e.a,{href:"https://github.com/calimero-network/core/issues",children:"Issues"})," or\n",(0,i.jsx)(e.a,{href:"https://github.com/orgs/calimero-network/discussions",children:"Discussions"})," to share\nyour ideas and provide feedback."]}),"\n",(0,i.jsxs)(e.li,{children:[(0,i.jsx)(e.strong,{children:"Write Tutorials or Blog Posts:"})," Create tutorials or blog posts about how to\nuse the project or your experience contributing to it."]}),"\n"]})]})}function d(t={}){const{wrapper:e}={...(0,r.R)(),...t.components};return e?(0,i.jsx)(e,{...t,children:(0,i.jsx)(a,{...t})}):a(t)}},5248:(t,e,o)=>{o.d(e,{R:()=>s,x:()=>c});var n=o(758);const i={},r=n.createContext(i);function s(t){const e=n.useContext(r);return n.useMemo((function(){return"function"==typeof t?t(e):{...e,...t}}),[e,t])}function c(t){let e;return e=t.disableParentContext?"function"==typeof t.components?t.components(i):t.components||i:s(t.components),n.createElement(r.Provider,{value:e},t.children)}}}]); \ No newline at end of file diff --git a/assets/js/8ed5093a.a633c6fb.js b/assets/js/8ed5093a.9b5adf81.js similarity index 97% rename from assets/js/8ed5093a.a633c6fb.js rename to assets/js/8ed5093a.9b5adf81.js index 0d4b9aee..0c7218fa 100644 --- a/assets/js/8ed5093a.a633c6fb.js +++ b/assets/js/8ed5093a.9b5adf81.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4302],{7166:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>d,frontMatter:()=>s,metadata:()=>r,toc:()=>c});const r=JSON.parse('{"id":"support/learning","title":"Learning","description":"Expand your knowledge and stay informed by exploring the following resources:","source":"@site/docs/10-support/02-learning.mdx","sourceDirName":"10-support","slug":"/support/learning","permalink":"/support/learning","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/10-support/02-learning.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":2,"frontMatter":{"id":"learning","title":"Learning"},"sidebar":"tutorialSidebar","previous":{"title":"Community and Support","permalink":"/support/community-and-support"},"next":{"title":"install-meroctl","permalink":"/shared/install-meroctl"}}');var o=t(6070),i=t(5248);const s={id:"learning",title:"Learning"},a="Learning",l={},c=[{value:"Learn More",id:"learn-more",level:2}];function u(e){const n={a:"a",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.header,{children:(0,o.jsx)(n.h1,{id:"learning",children:"Learning"})}),"\n",(0,o.jsx)(n.p,{children:"Expand your knowledge and stay informed by exploring the following resources:"}),"\n",(0,o.jsx)(n.h2,{id:"learn-more",children:"Learn More"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Website:"})," Visit our ",(0,o.jsx)(n.a,{href:"https://www.calimero.network/",children:"website"})," for\ncomprehensive information about the project, including features and\ndocumentation."]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Blog:"})," Check out our ",(0,o.jsx)(n.a,{href:"https://www.calimero.network/blogs",children:"blog"})," for\ninsightful articles, tutorials, and the latest news about our project."]}),"\n"]}),"\n",(0,o.jsx)(n.p,{children:"We provide a variety of resources to help you learn more about our project and\nstay up-to-date with the latest developments. Dive into our documentation, read\nour blog, and explore our website to get the most out of our project."})]})}function d(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(u,{...e})}):u(e)}},5248:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>a});var r=t(758);const o={},i=r.createContext(o);function s(e){const n=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),r.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4302],{7166:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>d,frontMatter:()=>s,metadata:()=>r,toc:()=>c});const r=JSON.parse('{"id":"support/learning","title":"Learning","description":"Expand your knowledge and stay informed by exploring the following resources:","source":"@site/docs/10-support/02-learning.mdx","sourceDirName":"10-support","slug":"/support/learning","permalink":"/support/learning","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/10-support/02-learning.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":2,"frontMatter":{"id":"learning","title":"Learning"},"sidebar":"tutorialSidebar","previous":{"title":"Community and Support","permalink":"/support/community-and-support"},"next":{"title":"install-meroctl","permalink":"/shared/install-meroctl"}}');var o=t(6070),i=t(5248);const s={id:"learning",title:"Learning"},a="Learning",l={},c=[{value:"Learn More",id:"learn-more",level:2}];function u(e){const n={a:"a",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.header,{children:(0,o.jsx)(n.h1,{id:"learning",children:"Learning"})}),"\n",(0,o.jsx)(n.p,{children:"Expand your knowledge and stay informed by exploring the following resources:"}),"\n",(0,o.jsx)(n.h2,{id:"learn-more",children:"Learn More"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Website:"})," Visit our ",(0,o.jsx)(n.a,{href:"https://www.calimero.network/",children:"website"})," for\ncomprehensive information about the project, including features and\ndocumentation."]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Blog:"})," Check out our ",(0,o.jsx)(n.a,{href:"https://www.calimero.network/blogs",children:"blog"})," for\ninsightful articles, tutorials, and the latest news about our project."]}),"\n"]}),"\n",(0,o.jsx)(n.p,{children:"We provide a variety of resources to help you learn more about our project and\nstay up-to-date with the latest developments. Dive into our documentation, read\nour blog, and explore our website to get the most out of our project."})]})}function d(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(u,{...e})}):u(e)}},5248:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>a});var r=t(758);const o={},i=r.createContext(o);function s(e){const n=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),r.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/961bc6b0.3fee458e.js b/assets/js/961bc6b0.9f84b294.js similarity index 99% rename from assets/js/961bc6b0.3fee458e.js rename to assets/js/961bc6b0.9f84b294.js index 5a07ecea..e984c695 100644 --- a/assets/js/961bc6b0.3fee458e.js +++ b/assets/js/961bc6b0.9f84b294.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8778],{4849:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>o,contentTitle:()=>l,default:()=>p,frontMatter:()=>c,metadata:()=>a,toc:()=>r});const a=JSON.parse('{"id":"tutorials/create-context","title":"Create Context","description":"Create a context using the Admin Dashboard","source":"@site/docs/06-tutorials/02-create-context.mdx","sourceDirName":"06-tutorials","slug":"/tutorials/create-context","permalink":"/tutorials/create-context","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/06-tutorials/02-create-context.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":2,"frontMatter":{"id":"create-context","title":"Create Context"},"sidebar":"tutorialSidebar","previous":{"title":"ICP Wallet","permalink":"/tutorials/login-with-wallets/icp-wallet"},"next":{"title":"Invitations and Joinings","permalink":"/tutorials/invitations-and-joinings"}}');var i=n(6070),s=n(5248);const c={id:"create-context",title:"Create Context"},l=void 0,o={},r=[{value:"Create a context using the Admin Dashboard",id:"create-a-context-using-the-admin-dashboard",level:2},{value:"Create context using interactive CLI",id:"create-context-using-interactive-cli",level:2},{value:"Step 1: Install the Application",id:"step-1-install-the-application",level:3},{value:"Step 2: Create a New Context",id:"step-2-create-a-new-context",level:3}];function d(e){const t={a:"a",blockquote:"blockquote",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h2,{id:"create-a-context-using-the-admin-dashboard",children:"Create a context using the Admin Dashboard"}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsx)(t.li,{children:'Navigate to the "Contexts" tab and click the "Start New Context" button.'}),"\n",(0,i.jsx)(t.li,{children:'Use the "Browse" button to select an application from the list.'}),"\n",(0,i.jsx)(t.li,{children:'Choose the "Template Application" option.'}),"\n",(0,i.jsx)(t.li,{children:'Press "Start" to initiate the context creation process with the selected\napplication.'}),"\n"]}),"\n",(0,i.jsxs)(t.p,{children:["Visit ",(0,i.jsx)(t.a,{href:"../../developer-tools/apps/admin-dashboard",children:"Admin Dashboard Page"})," to view\ndetailed instructions with images."]}),"\n",(0,i.jsx)(t.p,{children:"After the context is created, you will be redirected to the context dashboard.\nKeep this page open as you will need the Context ID later."}),"\n",(0,i.jsx)(t.h2,{id:"create-context-using-interactive-cli",children:"Create context using interactive CLI"}),"\n",(0,i.jsxs)(t.p,{children:["After you have start the node following\n",(0,i.jsx)(t.a,{href:"../../getting-started/setup",children:"instructions"}),", interactive CLI will be available\nwithin the same terminal."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Interactive CLI",src:n(628).A+"",width:"2138",height:"1256"})}),"\n",(0,i.jsxs)(t.blockquote,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"NOTE"}),": You can see available commands in terminal: call, peers, pool, gc,\ncontext, application. In this example we will be using commands for ",(0,i.jsx)(t.code,{children:"context"}),"\nand ",(0,i.jsx)(t.code,{children:"application"}),"."]}),"\n"]}),"\n",(0,i.jsx)(t.h3,{id:"step-1-install-the-application",children:"Step 1: Install the Application"}),"\n",(0,i.jsx)(t.p,{children:"Run the following command to install the application:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"application install url {url}\xa0{metadata}\n"})}),"\n",(0,i.jsxs)(t.blockquote,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"NOTE"}),": metadata example:"]}),"\n"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'\'{"contractAppId": ""}\'\n'})}),"\n",(0,i.jsxs)(t.p,{children:["You can find the application ",(0,i.jsx)(t.code,{children:"URL"})," and ",(0,i.jsx)(t.code,{children:"contractAppId"})," by opening Application\nDetails from Applications section of the Admin Dashboard."]}),"\n",(0,i.jsxs)(t.p,{children:["You can also install an app that you have available locally with ",(0,i.jsx)(t.code,{children:"file"}),":"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"application install file {path/to/file}\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Application details",src:n(2315).A+"",width:"2418",height:"654"})}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"contractApplicationId"})," is the id of application stored in the contract. Value\nis optional but if provided, it enables Admin Dashboard to extract and display\nthe application metadata."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",metastring:'title="Example"',children:'application install url https://blobby-public.euw3.prod.gcp.calimero.network/bafkreihl5o6etrnpy7dlgixz3onbfb3og4dll2yqsqaebqakuldk6e2qya \'{"contractAppId": "980265ba072119a9074e429dea477e1c084a94e8d9f645c0158680e6942fb99e"}\'\n|\xa0Downloading application..\n\u2502 Installed application: Ahe2vLWLgswJARv5LsafXp7uJyb2Ba9GjzUSeLc71gUF\n'})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Application install",src:n(8327).A+"",width:"2104",height:"1054"})}),"\n",(0,i.jsx)(t.h3,{id:"step-2-create-a-new-context",children:"Step 2: Create a New Context"}),"\n",(0,i.jsxs)(t.p,{children:["Conext can be created from the\n",(0,i.jsx)(t.a,{href:"../../developer-tools/apps/admin-dashboard",children:"Admin Dashboard Page"})," or with\ninteractive CLI."]}),"\n",(0,i.jsx)(t.p,{children:"After the application is successfully installed, you can create a new context\nwith the installed application using this command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"context create {applicationId}\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",metastring:'title="Example"',children:"context create Ahe2vLWLgswJARv5LsafXp7uJyb2Ba9GjzUSeLc71gUF\n2024-10-07T11:55:36.658396Z INFO calimero_context: Subscribed to context context_id=567C5Gg4mxHMPKy2wLJ4uvb3DHsbcpVDYUsuAWgTPgXn\nCreated context 567C5Gg4mxHMPKy2wLJ4uvb3DHsbcpVDYUsuAWgTPgXn with\nidentity DaSkad6DK7f6fUhjz1CvNW7L4TkWZmWqAcwysZHG3Xs5\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Create context",src:n(1405).A+"",width:"2144",height:"1250"})})]})}function p(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},2315:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/application-details-for-context-creation-c6bad15db650370162b5f187fe61b93d.png"},628:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/0-interactive-cli-292babf32a8222076a6f90c6c54d768c.png"},8327:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/1-install-app-24cb8f2f6694b7c59c30c50ddfddcccb.png"},1405:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/2-create-context-3a7bde85050cb57aab0686c0b40d39d3.png"},5248:(e,t,n)=>{n.d(t,{R:()=>c,x:()=>l});var a=n(758);const i={},s=a.createContext(i);function c(e){const t=a.useContext(s);return a.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:c(e.components),a.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8778],{4849:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>o,contentTitle:()=>l,default:()=>p,frontMatter:()=>c,metadata:()=>a,toc:()=>r});const a=JSON.parse('{"id":"tutorials/create-context","title":"Create Context","description":"Create a context using the Admin Dashboard","source":"@site/docs/06-tutorials/02-create-context.mdx","sourceDirName":"06-tutorials","slug":"/tutorials/create-context","permalink":"/tutorials/create-context","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/06-tutorials/02-create-context.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":2,"frontMatter":{"id":"create-context","title":"Create Context"},"sidebar":"tutorialSidebar","previous":{"title":"ICP Wallet","permalink":"/tutorials/login-with-wallets/icp-wallet"},"next":{"title":"Invitations and Joinings","permalink":"/tutorials/invitations-and-joinings"}}');var i=n(6070),s=n(5248);const c={id:"create-context",title:"Create Context"},l=void 0,o={},r=[{value:"Create a context using the Admin Dashboard",id:"create-a-context-using-the-admin-dashboard",level:2},{value:"Create context using interactive CLI",id:"create-context-using-interactive-cli",level:2},{value:"Step 1: Install the Application",id:"step-1-install-the-application",level:3},{value:"Step 2: Create a New Context",id:"step-2-create-a-new-context",level:3}];function d(e){const t={a:"a",blockquote:"blockquote",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h2,{id:"create-a-context-using-the-admin-dashboard",children:"Create a context using the Admin Dashboard"}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsx)(t.li,{children:'Navigate to the "Contexts" tab and click the "Start New Context" button.'}),"\n",(0,i.jsx)(t.li,{children:'Use the "Browse" button to select an application from the list.'}),"\n",(0,i.jsx)(t.li,{children:'Choose the "Template Application" option.'}),"\n",(0,i.jsx)(t.li,{children:'Press "Start" to initiate the context creation process with the selected\napplication.'}),"\n"]}),"\n",(0,i.jsxs)(t.p,{children:["Visit ",(0,i.jsx)(t.a,{href:"../../developer-tools/apps/admin-dashboard",children:"Admin Dashboard Page"})," to view\ndetailed instructions with images."]}),"\n",(0,i.jsx)(t.p,{children:"After the context is created, you will be redirected to the context dashboard.\nKeep this page open as you will need the Context ID later."}),"\n",(0,i.jsx)(t.h2,{id:"create-context-using-interactive-cli",children:"Create context using interactive CLI"}),"\n",(0,i.jsxs)(t.p,{children:["After you have start the node following\n",(0,i.jsx)(t.a,{href:"../../getting-started/setup",children:"instructions"}),", interactive CLI will be available\nwithin the same terminal."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Interactive CLI",src:n(628).A+"",width:"2138",height:"1256"})}),"\n",(0,i.jsxs)(t.blockquote,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"NOTE"}),": You can see available commands in terminal: call, peers, pool, gc,\ncontext, application. In this example we will be using commands for ",(0,i.jsx)(t.code,{children:"context"}),"\nand ",(0,i.jsx)(t.code,{children:"application"}),"."]}),"\n"]}),"\n",(0,i.jsx)(t.h3,{id:"step-1-install-the-application",children:"Step 1: Install the Application"}),"\n",(0,i.jsx)(t.p,{children:"Run the following command to install the application:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"application install url {url}\xa0{metadata}\n"})}),"\n",(0,i.jsxs)(t.blockquote,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"NOTE"}),": metadata example:"]}),"\n"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'\'{"contractAppId": ""}\'\n'})}),"\n",(0,i.jsxs)(t.p,{children:["You can find the application ",(0,i.jsx)(t.code,{children:"URL"})," and ",(0,i.jsx)(t.code,{children:"contractAppId"})," by opening Application\nDetails from Applications section of the Admin Dashboard."]}),"\n",(0,i.jsxs)(t.p,{children:["You can also install an app that you have available locally with ",(0,i.jsx)(t.code,{children:"file"}),":"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"application install file {path/to/file}\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Application details",src:n(2315).A+"",width:"2418",height:"654"})}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"contractApplicationId"})," is the id of application stored in the contract. Value\nis optional but if provided, it enables Admin Dashboard to extract and display\nthe application metadata."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",metastring:'title="Example"',children:'application install url https://blobby-public.euw3.prod.gcp.calimero.network/bafkreihl5o6etrnpy7dlgixz3onbfb3og4dll2yqsqaebqakuldk6e2qya \'{"contractAppId": "980265ba072119a9074e429dea477e1c084a94e8d9f645c0158680e6942fb99e"}\'\n|\xa0Downloading application..\n\u2502 Installed application: Ahe2vLWLgswJARv5LsafXp7uJyb2Ba9GjzUSeLc71gUF\n'})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Application install",src:n(8327).A+"",width:"2104",height:"1054"})}),"\n",(0,i.jsx)(t.h3,{id:"step-2-create-a-new-context",children:"Step 2: Create a New Context"}),"\n",(0,i.jsxs)(t.p,{children:["Conext can be created from the\n",(0,i.jsx)(t.a,{href:"../../developer-tools/apps/admin-dashboard",children:"Admin Dashboard Page"})," or with\ninteractive CLI."]}),"\n",(0,i.jsx)(t.p,{children:"After the application is successfully installed, you can create a new context\nwith the installed application using this command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"context create {applicationId}\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",metastring:'title="Example"',children:"context create Ahe2vLWLgswJARv5LsafXp7uJyb2Ba9GjzUSeLc71gUF\n2024-10-07T11:55:36.658396Z INFO calimero_context: Subscribed to context context_id=567C5Gg4mxHMPKy2wLJ4uvb3DHsbcpVDYUsuAWgTPgXn\nCreated context 567C5Gg4mxHMPKy2wLJ4uvb3DHsbcpVDYUsuAWgTPgXn with\nidentity DaSkad6DK7f6fUhjz1CvNW7L4TkWZmWqAcwysZHG3Xs5\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Create context",src:n(1405).A+"",width:"2144",height:"1250"})})]})}function p(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},2315:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/application-details-for-context-creation-c6bad15db650370162b5f187fe61b93d.png"},628:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/0-interactive-cli-292babf32a8222076a6f90c6c54d768c.png"},8327:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/1-install-app-24cb8f2f6694b7c59c30c50ddfddcccb.png"},1405:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/2-create-context-3a7bde85050cb57aab0686c0b40d39d3.png"},5248:(e,t,n)=>{n.d(t,{R:()=>c,x:()=>l});var a=n(758);const i={},s=a.createContext(i);function c(e){const t=a.useContext(s);return a.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:c(e.components),a.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/9859.dc733ae1.js b/assets/js/9859.cd0f1376.js similarity index 99% rename from assets/js/9859.dc733ae1.js rename to assets/js/9859.cd0f1376.js index 9a51e83d..17114b7a 100644 --- a/assets/js/9859.dc733ae1.js +++ b/assets/js/9859.cd0f1376.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9859],{202:(e,t,n)=>{t.Qi=t.XO=void 0;const r=n(406),i=n(8137),s=n(436);var o;!function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:s.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:s.Event.None}),e.is=function(t){const n=t;return n&&(n===e.None||n===e.Cancelled||i.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}}(o||(t.XO=o={}));const a=Object.freeze((function(e,t){const n=(0,r.default)().timer.setTimeout(e.bind(t),0);return{dispose(){n.dispose()}}}));class c{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?a:(this._emitter||(this._emitter=new s.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}t.Qi=class{get token(){return this._token||(this._token=new c),this._token}cancel(){this._token?this._token.cancel():this._token=o.Cancelled}dispose(){this._token?this._token instanceof c&&this._token.dispose():this._token=o.None}}},436:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;const r=n(406);var i;!function(e){const t={dispose(){}};e.None=function(){return t}}(i||(t.Event=i={}));class s{add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let n=!1;for(let r=0,i=this._callbacks.length;r{this._callbacks||(this._callbacks=new s),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);const r={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),r.dispose=o._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(r),r}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}t.Emitter=o,o._noop=function(){}},8137:(e,t)=>{function n(e){return"string"==typeof e||e instanceof String}function r(e){return Array.isArray(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0,t.boolean=function(e){return!0===e||!1===e},t.string=n,t.number=function(e){return"number"==typeof e||e instanceof Number},t.error=function(e){return e instanceof Error},t.func=function(e){return"function"==typeof e},t.array=r,t.stringArray=function(e){return r(e)&&e.every((e=>n(e)))}},406:(e,t)=>{let n;function r(){if(void 0===n)throw new Error("No runtime abstraction layer installed");return n}Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.install=function(e){if(void 0===e)throw new Error("No runtime abstraction layer provided");n=e}}(r||(r={})),t.default=r},8469:(e,t,n)=>{n.d(t,{v:()=>a});var r=n(5409),i=n(7546),s=class extends r.mR{static{(0,r.K2)(this,"InfoTokenBuilder")}constructor(){super(["info","showInfo"])}},o={parser:{TokenBuilder:(0,r.K2)((()=>new s),"TokenBuilder"),ValueConverter:(0,r.K2)((()=>new r.Tm),"ValueConverter")}};function a(e=i.DD){const t=(0,i.WQ)((0,i.uM)(e),r.sr),n=(0,i.WQ)((0,i.tG)({shared:t}),r.e5,o);return t.ServiceRegistry.register(n),{shared:t,Info:n}}(0,r.K2)(a,"createInfoServices")},8693:(e,t,n)=>{n.d(t,{f:()=>c});var r=n(5409),i=n(7546),s=class extends r.mR{static{(0,r.K2)(this,"PieTokenBuilder")}constructor(){super(["pie","showData"])}},o=class extends r.dg{static{(0,r.K2)(this,"PieValueConverter")}runCustomConverter(e,t,n){if("PIE_SECTION_LABEL"===e.name)return t.replace(/"/g,"").trim()}},a={parser:{TokenBuilder:(0,r.K2)((()=>new s),"TokenBuilder"),ValueConverter:(0,r.K2)((()=>new o),"ValueConverter")}};function c(e=i.DD){const t=(0,i.WQ)((0,i.uM)(e),r.sr),n=(0,i.WQ)((0,i.tG)({shared:t}),r.KX,a);return t.ServiceRegistry.register(n),{shared:t,Pie:n}}(0,r.K2)(c,"createPieServices")},3457:(e,t,n)=>{n.d(t,{$:()=>a});var r=n(5409),i=n(7546),s=class extends r.mR{static{(0,r.K2)(this,"PacketTokenBuilder")}constructor(){super(["packet-beta"])}},o={parser:{TokenBuilder:(0,r.K2)((()=>new s),"TokenBuilder"),ValueConverter:(0,r.K2)((()=>new r.Tm),"ValueConverter")}};function a(e=i.DD){const t=(0,i.WQ)((0,i.uM)(e),r.sr),n=(0,i.WQ)((0,i.tG)({shared:t}),r.AM,o);return t.ServiceRegistry.register(n),{shared:t,Packet:n}}(0,r.K2)(a,"createPacketServices")},3960:(e,t,n)=>{n.d(t,{S:()=>c});var r=n(5409),i=n(7546),s=class extends r.mR{static{(0,r.K2)(this,"ArchitectureTokenBuilder")}constructor(){super(["architecture"])}},o=class extends r.dg{static{(0,r.K2)(this,"ArchitectureValueConverter")}runCustomConverter(e,t,n){return"ARCH_ICON"===e.name?t.replace(/[()]/g,"").trim():"ARCH_TEXT_ICON"===e.name?t.replace(/["()]/g,""):"ARCH_TITLE"===e.name?t.replace(/[[\]]/g,"").trim():void 0}},a={parser:{TokenBuilder:(0,r.K2)((()=>new s),"TokenBuilder"),ValueConverter:(0,r.K2)((()=>new o),"ValueConverter")}};function c(e=i.DD){const t=(0,i.WQ)((0,i.uM)(e),r.sr),n=(0,i.WQ)((0,i.tG)({shared:t}),r.jE,a);return t.ServiceRegistry.register(n),{shared:t,Architecture:n}}(0,r.K2)(c,"createArchitectureServices")},4105:(e,t,n)=>{n.d(t,{b:()=>a});var r=n(5409),i=n(7546),s=class extends r.mR{static{(0,r.K2)(this,"GitGraphTokenBuilder")}constructor(){super(["gitGraph"])}},o={parser:{TokenBuilder:(0,r.K2)((()=>new s),"TokenBuilder"),ValueConverter:(0,r.K2)((()=>new r.Tm),"ValueConverter")}};function a(e=i.DD){const t=(0,i.WQ)((0,i.uM)(e),r.sr),n=(0,i.WQ)((0,i.tG)({shared:t}),r.eZ,o);return t.ServiceRegistry.register(n),{shared:t,GitGraph:n}}(0,r.K2)(a,"createGitGraphServices")},5409:(e,t,n)=>{n.d(t,{AM:()=>$,K2:()=>s,KX:()=>w,Tm:()=>P,dg:()=>_,e5:()=>C,eZ:()=>O,jE:()=>L,mR:()=>M,sr:()=>N});var r=n(7546),i=Object.defineProperty,s=(e,t)=>i(e,"name",{value:t,configurable:!0});s((function(e){return g.isInstance(e,"Architecture")}),"isArchitecture");var o="Branch";s((function(e){return g.isInstance(e,o)}),"isBranch");var a="Commit";s((function(e){return g.isInstance(e,a)}),"isCommit");s((function(e){return g.isInstance(e,"Common")}),"isCommon");var c="GitGraph";s((function(e){return g.isInstance(e,c)}),"isGitGraph");s((function(e){return g.isInstance(e,"Info")}),"isInfo");var l="Merge";s((function(e){return g.isInstance(e,l)}),"isMerge");s((function(e){return g.isInstance(e,"Packet")}),"isPacket");s((function(e){return g.isInstance(e,"PacketBlock")}),"isPacketBlock");s((function(e){return g.isInstance(e,"Pie")}),"isPie");s((function(e){return g.isInstance(e,"PieSection")}),"isPieSection");var u,d,h,f,p,m=class extends r.kD{static{s(this,"MermaidAstReflection")}getAllTypes(){return["Architecture","Branch","Checkout","CherryPicking","Commit","Common","Direction","Edge","GitGraph","Group","Info","Junction","Merge","Packet","PacketBlock","Pie","PieSection","Service","Statement"]}computeIsSubtype(e,t){switch(e){case o:case"Checkout":case"CherryPicking":case a:case l:return this.isSubtype("Statement",t);case"Direction":return this.isSubtype(c,t);default:return!1}}getReferenceType(e){const t=`${e.container.$type}:${e.property}`;throw new Error(`${t} is not a valid reference id.`)}getTypeMetaData(e){switch(e){case"Architecture":return{name:"Architecture",properties:[{name:"accDescr"},{name:"accTitle"},{name:"edges",defaultValue:[]},{name:"groups",defaultValue:[]},{name:"junctions",defaultValue:[]},{name:"services",defaultValue:[]},{name:"title"}]};case"Branch":return{name:"Branch",properties:[{name:"name"},{name:"order"}]};case"Checkout":return{name:"Checkout",properties:[{name:"branch"}]};case"CherryPicking":return{name:"CherryPicking",properties:[{name:"id"},{name:"parent"},{name:"tags",defaultValue:[]}]};case"Commit":return{name:"Commit",properties:[{name:"id"},{name:"message"},{name:"tags",defaultValue:[]},{name:"type"}]};case"Common":return{name:"Common",properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case"Edge":return{name:"Edge",properties:[{name:"lhsDir"},{name:"lhsGroup",defaultValue:!1},{name:"lhsId"},{name:"lhsInto",defaultValue:!1},{name:"rhsDir"},{name:"rhsGroup",defaultValue:!1},{name:"rhsId"},{name:"rhsInto",defaultValue:!1},{name:"title"}]};case"GitGraph":return{name:"GitGraph",properties:[{name:"accDescr"},{name:"accTitle"},{name:"statements",defaultValue:[]},{name:"title"}]};case"Group":return{name:"Group",properties:[{name:"icon"},{name:"id"},{name:"in"},{name:"title"}]};case"Info":return{name:"Info",properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case"Junction":return{name:"Junction",properties:[{name:"id"},{name:"in"}]};case"Merge":return{name:"Merge",properties:[{name:"branch"},{name:"id"},{name:"tags",defaultValue:[]},{name:"type"}]};case"Packet":return{name:"Packet",properties:[{name:"accDescr"},{name:"accTitle"},{name:"blocks",defaultValue:[]},{name:"title"}]};case"PacketBlock":return{name:"PacketBlock",properties:[{name:"end"},{name:"label"},{name:"start"}]};case"Pie":return{name:"Pie",properties:[{name:"accDescr"},{name:"accTitle"},{name:"sections",defaultValue:[]},{name:"showData",defaultValue:!1},{name:"title"}]};case"PieSection":return{name:"PieSection",properties:[{name:"label"},{name:"value"}]};case"Service":return{name:"Service",properties:[{name:"icon"},{name:"iconText"},{name:"id"},{name:"in"},{name:"title"}]};case"Direction":return{name:"Direction",properties:[{name:"accDescr"},{name:"accTitle"},{name:"dir"},{name:"statements",defaultValue:[]},{name:"title"}]};default:return{name:e,properties:[]}}}},g=new m,y=s((()=>u??(u=(0,r.y0)('{"$type":"Grammar","isDeclared":true,"name":"Info","imports":[],"rules":[{"$type":"ParserRule","name":"Info","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}'))),"InfoGrammar"),A=s((()=>d??(d=(0,r.y0)('{"$type":"Grammar","isDeclared":true,"name":"Packet","imports":[],"rules":[{"$type":"ParserRule","name":"Packet","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"packet-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"?"},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|\'[^\']*\'/"},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}'))),"PacketGrammar"),T=s((()=>h??(h=(0,r.y0)('{"$type":"Grammar","isDeclared":true,"name":"Pie","imports":[],"rules":[{"$type":"ParserRule","name":"Pie","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"PIE_SECTION_LABEL","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]+\\"/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PIE_SECTION_VALUE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/(0|[1-9][0-9]*)(\\\\.[0-9]+)?/"},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}'))),"PieGrammar"),v=s((()=>f??(f=(0,r.y0)('{"$type":"Grammar","isDeclared":true,"name":"Architecture","imports":[],"rules":[{"$type":"ParserRule","name":"Architecture","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Statement","fragment":true,"definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LeftPort","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RightPort","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Arrow","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ID","definition":{"$type":"RegexToken","regex":"/[\\\\w]+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TEXT_ICON","definition":{"$type":"RegexToken","regex":"/\\\\(\\"[^\\"]+\\"\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[[\\\\w ]+\\\\]/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/"},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}'))),"ArchitectureGrammar"),R=s((()=>p??(p=(0,r.y0)('{"$type":"Grammar","isDeclared":true,"name":"GitGraph","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"ParserRule","name":"GitGraph","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+(?=\\\\s)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|\'[^\']*\'/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"types":[],"usedGrammars":[]}'))),"GitGraphGrammar"),E={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},k={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},x={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},I={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},S={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},N={AstReflection:s((()=>new m),"AstReflection")},C={Grammar:s((()=>y()),"Grammar"),LanguageMetaData:s((()=>E),"LanguageMetaData"),parser:{}},$={Grammar:s((()=>A()),"Grammar"),LanguageMetaData:s((()=>k),"LanguageMetaData"),parser:{}},w={Grammar:s((()=>T()),"Grammar"),LanguageMetaData:s((()=>x),"LanguageMetaData"),parser:{}},L={Grammar:s((()=>v()),"Grammar"),LanguageMetaData:s((()=>I),"LanguageMetaData"),parser:{}},O={Grammar:s((()=>R()),"Grammar"),LanguageMetaData:s((()=>S),"LanguageMetaData"),parser:{}},b={ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/accTitle[\t ]*:([^\n\r]*)/,TITLE:/title([\t ][^\n\r]*|)/},_=class extends r.dM{static{s(this,"AbstractMermaidValueConverter")}runConverter(e,t,n){let r=this.runCommonConverter(e,t,n);return void 0===r&&(r=this.runCustomConverter(e,t,n)),void 0===r?super.runConverter(e,t,n):r}runCommonConverter(e,t,n){const r=b[e.name];if(void 0===r)return;const i=r.exec(t);return null!==i?void 0!==i[1]?i[1].trim().replace(/[\t ]{2,}/gm," "):void 0!==i[2]?i[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,"\n"):void 0:void 0}},P=class extends _{static{s(this,"CommonValueConverter")}runCustomConverter(e,t,n){}},M=class extends r.QU{static{s(this,"AbstractMermaidTokenBuilder")}constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,t,n){const r=super.buildKeywordTokens(e,t,n);return r.forEach((e=>{this.keywords.has(e.name)&&void 0!==e.PATTERN&&(e.PATTERN=new RegExp(e.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))})),r}};(class extends M{static{s(this,"CommonTokenBuilder")}})},9859:(e,t,n)=>{n.d(t,{qg:()=>o});n(4105),n(8469),n(3457),n(8693),n(3960);var r=n(5409),i={},s={info:(0,r.K2)((async()=>{const{createInfoServices:e}=await n.e(1346).then(n.bind(n,1346)),t=e().Info.parser.LangiumParser;i.info=t}),"info"),packet:(0,r.K2)((async()=>{const{createPacketServices:e}=await n.e(8700).then(n.bind(n,8700)),t=e().Packet.parser.LangiumParser;i.packet=t}),"packet"),pie:(0,r.K2)((async()=>{const{createPieServices:e}=await n.e(867).then(n.bind(n,867)),t=e().Pie.parser.LangiumParser;i.pie=t}),"pie"),architecture:(0,r.K2)((async()=>{const{createArchitectureServices:e}=await n.e(1456).then(n.bind(n,1456)),t=e().Architecture.parser.LangiumParser;i.architecture=t}),"architecture"),gitGraph:(0,r.K2)((async()=>{const{createGitGraphServices:e}=await n.e(1307).then(n.bind(n,3688)),t=e().GitGraph.parser.LangiumParser;i.gitGraph=t}),"gitGraph")};async function o(e,t){const n=s[e];if(!n)throw new Error(`Unknown diagram type: ${e}`);i[e]||await n();const r=i[e].parse(t);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new a(r);return r.value}(0,r.K2)(o,"parse");var a=class extends Error{constructor(e){super(`Parsing failed: ${e.lexerErrors.map((e=>e.message)).join("\n")} ${e.parserErrors.map((e=>e.message)).join("\n")}`),this.result=e}static{(0,r.K2)(this,"MermaidParseError")}}},7546:(e,t,n)=>{function r(e){return"object"==typeof e&&null!==e&&"string"==typeof e.$type}function i(e){return"object"==typeof e&&null!==e&&"string"==typeof e.$refText}function s(e){return"object"==typeof e&&null!==e&&r(e.container)&&i(e.reference)&&"string"==typeof e.message}n.d(t,{kD:()=>o,QU:()=>Hc,dM:()=>Wc,DD:()=>Lu,tG:()=>Eu,uM:()=>ku,WQ:()=>xu,y0:()=>_u});class o{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,t){return r(e)&&this.isSubtype(e.$type,t)}isSubtype(e,t){if(e===t)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});const r=n[t];if(void 0!==r)return r;{const r=this.computeIsSubtype(e,t);return n[t]=r,r}}getAllSubTypes(e){const t=this.allSubtypes[e];if(t)return t;{const t=this.getAllTypes(),n=[];for(const r of t)this.isSubtype(r,e)&&n.push(r);return this.allSubtypes[e]=n,n}}}function a(e){return"object"==typeof e&&null!==e&&Array.isArray(e.content)}function c(e){return"object"==typeof e&&null!==e&&"object"==typeof e.tokenType}function l(e){return a(e)&&"string"==typeof e.fullText}class u{constructor(e,t){this.startFn=e,this.nextFn=t}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){const e=this.iterator();return Boolean(e.next().done)}count(){const e=this.iterator();let t=0,n=e.next();for(;!n.done;)t++,n=e.next();return t}toArray(){const e=[],t=this.iterator();let n;do{n=t.next(),void 0!==n.value&&e.push(n.value)}while(!n.done);return e}toSet(){return new Set(this)}toMap(e,t){const n=this.map((n=>[e?e(n):n,t?t(n):n]));return new Map(n)}toString(){return this.join()}concat(e){const t=e[Symbol.iterator]();return new u((()=>({first:this.startFn(),firstDone:!1})),(e=>{let n;if(!e.firstDone){do{if(n=this.nextFn(e.first),!n.done)return n}while(!n.done);e.firstDone=!0}do{if(n=t.next(),!n.done)return n}while(!n.done);return p}))}join(e=","){const t=this.iterator();let n,r="",i=!1;do{n=t.next(),n.done||(i&&(r+=e),r+=d(n.value)),i=!0}while(!n.done);return r}indexOf(e,t=0){const n=this.iterator();let r=0,i=n.next();for(;!i.done;){if(r>=t&&i.value===e)return r;i=n.next(),r++}return-1}every(e){const t=this.iterator();let n=t.next();for(;!n.done;){if(!e(n.value))return!1;n=t.next()}return!0}some(e){const t=this.iterator();let n=t.next();for(;!n.done;){if(e(n.value))return!0;n=t.next()}return!1}forEach(e){const t=this.iterator();let n=0,r=t.next();for(;!r.done;)e(r.value,n),r=t.next(),n++}map(e){return new u(this.startFn,(t=>{const{done:n,value:r}=this.nextFn(t);return n?p:{done:!1,value:e(r)}}))}filter(e){return new u(this.startFn,(t=>{let n;do{if(n=this.nextFn(t),!n.done&&e(n.value))return n}while(!n.done);return p}))}nonNullable(){return this.filter((e=>null!=e))}reduce(e,t){const n=this.iterator();let r=t,i=n.next();for(;!i.done;)r=void 0===r?i.value:e(r,i.value),i=n.next();return r}reduceRight(e,t){return this.recursiveReduce(this.iterator(),e,t)}recursiveReduce(e,t,n){const r=e.next();if(r.done)return n;const i=this.recursiveReduce(e,t,n);return void 0===i?r.value:t(i,r.value)}find(e){const t=this.iterator();let n=t.next();for(;!n.done;){if(e(n.value))return n.value;n=t.next()}}findIndex(e){const t=this.iterator();let n=0,r=t.next();for(;!r.done;){if(e(r.value))return n;r=t.next(),n++}return-1}includes(e){const t=this.iterator();let n=t.next();for(;!n.done;){if(n.value===e)return!0;n=t.next()}return!1}flatMap(e){return new u((()=>({this:this.startFn()})),(t=>{do{if(t.iterator){const e=t.iterator.next();if(!e.done)return e;t.iterator=void 0}const{done:n,value:r}=this.nextFn(t.this);if(!n){const n=e(r);if(!h(n))return{done:!1,value:n};t.iterator=n[Symbol.iterator]()}}while(t.iterator);return p}))}flat(e){if(void 0===e&&(e=1),e<=0)return this;const t=e>1?this.flat(e-1):this;return new u((()=>({this:t.startFn()})),(e=>{do{if(e.iterator){const t=e.iterator.next();if(!t.done)return t;e.iterator=void 0}const{done:n,value:r}=t.nextFn(e.this);if(!n){if(!h(r))return{done:!1,value:r};e.iterator=r[Symbol.iterator]()}}while(e.iterator);return p}))}head(){const e=this.iterator().next();if(!e.done)return e.value}tail(e=1){return new u((()=>{const t=this.startFn();for(let n=0;n({size:0,state:this.startFn()})),(t=>(t.size++,t.size>e?p:this.nextFn(t.state))))}distinct(e){const t=new Set;return this.filter((n=>{const r=e?e(n):n;return!t.has(r)&&(t.add(r),!0)}))}exclude(e,t){const n=new Set;for(const r of e){const e=t?t(r):r;n.add(e)}return this.filter((e=>{const r=t?t(e):e;return!n.has(r)}))}}function d(e){return"string"==typeof e?e:void 0===e?"undefined":"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e)}function h(e){return!!e&&"function"==typeof e[Symbol.iterator]}const f=new u((()=>{}),(()=>p)),p=Object.freeze({done:!0,value:void 0});function m(...e){if(1===e.length){const t=e[0];if(t instanceof u)return t;if(h(t))return new u((()=>t[Symbol.iterator]()),(e=>e.next()));if("number"==typeof t.length)return new u((()=>({index:0})),(e=>e.index1?new u((()=>({collIndex:0,arrIndex:0})),(t=>{do{if(t.iterator){const e=t.iterator.next();if(!e.done)return e;t.iterator=void 0}if(t.array){if(t.arrIndex({iterators:(null==n?void 0:n.includeRoot)?[[e][Symbol.iterator]()]:[t(e)[Symbol.iterator]()],pruned:!1})),(e=>{for(e.pruned&&(e.iterators.pop(),e.pruned=!1);e.iterators.length>0;){const n=e.iterators[e.iterators.length-1].next();if(!n.done)return e.iterators.push(t(n.value)[Symbol.iterator]()),n;e.iterators.pop()}return p}))}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var y,A;function T(e){return new g(e,(e=>a(e)?e.content:[]),{includeRoot:!0})}function v(e){return{start:{character:e.startColumn-1,line:e.startLine-1},end:{character:e.endColumn,line:e.endLine-1}}}function R(e){if(!e)return;const{offset:t,end:n,range:r}=e;return{range:r,offset:t,end:n,length:n-t}}function E(e,t){const n=function(e,t){if(e.end.linet.end.line||e.start.line===t.end.line&&e.start.character>t.end.character)return A.After;const n=e.start.line>t.start.line||e.start.line===t.start.line&&e.start.character>=t.start.character,r=e.end.lineA.After}!function(e){e.sum=function(e){return e.reduce(((e,t)=>e+t),0)},e.product=function(e){return e.reduce(((e,t)=>e*t),0)},e.min=function(e){return e.reduce(((e,t)=>Math.min(e,t)))},e.max=function(e){return e.reduce(((e,t)=>Math.max(e,t)))}}(y||(y={})),function(e){e[e.Before=0]="Before",e[e.After=1]="After",e[e.OverlapFront=2]="OverlapFront",e[e.OverlapBack=3]="OverlapBack",e[e.Inside=4]="Inside"}(A||(A={}));const k=/^[\w\p{L}]$/u;function x(e,t){if(e){const n=function(e,t=!0){for(;e.container;){const n=e.container;let r=n.content.indexOf(e);for(;r>0;){r--;const e=n.content[r];if(t||!e.hidden)return e}e=n}return}(e,!0);if(n&&I(n,t))return n;if(l(e)){for(let n=e.content.findIndex((e=>!e.hidden))-1;n>=0;n--){const r=e.content[n];if(I(r,t))return r}}}}function I(e,t){return c(e)&&t.includes(e.tokenType.name)}class S extends Error{constructor(e,t){super(e?`${t} at ${e.range.start.line}:${e.range.start.character}`:t)}}function N(e){throw new Error("Error! The input value was not handled.")}const C="AbstractRule";const $="AbstractType";const w="Condition";const L="TypeDefinition";const O="ValueLiteral";const b="AbstractElement";const _="ArrayLiteral";const P="ArrayType";const M="BooleanLiteral";const D="Conjunction";const U="Disjunction";const F="Grammar";const G="InferredType";function K(e){return Oe.isInstance(e,G)}const B="Interface";function j(e){return Oe.isInstance(e,B)}const V="Negation";const H="NumberLiteral";const W="Parameter";const z="ParameterReference";const Y="ParserRule";function X(e){return Oe.isInstance(e,Y)}const q="ReferenceType";const Q="ReturnType";const J="SimpleType";const Z="StringLiteral";const ee="TerminalRule";function te(e){return Oe.isInstance(e,ee)}const ne="Type";function re(e){return Oe.isInstance(e,ne)}const ie="UnionType";const se="Action";function oe(e){return Oe.isInstance(e,se)}const ae="Alternatives";function ce(e){return Oe.isInstance(e,ae)}const le="Assignment";function ue(e){return Oe.isInstance(e,le)}const de="CharacterRange";const he="CrossReference";function fe(e){return Oe.isInstance(e,he)}const pe="EndOfFile";const me="Group";function ge(e){return Oe.isInstance(e,me)}const ye="Keyword";function Ae(e){return Oe.isInstance(e,ye)}const Te="NegatedToken";const ve="RegexToken";const Re="RuleCall";function Ee(e){return Oe.isInstance(e,Re)}const ke="TerminalAlternatives";const xe="TerminalGroup";const Ie="TerminalRuleCall";function Se(e){return Oe.isInstance(e,Ie)}const Ne="UnorderedGroup";function Ce(e){return Oe.isInstance(e,Ne)}const $e="UntilToken";const we="Wildcard";class Le extends o{getAllTypes(){return["AbstractElement","AbstractRule","AbstractType","Action","Alternatives","ArrayLiteral","ArrayType","Assignment","BooleanLiteral","CharacterRange","Condition","Conjunction","CrossReference","Disjunction","EndOfFile","Grammar","GrammarImport","Group","InferredType","Interface","Keyword","NamedArgument","NegatedToken","Negation","NumberLiteral","Parameter","ParameterReference","ParserRule","ReferenceType","RegexToken","ReturnType","RuleCall","SimpleType","StringLiteral","TerminalAlternatives","TerminalGroup","TerminalRule","TerminalRuleCall","Type","TypeAttribute","TypeDefinition","UnionType","UnorderedGroup","UntilToken","ValueLiteral","Wildcard"]}computeIsSubtype(e,t){switch(e){case se:case ae:case le:case de:case he:case pe:case me:case ye:case Te:case ve:case Re:case ke:case xe:case Ie:case Ne:case $e:case we:return this.isSubtype(b,t);case _:case H:case Z:return this.isSubtype(O,t);case P:case q:case J:case ie:return this.isSubtype(L,t);case M:return this.isSubtype(w,t)||this.isSubtype(O,t);case D:case U:case V:case z:return this.isSubtype(w,t);case G:case B:case ne:return this.isSubtype($,t);case Y:return this.isSubtype(C,t)||this.isSubtype($,t);case ee:return this.isSubtype(C,t);default:return!1}}getReferenceType(e){const t=`${e.container.$type}:${e.property}`;switch(t){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return $;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return C;case"Grammar:usedGrammars":return F;case"NamedArgument:parameter":case"ParameterReference:parameter":return W;case"TerminalRuleCall:rule":return ee;default:throw new Error(`${t} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case"AbstractElement":return{name:"AbstractElement",properties:[{name:"cardinality"},{name:"lookahead"}]};case"ArrayLiteral":return{name:"ArrayLiteral",properties:[{name:"elements",defaultValue:[]}]};case"ArrayType":return{name:"ArrayType",properties:[{name:"elementType"}]};case"BooleanLiteral":return{name:"BooleanLiteral",properties:[{name:"true",defaultValue:!1}]};case"Conjunction":return{name:"Conjunction",properties:[{name:"left"},{name:"right"}]};case"Disjunction":return{name:"Disjunction",properties:[{name:"left"},{name:"right"}]};case"Grammar":return{name:"Grammar",properties:[{name:"definesHiddenTokens",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"imports",defaultValue:[]},{name:"interfaces",defaultValue:[]},{name:"isDeclared",defaultValue:!1},{name:"name"},{name:"rules",defaultValue:[]},{name:"types",defaultValue:[]},{name:"usedGrammars",defaultValue:[]}]};case"GrammarImport":return{name:"GrammarImport",properties:[{name:"path"}]};case"InferredType":return{name:"InferredType",properties:[{name:"name"}]};case"Interface":return{name:"Interface",properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case"NamedArgument":return{name:"NamedArgument",properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case"Negation":return{name:"Negation",properties:[{name:"value"}]};case"NumberLiteral":return{name:"NumberLiteral",properties:[{name:"value"}]};case"Parameter":return{name:"Parameter",properties:[{name:"name"}]};case"ParameterReference":return{name:"ParameterReference",properties:[{name:"parameter"}]};case"ParserRule":return{name:"ParserRule",properties:[{name:"dataType"},{name:"definesHiddenTokens",defaultValue:!1},{name:"definition"},{name:"entry",defaultValue:!1},{name:"fragment",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"inferredType"},{name:"name"},{name:"parameters",defaultValue:[]},{name:"returnType"},{name:"wildcard",defaultValue:!1}]};case"ReferenceType":return{name:"ReferenceType",properties:[{name:"referenceType"}]};case"ReturnType":return{name:"ReturnType",properties:[{name:"name"}]};case"SimpleType":return{name:"SimpleType",properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case"StringLiteral":return{name:"StringLiteral",properties:[{name:"value"}]};case"TerminalRule":return{name:"TerminalRule",properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case"Type":return{name:"Type",properties:[{name:"name"},{name:"type"}]};case"TypeAttribute":return{name:"TypeAttribute",properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case"UnionType":return{name:"UnionType",properties:[{name:"types",defaultValue:[]}]};case"Action":return{name:"Action",properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case"Alternatives":return{name:"Alternatives",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"Assignment":return{name:"Assignment",properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case"CharacterRange":return{name:"CharacterRange",properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case"CrossReference":return{name:"CrossReference",properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case"EndOfFile":return{name:"EndOfFile",properties:[{name:"cardinality"},{name:"lookahead"}]};case"Group":return{name:"Group",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case"Keyword":return{name:"Keyword",properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case"NegatedToken":return{name:"NegatedToken",properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case"RegexToken":return{name:"RegexToken",properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case"RuleCall":return{name:"RuleCall",properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case"TerminalAlternatives":return{name:"TerminalAlternatives",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"TerminalGroup":return{name:"TerminalGroup",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"TerminalRuleCall":return{name:"TerminalRuleCall",properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case"UnorderedGroup":return{name:"UnorderedGroup",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"UntilToken":return{name:"UntilToken",properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case"Wildcard":return{name:"Wildcard",properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:e,properties:[]}}}}const Oe=new Le;function be(e){for(const[t,n]of Object.entries(e))t.startsWith("$")||(Array.isArray(n)?n.forEach(((n,i)=>{r(n)&&(n.$container=e,n.$containerProperty=t,n.$containerIndex=i)})):r(n)&&(n.$container=e,n.$containerProperty=t))}function _e(e,t){let n=e;for(;n;){if(t(n))return n;n=n.$container}}function Pe(e){const t=function(e){for(;e.$container;)e=e.$container;return e}(e),n=t.$document;if(!n)throw new Error("AST node has no document.");return n}function Me(e,t){if(!e)throw new Error("Node must be an AstNode.");const n=null==t?void 0:t.range;return new u((()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0})),(t=>{for(;t.keyIndexMe(e,t)))}function Ue(e,t){if(!e)throw new Error("Root node must be an AstNode.");return(null==t?void 0:t.range)&&!Fe(e,t.range)?new g(e,(()=>[])):new g(e,(e=>Me(e,t)),{includeRoot:!0})}function Fe(e,t){var n;if(!t)return!0;const r=null===(n=e.$cstNode)||void 0===n?void 0:n.range;return!!r&&E(r,t)}function Ge(e){return new u((()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0})),(t=>{for(;t.keyIndex=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}}class tt{visitChildren(e){for(const t in e){const n=e[t];e.hasOwnProperty(t)&&(void 0!==n.type?this.visit(n):Array.isArray(n)&&n.forEach((e=>{this.visit(e)}),this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e)}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}const nt=/\r?\n/gm,rt=new et;const it=new class extends tt{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const t=String.fromCharCode(e.value);if(this.multiline||"\n"!==t||(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const e=at(t);this.endRegexpStack.push(e),this.isStarting&&(this.startRegexp+=e)}}visitSet(e){if(!this.multiline){const t=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(t);this.multiline=Boolean("\n".match(n))}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const t=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(t),this.isStarting&&(this.startRegexp+=t)}}visitChildren(e){if("Group"===e.type){if(e.quantifier)return}super.visitChildren(e)}};function st(e){try{return"string"==typeof e&&(e=new RegExp(e)),e=e.toString(),it.reset(e),it.visit(rt.pattern(e)),it.multiline}catch(t){return!1}}function ot(e){return("string"==typeof e?new RegExp(e):e).test(" ")}function at(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ct(e,t){const n=function(e){"string"==typeof e&&(e=new RegExp(e));const t=e,n=e.source;let r=0;function i(){let e,s="";function o(e){s+=n.substr(r,e),r+=e}function a(e){s+="(?:"+n.substr(r,e)+"|$)",r+=e}for(;r",r)-r+1);break;default:a(2)}break;case"[":e=/\[(?:\\.|.)*?\]/g,e.lastIndex=r,e=e.exec(n)||[],a(e[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":e=/\{\d+,?\d*\}/g,e.lastIndex=r,e=e.exec(n),e?o(e[0].length):a(1);break;case"(":if("?"===n[r+1])switch(n[r+2]){case":":s+="(?:",r+=3,s+=i()+"|$)";break;case"=":s+="(?=",r+=3,s+=i()+")";break;case"!":e=r,r+=3,i(),s+=n.substr(e,r-e);break;case"<":switch(n[r+3]){case"=":case"!":e=r,r+=4,i(),s+=n.substr(e,r-e);break;default:o(n.indexOf(">",r)-r+1),s+=i()+"|$)"}}else o(1),s+=i()+"|$)";break;case")":return++r,s;default:a(1)}return s}return new RegExp(i(),e.flags)}(e),r=t.match(n);return!!r&&r[0].length>0}function lt(e,t){const n=new Set,r=function(e){return e.rules.find((e=>X(e)&&e.entry))}(e);if(!r)return new Set(e.rules);const i=[r].concat(function(e){return e.rules.filter((e=>te(e)&&e.hidden))}(e));for(const o of i)ut(o,n,t);const s=new Set;for(const o of e.rules)(n.has(o.name)||te(o)&&o.hidden)&&s.add(o);return s}function ut(e,t,n){t.add(e.name),De(e).forEach((e=>{if(Ee(e)||n&&Se(e)){const r=e.rule.ref;r&&!t.has(r.name)&&ut(r,t,n)}}))}function dt(e,t,n){if(!e||!t)return;const r=ht(e,t,e.astNode,!0);return 0!==r.length?r[n=void 0!==n?Math.max(0,Math.min(n,r.length-1)):0]:void 0}function ht(e,t,n,r){if(!r){const n=_e(e.grammarSource,ue);if(n&&n.feature===t)return[e]}return a(e)&&e.astNode===n?e.content.flatMap((e=>ht(e,t,n,!1))):[]}function ft(e,t,n){if(e.astNode!==n)return[];if(Ae(e.grammarSource)&&e.grammarSource.value===t)return[e];const r=T(e).iterator();let i;const s=[];do{if(i=r.next(),!i.done){const e=i.value;e.astNode===n?Ae(e.grammarSource)&&e.grammarSource.value===t&&s.push(e):r.prune()}}while(!i.done);return s}function pt(e){let t=e;return K(t)&&(oe(t.$container)?t=t.$container.$container:X(t.$container)?t=t.$container:N(t.$container)),mt(e,t,new Map)}function mt(e,t,n){var r,i;function s(t,r){let i;return _e(t,ue)||(i=mt(r,r,n)),n.set(e,i),i}if(n.has(e))return n.get(e);n.set(e,void 0);for(const o of De(t)){if(ue(o)&&"name"===o.feature.toLowerCase())return n.set(e,o),o;if(Ee(o)&&X(o.rule.ref))return s(o,o.rule.ref);if(i=o,Oe.isInstance(i,J)&&(null===(r=o.typeRef)||void 0===r?void 0:r.ref))return s(o,o.typeRef.ref)}}function gt(e){return yt(e,new Set)}function yt(e,t){if(t.has(e))return!0;t.add(e);for(const n of De(e))if(Ee(n)){if(!n.rule.ref)return!1;if(X(n.rule.ref)&&!yt(n.rule.ref,t))return!1}else{if(ue(n))return!1;if(oe(n))return!1}return Boolean(e.definition)}function At(e){if(e.inferredType)return e.inferredType.name;if(e.dataType)return e.dataType;if(e.returnType){const t=e.returnType.ref;if(t){if(X(t))return t.name;if(j(t)||re(t))return t.name}}}function Tt(e){var t,n;if(X(e))return gt(e)?e.name:null!==(t=At(e))&&void 0!==t?t:e.name;if(j(e)||re(e)||(n=e,Oe.isInstance(n,Q)))return e.name;if(oe(e)){const t=function(e){var t;if(e.inferredType)return e.inferredType.name;if(null===(t=e.type)||void 0===t?void 0:t.ref)return Tt(e.type.ref);return}(e);if(t)return t}else if(K(e))return e.name;throw new Error("Cannot get name of Unknown Type")}function vt(e){const t={s:!1,i:!1,u:!1},n=Et(e.definition,t),r=Object.entries(t).filter((([,e])=>e)).map((([e])=>e)).join("");return new RegExp(n,r)}const Rt=/[\s\S]/.source;function Et(e,t){if(s=e,Oe.isInstance(s,ke))return xt((i=e).elements.map((e=>Et(e))).join("|"),{cardinality:i.cardinality,lookahead:i.lookahead});if(function(e){return Oe.isInstance(e,xe)}(e))return xt((r=e).elements.map((e=>Et(e))).join(""),{cardinality:r.cardinality,lookahead:r.lookahead});if(function(e){return Oe.isInstance(e,de)}(e))return function(e){if(e.right)return xt(`[${kt(e.left)}-${kt(e.right)}]`,{cardinality:e.cardinality,lookahead:e.lookahead,wrap:!1});return xt(kt(e.left),{cardinality:e.cardinality,lookahead:e.lookahead,wrap:!1})}(e);if(Se(e)){const t=e.rule.ref;if(!t)throw new Error("Missing rule reference.");return xt(Et(t.definition),{cardinality:e.cardinality,lookahead:e.lookahead})}if(function(e){return Oe.isInstance(e,Te)}(e))return function(e){return xt(`(?!${Et(e.terminal)})${Rt}*?`,{cardinality:e.cardinality,lookahead:e.lookahead})}(e);if(function(e){return Oe.isInstance(e,$e)}(e))return xt(`${Rt}*?${Et((n=e).terminal)}`,{cardinality:n.cardinality,lookahead:n.lookahead});if(function(e){return Oe.isInstance(e,ve)}(e)){const n=e.regex.lastIndexOf("/"),r=e.regex.substring(1,n),i=e.regex.substring(n+1);return t&&(t.i=i.includes("i"),t.s=i.includes("s"),t.u=i.includes("u")),xt(r,{cardinality:e.cardinality,lookahead:e.lookahead,wrap:!1})}if(function(e){return Oe.isInstance(e,we)}(e))return xt(Rt,{cardinality:e.cardinality,lookahead:e.lookahead});throw new Error(`Invalid terminal element: ${null==e?void 0:e.$type}`);var n,r,i,s}function kt(e){return at(e.value)}function xt(e,t){var n;return(!1!==t.wrap||t.lookahead)&&(e=`(${null!==(n=t.lookahead)&&void 0!==n?n:""}${e})`),t.cardinality?`${e}${t.cardinality}`:e}var It=n(3129),St=n(6064),Nt=n(570),Ct=n(2185),$t=n(2540),wt=n(4350);function Lt(e){function t(){}t.prototype=e;const n=new t;function r(){return typeof n.bar}return r(),r(),e}const Ot=function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(i);++r{t.accept(e)}))}}class sn extends rn{constructor(e){super([]),this.idx=1,jt(this,Yt(e,(e=>void 0!==e)))}set definition(e){}get definition(){return void 0!==this.referencedRule?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class on extends rn{constructor(e){super(e.definition),this.orgText="",jt(this,Yt(e,(e=>void 0!==e)))}}class an extends rn{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,jt(this,Yt(e,(e=>void 0!==e)))}}class cn extends rn{constructor(e){super(e.definition),this.idx=1,jt(this,Yt(e,(e=>void 0!==e)))}}class ln extends rn{constructor(e){super(e.definition),this.idx=1,jt(this,Yt(e,(e=>void 0!==e)))}}class un extends rn{constructor(e){super(e.definition),this.idx=1,jt(this,Yt(e,(e=>void 0!==e)))}}class dn extends rn{constructor(e){super(e.definition),this.idx=1,jt(this,Yt(e,(e=>void 0!==e)))}}class hn extends rn{constructor(e){super(e.definition),this.idx=1,jt(this,Yt(e,(e=>void 0!==e)))}}class fn extends rn{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,jt(this,Yt(e,(e=>void 0!==e)))}}class pn{constructor(e){this.idx=1,jt(this,Yt(e,(e=>void 0!==e)))}accept(e){e.visit(this)}}function mn(e){function t(e){return(0,Ct.A)(e,mn)}if(e instanceof sn){const t={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return(0,Pt.A)(e.label)&&(t.label=e.label),t}if(e instanceof an)return{type:"Alternative",definition:t(e.definition)};if(e instanceof cn)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof ln)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof un)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:mn(new pn({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof hn)return{type:"RepetitionWithSeparator",idx:e.idx,separator:mn(new pn({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof dn)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof fn)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof pn){const t={type:"Terminal",name:e.terminalType.name,label:nn(e.terminalType),idx:e.idx};(0,Pt.A)(e.label)&&(t.terminalLabel=e.label);const n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=tn(n)?n.source:n),t}if(e instanceof on)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}class gn{visit(e){const t=e;switch(t.constructor){case sn:return this.visitNonTerminal(t);case an:return this.visitAlternative(t);case cn:return this.visitOption(t);case ln:return this.visitRepetitionMandatory(t);case un:return this.visitRepetitionMandatoryWithSeparator(t);case hn:return this.visitRepetitionWithSeparator(t);case dn:return this.visitRepetition(t);case fn:return this.visitAlternation(t);case pn:return this.visitTerminal(t);case on:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}var yn=n(5601),An=n(4753);const Tn=function(e,t){var n;return(0,An.A)(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n};var vn=n(3145),Rn=n(6599);const En=function(e,t,n){var r=(0,vn.A)(e)?yn.A:Tn;return n&&(0,Rn.A)(e,t,n)&&(t=void 0),r(e,(0,Ht.A)(t,3))};var kn=n(7617),xn=Math.max;const In=function(e,t,n,r){e=(0,Ft.A)(e)?e:(0,St.A)(e),n=n&&!r?(0,bt.A)(n):0;var i=e.length;return n<0&&(n=xn(i+n,0)),(0,Pt.A)(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&(0,kn.A)(e,t,n)>-1};const Sn=function(e,t){for(var n=-1,r=null==e?0:e.length;++n$n(e,t))):!(e instanceof sn&&In(t,e))&&(e instanceof rn&&(e instanceof sn&&t.push(e),Cn(e.definition,(e=>$n(e,t))))))}function wn(e){if(e instanceof sn)return"SUBRULE";if(e instanceof cn)return"OPTION";if(e instanceof fn)return"OR";if(e instanceof ln)return"AT_LEAST_ONE";if(e instanceof un)return"AT_LEAST_ONE_SEP";if(e instanceof hn)return"MANY_SEP";if(e instanceof dn)return"MANY";if(e instanceof pn)return"CONSUME";throw Error("non exhaustive match")}class Ln{walk(e,t=[]){(0,It.A)(e.definition,((n,r)=>{const i=_t(e.definition,r+1);if(n instanceof sn)this.walkProdRef(n,i,t);else if(n instanceof pn)this.walkTerminal(n,i,t);else if(n instanceof an)this.walkFlat(n,i,t);else if(n instanceof cn)this.walkOption(n,i,t);else if(n instanceof ln)this.walkAtLeastOne(n,i,t);else if(n instanceof un)this.walkAtLeastOneSep(n,i,t);else if(n instanceof hn)this.walkManySep(n,i,t);else if(n instanceof dn)this.walkMany(n,i,t);else{if(!(n instanceof fn))throw Error("non exhaustive match");this.walkOr(n,i,t)}}))}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){const r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){const r=[new cn({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){const r=On(e,t,n);this.walk(e,r)}walkMany(e,t,n){const r=[new cn({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){const r=On(e,t,n);this.walk(e,r)}walkOr(e,t,n){const r=t.concat(n);(0,It.A)(e.definition,(e=>{const t=new an({definition:[e]});this.walk(t,r)}))}}function On(e,t,n){return[new cn({definition:[new pn({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}var bn=n(171);const _n=function(e){return e&&e.length?(0,bn.A)(e):[]};var Pn=n(129);function Mn(e){if(e instanceof sn)return Mn(e.referencedRule);if(e instanceof pn)return[e.terminalType];if(function(e){return e instanceof an||e instanceof cn||e instanceof dn||e instanceof ln||e instanceof un||e instanceof hn||e instanceof pn||e instanceof on}(e))return function(e){let t=[];const n=e.definition;let r,i=0,s=n.length>i,o=!0;for(;s&&o;)r=n[i],o=$n(r),t=t.concat(Mn(r)),i+=1,s=n.length>i;return _n(t)}(e);if(function(e){return e instanceof fn}(e))return function(e){const t=(0,Ct.A)(e.definition,(e=>Mn(e)));return _n((0,Pn.A)(t))}(e);throw Error("non exhaustive match")}const Dn="_~IN~_";class Un extends Ln{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const r=(i=e.referencedRule,s=e.idx,i.name+s+Dn+this.topProd.name);var i,s;const o=t.concat(n),a=Mn(new an({definition:o}));this.follows[r]=a}}var Fn=n(707),Gn=n(5237),Kn=n(1031),Bn=n(2837);const jn=function(e){if("function"!=typeof e)throw new TypeError("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}};const Vn=function(e,t){return((0,vn.A)(e)?Kn.A:Bn.A)(e,jn((0,Ht.A)(t,3)))};var Hn=n(1863),Wn=Math.max;const zn=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:(0,bt.A)(n);return i<0&&(i=Wn(r+i,0)),(0,kn.A)(e,t,i)};var Yn=n(6800),Xn=n(9949),qn=n(6691),Qn=n(9532),Jn=n(3924),Zn=n(9584);const er=function(e,t,n,r){var i=-1,s=Qn.A,o=!0,a=e.length,c=[],l=t.length;if(!a)return c;n&&(t=(0,Vt.A)(t,(0,Jt.A)(n))),r?(s=Jn.A,o=!1):t.length>=200&&(s=Zn.A,o=!1,t=new qn.A(t));e:for(;++i\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),cr(`${pr}\n\tFailed parsing: < ${e.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function gr(e,t,n){switch(e.type){case"Disjunction":for(let i=0;i{if("number"==typeof e)yr(e,t,n);else{const r=e;if(!0===n)for(let e=r.from;e<=r.to;e++)yr(e,t,n);else{for(let e=r.from;e<=r.to&&e=Fr){const e=r.from>=Fr?r.from:Fr,n=r.to,i=Kr(e),s=Kr(n);for(let r=i;r<=s;r++)t[r]=r}}}}));break;case"Group":gr(s.value,t,n);break;default:throw Error("Non Exhaustive Match")}const o=void 0!==s.quantifier&&0===s.quantifier.atLeast;if("Group"===s.type&&!1===Tr(s)||"Group"!==s.type&&!1===o)break}break;default:throw Error("non exhaustive match!")}return(0,St.A)(t)}function yr(e,t,n){const r=Kr(e);t[r]=r,!0===n&&function(e,t){const n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){const e=Kr(r.charCodeAt(0));t[e]=e}else{const e=n.toLowerCase();if(e!==n){const n=Kr(e.charCodeAt(0));t[n]=n}}}(e,t)}function Ar(e,t){return(0,ar.A)(e.value,(e=>{if("number"==typeof e)return In(t,e);{const n=e;return void 0!==(0,ar.A)(t,(e=>n.from<=e&&e<=n.to))}}))}function Tr(e){const t=e.quantifier;return!(!t||0!==t.atLeast)||!!e.value&&((0,vn.A)(e.value)?Cn(e.value,Tr):Tr(e.value))}class vr extends tt{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(!0!==this.found){switch(e.type){case"Lookahead":return void this.visitLookahead(e);case"NegativeLookahead":return void this.visitNegativeLookahead(e)}super.visitChildren(e)}}visitCharacter(e){In(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?void 0===Ar(e,this.targetCharCodes)&&(this.found=!0):void 0!==Ar(e,this.targetCharCodes)&&(this.found=!0)}}function Rr(e,t){if(t instanceof RegExp){const n=hr(t),r=new vr(e);return r.visit(n),r.found}return void 0!==(0,ar.A)(t,(t=>In(e,t.charCodeAt(0))))}const Er="PATTERN",kr="defaultMode",xr="modes";let Ir="boolean"==typeof new RegExp("(?:)").sticky;function Sr(e,t){const n=(t=(0,Gn.A)(t,{useSticky:Ir,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:(e,t)=>t()})).tracer;let r;n("initCharCodeToOptimizedIndexMap",(()=>{!function(){if((0,Nt.A)(Gr)){Gr=new Array(65536);for(let e=0;e<65536;e++)Gr[e]=e>255?255+~~(e/255):e}}()})),n("Reject Lexer.NA",(()=>{r=Vn(e,(e=>e[Er]===ii.NA))}));let i,s,o,a,c,l,u,d,h,f,p,m=!1;n("Transform Patterns",(()=>{m=!1,i=(0,Ct.A)(r,(e=>{const n=e[Er];if(tn(n)){const e=n.source;return 1!==e.length||"^"===e||"$"===e||"."===e||n.ignoreCase?2!==e.length||"\\"!==e[0]||In(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],e[1])?t.useSticky?Lr(n):wr(n):e[1]:e}if((0,Hn.A)(n))return m=!0,{exec:n};if("object"==typeof n)return m=!0,n;if("string"==typeof n){if(1===n.length)return n;{const e=n.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),r=new RegExp(e);return t.useSticky?Lr(r):wr(r)}}throw Error("non exhaustive match")}))})),n("misc mapping",(()=>{s=(0,Ct.A)(r,(e=>e.tokenTypeIdx)),o=(0,Ct.A)(r,(e=>{const t=e.GROUP;if(t!==ii.SKIPPED){if((0,Pt.A)(t))return t;if((0,Fn.A)(t))return!1;throw Error("non exhaustive match")}})),a=(0,Ct.A)(r,(e=>{const t=e.LONGER_ALT;if(t){return(0,vn.A)(t)?(0,Ct.A)(t,(e=>zn(r,e))):[zn(r,t)]}})),c=(0,Ct.A)(r,(e=>e.PUSH_MODE)),l=(0,Ct.A)(r,(e=>(0,$t.A)(e,"POP_MODE")))})),n("Line Terminator Handling",(()=>{const e=Dr(t.lineTerminatorCharacters);u=(0,Ct.A)(r,(e=>!1)),"onlyOffset"!==t.positionTracking&&(u=(0,Ct.A)(r,(t=>(0,$t.A)(t,"LINE_BREAKS")?!!t.LINE_BREAKS:!1===Mr(t,e)&&Rr(e,t.PATTERN))))})),n("Misc Mapping #2",(()=>{d=(0,Ct.A)(r,br),h=(0,Ct.A)(i,_r),f=(0,Yn.A)(r,((e,t)=>{const n=t.GROUP;return(0,Pt.A)(n)&&n!==ii.SKIPPED&&(e[n]=[]),e}),{}),p=(0,Ct.A)(i,((e,t)=>({pattern:i[t],longerAlt:a[t],canLineTerminator:u[t],isCustom:d[t],short:h[t],group:o[t],push:c[t],pop:l[t],tokenTypeIdx:s[t],tokenType:r[t]})))}));let g=!0,y=[];return t.safeMode||n("First Char Optimization",(()=>{y=(0,Yn.A)(r,((e,n,r)=>{if("string"==typeof n.PATTERN){const t=Kr(n.PATTERN.charCodeAt(0));Ur(e,t,p[r])}else if((0,vn.A)(n.START_CHARS_HINT)){let t;(0,It.A)(n.START_CHARS_HINT,(n=>{const i=Kr("string"==typeof n?n.charCodeAt(0):n);t!==i&&(t=i,Ur(e,i,p[r]))}))}else if(tn(n.PATTERN))if(n.PATTERN.unicode)g=!1,t.ensureOptimizations&&cr(`${pr}\tUnable to analyze < ${n.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const i=mr(n.PATTERN,t.ensureOptimizations);(0,Nt.A)(i)&&(g=!1),(0,It.A)(i,(t=>{Ur(e,t,p[r])}))}else t.ensureOptimizations&&cr(`${pr}\tTokenType: <${n.name}> is using a custom token pattern without providing parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),g=!1;return e}),[])})),{emptyGroups:f,patternIdxToConfig:p,charCodeToPatternIdxToConfig:y,hasCustom:m,canBeOptimized:g}}function Nr(e,t){let n=[];const r=function(e){const t=(0,Xn.A)(e,(e=>!(0,$t.A)(e,Er))),n=(0,Ct.A)(t,(e=>({message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:ni.MISSING_PATTERN,tokenTypes:[e]}))),r=ir(e,t);return{errors:n,valid:r}}(e);n=n.concat(r.errors);const i=function(e){const t=(0,Xn.A)(e,(e=>{const t=e[Er];return!(tn(t)||(0,Hn.A)(t)||(0,$t.A)(t,"exec")||(0,Pt.A)(t))})),n=(0,Ct.A)(t,(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:ni.INVALID_PATTERN,tokenTypes:[e]}))),r=ir(e,t);return{errors:n,valid:r}}(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(function(e){let t=[];const n=(0,Xn.A)(e,(e=>tn(e[Er])));return t=t.concat(function(e){class t extends tt{constructor(){super(...arguments),this.found=!1}visitEndAnchor(e){this.found=!0}}const n=(0,Xn.A)(e,(e=>{const n=e.PATTERN;try{const e=hr(n),r=new t;return r.visit(e),r.found}catch(r){return Cr.test(n.source)}})),r=(0,Ct.A)(n,(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:ni.EOI_ANCHOR_FOUND,tokenTypes:[e]})));return r}(n)),t=t.concat(function(e){class t extends tt{constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}const n=(0,Xn.A)(e,(e=>{const n=e.PATTERN;try{const e=hr(n),r=new t;return r.visit(e),r.found}catch(r){return $r.test(n.source)}})),r=(0,Ct.A)(n,(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:ni.SOI_ANCHOR_FOUND,tokenTypes:[e]})));return r}(n)),t=t.concat(function(e){const t=(0,Xn.A)(e,(e=>{const t=e[Er];return t instanceof RegExp&&(t.multiline||t.global)})),n=(0,Ct.A)(t,(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:ni.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]})));return n}(n)),t=t.concat(function(e){const t=[];let n=(0,Ct.A)(e,(n=>(0,Yn.A)(e,((e,r)=>(n.PATTERN.source!==r.PATTERN.source||In(t,r)||r.PATTERN===ii.NA||(t.push(r),e.push(r)),e)),[])));n=sr(n);const r=(0,Xn.A)(n,(e=>e.length>1)),i=(0,Ct.A)(r,(e=>{const t=(0,Ct.A)(e,(e=>e.name));return{message:`The same RegExp pattern ->${or(e).PATTERN}<-has been used in all of the following Token Types: ${t.join(", ")} <-`,type:ni.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}}));return i}(n)),t=t.concat(function(e){const t=(0,Xn.A)(e,(e=>e.PATTERN.test(""))),n=(0,Ct.A)(t,(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:ni.EMPTY_MATCH_PATTERN,tokenTypes:[e]})));return n}(n)),t}(s)),n=n.concat(function(e){const t=(0,Xn.A)(e,(e=>{if(!(0,$t.A)(e,"GROUP"))return!1;const t=e.GROUP;return t!==ii.SKIPPED&&t!==ii.NA&&!(0,Pt.A)(t)})),n=(0,Ct.A)(t,(e=>({message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:ni.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]})));return n}(s)),n=n.concat(function(e,t){const n=(0,Xn.A)(e,(e=>void 0!==e.PUSH_MODE&&!In(t,e.PUSH_MODE))),r=(0,Ct.A)(n,(e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:ni.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]})));return r}(s,t)),n=n.concat(function(e){const t=[],n=(0,Yn.A)(e,((e,t,n)=>{const r=t.PATTERN;return r===ii.NA||((0,Pt.A)(r)?e.push({str:r,idx:n,tokenType:t}):tn(r)&&function(e){const t=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return void 0===(0,ar.A)(t,(t=>-1!==e.source.indexOf(t)))}(r)&&e.push({str:r.source,idx:n,tokenType:t})),e}),[]);return(0,It.A)(e,((e,r)=>{(0,It.A)(n,(({str:n,idx:i,tokenType:s})=>{if(r${s.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:n,type:ni.UNREACHABLE_PATTERN,tokenTypes:[e,s]})}}))})),t}(s)),n}const Cr=/[^\\][$]/;const $r=/[^\\[][\^]|^\^/;function wr(e){const t=e.ignoreCase?"i":"";return new RegExp(`^(?:${e.source})`,t)}function Lr(e){const t=e.ignoreCase?"iy":"y";return new RegExp(`${e.source}`,t)}function Or(e,t,n){const r=[];let i=!1;const s=sr((0,Pn.A)((0,St.A)(e.modes))),o=Vn(s,(e=>e[Er]===ii.NA)),a=Dr(n);return t&&(0,It.A)(o,(e=>{const t=Mr(e,a);if(!1!==t){const n=function(e,t){if(t.issue===ni.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <${e.name}> Token Type\n\t Root cause: ${t.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===ni.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option.\n\tThe problem is in the <${e.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}(e,t),i={message:n,type:t.issue,tokenType:e};r.push(i)}else(0,$t.A)(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(i=!0):Rr(a,e.PATTERN)&&(i=!0)})),t&&!i&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:ni.NO_LINE_BREAKS_FLAGS}),r}function br(e){const t=e.PATTERN;if(tn(t))return!1;if((0,Hn.A)(t))return!0;if((0,$t.A)(t,"exec"))return!0;if((0,Pt.A)(t))return!1;throw Error("non exhaustive match")}function _r(e){return!(!(0,Pt.A)(e)||1!==e.length)&&e.charCodeAt(0)}const Pr={test:function(e){const t=e.length;for(let n=this.lastIndex;n(0,Pt.A)(e)?e.charCodeAt(0):e))}function Ur(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}const Fr=256;let Gr=[];function Kr(e){return ee.CATEGORIES))));const e=ir(n,t);t=t.concat(e),(0,Nt.A)(e)?r=!1:n=e}return t}(e);!function(e){(0,It.A)(e,(e=>{var t;Jr(e)||(Xr[Yr]=e,e.tokenTypeIdx=Yr++),Zr(e)&&!(0,vn.A)(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Zr(e)||(e.CATEGORIES=[]),t=e,(0,$t.A)(t,"categoryMatches")||(e.categoryMatches=[]),function(e){return(0,$t.A)(e,"categoryMatchesMap")}(e)||(e.categoryMatchesMap={})}))}(t),function(e){(0,It.A)(e,(e=>{Qr([],e)}))}(t),function(e){(0,It.A)(e,(e=>{e.categoryMatches=[],(0,It.A)(e.categoryMatchesMap,((t,n)=>{e.categoryMatches.push(Xr[n].tokenTypeIdx)}))}))}(t),(0,It.A)(t,(e=>{e.isParent=e.categoryMatches.length>0}))}function Qr(e,t){(0,It.A)(e,(e=>{t.categoryMatchesMap[e.tokenTypeIdx]=!0})),(0,It.A)(t.CATEGORIES,(n=>{const r=e.concat(t);In(r,n)||Qr(r,n)}))}function Jr(e){return(0,$t.A)(e,"tokenTypeIdx")}function Zr(e){return(0,$t.A)(e,"CATEGORIES")}function ei(e){return(0,$t.A)(e,"tokenTypeIdx")}const ti={buildUnableToPopLexerModeMessage:e=>`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(e,t,n,r,i)=>`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`};var ni;!function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"}(ni||(ni={}));const ri={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:ti,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(ri);class ii{constructor(e,t=ri){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(e,t)=>{if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=Hr(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()},"boolean"==typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=jt({},ri,t);const n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof n&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",(()=>{let n,r=!0;this.TRACE_INIT("Lexer Config handling",(()=>{if(this.config.lineTerminatorsPattern===ri.lineTerminatorsPattern)this.config.lineTerminatorsPattern=Pr;else if(this.config.lineTerminatorCharacters===ri.lineTerminatorCharacters)throw Error("Error: Missing property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),(0,vn.A)(e)?n={modes:{defaultMode:(0,wt.A)(e)},defaultMode:kr}:(r=!1,n=(0,wt.A)(e))})),!1===this.config.skipValidations&&(this.TRACE_INIT("performRuntimeChecks",(()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e){const t=[];return(0,$t.A)(e,kr)||t.push({message:"A MultiMode Lexer cannot be initialized without a <"+kr+"> property in its definition\n",type:ni.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),(0,$t.A)(e,xr)||t.push({message:"A MultiMode Lexer cannot be initialized without a property in its definition\n",type:ni.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),(0,$t.A)(e,xr)&&(0,$t.A)(e,kr)&&!(0,$t.A)(e.modes,e.defaultMode)&&t.push({message:`A MultiMode Lexer cannot be initialized with a ${kr}: <${e.defaultMode}>which does not exist\n`,type:ni.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),(0,$t.A)(e,xr)&&(0,It.A)(e.modes,((e,n)=>{(0,It.A)(e,((r,i)=>{if((0,Fn.A)(r))t.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${n}> at index: <${i}>\n`,type:ni.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if((0,$t.A)(r,"LONGER_ALT")){const i=(0,vn.A)(r.LONGER_ALT)?r.LONGER_ALT:[r.LONGER_ALT];(0,It.A)(i,(i=>{(0,Fn.A)(i)||In(e,i)||t.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${r.name}> outside of mode <${n}>\n`,type:ni.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})}))}}))})),t}(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),this.TRACE_INIT("performWarningRuntimeChecks",(()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(Or(n,this.trackStartLines,this.config.lineTerminatorCharacters))}))),n.modes=n.modes?n.modes:{},(0,It.A)(n.modes,((e,t)=>{n.modes[t]=Vn(e,(e=>(0,Fn.A)(e)))}));const i=(0,Kt.A)(n.modes);if((0,It.A)(n.modes,((e,n)=>{this.TRACE_INIT(`Mode: <${n}> processing`,(()=>{if(this.modes.push(n),!1===this.config.skipValidations&&this.TRACE_INIT("validatePatterns",(()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Nr(e,i))})),(0,Nt.A)(this.lexerDefinitionErrors)){let r;qr(e),this.TRACE_INIT("analyzeTokenTypes",(()=>{r=Sr(e,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})})),this.patternIdxToConfig[n]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[n]=r.charCodeToPatternIdxToConfig,this.emptyGroups=jt({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[n]=r.canBeOptimized}}))})),this.defaultMode=n.defaultMode,!(0,Nt.A)(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const e=(0,Ct.A)(this.lexerDefinitionErrors,(e=>e.message)).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+e)}(0,It.A)(this.lexerDefinitionWarning,(e=>{lr(e.message)})),this.TRACE_INIT("Choosing sub-methods implementations",(()=>{if(Ir?(this.chopInput=Br.A,this.match=this.matchWithTest):(this.updateLastIndex=jr.A,this.match=this.matchWithExec),r&&(this.handleModes=jr.A),!1===this.trackStartLines&&(this.computeNewColumn=Br.A),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=jr.A),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else{if(!/onlyOffset/i.test(this.config.positionTracking))throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.createTokenInstance=this.createOffsetOnlyToken}this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)})),this.TRACE_INIT("Failed Optimization Warnings",(()=>{const e=(0,Yn.A)(this.canModeBeOptimized,((e,t,n)=>(!1===t&&e.push(n),e)),[]);if(t.ensureOptimizations&&!(0,Nt.A)(e))throw Error(`Lexer Modes: < ${e.join(", ")} > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.`)})),this.TRACE_INIT("clearRegExpParserCache",(()=>{ur={}})),this.TRACE_INIT("toFastProperties",(()=>{Lt(this)}))}))}tokenize(e,t=this.defaultMode){if(!(0,Nt.A)(this.lexerDefinitionErrors)){const e=(0,Ct.A)(this.lexerDefinitionErrors,(e=>e.message)).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+e)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let n,r,i,s,o,a,c,l,u,d,h,f,p,m,g;const y=e,A=y.length;let T=0,v=0;const R=this.hasCustom?0:Math.floor(e.length/10),E=new Array(R),k=[];let x=this.trackStartLines?1:void 0,I=this.trackStartLines?1:void 0;const S=function(e){const t={},n=(0,Kt.A)(e);return(0,It.A)(n,(n=>{const r=e[n];if(!(0,vn.A)(r))throw Error("non exhaustive match");t[n]=[]})),t}(this.emptyGroups),N=this.trackStartLines,C=this.config.lineTerminatorsPattern;let $=0,w=[],L=[];const O=[],b=[];let _;function P(){return w}function M(e){const t=Kr(e),n=L[t];return void 0===n?b:n}Object.freeze(b);const D=e=>{if(1===O.length&&void 0===e.tokenType.PUSH_MODE){const t=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);k.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{O.pop();const e=(0,Vr.A)(O);w=this.patternIdxToConfig[e],L=this.charCodeToPatternIdxToConfig[e],$=w.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;_=L&&t?M:P}};function U(e){O.push(e),L=this.charCodeToPatternIdxToConfig[e],w=this.patternIdxToConfig[e],$=w.length,$=w.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;_=L&&t?M:P}let F;U.call(this,t);const G=this.config.recoveryEnabled;for(;Ta.length){a=s,c=l,F=t;break}}}break}}if(null!==a){if(u=a.length,d=F.group,void 0!==d&&(h=F.tokenTypeIdx,f=this.createTokenInstance(a,T,h,F.tokenType,x,I,u),this.handlePayload(f,c),!1===d?v=this.addToken(E,v,f):S[d].push(f)),e=this.chopInput(e,u),T+=u,I=this.computeNewColumn(I,u),!0===N&&!0===F.canLineTerminator){let e,t,n=0;C.lastIndex=0;do{e=C.test(a),!0===e&&(t=C.lastIndex-1,n++)}while(!0===e);0!==n&&(x+=n,I=u-t,this.updateTokenEndLineColumnLocation(f,d,t,n,x,I,u))}this.handleModes(F,D,U,f)}else{const t=T,n=x,i=I;let s=!1===G;for(;!1===s&&T`Expecting ${oi(e)?`--\x3e ${si(e)} <--`:`token of type --\x3e ${e.name} <--`} but found --\x3e '${t.image}' <--`,buildNotAllInputParsedMessage:({firstRedundant:e,ruleName:t})=>"Redundant input, expecting EOF but found: "+e.image,buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:n,customUserDescription:r,ruleName:i}){const s="Expecting: ",o="\nbut found: '"+or(t).image+"'";if(r)return s+r+o;{const t=(0,Yn.A)(e,((e,t)=>e.concat(t)),[]),n=(0,Ct.A)(t,(e=>`[${(0,Ct.A)(e,(e=>si(e))).join(", ")}]`));return s+`one of these possible Token sequences:\n${(0,Ct.A)(n,((e,t)=>` ${t+1}. ${e}`)).join("\n")}`+o}},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:n,ruleName:r}){const i="Expecting: ",s="\nbut found: '"+or(t).image+"'";if(n)return i+n+s;return i+`expecting at least one iteration which starts with one of these possible Token sequences::\n <${(0,Ct.A)(e,(e=>`[${(0,Ct.A)(e,(e=>si(e))).join(",")}]`)).join(" ,")}>`+s}};Object.freeze(vi);const Ri={buildRuleNotFoundError:(e,t)=>"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"},Ei={buildDuplicateFoundError(e,t){const n=e.name,r=or(t),i=r.idx,s=wn(r),o=(a=r)instanceof pn?a.terminalType.name:a instanceof sn?a.nonTerminalName:"";var a;let c=`->${s}${i>0?i:""}<- ${o?`with argument: ->${o}<-`:""}\n appears more than once (${t.length} times) in the top level rule: ->${n}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,"\n"),c},buildNamespaceConflictError:e=>`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`,buildAlternationPrefixAmbiguityError(e){const t=(0,Ct.A)(e.prefixPath,(e=>si(e))).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(e){const t=(0,Ct.A)(e.prefixPath,(e=>si(e))).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;let r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\n`;return r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r},buildEmptyRepetitionError(e){let t=wn(e.repetition);0!==e.repetition.idx&&(t+=e.repetition.idx);return`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError:e=>"deprecated",buildEmptyAlternationError:e=>`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in inside <${e.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`,buildTooManyAlternativesError:e=>`An Alternation cannot have more than 256 alternatives:\n inside <${e.topLevelRule.name}> Rule.\n has ${e.alternation.definition.length+1} alternatives.`,buildLeftRecursionError(e){const t=e.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${`${t} --\x3e ${(0,Ct.A)(e.leftRecursionPath,(e=>e.name)).concat([t]).join(" --\x3e ")}`}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError:e=>"deprecated",buildDuplicateRuleNameError(e){let t;t=e.topLevelRule instanceof on?e.topLevelRule.name:e.topLevelRule;return`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};class ki extends gn{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){(0,It.A)((0,St.A)(this.nameToTopRule),(e=>{this.currTopLevel=e,e.accept(this)}))}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:eo.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}const xi=function(e,t){return(0,tr.A)((0,Ct.A)(e,t),1)};var Ii=n(5745);const Si=function(e,t,n,r){for(var i=-1,s=null==e?0:e.length;++i{!1===(0,Nt.A)(e.definition)&&(r=s(e.definition))})),r;if(!(t instanceof pn))throw Error("non exhaustive match");n.push(t.terminalType)}}i++}return r.push({partialPath:n,suffixDef:_t(e,i)}),r}function Gi(e,t,n,r){const i="EXIT_NONE_TERMINAL",s=[i],o="EXIT_ALTERNATIVE";let a=!1;const c=t.length,l=c-r-1,u=[],d=[];for(d.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!(0,Nt.A)(d);){const e=d.pop();if(e===o){a&&(0,Vr.A)(d).idx<=l&&d.pop();continue}const r=e.def,h=e.idx,f=e.ruleStack,p=e.occurrenceStack;if((0,Nt.A)(r))continue;const m=r[0];if(m===i){const e={idx:h,def:_t(r),ruleStack:Li(f),occurrenceStack:Li(p)};d.push(e)}else if(m instanceof pn)if(h=0;t--){const e={idx:h,def:m.definition[t].definition.concat(_t(r)),ruleStack:f,occurrenceStack:p};d.push(e),d.push(o)}else if(m instanceof an)d.push({idx:h,def:m.definition.concat(_t(r)),ruleStack:f,occurrenceStack:p});else{if(!(m instanceof on))throw Error("non exhaustive match");d.push(Ki(m,h,f,p))}}return u}function Ki(e,t,n,r){const i=(0,wt.A)(n);i.push(e.name);const s=(0,wt.A)(r);return s.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:s}}var Bi;function ji(e){if(e instanceof cn||"Option"===e)return Bi.OPTION;if(e instanceof dn||"Repetition"===e)return Bi.REPETITION;if(e instanceof ln||"RepetitionMandatory"===e)return Bi.REPETITION_MANDATORY;if(e instanceof un||"RepetitionMandatoryWithSeparator"===e)return Bi.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof hn||"RepetitionWithSeparator"===e)return Bi.REPETITION_WITH_SEPARATOR;if(e instanceof fn||"Alternation"===e)return Bi.ALTERNATION;throw Error("non exhaustive match")}function Vi(e){const{occurrence:t,rule:n,prodType:r,maxLookahead:i}=e,s=ji(r);return s===Bi.ALTERNATION?Zi(t,n,i):es(t,n,s,i)}function Hi(e,t,n,r){const i=e.length,s=Cn(e,(e=>Cn(e,(e=>1===e.length))));if(t)return function(t){const r=(0,Ct.A)(t,(e=>e.GATE));for(let s=0;s(0,Pn.A)(e))),n=(0,Yn.A)(t,((e,t,n)=>((0,It.A)(t,(t=>{(0,$t.A)(e,t.tokenTypeIdx)||(e[t.tokenTypeIdx]=n),(0,It.A)(t.categoryMatches,(t=>{(0,$t.A)(e,t)||(e[t]=n)}))})),e)),{});return function(){const e=this.LA(1);return n[e.tokenTypeIdx]}}return function(){for(let t=0;t1===e.length)),i=e.length;if(r&&!n){const t=(0,Pn.A)(e);if(1===t.length&&(0,Nt.A)(t[0].categoryMatches)){const e=t[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===e}}{const e=(0,Yn.A)(t,((e,t,n)=>(e[t.tokenTypeIdx]=!0,(0,It.A)(t.categoryMatches,(t=>{e[t]=!0})),e)),[]);return function(){const t=this.LA(1);return!0===e[t.tokenTypeIdx]}}}return function(){e:for(let n=0;nFi([e],1))),r=Xi(n.length),i=(0,Ct.A)(n,(e=>{const t={};return(0,It.A)(e,(e=>{const n=qi(e.partialPath);(0,It.A)(n,(e=>{t[e]=!0}))})),t}));let s=n;for(let o=1;o<=t;o++){const e=s;s=Xi(e.length);for(let n=0;n{const t=qi(e.partialPath);(0,It.A)(t,(e=>{i[n][e]=!0}))}))}}}}return r}function Zi(e,t,n,r){const i=new Yi(e,Bi.ALTERNATION,r);return t.accept(i),Ji(i.result,n)}function es(e,t,n,r){const i=new Yi(e,n);t.accept(i);const s=i.result,o=new zi(t,e,n).startWalking();return Ji([new an({definition:s}),new an({definition:o})],r)}function ts(e,t){e:for(let n=0;nCn(e,(e=>Cn(e,(e=>(0,Nt.A)(e.categoryMatches)))))))}function rs(e,t,n,r){const i=xi(e,(e=>function(e,t){const n=new os;e.accept(n);const r=n.allProductions,i=wi(r,is),s=Yt(i,(e=>e.length>1)),o=(0,Ct.A)((0,St.A)(s),(n=>{const r=or(n),i=t.buildDuplicateFoundError(e,n),s=wn(r),o={message:i,type:eo.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:s,occurrence:r.idx},a=ss(r);return a&&(o.parameter=a),o}));return o}(e,n))),s=function(e,t,n){const r=[],i=(0,Ct.A)(t,(e=>e.name));return(0,It.A)(e,(e=>{const t=e.name;if(In(i,t)){const i=n.buildNamespaceConflictError(e);r.push({message:i,type:eo.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}})),r}(e,t,n),o=xi(e,(e=>function(e,t){const n=new ls;e.accept(n);const r=n.alternations,i=xi(r,(n=>n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:eo.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[]));return i}(e,n))),a=xi(e,(t=>function(e,t,n,r){const i=[],s=(0,Yn.A)(t,((t,n)=>n.name===e.name?t+1:t),0);if(s>1){const t=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:t,type:eo.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}(t,e,r,n)));return i.concat(s,o,a)}function is(e){return`${wn(e)}_#_${e.idx}_#_${ss(e)}`}function ss(e){return e instanceof pn?e.terminalType.name:e instanceof sn?e.nonTerminalName:""}class os extends gn{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function as(e,t,n,r=[]){const i=[],s=cs(t.definition);if((0,Nt.A)(s))return[];{const t=e.name;In(s,e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:eo.LEFT_RECURSION,ruleName:t});const o=ir(s,r.concat([e])),a=xi(o,(t=>{const i=(0,wt.A)(r);return i.push(t),as(e,t,n,i)}));return i.concat(a)}}function cs(e){let t=[];if((0,Nt.A)(e))return t;const n=or(e);if(n instanceof sn)t.push(n.referencedRule);else if(n instanceof an||n instanceof cn||n instanceof ln||n instanceof un||n instanceof hn||n instanceof dn)t=t.concat(cs(n.definition));else if(n instanceof fn)t=(0,Pn.A)((0,Ct.A)(n.definition,(e=>cs(e.definition))));else if(!(n instanceof pn))throw Error("non exhaustive match");const r=$n(n),i=e.length>1;if(r&&i){const n=_t(e);return t.concat(cs(n))}return t}class ls extends gn{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function us(e,t,n){const r=new ls;e.accept(r);let i=r.alternations;i=Vn(i,(e=>!0===e.ignoreAmbiguities));const s=xi(i,(r=>{const i=r.idx,s=r.maxLookahead||t,o=Zi(i,e,s,r),a=function(e,t,n,r){const i=[],s=(0,Yn.A)(e,((n,r,s)=>(!0===t.definition[s].ignoreAmbiguities||(0,It.A)(r,(r=>{const o=[s];(0,It.A)(e,((e,n)=>{s!==n&&ts(e,r)&&!0!==t.definition[n].ignoreAmbiguities&&o.push(n)})),o.length>1&&!ts(i,r)&&(i.push(r),n.push({alts:o,path:r}))})),n)),[]),o=(0,Ct.A)(s,(e=>{const i=(0,Ct.A)(e.alts,(e=>e+1));return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:eo.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:e.alts}}));return o}(o,r,e,n),c=function(e,t,n,r){const i=(0,Yn.A)(e,((e,t,n)=>{const r=(0,Ct.A)(t,(e=>({idx:n,path:e})));return e.concat(r)}),[]),s=sr(xi(i,(e=>{if(!0===t.definition[e.idx].ignoreAmbiguities)return[];const s=e.idx,o=e.path,a=(0,Xn.A)(i,(e=>{return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx{const n=r[t];return e===n||n.categoryMatchesMap[e.tokenTypeIdx]})));var n,r}));return(0,Ct.A)(a,(e=>{const i=[e.idx+1,s+1],o=0===t.idx?"":t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:eo.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:i}}))})));return s}(o,r,e,n);return a.concat(c)}));return s}class ds extends gn{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}function hs(e){const t=(0,Gn.A)(e,{errMsgProvider:Ri}),n={};return(0,It.A)(e.rules,(e=>{n[e.name]=e})),function(e,t){const n=new ki(e,t);return n.resolveRefs(),n.errors}(n,t.errMsgProvider)}const fs="MismatchedTokenException",ps="NoViableAltException",ms="EarlyExitException",gs="NotAllInputParsedException",ys=[fs,ps,ms,gs];function As(e){return In(ys,e.name)}Object.freeze(ys);class Ts extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class vs extends Ts{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=fs}}class Rs extends Ts{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=ps}}class Es extends Ts{constructor(e,t){super(e,t),this.name=gs}}class ks extends Ts{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=ms}}const xs={},Is="InRuleRecoveryException";class Ss extends Error{constructor(e){super(e),this.name=Is}}function Ns(e,t,n,r,i,s,o){const a=this.getKeyForAutomaticLookahead(r,i);let c=this.firstAfterRepMap[a];if(void 0===c){const e=this.getCurrRuleFullName();c=new s(this.getGAstProductions()[e],i).startWalking(),this.firstAfterRepMap[a]=c}let l=c.token,u=c.occurrence;const d=c.isEndOfRule;1===this.RULE_STACK.length&&d&&void 0===l&&(l=yi,u=1),void 0!==l&&void 0!==u&&this.shouldInRepetitionRecoveryBeTried(l,u,o)&&this.tryInRepetitionRecovery(e,t,n,l)}const Cs=1024,$s=1280,ws=1536;function Ls(e,t,n){return n|t|e}class Os{constructor(e){var t;this.maxLookahead=null!==(t=null==e?void 0:e.maxLookahead)&&void 0!==t?t:Js.maxLookahead}validate(e){const t=this.validateNoLeftRecursion(e.rules);if((0,Nt.A)(t)){const n=this.validateEmptyOrAlternatives(e.rules),r=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...n,...r,...i]}return t}validateNoLeftRecursion(e){return xi(e,(e=>as(e,e,Ei)))}validateEmptyOrAlternatives(e){return xi(e,(e=>function(e,t){const n=new ls;e.accept(n);const r=n.alternations;return xi(r,(n=>{const r=Li(n.definition);return xi(r,((r,i)=>{const s=Gi([r],[],Wr,1);return(0,Nt.A)(s)?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:eo.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}]:[]}))}))}(e,Ei)))}validateAmbiguousAlternationAlternatives(e,t){return xi(e,(e=>us(e,t,Ei)))}validateSomeNonEmptyLookaheadPath(e,t){return function(e,t,n){const r=[];return(0,It.A)(e,(e=>{const i=new ds;e.accept(i);const s=i.allProductions;(0,It.A)(s,(i=>{const s=ji(i),o=i.maxLookahead||t,a=es(i.idx,e,s,o)[0];if((0,Nt.A)((0,Pn.A)(a))){const t=n.buildEmptyRepetitionError({topLevelRule:e,repetition:i});r.push({message:t,type:eo.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}}))})),r}(e,t,Ei)}buildLookaheadForAlternation(e){return function(e,t,n,r,i,s){const o=Zi(e,t,n);return s(o,r,ns(o)?zr:Wr,i)}(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Hi)}buildLookaheadForOptional(e){return function(e,t,n,r,i,s){const o=es(e,t,i,n),a=ns(o)?zr:Wr;return s(o[0],a,r)}(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,ji(e.prodType),Wi)}}const bs=new class extends gn{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};function _s(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset!1===(0,Hn.A)(e[t]))),r=(0,Ct.A)(n,(t=>({msg:`Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,type:Fs.MISSING_METHOD,methodName:t})));return sr(r)}(e,t);return n}(this,t);if(!(0,Nt.A)(e)){const t=(0,Ct.A)(e,(e=>e.msg));throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join("\n\n").replace(/\n/g,"\n\t")}`)}}};return(n.prototype=r).constructor=n,n._RULE_NAMES=t,n}var Fs;!function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"}(Fs||(Fs={}));var Gs=n(9084);const Ks={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Ks);const Bs=!0,js=Math.pow(2,8)-1,Vs=gi({name:"RECORDING_PHASE_TOKEN",pattern:ii.NA});qr([Vs]);const Hs=Ai(Vs,"This IToken indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(Hs);const Ws={name:"This CSTNode indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",children:{}};function zs(e,t,n,r=!1){qs(n);const i=(0,Vr.A)(this.recordingProdStack),s=(0,Hn.A)(t)?t:t.DEF,o=new e({definition:[],idx:n});return r&&(o.separator=t.SEP),(0,$t.A)(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(o),s.call(this),i.definition.push(o),this.recordingProdStack.pop(),Ks}function Ys(e,t){qs(t);const n=(0,Vr.A)(this.recordingProdStack),r=!1===(0,vn.A)(e),i=!1===r?e:e.DEF,s=new fn({definition:[],idx:t,ignoreAmbiguities:r&&!0===e.IGNORE_AMBIGUITIES});(0,$t.A)(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD);const o=En(i,(e=>(0,Hn.A)(e.GATE)));return s.hasPredicates=o,n.definition.push(s),(0,It.A)(i,(e=>{const t=new an({definition:[]});s.definition.push(t),(0,$t.A)(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:(0,$t.A)(e,"GATE")&&(t.ignoreAmbiguities=!0),this.recordingProdStack.push(t),e.ALT.call(this),this.recordingProdStack.pop()})),Ks}function Xs(e){return 0===e?"":`${e}`}function qs(e){if(e<0||e>js){const t=new Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than ${js+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}const Qs=Ai(yi,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Qs);const Js=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:vi,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Zs=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var eo,to,no;function ro(e=void 0){return function(){return e}}!function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"}(eo||(eo={}));class io{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",(()=>{let e;this.selfAnalysisDone=!0;const t=this.className;this.TRACE_INIT("toFastProps",(()=>{Lt(this)})),this.TRACE_INIT("Grammar Recording",(()=>{try{this.enableRecording(),(0,It.A)(this.definedRulesNames,(e=>{const t=this[e].originalGrammarAction;let n;this.TRACE_INIT(`${e} Rule`,(()=>{n=this.topLevelRuleRecord(e,t)})),this.gastProductionsCache[e]=n}))}finally{this.disableRecording()}}));let n=[];if(this.TRACE_INIT("Grammar Resolving",(()=>{n=hs({rules:(0,St.A)(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)})),this.TRACE_INIT("Grammar Validations",(()=>{if((0,Nt.A)(n)&&!1===this.skipValidations){const n=(e={rules:(0,St.A)(this.gastProductionsCache),tokenTypes:(0,St.A)(this.tokensMap),errMsgProvider:Ei,grammarName:t},rs((e=(0,Gn.A)(e,{errMsgProvider:Ei})).rules,e.tokenTypes,e.errMsgProvider,e.grammarName)),r=function(e){const t=e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName});return(0,Ct.A)(t,(e=>Object.assign({type:eo.CUSTOM_LOOKAHEAD_VALIDATION},e)))}({lookaheadStrategy:this.lookaheadStrategy,rules:(0,St.A)(this.gastProductionsCache),tokenTypes:(0,St.A)(this.tokensMap),grammarName:t});this.definitionErrors=this.definitionErrors.concat(n,r)}var e})),(0,Nt.A)(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",(()=>{const e=function(e){const t={};return(0,It.A)(e,(e=>{const n=new Un(e).startWalking();jt(t,n)})),t}((0,St.A)(this.gastProductionsCache));this.resyncFollows=e})),this.TRACE_INIT("ComputeLookaheadFunctions",(()=>{var e,t;null===(t=(e=this.lookaheadStrategy).initialize)||void 0===t||t.call(e,{rules:(0,St.A)(this.gastProductionsCache)}),this.preComputeLookaheadFunctions((0,St.A)(this.gastProductionsCache))}))),!io.DEFER_DEFINITION_ERRORS_HANDLING&&!(0,Nt.A)(this.definitionErrors))throw e=(0,Ct.A)(this.definitionErrors,(e=>e.message)),new Error(`Parser Definition Errors detected:\n ${e.join("\n-------------------------------\n")}`)}))}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initContentAssist(),n.initGastRecorder(t),n.initPerformanceTracer(t),(0,$t.A)(t,"ignoredIssues"))throw new Error("The IParserConfig property has been deprecated.\n\tPlease use the flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=(0,$t.A)(t,"skipValidations")?t.skipValidations:Js.skipValidations}}io.DEFER_DEFINITION_ERRORS_HANDLING=!1,to=io,no=[class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=(0,$t.A)(e,"recoveryEnabled")?e.recoveryEnabled:Js.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Ns)}getTokenToInsert(e){const t=Ai(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,r){const i=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let a=!1;const c=this.LA(1);let l=this.LA(1);const u=()=>{const e=this.LA(0),t=this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:c,previous:e,ruleName:this.getCurrRuleFullName()}),n=new vs(t,c,this.LA(0));n.resyncedTokens=Li(o),this.SAVE_ERROR(n)};for(;!a;){if(this.tokenMatcher(l,r))return void u();if(n.call(this))return u(),void e.apply(this,t);this.tokenMatcher(l,i)?a=!0:(l=this.SKIP_TOKEN(),this.addToResyncTokens(l,o))}this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,t,n){return!1!==n&&!this.tokenMatcher(this.LA(1),e)&&!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t))}getFollowsForInRuleRecovery(e,t){const n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new Ss("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if((0,Nt.A)(t))return!1;const n=this.LA(1);return void 0!==(0,ar.A)(t,(e=>this.tokenMatcher(n,e)))}canRecoverWithSingleTokenDeletion(e){return!!this.canTokenTypeBeDeletedInRecovery(e)&&this.tokenMatcher(this.LA(2),e)}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(t);return In(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA(1),n=2;for(;;){const r=(0,ar.A)(e,(e=>Ti(t,e)));if(void 0!==r)return r;t=this.LA(n),n++}}getCurrFollowKey(){if(1===this.RULE_STACK.length)return xs;const e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK;return(0,Ct.A)(e,((n,r)=>0===r?xs:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:t[r],inRule:this.shortRuleNameToFullName(e[r-1])}))}flattenFollowSet(){const e=(0,Ct.A)(this.buildFullFollowKeyStack(),(e=>this.getFollowSetFromFollowKey(e)));return(0,Pn.A)(e)}getFollowSetFromFollowKey(e){if(e===xs)return[yi];const t=e.ruleName+e.idxInCallingRule+Dn+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,yi)||t.push(e),t}reSyncTo(e){const t=[];let n=this.LA(1);for(;!1===this.tokenMatcher(n,e);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return Li(t)}attemptInRepetitionRecovery(e,t,n,r,i,s,o){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:(0,wt.A)(this.RULE_OCCURRENCE_STACK),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){return(0,Ct.A)(this.RULE_STACK,(e=>this.shortRuleNameToFullName(e)))}},class{initLooksAhead(e){this.dynamicTokensEnabled=(0,$t.A)(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Js.dynamicTokensEnabled,this.maxLookahead=(0,$t.A)(e,"maxLookahead")?e.maxLookahead:Js.maxLookahead,this.lookaheadStrategy=(0,$t.A)(e,"lookaheadStrategy")?e.lookaheadStrategy:new Os({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){(0,It.A)(e,(e=>{this.TRACE_INIT(`${e.name} Rule Lookahead`,(()=>{const{alternation:t,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:s,repetitionWithSeparator:o}=function(e){bs.reset(),e.accept(bs);const t=bs.dslMethods;return bs.reset(),t}(e);(0,It.A)(t,(t=>{const n=0===t.idx?"":t.idx;this.TRACE_INIT(`${wn(t)}${n}`,(()=>{const n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),r=Ls(this.fullRuleNameToShort[e.name],256,t.idx);this.setLaFuncCache(r,n)}))})),(0,It.A)(n,(t=>{this.computeLookaheadFunc(e,t.idx,768,"Repetition",t.maxLookahead,wn(t))})),(0,It.A)(r,(t=>{this.computeLookaheadFunc(e,t.idx,512,"Option",t.maxLookahead,wn(t))})),(0,It.A)(i,(t=>{this.computeLookaheadFunc(e,t.idx,Cs,"RepetitionMandatory",t.maxLookahead,wn(t))})),(0,It.A)(s,(t=>{this.computeLookaheadFunc(e,t.idx,ws,"RepetitionMandatoryWithSeparator",t.maxLookahead,wn(t))})),(0,It.A)(o,(t=>{this.computeLookaheadFunc(e,t.idx,$s,"RepetitionWithSeparator",t.maxLookahead,wn(t))}))}))}))}computeLookaheadFunc(e,t,n,r,i,s){this.TRACE_INIT(`${s}${0===t?"":t}`,(()=>{const s=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),o=Ls(this.fullRuleNameToShort[e.name],n,t);this.setLaFuncCache(o,s)}))}getKeyForAutomaticLookahead(e,t){return Ls(this.getLastExplicitRuleShortName(),e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=(0,$t.A)(e,"nodeLocationTracking")?e.nodeLocationTracking:Js.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Ps,this.setNodeLocationFromNode=Ps,this.cstPostRule=jr.A,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=jr.A,this.setNodeLocationFromNode=jr.A,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=_s,this.setNodeLocationFromNode=_s,this.cstPostRule=jr.A,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=jr.A,this.setNodeLocationFromNode=jr.A,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error(`Invalid config option: "${e.nodeLocationTracking}"`);this.setNodeLocationFromToken=jr.A,this.setNodeLocationFromNode=jr.A,this.cstPostRule=jr.A,this.setInitialNodeLocation=jr.A}else this.cstInvocationStateUpdate=jr.A,this.cstFinallyStateUpdate=jr.A,this.cstPostTerminal=jr.A,this.cstPostNonTerminal=jr.A,this.cstPostRule=jr.A}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?n.endOffset=t.endOffset:n.startOffset=NaN}cstPostTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];var r,i,s;i=t,s=e,void 0===(r=n).children[s]?r.children[s]=[i]:r.children[s].push(i),this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];!function(e,t,n){void 0===e.children[t]?e.children[t]=[n]:e.children[t].push(n)}(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if((0,Fn.A)(this.baseCstVisitorConstructor)){const e=Us(this.className,(0,Kt.A)(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if((0,Fn.A)(this.baseCstVisitorWithDefaultsConstructor)){const e=function(e,t,n){const r=function(){};Ms(r,e+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return(0,It.A)(t,(e=>{i[e]=Ds})),(r.prototype=i).constructor=r,r}(this.className,(0,Kt.A)(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(!0!==this.selfAnalysisDone)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Qs}LA(e){const t=this.currIdx+e;return t<0||this.tokVectorLength<=t?Qs:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},class{initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=zr,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},(0,$t.A)(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if((0,vn.A)(e)){if((0,Nt.A)(e))throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if((0,vn.A)(e))this.tokensMap=(0,Yn.A)(e,((e,t)=>(e[t.name]=t,e)),{});else if((0,$t.A)(e,"modes")&&Cn((0,Pn.A)((0,St.A)(e.modes)),ei)){const t=(0,Pn.A)((0,St.A)(e.modes)),n=_n(t);this.tokensMap=(0,Yn.A)(n,((e,t)=>(e[t.name]=t,e)),{})}else{if(!(0,Gs.A)(e))throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=(0,wt.A)(e)}this.tokensMap.EOF=yi;const n=(0,$t.A)(e,"modes")?(0,Pn.A)((0,St.A)(e.modes)):(0,St.A)(e),r=Cn(n,(e=>(0,Nt.A)(e.categoryMatches)));this.tokenMatcher=r?zr:Wr,qr((0,St.A)(this.tokensMap))}defineRule(e,t,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const r=(0,$t.A)(n,"resyncEnabled")?n.resyncEnabled:Zs.resyncEnabled,i=(0,$t.A)(n,"recoveryValueFunc")?n.recoveryValueFunc:Zs.recoveryValueFunc,s=this.ruleShortNameIdx<<12;let o;return this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s,o=!0===this.outputCst?function(...n){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n);const r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}catch(o){return this.invokeRuleCatch(o,r,i)}finally{this.ruleFinallyStateUpdate()}}:function(...n){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n)}catch(o){return this.invokeRuleCatch(o,r,i)}finally{this.ruleFinallyStateUpdate()}},Object.assign(o,{ruleName:e,originalGrammarAction:t})}invokeRuleCatch(e,t,n){const r=1===this.RULE_STACK.length,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(As(e)){const t=e;if(i){const r=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(r)){if(t.resyncedTokens=this.reSyncTo(r),this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];return e.recoveredNode=!0,e}return n(e)}if(this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];e.recoveredNode=!0,t.partialCstResult=e}throw t}if(r)return this.moveToTerminatedState(),n(e);throw t}throw e}optionInternal(e,t){const n=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,n)}optionInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof e){r=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=()=>t.call(this)&&e.call(this)}}else r=e;if(!0===i.call(this))return r.call(this)}atLeastOneInternal(e,t){const n=this.getKeyForAutomaticLookahead(Cs,e);return this.atLeastOneInternalLogic(e,t,n)}atLeastOneInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;if(!0!==i.call(this))throw this.raiseEarlyExitException(e,Bi.REPETITION_MANDATORY,t.ERR_MSG);{let e=this.doSingleRepetition(r);for(;!0===i.call(this)&&!0===e;)e=this.doSingleRepetition(r)}this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],i,Cs,e,Di)}atLeastOneSepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(ws,e);this.atLeastOneSepFirstInternalLogic(e,t,n)}atLeastOneSepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0!==this.getLaFuncFromCache(n).call(this))throw this.raiseEarlyExitException(e,Bi.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);{r.call(this);const t=()=>this.tokenMatcher(this.LA(1),i);for(;!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,Ui],t,ws,e,Ui)}}manyInternal(e,t){const n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,n)}manyInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;let s=!0;for(;!0===i.call(this)&&!0===s;)s=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],i,768,e,Pi,s)}manySepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead($s,e);this.manySepFirstInternalLogic(e,t,n)}manySepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0===this.getLaFuncFromCache(n).call(this)){r.call(this);const t=()=>this.tokenMatcher(this.LA(1),i);for(;!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,Mi],t,$s,e,Mi)}}repetitionSepSecondInternal(e,t,n,r,i){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,ws,e,i)}doSingleRepetition(e){const t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){const n=this.getKeyForAutomaticLookahead(256,t),r=(0,vn.A)(e)?e:e.DEF,i=this.getLaFuncFromCache(n).call(this,r);if(void 0!==i)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),0===this.RULE_STACK.length&&!1===this.isAtEndOfInput()){const e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Es(t,e))}}subruleInternal(e,t,n){let r;try{const i=void 0!==n?n.ARGS:void 0;return this.subruleIdx=t,r=e.apply(this,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:e.ruleName),r}catch(i){throw this.subruleInternalError(i,n,e.ruleName)}}subruleInternalError(e,t,n){throw As(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,t,n){let r;try{const t=this.LA(1);!0===this.tokenMatcher(t,e)?(this.consumeToken(),r=t):this.consumeInternalError(e,t,n)}catch(i){r=this.consumeInternalRecovery(e,t,i)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:e.name,r),r}consumeInternalError(e,t,n){let r;const i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new vs(r,t,i))}consumeInternalRecovery(e,t,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;{const i=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,i)}catch(r){throw r.name===Is?n:r}}}saveRecogState(){const e=this.errors,t=(0,wt.A)(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,t,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t)}isBackTracking(){return 0!==this.isBackTrackingStack.length}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),yi)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},class{ACTION(e){return e.call(this)}consume(e,t,n){return this.consumeInternal(t,e,n)}subrule(e,t,n){return this.subruleInternal(t,e,n)}option(e,t){return this.optionInternal(t,e)}or(e,t){return this.orInternal(t,e)}many(e,t){return this.manyInternal(e,t)}atLeastOne(e,t){return this.atLeastOneInternal(e,t)}CONSUME(e,t){return this.consumeInternal(e,0,t)}CONSUME1(e,t){return this.consumeInternal(e,1,t)}CONSUME2(e,t){return this.consumeInternal(e,2,t)}CONSUME3(e,t){return this.consumeInternal(e,3,t)}CONSUME4(e,t){return this.consumeInternal(e,4,t)}CONSUME5(e,t){return this.consumeInternal(e,5,t)}CONSUME6(e,t){return this.consumeInternal(e,6,t)}CONSUME7(e,t){return this.consumeInternal(e,7,t)}CONSUME8(e,t){return this.consumeInternal(e,8,t)}CONSUME9(e,t){return this.consumeInternal(e,9,t)}SUBRULE(e,t){return this.subruleInternal(e,0,t)}SUBRULE1(e,t){return this.subruleInternal(e,1,t)}SUBRULE2(e,t){return this.subruleInternal(e,2,t)}SUBRULE3(e,t){return this.subruleInternal(e,3,t)}SUBRULE4(e,t){return this.subruleInternal(e,4,t)}SUBRULE5(e,t){return this.subruleInternal(e,5,t)}SUBRULE6(e,t){return this.subruleInternal(e,6,t)}SUBRULE7(e,t){return this.subruleInternal(e,7,t)}SUBRULE8(e,t){return this.subruleInternal(e,8,t)}SUBRULE9(e,t){return this.subruleInternal(e,9,t)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,t,n=Zs){if(In(this.definedRulesNames,e)){const t={message:Ei.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:eo.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(t)}this.definedRulesNames.push(e);const r=this.defineRule(e,t,n);return this[e]=r,r}OVERRIDE_RULE(e,t,n=Zs){const r=function(e,t,n){const r=[];let i;return In(t,e)||(i=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:eo.INVALID_RULE_OVERRIDE,ruleName:e})),r}(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);const i=this.defineRule(e,t,n);return this[e]=i,i}BACKTRACK(e,t){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return e.apply(this,t),!0}catch(r){if(As(r))return!1;throw r}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return e=(0,St.A)(this.gastProductionsCache),(0,Ct.A)(e,mn);var e}},class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=(0,$t.A)(e,"errorMessageProvider")?e.errorMessageProvider:Js.errorMessageProvider}SAVE_ERROR(e){if(As(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:(0,wt.A)(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return(0,wt.A)(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,t,n){const r=this.getCurrRuleFullName(),i=es(e,this.getGAstProductions()[r],t,this.maxLookahead)[0],s=[];for(let a=1;a<=this.maxLookahead;a++)s.push(this.LA(a));const o=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:s,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new ks(o,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const n=this.getCurrRuleFullName(),r=Zi(e,this.getGAstProductions()[n],this.maxLookahead),i=[];for(let a=1;a<=this.maxLookahead;a++)i.push(this.LA(a));const s=this.LA(0),o=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:r,actual:i,previous:s,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Rs(o,this.LA(1),s))}},class{initContentAssist(){}computeContentAssist(e,t){const n=this.gastProductionsCache[e];if((0,Fn.A)(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return Gi([n],t,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const t=or(e.ruleStack),n=this.getGAstProductions()[t];return new bi(n,e).startWalking()}},class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",(()=>{for(let e=0;e<10;e++){const t=e>0?e:"";this[`CONSUME${t}`]=function(t,n){return this.consumeInternalRecord(t,e,n)},this[`SUBRULE${t}`]=function(t,n){return this.subruleInternalRecord(t,e,n)},this[`OPTION${t}`]=function(t){return this.optionInternalRecord(t,e)},this[`OR${t}`]=function(t){return this.orInternalRecord(t,e)},this[`MANY${t}`]=function(t){this.manyInternalRecord(e,t)},this[`MANY_SEP${t}`]=function(t){this.manySepFirstInternalRecord(e,t)},this[`AT_LEAST_ONE${t}`]=function(t){this.atLeastOneInternalRecord(e,t)},this[`AT_LEAST_ONE_SEP${t}`]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}}this.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},this.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD}))}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",(()=>{const e=this;for(let t=0;t<10;t++){const n=t>0?t:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA}))}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return Qs}topLevelRuleRecord(e,t){try{const n=new on({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(n){if(!0!==n.KNOWN_RECORDER_ERROR)try{n.message=n.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(r){throw n}throw n}}optionInternalRecord(e,t){return zs.call(this,cn,e,t)}atLeastOneInternalRecord(e,t){zs.call(this,ln,t,e)}atLeastOneSepFirstInternalRecord(e,t){zs.call(this,un,t,e,Bs)}manyInternalRecord(e,t){zs.call(this,dn,t,e)}manySepFirstInternalRecord(e,t){zs.call(this,hn,t,e,Bs)}orInternalRecord(e,t){return Ys.call(this,e,t)}subruleInternalRecord(e,t,n){if(qs(t),!e||!1===(0,$t.A)(e,"ruleName")){const n=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=(0,Vr.A)(this.recordingProdStack),i=e.ruleName,s=new sn({idx:t,nonTerminalName:i,label:null==n?void 0:n.LABEL,referencedRule:void 0});return r.definition.push(s),this.outputCst?Ws:Ks}consumeInternalRecord(e,t,n){if(qs(t),!Jr(e)){const n=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=(0,Vr.A)(this.recordingProdStack),i=new pn({idx:t,terminalType:e,label:null==n?void 0:n.LABEL});return r.definition.push(i),Hs}},class{initPerformanceTracer(e){if((0,$t.A)(e,"traceInitPerf")){const t=e.traceInitPerf,n="number"==typeof t;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=Js.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=Hr(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()}}],no.forEach((e=>{const t=e.prototype;Object.getOwnPropertyNames(t).forEach((n=>{if("constructor"===n)return;const r=Object.getOwnPropertyDescriptor(t,n);r&&(r.get||r.set)?Object.defineProperty(to.prototype,n,r):to.prototype[n]=e.prototype[n]}))}));class so extends io{constructor(e,t=Js){const n=(0,wt.A)(t);n.outputCst=!1,super(e,n)}}function oo(e,t,n){return`${e.name}_${t}_${n}`}class ao{constructor(e){this.target=e}isEpsilon(){return!1}}class co extends ao{constructor(e,t){super(e),this.tokenType=t}}class lo extends ao{constructor(e){super(e)}isEpsilon(){return!0}}class uo extends ao{constructor(e,t,n){super(e),this.rule=t,this.followState=n}isEpsilon(){return!0}}function ho(e){const t={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};!function(e,t){const n=t.length;for(let r=0;rfo(e,t,n))),s=Ao(e,t,r,n,...i);return s}(e,t,n):n instanceof cn?function(e,t,n){const r=Eo(e,t,n,{type:1});yo(e,r);const i=Ao(e,t,r,n,po(e,t,n));return function(e,t,n,r){const i=r.left,s=r.right;return Ro(i,s),e.decisionMap[oo(t,"Option",n.idx)]=i,r}(e,t,n,i)}(e,t,n):n instanceof dn?function(e,t,n){const r=Eo(e,t,n,{type:5});yo(e,r);const i=Ao(e,t,r,n,po(e,t,n));return go(e,t,n,i)}(e,t,n):n instanceof hn?function(e,t,n){const r=Eo(e,t,n,{type:5});yo(e,r);const i=Ao(e,t,r,n,po(e,t,n)),s=To(e,t,n.separator,n);return go(e,t,n,i,s)}(e,t,n):n instanceof ln?function(e,t,n){const r=Eo(e,t,n,{type:4});yo(e,r);const i=Ao(e,t,r,n,po(e,t,n));return mo(e,t,n,i)}(e,t,n):n instanceof un?function(e,t,n){const r=Eo(e,t,n,{type:4});yo(e,r);const i=Ao(e,t,r,n,po(e,t,n)),s=To(e,t,n.separator,n);return mo(e,t,n,i,s)}(e,t,n):po(e,t,n)}function po(e,t,n){const r=(0,Xn.A)((0,Ct.A)(n.definition,(n=>fo(e,t,n))),(e=>void 0!==e));return 1===r.length?r[0]:0===r.length?void 0:function(e,t){const n=t.length;for(let s=0;se.alt))}get key(){let e="";for(const t in this.map)e+=t+":";return e}}function No(e,t=!0){return`${t?`a${e.alt}`:""}s${e.state.stateNumber}:${e.stack.map((e=>e.stateNumber.toString())).join("_")}`}var Co=n(2675);const $o=function(e,t){return e&&e.length?(0,bn.A)(e,(0,Ht.A)(t,2)):[]};function wo(e,t){const n={};return r=>{const i=r.toString();let s=n[i];return void 0!==s||(s={atnStartState:e,decision:t,states:{}},n[i]=s),s}}class Lo{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,t){this.predicates[e]=t}toString(){let e="";const t=this.predicates.length;for(let n=0;nconsole.log(e)}initialize(e){this.atn=ho(e.rules),this.dfas=function(e){const t=e.decisionStates.length,n=Array(t);for(let r=0;r(0,Ct.A)(e,(e=>e[0]))));if(_o(l,!1)&&!i){const e=(0,Yn.A)(l,((e,t,n)=>((0,It.A)(t,(t=>{t&&(e[t.tokenTypeIdx]=n,(0,It.A)(t.categoryMatches,(t=>{e[t]=n})))})),e)),{});return r?function(t){var n;const r=this.LA(1),i=e[r.tokenTypeIdx];if(void 0!==t&&void 0!==i){const e=null===(n=t[i])||void 0===n?void 0:n.GATE;if(void 0!==e&&!1===e.call(this))return}return i}:function(){const t=this.LA(1);return e[t.tokenTypeIdx]}}return r?function(e){const t=new Lo,n=void 0===e?0:e.length;for(let i=0;i(0,Ct.A)(e,(e=>e[0]))));if(_o(l)&&l[0][0]&&!i){const e=l[0],t=(0,Pn.A)(e);if(1===t.length&&(0,Nt.A)(t[0].categoryMatches)){const e=t[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===e}}{const e=(0,Yn.A)(t,((e,t)=>(void 0!==t&&(e[t.tokenTypeIdx]=!0,(0,It.A)(t.categoryMatches,(t=>{e[t]=!0}))),e)),{});return function(){const t=this.LA(1);return!0===e[t.tokenTypeIdx]}}}return function(){const e=Po.call(this,s,c,Oo,o);return"object"!=typeof e&&0===e}}}function _o(e,t=!0){const n=new Set;for(const r of e){const e=new Set;for(const i of r){if(void 0===i){if(t)break;return!1}const r=[i.tokenTypeIdx].concat(i.categoryMatches);for(const t of r)if(n.has(t)){if(!e.has(t))return!1}else n.add(t),e.add(t)}}return!0}function Po(e,t,n,r){const i=e[t](n);let s=i.start;if(void 0===s){s=jo(i,Ko(Vo(i.atnStartState))),i.start=s}return Mo.apply(this,[i,s,n,r])}function Mo(e,t,n,r){let i=t,s=1;const o=[];let a=this.LA(s++);for(;;){let t=(c=a,i.edges[c.tokenTypeIdx]);if(void 0===t&&(t=Do.apply(this,[e,i,a,s,n,r])),t===Io)return Fo(o,i,a);if(!0===t.isAcceptState)return t.prediction;i=t,o.push(a),a=this.LA(s++)}var c}function Do(e,t,n,r,i,s){const o=function(e,t,n){const r=new So,i=[];for(const o of e.elements){if(!1===n.is(o.alt))continue;if(7===o.state.type){i.push(o);continue}const e=o.state.transitions.length;for(let n=0;n0&&!function(e){for(const t of e.elements)if(7===t.state.type)return!0;return!1}(s))for(const o of i)s.add(o);return s}(t.configs,n,i);if(0===o.size)return Bo(e,t,n,Io),Io;let a=Ko(o);const c=function(e,t){let n;for(const r of e.elements)if(!0===t.is(r.alt))if(void 0===n)n=r.alt;else if(n!==r.alt)return;return n}(o,i);if(void 0!==c)a.isAcceptState=!0,a.prediction=c,a.configs.uniqueAlt=c;else if(function(e){if(function(e){for(const t of e.elements)if(7!==t.state.type)return!1;return!0}(e))return!0;const t=function(e){const t=new Map;for(const n of e){const e=No(n,!1);let r=t.get(e);void 0===r&&(r={},t.set(e,r)),r[n.alt]=!0}return t}(e.elements);return function(e){for(const t of Array.from(e.values()))if(Object.keys(t).length>1)return!0;return!1}(t)&&!function(e){for(const t of Array.from(e.values()))if(1===Object.keys(t).length)return!0;return!1}(t)}(o)){const t=(0,Co.A)(o.alts);a.isAcceptState=!0,a.prediction=t,a.configs.uniqueAlt=t,Uo.apply(this,[e,r,o.alts,s])}return a=Bo(e,t,n,a),a}function Uo(e,t,n,r){const i=[];for(let o=1;o<=t;o++)i.push(this.LA(o).tokenType);const s=e.atnStartState;r(function(e){const t=(0,Ct.A)(e.prefixPath,(e=>si(e))).join(", "),n=0===e.production.idx?"":e.production.idx;let r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(", ")}> in <${function(e){if(e instanceof sn)return"SUBRULE";if(e instanceof cn)return"OPTION";if(e instanceof fn)return"OR";if(e instanceof ln)return"AT_LEAST_ONE";if(e instanceof un)return"AT_LEAST_ONE_SEP";if(e instanceof hn)return"MANY_SEP";if(e instanceof dn)return"MANY";if(e instanceof pn)return"CONSUME";throw Error("non exhaustive match")}(e.production)}${n}> inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\n`;return r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r}({topLevelRule:s.rule,ambiguityIndices:n,production:s.production,prefixPath:i}))}function Fo(e,t,n){const r=xi(t.configs.elements,(e=>e.state.transitions));return{actualToken:n,possibleTokenTypes:$o(r.filter((e=>e instanceof co)).map((e=>e.tokenType)),(e=>e.tokenTypeIdx)),tokenPath:e}}function Go(e,t){if(e instanceof co&&Ti(t,e.tokenType))return e.target}function Ko(e){return{configs:e,edges:{},isAcceptState:!1,prediction:-1}}function Bo(e,t,n,r){return r=jo(e,r),t.edges[n.tokenTypeIdx]=r,r}function jo(e,t){if(t===Io)return t;const n=t.configs.key,r=e.states[n];return void 0!==r?r:(t.configs.finalize(),e.states[n]=t,t)}function Vo(e){const t=new So,n=e.transitions.length;for(let r=0;r0){const n=[...e.stack];Ho({state:n.pop(),alt:e.alt,stack:n},t)}else t.add(e);return}n.epsilonOnlyTransitions||t.add(e);const r=n.transitions.length;for(let i=0;i0&&(r.arguments=n),r},e.is=function(e){let t=e;return Ac.defined(t)&&Ac.string(t.title)&&Ac.string(t.command)}}(da||(da={})),function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:""}},e.is=function(e){const t=e;return Ac.objectLiteral(t)&&Ac.string(t.newText)&&Jo.is(t.range)}}(ha||(ha={})),function(e){e.create=function(e,t,n){const r={label:e};return void 0!==t&&(r.needsConfirmation=t),void 0!==n&&(r.description=n),r},e.is=function(e){const t=e;return Ac.objectLiteral(t)&&Ac.string(t.label)&&(Ac.boolean(t.needsConfirmation)||void 0===t.needsConfirmation)&&(Ac.string(t.description)||void 0===t.description)}}(fa||(fa={})),function(e){e.is=function(e){const t=e;return Ac.string(t)}}(pa||(pa={})),function(e){e.replace=function(e,t,n){return{range:e,newText:t,annotationId:n}},e.insert=function(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}},e.del=function(e,t){return{range:e,newText:"",annotationId:t}},e.is=function(e){const t=e;return ha.is(t)&&(fa.is(t.annotationId)||pa.is(t.annotationId))}}(ma||(ma={})),function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){let t=e;return Ac.defined(t)&&ka.is(t.textDocument)&&Array.isArray(t.edits)}}(ga||(ga={})),function(e){e.create=function(e,t,n){let r={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){let t=e;return t&&"create"===t.kind&&Ac.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||Ac.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Ac.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||pa.is(t.annotationId))}}(ya||(ya={})),function(e){e.create=function(e,t,n,r){let i={kind:"rename",oldUri:e,newUri:t};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(i.options=n),void 0!==r&&(i.annotationId=r),i},e.is=function(e){let t=e;return t&&"rename"===t.kind&&Ac.string(t.oldUri)&&Ac.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||Ac.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Ac.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||pa.is(t.annotationId))}}(Aa||(Aa={})),function(e){e.create=function(e,t,n){let r={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){let t=e;return t&&"delete"===t.kind&&Ac.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||Ac.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||Ac.boolean(t.options.ignoreIfNotExists)))&&(void 0===t.annotationId||pa.is(t.annotationId))}}(Ta||(Ta={})),function(e){e.is=function(e){let t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every((e=>Ac.string(e.kind)?ya.is(e)||Aa.is(e)||Ta.is(e):ga.is(e))))}}(va||(va={}));!function(e){e.create=function(e){return{uri:e}},e.is=function(e){let t=e;return Ac.defined(t)&&Ac.string(t.uri)}}(Ra||(Ra={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){let t=e;return Ac.defined(t)&&Ac.string(t.uri)&&Ac.integer(t.version)}}(Ea||(Ea={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){let t=e;return Ac.defined(t)&&Ac.string(t.uri)&&(null===t.version||Ac.integer(t.version))}}(ka||(ka={})),function(e){e.create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},e.is=function(e){let t=e;return Ac.defined(t)&&Ac.string(t.uri)&&Ac.string(t.languageId)&&Ac.integer(t.version)&&Ac.string(t.text)}}(xa||(xa={})),function(e){e.PlainText="plaintext",e.Markdown="markdown",e.is=function(t){const n=t;return n===e.PlainText||n===e.Markdown}}(Ia||(Ia={})),function(e){e.is=function(e){const t=e;return Ac.objectLiteral(e)&&Ia.is(t.kind)&&Ac.string(t.value)}}(Sa||(Sa={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(Na||(Na={})),function(e){e.PlainText=1,e.Snippet=2}(Ca||(Ca={})),function(e){e.Deprecated=1}($a||($a={})),function(e){e.create=function(e,t,n){return{newText:e,insert:t,replace:n}},e.is=function(e){const t=e;return t&&Ac.string(t.newText)&&Jo.is(t.insert)&&Jo.is(t.replace)}}(wa||(wa={})),function(e){e.asIs=1,e.adjustIndentation=2}(La||(La={})),function(e){e.is=function(e){const t=e;return t&&(Ac.string(t.detail)||void 0===t.detail)&&(Ac.string(t.description)||void 0===t.description)}}(Oa||(Oa={})),function(e){e.create=function(e){return{label:e}}}(ba||(ba={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(_a||(_a={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){const t=e;return Ac.string(t)||Ac.objectLiteral(t)&&Ac.string(t.language)&&Ac.string(t.value)}}(Pa||(Pa={})),function(e){e.is=function(e){let t=e;return!!t&&Ac.objectLiteral(t)&&(Sa.is(t.contents)||Pa.is(t.contents)||Ac.typedArray(t.contents,Pa.is))&&(void 0===e.range||Jo.is(e.range))}}(Ma||(Ma={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(Da||(Da={})),function(e){e.create=function(e,t,...n){let r={label:e};return Ac.defined(t)&&(r.documentation=t),Ac.defined(n)?r.parameters=n:r.parameters=[],r}}(Ua||(Ua={})),function(e){e.Text=1,e.Read=2,e.Write=3}(Fa||(Fa={})),function(e){e.create=function(e,t){let n={range:e};return Ac.number(t)&&(n.kind=t),n}}(Ga||(Ga={})),function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26}(Ka||(Ka={})),function(e){e.Deprecated=1}(Ba||(Ba={})),function(e){e.create=function(e,t,n,r,i){let s={name:e,kind:t,location:{uri:r,range:n}};return i&&(s.containerName=i),s}}(ja||(ja={})),function(e){e.create=function(e,t,n,r){return void 0!==r?{name:e,kind:t,location:{uri:n,range:r}}:{name:e,kind:t,location:{uri:n}}}}(Va||(Va={})),function(e){e.create=function(e,t,n,r,i,s){let o={name:e,detail:t,kind:n,range:r,selectionRange:i};return void 0!==s&&(o.children=s),o},e.is=function(e){let t=e;return t&&Ac.string(t.name)&&Ac.number(t.kind)&&Jo.is(t.range)&&Jo.is(t.selectionRange)&&(void 0===t.detail||Ac.string(t.detail))&&(void 0===t.deprecated||Ac.boolean(t.deprecated))&&(void 0===t.children||Array.isArray(t.children))&&(void 0===t.tags||Array.isArray(t.tags))}}(Ha||(Ha={})),function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"}(Wa||(Wa={})),function(e){e.Invoked=1,e.Automatic=2}(za||(za={})),function(e){e.create=function(e,t,n){let r={diagnostics:e};return null!=t&&(r.only=t),null!=n&&(r.triggerKind=n),r},e.is=function(e){let t=e;return Ac.defined(t)&&Ac.typedArray(t.diagnostics,ua.is)&&(void 0===t.only||Ac.typedArray(t.only,Ac.string))&&(void 0===t.triggerKind||t.triggerKind===za.Invoked||t.triggerKind===za.Automatic)}}(Ya||(Ya={})),function(e){e.create=function(e,t,n){let r={title:e},i=!0;return"string"==typeof t?(i=!1,r.kind=t):da.is(t)?r.command=t:r.edit=t,i&&void 0!==n&&(r.kind=n),r},e.is=function(e){let t=e;return t&&Ac.string(t.title)&&(void 0===t.diagnostics||Ac.typedArray(t.diagnostics,ua.is))&&(void 0===t.kind||Ac.string(t.kind))&&(void 0!==t.edit||void 0!==t.command)&&(void 0===t.command||da.is(t.command))&&(void 0===t.isPreferred||Ac.boolean(t.isPreferred))&&(void 0===t.edit||va.is(t.edit))}}(Xa||(Xa={})),function(e){e.create=function(e,t){let n={range:e};return Ac.defined(t)&&(n.data=t),n},e.is=function(e){let t=e;return Ac.defined(t)&&Jo.is(t.range)&&(Ac.undefined(t.command)||da.is(t.command))}}(qa||(qa={})),function(e){e.create=function(e,t){return{tabSize:e,insertSpaces:t}},e.is=function(e){let t=e;return Ac.defined(t)&&Ac.uinteger(t.tabSize)&&Ac.boolean(t.insertSpaces)}}(Qa||(Qa={})),function(e){e.create=function(e,t,n){return{range:e,target:t,data:n}},e.is=function(e){let t=e;return Ac.defined(t)&&Jo.is(t.range)&&(Ac.undefined(t.target)||Ac.string(t.target))}}(Ja||(Ja={})),function(e){e.create=function(e,t){return{range:e,parent:t}},e.is=function(t){let n=t;return Ac.objectLiteral(n)&&Jo.is(n.range)&&(void 0===n.parent||e.is(n.parent))}}(Za||(Za={})),function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"}(ec||(ec={})),function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"}(tc||(tc={})),function(e){e.is=function(e){const t=e;return Ac.objectLiteral(t)&&(void 0===t.resultId||"string"==typeof t.resultId)&&Array.isArray(t.data)&&(0===t.data.length||"number"==typeof t.data[0])}}(nc||(nc={})),function(e){e.create=function(e,t){return{range:e,text:t}},e.is=function(e){const t=e;return null!=t&&Jo.is(t.range)&&Ac.string(t.text)}}(rc||(rc={})),function(e){e.create=function(e,t,n){return{range:e,variableName:t,caseSensitiveLookup:n}},e.is=function(e){const t=e;return null!=t&&Jo.is(t.range)&&Ac.boolean(t.caseSensitiveLookup)&&(Ac.string(t.variableName)||void 0===t.variableName)}}(ic||(ic={})),function(e){e.create=function(e,t){return{range:e,expression:t}},e.is=function(e){const t=e;return null!=t&&Jo.is(t.range)&&(Ac.string(t.expression)||void 0===t.expression)}}(sc||(sc={})),function(e){e.create=function(e,t){return{frameId:e,stoppedLocation:t}},e.is=function(e){const t=e;return Ac.defined(t)&&Jo.is(e.stoppedLocation)}}(oc||(oc={})),function(e){e.Type=1,e.Parameter=2,e.is=function(e){return 1===e||2===e}}(ac||(ac={})),function(e){e.create=function(e){return{value:e}},e.is=function(e){const t=e;return Ac.objectLiteral(t)&&(void 0===t.tooltip||Ac.string(t.tooltip)||Sa.is(t.tooltip))&&(void 0===t.location||Zo.is(t.location))&&(void 0===t.command||da.is(t.command))}}(cc||(cc={})),function(e){e.create=function(e,t,n){const r={position:e,label:t};return void 0!==n&&(r.kind=n),r},e.is=function(e){const t=e;return Ac.objectLiteral(t)&&Qo.is(t.position)&&(Ac.string(t.label)||Ac.typedArray(t.label,cc.is))&&(void 0===t.kind||ac.is(t.kind))&&void 0===t.textEdits||Ac.typedArray(t.textEdits,ha.is)&&(void 0===t.tooltip||Ac.string(t.tooltip)||Sa.is(t.tooltip))&&(void 0===t.paddingLeft||Ac.boolean(t.paddingLeft))&&(void 0===t.paddingRight||Ac.boolean(t.paddingRight))}}(lc||(lc={})),function(e){e.createSnippet=function(e){return{kind:"snippet",value:e}}}(uc||(uc={})),function(e){e.create=function(e,t,n,r){return{insertText:e,filterText:t,range:n,command:r}}}(dc||(dc={})),function(e){e.create=function(e){return{items:e}}}(hc||(hc={})),function(e){e.Invoked=0,e.Automatic=1}(fc||(fc={})),function(e){e.create=function(e,t){return{range:e,text:t}}}(pc||(pc={})),function(e){e.create=function(e,t){return{triggerKind:e,selectedCompletionInfo:t}}}(mc||(mc={})),function(e){e.is=function(e){const t=e;return Ac.objectLiteral(t)&&Yo.is(t.uri)&&Ac.string(t.name)}}(gc||(gc={}));var yc,Ac;!function(e){function t(e,n){if(e.length<=1)return e;const r=e.length/2|0,i=e.slice(0,r),s=e.slice(r);t(i,n),t(s,n);let o=0,a=0,c=0;for(;o{let n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n})),s=r.length;for(let t=i.length-1;t>=0;t--){let n=i[t],o=e.offsetAt(n.range.start),a=e.offsetAt(n.range.end);if(!(a<=s))throw new Error("Overlapping edit");r=r.substring(0,o)+n.newText+r.substring(a,r.length),s=o}return r}}(yc||(yc={}));class Tc{constructor(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(void 0===this._lineOffsets){let e=[],t=this._content,n=!0;for(let r=0;r0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return Qo.create(0,e);for(;ne?r=i:n=i+1}let i=n-1;return Qo.create(i,e-t[i])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line],r=e.line+1=0&&t.content.splice(n,1)}}construct(e){const t=this.current;"string"==typeof e.$type&&(this.current.astNode=e),e.$cstNode=t;const n=this.nodeStack.pop();0===(null==n?void 0:n.content.length)&&this.removeNode(n)}addHiddenTokens(e){for(const t of e){const e=new Ec(t.startOffset,t.image.length,v(t),t.tokenType,!0);e.root=this.rootNode,this.addHiddenToken(this.rootNode,e)}}addHiddenToken(e,t){const{offset:n,end:r}=t;for(let i=0;io&&r=0;e--){const t=this.content[e];if(!t.hidden)return t}return this.content[this.content.length-1]}}class xc extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,xc.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,t,...n){return this.addParents(n),super.splice(e,t,...n)}addParents(e){for(const t of e)t.container=this.parent}}class Ic extends kc{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=null!=e?e:""}}const Sc=Symbol("Datatype");function Nc(e){return e.$type===Sc}const Cc=e=>e.endsWith("\u200b")?e:e+"\u200b";class $c{constructor(e){this._unorderedGroups=new Map,this.lexer=e.parser.Lexer;const t=this.lexer.definition;this.wrapper=new Pc(t,Object.assign(Object.assign({},e.parser.ParserConfig),{errorMessageProvider:e.parser.ParserErrorMessageProvider}))}alternatives(e,t){this.wrapper.wrapOr(e,t)}optional(e,t){this.wrapper.wrapOption(e,t)}many(e,t){this.wrapper.wrapMany(e,t)}atLeastOne(e,t){this.wrapper.wrapAtLeastOne(e,t)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}}class wc extends $c{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new vc,this.stack=[],this.assignmentMap=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,t){const n=e.fragment?void 0:gt(e)?Sc:Tt(e),r=this.wrapper.DEFINE_RULE(Cc(e.name),this.startImplementation(n,t).bind(this));return e.entry&&(this.mainRule=r),r}parse(e){this.nodeBuilder.buildRootNode(e);const t=this.lexer.tokenize(e);this.wrapper.input=t.tokens;const n=this.mainRule.call(this.wrapper,{});return this.nodeBuilder.addHiddenTokens(t.hidden),this.unorderedGroups.clear(),{value:n,lexerErrors:t.errors,parserErrors:this.wrapper.errors}}startImplementation(e,t){return n=>{if(!this.isRecording()){const t={$type:e};this.stack.push(t),e===Sc&&(t.value="")}let r;try{r=t(n)}catch(i){r=void 0}return this.isRecording()||void 0!==r||(r=this.construct()),r}}consume(e,t,n){const r=this.wrapper.wrapConsume(e,t);if(!this.isRecording()&&this.isValidToken(r)){const e=this.nodeBuilder.buildLeafNode(r,n),{assignment:t,isCrossRef:i}=this.getAssignment(n),s=this.current;if(t){const s=Ae(n)?r.image:this.converter.convert(r.image,e);this.assign(t.operator,t.feature,s,e,i)}else if(Nc(s)){let t=r.image;Ae(n)||(t=this.converter.convert(t,e).toString()),s.value+=t}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&"number"==typeof e.endOffset&&!isNaN(e.endOffset)}subrule(e,t,n,r){let i;this.isRecording()||(i=this.nodeBuilder.buildCompositeNode(n));const s=this.wrapper.wrapSubrule(e,t,r);!this.isRecording()&&i&&i.length>0&&this.performSubruleAssignment(s,n,i)}performSubruleAssignment(e,t,n){const{assignment:r,isCrossRef:i}=this.getAssignment(t);if(r)this.assign(r.operator,r.feature,e,n,i);else if(!r){const t=this.current;if(Nc(t))t.value+=e.toString();else if("object"==typeof e&&e){const n=e.$type,r=this.assignWithoutOverride(e,t);n&&(r.$type=n);const i=r;this.stack.pop(),this.stack.push(i)}}}action(e,t){if(!this.isRecording()){let n=this.current;if(!n.$cstNode&&t.feature&&t.operator){n=this.construct(!1);const e=n.$cstNode.feature;this.nodeBuilder.buildCompositeNode(e)}const r={$type:e};this.stack.pop(),this.stack.push(r),t.feature&&t.operator&&this.assign(t.operator,t.feature,n,n.$cstNode,!1)}}construct(e=!0){if(this.isRecording())return;const t=this.current;return be(t),this.nodeBuilder.construct(t),e&&this.stack.pop(),Nc(t)?this.converter.convert(t.value,t.$cstNode):(function(e,t){const n=e.getTypeMetaData(t.$type),r=t;for(const i of n.properties)void 0!==i.defaultValue&&void 0===r[i.name]&&(r[i.name]=Ke(i.defaultValue))}(this.astReflection,t),t)}getAssignment(e){if(!this.assignmentMap.has(e)){const t=_e(e,ue);this.assignmentMap.set(e,{assignment:t,isCrossRef:!!t&&fe(t.terminal)})}return this.assignmentMap.get(e)}assign(e,t,n,r,i){const s=this.current;let o;switch(o=i&&"string"==typeof n?this.linker.buildReference(s,t,r,n):n,e){case"=":s[t]=o;break;case"?=":s[t]=!0;break;case"+=":Array.isArray(s[t])||(s[t]=[]),s[t].push(o)}}assignWithoutOverride(e,t){for(const[n,r]of Object.entries(t)){const t=e[n];void 0===t?e[n]=r:Array.isArray(t)&&Array.isArray(r)&&(r.push(...t),e[n]=r)}return e}get definitionErrors(){return this.wrapper.definitionErrors}}class Lc{buildMismatchTokenMessage(e){return vi.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return vi.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return vi.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return vi.buildEarlyExitMessage(e)}}class Oc extends Lc{buildMismatchTokenMessage({expected:e,actual:t}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${t.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}}class bc extends $c{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const t=this.lexer.tokenize(e);return this.tokens=t.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,t){const n=this.wrapper.DEFINE_RULE(Cc(e.name),this.startImplementation(t).bind(this));return e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return t=>{const n=this.keepStackSize();try{e(t)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,t,n){this.wrapper.wrapConsume(e,t),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,t,n,r){this.before(n),this.wrapper.wrapSubrule(e,t,r),this.after(n)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const t=this.elementStack.lastIndexOf(e);t>=0&&this.elementStack.splice(t)}}get currIdx(){return this.wrapper.currIdx}}const _c={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Oc};class Pc extends so{constructor(e,t){const n=t&&"maxLookahead"in t;super(e,Object.assign(Object.assign(Object.assign({},_c),{lookaheadStrategy:n?new Os({maxLookahead:t.maxLookahead}):new bo}),t))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,t){return this.RULE(e,t)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,t){return this.consume(e,t)}wrapSubrule(e,t,n){return this.subrule(e,t,{ARGS:[n]})}wrapOr(e,t){this.or(e,t)}wrapOption(e,t){this.option(e,t)}wrapMany(e,t){this.many(e,t)}wrapAtLeastOne(e,t){this.atLeastOne(e,t)}}function Mc(e,t,n){return function(e,t){const n=lt(t,!1),r=m(t.rules).filter(X).filter((e=>n.has(e)));for(const i of r){const t=Object.assign(Object.assign({},e),{consume:1,optional:1,subrule:1,many:1,or:1});t.rules.set(i.name,e.parser.rule(i,Dc(t,i.definition)))}}({parser:t,tokens:n,rules:new Map,ruleNames:new Map},e),t}function Dc(e,t,n=!1){let r;if(Ae(t))r=function(e,t){const n=e.consume++,r=e.tokens[t.value];if(!r)throw new Error("Could not find token for keyword: "+t.value);return()=>e.parser.consume(n,r,t)}(e,t);else if(oe(t))r=function(e,t){const n=Tt(t);return()=>e.parser.action(n,t)}(e,t);else if(ue(t))r=Dc(e,t.terminal);else if(fe(t))r=Gc(e,t);else if(Ee(t))r=function(e,t){const n=t.rule.ref;if(X(n)){const r=e.subrule++,i=t.arguments.length>0?function(e,t){const n=t.map((e=>Uc(e.value)));return t=>{const r={};for(let i=0;i({});return s=>e.parser.subrule(r,Bc(e,n),t,i(s))}if(te(n)){const r=e.consume++,i=jc(e,n.name);return()=>e.parser.consume(r,i,t)}if(!n)throw new S(t.$cstNode,`Undefined rule type: ${t.$type}`);N()}(e,t);else if(ce(t))r=function(e,t){if(1===t.elements.length)return Dc(e,t.elements[0]);{const n=[];for(const i of t.elements){const t={ALT:Dc(e,i,!0)},r=Fc(i);r&&(t.GATE=Uc(r)),n.push(t)}const r=e.or++;return t=>e.parser.alternatives(r,n.map((e=>{const n={ALT:()=>e.ALT(t)},r=e.GATE;return r&&(n.GATE=()=>r(t)),n})))}}(e,t);else if(Ce(t))r=function(e,t){if(1===t.elements.length)return Dc(e,t.elements[0]);const n=[];for(const a of t.elements){const t={ALT:Dc(e,a,!0)},r=Fc(a);r&&(t.GATE=Uc(r)),n.push(t)}const r=e.or++,i=(e,t)=>`uGroup_${e}_${t.getRuleStack().join("-")}`,s=t=>e.parser.alternatives(r,n.map(((n,s)=>{const o={ALT:()=>!0},a=e.parser;o.ALT=()=>{if(n.ALT(t),!a.isRecording()){const e=i(r,a);a.unorderedGroups.get(e)||a.unorderedGroups.set(e,[]);const t=a.unorderedGroups.get(e);void 0===(null==t?void 0:t[s])&&(t[s]=!0)}};const c=n.GATE;return o.GATE=c?()=>c(t):()=>{const e=a.unorderedGroups.get(i(r,a));return!(null==e?void 0:e[s])},o}))),o=Kc(e,Fc(t),s,"*");return t=>{o(t),e.parser.isRecording()||e.parser.unorderedGroups.delete(i(r,e.parser))}}(e,t);else if(ge(t))r=function(e,t){const n=t.elements.map((t=>Dc(e,t)));return e=>n.forEach((t=>t(e)))}(e,t);else{if(i=t,!Oe.isInstance(i,pe))throw new S(t.$cstNode,`Unexpected element type: ${t.$type}`);{const n=e.consume++;r=()=>e.parser.consume(n,yi,t)}}var i;return Kc(e,n?void 0:Fc(t),r,t.cardinality)}function Uc(e){if(t=e,Oe.isInstance(t,U)){const t=Uc(e.left),n=Uc(e.right);return e=>t(e)||n(e)}if(function(e){return Oe.isInstance(e,D)}(e)){const t=Uc(e.left),n=Uc(e.right);return e=>t(e)&&n(e)}if(function(e){return Oe.isInstance(e,V)}(e)){const t=Uc(e.value);return e=>!t(e)}if(function(e){return Oe.isInstance(e,z)}(e)){const t=e.parameter.ref.name;return e=>void 0!==e&&!0===e[t]}if(function(e){return Oe.isInstance(e,M)}(e)){const t=Boolean(e.true);return()=>t}var t;N()}function Fc(e){if(ge(e))return e.guardCondition}function Gc(e,t,n=t.terminal){if(n){if(Ee(n)&&X(n.rule.ref)){const r=e.subrule++;return i=>e.parser.subrule(r,Bc(e,n.rule.ref),t,i)}if(Ee(n)&&te(n.rule.ref)){const r=e.consume++,i=jc(e,n.rule.ref.name);return()=>e.parser.consume(r,i,t)}if(Ae(n)){const r=e.consume++,i=jc(e,n.value);return()=>e.parser.consume(r,i,t)}throw new Error("Could not build cross reference parser")}{if(!t.type.ref)throw new Error("Could not resolve reference to type: "+t.type.$refText);const n=pt(t.type.ref),r=null==n?void 0:n.terminal;if(!r)throw new Error("Could not find name assignment for type: "+Tt(t.type.ref));return Gc(e,t,r)}}function Kc(e,t,n,r){const i=t&&Uc(t);if(!r){if(i){const t=e.or++;return r=>e.parser.alternatives(t,[{ALT:()=>n(r),GATE:()=>i(r)},{ALT:ro(),GATE:()=>!i(r)}])}return n}if("*"===r){const t=e.many++;return r=>e.parser.many(t,{DEF:()=>n(r),GATE:i?()=>i(r):void 0})}if("+"===r){const t=e.many++;if(i){const r=e.or++;return s=>e.parser.alternatives(r,[{ALT:()=>e.parser.atLeastOne(t,{DEF:()=>n(s)}),GATE:()=>i(s)},{ALT:ro(),GATE:()=>!i(s)}])}return r=>e.parser.atLeastOne(t,{DEF:()=>n(r)})}if("?"===r){const t=e.optional++;return r=>e.parser.optional(t,{DEF:()=>n(r),GATE:i?()=>i(r):void 0})}N()}function Bc(e,t){const n=function(e,t){if(X(t))return t.name;if(e.ruleNames.has(t))return e.ruleNames.get(t);{let n=t,r=n.$container,i=t.$type;for(;!X(r);){if(ge(r)||ce(r)||Ce(r)){i=r.elements.indexOf(n).toString()+":"+i}n=r,r=r.$container}return i=r.name+":"+i,e.ruleNames.set(t,i),i}}(e,t),r=e.rules.get(n);if(!r)throw new Error(`Rule "${n}" not found."`);return r}function jc(e,t){const n=e.tokens[t];if(!n)throw new Error(`Token "${t}" not found."`);return n}function Vc(e){const t=function(e){const t=e.Grammar,n=e.parser.Lexer,r=new wc(e);return Mc(t,r,n.definition)}(e);return t.finalize(),t}class Hc{buildTokens(e,t){const n=m(lt(e,!1)),r=this.buildTerminalTokens(n),i=this.buildKeywordTokens(n,r,t);return r.forEach((e=>{const t=e.PATTERN;"object"==typeof t&&t&&"test"in t&&ot(t)?i.unshift(e):i.push(e)})),i}buildTerminalTokens(e){return e.filter(te).filter((e=>!e.fragment)).map((e=>this.buildTerminalToken(e))).toArray()}buildTerminalToken(e){const t=vt(e),n=this.requiresCustomPattern(t)?this.regexPatternFunction(t):t,r={name:e.name,PATTERN:n,LINE_BREAKS:!0};return e.hidden&&(r.GROUP=ot(t)?ii.SKIPPED:"hidden"),r}requiresCustomPattern(e){return!!e.flags.includes("u")||!(!e.source.includes("?<=")&&!e.source.includes("?{t.lastIndex=n;return t.exec(e)}}buildKeywordTokens(e,t,n){return e.filter(X).flatMap((e=>De(e).filter(Ae))).distinct((e=>e.value)).toArray().sort(((e,t)=>t.value.length-e.value.length)).map((e=>this.buildKeywordToken(e,t,Boolean(null==n?void 0:n.caseInsensitive))))}buildKeywordToken(e,t,n){return{name:e.value,PATTERN:this.buildKeywordPattern(e,n),LONGER_ALT:this.findLongerAlt(e,t)}}buildKeywordPattern(e,t){return t?new RegExp(function(e){return Array.prototype.map.call(e,(e=>/\w/.test(e)?`[${e.toLowerCase()}${e.toUpperCase()}]`:at(e))).join("")}(e.value)):e.value}findLongerAlt(e,t){return t.reduce(((t,n)=>{const r=null==n?void 0:n.PATTERN;return(null==r?void 0:r.source)&&ct("^"+r.source+"$",e.value)&&t.push(n),t}),[])}}class Wc{convert(e,t){let n=t.grammarSource;if(fe(n)&&(n=function(e){if(e.terminal)return e.terminal;if(e.type.ref){const t=pt(e.type.ref);return null==t?void 0:t.terminal}}(n)),Ee(n)){const r=n.rule.ref;if(!r)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(r,e,t)}return e}runConverter(e,t,n){var r;switch(e.name.toUpperCase()){case"INT":return zc.convertInt(t);case"STRING":return zc.convertString(t);case"ID":return zc.convertID(t)}switch(null===(r=function(e){var t,n,r;return te(e)?null!==(n=null===(t=e.type)||void 0===t?void 0:t.name)&&void 0!==n?n:"string":gt(e)?e.name:null!==(r=At(e))&&void 0!==r?r:e.name}(e))||void 0===r?void 0:r.toLowerCase()){case"number":return zc.convertNumber(t);case"boolean":return zc.convertBoolean(t);case"bigint":return zc.convertBigint(t);case"date":return zc.convertDate(t);default:return t}}}var zc;!function(e){function t(e){switch(e){case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";case"v":return"\v";case"0":return"\0";default:return e}}e.convertString=function(e){let n="";for(let r=1;r=qc&&(Xc=t,await new Promise((e=>{"undefined"==typeof setImmediate?setTimeout(e,0):setImmediate(e)}))),e.isCancellationRequested)throw Qc}class el{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=t=>(e(t),this),this.reject=e=>(t(e),this)}))}}class tl{constructor(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){for(const n of e)if(tl.isIncremental(n)){const e=al(n.range),t=this.offsetAt(e.start),r=this.offsetAt(e.end);this._content=this._content.substring(0,t)+n.text+this._content.substring(r,this._content.length);const i=Math.max(e.start.line,0),s=Math.max(e.end.line,0);let o=this._lineOffsets;const a=sl(n.text,!1,t);if(s-i===a.length)for(let n=0,l=a.length;ne?r=i:n=i+1}const i=n-1;return{line:i,character:(e=this.ensureBeforeEOL(e,t[i]))-t[i]}}offsetAt(e){const t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;const n=t[e.line];if(e.character<=0)return n;const r=e.line+1t&&ol(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const t=e;return null!=t&&"string"==typeof t.text&&void 0!==t.range&&(void 0===t.rangeLength||"number"==typeof t.rangeLength)}static isFull(e){const t=e;return null!=t&&"string"==typeof t.text&&void 0===t.range&&void 0===t.rangeLength}}var nl,rl;function il(e,t){if(e.length<=1)return e;const n=e.length/2|0,r=e.slice(0,n),i=e.slice(n);il(r,t),il(i,t);let s=0,o=0,a=0;for(;sn.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}function cl(e){const t=al(e.range);return t!==e.range?{newText:e.newText,range:t}:e}!function(e){e.create=function(e,t,n,r){return new tl(e,t,n,r)},e.update=function(e,t,n){if(e instanceof tl)return e.update(t,n),e;throw new Error("TextDocument.update: document must be created by TextDocument.create")},e.applyEdits=function(e,t){const n=e.getText(),r=il(t.map(cl),((e,t)=>{const n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n}));let i=0;const s=[];for(const o of r){const t=e.offsetAt(o.range.start);if(ti&&s.push(n.substring(i,t)),o.newText.length&&s.push(o.newText),i=e.offsetAt(o.range.end)}return s.push(n.substr(i)),s.join("")}}(nl||(nl={})),(()=>{var e={470:e=>{function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",i=0,s=-1,o=0,a=0;a<=e.length;++a){if(a2){var c=r.lastIndexOf("/");if(c!==r.length-1){-1===c?(r="",i=0):i=(r=r.slice(0,c)).length-1-r.lastIndexOf("/"),s=a,o=0;continue}}else if(2===r.length||1===r.length){r="",i=0,s=a,o=0;continue}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(s+1,a):r=e.slice(s+1,a),i=a-s-1;s=a,o=0}else 46===n&&-1!==o?++o:o=-1}return r}var r={resolve:function(){for(var e,r="",i=!1,s=arguments.length-1;s>=-1&&!i;s--){var o;s>=0?o=arguments[s]:(void 0===e&&(e=process.cwd()),o=e),t(o),0!==o.length&&(r=o+"/"+r,i=47===o.charCodeAt(0))}return r=n(r,!i),i?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var i=1;il){if(47===n.charCodeAt(a+d))return n.slice(a+d+1);if(0===d)return n.slice(a+d)}else o>l&&(47===e.charCodeAt(i+d)?u=d:0===d&&(u=0));break}var h=e.charCodeAt(i+d);if(h!==n.charCodeAt(a+d))break;47===h&&(u=d)}var f="";for(d=i+u+1;d<=s;++d)d!==s&&47!==e.charCodeAt(d)||(0===f.length?f+="..":f+="/..");return f.length>0?f+n.slice(a+u):(a+=u,47===n.charCodeAt(a)&&++a,n.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,i=-1,s=!0,o=e.length-1;o>=1;--o)if(47===(n=e.charCodeAt(o))){if(!s){i=o;break}}else s=!1;return-1===i?r?"/":".":r&&1===i?"//":e.slice(0,i)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,i=0,s=-1,o=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var a=n.length-1,c=-1;for(r=e.length-1;r>=0;--r){var l=e.charCodeAt(r);if(47===l){if(!o){i=r+1;break}}else-1===c&&(o=!1,c=r+1),a>=0&&(l===n.charCodeAt(a)?-1==--a&&(s=r):(a=-1,s=c))}return i===s?s=c:-1===s&&(s=e.length),e.slice(i,s)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!o){i=r+1;break}}else-1===s&&(o=!1,s=r+1);return-1===s?"":e.slice(i,s)},extname:function(e){t(e);for(var n=-1,r=0,i=-1,s=!0,o=0,a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(47!==c)-1===i&&(s=!1,i=a+1),46===c?-1===n?n=a:1!==o&&(o=1):-1!==n&&(o=-1);else if(!s){r=a+1;break}}return-1===n||-1===i||0===o||1===o&&n===i-1&&n===r+1?"":e.slice(n,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,i=e.charCodeAt(0),s=47===i;s?(n.root="/",r=1):r=0;for(var o=-1,a=0,c=-1,l=!0,u=e.length-1,d=0;u>=r;--u)if(47!==(i=e.charCodeAt(u)))-1===c&&(l=!1,c=u+1),46===i?-1===o?o=u:1!==d&&(d=1):-1!==o&&(d=-1);else if(!l){a=u+1;break}return-1===o||-1===c||0===d||1===d&&o===c-1&&o===a+1?-1!==c&&(n.base=n.name=0===a&&s?e.slice(1,c):e.slice(a,c)):(0===a&&s?(n.name=e.slice(1,o),n.base=e.slice(1,c)):(n.name=e.slice(a,o),n.base=e.slice(a,c)),n.ext=e.slice(o,c)),a>0?n.dir=e.slice(0,a-1):s&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{let e;if(n.r(r),n.d(r,{URI:()=>u,Utils:()=>x}),"object"==typeof process)e="win32"===process.platform;else if("object"==typeof navigator){let t=navigator.userAgent;e=t.indexOf("Windows")>=0}const t=/^\w[\w\d+.-]*$/,i=/^\//,s=/^\/\//;function o(e,n){if(!e.scheme&&n)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!t.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!i.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(s.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}const a="",c="/",l=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class u{static isUri(e){return e instanceof u||!!e&&"string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"string"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString}scheme;authority;path;query;fragment;constructor(e,t,n,r,i,s=!1){"object"==typeof e?(this.scheme=e.scheme||a,this.authority=e.authority||a,this.path=e.path||a,this.query=e.query||a,this.fragment=e.fragment||a):(this.scheme=function(e,t){return e||t?e:"file"}(e,s),this.authority=t||a,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==c&&(t=c+t):t=c}return t}(this.scheme,n||a),this.query=r||a,this.fragment=i||a,o(this,s))}get fsPath(){return g(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:n,path:r,query:i,fragment:s}=e;return void 0===t?t=this.scheme:null===t&&(t=a),void 0===n?n=this.authority:null===n&&(n=a),void 0===r?r=this.path:null===r&&(r=a),void 0===i?i=this.query:null===i&&(i=a),void 0===s?s=this.fragment:null===s&&(s=a),t===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&s===this.fragment?this:new h(t,n,r,i,s)}static parse(e,t=!1){const n=l.exec(e);return n?new h(n[2]||a,v(n[4]||a),v(n[5]||a),v(n[7]||a),v(n[9]||a),t):new h(a,a,a,a,a)}static file(t){let n=a;if(e&&(t=t.replace(/\\/g,c)),t[0]===c&&t[1]===c){const e=t.indexOf(c,2);-1===e?(n=t.substring(2),t=c):(n=t.substring(2,e),t=t.substring(e)||c)}return new h("file",n,t,a,a)}static from(e){const t=new h(e.scheme,e.authority,e.path,e.query,e.fragment);return o(t,!0),t}toString(e=!1){return y(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof u)return e;{const t=new h(e);return t._formatted=e.external,t._fsPath=e._sep===d?e.fsPath:null,t}}return e}}const d=e?1:void 0;class h extends u{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=g(this,!1)),this._fsPath}toString(e=!1){return e?y(this,!0):(this._formatted||(this._formatted=y(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=d),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}}const f={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function p(e,t,n){let r,i=-1;for(let s=0;s=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||45===o||46===o||95===o||126===o||t&&47===o||n&&91===o||n&&93===o||n&&58===o)-1!==i&&(r+=encodeURIComponent(e.substring(i,s)),i=-1),void 0!==r&&(r+=e.charAt(s));else{void 0===r&&(r=e.substr(0,s));const t=f[o];void 0!==t?(-1!==i&&(r+=encodeURIComponent(e.substring(i,s)),i=-1),r+=t):-1===i&&(i=s)}}return-1!==i&&(r+=encodeURIComponent(e.substring(i))),void 0!==r?r:e}function m(e){let t;for(let n=0;n1&&"file"===t.scheme?`//${t.authority}${t.path}`:47===t.path.charCodeAt(0)&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&58===t.path.charCodeAt(2)?n?t.path.substr(1):t.path[1].toLowerCase()+t.path.substr(2):t.path,e&&(r=r.replace(/\//g,"\\")),r}function y(e,t){const n=t?m:p;let r="",{scheme:i,authority:s,path:o,query:a,fragment:l}=e;if(i&&(r+=i,r+=":"),(s||"file"===i)&&(r+=c,r+=c),s){let e=s.indexOf("@");if(-1!==e){const t=s.substr(0,e);s=s.substr(e+1),e=t.lastIndexOf(":"),-1===e?r+=n(t,!1,!1):(r+=n(t.substr(0,e),!1,!1),r+=":",r+=n(t.substr(e+1),!1,!0)),r+="@"}s=s.toLowerCase(),e=s.lastIndexOf(":"),-1===e?r+=n(s,!1,!0):(r+=n(s.substr(0,e),!1,!0),r+=s.substr(e))}if(o){if(o.length>=3&&47===o.charCodeAt(0)&&58===o.charCodeAt(2)){const e=o.charCodeAt(1);e>=65&&e<=90&&(o=`/${String.fromCharCode(e+32)}:${o.substr(3)}`)}else if(o.length>=2&&58===o.charCodeAt(1)){const e=o.charCodeAt(0);e>=65&&e<=90&&(o=`${String.fromCharCode(e+32)}:${o.substr(2)}`)}r+=n(o,!0,!1)}return a&&(r+="?",r+=n(a,!1,!1)),l&&(r+="#",r+=t?l:p(l,!1,!1)),r}function A(e){try{return decodeURIComponent(e)}catch{return e.length>3?e.substr(0,3)+A(e.substr(3)):e}}const T=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function v(e){return e.match(T)?e.replace(T,(e=>A(e))):e}var R=n(470);const E=R.posix||R,k="/";var x;!function(e){e.joinPath=function(e,...t){return e.with({path:E.join(e.path,...t)})},e.resolvePath=function(e,...t){let n=e.path,r=!1;n[0]!==k&&(n=k+n,r=!0);let i=E.resolve(n,...t);return r&&i[0]===k&&!e.authority&&(i=i.substring(1)),e.with({path:i})},e.dirname=function(e){if(0===e.path.length||e.path===k)return e;let t=E.dirname(e.path);return 1===t.length&&46===t.charCodeAt(0)&&(t=""),e.with({path:t})},e.basename=function(e){return E.basename(e.path)},e.extname=function(e){return E.extname(e.path)}}(x||(x={}))})(),rl=r})();const{URI:ll,Utils:ul}=rl;var dl,hl;!function(e){e.basename=ul.basename,e.dirname=ul.dirname,e.extname=ul.extname,e.joinPath=ul.joinPath,e.resolvePath=ul.resolvePath,e.equals=function(e,t){return(null==e?void 0:e.toString())===(null==t?void 0:t.toString())},e.relative=function(e,t){const n="string"==typeof e?e:e.path,r="string"==typeof t?t:t.path,i=n.split("/").filter((e=>e.length>0)),s=r.split("/").filter((e=>e.length>0));let o=0;for(;onull!=r?r:r=nl.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,null!=t?t:"")}}class pl{constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory}get all(){return m(this.documentMap.values())}addDocument(e){const t=e.uri.toString();if(this.documentMap.has(t))throw new Error(`A document with the URI '${t}' is already present.`);this.documentMap.set(t,e)}getDocument(e){const t=e.toString();return this.documentMap.get(t)}async getOrCreateDocument(e,t){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,t),this.addDocument(n),n)}createDocument(e,t,n){if(n)return this.langiumDocumentFactory.fromString(t,e,n).then((e=>(this.addDocument(e),e)));{const n=this.langiumDocumentFactory.fromString(t,e);return this.addDocument(n),n}}hasDocument(e){return this.documentMap.has(e.toString())}invalidateDocument(e){const t=e.toString(),n=this.documentMap.get(t);return n&&(n.state=hl.Changed,n.precomputedScopes=void 0,n.references=[],n.diagnostics=void 0),n}deleteDocument(e){const t=e.toString(),n=this.documentMap.get(t);return n&&(n.state=hl.Changed,this.documentMap.delete(t)),n}}class ml{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator}async link(e,t=Yc.XO.None){for(const n of Ue(e.parseResult.value))await Zc(t),Ge(n).forEach((t=>this.doLink(t,e)))}doLink(e,t){const n=e.reference;if(void 0===n._ref)try{const t=this.getCandidate(e);if(s(t))n._ref=t;else if(n._nodeDescription=t,this.langiumDocuments().hasDocument(t.documentUri)){const r=this.loadAstNode(t);n._ref=null!=r?r:this.createLinkingError(e,t)}}catch(r){n._ref=Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${n.$refText}': ${r}`})}t.references.push(n)}unlink(e){for(const t of e.references)delete t._ref,delete t._nodeDescription;e.references=[]}getCandidate(e){const t=this.scopeProvider.getScope(e).getElement(e.reference.$refText);return null!=t?t:this.createLinkingError(e)}buildReference(e,t,n,i){const o=this,a={$refNode:n,$refText:i,get ref(){var n,i;if(r(this._ref))return this._ref;if("object"==typeof(i=this._nodeDescription)&&null!==i&&"string"==typeof i.name&&"string"==typeof i.type&&"string"==typeof i.path){const n=o.loadAstNode(this._nodeDescription);this._ref=null!=n?n:o.createLinkingError({reference:a,container:e,property:t},this._nodeDescription)}else if(void 0===this._ref){const r=o.getLinkedNode({reference:a,container:e,property:t});if(r.error&&Pe(e).state=e.end)return t.ref}if(n){const t=this.nameProvider.getNameNode(n);if(t&&(t===e||function(e,t){for(;e.container;)if((e=e.container)===t)return!0;return!1}(e,t)))return n}}}findDeclarationNode(e){const t=this.findDeclaration(e);if(null==t?void 0:t.$cstNode){const e=this.nameProvider.getNameNode(t);return null!=e?e:t.$cstNode}}findReferences(e,t){const n=[];if(t.includeDeclaration){const t=this.getReferenceToSelf(e);t&&n.push(t)}let r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return t.documentUri&&(r=r.filter((e=>dl.equals(e.sourceUri,t.documentUri)))),n.push(...r),m(n)}getReferenceToSelf(e){const t=this.nameProvider.getNameNode(e);if(t){const n=Pe(e),r=this.nodeLocator.getAstNodePath(e);return{sourceUri:n.uri,sourcePath:r,targetUri:n.uri,targetPath:r,segment:R(t),local:!0}}}}class Al{constructor(e){if(this.map=new Map,e)for(const[t,n]of e)this.add(t,n)}get size(){return y.sum(m(this.map.values()).map((e=>e.length)))}clear(){this.map.clear()}delete(e,t){if(void 0===t)return this.map.delete(e);{const n=this.map.get(e);if(n){const r=n.indexOf(t);if(r>=0)return 1===n.length?this.map.delete(e):n.splice(r,1),!0}return!1}}get(e){var t;return null!==(t=this.map.get(e))&&void 0!==t?t:[]}has(e,t){if(void 0===t)return this.map.has(e);{const n=this.map.get(e);return!!n&&n.indexOf(t)>=0}}add(e,t){return this.map.has(e)?this.map.get(e).push(t):this.map.set(e,[t]),this}addAll(e,t){return this.map.has(e)?this.map.get(e).push(...t):this.map.set(e,Array.from(t)),this}forEach(e){this.map.forEach(((t,n)=>t.forEach((t=>e(t,n,this)))))}[Symbol.iterator](){return this.entries().iterator()}entries(){return m(this.map.entries()).flatMap((([e,t])=>t.map((t=>[e,t]))))}keys(){return m(this.map.keys())}values(){return m(this.map.values()).flat()}entriesGroupedByKey(){return m(this.map.entries())}}class Tl{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[t,n]of e)this.set(t,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,t){return this.map.set(e,t),this.inverse.set(t,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const t=this.map.get(e);return void 0!==t&&(this.map.delete(e),this.inverse.delete(t),!0)}}class vl{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,t=Yc.XO.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,t)}async computeExportsForNode(e,t,n=Me,r=Yc.XO.None){const i=[];this.exportNode(e,i,t);for(const s of n(e))await Zc(r),this.exportNode(s,i,t);return i}exportNode(e,t,n){const r=this.nameProvider.getName(e);r&&t.push(this.descriptions.createDescription(e,r,n))}async computeLocalScopes(e,t=Yc.XO.None){const n=e.parseResult.value,r=new Al;for(const i of De(n))await Zc(t),this.processNode(i,e,r);return r}processNode(e,t,n){const r=e.$container;if(r){const i=this.nameProvider.getName(e);i&&n.add(r,this.descriptions.createDescription(e,i,t))}}}class Rl{constructor(e,t,n){var r;this.elements=e,this.outerScope=t,this.caseInsensitive=null!==(r=null==n?void 0:n.caseInsensitive)&&void 0!==r&&r}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const t=this.caseInsensitive?this.elements.find((t=>t.name.toLowerCase()===e.toLowerCase())):this.elements.find((t=>t.name===e));return t||(this.outerScope?this.outerScope.getElement(e):void 0)}}class El{constructor(e,t,n){var r;this.elements=new Map,this.caseInsensitive=null!==(r=null==n?void 0:n.caseInsensitive)&&void 0!==r&&r;for(const i of e){const e=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.set(e,i)}this.outerScope=t}getElement(e){const t=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(t);return n||(this.outerScope?this.outerScope.getElement(e):void 0)}getAllElements(){let e=m(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}class kl{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach((e=>e.dispose()))}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}}class xl extends kl{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,t){this.throwIfDisposed(),this.cache.set(e,t)}get(e,t){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(t){const n=t();return this.cache.set(e,n),n}}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}}class Il extends kl{constructor(e){super(),this.cache=new Map,this.converter=null!=e?e:e=>e}has(e,t){return this.throwIfDisposed(),this.cacheForContext(e).has(t)}set(e,t,n){this.throwIfDisposed(),this.cacheForContext(e).set(t,n)}get(e,t,n){this.throwIfDisposed();const r=this.cacheForContext(e);if(r.has(t))return r.get(t);if(n){const e=n();return r.set(t,e),e}}delete(e,t){return this.throwIfDisposed(),this.cacheForContext(e).delete(t)}clear(e){if(this.throwIfDisposed(),e){const t=this.converter(e);this.cache.delete(t)}else this.cache.clear()}cacheForContext(e){const t=this.converter(e);let n=this.cache.get(t);return n||(n=new Map,this.cache.set(t,n)),n}}class Sl extends xl{constructor(e){super(),this.onDispose(e.workspace.DocumentBuilder.onUpdate((()=>{this.clear()})))}}class Nl{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new Sl(e.shared)}getScope(e){const t=[],n=this.reflection.getReferenceType(e),r=Pe(e.container).precomputedScopes;if(r){let i=e.container;do{const e=r.get(i);e.length>0&&t.push(m(e).filter((e=>this.reflection.isSubtype(e.type,n)))),i=i.$container}while(i)}let i=this.getGlobalScope(n,e);for(let s=t.length-1;s>=0;s--)i=this.createScope(t[s],i);return i}createScope(e,t,n){return new Rl(m(e),t,n)}createScopeForNodes(e,t,n){const r=m(e).map((e=>{const t=this.nameProvider.getName(e);if(t)return this.descriptions.createDescription(e,t)})).nonNullable();return new Rl(r,t,n)}getGlobalScope(e,t){return this.globalScopeCache.get(e,(()=>new El(this.indexManager.allElements(e))))}}function Cl(e){return"object"==typeof e&&!!e&&("$ref"in e||"$error"in e)}class $l{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,t={}){const n=null==t?void 0:t.replacer,r=(e,n)=>this.replacer(e,n,t),i=n?(e,t)=>n(e,t,r):r;try{return this.currentDocument=Pe(e),JSON.stringify(e,i,null==t?void 0:t.space)}finally{this.currentDocument=void 0}}deserialize(e,t={}){const n=JSON.parse(e);return this.linkNode(n,n,t),n}replacer(e,t,{refText:n,sourceText:s,textRegions:o,comments:a,uriConverter:c}){var l,u,d,h;if(!this.ignoreProperties.has(e)){if(i(t)){const e=t.ref,r=n?t.$refText:void 0;if(e){const n=Pe(e);let i="";this.currentDocument&&this.currentDocument!==n&&(i=c?c(n.uri,t):n.uri.toString());return{$ref:`${i}#${this.astNodeLocator.getAstNodePath(e)}`,$refText:r}}return{$error:null!==(u=null===(l=t.error)||void 0===l?void 0:l.message)&&void 0!==u?u:"Could not resolve reference",$refText:r}}if(r(t)){let n;if(o&&(n=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},t)),e&&!t.$document||!(null==n?void 0:n.$textRegion)||(n.$textRegion.documentURI=null===(d=this.currentDocument)||void 0===d?void 0:d.uri.toString())),s&&!e&&(null!=n||(n=Object.assign({},t)),n.$sourceText=null===(h=t.$cstNode)||void 0===h?void 0:h.text),a){null!=n||(n=Object.assign({},t));const e=this.commentProvider.getComment(t);e&&(n.$comment=e.replace(/\r/g,""))}return null!=n?n:t}return t}}addAstNodeRegionWithAssignmentsTo(e){const t=e=>({offset:e.offset,end:e.end,length:e.length,range:e.range});if(e.$cstNode){const n=(e.$textRegion=t(e.$cstNode)).assignments={};return Object.keys(e).filter((e=>!e.startsWith("$"))).forEach((r=>{const i=function(e,t){return e&&t?ht(e,t,e.astNode,!0):[]}(e.$cstNode,r).map(t);0!==i.length&&(n[r]=i)})),e}}linkNode(e,t,n,i,s,o){for(const[c,l]of Object.entries(e))if(Array.isArray(l))for(let i=0;i{try{await e.call(t,n,r,i)}catch(s){if(Jc(s))throw s;console.error("An error occurred during validation:",s);const e=s instanceof Error?s.message:String(s);s instanceof Error&&s.stack&&console.error(s.stack),r("error","An error occurred during validation: "+e,{node:n})}}}addEntry(e,t){if("AstNode"!==e)for(const n of this.reflection.getAllSubTypes(e))this.entries.add(n,t);else this.entries.add("AstNode",t)}getChecks(e,t){let n=m(this.entries.get(e)).concat(this.entries.get("AstNode"));return t&&(n=n.filter((e=>t.includes(e.category)))),n.map((e=>e.check))}}class Ml{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,t={},n=Yc.XO.None){const r=e.parseResult,i=[];if(await Zc(n),!t.categories||t.categories.includes("built-in")){if(this.processLexingErrors(r,i,t),t.stopAfterLexingErrors&&i.some((e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.code)===bl.LexingError})))return i;if(this.processParsingErrors(r,i,t),t.stopAfterParsingErrors&&i.some((e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.code)===bl.ParsingError})))return i;if(this.processLinkingErrors(e,i,t),t.stopAfterLinkingErrors&&i.some((e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.code)===bl.LinkingError})))return i}try{i.push(...await this.validateAst(r.value,t,n))}catch(s){if(Jc(s))throw s;console.error("An error occurred during validation:",s)}return await Zc(n),i}processLexingErrors(e,t,n){for(const r of e.lexerErrors){const e={severity:Ul("error"),range:{start:{line:r.line-1,character:r.column-1},end:{line:r.line-1,character:r.column+r.length-1}},message:r.message,data:Ll(bl.LexingError),source:this.getSource()};t.push(e)}}processParsingErrors(e,t,n){for(const r of e.parserErrors){let e;if(isNaN(r.token.startOffset)){if("previousToken"in r){const t=r.previousToken;if(isNaN(t.startOffset)){const t={line:0,character:0};e={start:t,end:t}}else{const n={line:t.endLine-1,character:t.endColumn};e={start:n,end:n}}}}else e=v(r.token);if(e){const n={severity:Ul("error"),range:e,message:r.message,data:Ll(bl.ParsingError),source:this.getSource()};t.push(n)}}}processLinkingErrors(e,t,n){for(const r of e.references){const e=r.error;if(e){const n={node:e.container,property:e.property,index:e.index,data:{code:bl.LinkingError,containerType:e.container.$type,property:e.property,refText:e.reference.$refText}};t.push(this.toDiagnostic("error",e.message,n))}}}async validateAst(e,t,n=Yc.XO.None){const r=[],i=(e,t,n)=>{r.push(this.toDiagnostic(e,t,n))};return await Promise.all(Ue(e).map((async e=>{await Zc(n);const r=this.validationRegistry.getChecks(e.$type,t.categories);for(const t of r)await t(e,i,n)}))),r}toDiagnostic(e,t,n){return{message:t,range:Dl(n),severity:Ul(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}}function Dl(e){if(e.range)return e.range;let t;return"string"==typeof e.property?t=dt(e.node.$cstNode,e.property,e.index):"string"==typeof e.keyword&&(t=function(e,t,n){if(!e)return;const r=ft(e,t,null==e?void 0:e.astNode);return 0!==r.length?r[n=void 0!==n?Math.max(0,Math.min(n,r.length-1)):0]:void 0}(e.node.$cstNode,e.keyword,e.index)),null!=t||(t=e.node.$cstNode),t?t.range:{start:{line:0,character:0},end:{line:0,character:0}}}function Ul(e){switch(e){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+e)}}!function(e){e.LexingError="lexing-error",e.ParsingError="parsing-error",e.LinkingError="linking-error"}(bl||(bl={}));class Fl{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,t,n=Pe(e)){null!=t||(t=this.nameProvider.getName(e));const r=this.astNodeLocator.getAstNodePath(e);if(!t)throw new Error(`Node at path ${r} has no name.`);let i;const s=()=>{var t;return null!=i?i:i=R(null!==(t=this.nameProvider.getNameNode(e))&&void 0!==t?t:e.$cstNode)};return{node:e,name:t,get nameSegment(){return s()},selectionSegment:R(e.$cstNode),type:e.$type,documentUri:n.uri,path:r}}}class Gl{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,t=Yc.XO.None){const n=[],r=e.parseResult.value;for(const i of Ue(r))await Zc(t),Ge(i).filter((e=>!s(e))).forEach((e=>{const t=this.createDescription(e);t&&n.push(t)}));return n}createDescription(e){const t=e.reference.$nodeDescription,n=e.reference.$refNode;if(!t||!n)return;const r=Pe(e.container).uri;return{sourceUri:r,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:t.documentUri,targetPath:t.path,segment:R(n),local:dl.equals(t.documentUri,r)}}}class Kl{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const t=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return t+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:t}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return void 0!==t?e+this.indexSeparator+t:e}getAstNode(e,t){return t.split(this.segmentSeparator).reduce(((e,t)=>{if(!e||0===t.length)return e;const n=t.indexOf(this.indexSeparator);if(n>0){const r=t.substring(0,n),i=parseInt(t.substring(n+1)),s=e[r];return null==s?void 0:s[i]}return e[t]}),e)}}class Bl{constructor(e){this._ready=new el,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var t,n;this.workspaceConfig=null!==(n=null===(t=e.capabilities.workspace)||void 0===t?void 0:t.configuration)&&void 0!==n&&n}async initialized(e){if(this.workspaceConfig){if(e.register){const t=this.serviceRegistry.all;e.register({section:t.map((e=>this.toSectionName(e.LanguageMetaData.languageId)))})}if(e.fetchConfiguration){const t=this.serviceRegistry.all.map((e=>({section:this.toSectionName(e.LanguageMetaData.languageId)}))),n=await e.fetchConfiguration(t);t.forEach(((e,t)=>{this.updateSectionConfiguration(e.section,n[t])}))}}this._ready.resolve()}updateConfiguration(e){e.settings&&Object.keys(e.settings).forEach((t=>{this.updateSectionConfiguration(t,e.settings[t])}))}updateSectionConfiguration(e,t){this.settings[e]=t}async getConfiguration(e,t){await this.ready;const n=this.toSectionName(e);if(this.settings[n])return this.settings[n][t]}toSectionName(e){return`${e}`}}!function(e){e.create=function(e){return{dispose:async()=>await e()}}}(_l||(_l={}));class jl{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Al,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=hl.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.indexManager=e.workspace.IndexManager,this.serviceRegistry=e.ServiceRegistry}async build(e,t={},n=Yc.XO.None){var r,i;for(const s of e){const e=s.uri.toString();if(s.state===hl.Validated){if("boolean"==typeof t.validation&&t.validation)s.state=hl.IndexedReferences,s.diagnostics=void 0,this.buildState.delete(e);else if("object"==typeof t.validation){const n=this.buildState.get(e),o=null===(r=null==n?void 0:n.result)||void 0===r?void 0:r.validationChecks;if(o){const r=(null!==(i=t.validation.categories)&&void 0!==i?i:Ol.all).filter((e=>!o.includes(e)));r.length>0&&(this.buildState.set(e,{completed:!1,options:{validation:Object.assign(Object.assign({},t.validation),{categories:r})},result:n.result}),s.state=hl.IndexedReferences)}}}else this.buildState.delete(e)}this.currentState=hl.Changed,await this.emitUpdate(e.map((e=>e.uri)),[]),await this.buildDocuments(e,t,n)}async update(e,t,n=Yc.XO.None){this.currentState=hl.Changed;for(const s of t)this.langiumDocuments.deleteDocument(s),this.buildState.delete(s.toString()),this.indexManager.remove(s);for(const s of e){if(!this.langiumDocuments.invalidateDocument(s)){const e=this.langiumDocumentFactory.fromModel({$type:"INVALID"},s);e.state=hl.Changed,this.langiumDocuments.addDocument(e)}this.buildState.delete(s.toString())}const r=m(e).concat(t).map((e=>e.toString())).toSet();this.langiumDocuments.all.filter((e=>!r.has(e.uri.toString())&&this.shouldRelink(e,r))).forEach((e=>{this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e),e.state=Math.min(e.state,hl.ComputedScopes),e.diagnostics=void 0})),await this.emitUpdate(e,t),await Zc(n);const i=this.langiumDocuments.all.filter((e=>{var t;return e.staten(e,t))))}shouldRelink(e,t){return!!e.references.some((e=>void 0!==e.error))||this.indexManager.isAffected(e,t)}onUpdate(e){return this.updateListeners.push(e),_l.create((()=>{const t=this.updateListeners.indexOf(e);t>=0&&this.updateListeners.splice(t,1)}))}async buildDocuments(e,t,n){this.prepareBuild(e,t),await this.runCancelable(e,hl.Parsed,n,(e=>this.langiumDocumentFactory.update(e,n))),await this.runCancelable(e,hl.IndexedContent,n,(e=>this.indexManager.updateContent(e,n))),await this.runCancelable(e,hl.ComputedScopes,n,(async e=>{const t=this.serviceRegistry.getServices(e.uri).references.ScopeComputation;e.precomputedScopes=await t.computeLocalScopes(e,n)})),await this.runCancelable(e,hl.Linked,n,(e=>this.serviceRegistry.getServices(e.uri).references.Linker.link(e,n))),await this.runCancelable(e,hl.IndexedReferences,n,(e=>this.indexManager.updateReferences(e,n)));const r=e.filter((e=>this.shouldValidate(e)));await this.runCancelable(r,hl.Validated,n,(e=>this.validate(e,n)));for(const i of e){const e=this.buildState.get(i.uri.toString());e&&(e.completed=!0)}}prepareBuild(e,t){for(const n of e){const e=n.uri.toString(),r=this.buildState.get(e);r&&!r.completed||this.buildState.set(e,{completed:!1,options:t,result:null==r?void 0:r.result})}}async runCancelable(e,t,n,r){const i=e.filter((e=>e.state{this.buildPhaseListeners.delete(e,t)}))}waitUntil(e,t,n){let r;if(t&&"path"in t?r=t:n=t,null!=n||(n=Yc.XO.None),r){const t=this.langiumDocuments.getDocument(r);if(t&&t.state>e)return Promise.resolve(r)}return this.currentState>=e?Promise.resolve(void 0):n.isCancellationRequested?Promise.reject(Qc):new Promise(((t,i)=>{const s=this.onBuildPhase(e,(()=>{if(s.dispose(),o.dispose(),r){const e=this.langiumDocuments.getDocument(r);t(null==e?void 0:e.uri)}else t(void 0)})),o=n.onCancellationRequested((()=>{s.dispose(),o.dispose(),i(Qc)}))}))}async notifyBuildPhase(e,t,n){if(0===e.length)return;const r=this.buildPhaseListeners.get(t);for(const i of r)await Zc(n),await i(e,n)}shouldValidate(e){return Boolean(this.getBuildOptions(e).validation)}async validate(e,t){var n,r;const i=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,s=this.getBuildOptions(e).validation,o="object"==typeof s?s:void 0,a=await i.validateDocument(e,o,t);e.diagnostics?e.diagnostics.push(...a):e.diagnostics=a;const c=this.buildState.get(e.uri.toString());if(c){null!==(n=c.result)&&void 0!==n||(c.result={});const e=null!==(r=null==o?void 0:o.categories)&&void 0!==r?r:Ol.all;c.result.validationChecks?c.result.validationChecks.push(...e):c.result.validationChecks=[...e]}}getBuildOptions(e){var t,n;return null!==(n=null===(t=this.buildState.get(e.uri.toString()))||void 0===t?void 0:t.options)&&void 0!==n?n:{}}}class Vl{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new Il,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,t){const n=Pe(e).uri,r=[];return this.referenceIndex.forEach((e=>{e.forEach((e=>{dl.equals(e.targetUri,n)&&e.targetPath===t&&r.push(e)}))})),m(r)}allElements(e,t){let n=m(this.symbolIndex.keys());return t&&(n=n.filter((e=>!t||t.has(e)))),n.map((t=>this.getFileDescriptions(t,e))).flat()}getFileDescriptions(e,t){var n;if(!t)return null!==(n=this.symbolIndex.get(e))&&void 0!==n?n:[];const r=this.symbolByTypeIndex.get(e,t,(()=>{var n;return(null!==(n=this.symbolIndex.get(e))&&void 0!==n?n:[]).filter((e=>this.astReflection.isSubtype(e.type,t)))}));return r}remove(e){const t=e.toString();this.symbolIndex.delete(t),this.symbolByTypeIndex.clear(t),this.referenceIndex.delete(t)}async updateContent(e,t=Yc.XO.None){const n=this.serviceRegistry.getServices(e.uri),r=await n.references.ScopeComputation.computeExports(e,t),i=e.uri.toString();this.symbolIndex.set(i,r),this.symbolByTypeIndex.clear(i)}async updateReferences(e,t=Yc.XO.None){const n=this.serviceRegistry.getServices(e.uri),r=await n.workspace.ReferenceDescriptionProvider.createDescriptions(e,t);this.referenceIndex.set(e.uri.toString(),r)}isAffected(e,t){const n=this.referenceIndex.get(e.uri.toString());return!!n&&n.some((e=>!e.local&&t.has(e.targetUri.toString())))}}class Hl{constructor(e){this.initialBuildOptions={},this._ready=new el,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}initialize(e){var t;this.folders=null!==(t=e.workspaceFolders)&&void 0!==t?t:void 0}initialized(e){return this.mutex.write((e=>{var t;return this.initializeWorkspace(null!==(t=this.folders)&&void 0!==t?t:[],e)}))}async initializeWorkspace(e,t=Yc.XO.None){const n=await this.performStartup(e);await Zc(t),await this.documentBuilder.build(n,this.initialBuildOptions,t)}async performStartup(e){const t=this.serviceRegistry.all.flatMap((e=>e.LanguageMetaData.fileExtensions)),n=[],r=e=>{n.push(e),this.langiumDocuments.hasDocument(e.uri)||this.langiumDocuments.addDocument(e)};return await this.loadAdditionalDocuments(e,r),await Promise.all(e.map((e=>[e,this.getRootFolder(e)])).map((async e=>this.traverseFolder(...e,t,r)))),this._ready.resolve(),n}loadAdditionalDocuments(e,t){return Promise.resolve()}getRootFolder(e){return ll.parse(e.uri)}async traverseFolder(e,t,n,r){const i=await this.fileSystemProvider.readDirectory(t);await Promise.all(i.map((async t=>{if(this.includeEntry(e,t,n))if(t.isDirectory)await this.traverseFolder(e,t.uri,n,r);else if(t.isFile){const e=await this.langiumDocuments.getOrCreateDocument(t.uri);r(e)}})))}includeEntry(e,t,n){const r=dl.basename(t.uri);if(r.startsWith("."))return!1;if(t.isDirectory)return"node_modules"!==r&&"out"!==r;if(t.isFile){const e=dl.extname(t.uri);return n.includes(e)}return!1}}class Wl{constructor(e){const t=e.parser.TokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(t);const n=Yl(t)?Object.values(t):t;this.chevrotainLexer=new ii(n,{positionTracking:"full"})}get definition(){return this.tokenTypes}tokenize(e){var t;const n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:null!==(t=n.groups.hidden)&&void 0!==t?t:[]}}toTokenTypeDictionary(e){if(Yl(e))return e;const t=zl(e)?Object.values(e.modes).flat():e,n={};return t.forEach((e=>n[e.name]=e)),n}}function zl(e){return e&&"modes"in e&&"defaultMode"in e}function Yl(e){return!function(e){return Array.isArray(e)&&(0===e.length||"name"in e[0])}(e)&&!zl(e)}function Xl(e,t,n){let r,i;"string"==typeof e?(i=t,r=n):(i=e.range.start,r=t),i||(i=Qo.create(0,0));const s=function(e){var t,n,r;const i=[];let s=e.position.line,o=e.position.character;for(let a=0;a=u.length){if(i.length>0){const e=Qo.create(s,o);i.push({type:"break",content:"",range:Jo.create(e,e)})}}else{Ql.lastIndex=d;const e=Ql.exec(u);if(e){const t=e[0],n=e[1],r=Qo.create(s,o+d),a=Qo.create(s,o+d+t.length);i.push({type:"tag",content:n,range:Jo.create(r,a)}),d+=t.length,d=nu(u,d)}if(d0&&"break"===i[i.length-1].type)return i.slice(0,-1);return i}({lines:ql(e),position:i,options:lu(r)});return function(e){var t,n,r,i;const s=Qo.create(e.position.line,e.position.character);if(0===e.tokens.length)return new du([],Jo.create(s,s));const o=[];for(;e.index0&&i.push({type:"text",content:t.substring(s,e),range:Jo.create(Qo.create(n,s+r),Qo.create(n,e+r))});let c=o.length+1;const l=a[1];if(i.push({type:"inline-tag",content:l,range:Jo.create(Qo.create(n,s+c+r),Qo.create(n,s+c+l.length+r))}),c+=l.length,4===a.length){c+=a[2].length;const e=a[3];i.push({type:"text",content:e,range:Jo.create(Qo.create(n,s+c+r),Qo.create(n,s+c+e.length+r))})}else i.push({type:"text",content:"",range:Jo.create(Qo.create(n,s+c+r),Qo.create(n,s+c+r))});s=e+a[0].length}const o=t.substring(s);o.length>0&&i.push({type:"text",content:o,range:Jo.create(Qo.create(n,s+r),Qo.create(n,s+r+o.length))})}return i}const eu=/\S/,tu=/\s*$/;function nu(e,t){const n=e.substring(t).match(eu);return n?t+n.index:e.length}function ru(e){const t=e.match(tu);if(t&&"number"==typeof t.index)return t.index}function iu(e,t){const n=e.tokens[e.index];return"tag"===n.type?au(e,!1):"text"===n.type||"inline-tag"===n.type?su(e):(function(e,t){if(t){const n=new pu("",e.range);"inlines"in t?t.inlines.push(n):t.content.inlines.push(n)}}(n,t),void e.index++)}function su(e){let t=e.tokens[e.index];const n=t;let r=t;const i=[];for(;t&&"break"!==t.type&&"tag"!==t.type;)i.push(ou(e)),r=t,t=e.tokens[e.index];return new fu(i,Jo.create(n.range.start,r.range.end))}function ou(e){return"inline-tag"===e.tokens[e.index].type?au(e,!0):cu(e)}function au(e,t){const n=e.tokens[e.index++],r=n.content.substring(1),i=e.tokens[e.index];if("text"===(null==i?void 0:i.type)){if(t){const i=cu(e);return new hu(r,new fu([i],i.range),t,Jo.create(n.range.start,i.range.end))}{const i=su(e);return new hu(r,i,t,Jo.create(n.range.start,i.range.end))}}{const e=n.range;return new hu(r,new fu([],e),t,e)}}function cu(e){const t=e.tokens[e.index++];return new pu(t.content,t.range)}function lu(e){if(!e)return lu({start:"/**",end:"*/",line:"*"});const{start:t,end:n,line:r}=e;return{start:uu(t,!0),end:uu(n,!1),line:uu(r,!0)}}function uu(e,t){if("string"==typeof e||"object"==typeof e){const n="string"==typeof e?at(e):e.source;return t?new RegExp(`^\\s*${n}`):new RegExp(`\\s*${n}\\s*$`)}return e}class du{constructor(e,t){this.elements=e,this.range=t}getTag(e){return this.getAllTags().find((t=>t.name===e))}getTags(e){return this.getAllTags().filter((t=>t.name===e))}getAllTags(){return this.elements.filter((e=>"name"in e))}toString(){let e="";for(const t of this.elements)if(0===e.length)e=t.toString();else{const n=t.toString();e+=mu(e)+n}return e.trim()}toMarkdown(e){let t="";for(const n of this.elements)if(0===t.length)t=n.toMarkdown(e);else{const r=n.toMarkdown(e);t+=mu(t)+r}return t.trim()}}class hu{constructor(e,t,n,r){this.name=e,this.content=t,this.inline=n,this.range=r}toString(){let e=`@${this.name}`;const t=this.content.toString();return 1===this.content.inlines.length?e=`${e} ${t}`:this.content.inlines.length>1&&(e=`${e}\n${t}`),this.inline?`{${e}}`:e}toMarkdown(e){var t,n;return null!==(n=null===(t=null==e?void 0:e.renderTag)||void 0===t?void 0:t.call(e,this))&&void 0!==n?n:this.toMarkdownDefault(e)}toMarkdownDefault(e){const t=this.content.toMarkdown(e);if(this.inline){const n=function(e,t,n){var r,i;if("linkplain"===e||"linkcode"===e||"link"===e){const s=t.indexOf(" ");let o=t;if(s>0){const e=nu(t,s);o=t.substring(e),t=t.substring(0,s)}("linkcode"===e||"link"===e&&"code"===n.link)&&(o=`\`${o}\``);const a=null!==(i=null===(r=n.renderLink)||void 0===r?void 0:r.call(n,t,o))&&void 0!==i?i:function(e,t){try{return ll.parse(e,!0),`[${t}](${e})`}catch(r){return e}}(t,o);return a}return}(this.name,t,null!=e?e:{});if("string"==typeof n)return n}let n="";"italic"===(null==e?void 0:e.tag)||void 0===(null==e?void 0:e.tag)?n="*":"bold"===(null==e?void 0:e.tag)?n="**":"bold-italic"===(null==e?void 0:e.tag)&&(n="***");let r=`${n}@${this.name}${n}`;return 1===this.content.inlines.length?r=`${r} \u2014 ${t}`:this.content.inlines.length>1&&(r=`${r}\n${t}`),this.inline?`{${r}}`:r}}class fu{constructor(e,t){this.inlines=e,this.range=t}toString(){let e="";for(let t=0;tn.range.start.line&&(e+="\n")}return e}toMarkdown(e){let t="";for(let n=0;nr.range.start.line&&(t+="\n")}return t}}class pu{constructor(e,t){this.text=e,this.range=t}toString(){return this.text}toMarkdown(){return this.text}}function mu(e){return e.endsWith("\n")?"\n":"\n\n"}class gu{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const t=this.commentProvider.getComment(e);if(t&&function(e,t){const n=lu(t),r=ql(e);if(0===r.length)return!1;const i=r[0],s=r[r.length-1],o=n.start,a=n.end;return Boolean(null==o?void 0:o.exec(i))&&Boolean(null==a?void 0:a.exec(s))}(t)){return Xl(t).toMarkdown({renderLink:(t,n)=>this.documentationLinkRenderer(e,t,n),renderTag:t=>this.documentationTagRenderer(e,t)})}}documentationLinkRenderer(e,t,n){var r;const i=null!==(r=this.findNameInPrecomputedScopes(e,t))&&void 0!==r?r:this.findNameInGlobalScope(e,t);if(i&&i.nameSegment){const e=i.nameSegment.range.start.line+1,t=i.nameSegment.range.start.character+1;return`[${n}](${i.documentUri.with({fragment:`L${e},${t}`}).toString()})`}}documentationTagRenderer(e,t){}findNameInPrecomputedScopes(e,t){const n=Pe(e).precomputedScopes;if(!n)return;let r=e;do{const e=n.get(r).find((e=>e.name===t));if(e)return e;r=r.$container}while(r)}findNameInGlobalScope(e,t){return this.indexManager.allElements().find((e=>e.name===t))}}class yu{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var t;return function(e){return"string"==typeof e.$comment}(e)?e.$comment:null===(t=x(e.$cstNode,this.grammarConfig().multilineCommentRules))||void 0===t?void 0:t.text}}var Au;n(436);class Tu{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e){return Promise.resolve(this.syncParser.parse(e))}}class vu{constructor(){this.previousTokenSource=new Yc.Qi,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const t=new Yc.Qi;return this.previousTokenSource=t,this.enqueue(this.writeQueue,e,t.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,t,n){const r=new el,i={action:t,deferred:r,cancellationToken:null!=n?n:Yc.XO.None};return e.push(i),this.performNextOperation(),r.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else{if(!(this.readQueue.length>0))return;e.push(...this.readQueue.splice(0,this.readQueue.length))}this.done=!1,await Promise.all(e.map((async({action:e,deferred:t,cancellationToken:n})=>{try{const r=await Promise.resolve().then((()=>e(n)));t.resolve(r)}catch(r){Jc(r)?t.resolve(void 0):t.reject(r)}}))),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class Ru{constructor(e){this.grammarElementIdMap=new Tl,this.tokenTypeIdMap=new Tl,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors.map((e=>Object.assign({},e))),parserErrors:e.parserErrors.map((e=>Object.assign({},e))),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}createDehyrationContext(e){const t=new Map,n=new Map;for(const r of Ue(e))t.set(r,{});if(e.$cstNode)for(const r of T(e.$cstNode))n.set(r,{});return{astNodes:t,cstNodes:n}}dehydrateAstNode(e,t){const n=t.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,void 0!==e.$cstNode&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,t));for(const[s,o]of Object.entries(e))if(!s.startsWith("$"))if(Array.isArray(o)){const e=[];n[s]=e;for(const n of o)r(n)?e.push(this.dehydrateAstNode(n,t)):i(n)?e.push(this.dehydrateReference(n,t)):e.push(n)}else r(o)?n[s]=this.dehydrateAstNode(o,t):i(o)?n[s]=this.dehydrateReference(o,t):void 0!==o&&(n[s]=o);return n}dehydrateReference(e,t){const n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=t.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,t){const n=t.cstNodes.get(e);return l(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=t.astNodes.get(e.astNode),a(e)?n.content=e.content.map((e=>this.dehydrateCstNode(e,t))):c(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){const t=e.value,n=this.createHydrationContext(t);return"$cstNode"in t&&this.hydrateCstNode(t.$cstNode,n),{lexerErrors:e.lexerErrors,parserErrors:e.parserErrors,value:this.hydrateAstNode(t,n)}}createHydrationContext(e){const t=new Map,n=new Map;for(const i of Ue(e))t.set(i,{});let r;if(e.$cstNode)for(const i of T(e.$cstNode)){let e;"fullText"in i?(e=new Ic(i.fullText),r=e):"content"in i?e=new kc:"tokenType"in i&&(e=this.hydrateCstLeafNode(i)),e&&(n.set(i,e),e.root=r)}return{astNodes:t,cstNodes:n}}hydrateAstNode(e,t){const n=t.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=t.cstNodes.get(e.$cstNode));for(const[s,o]of Object.entries(e))if(!s.startsWith("$"))if(Array.isArray(o)){const e=[];n[s]=e;for(const a of o)r(a)?e.push(this.setParent(this.hydrateAstNode(a,t),n)):i(a)?e.push(this.hydrateReference(a,n,s,t)):e.push(a)}else r(o)?n[s]=this.setParent(this.hydrateAstNode(o,t),n):i(o)?n[s]=this.hydrateReference(o,n,s,t):void 0!==o&&(n[s]=o);return n}setParent(e,t){return e.$container=t,e}hydrateReference(e,t,n,r){return this.linker.buildReference(t,n,r.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,t,n=0){const r=t.cstNodes.get(e);if("number"==typeof e.grammarSource&&(r.grammarSource=this.getGrammarElement(e.grammarSource)),r.astNode=t.astNodes.get(e.astNode),a(r))for(const i of e.content){const e=this.hydrateCstNode(i,t,n++);r.content.push(e)}return r}hydrateCstLeafNode(e){const t=this.getTokenType(e.tokenType),n=e.offset,r=e.length,i=e.startLine,s=e.startColumn,o=e.endLine,a=e.endColumn,c=e.hidden;return new Ec(n,r,{start:{line:i,character:s},end:{line:o,character:a}},t,c)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){return 0===this.grammarElementIdMap.size&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){0===this.grammarElementIdMap.size&&this.createGrammarElementIdMap();const t=this.grammarElementIdMap.getKey(e);if(t)return t;throw new Error("Invalid grammar element id: "+e)}createGrammarElementIdMap(){let e=0;for(const n of Ue(this.grammar))t=n,Oe.isInstance(t,b)&&this.grammarElementIdMap.set(n,e++);var t}}function Eu(e){return{documentation:{CommentProvider:e=>new yu(e),DocumentationProvider:e=>new gu(e)},parser:{AsyncParser:e=>new Tu(e),GrammarConfig:e=>function(e){const t=[],n=e.Grammar;for(const i of n.rules)te(i)&&(r=i).hidden&&!vt(r).test(" ")&&st(vt(i))&&t.push(i.name);var r;return{multilineCommentRules:t,nameRegexp:k}}(e),LangiumParser:e=>Vc(e),CompletionParser:e=>function(e){const t=e.Grammar,n=e.parser.Lexer,r=new bc(e);return Mc(t,r,n.definition),r.finalize(),r}(e),ValueConverter:()=>new Wc,TokenBuilder:()=>new Hc,Lexer:e=>new Wl(e),ParserErrorMessageProvider:()=>new Oc},workspace:{AstNodeLocator:()=>new Kl,AstNodeDescriptionProvider:e=>new Fl(e),ReferenceDescriptionProvider:e=>new Gl(e)},references:{Linker:e=>new ml(e),NameProvider:()=>new gl,ScopeProvider:e=>new Nl(e),ScopeComputation:e=>new vl(e),References:e=>new yl(e)},serializer:{Hydrator:e=>new Ru(e),JsonSerializer:e=>new $l(e)},validation:{DocumentValidator:e=>new Ml(e),ValidationRegistry:e=>new Pl(e)},shared:()=>e.shared}}function ku(e){return{ServiceRegistry:()=>new wl,workspace:{LangiumDocuments:e=>new pl(e),LangiumDocumentFactory:e=>new fl(e),DocumentBuilder:e=>new jl(e),IndexManager:e=>new Vl(e),WorkspaceManager:e=>new Hl(e),FileSystemProvider:t=>e.fileSystemProvider(t),WorkspaceLock:()=>new vu,ConfigurationProvider:e=>new Bl(e)}}}function xu(e,t,n,r,i,s,o,a,c){return Su([e,t,n,r,i,s,o,a,c].reduce($u,{}))}!function(e){e.merge=(e,t)=>$u($u({},e),t)}(Au||(Au={}));const Iu=Symbol("isProxy");function Su(e,t){const n=new Proxy({},{deleteProperty:()=>!1,get:(r,i)=>Cu(r,i,e,t||n),getOwnPropertyDescriptor:(r,i)=>(Cu(r,i,e,t||n),Object.getOwnPropertyDescriptor(r,i)),has:(t,n)=>n in e,ownKeys:()=>[...Reflect.ownKeys(e),Iu]});return n[Iu]=!0,n}const Nu=Symbol();function Cu(e,t,n,r){if(t in e){if(e[t]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable.",{cause:e[t]});if(e[t]===Nu)throw new Error('Cycle detected. Please make "'+String(t)+'" lazy. See https://langium.org/docs/configuration-services/#resolving-cyclic-dependencies');return e[t]}if(t in n){const s=n[t];e[t]=Nu;try{e[t]="function"==typeof s?s(r):Su(s,r)}catch(i){throw e[t]=i instanceof Error?i:void 0,i}return e[t]}}function $u(e,t){if(t)for(const[n,r]of Object.entries(t))if(void 0!==r){const t=e[n];e[n]=null!==t&&null!==r&&"object"==typeof t&&"object"==typeof r?$u(t,r):r}return e}class wu{readFile(){throw new Error("No file system is available.")}async readDirectory(){return[]}}const Lu={fileSystemProvider:()=>new wu},Ou={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},bu={AstReflection:()=>new Le};function _u(e){var t;const n=function(){const e=xu(ku(Lu),bu),t=xu(Eu({shared:e}),Ou);return e.ServiceRegistry.register(t),t}(),r=n.serializer.JsonSerializer.deserialize(e);return n.shared.workspace.LangiumDocumentFactory.fromModel(r,ll.parse(`memory://${null!==(t=r.name)&&void 0!==t?t:"grammar"}.langium`)),r}},3884:(e,t,n)=>{n.d(t,{A:()=>i});var r=n(3027);const i=function(e,t,n){for(var i=-1,s=e.length;++i{n.d(t,{A:()=>r});const r=function(e,t){return e{n.d(t,{A:()=>s});var r=n(4753),i=n(2849);const s=function(e,t){var n=-1,s=(0,i.A)(e)?Array(e.length):[];return(0,r.A)(e,(function(e,r,i){s[++n]=t(e,r,i)})),s}},1159:(e,t,n)=>{n.d(t,{A:()=>u});var r=n(2880),i=n(3406),s=n(870),o=n(1408),a=n(9084),c=n(1528);const l=function(e,t,n,r){if(!(0,a.A)(e))return e;for(var l=-1,u=(t=(0,s.A)(t,e)).length,d=u-1,h=e;null!=h&&++l{n.d(t,{A:()=>i});var r=n(8020);const i=function(e){return(0,r.A)(e,4)}},5237:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(4713),i=n(6957),s=n(6599),o=n(6920),a=Object.prototype,c=a.hasOwnProperty;const l=(0,r.A)((function(e,t){e=Object(e);var n=-1,r=t.length,l=r>2?t[2]:void 0;for(l&&(0,s.A)(t[0],t[1],l)&&(r=1);++n{n.d(t,{A:()=>u});var r=n(6095),i=n(2849),s=n(2859);const o=function(e){return function(t,n,o){var a=Object(t);if(!(0,i.A)(t)){var c=(0,r.A)(n,3);t=(0,s.A)(t),n=function(e){return c(a[e],e,a)}}var l=e(t,n,o);return l>-1?a[c?t[l]:l]:void 0}};var a=n(6482),c=n(1066),l=Math.max;const u=o((function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var s=null==n?0:(0,c.A)(n);return s<0&&(s=l(i+s,0)),(0,a.A)(e,(0,r.A)(t,3),s)}))},129:(e,t,n)=>{n.d(t,{A:()=>i});var r=n(9759);const i=function(e){return(null==e?0:e.length)?(0,r.A)(e,1):[]}},2540:(e,t,n)=>{n.d(t,{A:()=>o});var r=Object.prototype.hasOwnProperty;const i=function(e,t){return null!=e&&r.call(e,t)};var s=n(6923);const o=function(e,t){return null!=e&&(0,s.A)(e,t,i)}},586:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(565),i=n(3145),s=n(7427);const o=function(e){return"string"==typeof e||!(0,i.A)(e)&&(0,s.A)(e)&&"[object String]"==(0,r.A)(e)}},8663:(e,t,n)=>{n.d(t,{A:()=>r});const r=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},2185:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(2663),i=n(6095),s=n(1361),o=n(3145);const a=function(e,t){return((0,o.A)(e)?r.A:s.A)(e,(0,i.A)(t,3))}},2675:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(3884),i=n(3855),s=n(6117);const o=function(e){return e&&e.length?(0,r.A)(e,s.A,i.A):void 0}},7001:(e,t,n)=>{n.d(t,{A:()=>m});var r=/\s/;const i=function(e){for(var t=e.length;t--&&r.test(e.charAt(t)););return t};var s=/^\s+/;const o=function(e){return e?e.slice(0,i(e)+1).replace(s,""):e};var a=n(9084),c=n(3027),l=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,d=/^0o[0-7]+$/i,h=parseInt;const f=function(e){if("number"==typeof e)return e;if((0,c.A)(e))return NaN;if((0,a.A)(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=(0,a.A)(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=o(e);var n=u.test(e);return n||d.test(e)?h(e.slice(2),n?2:8):l.test(e)?NaN:+e};var p=1/0;const m=function(e){return e?(e=f(e))===p||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},1066:(e,t,n)=>{n.d(t,{A:()=>i});var r=n(7001);const i=function(e){var t=(0,r.A)(e),n=t%1;return t==t?n?t-n:t:0}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9859],{202:(e,t,n)=>{t.Qi=t.XO=void 0;const r=n(406),i=n(8137),s=n(436);var o;!function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:s.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:s.Event.None}),e.is=function(t){const n=t;return n&&(n===e.None||n===e.Cancelled||i.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}}(o||(t.XO=o={}));const a=Object.freeze((function(e,t){const n=(0,r.default)().timer.setTimeout(e.bind(t),0);return{dispose(){n.dispose()}}}));class c{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?a:(this._emitter||(this._emitter=new s.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}t.Qi=class{get token(){return this._token||(this._token=new c),this._token}cancel(){this._token?this._token.cancel():this._token=o.Cancelled}dispose(){this._token?this._token instanceof c&&this._token.dispose():this._token=o.None}}},436:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;const r=n(406);var i;!function(e){const t={dispose(){}};e.None=function(){return t}}(i||(t.Event=i={}));class s{add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let n=!1;for(let r=0,i=this._callbacks.length;r{this._callbacks||(this._callbacks=new s),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);const r={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),r.dispose=o._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(r),r}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}t.Emitter=o,o._noop=function(){}},8137:(e,t)=>{function n(e){return"string"==typeof e||e instanceof String}function r(e){return Array.isArray(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0,t.boolean=function(e){return!0===e||!1===e},t.string=n,t.number=function(e){return"number"==typeof e||e instanceof Number},t.error=function(e){return e instanceof Error},t.func=function(e){return"function"==typeof e},t.array=r,t.stringArray=function(e){return r(e)&&e.every((e=>n(e)))}},406:(e,t)=>{let n;function r(){if(void 0===n)throw new Error("No runtime abstraction layer installed");return n}Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.install=function(e){if(void 0===e)throw new Error("No runtime abstraction layer provided");n=e}}(r||(r={})),t.default=r},8469:(e,t,n)=>{n.d(t,{v:()=>a});var r=n(5409),i=n(7546),s=class extends r.mR{static{(0,r.K2)(this,"InfoTokenBuilder")}constructor(){super(["info","showInfo"])}},o={parser:{TokenBuilder:(0,r.K2)((()=>new s),"TokenBuilder"),ValueConverter:(0,r.K2)((()=>new r.Tm),"ValueConverter")}};function a(e=i.DD){const t=(0,i.WQ)((0,i.uM)(e),r.sr),n=(0,i.WQ)((0,i.tG)({shared:t}),r.e5,o);return t.ServiceRegistry.register(n),{shared:t,Info:n}}(0,r.K2)(a,"createInfoServices")},8693:(e,t,n)=>{n.d(t,{f:()=>c});var r=n(5409),i=n(7546),s=class extends r.mR{static{(0,r.K2)(this,"PieTokenBuilder")}constructor(){super(["pie","showData"])}},o=class extends r.dg{static{(0,r.K2)(this,"PieValueConverter")}runCustomConverter(e,t,n){if("PIE_SECTION_LABEL"===e.name)return t.replace(/"/g,"").trim()}},a={parser:{TokenBuilder:(0,r.K2)((()=>new s),"TokenBuilder"),ValueConverter:(0,r.K2)((()=>new o),"ValueConverter")}};function c(e=i.DD){const t=(0,i.WQ)((0,i.uM)(e),r.sr),n=(0,i.WQ)((0,i.tG)({shared:t}),r.KX,a);return t.ServiceRegistry.register(n),{shared:t,Pie:n}}(0,r.K2)(c,"createPieServices")},3457:(e,t,n)=>{n.d(t,{$:()=>a});var r=n(5409),i=n(7546),s=class extends r.mR{static{(0,r.K2)(this,"PacketTokenBuilder")}constructor(){super(["packet-beta"])}},o={parser:{TokenBuilder:(0,r.K2)((()=>new s),"TokenBuilder"),ValueConverter:(0,r.K2)((()=>new r.Tm),"ValueConverter")}};function a(e=i.DD){const t=(0,i.WQ)((0,i.uM)(e),r.sr),n=(0,i.WQ)((0,i.tG)({shared:t}),r.AM,o);return t.ServiceRegistry.register(n),{shared:t,Packet:n}}(0,r.K2)(a,"createPacketServices")},3960:(e,t,n)=>{n.d(t,{S:()=>c});var r=n(5409),i=n(7546),s=class extends r.mR{static{(0,r.K2)(this,"ArchitectureTokenBuilder")}constructor(){super(["architecture"])}},o=class extends r.dg{static{(0,r.K2)(this,"ArchitectureValueConverter")}runCustomConverter(e,t,n){return"ARCH_ICON"===e.name?t.replace(/[()]/g,"").trim():"ARCH_TEXT_ICON"===e.name?t.replace(/["()]/g,""):"ARCH_TITLE"===e.name?t.replace(/[[\]]/g,"").trim():void 0}},a={parser:{TokenBuilder:(0,r.K2)((()=>new s),"TokenBuilder"),ValueConverter:(0,r.K2)((()=>new o),"ValueConverter")}};function c(e=i.DD){const t=(0,i.WQ)((0,i.uM)(e),r.sr),n=(0,i.WQ)((0,i.tG)({shared:t}),r.jE,a);return t.ServiceRegistry.register(n),{shared:t,Architecture:n}}(0,r.K2)(c,"createArchitectureServices")},4105:(e,t,n)=>{n.d(t,{b:()=>a});var r=n(5409),i=n(7546),s=class extends r.mR{static{(0,r.K2)(this,"GitGraphTokenBuilder")}constructor(){super(["gitGraph"])}},o={parser:{TokenBuilder:(0,r.K2)((()=>new s),"TokenBuilder"),ValueConverter:(0,r.K2)((()=>new r.Tm),"ValueConverter")}};function a(e=i.DD){const t=(0,i.WQ)((0,i.uM)(e),r.sr),n=(0,i.WQ)((0,i.tG)({shared:t}),r.eZ,o);return t.ServiceRegistry.register(n),{shared:t,GitGraph:n}}(0,r.K2)(a,"createGitGraphServices")},5409:(e,t,n)=>{n.d(t,{AM:()=>$,K2:()=>s,KX:()=>w,Tm:()=>P,dg:()=>_,e5:()=>C,eZ:()=>O,jE:()=>L,mR:()=>M,sr:()=>N});var r=n(7546),i=Object.defineProperty,s=(e,t)=>i(e,"name",{value:t,configurable:!0});s((function(e){return g.isInstance(e,"Architecture")}),"isArchitecture");var o="Branch";s((function(e){return g.isInstance(e,o)}),"isBranch");var a="Commit";s((function(e){return g.isInstance(e,a)}),"isCommit");s((function(e){return g.isInstance(e,"Common")}),"isCommon");var c="GitGraph";s((function(e){return g.isInstance(e,c)}),"isGitGraph");s((function(e){return g.isInstance(e,"Info")}),"isInfo");var l="Merge";s((function(e){return g.isInstance(e,l)}),"isMerge");s((function(e){return g.isInstance(e,"Packet")}),"isPacket");s((function(e){return g.isInstance(e,"PacketBlock")}),"isPacketBlock");s((function(e){return g.isInstance(e,"Pie")}),"isPie");s((function(e){return g.isInstance(e,"PieSection")}),"isPieSection");var u,d,h,f,p,m=class extends r.kD{static{s(this,"MermaidAstReflection")}getAllTypes(){return["Architecture","Branch","Checkout","CherryPicking","Commit","Common","Direction","Edge","GitGraph","Group","Info","Junction","Merge","Packet","PacketBlock","Pie","PieSection","Service","Statement"]}computeIsSubtype(e,t){switch(e){case o:case"Checkout":case"CherryPicking":case a:case l:return this.isSubtype("Statement",t);case"Direction":return this.isSubtype(c,t);default:return!1}}getReferenceType(e){const t=`${e.container.$type}:${e.property}`;throw new Error(`${t} is not a valid reference id.`)}getTypeMetaData(e){switch(e){case"Architecture":return{name:"Architecture",properties:[{name:"accDescr"},{name:"accTitle"},{name:"edges",defaultValue:[]},{name:"groups",defaultValue:[]},{name:"junctions",defaultValue:[]},{name:"services",defaultValue:[]},{name:"title"}]};case"Branch":return{name:"Branch",properties:[{name:"name"},{name:"order"}]};case"Checkout":return{name:"Checkout",properties:[{name:"branch"}]};case"CherryPicking":return{name:"CherryPicking",properties:[{name:"id"},{name:"parent"},{name:"tags",defaultValue:[]}]};case"Commit":return{name:"Commit",properties:[{name:"id"},{name:"message"},{name:"tags",defaultValue:[]},{name:"type"}]};case"Common":return{name:"Common",properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case"Edge":return{name:"Edge",properties:[{name:"lhsDir"},{name:"lhsGroup",defaultValue:!1},{name:"lhsId"},{name:"lhsInto",defaultValue:!1},{name:"rhsDir"},{name:"rhsGroup",defaultValue:!1},{name:"rhsId"},{name:"rhsInto",defaultValue:!1},{name:"title"}]};case"GitGraph":return{name:"GitGraph",properties:[{name:"accDescr"},{name:"accTitle"},{name:"statements",defaultValue:[]},{name:"title"}]};case"Group":return{name:"Group",properties:[{name:"icon"},{name:"id"},{name:"in"},{name:"title"}]};case"Info":return{name:"Info",properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case"Junction":return{name:"Junction",properties:[{name:"id"},{name:"in"}]};case"Merge":return{name:"Merge",properties:[{name:"branch"},{name:"id"},{name:"tags",defaultValue:[]},{name:"type"}]};case"Packet":return{name:"Packet",properties:[{name:"accDescr"},{name:"accTitle"},{name:"blocks",defaultValue:[]},{name:"title"}]};case"PacketBlock":return{name:"PacketBlock",properties:[{name:"end"},{name:"label"},{name:"start"}]};case"Pie":return{name:"Pie",properties:[{name:"accDescr"},{name:"accTitle"},{name:"sections",defaultValue:[]},{name:"showData",defaultValue:!1},{name:"title"}]};case"PieSection":return{name:"PieSection",properties:[{name:"label"},{name:"value"}]};case"Service":return{name:"Service",properties:[{name:"icon"},{name:"iconText"},{name:"id"},{name:"in"},{name:"title"}]};case"Direction":return{name:"Direction",properties:[{name:"accDescr"},{name:"accTitle"},{name:"dir"},{name:"statements",defaultValue:[]},{name:"title"}]};default:return{name:e,properties:[]}}}},g=new m,y=s((()=>u??(u=(0,r.y0)('{"$type":"Grammar","isDeclared":true,"name":"Info","imports":[],"rules":[{"$type":"ParserRule","name":"Info","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}'))),"InfoGrammar"),A=s((()=>d??(d=(0,r.y0)('{"$type":"Grammar","isDeclared":true,"name":"Packet","imports":[],"rules":[{"$type":"ParserRule","name":"Packet","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"packet-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"?"},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|\'[^\']*\'/"},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}'))),"PacketGrammar"),T=s((()=>h??(h=(0,r.y0)('{"$type":"Grammar","isDeclared":true,"name":"Pie","imports":[],"rules":[{"$type":"ParserRule","name":"Pie","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"PIE_SECTION_LABEL","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]+\\"/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PIE_SECTION_VALUE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/(0|[1-9][0-9]*)(\\\\.[0-9]+)?/"},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}'))),"PieGrammar"),v=s((()=>f??(f=(0,r.y0)('{"$type":"Grammar","isDeclared":true,"name":"Architecture","imports":[],"rules":[{"$type":"ParserRule","name":"Architecture","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Statement","fragment":true,"definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LeftPort","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RightPort","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Arrow","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ID","definition":{"$type":"RegexToken","regex":"/[\\\\w]+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TEXT_ICON","definition":{"$type":"RegexToken","regex":"/\\\\(\\"[^\\"]+\\"\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[[\\\\w ]+\\\\]/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/"},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}'))),"ArchitectureGrammar"),R=s((()=>p??(p=(0,r.y0)('{"$type":"Grammar","isDeclared":true,"name":"GitGraph","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"ParserRule","name":"GitGraph","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+(?=\\\\s)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|\'[^\']*\'/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"types":[],"usedGrammars":[]}'))),"GitGraphGrammar"),E={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},k={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},x={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},I={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},S={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},N={AstReflection:s((()=>new m),"AstReflection")},C={Grammar:s((()=>y()),"Grammar"),LanguageMetaData:s((()=>E),"LanguageMetaData"),parser:{}},$={Grammar:s((()=>A()),"Grammar"),LanguageMetaData:s((()=>k),"LanguageMetaData"),parser:{}},w={Grammar:s((()=>T()),"Grammar"),LanguageMetaData:s((()=>x),"LanguageMetaData"),parser:{}},L={Grammar:s((()=>v()),"Grammar"),LanguageMetaData:s((()=>I),"LanguageMetaData"),parser:{}},O={Grammar:s((()=>R()),"Grammar"),LanguageMetaData:s((()=>S),"LanguageMetaData"),parser:{}},b={ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/accTitle[\t ]*:([^\n\r]*)/,TITLE:/title([\t ][^\n\r]*|)/},_=class extends r.dM{static{s(this,"AbstractMermaidValueConverter")}runConverter(e,t,n){let r=this.runCommonConverter(e,t,n);return void 0===r&&(r=this.runCustomConverter(e,t,n)),void 0===r?super.runConverter(e,t,n):r}runCommonConverter(e,t,n){const r=b[e.name];if(void 0===r)return;const i=r.exec(t);return null!==i?void 0!==i[1]?i[1].trim().replace(/[\t ]{2,}/gm," "):void 0!==i[2]?i[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,"\n"):void 0:void 0}},P=class extends _{static{s(this,"CommonValueConverter")}runCustomConverter(e,t,n){}},M=class extends r.QU{static{s(this,"AbstractMermaidTokenBuilder")}constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,t,n){const r=super.buildKeywordTokens(e,t,n);return r.forEach((e=>{this.keywords.has(e.name)&&void 0!==e.PATTERN&&(e.PATTERN=new RegExp(e.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))})),r}};(class extends M{static{s(this,"CommonTokenBuilder")}})},9859:(e,t,n)=>{n.d(t,{qg:()=>o});n(4105),n(8469),n(3457),n(8693),n(3960);var r=n(5409),i={},s={info:(0,r.K2)((async()=>{const{createInfoServices:e}=await n.e(1346).then(n.bind(n,1346)),t=e().Info.parser.LangiumParser;i.info=t}),"info"),packet:(0,r.K2)((async()=>{const{createPacketServices:e}=await n.e(8700).then(n.bind(n,8700)),t=e().Packet.parser.LangiumParser;i.packet=t}),"packet"),pie:(0,r.K2)((async()=>{const{createPieServices:e}=await n.e(867).then(n.bind(n,867)),t=e().Pie.parser.LangiumParser;i.pie=t}),"pie"),architecture:(0,r.K2)((async()=>{const{createArchitectureServices:e}=await n.e(1456).then(n.bind(n,1456)),t=e().Architecture.parser.LangiumParser;i.architecture=t}),"architecture"),gitGraph:(0,r.K2)((async()=>{const{createGitGraphServices:e}=await n.e(1307).then(n.bind(n,1307)),t=e().GitGraph.parser.LangiumParser;i.gitGraph=t}),"gitGraph")};async function o(e,t){const n=s[e];if(!n)throw new Error(`Unknown diagram type: ${e}`);i[e]||await n();const r=i[e].parse(t);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new a(r);return r.value}(0,r.K2)(o,"parse");var a=class extends Error{constructor(e){super(`Parsing failed: ${e.lexerErrors.map((e=>e.message)).join("\n")} ${e.parserErrors.map((e=>e.message)).join("\n")}`),this.result=e}static{(0,r.K2)(this,"MermaidParseError")}}},7546:(e,t,n)=>{function r(e){return"object"==typeof e&&null!==e&&"string"==typeof e.$type}function i(e){return"object"==typeof e&&null!==e&&"string"==typeof e.$refText}function s(e){return"object"==typeof e&&null!==e&&r(e.container)&&i(e.reference)&&"string"==typeof e.message}n.d(t,{kD:()=>o,QU:()=>Hc,dM:()=>Wc,DD:()=>Lu,tG:()=>Eu,uM:()=>ku,WQ:()=>xu,y0:()=>_u});class o{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,t){return r(e)&&this.isSubtype(e.$type,t)}isSubtype(e,t){if(e===t)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});const r=n[t];if(void 0!==r)return r;{const r=this.computeIsSubtype(e,t);return n[t]=r,r}}getAllSubTypes(e){const t=this.allSubtypes[e];if(t)return t;{const t=this.getAllTypes(),n=[];for(const r of t)this.isSubtype(r,e)&&n.push(r);return this.allSubtypes[e]=n,n}}}function a(e){return"object"==typeof e&&null!==e&&Array.isArray(e.content)}function c(e){return"object"==typeof e&&null!==e&&"object"==typeof e.tokenType}function l(e){return a(e)&&"string"==typeof e.fullText}class u{constructor(e,t){this.startFn=e,this.nextFn=t}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){const e=this.iterator();return Boolean(e.next().done)}count(){const e=this.iterator();let t=0,n=e.next();for(;!n.done;)t++,n=e.next();return t}toArray(){const e=[],t=this.iterator();let n;do{n=t.next(),void 0!==n.value&&e.push(n.value)}while(!n.done);return e}toSet(){return new Set(this)}toMap(e,t){const n=this.map((n=>[e?e(n):n,t?t(n):n]));return new Map(n)}toString(){return this.join()}concat(e){const t=e[Symbol.iterator]();return new u((()=>({first:this.startFn(),firstDone:!1})),(e=>{let n;if(!e.firstDone){do{if(n=this.nextFn(e.first),!n.done)return n}while(!n.done);e.firstDone=!0}do{if(n=t.next(),!n.done)return n}while(!n.done);return p}))}join(e=","){const t=this.iterator();let n,r="",i=!1;do{n=t.next(),n.done||(i&&(r+=e),r+=d(n.value)),i=!0}while(!n.done);return r}indexOf(e,t=0){const n=this.iterator();let r=0,i=n.next();for(;!i.done;){if(r>=t&&i.value===e)return r;i=n.next(),r++}return-1}every(e){const t=this.iterator();let n=t.next();for(;!n.done;){if(!e(n.value))return!1;n=t.next()}return!0}some(e){const t=this.iterator();let n=t.next();for(;!n.done;){if(e(n.value))return!0;n=t.next()}return!1}forEach(e){const t=this.iterator();let n=0,r=t.next();for(;!r.done;)e(r.value,n),r=t.next(),n++}map(e){return new u(this.startFn,(t=>{const{done:n,value:r}=this.nextFn(t);return n?p:{done:!1,value:e(r)}}))}filter(e){return new u(this.startFn,(t=>{let n;do{if(n=this.nextFn(t),!n.done&&e(n.value))return n}while(!n.done);return p}))}nonNullable(){return this.filter((e=>null!=e))}reduce(e,t){const n=this.iterator();let r=t,i=n.next();for(;!i.done;)r=void 0===r?i.value:e(r,i.value),i=n.next();return r}reduceRight(e,t){return this.recursiveReduce(this.iterator(),e,t)}recursiveReduce(e,t,n){const r=e.next();if(r.done)return n;const i=this.recursiveReduce(e,t,n);return void 0===i?r.value:t(i,r.value)}find(e){const t=this.iterator();let n=t.next();for(;!n.done;){if(e(n.value))return n.value;n=t.next()}}findIndex(e){const t=this.iterator();let n=0,r=t.next();for(;!r.done;){if(e(r.value))return n;r=t.next(),n++}return-1}includes(e){const t=this.iterator();let n=t.next();for(;!n.done;){if(n.value===e)return!0;n=t.next()}return!1}flatMap(e){return new u((()=>({this:this.startFn()})),(t=>{do{if(t.iterator){const e=t.iterator.next();if(!e.done)return e;t.iterator=void 0}const{done:n,value:r}=this.nextFn(t.this);if(!n){const n=e(r);if(!h(n))return{done:!1,value:n};t.iterator=n[Symbol.iterator]()}}while(t.iterator);return p}))}flat(e){if(void 0===e&&(e=1),e<=0)return this;const t=e>1?this.flat(e-1):this;return new u((()=>({this:t.startFn()})),(e=>{do{if(e.iterator){const t=e.iterator.next();if(!t.done)return t;e.iterator=void 0}const{done:n,value:r}=t.nextFn(e.this);if(!n){if(!h(r))return{done:!1,value:r};e.iterator=r[Symbol.iterator]()}}while(e.iterator);return p}))}head(){const e=this.iterator().next();if(!e.done)return e.value}tail(e=1){return new u((()=>{const t=this.startFn();for(let n=0;n({size:0,state:this.startFn()})),(t=>(t.size++,t.size>e?p:this.nextFn(t.state))))}distinct(e){const t=new Set;return this.filter((n=>{const r=e?e(n):n;return!t.has(r)&&(t.add(r),!0)}))}exclude(e,t){const n=new Set;for(const r of e){const e=t?t(r):r;n.add(e)}return this.filter((e=>{const r=t?t(e):e;return!n.has(r)}))}}function d(e){return"string"==typeof e?e:void 0===e?"undefined":"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e)}function h(e){return!!e&&"function"==typeof e[Symbol.iterator]}const f=new u((()=>{}),(()=>p)),p=Object.freeze({done:!0,value:void 0});function m(...e){if(1===e.length){const t=e[0];if(t instanceof u)return t;if(h(t))return new u((()=>t[Symbol.iterator]()),(e=>e.next()));if("number"==typeof t.length)return new u((()=>({index:0})),(e=>e.index1?new u((()=>({collIndex:0,arrIndex:0})),(t=>{do{if(t.iterator){const e=t.iterator.next();if(!e.done)return e;t.iterator=void 0}if(t.array){if(t.arrIndex({iterators:(null==n?void 0:n.includeRoot)?[[e][Symbol.iterator]()]:[t(e)[Symbol.iterator]()],pruned:!1})),(e=>{for(e.pruned&&(e.iterators.pop(),e.pruned=!1);e.iterators.length>0;){const n=e.iterators[e.iterators.length-1].next();if(!n.done)return e.iterators.push(t(n.value)[Symbol.iterator]()),n;e.iterators.pop()}return p}))}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var y,A;function T(e){return new g(e,(e=>a(e)?e.content:[]),{includeRoot:!0})}function v(e){return{start:{character:e.startColumn-1,line:e.startLine-1},end:{character:e.endColumn,line:e.endLine-1}}}function R(e){if(!e)return;const{offset:t,end:n,range:r}=e;return{range:r,offset:t,end:n,length:n-t}}function E(e,t){const n=function(e,t){if(e.end.linet.end.line||e.start.line===t.end.line&&e.start.character>t.end.character)return A.After;const n=e.start.line>t.start.line||e.start.line===t.start.line&&e.start.character>=t.start.character,r=e.end.lineA.After}!function(e){e.sum=function(e){return e.reduce(((e,t)=>e+t),0)},e.product=function(e){return e.reduce(((e,t)=>e*t),0)},e.min=function(e){return e.reduce(((e,t)=>Math.min(e,t)))},e.max=function(e){return e.reduce(((e,t)=>Math.max(e,t)))}}(y||(y={})),function(e){e[e.Before=0]="Before",e[e.After=1]="After",e[e.OverlapFront=2]="OverlapFront",e[e.OverlapBack=3]="OverlapBack",e[e.Inside=4]="Inside"}(A||(A={}));const k=/^[\w\p{L}]$/u;function x(e,t){if(e){const n=function(e,t=!0){for(;e.container;){const n=e.container;let r=n.content.indexOf(e);for(;r>0;){r--;const e=n.content[r];if(t||!e.hidden)return e}e=n}return}(e,!0);if(n&&I(n,t))return n;if(l(e)){for(let n=e.content.findIndex((e=>!e.hidden))-1;n>=0;n--){const r=e.content[n];if(I(r,t))return r}}}}function I(e,t){return c(e)&&t.includes(e.tokenType.name)}class S extends Error{constructor(e,t){super(e?`${t} at ${e.range.start.line}:${e.range.start.character}`:t)}}function N(e){throw new Error("Error! The input value was not handled.")}const C="AbstractRule";const $="AbstractType";const w="Condition";const L="TypeDefinition";const O="ValueLiteral";const b="AbstractElement";const _="ArrayLiteral";const P="ArrayType";const M="BooleanLiteral";const D="Conjunction";const U="Disjunction";const F="Grammar";const G="InferredType";function K(e){return Oe.isInstance(e,G)}const B="Interface";function j(e){return Oe.isInstance(e,B)}const V="Negation";const H="NumberLiteral";const W="Parameter";const z="ParameterReference";const Y="ParserRule";function X(e){return Oe.isInstance(e,Y)}const q="ReferenceType";const Q="ReturnType";const J="SimpleType";const Z="StringLiteral";const ee="TerminalRule";function te(e){return Oe.isInstance(e,ee)}const ne="Type";function re(e){return Oe.isInstance(e,ne)}const ie="UnionType";const se="Action";function oe(e){return Oe.isInstance(e,se)}const ae="Alternatives";function ce(e){return Oe.isInstance(e,ae)}const le="Assignment";function ue(e){return Oe.isInstance(e,le)}const de="CharacterRange";const he="CrossReference";function fe(e){return Oe.isInstance(e,he)}const pe="EndOfFile";const me="Group";function ge(e){return Oe.isInstance(e,me)}const ye="Keyword";function Ae(e){return Oe.isInstance(e,ye)}const Te="NegatedToken";const ve="RegexToken";const Re="RuleCall";function Ee(e){return Oe.isInstance(e,Re)}const ke="TerminalAlternatives";const xe="TerminalGroup";const Ie="TerminalRuleCall";function Se(e){return Oe.isInstance(e,Ie)}const Ne="UnorderedGroup";function Ce(e){return Oe.isInstance(e,Ne)}const $e="UntilToken";const we="Wildcard";class Le extends o{getAllTypes(){return["AbstractElement","AbstractRule","AbstractType","Action","Alternatives","ArrayLiteral","ArrayType","Assignment","BooleanLiteral","CharacterRange","Condition","Conjunction","CrossReference","Disjunction","EndOfFile","Grammar","GrammarImport","Group","InferredType","Interface","Keyword","NamedArgument","NegatedToken","Negation","NumberLiteral","Parameter","ParameterReference","ParserRule","ReferenceType","RegexToken","ReturnType","RuleCall","SimpleType","StringLiteral","TerminalAlternatives","TerminalGroup","TerminalRule","TerminalRuleCall","Type","TypeAttribute","TypeDefinition","UnionType","UnorderedGroup","UntilToken","ValueLiteral","Wildcard"]}computeIsSubtype(e,t){switch(e){case se:case ae:case le:case de:case he:case pe:case me:case ye:case Te:case ve:case Re:case ke:case xe:case Ie:case Ne:case $e:case we:return this.isSubtype(b,t);case _:case H:case Z:return this.isSubtype(O,t);case P:case q:case J:case ie:return this.isSubtype(L,t);case M:return this.isSubtype(w,t)||this.isSubtype(O,t);case D:case U:case V:case z:return this.isSubtype(w,t);case G:case B:case ne:return this.isSubtype($,t);case Y:return this.isSubtype(C,t)||this.isSubtype($,t);case ee:return this.isSubtype(C,t);default:return!1}}getReferenceType(e){const t=`${e.container.$type}:${e.property}`;switch(t){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return $;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return C;case"Grammar:usedGrammars":return F;case"NamedArgument:parameter":case"ParameterReference:parameter":return W;case"TerminalRuleCall:rule":return ee;default:throw new Error(`${t} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case"AbstractElement":return{name:"AbstractElement",properties:[{name:"cardinality"},{name:"lookahead"}]};case"ArrayLiteral":return{name:"ArrayLiteral",properties:[{name:"elements",defaultValue:[]}]};case"ArrayType":return{name:"ArrayType",properties:[{name:"elementType"}]};case"BooleanLiteral":return{name:"BooleanLiteral",properties:[{name:"true",defaultValue:!1}]};case"Conjunction":return{name:"Conjunction",properties:[{name:"left"},{name:"right"}]};case"Disjunction":return{name:"Disjunction",properties:[{name:"left"},{name:"right"}]};case"Grammar":return{name:"Grammar",properties:[{name:"definesHiddenTokens",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"imports",defaultValue:[]},{name:"interfaces",defaultValue:[]},{name:"isDeclared",defaultValue:!1},{name:"name"},{name:"rules",defaultValue:[]},{name:"types",defaultValue:[]},{name:"usedGrammars",defaultValue:[]}]};case"GrammarImport":return{name:"GrammarImport",properties:[{name:"path"}]};case"InferredType":return{name:"InferredType",properties:[{name:"name"}]};case"Interface":return{name:"Interface",properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case"NamedArgument":return{name:"NamedArgument",properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case"Negation":return{name:"Negation",properties:[{name:"value"}]};case"NumberLiteral":return{name:"NumberLiteral",properties:[{name:"value"}]};case"Parameter":return{name:"Parameter",properties:[{name:"name"}]};case"ParameterReference":return{name:"ParameterReference",properties:[{name:"parameter"}]};case"ParserRule":return{name:"ParserRule",properties:[{name:"dataType"},{name:"definesHiddenTokens",defaultValue:!1},{name:"definition"},{name:"entry",defaultValue:!1},{name:"fragment",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"inferredType"},{name:"name"},{name:"parameters",defaultValue:[]},{name:"returnType"},{name:"wildcard",defaultValue:!1}]};case"ReferenceType":return{name:"ReferenceType",properties:[{name:"referenceType"}]};case"ReturnType":return{name:"ReturnType",properties:[{name:"name"}]};case"SimpleType":return{name:"SimpleType",properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case"StringLiteral":return{name:"StringLiteral",properties:[{name:"value"}]};case"TerminalRule":return{name:"TerminalRule",properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case"Type":return{name:"Type",properties:[{name:"name"},{name:"type"}]};case"TypeAttribute":return{name:"TypeAttribute",properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case"UnionType":return{name:"UnionType",properties:[{name:"types",defaultValue:[]}]};case"Action":return{name:"Action",properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case"Alternatives":return{name:"Alternatives",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"Assignment":return{name:"Assignment",properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case"CharacterRange":return{name:"CharacterRange",properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case"CrossReference":return{name:"CrossReference",properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case"EndOfFile":return{name:"EndOfFile",properties:[{name:"cardinality"},{name:"lookahead"}]};case"Group":return{name:"Group",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case"Keyword":return{name:"Keyword",properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case"NegatedToken":return{name:"NegatedToken",properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case"RegexToken":return{name:"RegexToken",properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case"RuleCall":return{name:"RuleCall",properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case"TerminalAlternatives":return{name:"TerminalAlternatives",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"TerminalGroup":return{name:"TerminalGroup",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"TerminalRuleCall":return{name:"TerminalRuleCall",properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case"UnorderedGroup":return{name:"UnorderedGroup",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"UntilToken":return{name:"UntilToken",properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case"Wildcard":return{name:"Wildcard",properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:e,properties:[]}}}}const Oe=new Le;function be(e){for(const[t,n]of Object.entries(e))t.startsWith("$")||(Array.isArray(n)?n.forEach(((n,i)=>{r(n)&&(n.$container=e,n.$containerProperty=t,n.$containerIndex=i)})):r(n)&&(n.$container=e,n.$containerProperty=t))}function _e(e,t){let n=e;for(;n;){if(t(n))return n;n=n.$container}}function Pe(e){const t=function(e){for(;e.$container;)e=e.$container;return e}(e),n=t.$document;if(!n)throw new Error("AST node has no document.");return n}function Me(e,t){if(!e)throw new Error("Node must be an AstNode.");const n=null==t?void 0:t.range;return new u((()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0})),(t=>{for(;t.keyIndexMe(e,t)))}function Ue(e,t){if(!e)throw new Error("Root node must be an AstNode.");return(null==t?void 0:t.range)&&!Fe(e,t.range)?new g(e,(()=>[])):new g(e,(e=>Me(e,t)),{includeRoot:!0})}function Fe(e,t){var n;if(!t)return!0;const r=null===(n=e.$cstNode)||void 0===n?void 0:n.range;return!!r&&E(r,t)}function Ge(e){return new u((()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0})),(t=>{for(;t.keyIndex=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}}class tt{visitChildren(e){for(const t in e){const n=e[t];e.hasOwnProperty(t)&&(void 0!==n.type?this.visit(n):Array.isArray(n)&&n.forEach((e=>{this.visit(e)}),this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e)}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}const nt=/\r?\n/gm,rt=new et;const it=new class extends tt{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const t=String.fromCharCode(e.value);if(this.multiline||"\n"!==t||(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const e=at(t);this.endRegexpStack.push(e),this.isStarting&&(this.startRegexp+=e)}}visitSet(e){if(!this.multiline){const t=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(t);this.multiline=Boolean("\n".match(n))}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const t=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(t),this.isStarting&&(this.startRegexp+=t)}}visitChildren(e){if("Group"===e.type){if(e.quantifier)return}super.visitChildren(e)}};function st(e){try{return"string"==typeof e&&(e=new RegExp(e)),e=e.toString(),it.reset(e),it.visit(rt.pattern(e)),it.multiline}catch(t){return!1}}function ot(e){return("string"==typeof e?new RegExp(e):e).test(" ")}function at(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ct(e,t){const n=function(e){"string"==typeof e&&(e=new RegExp(e));const t=e,n=e.source;let r=0;function i(){let e,s="";function o(e){s+=n.substr(r,e),r+=e}function a(e){s+="(?:"+n.substr(r,e)+"|$)",r+=e}for(;r",r)-r+1);break;default:a(2)}break;case"[":e=/\[(?:\\.|.)*?\]/g,e.lastIndex=r,e=e.exec(n)||[],a(e[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":e=/\{\d+,?\d*\}/g,e.lastIndex=r,e=e.exec(n),e?o(e[0].length):a(1);break;case"(":if("?"===n[r+1])switch(n[r+2]){case":":s+="(?:",r+=3,s+=i()+"|$)";break;case"=":s+="(?=",r+=3,s+=i()+")";break;case"!":e=r,r+=3,i(),s+=n.substr(e,r-e);break;case"<":switch(n[r+3]){case"=":case"!":e=r,r+=4,i(),s+=n.substr(e,r-e);break;default:o(n.indexOf(">",r)-r+1),s+=i()+"|$)"}}else o(1),s+=i()+"|$)";break;case")":return++r,s;default:a(1)}return s}return new RegExp(i(),e.flags)}(e),r=t.match(n);return!!r&&r[0].length>0}function lt(e,t){const n=new Set,r=function(e){return e.rules.find((e=>X(e)&&e.entry))}(e);if(!r)return new Set(e.rules);const i=[r].concat(function(e){return e.rules.filter((e=>te(e)&&e.hidden))}(e));for(const o of i)ut(o,n,t);const s=new Set;for(const o of e.rules)(n.has(o.name)||te(o)&&o.hidden)&&s.add(o);return s}function ut(e,t,n){t.add(e.name),De(e).forEach((e=>{if(Ee(e)||n&&Se(e)){const r=e.rule.ref;r&&!t.has(r.name)&&ut(r,t,n)}}))}function dt(e,t,n){if(!e||!t)return;const r=ht(e,t,e.astNode,!0);return 0!==r.length?r[n=void 0!==n?Math.max(0,Math.min(n,r.length-1)):0]:void 0}function ht(e,t,n,r){if(!r){const n=_e(e.grammarSource,ue);if(n&&n.feature===t)return[e]}return a(e)&&e.astNode===n?e.content.flatMap((e=>ht(e,t,n,!1))):[]}function ft(e,t,n){if(e.astNode!==n)return[];if(Ae(e.grammarSource)&&e.grammarSource.value===t)return[e];const r=T(e).iterator();let i;const s=[];do{if(i=r.next(),!i.done){const e=i.value;e.astNode===n?Ae(e.grammarSource)&&e.grammarSource.value===t&&s.push(e):r.prune()}}while(!i.done);return s}function pt(e){let t=e;return K(t)&&(oe(t.$container)?t=t.$container.$container:X(t.$container)?t=t.$container:N(t.$container)),mt(e,t,new Map)}function mt(e,t,n){var r,i;function s(t,r){let i;return _e(t,ue)||(i=mt(r,r,n)),n.set(e,i),i}if(n.has(e))return n.get(e);n.set(e,void 0);for(const o of De(t)){if(ue(o)&&"name"===o.feature.toLowerCase())return n.set(e,o),o;if(Ee(o)&&X(o.rule.ref))return s(o,o.rule.ref);if(i=o,Oe.isInstance(i,J)&&(null===(r=o.typeRef)||void 0===r?void 0:r.ref))return s(o,o.typeRef.ref)}}function gt(e){return yt(e,new Set)}function yt(e,t){if(t.has(e))return!0;t.add(e);for(const n of De(e))if(Ee(n)){if(!n.rule.ref)return!1;if(X(n.rule.ref)&&!yt(n.rule.ref,t))return!1}else{if(ue(n))return!1;if(oe(n))return!1}return Boolean(e.definition)}function At(e){if(e.inferredType)return e.inferredType.name;if(e.dataType)return e.dataType;if(e.returnType){const t=e.returnType.ref;if(t){if(X(t))return t.name;if(j(t)||re(t))return t.name}}}function Tt(e){var t,n;if(X(e))return gt(e)?e.name:null!==(t=At(e))&&void 0!==t?t:e.name;if(j(e)||re(e)||(n=e,Oe.isInstance(n,Q)))return e.name;if(oe(e)){const t=function(e){var t;if(e.inferredType)return e.inferredType.name;if(null===(t=e.type)||void 0===t?void 0:t.ref)return Tt(e.type.ref);return}(e);if(t)return t}else if(K(e))return e.name;throw new Error("Cannot get name of Unknown Type")}function vt(e){const t={s:!1,i:!1,u:!1},n=Et(e.definition,t),r=Object.entries(t).filter((([,e])=>e)).map((([e])=>e)).join("");return new RegExp(n,r)}const Rt=/[\s\S]/.source;function Et(e,t){if(s=e,Oe.isInstance(s,ke))return xt((i=e).elements.map((e=>Et(e))).join("|"),{cardinality:i.cardinality,lookahead:i.lookahead});if(function(e){return Oe.isInstance(e,xe)}(e))return xt((r=e).elements.map((e=>Et(e))).join(""),{cardinality:r.cardinality,lookahead:r.lookahead});if(function(e){return Oe.isInstance(e,de)}(e))return function(e){if(e.right)return xt(`[${kt(e.left)}-${kt(e.right)}]`,{cardinality:e.cardinality,lookahead:e.lookahead,wrap:!1});return xt(kt(e.left),{cardinality:e.cardinality,lookahead:e.lookahead,wrap:!1})}(e);if(Se(e)){const t=e.rule.ref;if(!t)throw new Error("Missing rule reference.");return xt(Et(t.definition),{cardinality:e.cardinality,lookahead:e.lookahead})}if(function(e){return Oe.isInstance(e,Te)}(e))return function(e){return xt(`(?!${Et(e.terminal)})${Rt}*?`,{cardinality:e.cardinality,lookahead:e.lookahead})}(e);if(function(e){return Oe.isInstance(e,$e)}(e))return xt(`${Rt}*?${Et((n=e).terminal)}`,{cardinality:n.cardinality,lookahead:n.lookahead});if(function(e){return Oe.isInstance(e,ve)}(e)){const n=e.regex.lastIndexOf("/"),r=e.regex.substring(1,n),i=e.regex.substring(n+1);return t&&(t.i=i.includes("i"),t.s=i.includes("s"),t.u=i.includes("u")),xt(r,{cardinality:e.cardinality,lookahead:e.lookahead,wrap:!1})}if(function(e){return Oe.isInstance(e,we)}(e))return xt(Rt,{cardinality:e.cardinality,lookahead:e.lookahead});throw new Error(`Invalid terminal element: ${null==e?void 0:e.$type}`);var n,r,i,s}function kt(e){return at(e.value)}function xt(e,t){var n;return(!1!==t.wrap||t.lookahead)&&(e=`(${null!==(n=t.lookahead)&&void 0!==n?n:""}${e})`),t.cardinality?`${e}${t.cardinality}`:e}var It=n(3129),St=n(6064),Nt=n(570),Ct=n(2185),$t=n(2540),wt=n(4350);function Lt(e){function t(){}t.prototype=e;const n=new t;function r(){return typeof n.bar}return r(),r(),e}const Ot=function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(i);++r{t.accept(e)}))}}class sn extends rn{constructor(e){super([]),this.idx=1,jt(this,Yt(e,(e=>void 0!==e)))}set definition(e){}get definition(){return void 0!==this.referencedRule?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class on extends rn{constructor(e){super(e.definition),this.orgText="",jt(this,Yt(e,(e=>void 0!==e)))}}class an extends rn{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,jt(this,Yt(e,(e=>void 0!==e)))}}class cn extends rn{constructor(e){super(e.definition),this.idx=1,jt(this,Yt(e,(e=>void 0!==e)))}}class ln extends rn{constructor(e){super(e.definition),this.idx=1,jt(this,Yt(e,(e=>void 0!==e)))}}class un extends rn{constructor(e){super(e.definition),this.idx=1,jt(this,Yt(e,(e=>void 0!==e)))}}class dn extends rn{constructor(e){super(e.definition),this.idx=1,jt(this,Yt(e,(e=>void 0!==e)))}}class hn extends rn{constructor(e){super(e.definition),this.idx=1,jt(this,Yt(e,(e=>void 0!==e)))}}class fn extends rn{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,jt(this,Yt(e,(e=>void 0!==e)))}}class pn{constructor(e){this.idx=1,jt(this,Yt(e,(e=>void 0!==e)))}accept(e){e.visit(this)}}function mn(e){function t(e){return(0,Ct.A)(e,mn)}if(e instanceof sn){const t={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return(0,Pt.A)(e.label)&&(t.label=e.label),t}if(e instanceof an)return{type:"Alternative",definition:t(e.definition)};if(e instanceof cn)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof ln)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof un)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:mn(new pn({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof hn)return{type:"RepetitionWithSeparator",idx:e.idx,separator:mn(new pn({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof dn)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof fn)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof pn){const t={type:"Terminal",name:e.terminalType.name,label:nn(e.terminalType),idx:e.idx};(0,Pt.A)(e.label)&&(t.terminalLabel=e.label);const n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=tn(n)?n.source:n),t}if(e instanceof on)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}class gn{visit(e){const t=e;switch(t.constructor){case sn:return this.visitNonTerminal(t);case an:return this.visitAlternative(t);case cn:return this.visitOption(t);case ln:return this.visitRepetitionMandatory(t);case un:return this.visitRepetitionMandatoryWithSeparator(t);case hn:return this.visitRepetitionWithSeparator(t);case dn:return this.visitRepetition(t);case fn:return this.visitAlternation(t);case pn:return this.visitTerminal(t);case on:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}var yn=n(5601),An=n(4753);const Tn=function(e,t){var n;return(0,An.A)(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n};var vn=n(3145),Rn=n(6599);const En=function(e,t,n){var r=(0,vn.A)(e)?yn.A:Tn;return n&&(0,Rn.A)(e,t,n)&&(t=void 0),r(e,(0,Ht.A)(t,3))};var kn=n(7617),xn=Math.max;const In=function(e,t,n,r){e=(0,Ft.A)(e)?e:(0,St.A)(e),n=n&&!r?(0,bt.A)(n):0;var i=e.length;return n<0&&(n=xn(i+n,0)),(0,Pt.A)(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&(0,kn.A)(e,t,n)>-1};const Sn=function(e,t){for(var n=-1,r=null==e?0:e.length;++n$n(e,t))):!(e instanceof sn&&In(t,e))&&(e instanceof rn&&(e instanceof sn&&t.push(e),Cn(e.definition,(e=>$n(e,t))))))}function wn(e){if(e instanceof sn)return"SUBRULE";if(e instanceof cn)return"OPTION";if(e instanceof fn)return"OR";if(e instanceof ln)return"AT_LEAST_ONE";if(e instanceof un)return"AT_LEAST_ONE_SEP";if(e instanceof hn)return"MANY_SEP";if(e instanceof dn)return"MANY";if(e instanceof pn)return"CONSUME";throw Error("non exhaustive match")}class Ln{walk(e,t=[]){(0,It.A)(e.definition,((n,r)=>{const i=_t(e.definition,r+1);if(n instanceof sn)this.walkProdRef(n,i,t);else if(n instanceof pn)this.walkTerminal(n,i,t);else if(n instanceof an)this.walkFlat(n,i,t);else if(n instanceof cn)this.walkOption(n,i,t);else if(n instanceof ln)this.walkAtLeastOne(n,i,t);else if(n instanceof un)this.walkAtLeastOneSep(n,i,t);else if(n instanceof hn)this.walkManySep(n,i,t);else if(n instanceof dn)this.walkMany(n,i,t);else{if(!(n instanceof fn))throw Error("non exhaustive match");this.walkOr(n,i,t)}}))}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){const r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){const r=[new cn({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){const r=On(e,t,n);this.walk(e,r)}walkMany(e,t,n){const r=[new cn({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){const r=On(e,t,n);this.walk(e,r)}walkOr(e,t,n){const r=t.concat(n);(0,It.A)(e.definition,(e=>{const t=new an({definition:[e]});this.walk(t,r)}))}}function On(e,t,n){return[new cn({definition:[new pn({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}var bn=n(171);const _n=function(e){return e&&e.length?(0,bn.A)(e):[]};var Pn=n(129);function Mn(e){if(e instanceof sn)return Mn(e.referencedRule);if(e instanceof pn)return[e.terminalType];if(function(e){return e instanceof an||e instanceof cn||e instanceof dn||e instanceof ln||e instanceof un||e instanceof hn||e instanceof pn||e instanceof on}(e))return function(e){let t=[];const n=e.definition;let r,i=0,s=n.length>i,o=!0;for(;s&&o;)r=n[i],o=$n(r),t=t.concat(Mn(r)),i+=1,s=n.length>i;return _n(t)}(e);if(function(e){return e instanceof fn}(e))return function(e){const t=(0,Ct.A)(e.definition,(e=>Mn(e)));return _n((0,Pn.A)(t))}(e);throw Error("non exhaustive match")}const Dn="_~IN~_";class Un extends Ln{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const r=(i=e.referencedRule,s=e.idx,i.name+s+Dn+this.topProd.name);var i,s;const o=t.concat(n),a=Mn(new an({definition:o}));this.follows[r]=a}}var Fn=n(707),Gn=n(5237),Kn=n(1031),Bn=n(2837);const jn=function(e){if("function"!=typeof e)throw new TypeError("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}};const Vn=function(e,t){return((0,vn.A)(e)?Kn.A:Bn.A)(e,jn((0,Ht.A)(t,3)))};var Hn=n(1863),Wn=Math.max;const zn=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:(0,bt.A)(n);return i<0&&(i=Wn(r+i,0)),(0,kn.A)(e,t,i)};var Yn=n(6800),Xn=n(9949),qn=n(6691),Qn=n(9532),Jn=n(3924),Zn=n(9584);const er=function(e,t,n,r){var i=-1,s=Qn.A,o=!0,a=e.length,c=[],l=t.length;if(!a)return c;n&&(t=(0,Vt.A)(t,(0,Jt.A)(n))),r?(s=Jn.A,o=!1):t.length>=200&&(s=Zn.A,o=!1,t=new qn.A(t));e:for(;++i\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),cr(`${pr}\n\tFailed parsing: < ${e.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function gr(e,t,n){switch(e.type){case"Disjunction":for(let i=0;i{if("number"==typeof e)yr(e,t,n);else{const r=e;if(!0===n)for(let e=r.from;e<=r.to;e++)yr(e,t,n);else{for(let e=r.from;e<=r.to&&e=Fr){const e=r.from>=Fr?r.from:Fr,n=r.to,i=Kr(e),s=Kr(n);for(let r=i;r<=s;r++)t[r]=r}}}}));break;case"Group":gr(s.value,t,n);break;default:throw Error("Non Exhaustive Match")}const o=void 0!==s.quantifier&&0===s.quantifier.atLeast;if("Group"===s.type&&!1===Tr(s)||"Group"!==s.type&&!1===o)break}break;default:throw Error("non exhaustive match!")}return(0,St.A)(t)}function yr(e,t,n){const r=Kr(e);t[r]=r,!0===n&&function(e,t){const n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){const e=Kr(r.charCodeAt(0));t[e]=e}else{const e=n.toLowerCase();if(e!==n){const n=Kr(e.charCodeAt(0));t[n]=n}}}(e,t)}function Ar(e,t){return(0,ar.A)(e.value,(e=>{if("number"==typeof e)return In(t,e);{const n=e;return void 0!==(0,ar.A)(t,(e=>n.from<=e&&e<=n.to))}}))}function Tr(e){const t=e.quantifier;return!(!t||0!==t.atLeast)||!!e.value&&((0,vn.A)(e.value)?Cn(e.value,Tr):Tr(e.value))}class vr extends tt{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(!0!==this.found){switch(e.type){case"Lookahead":return void this.visitLookahead(e);case"NegativeLookahead":return void this.visitNegativeLookahead(e)}super.visitChildren(e)}}visitCharacter(e){In(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?void 0===Ar(e,this.targetCharCodes)&&(this.found=!0):void 0!==Ar(e,this.targetCharCodes)&&(this.found=!0)}}function Rr(e,t){if(t instanceof RegExp){const n=hr(t),r=new vr(e);return r.visit(n),r.found}return void 0!==(0,ar.A)(t,(t=>In(e,t.charCodeAt(0))))}const Er="PATTERN",kr="defaultMode",xr="modes";let Ir="boolean"==typeof new RegExp("(?:)").sticky;function Sr(e,t){const n=(t=(0,Gn.A)(t,{useSticky:Ir,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:(e,t)=>t()})).tracer;let r;n("initCharCodeToOptimizedIndexMap",(()=>{!function(){if((0,Nt.A)(Gr)){Gr=new Array(65536);for(let e=0;e<65536;e++)Gr[e]=e>255?255+~~(e/255):e}}()})),n("Reject Lexer.NA",(()=>{r=Vn(e,(e=>e[Er]===ii.NA))}));let i,s,o,a,c,l,u,d,h,f,p,m=!1;n("Transform Patterns",(()=>{m=!1,i=(0,Ct.A)(r,(e=>{const n=e[Er];if(tn(n)){const e=n.source;return 1!==e.length||"^"===e||"$"===e||"."===e||n.ignoreCase?2!==e.length||"\\"!==e[0]||In(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],e[1])?t.useSticky?Lr(n):wr(n):e[1]:e}if((0,Hn.A)(n))return m=!0,{exec:n};if("object"==typeof n)return m=!0,n;if("string"==typeof n){if(1===n.length)return n;{const e=n.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),r=new RegExp(e);return t.useSticky?Lr(r):wr(r)}}throw Error("non exhaustive match")}))})),n("misc mapping",(()=>{s=(0,Ct.A)(r,(e=>e.tokenTypeIdx)),o=(0,Ct.A)(r,(e=>{const t=e.GROUP;if(t!==ii.SKIPPED){if((0,Pt.A)(t))return t;if((0,Fn.A)(t))return!1;throw Error("non exhaustive match")}})),a=(0,Ct.A)(r,(e=>{const t=e.LONGER_ALT;if(t){return(0,vn.A)(t)?(0,Ct.A)(t,(e=>zn(r,e))):[zn(r,t)]}})),c=(0,Ct.A)(r,(e=>e.PUSH_MODE)),l=(0,Ct.A)(r,(e=>(0,$t.A)(e,"POP_MODE")))})),n("Line Terminator Handling",(()=>{const e=Dr(t.lineTerminatorCharacters);u=(0,Ct.A)(r,(e=>!1)),"onlyOffset"!==t.positionTracking&&(u=(0,Ct.A)(r,(t=>(0,$t.A)(t,"LINE_BREAKS")?!!t.LINE_BREAKS:!1===Mr(t,e)&&Rr(e,t.PATTERN))))})),n("Misc Mapping #2",(()=>{d=(0,Ct.A)(r,br),h=(0,Ct.A)(i,_r),f=(0,Yn.A)(r,((e,t)=>{const n=t.GROUP;return(0,Pt.A)(n)&&n!==ii.SKIPPED&&(e[n]=[]),e}),{}),p=(0,Ct.A)(i,((e,t)=>({pattern:i[t],longerAlt:a[t],canLineTerminator:u[t],isCustom:d[t],short:h[t],group:o[t],push:c[t],pop:l[t],tokenTypeIdx:s[t],tokenType:r[t]})))}));let g=!0,y=[];return t.safeMode||n("First Char Optimization",(()=>{y=(0,Yn.A)(r,((e,n,r)=>{if("string"==typeof n.PATTERN){const t=Kr(n.PATTERN.charCodeAt(0));Ur(e,t,p[r])}else if((0,vn.A)(n.START_CHARS_HINT)){let t;(0,It.A)(n.START_CHARS_HINT,(n=>{const i=Kr("string"==typeof n?n.charCodeAt(0):n);t!==i&&(t=i,Ur(e,i,p[r]))}))}else if(tn(n.PATTERN))if(n.PATTERN.unicode)g=!1,t.ensureOptimizations&&cr(`${pr}\tUnable to analyze < ${n.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const i=mr(n.PATTERN,t.ensureOptimizations);(0,Nt.A)(i)&&(g=!1),(0,It.A)(i,(t=>{Ur(e,t,p[r])}))}else t.ensureOptimizations&&cr(`${pr}\tTokenType: <${n.name}> is using a custom token pattern without providing parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),g=!1;return e}),[])})),{emptyGroups:f,patternIdxToConfig:p,charCodeToPatternIdxToConfig:y,hasCustom:m,canBeOptimized:g}}function Nr(e,t){let n=[];const r=function(e){const t=(0,Xn.A)(e,(e=>!(0,$t.A)(e,Er))),n=(0,Ct.A)(t,(e=>({message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:ni.MISSING_PATTERN,tokenTypes:[e]}))),r=ir(e,t);return{errors:n,valid:r}}(e);n=n.concat(r.errors);const i=function(e){const t=(0,Xn.A)(e,(e=>{const t=e[Er];return!(tn(t)||(0,Hn.A)(t)||(0,$t.A)(t,"exec")||(0,Pt.A)(t))})),n=(0,Ct.A)(t,(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:ni.INVALID_PATTERN,tokenTypes:[e]}))),r=ir(e,t);return{errors:n,valid:r}}(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(function(e){let t=[];const n=(0,Xn.A)(e,(e=>tn(e[Er])));return t=t.concat(function(e){class t extends tt{constructor(){super(...arguments),this.found=!1}visitEndAnchor(e){this.found=!0}}const n=(0,Xn.A)(e,(e=>{const n=e.PATTERN;try{const e=hr(n),r=new t;return r.visit(e),r.found}catch(r){return Cr.test(n.source)}})),r=(0,Ct.A)(n,(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:ni.EOI_ANCHOR_FOUND,tokenTypes:[e]})));return r}(n)),t=t.concat(function(e){class t extends tt{constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}const n=(0,Xn.A)(e,(e=>{const n=e.PATTERN;try{const e=hr(n),r=new t;return r.visit(e),r.found}catch(r){return $r.test(n.source)}})),r=(0,Ct.A)(n,(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:ni.SOI_ANCHOR_FOUND,tokenTypes:[e]})));return r}(n)),t=t.concat(function(e){const t=(0,Xn.A)(e,(e=>{const t=e[Er];return t instanceof RegExp&&(t.multiline||t.global)})),n=(0,Ct.A)(t,(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:ni.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]})));return n}(n)),t=t.concat(function(e){const t=[];let n=(0,Ct.A)(e,(n=>(0,Yn.A)(e,((e,r)=>(n.PATTERN.source!==r.PATTERN.source||In(t,r)||r.PATTERN===ii.NA||(t.push(r),e.push(r)),e)),[])));n=sr(n);const r=(0,Xn.A)(n,(e=>e.length>1)),i=(0,Ct.A)(r,(e=>{const t=(0,Ct.A)(e,(e=>e.name));return{message:`The same RegExp pattern ->${or(e).PATTERN}<-has been used in all of the following Token Types: ${t.join(", ")} <-`,type:ni.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}}));return i}(n)),t=t.concat(function(e){const t=(0,Xn.A)(e,(e=>e.PATTERN.test(""))),n=(0,Ct.A)(t,(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:ni.EMPTY_MATCH_PATTERN,tokenTypes:[e]})));return n}(n)),t}(s)),n=n.concat(function(e){const t=(0,Xn.A)(e,(e=>{if(!(0,$t.A)(e,"GROUP"))return!1;const t=e.GROUP;return t!==ii.SKIPPED&&t!==ii.NA&&!(0,Pt.A)(t)})),n=(0,Ct.A)(t,(e=>({message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:ni.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]})));return n}(s)),n=n.concat(function(e,t){const n=(0,Xn.A)(e,(e=>void 0!==e.PUSH_MODE&&!In(t,e.PUSH_MODE))),r=(0,Ct.A)(n,(e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:ni.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]})));return r}(s,t)),n=n.concat(function(e){const t=[],n=(0,Yn.A)(e,((e,t,n)=>{const r=t.PATTERN;return r===ii.NA||((0,Pt.A)(r)?e.push({str:r,idx:n,tokenType:t}):tn(r)&&function(e){const t=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return void 0===(0,ar.A)(t,(t=>-1!==e.source.indexOf(t)))}(r)&&e.push({str:r.source,idx:n,tokenType:t})),e}),[]);return(0,It.A)(e,((e,r)=>{(0,It.A)(n,(({str:n,idx:i,tokenType:s})=>{if(r${s.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:n,type:ni.UNREACHABLE_PATTERN,tokenTypes:[e,s]})}}))})),t}(s)),n}const Cr=/[^\\][$]/;const $r=/[^\\[][\^]|^\^/;function wr(e){const t=e.ignoreCase?"i":"";return new RegExp(`^(?:${e.source})`,t)}function Lr(e){const t=e.ignoreCase?"iy":"y";return new RegExp(`${e.source}`,t)}function Or(e,t,n){const r=[];let i=!1;const s=sr((0,Pn.A)((0,St.A)(e.modes))),o=Vn(s,(e=>e[Er]===ii.NA)),a=Dr(n);return t&&(0,It.A)(o,(e=>{const t=Mr(e,a);if(!1!==t){const n=function(e,t){if(t.issue===ni.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <${e.name}> Token Type\n\t Root cause: ${t.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===ni.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option.\n\tThe problem is in the <${e.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}(e,t),i={message:n,type:t.issue,tokenType:e};r.push(i)}else(0,$t.A)(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(i=!0):Rr(a,e.PATTERN)&&(i=!0)})),t&&!i&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:ni.NO_LINE_BREAKS_FLAGS}),r}function br(e){const t=e.PATTERN;if(tn(t))return!1;if((0,Hn.A)(t))return!0;if((0,$t.A)(t,"exec"))return!0;if((0,Pt.A)(t))return!1;throw Error("non exhaustive match")}function _r(e){return!(!(0,Pt.A)(e)||1!==e.length)&&e.charCodeAt(0)}const Pr={test:function(e){const t=e.length;for(let n=this.lastIndex;n(0,Pt.A)(e)?e.charCodeAt(0):e))}function Ur(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}const Fr=256;let Gr=[];function Kr(e){return ee.CATEGORIES))));const e=ir(n,t);t=t.concat(e),(0,Nt.A)(e)?r=!1:n=e}return t}(e);!function(e){(0,It.A)(e,(e=>{var t;Jr(e)||(Xr[Yr]=e,e.tokenTypeIdx=Yr++),Zr(e)&&!(0,vn.A)(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Zr(e)||(e.CATEGORIES=[]),t=e,(0,$t.A)(t,"categoryMatches")||(e.categoryMatches=[]),function(e){return(0,$t.A)(e,"categoryMatchesMap")}(e)||(e.categoryMatchesMap={})}))}(t),function(e){(0,It.A)(e,(e=>{Qr([],e)}))}(t),function(e){(0,It.A)(e,(e=>{e.categoryMatches=[],(0,It.A)(e.categoryMatchesMap,((t,n)=>{e.categoryMatches.push(Xr[n].tokenTypeIdx)}))}))}(t),(0,It.A)(t,(e=>{e.isParent=e.categoryMatches.length>0}))}function Qr(e,t){(0,It.A)(e,(e=>{t.categoryMatchesMap[e.tokenTypeIdx]=!0})),(0,It.A)(t.CATEGORIES,(n=>{const r=e.concat(t);In(r,n)||Qr(r,n)}))}function Jr(e){return(0,$t.A)(e,"tokenTypeIdx")}function Zr(e){return(0,$t.A)(e,"CATEGORIES")}function ei(e){return(0,$t.A)(e,"tokenTypeIdx")}const ti={buildUnableToPopLexerModeMessage:e=>`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(e,t,n,r,i)=>`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`};var ni;!function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"}(ni||(ni={}));const ri={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:ti,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(ri);class ii{constructor(e,t=ri){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(e,t)=>{if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=Hr(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()},"boolean"==typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=jt({},ri,t);const n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof n&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",(()=>{let n,r=!0;this.TRACE_INIT("Lexer Config handling",(()=>{if(this.config.lineTerminatorsPattern===ri.lineTerminatorsPattern)this.config.lineTerminatorsPattern=Pr;else if(this.config.lineTerminatorCharacters===ri.lineTerminatorCharacters)throw Error("Error: Missing property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),(0,vn.A)(e)?n={modes:{defaultMode:(0,wt.A)(e)},defaultMode:kr}:(r=!1,n=(0,wt.A)(e))})),!1===this.config.skipValidations&&(this.TRACE_INIT("performRuntimeChecks",(()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e){const t=[];return(0,$t.A)(e,kr)||t.push({message:"A MultiMode Lexer cannot be initialized without a <"+kr+"> property in its definition\n",type:ni.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),(0,$t.A)(e,xr)||t.push({message:"A MultiMode Lexer cannot be initialized without a property in its definition\n",type:ni.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),(0,$t.A)(e,xr)&&(0,$t.A)(e,kr)&&!(0,$t.A)(e.modes,e.defaultMode)&&t.push({message:`A MultiMode Lexer cannot be initialized with a ${kr}: <${e.defaultMode}>which does not exist\n`,type:ni.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),(0,$t.A)(e,xr)&&(0,It.A)(e.modes,((e,n)=>{(0,It.A)(e,((r,i)=>{if((0,Fn.A)(r))t.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${n}> at index: <${i}>\n`,type:ni.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if((0,$t.A)(r,"LONGER_ALT")){const i=(0,vn.A)(r.LONGER_ALT)?r.LONGER_ALT:[r.LONGER_ALT];(0,It.A)(i,(i=>{(0,Fn.A)(i)||In(e,i)||t.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${r.name}> outside of mode <${n}>\n`,type:ni.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})}))}}))})),t}(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),this.TRACE_INIT("performWarningRuntimeChecks",(()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(Or(n,this.trackStartLines,this.config.lineTerminatorCharacters))}))),n.modes=n.modes?n.modes:{},(0,It.A)(n.modes,((e,t)=>{n.modes[t]=Vn(e,(e=>(0,Fn.A)(e)))}));const i=(0,Kt.A)(n.modes);if((0,It.A)(n.modes,((e,n)=>{this.TRACE_INIT(`Mode: <${n}> processing`,(()=>{if(this.modes.push(n),!1===this.config.skipValidations&&this.TRACE_INIT("validatePatterns",(()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Nr(e,i))})),(0,Nt.A)(this.lexerDefinitionErrors)){let r;qr(e),this.TRACE_INIT("analyzeTokenTypes",(()=>{r=Sr(e,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})})),this.patternIdxToConfig[n]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[n]=r.charCodeToPatternIdxToConfig,this.emptyGroups=jt({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[n]=r.canBeOptimized}}))})),this.defaultMode=n.defaultMode,!(0,Nt.A)(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const e=(0,Ct.A)(this.lexerDefinitionErrors,(e=>e.message)).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+e)}(0,It.A)(this.lexerDefinitionWarning,(e=>{lr(e.message)})),this.TRACE_INIT("Choosing sub-methods implementations",(()=>{if(Ir?(this.chopInput=Br.A,this.match=this.matchWithTest):(this.updateLastIndex=jr.A,this.match=this.matchWithExec),r&&(this.handleModes=jr.A),!1===this.trackStartLines&&(this.computeNewColumn=Br.A),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=jr.A),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else{if(!/onlyOffset/i.test(this.config.positionTracking))throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.createTokenInstance=this.createOffsetOnlyToken}this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)})),this.TRACE_INIT("Failed Optimization Warnings",(()=>{const e=(0,Yn.A)(this.canModeBeOptimized,((e,t,n)=>(!1===t&&e.push(n),e)),[]);if(t.ensureOptimizations&&!(0,Nt.A)(e))throw Error(`Lexer Modes: < ${e.join(", ")} > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.`)})),this.TRACE_INIT("clearRegExpParserCache",(()=>{ur={}})),this.TRACE_INIT("toFastProperties",(()=>{Lt(this)}))}))}tokenize(e,t=this.defaultMode){if(!(0,Nt.A)(this.lexerDefinitionErrors)){const e=(0,Ct.A)(this.lexerDefinitionErrors,(e=>e.message)).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+e)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let n,r,i,s,o,a,c,l,u,d,h,f,p,m,g;const y=e,A=y.length;let T=0,v=0;const R=this.hasCustom?0:Math.floor(e.length/10),E=new Array(R),k=[];let x=this.trackStartLines?1:void 0,I=this.trackStartLines?1:void 0;const S=function(e){const t={},n=(0,Kt.A)(e);return(0,It.A)(n,(n=>{const r=e[n];if(!(0,vn.A)(r))throw Error("non exhaustive match");t[n]=[]})),t}(this.emptyGroups),N=this.trackStartLines,C=this.config.lineTerminatorsPattern;let $=0,w=[],L=[];const O=[],b=[];let _;function P(){return w}function M(e){const t=Kr(e),n=L[t];return void 0===n?b:n}Object.freeze(b);const D=e=>{if(1===O.length&&void 0===e.tokenType.PUSH_MODE){const t=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);k.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{O.pop();const e=(0,Vr.A)(O);w=this.patternIdxToConfig[e],L=this.charCodeToPatternIdxToConfig[e],$=w.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;_=L&&t?M:P}};function U(e){O.push(e),L=this.charCodeToPatternIdxToConfig[e],w=this.patternIdxToConfig[e],$=w.length,$=w.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;_=L&&t?M:P}let F;U.call(this,t);const G=this.config.recoveryEnabled;for(;Ta.length){a=s,c=l,F=t;break}}}break}}if(null!==a){if(u=a.length,d=F.group,void 0!==d&&(h=F.tokenTypeIdx,f=this.createTokenInstance(a,T,h,F.tokenType,x,I,u),this.handlePayload(f,c),!1===d?v=this.addToken(E,v,f):S[d].push(f)),e=this.chopInput(e,u),T+=u,I=this.computeNewColumn(I,u),!0===N&&!0===F.canLineTerminator){let e,t,n=0;C.lastIndex=0;do{e=C.test(a),!0===e&&(t=C.lastIndex-1,n++)}while(!0===e);0!==n&&(x+=n,I=u-t,this.updateTokenEndLineColumnLocation(f,d,t,n,x,I,u))}this.handleModes(F,D,U,f)}else{const t=T,n=x,i=I;let s=!1===G;for(;!1===s&&T`Expecting ${oi(e)?`--\x3e ${si(e)} <--`:`token of type --\x3e ${e.name} <--`} but found --\x3e '${t.image}' <--`,buildNotAllInputParsedMessage:({firstRedundant:e,ruleName:t})=>"Redundant input, expecting EOF but found: "+e.image,buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:n,customUserDescription:r,ruleName:i}){const s="Expecting: ",o="\nbut found: '"+or(t).image+"'";if(r)return s+r+o;{const t=(0,Yn.A)(e,((e,t)=>e.concat(t)),[]),n=(0,Ct.A)(t,(e=>`[${(0,Ct.A)(e,(e=>si(e))).join(", ")}]`));return s+`one of these possible Token sequences:\n${(0,Ct.A)(n,((e,t)=>` ${t+1}. ${e}`)).join("\n")}`+o}},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:n,ruleName:r}){const i="Expecting: ",s="\nbut found: '"+or(t).image+"'";if(n)return i+n+s;return i+`expecting at least one iteration which starts with one of these possible Token sequences::\n <${(0,Ct.A)(e,(e=>`[${(0,Ct.A)(e,(e=>si(e))).join(",")}]`)).join(" ,")}>`+s}};Object.freeze(vi);const Ri={buildRuleNotFoundError:(e,t)=>"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"},Ei={buildDuplicateFoundError(e,t){const n=e.name,r=or(t),i=r.idx,s=wn(r),o=(a=r)instanceof pn?a.terminalType.name:a instanceof sn?a.nonTerminalName:"";var a;let c=`->${s}${i>0?i:""}<- ${o?`with argument: ->${o}<-`:""}\n appears more than once (${t.length} times) in the top level rule: ->${n}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,"\n"),c},buildNamespaceConflictError:e=>`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`,buildAlternationPrefixAmbiguityError(e){const t=(0,Ct.A)(e.prefixPath,(e=>si(e))).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(e){const t=(0,Ct.A)(e.prefixPath,(e=>si(e))).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;let r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\n`;return r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r},buildEmptyRepetitionError(e){let t=wn(e.repetition);0!==e.repetition.idx&&(t+=e.repetition.idx);return`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError:e=>"deprecated",buildEmptyAlternationError:e=>`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in inside <${e.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`,buildTooManyAlternativesError:e=>`An Alternation cannot have more than 256 alternatives:\n inside <${e.topLevelRule.name}> Rule.\n has ${e.alternation.definition.length+1} alternatives.`,buildLeftRecursionError(e){const t=e.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${`${t} --\x3e ${(0,Ct.A)(e.leftRecursionPath,(e=>e.name)).concat([t]).join(" --\x3e ")}`}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError:e=>"deprecated",buildDuplicateRuleNameError(e){let t;t=e.topLevelRule instanceof on?e.topLevelRule.name:e.topLevelRule;return`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};class ki extends gn{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){(0,It.A)((0,St.A)(this.nameToTopRule),(e=>{this.currTopLevel=e,e.accept(this)}))}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:eo.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}const xi=function(e,t){return(0,tr.A)((0,Ct.A)(e,t),1)};var Ii=n(5745);const Si=function(e,t,n,r){for(var i=-1,s=null==e?0:e.length;++i{!1===(0,Nt.A)(e.definition)&&(r=s(e.definition))})),r;if(!(t instanceof pn))throw Error("non exhaustive match");n.push(t.terminalType)}}i++}return r.push({partialPath:n,suffixDef:_t(e,i)}),r}function Gi(e,t,n,r){const i="EXIT_NONE_TERMINAL",s=[i],o="EXIT_ALTERNATIVE";let a=!1;const c=t.length,l=c-r-1,u=[],d=[];for(d.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!(0,Nt.A)(d);){const e=d.pop();if(e===o){a&&(0,Vr.A)(d).idx<=l&&d.pop();continue}const r=e.def,h=e.idx,f=e.ruleStack,p=e.occurrenceStack;if((0,Nt.A)(r))continue;const m=r[0];if(m===i){const e={idx:h,def:_t(r),ruleStack:Li(f),occurrenceStack:Li(p)};d.push(e)}else if(m instanceof pn)if(h=0;t--){const e={idx:h,def:m.definition[t].definition.concat(_t(r)),ruleStack:f,occurrenceStack:p};d.push(e),d.push(o)}else if(m instanceof an)d.push({idx:h,def:m.definition.concat(_t(r)),ruleStack:f,occurrenceStack:p});else{if(!(m instanceof on))throw Error("non exhaustive match");d.push(Ki(m,h,f,p))}}return u}function Ki(e,t,n,r){const i=(0,wt.A)(n);i.push(e.name);const s=(0,wt.A)(r);return s.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:s}}var Bi;function ji(e){if(e instanceof cn||"Option"===e)return Bi.OPTION;if(e instanceof dn||"Repetition"===e)return Bi.REPETITION;if(e instanceof ln||"RepetitionMandatory"===e)return Bi.REPETITION_MANDATORY;if(e instanceof un||"RepetitionMandatoryWithSeparator"===e)return Bi.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof hn||"RepetitionWithSeparator"===e)return Bi.REPETITION_WITH_SEPARATOR;if(e instanceof fn||"Alternation"===e)return Bi.ALTERNATION;throw Error("non exhaustive match")}function Vi(e){const{occurrence:t,rule:n,prodType:r,maxLookahead:i}=e,s=ji(r);return s===Bi.ALTERNATION?Zi(t,n,i):es(t,n,s,i)}function Hi(e,t,n,r){const i=e.length,s=Cn(e,(e=>Cn(e,(e=>1===e.length))));if(t)return function(t){const r=(0,Ct.A)(t,(e=>e.GATE));for(let s=0;s(0,Pn.A)(e))),n=(0,Yn.A)(t,((e,t,n)=>((0,It.A)(t,(t=>{(0,$t.A)(e,t.tokenTypeIdx)||(e[t.tokenTypeIdx]=n),(0,It.A)(t.categoryMatches,(t=>{(0,$t.A)(e,t)||(e[t]=n)}))})),e)),{});return function(){const e=this.LA(1);return n[e.tokenTypeIdx]}}return function(){for(let t=0;t1===e.length)),i=e.length;if(r&&!n){const t=(0,Pn.A)(e);if(1===t.length&&(0,Nt.A)(t[0].categoryMatches)){const e=t[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===e}}{const e=(0,Yn.A)(t,((e,t,n)=>(e[t.tokenTypeIdx]=!0,(0,It.A)(t.categoryMatches,(t=>{e[t]=!0})),e)),[]);return function(){const t=this.LA(1);return!0===e[t.tokenTypeIdx]}}}return function(){e:for(let n=0;nFi([e],1))),r=Xi(n.length),i=(0,Ct.A)(n,(e=>{const t={};return(0,It.A)(e,(e=>{const n=qi(e.partialPath);(0,It.A)(n,(e=>{t[e]=!0}))})),t}));let s=n;for(let o=1;o<=t;o++){const e=s;s=Xi(e.length);for(let n=0;n{const t=qi(e.partialPath);(0,It.A)(t,(e=>{i[n][e]=!0}))}))}}}}return r}function Zi(e,t,n,r){const i=new Yi(e,Bi.ALTERNATION,r);return t.accept(i),Ji(i.result,n)}function es(e,t,n,r){const i=new Yi(e,n);t.accept(i);const s=i.result,o=new zi(t,e,n).startWalking();return Ji([new an({definition:s}),new an({definition:o})],r)}function ts(e,t){e:for(let n=0;nCn(e,(e=>Cn(e,(e=>(0,Nt.A)(e.categoryMatches)))))))}function rs(e,t,n,r){const i=xi(e,(e=>function(e,t){const n=new os;e.accept(n);const r=n.allProductions,i=wi(r,is),s=Yt(i,(e=>e.length>1)),o=(0,Ct.A)((0,St.A)(s),(n=>{const r=or(n),i=t.buildDuplicateFoundError(e,n),s=wn(r),o={message:i,type:eo.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:s,occurrence:r.idx},a=ss(r);return a&&(o.parameter=a),o}));return o}(e,n))),s=function(e,t,n){const r=[],i=(0,Ct.A)(t,(e=>e.name));return(0,It.A)(e,(e=>{const t=e.name;if(In(i,t)){const i=n.buildNamespaceConflictError(e);r.push({message:i,type:eo.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}})),r}(e,t,n),o=xi(e,(e=>function(e,t){const n=new ls;e.accept(n);const r=n.alternations,i=xi(r,(n=>n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:eo.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[]));return i}(e,n))),a=xi(e,(t=>function(e,t,n,r){const i=[],s=(0,Yn.A)(t,((t,n)=>n.name===e.name?t+1:t),0);if(s>1){const t=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:t,type:eo.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}(t,e,r,n)));return i.concat(s,o,a)}function is(e){return`${wn(e)}_#_${e.idx}_#_${ss(e)}`}function ss(e){return e instanceof pn?e.terminalType.name:e instanceof sn?e.nonTerminalName:""}class os extends gn{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function as(e,t,n,r=[]){const i=[],s=cs(t.definition);if((0,Nt.A)(s))return[];{const t=e.name;In(s,e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:eo.LEFT_RECURSION,ruleName:t});const o=ir(s,r.concat([e])),a=xi(o,(t=>{const i=(0,wt.A)(r);return i.push(t),as(e,t,n,i)}));return i.concat(a)}}function cs(e){let t=[];if((0,Nt.A)(e))return t;const n=or(e);if(n instanceof sn)t.push(n.referencedRule);else if(n instanceof an||n instanceof cn||n instanceof ln||n instanceof un||n instanceof hn||n instanceof dn)t=t.concat(cs(n.definition));else if(n instanceof fn)t=(0,Pn.A)((0,Ct.A)(n.definition,(e=>cs(e.definition))));else if(!(n instanceof pn))throw Error("non exhaustive match");const r=$n(n),i=e.length>1;if(r&&i){const n=_t(e);return t.concat(cs(n))}return t}class ls extends gn{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function us(e,t,n){const r=new ls;e.accept(r);let i=r.alternations;i=Vn(i,(e=>!0===e.ignoreAmbiguities));const s=xi(i,(r=>{const i=r.idx,s=r.maxLookahead||t,o=Zi(i,e,s,r),a=function(e,t,n,r){const i=[],s=(0,Yn.A)(e,((n,r,s)=>(!0===t.definition[s].ignoreAmbiguities||(0,It.A)(r,(r=>{const o=[s];(0,It.A)(e,((e,n)=>{s!==n&&ts(e,r)&&!0!==t.definition[n].ignoreAmbiguities&&o.push(n)})),o.length>1&&!ts(i,r)&&(i.push(r),n.push({alts:o,path:r}))})),n)),[]),o=(0,Ct.A)(s,(e=>{const i=(0,Ct.A)(e.alts,(e=>e+1));return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:eo.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:e.alts}}));return o}(o,r,e,n),c=function(e,t,n,r){const i=(0,Yn.A)(e,((e,t,n)=>{const r=(0,Ct.A)(t,(e=>({idx:n,path:e})));return e.concat(r)}),[]),s=sr(xi(i,(e=>{if(!0===t.definition[e.idx].ignoreAmbiguities)return[];const s=e.idx,o=e.path,a=(0,Xn.A)(i,(e=>{return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx{const n=r[t];return e===n||n.categoryMatchesMap[e.tokenTypeIdx]})));var n,r}));return(0,Ct.A)(a,(e=>{const i=[e.idx+1,s+1],o=0===t.idx?"":t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:eo.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:i}}))})));return s}(o,r,e,n);return a.concat(c)}));return s}class ds extends gn{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}function hs(e){const t=(0,Gn.A)(e,{errMsgProvider:Ri}),n={};return(0,It.A)(e.rules,(e=>{n[e.name]=e})),function(e,t){const n=new ki(e,t);return n.resolveRefs(),n.errors}(n,t.errMsgProvider)}const fs="MismatchedTokenException",ps="NoViableAltException",ms="EarlyExitException",gs="NotAllInputParsedException",ys=[fs,ps,ms,gs];function As(e){return In(ys,e.name)}Object.freeze(ys);class Ts extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class vs extends Ts{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=fs}}class Rs extends Ts{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=ps}}class Es extends Ts{constructor(e,t){super(e,t),this.name=gs}}class ks extends Ts{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=ms}}const xs={},Is="InRuleRecoveryException";class Ss extends Error{constructor(e){super(e),this.name=Is}}function Ns(e,t,n,r,i,s,o){const a=this.getKeyForAutomaticLookahead(r,i);let c=this.firstAfterRepMap[a];if(void 0===c){const e=this.getCurrRuleFullName();c=new s(this.getGAstProductions()[e],i).startWalking(),this.firstAfterRepMap[a]=c}let l=c.token,u=c.occurrence;const d=c.isEndOfRule;1===this.RULE_STACK.length&&d&&void 0===l&&(l=yi,u=1),void 0!==l&&void 0!==u&&this.shouldInRepetitionRecoveryBeTried(l,u,o)&&this.tryInRepetitionRecovery(e,t,n,l)}const Cs=1024,$s=1280,ws=1536;function Ls(e,t,n){return n|t|e}class Os{constructor(e){var t;this.maxLookahead=null!==(t=null==e?void 0:e.maxLookahead)&&void 0!==t?t:Js.maxLookahead}validate(e){const t=this.validateNoLeftRecursion(e.rules);if((0,Nt.A)(t)){const n=this.validateEmptyOrAlternatives(e.rules),r=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...n,...r,...i]}return t}validateNoLeftRecursion(e){return xi(e,(e=>as(e,e,Ei)))}validateEmptyOrAlternatives(e){return xi(e,(e=>function(e,t){const n=new ls;e.accept(n);const r=n.alternations;return xi(r,(n=>{const r=Li(n.definition);return xi(r,((r,i)=>{const s=Gi([r],[],Wr,1);return(0,Nt.A)(s)?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:eo.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}]:[]}))}))}(e,Ei)))}validateAmbiguousAlternationAlternatives(e,t){return xi(e,(e=>us(e,t,Ei)))}validateSomeNonEmptyLookaheadPath(e,t){return function(e,t,n){const r=[];return(0,It.A)(e,(e=>{const i=new ds;e.accept(i);const s=i.allProductions;(0,It.A)(s,(i=>{const s=ji(i),o=i.maxLookahead||t,a=es(i.idx,e,s,o)[0];if((0,Nt.A)((0,Pn.A)(a))){const t=n.buildEmptyRepetitionError({topLevelRule:e,repetition:i});r.push({message:t,type:eo.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}}))})),r}(e,t,Ei)}buildLookaheadForAlternation(e){return function(e,t,n,r,i,s){const o=Zi(e,t,n);return s(o,r,ns(o)?zr:Wr,i)}(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Hi)}buildLookaheadForOptional(e){return function(e,t,n,r,i,s){const o=es(e,t,i,n),a=ns(o)?zr:Wr;return s(o[0],a,r)}(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,ji(e.prodType),Wi)}}const bs=new class extends gn{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};function _s(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset!1===(0,Hn.A)(e[t]))),r=(0,Ct.A)(n,(t=>({msg:`Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,type:Fs.MISSING_METHOD,methodName:t})));return sr(r)}(e,t);return n}(this,t);if(!(0,Nt.A)(e)){const t=(0,Ct.A)(e,(e=>e.msg));throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join("\n\n").replace(/\n/g,"\n\t")}`)}}};return(n.prototype=r).constructor=n,n._RULE_NAMES=t,n}var Fs;!function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"}(Fs||(Fs={}));var Gs=n(9084);const Ks={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Ks);const Bs=!0,js=Math.pow(2,8)-1,Vs=gi({name:"RECORDING_PHASE_TOKEN",pattern:ii.NA});qr([Vs]);const Hs=Ai(Vs,"This IToken indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(Hs);const Ws={name:"This CSTNode indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",children:{}};function zs(e,t,n,r=!1){qs(n);const i=(0,Vr.A)(this.recordingProdStack),s=(0,Hn.A)(t)?t:t.DEF,o=new e({definition:[],idx:n});return r&&(o.separator=t.SEP),(0,$t.A)(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(o),s.call(this),i.definition.push(o),this.recordingProdStack.pop(),Ks}function Ys(e,t){qs(t);const n=(0,Vr.A)(this.recordingProdStack),r=!1===(0,vn.A)(e),i=!1===r?e:e.DEF,s=new fn({definition:[],idx:t,ignoreAmbiguities:r&&!0===e.IGNORE_AMBIGUITIES});(0,$t.A)(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD);const o=En(i,(e=>(0,Hn.A)(e.GATE)));return s.hasPredicates=o,n.definition.push(s),(0,It.A)(i,(e=>{const t=new an({definition:[]});s.definition.push(t),(0,$t.A)(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:(0,$t.A)(e,"GATE")&&(t.ignoreAmbiguities=!0),this.recordingProdStack.push(t),e.ALT.call(this),this.recordingProdStack.pop()})),Ks}function Xs(e){return 0===e?"":`${e}`}function qs(e){if(e<0||e>js){const t=new Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than ${js+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}const Qs=Ai(yi,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Qs);const Js=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:vi,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Zs=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var eo,to,no;function ro(e=void 0){return function(){return e}}!function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"}(eo||(eo={}));class io{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",(()=>{let e;this.selfAnalysisDone=!0;const t=this.className;this.TRACE_INIT("toFastProps",(()=>{Lt(this)})),this.TRACE_INIT("Grammar Recording",(()=>{try{this.enableRecording(),(0,It.A)(this.definedRulesNames,(e=>{const t=this[e].originalGrammarAction;let n;this.TRACE_INIT(`${e} Rule`,(()=>{n=this.topLevelRuleRecord(e,t)})),this.gastProductionsCache[e]=n}))}finally{this.disableRecording()}}));let n=[];if(this.TRACE_INIT("Grammar Resolving",(()=>{n=hs({rules:(0,St.A)(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)})),this.TRACE_INIT("Grammar Validations",(()=>{if((0,Nt.A)(n)&&!1===this.skipValidations){const n=(e={rules:(0,St.A)(this.gastProductionsCache),tokenTypes:(0,St.A)(this.tokensMap),errMsgProvider:Ei,grammarName:t},rs((e=(0,Gn.A)(e,{errMsgProvider:Ei})).rules,e.tokenTypes,e.errMsgProvider,e.grammarName)),r=function(e){const t=e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName});return(0,Ct.A)(t,(e=>Object.assign({type:eo.CUSTOM_LOOKAHEAD_VALIDATION},e)))}({lookaheadStrategy:this.lookaheadStrategy,rules:(0,St.A)(this.gastProductionsCache),tokenTypes:(0,St.A)(this.tokensMap),grammarName:t});this.definitionErrors=this.definitionErrors.concat(n,r)}var e})),(0,Nt.A)(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",(()=>{const e=function(e){const t={};return(0,It.A)(e,(e=>{const n=new Un(e).startWalking();jt(t,n)})),t}((0,St.A)(this.gastProductionsCache));this.resyncFollows=e})),this.TRACE_INIT("ComputeLookaheadFunctions",(()=>{var e,t;null===(t=(e=this.lookaheadStrategy).initialize)||void 0===t||t.call(e,{rules:(0,St.A)(this.gastProductionsCache)}),this.preComputeLookaheadFunctions((0,St.A)(this.gastProductionsCache))}))),!io.DEFER_DEFINITION_ERRORS_HANDLING&&!(0,Nt.A)(this.definitionErrors))throw e=(0,Ct.A)(this.definitionErrors,(e=>e.message)),new Error(`Parser Definition Errors detected:\n ${e.join("\n-------------------------------\n")}`)}))}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initContentAssist(),n.initGastRecorder(t),n.initPerformanceTracer(t),(0,$t.A)(t,"ignoredIssues"))throw new Error("The IParserConfig property has been deprecated.\n\tPlease use the flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=(0,$t.A)(t,"skipValidations")?t.skipValidations:Js.skipValidations}}io.DEFER_DEFINITION_ERRORS_HANDLING=!1,to=io,no=[class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=(0,$t.A)(e,"recoveryEnabled")?e.recoveryEnabled:Js.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Ns)}getTokenToInsert(e){const t=Ai(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,r){const i=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let a=!1;const c=this.LA(1);let l=this.LA(1);const u=()=>{const e=this.LA(0),t=this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:c,previous:e,ruleName:this.getCurrRuleFullName()}),n=new vs(t,c,this.LA(0));n.resyncedTokens=Li(o),this.SAVE_ERROR(n)};for(;!a;){if(this.tokenMatcher(l,r))return void u();if(n.call(this))return u(),void e.apply(this,t);this.tokenMatcher(l,i)?a=!0:(l=this.SKIP_TOKEN(),this.addToResyncTokens(l,o))}this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,t,n){return!1!==n&&!this.tokenMatcher(this.LA(1),e)&&!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t))}getFollowsForInRuleRecovery(e,t){const n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new Ss("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if((0,Nt.A)(t))return!1;const n=this.LA(1);return void 0!==(0,ar.A)(t,(e=>this.tokenMatcher(n,e)))}canRecoverWithSingleTokenDeletion(e){return!!this.canTokenTypeBeDeletedInRecovery(e)&&this.tokenMatcher(this.LA(2),e)}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(t);return In(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA(1),n=2;for(;;){const r=(0,ar.A)(e,(e=>Ti(t,e)));if(void 0!==r)return r;t=this.LA(n),n++}}getCurrFollowKey(){if(1===this.RULE_STACK.length)return xs;const e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK;return(0,Ct.A)(e,((n,r)=>0===r?xs:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:t[r],inRule:this.shortRuleNameToFullName(e[r-1])}))}flattenFollowSet(){const e=(0,Ct.A)(this.buildFullFollowKeyStack(),(e=>this.getFollowSetFromFollowKey(e)));return(0,Pn.A)(e)}getFollowSetFromFollowKey(e){if(e===xs)return[yi];const t=e.ruleName+e.idxInCallingRule+Dn+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,yi)||t.push(e),t}reSyncTo(e){const t=[];let n=this.LA(1);for(;!1===this.tokenMatcher(n,e);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return Li(t)}attemptInRepetitionRecovery(e,t,n,r,i,s,o){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:(0,wt.A)(this.RULE_OCCURRENCE_STACK),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){return(0,Ct.A)(this.RULE_STACK,(e=>this.shortRuleNameToFullName(e)))}},class{initLooksAhead(e){this.dynamicTokensEnabled=(0,$t.A)(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Js.dynamicTokensEnabled,this.maxLookahead=(0,$t.A)(e,"maxLookahead")?e.maxLookahead:Js.maxLookahead,this.lookaheadStrategy=(0,$t.A)(e,"lookaheadStrategy")?e.lookaheadStrategy:new Os({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){(0,It.A)(e,(e=>{this.TRACE_INIT(`${e.name} Rule Lookahead`,(()=>{const{alternation:t,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:s,repetitionWithSeparator:o}=function(e){bs.reset(),e.accept(bs);const t=bs.dslMethods;return bs.reset(),t}(e);(0,It.A)(t,(t=>{const n=0===t.idx?"":t.idx;this.TRACE_INIT(`${wn(t)}${n}`,(()=>{const n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),r=Ls(this.fullRuleNameToShort[e.name],256,t.idx);this.setLaFuncCache(r,n)}))})),(0,It.A)(n,(t=>{this.computeLookaheadFunc(e,t.idx,768,"Repetition",t.maxLookahead,wn(t))})),(0,It.A)(r,(t=>{this.computeLookaheadFunc(e,t.idx,512,"Option",t.maxLookahead,wn(t))})),(0,It.A)(i,(t=>{this.computeLookaheadFunc(e,t.idx,Cs,"RepetitionMandatory",t.maxLookahead,wn(t))})),(0,It.A)(s,(t=>{this.computeLookaheadFunc(e,t.idx,ws,"RepetitionMandatoryWithSeparator",t.maxLookahead,wn(t))})),(0,It.A)(o,(t=>{this.computeLookaheadFunc(e,t.idx,$s,"RepetitionWithSeparator",t.maxLookahead,wn(t))}))}))}))}computeLookaheadFunc(e,t,n,r,i,s){this.TRACE_INIT(`${s}${0===t?"":t}`,(()=>{const s=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),o=Ls(this.fullRuleNameToShort[e.name],n,t);this.setLaFuncCache(o,s)}))}getKeyForAutomaticLookahead(e,t){return Ls(this.getLastExplicitRuleShortName(),e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=(0,$t.A)(e,"nodeLocationTracking")?e.nodeLocationTracking:Js.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Ps,this.setNodeLocationFromNode=Ps,this.cstPostRule=jr.A,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=jr.A,this.setNodeLocationFromNode=jr.A,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=_s,this.setNodeLocationFromNode=_s,this.cstPostRule=jr.A,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=jr.A,this.setNodeLocationFromNode=jr.A,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error(`Invalid config option: "${e.nodeLocationTracking}"`);this.setNodeLocationFromToken=jr.A,this.setNodeLocationFromNode=jr.A,this.cstPostRule=jr.A,this.setInitialNodeLocation=jr.A}else this.cstInvocationStateUpdate=jr.A,this.cstFinallyStateUpdate=jr.A,this.cstPostTerminal=jr.A,this.cstPostNonTerminal=jr.A,this.cstPostRule=jr.A}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?n.endOffset=t.endOffset:n.startOffset=NaN}cstPostTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];var r,i,s;i=t,s=e,void 0===(r=n).children[s]?r.children[s]=[i]:r.children[s].push(i),this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];!function(e,t,n){void 0===e.children[t]?e.children[t]=[n]:e.children[t].push(n)}(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if((0,Fn.A)(this.baseCstVisitorConstructor)){const e=Us(this.className,(0,Kt.A)(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if((0,Fn.A)(this.baseCstVisitorWithDefaultsConstructor)){const e=function(e,t,n){const r=function(){};Ms(r,e+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return(0,It.A)(t,(e=>{i[e]=Ds})),(r.prototype=i).constructor=r,r}(this.className,(0,Kt.A)(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(!0!==this.selfAnalysisDone)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Qs}LA(e){const t=this.currIdx+e;return t<0||this.tokVectorLength<=t?Qs:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},class{initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=zr,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},(0,$t.A)(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if((0,vn.A)(e)){if((0,Nt.A)(e))throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if((0,vn.A)(e))this.tokensMap=(0,Yn.A)(e,((e,t)=>(e[t.name]=t,e)),{});else if((0,$t.A)(e,"modes")&&Cn((0,Pn.A)((0,St.A)(e.modes)),ei)){const t=(0,Pn.A)((0,St.A)(e.modes)),n=_n(t);this.tokensMap=(0,Yn.A)(n,((e,t)=>(e[t.name]=t,e)),{})}else{if(!(0,Gs.A)(e))throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=(0,wt.A)(e)}this.tokensMap.EOF=yi;const n=(0,$t.A)(e,"modes")?(0,Pn.A)((0,St.A)(e.modes)):(0,St.A)(e),r=Cn(n,(e=>(0,Nt.A)(e.categoryMatches)));this.tokenMatcher=r?zr:Wr,qr((0,St.A)(this.tokensMap))}defineRule(e,t,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const r=(0,$t.A)(n,"resyncEnabled")?n.resyncEnabled:Zs.resyncEnabled,i=(0,$t.A)(n,"recoveryValueFunc")?n.recoveryValueFunc:Zs.recoveryValueFunc,s=this.ruleShortNameIdx<<12;let o;return this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s,o=!0===this.outputCst?function(...n){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n);const r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}catch(o){return this.invokeRuleCatch(o,r,i)}finally{this.ruleFinallyStateUpdate()}}:function(...n){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n)}catch(o){return this.invokeRuleCatch(o,r,i)}finally{this.ruleFinallyStateUpdate()}},Object.assign(o,{ruleName:e,originalGrammarAction:t})}invokeRuleCatch(e,t,n){const r=1===this.RULE_STACK.length,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(As(e)){const t=e;if(i){const r=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(r)){if(t.resyncedTokens=this.reSyncTo(r),this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];return e.recoveredNode=!0,e}return n(e)}if(this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];e.recoveredNode=!0,t.partialCstResult=e}throw t}if(r)return this.moveToTerminatedState(),n(e);throw t}throw e}optionInternal(e,t){const n=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,n)}optionInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof e){r=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=()=>t.call(this)&&e.call(this)}}else r=e;if(!0===i.call(this))return r.call(this)}atLeastOneInternal(e,t){const n=this.getKeyForAutomaticLookahead(Cs,e);return this.atLeastOneInternalLogic(e,t,n)}atLeastOneInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;if(!0!==i.call(this))throw this.raiseEarlyExitException(e,Bi.REPETITION_MANDATORY,t.ERR_MSG);{let e=this.doSingleRepetition(r);for(;!0===i.call(this)&&!0===e;)e=this.doSingleRepetition(r)}this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],i,Cs,e,Di)}atLeastOneSepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(ws,e);this.atLeastOneSepFirstInternalLogic(e,t,n)}atLeastOneSepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0!==this.getLaFuncFromCache(n).call(this))throw this.raiseEarlyExitException(e,Bi.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);{r.call(this);const t=()=>this.tokenMatcher(this.LA(1),i);for(;!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,Ui],t,ws,e,Ui)}}manyInternal(e,t){const n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,n)}manyInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;let s=!0;for(;!0===i.call(this)&&!0===s;)s=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],i,768,e,Pi,s)}manySepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead($s,e);this.manySepFirstInternalLogic(e,t,n)}manySepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0===this.getLaFuncFromCache(n).call(this)){r.call(this);const t=()=>this.tokenMatcher(this.LA(1),i);for(;!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,Mi],t,$s,e,Mi)}}repetitionSepSecondInternal(e,t,n,r,i){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,ws,e,i)}doSingleRepetition(e){const t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){const n=this.getKeyForAutomaticLookahead(256,t),r=(0,vn.A)(e)?e:e.DEF,i=this.getLaFuncFromCache(n).call(this,r);if(void 0!==i)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),0===this.RULE_STACK.length&&!1===this.isAtEndOfInput()){const e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Es(t,e))}}subruleInternal(e,t,n){let r;try{const i=void 0!==n?n.ARGS:void 0;return this.subruleIdx=t,r=e.apply(this,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:e.ruleName),r}catch(i){throw this.subruleInternalError(i,n,e.ruleName)}}subruleInternalError(e,t,n){throw As(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,t,n){let r;try{const t=this.LA(1);!0===this.tokenMatcher(t,e)?(this.consumeToken(),r=t):this.consumeInternalError(e,t,n)}catch(i){r=this.consumeInternalRecovery(e,t,i)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:e.name,r),r}consumeInternalError(e,t,n){let r;const i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new vs(r,t,i))}consumeInternalRecovery(e,t,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;{const i=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,i)}catch(r){throw r.name===Is?n:r}}}saveRecogState(){const e=this.errors,t=(0,wt.A)(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,t,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t)}isBackTracking(){return 0!==this.isBackTrackingStack.length}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),yi)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},class{ACTION(e){return e.call(this)}consume(e,t,n){return this.consumeInternal(t,e,n)}subrule(e,t,n){return this.subruleInternal(t,e,n)}option(e,t){return this.optionInternal(t,e)}or(e,t){return this.orInternal(t,e)}many(e,t){return this.manyInternal(e,t)}atLeastOne(e,t){return this.atLeastOneInternal(e,t)}CONSUME(e,t){return this.consumeInternal(e,0,t)}CONSUME1(e,t){return this.consumeInternal(e,1,t)}CONSUME2(e,t){return this.consumeInternal(e,2,t)}CONSUME3(e,t){return this.consumeInternal(e,3,t)}CONSUME4(e,t){return this.consumeInternal(e,4,t)}CONSUME5(e,t){return this.consumeInternal(e,5,t)}CONSUME6(e,t){return this.consumeInternal(e,6,t)}CONSUME7(e,t){return this.consumeInternal(e,7,t)}CONSUME8(e,t){return this.consumeInternal(e,8,t)}CONSUME9(e,t){return this.consumeInternal(e,9,t)}SUBRULE(e,t){return this.subruleInternal(e,0,t)}SUBRULE1(e,t){return this.subruleInternal(e,1,t)}SUBRULE2(e,t){return this.subruleInternal(e,2,t)}SUBRULE3(e,t){return this.subruleInternal(e,3,t)}SUBRULE4(e,t){return this.subruleInternal(e,4,t)}SUBRULE5(e,t){return this.subruleInternal(e,5,t)}SUBRULE6(e,t){return this.subruleInternal(e,6,t)}SUBRULE7(e,t){return this.subruleInternal(e,7,t)}SUBRULE8(e,t){return this.subruleInternal(e,8,t)}SUBRULE9(e,t){return this.subruleInternal(e,9,t)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,t,n=Zs){if(In(this.definedRulesNames,e)){const t={message:Ei.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:eo.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(t)}this.definedRulesNames.push(e);const r=this.defineRule(e,t,n);return this[e]=r,r}OVERRIDE_RULE(e,t,n=Zs){const r=function(e,t,n){const r=[];let i;return In(t,e)||(i=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:eo.INVALID_RULE_OVERRIDE,ruleName:e})),r}(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);const i=this.defineRule(e,t,n);return this[e]=i,i}BACKTRACK(e,t){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return e.apply(this,t),!0}catch(r){if(As(r))return!1;throw r}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return e=(0,St.A)(this.gastProductionsCache),(0,Ct.A)(e,mn);var e}},class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=(0,$t.A)(e,"errorMessageProvider")?e.errorMessageProvider:Js.errorMessageProvider}SAVE_ERROR(e){if(As(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:(0,wt.A)(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return(0,wt.A)(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,t,n){const r=this.getCurrRuleFullName(),i=es(e,this.getGAstProductions()[r],t,this.maxLookahead)[0],s=[];for(let a=1;a<=this.maxLookahead;a++)s.push(this.LA(a));const o=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:s,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new ks(o,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const n=this.getCurrRuleFullName(),r=Zi(e,this.getGAstProductions()[n],this.maxLookahead),i=[];for(let a=1;a<=this.maxLookahead;a++)i.push(this.LA(a));const s=this.LA(0),o=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:r,actual:i,previous:s,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Rs(o,this.LA(1),s))}},class{initContentAssist(){}computeContentAssist(e,t){const n=this.gastProductionsCache[e];if((0,Fn.A)(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return Gi([n],t,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const t=or(e.ruleStack),n=this.getGAstProductions()[t];return new bi(n,e).startWalking()}},class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",(()=>{for(let e=0;e<10;e++){const t=e>0?e:"";this[`CONSUME${t}`]=function(t,n){return this.consumeInternalRecord(t,e,n)},this[`SUBRULE${t}`]=function(t,n){return this.subruleInternalRecord(t,e,n)},this[`OPTION${t}`]=function(t){return this.optionInternalRecord(t,e)},this[`OR${t}`]=function(t){return this.orInternalRecord(t,e)},this[`MANY${t}`]=function(t){this.manyInternalRecord(e,t)},this[`MANY_SEP${t}`]=function(t){this.manySepFirstInternalRecord(e,t)},this[`AT_LEAST_ONE${t}`]=function(t){this.atLeastOneInternalRecord(e,t)},this[`AT_LEAST_ONE_SEP${t}`]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}}this.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},this.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD}))}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",(()=>{const e=this;for(let t=0;t<10;t++){const n=t>0?t:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA}))}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return Qs}topLevelRuleRecord(e,t){try{const n=new on({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(n){if(!0!==n.KNOWN_RECORDER_ERROR)try{n.message=n.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(r){throw n}throw n}}optionInternalRecord(e,t){return zs.call(this,cn,e,t)}atLeastOneInternalRecord(e,t){zs.call(this,ln,t,e)}atLeastOneSepFirstInternalRecord(e,t){zs.call(this,un,t,e,Bs)}manyInternalRecord(e,t){zs.call(this,dn,t,e)}manySepFirstInternalRecord(e,t){zs.call(this,hn,t,e,Bs)}orInternalRecord(e,t){return Ys.call(this,e,t)}subruleInternalRecord(e,t,n){if(qs(t),!e||!1===(0,$t.A)(e,"ruleName")){const n=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=(0,Vr.A)(this.recordingProdStack),i=e.ruleName,s=new sn({idx:t,nonTerminalName:i,label:null==n?void 0:n.LABEL,referencedRule:void 0});return r.definition.push(s),this.outputCst?Ws:Ks}consumeInternalRecord(e,t,n){if(qs(t),!Jr(e)){const n=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=(0,Vr.A)(this.recordingProdStack),i=new pn({idx:t,terminalType:e,label:null==n?void 0:n.LABEL});return r.definition.push(i),Hs}},class{initPerformanceTracer(e){if((0,$t.A)(e,"traceInitPerf")){const t=e.traceInitPerf,n="number"==typeof t;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=Js.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=Hr(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()}}],no.forEach((e=>{const t=e.prototype;Object.getOwnPropertyNames(t).forEach((n=>{if("constructor"===n)return;const r=Object.getOwnPropertyDescriptor(t,n);r&&(r.get||r.set)?Object.defineProperty(to.prototype,n,r):to.prototype[n]=e.prototype[n]}))}));class so extends io{constructor(e,t=Js){const n=(0,wt.A)(t);n.outputCst=!1,super(e,n)}}function oo(e,t,n){return`${e.name}_${t}_${n}`}class ao{constructor(e){this.target=e}isEpsilon(){return!1}}class co extends ao{constructor(e,t){super(e),this.tokenType=t}}class lo extends ao{constructor(e){super(e)}isEpsilon(){return!0}}class uo extends ao{constructor(e,t,n){super(e),this.rule=t,this.followState=n}isEpsilon(){return!0}}function ho(e){const t={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};!function(e,t){const n=t.length;for(let r=0;rfo(e,t,n))),s=Ao(e,t,r,n,...i);return s}(e,t,n):n instanceof cn?function(e,t,n){const r=Eo(e,t,n,{type:1});yo(e,r);const i=Ao(e,t,r,n,po(e,t,n));return function(e,t,n,r){const i=r.left,s=r.right;return Ro(i,s),e.decisionMap[oo(t,"Option",n.idx)]=i,r}(e,t,n,i)}(e,t,n):n instanceof dn?function(e,t,n){const r=Eo(e,t,n,{type:5});yo(e,r);const i=Ao(e,t,r,n,po(e,t,n));return go(e,t,n,i)}(e,t,n):n instanceof hn?function(e,t,n){const r=Eo(e,t,n,{type:5});yo(e,r);const i=Ao(e,t,r,n,po(e,t,n)),s=To(e,t,n.separator,n);return go(e,t,n,i,s)}(e,t,n):n instanceof ln?function(e,t,n){const r=Eo(e,t,n,{type:4});yo(e,r);const i=Ao(e,t,r,n,po(e,t,n));return mo(e,t,n,i)}(e,t,n):n instanceof un?function(e,t,n){const r=Eo(e,t,n,{type:4});yo(e,r);const i=Ao(e,t,r,n,po(e,t,n)),s=To(e,t,n.separator,n);return mo(e,t,n,i,s)}(e,t,n):po(e,t,n)}function po(e,t,n){const r=(0,Xn.A)((0,Ct.A)(n.definition,(n=>fo(e,t,n))),(e=>void 0!==e));return 1===r.length?r[0]:0===r.length?void 0:function(e,t){const n=t.length;for(let s=0;se.alt))}get key(){let e="";for(const t in this.map)e+=t+":";return e}}function No(e,t=!0){return`${t?`a${e.alt}`:""}s${e.state.stateNumber}:${e.stack.map((e=>e.stateNumber.toString())).join("_")}`}var Co=n(2675);const $o=function(e,t){return e&&e.length?(0,bn.A)(e,(0,Ht.A)(t,2)):[]};function wo(e,t){const n={};return r=>{const i=r.toString();let s=n[i];return void 0!==s||(s={atnStartState:e,decision:t,states:{}},n[i]=s),s}}class Lo{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,t){this.predicates[e]=t}toString(){let e="";const t=this.predicates.length;for(let n=0;nconsole.log(e)}initialize(e){this.atn=ho(e.rules),this.dfas=function(e){const t=e.decisionStates.length,n=Array(t);for(let r=0;r(0,Ct.A)(e,(e=>e[0]))));if(_o(l,!1)&&!i){const e=(0,Yn.A)(l,((e,t,n)=>((0,It.A)(t,(t=>{t&&(e[t.tokenTypeIdx]=n,(0,It.A)(t.categoryMatches,(t=>{e[t]=n})))})),e)),{});return r?function(t){var n;const r=this.LA(1),i=e[r.tokenTypeIdx];if(void 0!==t&&void 0!==i){const e=null===(n=t[i])||void 0===n?void 0:n.GATE;if(void 0!==e&&!1===e.call(this))return}return i}:function(){const t=this.LA(1);return e[t.tokenTypeIdx]}}return r?function(e){const t=new Lo,n=void 0===e?0:e.length;for(let i=0;i(0,Ct.A)(e,(e=>e[0]))));if(_o(l)&&l[0][0]&&!i){const e=l[0],t=(0,Pn.A)(e);if(1===t.length&&(0,Nt.A)(t[0].categoryMatches)){const e=t[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===e}}{const e=(0,Yn.A)(t,((e,t)=>(void 0!==t&&(e[t.tokenTypeIdx]=!0,(0,It.A)(t.categoryMatches,(t=>{e[t]=!0}))),e)),{});return function(){const t=this.LA(1);return!0===e[t.tokenTypeIdx]}}}return function(){const e=Po.call(this,s,c,Oo,o);return"object"!=typeof e&&0===e}}}function _o(e,t=!0){const n=new Set;for(const r of e){const e=new Set;for(const i of r){if(void 0===i){if(t)break;return!1}const r=[i.tokenTypeIdx].concat(i.categoryMatches);for(const t of r)if(n.has(t)){if(!e.has(t))return!1}else n.add(t),e.add(t)}}return!0}function Po(e,t,n,r){const i=e[t](n);let s=i.start;if(void 0===s){s=jo(i,Ko(Vo(i.atnStartState))),i.start=s}return Mo.apply(this,[i,s,n,r])}function Mo(e,t,n,r){let i=t,s=1;const o=[];let a=this.LA(s++);for(;;){let t=(c=a,i.edges[c.tokenTypeIdx]);if(void 0===t&&(t=Do.apply(this,[e,i,a,s,n,r])),t===Io)return Fo(o,i,a);if(!0===t.isAcceptState)return t.prediction;i=t,o.push(a),a=this.LA(s++)}var c}function Do(e,t,n,r,i,s){const o=function(e,t,n){const r=new So,i=[];for(const o of e.elements){if(!1===n.is(o.alt))continue;if(7===o.state.type){i.push(o);continue}const e=o.state.transitions.length;for(let n=0;n0&&!function(e){for(const t of e.elements)if(7===t.state.type)return!0;return!1}(s))for(const o of i)s.add(o);return s}(t.configs,n,i);if(0===o.size)return Bo(e,t,n,Io),Io;let a=Ko(o);const c=function(e,t){let n;for(const r of e.elements)if(!0===t.is(r.alt))if(void 0===n)n=r.alt;else if(n!==r.alt)return;return n}(o,i);if(void 0!==c)a.isAcceptState=!0,a.prediction=c,a.configs.uniqueAlt=c;else if(function(e){if(function(e){for(const t of e.elements)if(7!==t.state.type)return!1;return!0}(e))return!0;const t=function(e){const t=new Map;for(const n of e){const e=No(n,!1);let r=t.get(e);void 0===r&&(r={},t.set(e,r)),r[n.alt]=!0}return t}(e.elements);return function(e){for(const t of Array.from(e.values()))if(Object.keys(t).length>1)return!0;return!1}(t)&&!function(e){for(const t of Array.from(e.values()))if(1===Object.keys(t).length)return!0;return!1}(t)}(o)){const t=(0,Co.A)(o.alts);a.isAcceptState=!0,a.prediction=t,a.configs.uniqueAlt=t,Uo.apply(this,[e,r,o.alts,s])}return a=Bo(e,t,n,a),a}function Uo(e,t,n,r){const i=[];for(let o=1;o<=t;o++)i.push(this.LA(o).tokenType);const s=e.atnStartState;r(function(e){const t=(0,Ct.A)(e.prefixPath,(e=>si(e))).join(", "),n=0===e.production.idx?"":e.production.idx;let r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(", ")}> in <${function(e){if(e instanceof sn)return"SUBRULE";if(e instanceof cn)return"OPTION";if(e instanceof fn)return"OR";if(e instanceof ln)return"AT_LEAST_ONE";if(e instanceof un)return"AT_LEAST_ONE_SEP";if(e instanceof hn)return"MANY_SEP";if(e instanceof dn)return"MANY";if(e instanceof pn)return"CONSUME";throw Error("non exhaustive match")}(e.production)}${n}> inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\n`;return r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r}({topLevelRule:s.rule,ambiguityIndices:n,production:s.production,prefixPath:i}))}function Fo(e,t,n){const r=xi(t.configs.elements,(e=>e.state.transitions));return{actualToken:n,possibleTokenTypes:$o(r.filter((e=>e instanceof co)).map((e=>e.tokenType)),(e=>e.tokenTypeIdx)),tokenPath:e}}function Go(e,t){if(e instanceof co&&Ti(t,e.tokenType))return e.target}function Ko(e){return{configs:e,edges:{},isAcceptState:!1,prediction:-1}}function Bo(e,t,n,r){return r=jo(e,r),t.edges[n.tokenTypeIdx]=r,r}function jo(e,t){if(t===Io)return t;const n=t.configs.key,r=e.states[n];return void 0!==r?r:(t.configs.finalize(),e.states[n]=t,t)}function Vo(e){const t=new So,n=e.transitions.length;for(let r=0;r0){const n=[...e.stack];Ho({state:n.pop(),alt:e.alt,stack:n},t)}else t.add(e);return}n.epsilonOnlyTransitions||t.add(e);const r=n.transitions.length;for(let i=0;i0&&(r.arguments=n),r},e.is=function(e){let t=e;return Ac.defined(t)&&Ac.string(t.title)&&Ac.string(t.command)}}(da||(da={})),function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:""}},e.is=function(e){const t=e;return Ac.objectLiteral(t)&&Ac.string(t.newText)&&Jo.is(t.range)}}(ha||(ha={})),function(e){e.create=function(e,t,n){const r={label:e};return void 0!==t&&(r.needsConfirmation=t),void 0!==n&&(r.description=n),r},e.is=function(e){const t=e;return Ac.objectLiteral(t)&&Ac.string(t.label)&&(Ac.boolean(t.needsConfirmation)||void 0===t.needsConfirmation)&&(Ac.string(t.description)||void 0===t.description)}}(fa||(fa={})),function(e){e.is=function(e){const t=e;return Ac.string(t)}}(pa||(pa={})),function(e){e.replace=function(e,t,n){return{range:e,newText:t,annotationId:n}},e.insert=function(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}},e.del=function(e,t){return{range:e,newText:"",annotationId:t}},e.is=function(e){const t=e;return ha.is(t)&&(fa.is(t.annotationId)||pa.is(t.annotationId))}}(ma||(ma={})),function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){let t=e;return Ac.defined(t)&&ka.is(t.textDocument)&&Array.isArray(t.edits)}}(ga||(ga={})),function(e){e.create=function(e,t,n){let r={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){let t=e;return t&&"create"===t.kind&&Ac.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||Ac.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Ac.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||pa.is(t.annotationId))}}(ya||(ya={})),function(e){e.create=function(e,t,n,r){let i={kind:"rename",oldUri:e,newUri:t};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(i.options=n),void 0!==r&&(i.annotationId=r),i},e.is=function(e){let t=e;return t&&"rename"===t.kind&&Ac.string(t.oldUri)&&Ac.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||Ac.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Ac.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||pa.is(t.annotationId))}}(Aa||(Aa={})),function(e){e.create=function(e,t,n){let r={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){let t=e;return t&&"delete"===t.kind&&Ac.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||Ac.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||Ac.boolean(t.options.ignoreIfNotExists)))&&(void 0===t.annotationId||pa.is(t.annotationId))}}(Ta||(Ta={})),function(e){e.is=function(e){let t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every((e=>Ac.string(e.kind)?ya.is(e)||Aa.is(e)||Ta.is(e):ga.is(e))))}}(va||(va={}));!function(e){e.create=function(e){return{uri:e}},e.is=function(e){let t=e;return Ac.defined(t)&&Ac.string(t.uri)}}(Ra||(Ra={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){let t=e;return Ac.defined(t)&&Ac.string(t.uri)&&Ac.integer(t.version)}}(Ea||(Ea={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){let t=e;return Ac.defined(t)&&Ac.string(t.uri)&&(null===t.version||Ac.integer(t.version))}}(ka||(ka={})),function(e){e.create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},e.is=function(e){let t=e;return Ac.defined(t)&&Ac.string(t.uri)&&Ac.string(t.languageId)&&Ac.integer(t.version)&&Ac.string(t.text)}}(xa||(xa={})),function(e){e.PlainText="plaintext",e.Markdown="markdown",e.is=function(t){const n=t;return n===e.PlainText||n===e.Markdown}}(Ia||(Ia={})),function(e){e.is=function(e){const t=e;return Ac.objectLiteral(e)&&Ia.is(t.kind)&&Ac.string(t.value)}}(Sa||(Sa={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(Na||(Na={})),function(e){e.PlainText=1,e.Snippet=2}(Ca||(Ca={})),function(e){e.Deprecated=1}($a||($a={})),function(e){e.create=function(e,t,n){return{newText:e,insert:t,replace:n}},e.is=function(e){const t=e;return t&&Ac.string(t.newText)&&Jo.is(t.insert)&&Jo.is(t.replace)}}(wa||(wa={})),function(e){e.asIs=1,e.adjustIndentation=2}(La||(La={})),function(e){e.is=function(e){const t=e;return t&&(Ac.string(t.detail)||void 0===t.detail)&&(Ac.string(t.description)||void 0===t.description)}}(Oa||(Oa={})),function(e){e.create=function(e){return{label:e}}}(ba||(ba={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(_a||(_a={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){const t=e;return Ac.string(t)||Ac.objectLiteral(t)&&Ac.string(t.language)&&Ac.string(t.value)}}(Pa||(Pa={})),function(e){e.is=function(e){let t=e;return!!t&&Ac.objectLiteral(t)&&(Sa.is(t.contents)||Pa.is(t.contents)||Ac.typedArray(t.contents,Pa.is))&&(void 0===e.range||Jo.is(e.range))}}(Ma||(Ma={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(Da||(Da={})),function(e){e.create=function(e,t,...n){let r={label:e};return Ac.defined(t)&&(r.documentation=t),Ac.defined(n)?r.parameters=n:r.parameters=[],r}}(Ua||(Ua={})),function(e){e.Text=1,e.Read=2,e.Write=3}(Fa||(Fa={})),function(e){e.create=function(e,t){let n={range:e};return Ac.number(t)&&(n.kind=t),n}}(Ga||(Ga={})),function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26}(Ka||(Ka={})),function(e){e.Deprecated=1}(Ba||(Ba={})),function(e){e.create=function(e,t,n,r,i){let s={name:e,kind:t,location:{uri:r,range:n}};return i&&(s.containerName=i),s}}(ja||(ja={})),function(e){e.create=function(e,t,n,r){return void 0!==r?{name:e,kind:t,location:{uri:n,range:r}}:{name:e,kind:t,location:{uri:n}}}}(Va||(Va={})),function(e){e.create=function(e,t,n,r,i,s){let o={name:e,detail:t,kind:n,range:r,selectionRange:i};return void 0!==s&&(o.children=s),o},e.is=function(e){let t=e;return t&&Ac.string(t.name)&&Ac.number(t.kind)&&Jo.is(t.range)&&Jo.is(t.selectionRange)&&(void 0===t.detail||Ac.string(t.detail))&&(void 0===t.deprecated||Ac.boolean(t.deprecated))&&(void 0===t.children||Array.isArray(t.children))&&(void 0===t.tags||Array.isArray(t.tags))}}(Ha||(Ha={})),function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"}(Wa||(Wa={})),function(e){e.Invoked=1,e.Automatic=2}(za||(za={})),function(e){e.create=function(e,t,n){let r={diagnostics:e};return null!=t&&(r.only=t),null!=n&&(r.triggerKind=n),r},e.is=function(e){let t=e;return Ac.defined(t)&&Ac.typedArray(t.diagnostics,ua.is)&&(void 0===t.only||Ac.typedArray(t.only,Ac.string))&&(void 0===t.triggerKind||t.triggerKind===za.Invoked||t.triggerKind===za.Automatic)}}(Ya||(Ya={})),function(e){e.create=function(e,t,n){let r={title:e},i=!0;return"string"==typeof t?(i=!1,r.kind=t):da.is(t)?r.command=t:r.edit=t,i&&void 0!==n&&(r.kind=n),r},e.is=function(e){let t=e;return t&&Ac.string(t.title)&&(void 0===t.diagnostics||Ac.typedArray(t.diagnostics,ua.is))&&(void 0===t.kind||Ac.string(t.kind))&&(void 0!==t.edit||void 0!==t.command)&&(void 0===t.command||da.is(t.command))&&(void 0===t.isPreferred||Ac.boolean(t.isPreferred))&&(void 0===t.edit||va.is(t.edit))}}(Xa||(Xa={})),function(e){e.create=function(e,t){let n={range:e};return Ac.defined(t)&&(n.data=t),n},e.is=function(e){let t=e;return Ac.defined(t)&&Jo.is(t.range)&&(Ac.undefined(t.command)||da.is(t.command))}}(qa||(qa={})),function(e){e.create=function(e,t){return{tabSize:e,insertSpaces:t}},e.is=function(e){let t=e;return Ac.defined(t)&&Ac.uinteger(t.tabSize)&&Ac.boolean(t.insertSpaces)}}(Qa||(Qa={})),function(e){e.create=function(e,t,n){return{range:e,target:t,data:n}},e.is=function(e){let t=e;return Ac.defined(t)&&Jo.is(t.range)&&(Ac.undefined(t.target)||Ac.string(t.target))}}(Ja||(Ja={})),function(e){e.create=function(e,t){return{range:e,parent:t}},e.is=function(t){let n=t;return Ac.objectLiteral(n)&&Jo.is(n.range)&&(void 0===n.parent||e.is(n.parent))}}(Za||(Za={})),function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"}(ec||(ec={})),function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"}(tc||(tc={})),function(e){e.is=function(e){const t=e;return Ac.objectLiteral(t)&&(void 0===t.resultId||"string"==typeof t.resultId)&&Array.isArray(t.data)&&(0===t.data.length||"number"==typeof t.data[0])}}(nc||(nc={})),function(e){e.create=function(e,t){return{range:e,text:t}},e.is=function(e){const t=e;return null!=t&&Jo.is(t.range)&&Ac.string(t.text)}}(rc||(rc={})),function(e){e.create=function(e,t,n){return{range:e,variableName:t,caseSensitiveLookup:n}},e.is=function(e){const t=e;return null!=t&&Jo.is(t.range)&&Ac.boolean(t.caseSensitiveLookup)&&(Ac.string(t.variableName)||void 0===t.variableName)}}(ic||(ic={})),function(e){e.create=function(e,t){return{range:e,expression:t}},e.is=function(e){const t=e;return null!=t&&Jo.is(t.range)&&(Ac.string(t.expression)||void 0===t.expression)}}(sc||(sc={})),function(e){e.create=function(e,t){return{frameId:e,stoppedLocation:t}},e.is=function(e){const t=e;return Ac.defined(t)&&Jo.is(e.stoppedLocation)}}(oc||(oc={})),function(e){e.Type=1,e.Parameter=2,e.is=function(e){return 1===e||2===e}}(ac||(ac={})),function(e){e.create=function(e){return{value:e}},e.is=function(e){const t=e;return Ac.objectLiteral(t)&&(void 0===t.tooltip||Ac.string(t.tooltip)||Sa.is(t.tooltip))&&(void 0===t.location||Zo.is(t.location))&&(void 0===t.command||da.is(t.command))}}(cc||(cc={})),function(e){e.create=function(e,t,n){const r={position:e,label:t};return void 0!==n&&(r.kind=n),r},e.is=function(e){const t=e;return Ac.objectLiteral(t)&&Qo.is(t.position)&&(Ac.string(t.label)||Ac.typedArray(t.label,cc.is))&&(void 0===t.kind||ac.is(t.kind))&&void 0===t.textEdits||Ac.typedArray(t.textEdits,ha.is)&&(void 0===t.tooltip||Ac.string(t.tooltip)||Sa.is(t.tooltip))&&(void 0===t.paddingLeft||Ac.boolean(t.paddingLeft))&&(void 0===t.paddingRight||Ac.boolean(t.paddingRight))}}(lc||(lc={})),function(e){e.createSnippet=function(e){return{kind:"snippet",value:e}}}(uc||(uc={})),function(e){e.create=function(e,t,n,r){return{insertText:e,filterText:t,range:n,command:r}}}(dc||(dc={})),function(e){e.create=function(e){return{items:e}}}(hc||(hc={})),function(e){e.Invoked=0,e.Automatic=1}(fc||(fc={})),function(e){e.create=function(e,t){return{range:e,text:t}}}(pc||(pc={})),function(e){e.create=function(e,t){return{triggerKind:e,selectedCompletionInfo:t}}}(mc||(mc={})),function(e){e.is=function(e){const t=e;return Ac.objectLiteral(t)&&Yo.is(t.uri)&&Ac.string(t.name)}}(gc||(gc={}));var yc,Ac;!function(e){function t(e,n){if(e.length<=1)return e;const r=e.length/2|0,i=e.slice(0,r),s=e.slice(r);t(i,n),t(s,n);let o=0,a=0,c=0;for(;o{let n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n})),s=r.length;for(let t=i.length-1;t>=0;t--){let n=i[t],o=e.offsetAt(n.range.start),a=e.offsetAt(n.range.end);if(!(a<=s))throw new Error("Overlapping edit");r=r.substring(0,o)+n.newText+r.substring(a,r.length),s=o}return r}}(yc||(yc={}));class Tc{constructor(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(void 0===this._lineOffsets){let e=[],t=this._content,n=!0;for(let r=0;r0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return Qo.create(0,e);for(;ne?r=i:n=i+1}let i=n-1;return Qo.create(i,e-t[i])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line],r=e.line+1=0&&t.content.splice(n,1)}}construct(e){const t=this.current;"string"==typeof e.$type&&(this.current.astNode=e),e.$cstNode=t;const n=this.nodeStack.pop();0===(null==n?void 0:n.content.length)&&this.removeNode(n)}addHiddenTokens(e){for(const t of e){const e=new Ec(t.startOffset,t.image.length,v(t),t.tokenType,!0);e.root=this.rootNode,this.addHiddenToken(this.rootNode,e)}}addHiddenToken(e,t){const{offset:n,end:r}=t;for(let i=0;io&&r=0;e--){const t=this.content[e];if(!t.hidden)return t}return this.content[this.content.length-1]}}class xc extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,xc.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,t,...n){return this.addParents(n),super.splice(e,t,...n)}addParents(e){for(const t of e)t.container=this.parent}}class Ic extends kc{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=null!=e?e:""}}const Sc=Symbol("Datatype");function Nc(e){return e.$type===Sc}const Cc=e=>e.endsWith("\u200b")?e:e+"\u200b";class $c{constructor(e){this._unorderedGroups=new Map,this.lexer=e.parser.Lexer;const t=this.lexer.definition;this.wrapper=new Pc(t,Object.assign(Object.assign({},e.parser.ParserConfig),{errorMessageProvider:e.parser.ParserErrorMessageProvider}))}alternatives(e,t){this.wrapper.wrapOr(e,t)}optional(e,t){this.wrapper.wrapOption(e,t)}many(e,t){this.wrapper.wrapMany(e,t)}atLeastOne(e,t){this.wrapper.wrapAtLeastOne(e,t)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}}class wc extends $c{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new vc,this.stack=[],this.assignmentMap=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,t){const n=e.fragment?void 0:gt(e)?Sc:Tt(e),r=this.wrapper.DEFINE_RULE(Cc(e.name),this.startImplementation(n,t).bind(this));return e.entry&&(this.mainRule=r),r}parse(e){this.nodeBuilder.buildRootNode(e);const t=this.lexer.tokenize(e);this.wrapper.input=t.tokens;const n=this.mainRule.call(this.wrapper,{});return this.nodeBuilder.addHiddenTokens(t.hidden),this.unorderedGroups.clear(),{value:n,lexerErrors:t.errors,parserErrors:this.wrapper.errors}}startImplementation(e,t){return n=>{if(!this.isRecording()){const t={$type:e};this.stack.push(t),e===Sc&&(t.value="")}let r;try{r=t(n)}catch(i){r=void 0}return this.isRecording()||void 0!==r||(r=this.construct()),r}}consume(e,t,n){const r=this.wrapper.wrapConsume(e,t);if(!this.isRecording()&&this.isValidToken(r)){const e=this.nodeBuilder.buildLeafNode(r,n),{assignment:t,isCrossRef:i}=this.getAssignment(n),s=this.current;if(t){const s=Ae(n)?r.image:this.converter.convert(r.image,e);this.assign(t.operator,t.feature,s,e,i)}else if(Nc(s)){let t=r.image;Ae(n)||(t=this.converter.convert(t,e).toString()),s.value+=t}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&"number"==typeof e.endOffset&&!isNaN(e.endOffset)}subrule(e,t,n,r){let i;this.isRecording()||(i=this.nodeBuilder.buildCompositeNode(n));const s=this.wrapper.wrapSubrule(e,t,r);!this.isRecording()&&i&&i.length>0&&this.performSubruleAssignment(s,n,i)}performSubruleAssignment(e,t,n){const{assignment:r,isCrossRef:i}=this.getAssignment(t);if(r)this.assign(r.operator,r.feature,e,n,i);else if(!r){const t=this.current;if(Nc(t))t.value+=e.toString();else if("object"==typeof e&&e){const n=e.$type,r=this.assignWithoutOverride(e,t);n&&(r.$type=n);const i=r;this.stack.pop(),this.stack.push(i)}}}action(e,t){if(!this.isRecording()){let n=this.current;if(!n.$cstNode&&t.feature&&t.operator){n=this.construct(!1);const e=n.$cstNode.feature;this.nodeBuilder.buildCompositeNode(e)}const r={$type:e};this.stack.pop(),this.stack.push(r),t.feature&&t.operator&&this.assign(t.operator,t.feature,n,n.$cstNode,!1)}}construct(e=!0){if(this.isRecording())return;const t=this.current;return be(t),this.nodeBuilder.construct(t),e&&this.stack.pop(),Nc(t)?this.converter.convert(t.value,t.$cstNode):(function(e,t){const n=e.getTypeMetaData(t.$type),r=t;for(const i of n.properties)void 0!==i.defaultValue&&void 0===r[i.name]&&(r[i.name]=Ke(i.defaultValue))}(this.astReflection,t),t)}getAssignment(e){if(!this.assignmentMap.has(e)){const t=_e(e,ue);this.assignmentMap.set(e,{assignment:t,isCrossRef:!!t&&fe(t.terminal)})}return this.assignmentMap.get(e)}assign(e,t,n,r,i){const s=this.current;let o;switch(o=i&&"string"==typeof n?this.linker.buildReference(s,t,r,n):n,e){case"=":s[t]=o;break;case"?=":s[t]=!0;break;case"+=":Array.isArray(s[t])||(s[t]=[]),s[t].push(o)}}assignWithoutOverride(e,t){for(const[n,r]of Object.entries(t)){const t=e[n];void 0===t?e[n]=r:Array.isArray(t)&&Array.isArray(r)&&(r.push(...t),e[n]=r)}return e}get definitionErrors(){return this.wrapper.definitionErrors}}class Lc{buildMismatchTokenMessage(e){return vi.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return vi.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return vi.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return vi.buildEarlyExitMessage(e)}}class Oc extends Lc{buildMismatchTokenMessage({expected:e,actual:t}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${t.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}}class bc extends $c{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const t=this.lexer.tokenize(e);return this.tokens=t.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,t){const n=this.wrapper.DEFINE_RULE(Cc(e.name),this.startImplementation(t).bind(this));return e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return t=>{const n=this.keepStackSize();try{e(t)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,t,n){this.wrapper.wrapConsume(e,t),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,t,n,r){this.before(n),this.wrapper.wrapSubrule(e,t,r),this.after(n)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const t=this.elementStack.lastIndexOf(e);t>=0&&this.elementStack.splice(t)}}get currIdx(){return this.wrapper.currIdx}}const _c={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Oc};class Pc extends so{constructor(e,t){const n=t&&"maxLookahead"in t;super(e,Object.assign(Object.assign(Object.assign({},_c),{lookaheadStrategy:n?new Os({maxLookahead:t.maxLookahead}):new bo}),t))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,t){return this.RULE(e,t)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,t){return this.consume(e,t)}wrapSubrule(e,t,n){return this.subrule(e,t,{ARGS:[n]})}wrapOr(e,t){this.or(e,t)}wrapOption(e,t){this.option(e,t)}wrapMany(e,t){this.many(e,t)}wrapAtLeastOne(e,t){this.atLeastOne(e,t)}}function Mc(e,t,n){return function(e,t){const n=lt(t,!1),r=m(t.rules).filter(X).filter((e=>n.has(e)));for(const i of r){const t=Object.assign(Object.assign({},e),{consume:1,optional:1,subrule:1,many:1,or:1});t.rules.set(i.name,e.parser.rule(i,Dc(t,i.definition)))}}({parser:t,tokens:n,rules:new Map,ruleNames:new Map},e),t}function Dc(e,t,n=!1){let r;if(Ae(t))r=function(e,t){const n=e.consume++,r=e.tokens[t.value];if(!r)throw new Error("Could not find token for keyword: "+t.value);return()=>e.parser.consume(n,r,t)}(e,t);else if(oe(t))r=function(e,t){const n=Tt(t);return()=>e.parser.action(n,t)}(e,t);else if(ue(t))r=Dc(e,t.terminal);else if(fe(t))r=Gc(e,t);else if(Ee(t))r=function(e,t){const n=t.rule.ref;if(X(n)){const r=e.subrule++,i=t.arguments.length>0?function(e,t){const n=t.map((e=>Uc(e.value)));return t=>{const r={};for(let i=0;i({});return s=>e.parser.subrule(r,Bc(e,n),t,i(s))}if(te(n)){const r=e.consume++,i=jc(e,n.name);return()=>e.parser.consume(r,i,t)}if(!n)throw new S(t.$cstNode,`Undefined rule type: ${t.$type}`);N()}(e,t);else if(ce(t))r=function(e,t){if(1===t.elements.length)return Dc(e,t.elements[0]);{const n=[];for(const i of t.elements){const t={ALT:Dc(e,i,!0)},r=Fc(i);r&&(t.GATE=Uc(r)),n.push(t)}const r=e.or++;return t=>e.parser.alternatives(r,n.map((e=>{const n={ALT:()=>e.ALT(t)},r=e.GATE;return r&&(n.GATE=()=>r(t)),n})))}}(e,t);else if(Ce(t))r=function(e,t){if(1===t.elements.length)return Dc(e,t.elements[0]);const n=[];for(const a of t.elements){const t={ALT:Dc(e,a,!0)},r=Fc(a);r&&(t.GATE=Uc(r)),n.push(t)}const r=e.or++,i=(e,t)=>`uGroup_${e}_${t.getRuleStack().join("-")}`,s=t=>e.parser.alternatives(r,n.map(((n,s)=>{const o={ALT:()=>!0},a=e.parser;o.ALT=()=>{if(n.ALT(t),!a.isRecording()){const e=i(r,a);a.unorderedGroups.get(e)||a.unorderedGroups.set(e,[]);const t=a.unorderedGroups.get(e);void 0===(null==t?void 0:t[s])&&(t[s]=!0)}};const c=n.GATE;return o.GATE=c?()=>c(t):()=>{const e=a.unorderedGroups.get(i(r,a));return!(null==e?void 0:e[s])},o}))),o=Kc(e,Fc(t),s,"*");return t=>{o(t),e.parser.isRecording()||e.parser.unorderedGroups.delete(i(r,e.parser))}}(e,t);else if(ge(t))r=function(e,t){const n=t.elements.map((t=>Dc(e,t)));return e=>n.forEach((t=>t(e)))}(e,t);else{if(i=t,!Oe.isInstance(i,pe))throw new S(t.$cstNode,`Unexpected element type: ${t.$type}`);{const n=e.consume++;r=()=>e.parser.consume(n,yi,t)}}var i;return Kc(e,n?void 0:Fc(t),r,t.cardinality)}function Uc(e){if(t=e,Oe.isInstance(t,U)){const t=Uc(e.left),n=Uc(e.right);return e=>t(e)||n(e)}if(function(e){return Oe.isInstance(e,D)}(e)){const t=Uc(e.left),n=Uc(e.right);return e=>t(e)&&n(e)}if(function(e){return Oe.isInstance(e,V)}(e)){const t=Uc(e.value);return e=>!t(e)}if(function(e){return Oe.isInstance(e,z)}(e)){const t=e.parameter.ref.name;return e=>void 0!==e&&!0===e[t]}if(function(e){return Oe.isInstance(e,M)}(e)){const t=Boolean(e.true);return()=>t}var t;N()}function Fc(e){if(ge(e))return e.guardCondition}function Gc(e,t,n=t.terminal){if(n){if(Ee(n)&&X(n.rule.ref)){const r=e.subrule++;return i=>e.parser.subrule(r,Bc(e,n.rule.ref),t,i)}if(Ee(n)&&te(n.rule.ref)){const r=e.consume++,i=jc(e,n.rule.ref.name);return()=>e.parser.consume(r,i,t)}if(Ae(n)){const r=e.consume++,i=jc(e,n.value);return()=>e.parser.consume(r,i,t)}throw new Error("Could not build cross reference parser")}{if(!t.type.ref)throw new Error("Could not resolve reference to type: "+t.type.$refText);const n=pt(t.type.ref),r=null==n?void 0:n.terminal;if(!r)throw new Error("Could not find name assignment for type: "+Tt(t.type.ref));return Gc(e,t,r)}}function Kc(e,t,n,r){const i=t&&Uc(t);if(!r){if(i){const t=e.or++;return r=>e.parser.alternatives(t,[{ALT:()=>n(r),GATE:()=>i(r)},{ALT:ro(),GATE:()=>!i(r)}])}return n}if("*"===r){const t=e.many++;return r=>e.parser.many(t,{DEF:()=>n(r),GATE:i?()=>i(r):void 0})}if("+"===r){const t=e.many++;if(i){const r=e.or++;return s=>e.parser.alternatives(r,[{ALT:()=>e.parser.atLeastOne(t,{DEF:()=>n(s)}),GATE:()=>i(s)},{ALT:ro(),GATE:()=>!i(s)}])}return r=>e.parser.atLeastOne(t,{DEF:()=>n(r)})}if("?"===r){const t=e.optional++;return r=>e.parser.optional(t,{DEF:()=>n(r),GATE:i?()=>i(r):void 0})}N()}function Bc(e,t){const n=function(e,t){if(X(t))return t.name;if(e.ruleNames.has(t))return e.ruleNames.get(t);{let n=t,r=n.$container,i=t.$type;for(;!X(r);){if(ge(r)||ce(r)||Ce(r)){i=r.elements.indexOf(n).toString()+":"+i}n=r,r=r.$container}return i=r.name+":"+i,e.ruleNames.set(t,i),i}}(e,t),r=e.rules.get(n);if(!r)throw new Error(`Rule "${n}" not found."`);return r}function jc(e,t){const n=e.tokens[t];if(!n)throw new Error(`Token "${t}" not found."`);return n}function Vc(e){const t=function(e){const t=e.Grammar,n=e.parser.Lexer,r=new wc(e);return Mc(t,r,n.definition)}(e);return t.finalize(),t}class Hc{buildTokens(e,t){const n=m(lt(e,!1)),r=this.buildTerminalTokens(n),i=this.buildKeywordTokens(n,r,t);return r.forEach((e=>{const t=e.PATTERN;"object"==typeof t&&t&&"test"in t&&ot(t)?i.unshift(e):i.push(e)})),i}buildTerminalTokens(e){return e.filter(te).filter((e=>!e.fragment)).map((e=>this.buildTerminalToken(e))).toArray()}buildTerminalToken(e){const t=vt(e),n=this.requiresCustomPattern(t)?this.regexPatternFunction(t):t,r={name:e.name,PATTERN:n,LINE_BREAKS:!0};return e.hidden&&(r.GROUP=ot(t)?ii.SKIPPED:"hidden"),r}requiresCustomPattern(e){return!!e.flags.includes("u")||!(!e.source.includes("?<=")&&!e.source.includes("?{t.lastIndex=n;return t.exec(e)}}buildKeywordTokens(e,t,n){return e.filter(X).flatMap((e=>De(e).filter(Ae))).distinct((e=>e.value)).toArray().sort(((e,t)=>t.value.length-e.value.length)).map((e=>this.buildKeywordToken(e,t,Boolean(null==n?void 0:n.caseInsensitive))))}buildKeywordToken(e,t,n){return{name:e.value,PATTERN:this.buildKeywordPattern(e,n),LONGER_ALT:this.findLongerAlt(e,t)}}buildKeywordPattern(e,t){return t?new RegExp(function(e){return Array.prototype.map.call(e,(e=>/\w/.test(e)?`[${e.toLowerCase()}${e.toUpperCase()}]`:at(e))).join("")}(e.value)):e.value}findLongerAlt(e,t){return t.reduce(((t,n)=>{const r=null==n?void 0:n.PATTERN;return(null==r?void 0:r.source)&&ct("^"+r.source+"$",e.value)&&t.push(n),t}),[])}}class Wc{convert(e,t){let n=t.grammarSource;if(fe(n)&&(n=function(e){if(e.terminal)return e.terminal;if(e.type.ref){const t=pt(e.type.ref);return null==t?void 0:t.terminal}}(n)),Ee(n)){const r=n.rule.ref;if(!r)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(r,e,t)}return e}runConverter(e,t,n){var r;switch(e.name.toUpperCase()){case"INT":return zc.convertInt(t);case"STRING":return zc.convertString(t);case"ID":return zc.convertID(t)}switch(null===(r=function(e){var t,n,r;return te(e)?null!==(n=null===(t=e.type)||void 0===t?void 0:t.name)&&void 0!==n?n:"string":gt(e)?e.name:null!==(r=At(e))&&void 0!==r?r:e.name}(e))||void 0===r?void 0:r.toLowerCase()){case"number":return zc.convertNumber(t);case"boolean":return zc.convertBoolean(t);case"bigint":return zc.convertBigint(t);case"date":return zc.convertDate(t);default:return t}}}var zc;!function(e){function t(e){switch(e){case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";case"v":return"\v";case"0":return"\0";default:return e}}e.convertString=function(e){let n="";for(let r=1;r=qc&&(Xc=t,await new Promise((e=>{"undefined"==typeof setImmediate?setTimeout(e,0):setImmediate(e)}))),e.isCancellationRequested)throw Qc}class el{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=t=>(e(t),this),this.reject=e=>(t(e),this)}))}}class tl{constructor(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){for(const n of e)if(tl.isIncremental(n)){const e=al(n.range),t=this.offsetAt(e.start),r=this.offsetAt(e.end);this._content=this._content.substring(0,t)+n.text+this._content.substring(r,this._content.length);const i=Math.max(e.start.line,0),s=Math.max(e.end.line,0);let o=this._lineOffsets;const a=sl(n.text,!1,t);if(s-i===a.length)for(let n=0,l=a.length;ne?r=i:n=i+1}const i=n-1;return{line:i,character:(e=this.ensureBeforeEOL(e,t[i]))-t[i]}}offsetAt(e){const t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;const n=t[e.line];if(e.character<=0)return n;const r=e.line+1t&&ol(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const t=e;return null!=t&&"string"==typeof t.text&&void 0!==t.range&&(void 0===t.rangeLength||"number"==typeof t.rangeLength)}static isFull(e){const t=e;return null!=t&&"string"==typeof t.text&&void 0===t.range&&void 0===t.rangeLength}}var nl,rl;function il(e,t){if(e.length<=1)return e;const n=e.length/2|0,r=e.slice(0,n),i=e.slice(n);il(r,t),il(i,t);let s=0,o=0,a=0;for(;sn.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}function cl(e){const t=al(e.range);return t!==e.range?{newText:e.newText,range:t}:e}!function(e){e.create=function(e,t,n,r){return new tl(e,t,n,r)},e.update=function(e,t,n){if(e instanceof tl)return e.update(t,n),e;throw new Error("TextDocument.update: document must be created by TextDocument.create")},e.applyEdits=function(e,t){const n=e.getText(),r=il(t.map(cl),((e,t)=>{const n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n}));let i=0;const s=[];for(const o of r){const t=e.offsetAt(o.range.start);if(ti&&s.push(n.substring(i,t)),o.newText.length&&s.push(o.newText),i=e.offsetAt(o.range.end)}return s.push(n.substr(i)),s.join("")}}(nl||(nl={})),(()=>{var e={470:e=>{function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",i=0,s=-1,o=0,a=0;a<=e.length;++a){if(a2){var c=r.lastIndexOf("/");if(c!==r.length-1){-1===c?(r="",i=0):i=(r=r.slice(0,c)).length-1-r.lastIndexOf("/"),s=a,o=0;continue}}else if(2===r.length||1===r.length){r="",i=0,s=a,o=0;continue}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(s+1,a):r=e.slice(s+1,a),i=a-s-1;s=a,o=0}else 46===n&&-1!==o?++o:o=-1}return r}var r={resolve:function(){for(var e,r="",i=!1,s=arguments.length-1;s>=-1&&!i;s--){var o;s>=0?o=arguments[s]:(void 0===e&&(e=process.cwd()),o=e),t(o),0!==o.length&&(r=o+"/"+r,i=47===o.charCodeAt(0))}return r=n(r,!i),i?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var i=1;il){if(47===n.charCodeAt(a+d))return n.slice(a+d+1);if(0===d)return n.slice(a+d)}else o>l&&(47===e.charCodeAt(i+d)?u=d:0===d&&(u=0));break}var h=e.charCodeAt(i+d);if(h!==n.charCodeAt(a+d))break;47===h&&(u=d)}var f="";for(d=i+u+1;d<=s;++d)d!==s&&47!==e.charCodeAt(d)||(0===f.length?f+="..":f+="/..");return f.length>0?f+n.slice(a+u):(a+=u,47===n.charCodeAt(a)&&++a,n.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,i=-1,s=!0,o=e.length-1;o>=1;--o)if(47===(n=e.charCodeAt(o))){if(!s){i=o;break}}else s=!1;return-1===i?r?"/":".":r&&1===i?"//":e.slice(0,i)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,i=0,s=-1,o=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var a=n.length-1,c=-1;for(r=e.length-1;r>=0;--r){var l=e.charCodeAt(r);if(47===l){if(!o){i=r+1;break}}else-1===c&&(o=!1,c=r+1),a>=0&&(l===n.charCodeAt(a)?-1==--a&&(s=r):(a=-1,s=c))}return i===s?s=c:-1===s&&(s=e.length),e.slice(i,s)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!o){i=r+1;break}}else-1===s&&(o=!1,s=r+1);return-1===s?"":e.slice(i,s)},extname:function(e){t(e);for(var n=-1,r=0,i=-1,s=!0,o=0,a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(47!==c)-1===i&&(s=!1,i=a+1),46===c?-1===n?n=a:1!==o&&(o=1):-1!==n&&(o=-1);else if(!s){r=a+1;break}}return-1===n||-1===i||0===o||1===o&&n===i-1&&n===r+1?"":e.slice(n,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,i=e.charCodeAt(0),s=47===i;s?(n.root="/",r=1):r=0;for(var o=-1,a=0,c=-1,l=!0,u=e.length-1,d=0;u>=r;--u)if(47!==(i=e.charCodeAt(u)))-1===c&&(l=!1,c=u+1),46===i?-1===o?o=u:1!==d&&(d=1):-1!==o&&(d=-1);else if(!l){a=u+1;break}return-1===o||-1===c||0===d||1===d&&o===c-1&&o===a+1?-1!==c&&(n.base=n.name=0===a&&s?e.slice(1,c):e.slice(a,c)):(0===a&&s?(n.name=e.slice(1,o),n.base=e.slice(1,c)):(n.name=e.slice(a,o),n.base=e.slice(a,c)),n.ext=e.slice(o,c)),a>0?n.dir=e.slice(0,a-1):s&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{let e;if(n.r(r),n.d(r,{URI:()=>u,Utils:()=>x}),"object"==typeof process)e="win32"===process.platform;else if("object"==typeof navigator){let t=navigator.userAgent;e=t.indexOf("Windows")>=0}const t=/^\w[\w\d+.-]*$/,i=/^\//,s=/^\/\//;function o(e,n){if(!e.scheme&&n)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!t.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!i.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(s.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}const a="",c="/",l=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class u{static isUri(e){return e instanceof u||!!e&&"string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"string"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString}scheme;authority;path;query;fragment;constructor(e,t,n,r,i,s=!1){"object"==typeof e?(this.scheme=e.scheme||a,this.authority=e.authority||a,this.path=e.path||a,this.query=e.query||a,this.fragment=e.fragment||a):(this.scheme=function(e,t){return e||t?e:"file"}(e,s),this.authority=t||a,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==c&&(t=c+t):t=c}return t}(this.scheme,n||a),this.query=r||a,this.fragment=i||a,o(this,s))}get fsPath(){return g(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:n,path:r,query:i,fragment:s}=e;return void 0===t?t=this.scheme:null===t&&(t=a),void 0===n?n=this.authority:null===n&&(n=a),void 0===r?r=this.path:null===r&&(r=a),void 0===i?i=this.query:null===i&&(i=a),void 0===s?s=this.fragment:null===s&&(s=a),t===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&s===this.fragment?this:new h(t,n,r,i,s)}static parse(e,t=!1){const n=l.exec(e);return n?new h(n[2]||a,v(n[4]||a),v(n[5]||a),v(n[7]||a),v(n[9]||a),t):new h(a,a,a,a,a)}static file(t){let n=a;if(e&&(t=t.replace(/\\/g,c)),t[0]===c&&t[1]===c){const e=t.indexOf(c,2);-1===e?(n=t.substring(2),t=c):(n=t.substring(2,e),t=t.substring(e)||c)}return new h("file",n,t,a,a)}static from(e){const t=new h(e.scheme,e.authority,e.path,e.query,e.fragment);return o(t,!0),t}toString(e=!1){return y(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof u)return e;{const t=new h(e);return t._formatted=e.external,t._fsPath=e._sep===d?e.fsPath:null,t}}return e}}const d=e?1:void 0;class h extends u{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=g(this,!1)),this._fsPath}toString(e=!1){return e?y(this,!0):(this._formatted||(this._formatted=y(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=d),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}}const f={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function p(e,t,n){let r,i=-1;for(let s=0;s=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||45===o||46===o||95===o||126===o||t&&47===o||n&&91===o||n&&93===o||n&&58===o)-1!==i&&(r+=encodeURIComponent(e.substring(i,s)),i=-1),void 0!==r&&(r+=e.charAt(s));else{void 0===r&&(r=e.substr(0,s));const t=f[o];void 0!==t?(-1!==i&&(r+=encodeURIComponent(e.substring(i,s)),i=-1),r+=t):-1===i&&(i=s)}}return-1!==i&&(r+=encodeURIComponent(e.substring(i))),void 0!==r?r:e}function m(e){let t;for(let n=0;n1&&"file"===t.scheme?`//${t.authority}${t.path}`:47===t.path.charCodeAt(0)&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&58===t.path.charCodeAt(2)?n?t.path.substr(1):t.path[1].toLowerCase()+t.path.substr(2):t.path,e&&(r=r.replace(/\//g,"\\")),r}function y(e,t){const n=t?m:p;let r="",{scheme:i,authority:s,path:o,query:a,fragment:l}=e;if(i&&(r+=i,r+=":"),(s||"file"===i)&&(r+=c,r+=c),s){let e=s.indexOf("@");if(-1!==e){const t=s.substr(0,e);s=s.substr(e+1),e=t.lastIndexOf(":"),-1===e?r+=n(t,!1,!1):(r+=n(t.substr(0,e),!1,!1),r+=":",r+=n(t.substr(e+1),!1,!0)),r+="@"}s=s.toLowerCase(),e=s.lastIndexOf(":"),-1===e?r+=n(s,!1,!0):(r+=n(s.substr(0,e),!1,!0),r+=s.substr(e))}if(o){if(o.length>=3&&47===o.charCodeAt(0)&&58===o.charCodeAt(2)){const e=o.charCodeAt(1);e>=65&&e<=90&&(o=`/${String.fromCharCode(e+32)}:${o.substr(3)}`)}else if(o.length>=2&&58===o.charCodeAt(1)){const e=o.charCodeAt(0);e>=65&&e<=90&&(o=`${String.fromCharCode(e+32)}:${o.substr(2)}`)}r+=n(o,!0,!1)}return a&&(r+="?",r+=n(a,!1,!1)),l&&(r+="#",r+=t?l:p(l,!1,!1)),r}function A(e){try{return decodeURIComponent(e)}catch{return e.length>3?e.substr(0,3)+A(e.substr(3)):e}}const T=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function v(e){return e.match(T)?e.replace(T,(e=>A(e))):e}var R=n(470);const E=R.posix||R,k="/";var x;!function(e){e.joinPath=function(e,...t){return e.with({path:E.join(e.path,...t)})},e.resolvePath=function(e,...t){let n=e.path,r=!1;n[0]!==k&&(n=k+n,r=!0);let i=E.resolve(n,...t);return r&&i[0]===k&&!e.authority&&(i=i.substring(1)),e.with({path:i})},e.dirname=function(e){if(0===e.path.length||e.path===k)return e;let t=E.dirname(e.path);return 1===t.length&&46===t.charCodeAt(0)&&(t=""),e.with({path:t})},e.basename=function(e){return E.basename(e.path)},e.extname=function(e){return E.extname(e.path)}}(x||(x={}))})(),rl=r})();const{URI:ll,Utils:ul}=rl;var dl,hl;!function(e){e.basename=ul.basename,e.dirname=ul.dirname,e.extname=ul.extname,e.joinPath=ul.joinPath,e.resolvePath=ul.resolvePath,e.equals=function(e,t){return(null==e?void 0:e.toString())===(null==t?void 0:t.toString())},e.relative=function(e,t){const n="string"==typeof e?e:e.path,r="string"==typeof t?t:t.path,i=n.split("/").filter((e=>e.length>0)),s=r.split("/").filter((e=>e.length>0));let o=0;for(;onull!=r?r:r=nl.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,null!=t?t:"")}}class pl{constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory}get all(){return m(this.documentMap.values())}addDocument(e){const t=e.uri.toString();if(this.documentMap.has(t))throw new Error(`A document with the URI '${t}' is already present.`);this.documentMap.set(t,e)}getDocument(e){const t=e.toString();return this.documentMap.get(t)}async getOrCreateDocument(e,t){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,t),this.addDocument(n),n)}createDocument(e,t,n){if(n)return this.langiumDocumentFactory.fromString(t,e,n).then((e=>(this.addDocument(e),e)));{const n=this.langiumDocumentFactory.fromString(t,e);return this.addDocument(n),n}}hasDocument(e){return this.documentMap.has(e.toString())}invalidateDocument(e){const t=e.toString(),n=this.documentMap.get(t);return n&&(n.state=hl.Changed,n.precomputedScopes=void 0,n.references=[],n.diagnostics=void 0),n}deleteDocument(e){const t=e.toString(),n=this.documentMap.get(t);return n&&(n.state=hl.Changed,this.documentMap.delete(t)),n}}class ml{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator}async link(e,t=Yc.XO.None){for(const n of Ue(e.parseResult.value))await Zc(t),Ge(n).forEach((t=>this.doLink(t,e)))}doLink(e,t){const n=e.reference;if(void 0===n._ref)try{const t=this.getCandidate(e);if(s(t))n._ref=t;else if(n._nodeDescription=t,this.langiumDocuments().hasDocument(t.documentUri)){const r=this.loadAstNode(t);n._ref=null!=r?r:this.createLinkingError(e,t)}}catch(r){n._ref=Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${n.$refText}': ${r}`})}t.references.push(n)}unlink(e){for(const t of e.references)delete t._ref,delete t._nodeDescription;e.references=[]}getCandidate(e){const t=this.scopeProvider.getScope(e).getElement(e.reference.$refText);return null!=t?t:this.createLinkingError(e)}buildReference(e,t,n,i){const o=this,a={$refNode:n,$refText:i,get ref(){var n,i;if(r(this._ref))return this._ref;if("object"==typeof(i=this._nodeDescription)&&null!==i&&"string"==typeof i.name&&"string"==typeof i.type&&"string"==typeof i.path){const n=o.loadAstNode(this._nodeDescription);this._ref=null!=n?n:o.createLinkingError({reference:a,container:e,property:t},this._nodeDescription)}else if(void 0===this._ref){const r=o.getLinkedNode({reference:a,container:e,property:t});if(r.error&&Pe(e).state=e.end)return t.ref}if(n){const t=this.nameProvider.getNameNode(n);if(t&&(t===e||function(e,t){for(;e.container;)if((e=e.container)===t)return!0;return!1}(e,t)))return n}}}findDeclarationNode(e){const t=this.findDeclaration(e);if(null==t?void 0:t.$cstNode){const e=this.nameProvider.getNameNode(t);return null!=e?e:t.$cstNode}}findReferences(e,t){const n=[];if(t.includeDeclaration){const t=this.getReferenceToSelf(e);t&&n.push(t)}let r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return t.documentUri&&(r=r.filter((e=>dl.equals(e.sourceUri,t.documentUri)))),n.push(...r),m(n)}getReferenceToSelf(e){const t=this.nameProvider.getNameNode(e);if(t){const n=Pe(e),r=this.nodeLocator.getAstNodePath(e);return{sourceUri:n.uri,sourcePath:r,targetUri:n.uri,targetPath:r,segment:R(t),local:!0}}}}class Al{constructor(e){if(this.map=new Map,e)for(const[t,n]of e)this.add(t,n)}get size(){return y.sum(m(this.map.values()).map((e=>e.length)))}clear(){this.map.clear()}delete(e,t){if(void 0===t)return this.map.delete(e);{const n=this.map.get(e);if(n){const r=n.indexOf(t);if(r>=0)return 1===n.length?this.map.delete(e):n.splice(r,1),!0}return!1}}get(e){var t;return null!==(t=this.map.get(e))&&void 0!==t?t:[]}has(e,t){if(void 0===t)return this.map.has(e);{const n=this.map.get(e);return!!n&&n.indexOf(t)>=0}}add(e,t){return this.map.has(e)?this.map.get(e).push(t):this.map.set(e,[t]),this}addAll(e,t){return this.map.has(e)?this.map.get(e).push(...t):this.map.set(e,Array.from(t)),this}forEach(e){this.map.forEach(((t,n)=>t.forEach((t=>e(t,n,this)))))}[Symbol.iterator](){return this.entries().iterator()}entries(){return m(this.map.entries()).flatMap((([e,t])=>t.map((t=>[e,t]))))}keys(){return m(this.map.keys())}values(){return m(this.map.values()).flat()}entriesGroupedByKey(){return m(this.map.entries())}}class Tl{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[t,n]of e)this.set(t,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,t){return this.map.set(e,t),this.inverse.set(t,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const t=this.map.get(e);return void 0!==t&&(this.map.delete(e),this.inverse.delete(t),!0)}}class vl{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,t=Yc.XO.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,t)}async computeExportsForNode(e,t,n=Me,r=Yc.XO.None){const i=[];this.exportNode(e,i,t);for(const s of n(e))await Zc(r),this.exportNode(s,i,t);return i}exportNode(e,t,n){const r=this.nameProvider.getName(e);r&&t.push(this.descriptions.createDescription(e,r,n))}async computeLocalScopes(e,t=Yc.XO.None){const n=e.parseResult.value,r=new Al;for(const i of De(n))await Zc(t),this.processNode(i,e,r);return r}processNode(e,t,n){const r=e.$container;if(r){const i=this.nameProvider.getName(e);i&&n.add(r,this.descriptions.createDescription(e,i,t))}}}class Rl{constructor(e,t,n){var r;this.elements=e,this.outerScope=t,this.caseInsensitive=null!==(r=null==n?void 0:n.caseInsensitive)&&void 0!==r&&r}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const t=this.caseInsensitive?this.elements.find((t=>t.name.toLowerCase()===e.toLowerCase())):this.elements.find((t=>t.name===e));return t||(this.outerScope?this.outerScope.getElement(e):void 0)}}class El{constructor(e,t,n){var r;this.elements=new Map,this.caseInsensitive=null!==(r=null==n?void 0:n.caseInsensitive)&&void 0!==r&&r;for(const i of e){const e=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.set(e,i)}this.outerScope=t}getElement(e){const t=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(t);return n||(this.outerScope?this.outerScope.getElement(e):void 0)}getAllElements(){let e=m(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}class kl{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach((e=>e.dispose()))}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}}class xl extends kl{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,t){this.throwIfDisposed(),this.cache.set(e,t)}get(e,t){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(t){const n=t();return this.cache.set(e,n),n}}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}}class Il extends kl{constructor(e){super(),this.cache=new Map,this.converter=null!=e?e:e=>e}has(e,t){return this.throwIfDisposed(),this.cacheForContext(e).has(t)}set(e,t,n){this.throwIfDisposed(),this.cacheForContext(e).set(t,n)}get(e,t,n){this.throwIfDisposed();const r=this.cacheForContext(e);if(r.has(t))return r.get(t);if(n){const e=n();return r.set(t,e),e}}delete(e,t){return this.throwIfDisposed(),this.cacheForContext(e).delete(t)}clear(e){if(this.throwIfDisposed(),e){const t=this.converter(e);this.cache.delete(t)}else this.cache.clear()}cacheForContext(e){const t=this.converter(e);let n=this.cache.get(t);return n||(n=new Map,this.cache.set(t,n)),n}}class Sl extends xl{constructor(e){super(),this.onDispose(e.workspace.DocumentBuilder.onUpdate((()=>{this.clear()})))}}class Nl{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new Sl(e.shared)}getScope(e){const t=[],n=this.reflection.getReferenceType(e),r=Pe(e.container).precomputedScopes;if(r){let i=e.container;do{const e=r.get(i);e.length>0&&t.push(m(e).filter((e=>this.reflection.isSubtype(e.type,n)))),i=i.$container}while(i)}let i=this.getGlobalScope(n,e);for(let s=t.length-1;s>=0;s--)i=this.createScope(t[s],i);return i}createScope(e,t,n){return new Rl(m(e),t,n)}createScopeForNodes(e,t,n){const r=m(e).map((e=>{const t=this.nameProvider.getName(e);if(t)return this.descriptions.createDescription(e,t)})).nonNullable();return new Rl(r,t,n)}getGlobalScope(e,t){return this.globalScopeCache.get(e,(()=>new El(this.indexManager.allElements(e))))}}function Cl(e){return"object"==typeof e&&!!e&&("$ref"in e||"$error"in e)}class $l{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,t={}){const n=null==t?void 0:t.replacer,r=(e,n)=>this.replacer(e,n,t),i=n?(e,t)=>n(e,t,r):r;try{return this.currentDocument=Pe(e),JSON.stringify(e,i,null==t?void 0:t.space)}finally{this.currentDocument=void 0}}deserialize(e,t={}){const n=JSON.parse(e);return this.linkNode(n,n,t),n}replacer(e,t,{refText:n,sourceText:s,textRegions:o,comments:a,uriConverter:c}){var l,u,d,h;if(!this.ignoreProperties.has(e)){if(i(t)){const e=t.ref,r=n?t.$refText:void 0;if(e){const n=Pe(e);let i="";this.currentDocument&&this.currentDocument!==n&&(i=c?c(n.uri,t):n.uri.toString());return{$ref:`${i}#${this.astNodeLocator.getAstNodePath(e)}`,$refText:r}}return{$error:null!==(u=null===(l=t.error)||void 0===l?void 0:l.message)&&void 0!==u?u:"Could not resolve reference",$refText:r}}if(r(t)){let n;if(o&&(n=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},t)),e&&!t.$document||!(null==n?void 0:n.$textRegion)||(n.$textRegion.documentURI=null===(d=this.currentDocument)||void 0===d?void 0:d.uri.toString())),s&&!e&&(null!=n||(n=Object.assign({},t)),n.$sourceText=null===(h=t.$cstNode)||void 0===h?void 0:h.text),a){null!=n||(n=Object.assign({},t));const e=this.commentProvider.getComment(t);e&&(n.$comment=e.replace(/\r/g,""))}return null!=n?n:t}return t}}addAstNodeRegionWithAssignmentsTo(e){const t=e=>({offset:e.offset,end:e.end,length:e.length,range:e.range});if(e.$cstNode){const n=(e.$textRegion=t(e.$cstNode)).assignments={};return Object.keys(e).filter((e=>!e.startsWith("$"))).forEach((r=>{const i=function(e,t){return e&&t?ht(e,t,e.astNode,!0):[]}(e.$cstNode,r).map(t);0!==i.length&&(n[r]=i)})),e}}linkNode(e,t,n,i,s,o){for(const[c,l]of Object.entries(e))if(Array.isArray(l))for(let i=0;i{try{await e.call(t,n,r,i)}catch(s){if(Jc(s))throw s;console.error("An error occurred during validation:",s);const e=s instanceof Error?s.message:String(s);s instanceof Error&&s.stack&&console.error(s.stack),r("error","An error occurred during validation: "+e,{node:n})}}}addEntry(e,t){if("AstNode"!==e)for(const n of this.reflection.getAllSubTypes(e))this.entries.add(n,t);else this.entries.add("AstNode",t)}getChecks(e,t){let n=m(this.entries.get(e)).concat(this.entries.get("AstNode"));return t&&(n=n.filter((e=>t.includes(e.category)))),n.map((e=>e.check))}}class Ml{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,t={},n=Yc.XO.None){const r=e.parseResult,i=[];if(await Zc(n),!t.categories||t.categories.includes("built-in")){if(this.processLexingErrors(r,i,t),t.stopAfterLexingErrors&&i.some((e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.code)===bl.LexingError})))return i;if(this.processParsingErrors(r,i,t),t.stopAfterParsingErrors&&i.some((e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.code)===bl.ParsingError})))return i;if(this.processLinkingErrors(e,i,t),t.stopAfterLinkingErrors&&i.some((e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.code)===bl.LinkingError})))return i}try{i.push(...await this.validateAst(r.value,t,n))}catch(s){if(Jc(s))throw s;console.error("An error occurred during validation:",s)}return await Zc(n),i}processLexingErrors(e,t,n){for(const r of e.lexerErrors){const e={severity:Ul("error"),range:{start:{line:r.line-1,character:r.column-1},end:{line:r.line-1,character:r.column+r.length-1}},message:r.message,data:Ll(bl.LexingError),source:this.getSource()};t.push(e)}}processParsingErrors(e,t,n){for(const r of e.parserErrors){let e;if(isNaN(r.token.startOffset)){if("previousToken"in r){const t=r.previousToken;if(isNaN(t.startOffset)){const t={line:0,character:0};e={start:t,end:t}}else{const n={line:t.endLine-1,character:t.endColumn};e={start:n,end:n}}}}else e=v(r.token);if(e){const n={severity:Ul("error"),range:e,message:r.message,data:Ll(bl.ParsingError),source:this.getSource()};t.push(n)}}}processLinkingErrors(e,t,n){for(const r of e.references){const e=r.error;if(e){const n={node:e.container,property:e.property,index:e.index,data:{code:bl.LinkingError,containerType:e.container.$type,property:e.property,refText:e.reference.$refText}};t.push(this.toDiagnostic("error",e.message,n))}}}async validateAst(e,t,n=Yc.XO.None){const r=[],i=(e,t,n)=>{r.push(this.toDiagnostic(e,t,n))};return await Promise.all(Ue(e).map((async e=>{await Zc(n);const r=this.validationRegistry.getChecks(e.$type,t.categories);for(const t of r)await t(e,i,n)}))),r}toDiagnostic(e,t,n){return{message:t,range:Dl(n),severity:Ul(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}}function Dl(e){if(e.range)return e.range;let t;return"string"==typeof e.property?t=dt(e.node.$cstNode,e.property,e.index):"string"==typeof e.keyword&&(t=function(e,t,n){if(!e)return;const r=ft(e,t,null==e?void 0:e.astNode);return 0!==r.length?r[n=void 0!==n?Math.max(0,Math.min(n,r.length-1)):0]:void 0}(e.node.$cstNode,e.keyword,e.index)),null!=t||(t=e.node.$cstNode),t?t.range:{start:{line:0,character:0},end:{line:0,character:0}}}function Ul(e){switch(e){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+e)}}!function(e){e.LexingError="lexing-error",e.ParsingError="parsing-error",e.LinkingError="linking-error"}(bl||(bl={}));class Fl{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,t,n=Pe(e)){null!=t||(t=this.nameProvider.getName(e));const r=this.astNodeLocator.getAstNodePath(e);if(!t)throw new Error(`Node at path ${r} has no name.`);let i;const s=()=>{var t;return null!=i?i:i=R(null!==(t=this.nameProvider.getNameNode(e))&&void 0!==t?t:e.$cstNode)};return{node:e,name:t,get nameSegment(){return s()},selectionSegment:R(e.$cstNode),type:e.$type,documentUri:n.uri,path:r}}}class Gl{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,t=Yc.XO.None){const n=[],r=e.parseResult.value;for(const i of Ue(r))await Zc(t),Ge(i).filter((e=>!s(e))).forEach((e=>{const t=this.createDescription(e);t&&n.push(t)}));return n}createDescription(e){const t=e.reference.$nodeDescription,n=e.reference.$refNode;if(!t||!n)return;const r=Pe(e.container).uri;return{sourceUri:r,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:t.documentUri,targetPath:t.path,segment:R(n),local:dl.equals(t.documentUri,r)}}}class Kl{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const t=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return t+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:t}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return void 0!==t?e+this.indexSeparator+t:e}getAstNode(e,t){return t.split(this.segmentSeparator).reduce(((e,t)=>{if(!e||0===t.length)return e;const n=t.indexOf(this.indexSeparator);if(n>0){const r=t.substring(0,n),i=parseInt(t.substring(n+1)),s=e[r];return null==s?void 0:s[i]}return e[t]}),e)}}class Bl{constructor(e){this._ready=new el,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var t,n;this.workspaceConfig=null!==(n=null===(t=e.capabilities.workspace)||void 0===t?void 0:t.configuration)&&void 0!==n&&n}async initialized(e){if(this.workspaceConfig){if(e.register){const t=this.serviceRegistry.all;e.register({section:t.map((e=>this.toSectionName(e.LanguageMetaData.languageId)))})}if(e.fetchConfiguration){const t=this.serviceRegistry.all.map((e=>({section:this.toSectionName(e.LanguageMetaData.languageId)}))),n=await e.fetchConfiguration(t);t.forEach(((e,t)=>{this.updateSectionConfiguration(e.section,n[t])}))}}this._ready.resolve()}updateConfiguration(e){e.settings&&Object.keys(e.settings).forEach((t=>{this.updateSectionConfiguration(t,e.settings[t])}))}updateSectionConfiguration(e,t){this.settings[e]=t}async getConfiguration(e,t){await this.ready;const n=this.toSectionName(e);if(this.settings[n])return this.settings[n][t]}toSectionName(e){return`${e}`}}!function(e){e.create=function(e){return{dispose:async()=>await e()}}}(_l||(_l={}));class jl{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Al,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=hl.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.indexManager=e.workspace.IndexManager,this.serviceRegistry=e.ServiceRegistry}async build(e,t={},n=Yc.XO.None){var r,i;for(const s of e){const e=s.uri.toString();if(s.state===hl.Validated){if("boolean"==typeof t.validation&&t.validation)s.state=hl.IndexedReferences,s.diagnostics=void 0,this.buildState.delete(e);else if("object"==typeof t.validation){const n=this.buildState.get(e),o=null===(r=null==n?void 0:n.result)||void 0===r?void 0:r.validationChecks;if(o){const r=(null!==(i=t.validation.categories)&&void 0!==i?i:Ol.all).filter((e=>!o.includes(e)));r.length>0&&(this.buildState.set(e,{completed:!1,options:{validation:Object.assign(Object.assign({},t.validation),{categories:r})},result:n.result}),s.state=hl.IndexedReferences)}}}else this.buildState.delete(e)}this.currentState=hl.Changed,await this.emitUpdate(e.map((e=>e.uri)),[]),await this.buildDocuments(e,t,n)}async update(e,t,n=Yc.XO.None){this.currentState=hl.Changed;for(const s of t)this.langiumDocuments.deleteDocument(s),this.buildState.delete(s.toString()),this.indexManager.remove(s);for(const s of e){if(!this.langiumDocuments.invalidateDocument(s)){const e=this.langiumDocumentFactory.fromModel({$type:"INVALID"},s);e.state=hl.Changed,this.langiumDocuments.addDocument(e)}this.buildState.delete(s.toString())}const r=m(e).concat(t).map((e=>e.toString())).toSet();this.langiumDocuments.all.filter((e=>!r.has(e.uri.toString())&&this.shouldRelink(e,r))).forEach((e=>{this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e),e.state=Math.min(e.state,hl.ComputedScopes),e.diagnostics=void 0})),await this.emitUpdate(e,t),await Zc(n);const i=this.langiumDocuments.all.filter((e=>{var t;return e.staten(e,t))))}shouldRelink(e,t){return!!e.references.some((e=>void 0!==e.error))||this.indexManager.isAffected(e,t)}onUpdate(e){return this.updateListeners.push(e),_l.create((()=>{const t=this.updateListeners.indexOf(e);t>=0&&this.updateListeners.splice(t,1)}))}async buildDocuments(e,t,n){this.prepareBuild(e,t),await this.runCancelable(e,hl.Parsed,n,(e=>this.langiumDocumentFactory.update(e,n))),await this.runCancelable(e,hl.IndexedContent,n,(e=>this.indexManager.updateContent(e,n))),await this.runCancelable(e,hl.ComputedScopes,n,(async e=>{const t=this.serviceRegistry.getServices(e.uri).references.ScopeComputation;e.precomputedScopes=await t.computeLocalScopes(e,n)})),await this.runCancelable(e,hl.Linked,n,(e=>this.serviceRegistry.getServices(e.uri).references.Linker.link(e,n))),await this.runCancelable(e,hl.IndexedReferences,n,(e=>this.indexManager.updateReferences(e,n)));const r=e.filter((e=>this.shouldValidate(e)));await this.runCancelable(r,hl.Validated,n,(e=>this.validate(e,n)));for(const i of e){const e=this.buildState.get(i.uri.toString());e&&(e.completed=!0)}}prepareBuild(e,t){for(const n of e){const e=n.uri.toString(),r=this.buildState.get(e);r&&!r.completed||this.buildState.set(e,{completed:!1,options:t,result:null==r?void 0:r.result})}}async runCancelable(e,t,n,r){const i=e.filter((e=>e.state{this.buildPhaseListeners.delete(e,t)}))}waitUntil(e,t,n){let r;if(t&&"path"in t?r=t:n=t,null!=n||(n=Yc.XO.None),r){const t=this.langiumDocuments.getDocument(r);if(t&&t.state>e)return Promise.resolve(r)}return this.currentState>=e?Promise.resolve(void 0):n.isCancellationRequested?Promise.reject(Qc):new Promise(((t,i)=>{const s=this.onBuildPhase(e,(()=>{if(s.dispose(),o.dispose(),r){const e=this.langiumDocuments.getDocument(r);t(null==e?void 0:e.uri)}else t(void 0)})),o=n.onCancellationRequested((()=>{s.dispose(),o.dispose(),i(Qc)}))}))}async notifyBuildPhase(e,t,n){if(0===e.length)return;const r=this.buildPhaseListeners.get(t);for(const i of r)await Zc(n),await i(e,n)}shouldValidate(e){return Boolean(this.getBuildOptions(e).validation)}async validate(e,t){var n,r;const i=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,s=this.getBuildOptions(e).validation,o="object"==typeof s?s:void 0,a=await i.validateDocument(e,o,t);e.diagnostics?e.diagnostics.push(...a):e.diagnostics=a;const c=this.buildState.get(e.uri.toString());if(c){null!==(n=c.result)&&void 0!==n||(c.result={});const e=null!==(r=null==o?void 0:o.categories)&&void 0!==r?r:Ol.all;c.result.validationChecks?c.result.validationChecks.push(...e):c.result.validationChecks=[...e]}}getBuildOptions(e){var t,n;return null!==(n=null===(t=this.buildState.get(e.uri.toString()))||void 0===t?void 0:t.options)&&void 0!==n?n:{}}}class Vl{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new Il,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,t){const n=Pe(e).uri,r=[];return this.referenceIndex.forEach((e=>{e.forEach((e=>{dl.equals(e.targetUri,n)&&e.targetPath===t&&r.push(e)}))})),m(r)}allElements(e,t){let n=m(this.symbolIndex.keys());return t&&(n=n.filter((e=>!t||t.has(e)))),n.map((t=>this.getFileDescriptions(t,e))).flat()}getFileDescriptions(e,t){var n;if(!t)return null!==(n=this.symbolIndex.get(e))&&void 0!==n?n:[];const r=this.symbolByTypeIndex.get(e,t,(()=>{var n;return(null!==(n=this.symbolIndex.get(e))&&void 0!==n?n:[]).filter((e=>this.astReflection.isSubtype(e.type,t)))}));return r}remove(e){const t=e.toString();this.symbolIndex.delete(t),this.symbolByTypeIndex.clear(t),this.referenceIndex.delete(t)}async updateContent(e,t=Yc.XO.None){const n=this.serviceRegistry.getServices(e.uri),r=await n.references.ScopeComputation.computeExports(e,t),i=e.uri.toString();this.symbolIndex.set(i,r),this.symbolByTypeIndex.clear(i)}async updateReferences(e,t=Yc.XO.None){const n=this.serviceRegistry.getServices(e.uri),r=await n.workspace.ReferenceDescriptionProvider.createDescriptions(e,t);this.referenceIndex.set(e.uri.toString(),r)}isAffected(e,t){const n=this.referenceIndex.get(e.uri.toString());return!!n&&n.some((e=>!e.local&&t.has(e.targetUri.toString())))}}class Hl{constructor(e){this.initialBuildOptions={},this._ready=new el,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}initialize(e){var t;this.folders=null!==(t=e.workspaceFolders)&&void 0!==t?t:void 0}initialized(e){return this.mutex.write((e=>{var t;return this.initializeWorkspace(null!==(t=this.folders)&&void 0!==t?t:[],e)}))}async initializeWorkspace(e,t=Yc.XO.None){const n=await this.performStartup(e);await Zc(t),await this.documentBuilder.build(n,this.initialBuildOptions,t)}async performStartup(e){const t=this.serviceRegistry.all.flatMap((e=>e.LanguageMetaData.fileExtensions)),n=[],r=e=>{n.push(e),this.langiumDocuments.hasDocument(e.uri)||this.langiumDocuments.addDocument(e)};return await this.loadAdditionalDocuments(e,r),await Promise.all(e.map((e=>[e,this.getRootFolder(e)])).map((async e=>this.traverseFolder(...e,t,r)))),this._ready.resolve(),n}loadAdditionalDocuments(e,t){return Promise.resolve()}getRootFolder(e){return ll.parse(e.uri)}async traverseFolder(e,t,n,r){const i=await this.fileSystemProvider.readDirectory(t);await Promise.all(i.map((async t=>{if(this.includeEntry(e,t,n))if(t.isDirectory)await this.traverseFolder(e,t.uri,n,r);else if(t.isFile){const e=await this.langiumDocuments.getOrCreateDocument(t.uri);r(e)}})))}includeEntry(e,t,n){const r=dl.basename(t.uri);if(r.startsWith("."))return!1;if(t.isDirectory)return"node_modules"!==r&&"out"!==r;if(t.isFile){const e=dl.extname(t.uri);return n.includes(e)}return!1}}class Wl{constructor(e){const t=e.parser.TokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(t);const n=Yl(t)?Object.values(t):t;this.chevrotainLexer=new ii(n,{positionTracking:"full"})}get definition(){return this.tokenTypes}tokenize(e){var t;const n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:null!==(t=n.groups.hidden)&&void 0!==t?t:[]}}toTokenTypeDictionary(e){if(Yl(e))return e;const t=zl(e)?Object.values(e.modes).flat():e,n={};return t.forEach((e=>n[e.name]=e)),n}}function zl(e){return e&&"modes"in e&&"defaultMode"in e}function Yl(e){return!function(e){return Array.isArray(e)&&(0===e.length||"name"in e[0])}(e)&&!zl(e)}function Xl(e,t,n){let r,i;"string"==typeof e?(i=t,r=n):(i=e.range.start,r=t),i||(i=Qo.create(0,0));const s=function(e){var t,n,r;const i=[];let s=e.position.line,o=e.position.character;for(let a=0;a=u.length){if(i.length>0){const e=Qo.create(s,o);i.push({type:"break",content:"",range:Jo.create(e,e)})}}else{Ql.lastIndex=d;const e=Ql.exec(u);if(e){const t=e[0],n=e[1],r=Qo.create(s,o+d),a=Qo.create(s,o+d+t.length);i.push({type:"tag",content:n,range:Jo.create(r,a)}),d+=t.length,d=nu(u,d)}if(d0&&"break"===i[i.length-1].type)return i.slice(0,-1);return i}({lines:ql(e),position:i,options:lu(r)});return function(e){var t,n,r,i;const s=Qo.create(e.position.line,e.position.character);if(0===e.tokens.length)return new du([],Jo.create(s,s));const o=[];for(;e.index0&&i.push({type:"text",content:t.substring(s,e),range:Jo.create(Qo.create(n,s+r),Qo.create(n,e+r))});let c=o.length+1;const l=a[1];if(i.push({type:"inline-tag",content:l,range:Jo.create(Qo.create(n,s+c+r),Qo.create(n,s+c+l.length+r))}),c+=l.length,4===a.length){c+=a[2].length;const e=a[3];i.push({type:"text",content:e,range:Jo.create(Qo.create(n,s+c+r),Qo.create(n,s+c+e.length+r))})}else i.push({type:"text",content:"",range:Jo.create(Qo.create(n,s+c+r),Qo.create(n,s+c+r))});s=e+a[0].length}const o=t.substring(s);o.length>0&&i.push({type:"text",content:o,range:Jo.create(Qo.create(n,s+r),Qo.create(n,s+r+o.length))})}return i}const eu=/\S/,tu=/\s*$/;function nu(e,t){const n=e.substring(t).match(eu);return n?t+n.index:e.length}function ru(e){const t=e.match(tu);if(t&&"number"==typeof t.index)return t.index}function iu(e,t){const n=e.tokens[e.index];return"tag"===n.type?au(e,!1):"text"===n.type||"inline-tag"===n.type?su(e):(function(e,t){if(t){const n=new pu("",e.range);"inlines"in t?t.inlines.push(n):t.content.inlines.push(n)}}(n,t),void e.index++)}function su(e){let t=e.tokens[e.index];const n=t;let r=t;const i=[];for(;t&&"break"!==t.type&&"tag"!==t.type;)i.push(ou(e)),r=t,t=e.tokens[e.index];return new fu(i,Jo.create(n.range.start,r.range.end))}function ou(e){return"inline-tag"===e.tokens[e.index].type?au(e,!0):cu(e)}function au(e,t){const n=e.tokens[e.index++],r=n.content.substring(1),i=e.tokens[e.index];if("text"===(null==i?void 0:i.type)){if(t){const i=cu(e);return new hu(r,new fu([i],i.range),t,Jo.create(n.range.start,i.range.end))}{const i=su(e);return new hu(r,i,t,Jo.create(n.range.start,i.range.end))}}{const e=n.range;return new hu(r,new fu([],e),t,e)}}function cu(e){const t=e.tokens[e.index++];return new pu(t.content,t.range)}function lu(e){if(!e)return lu({start:"/**",end:"*/",line:"*"});const{start:t,end:n,line:r}=e;return{start:uu(t,!0),end:uu(n,!1),line:uu(r,!0)}}function uu(e,t){if("string"==typeof e||"object"==typeof e){const n="string"==typeof e?at(e):e.source;return t?new RegExp(`^\\s*${n}`):new RegExp(`\\s*${n}\\s*$`)}return e}class du{constructor(e,t){this.elements=e,this.range=t}getTag(e){return this.getAllTags().find((t=>t.name===e))}getTags(e){return this.getAllTags().filter((t=>t.name===e))}getAllTags(){return this.elements.filter((e=>"name"in e))}toString(){let e="";for(const t of this.elements)if(0===e.length)e=t.toString();else{const n=t.toString();e+=mu(e)+n}return e.trim()}toMarkdown(e){let t="";for(const n of this.elements)if(0===t.length)t=n.toMarkdown(e);else{const r=n.toMarkdown(e);t+=mu(t)+r}return t.trim()}}class hu{constructor(e,t,n,r){this.name=e,this.content=t,this.inline=n,this.range=r}toString(){let e=`@${this.name}`;const t=this.content.toString();return 1===this.content.inlines.length?e=`${e} ${t}`:this.content.inlines.length>1&&(e=`${e}\n${t}`),this.inline?`{${e}}`:e}toMarkdown(e){var t,n;return null!==(n=null===(t=null==e?void 0:e.renderTag)||void 0===t?void 0:t.call(e,this))&&void 0!==n?n:this.toMarkdownDefault(e)}toMarkdownDefault(e){const t=this.content.toMarkdown(e);if(this.inline){const n=function(e,t,n){var r,i;if("linkplain"===e||"linkcode"===e||"link"===e){const s=t.indexOf(" ");let o=t;if(s>0){const e=nu(t,s);o=t.substring(e),t=t.substring(0,s)}("linkcode"===e||"link"===e&&"code"===n.link)&&(o=`\`${o}\``);const a=null!==(i=null===(r=n.renderLink)||void 0===r?void 0:r.call(n,t,o))&&void 0!==i?i:function(e,t){try{return ll.parse(e,!0),`[${t}](${e})`}catch(r){return e}}(t,o);return a}return}(this.name,t,null!=e?e:{});if("string"==typeof n)return n}let n="";"italic"===(null==e?void 0:e.tag)||void 0===(null==e?void 0:e.tag)?n="*":"bold"===(null==e?void 0:e.tag)?n="**":"bold-italic"===(null==e?void 0:e.tag)&&(n="***");let r=`${n}@${this.name}${n}`;return 1===this.content.inlines.length?r=`${r} \u2014 ${t}`:this.content.inlines.length>1&&(r=`${r}\n${t}`),this.inline?`{${r}}`:r}}class fu{constructor(e,t){this.inlines=e,this.range=t}toString(){let e="";for(let t=0;tn.range.start.line&&(e+="\n")}return e}toMarkdown(e){let t="";for(let n=0;nr.range.start.line&&(t+="\n")}return t}}class pu{constructor(e,t){this.text=e,this.range=t}toString(){return this.text}toMarkdown(){return this.text}}function mu(e){return e.endsWith("\n")?"\n":"\n\n"}class gu{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const t=this.commentProvider.getComment(e);if(t&&function(e,t){const n=lu(t),r=ql(e);if(0===r.length)return!1;const i=r[0],s=r[r.length-1],o=n.start,a=n.end;return Boolean(null==o?void 0:o.exec(i))&&Boolean(null==a?void 0:a.exec(s))}(t)){return Xl(t).toMarkdown({renderLink:(t,n)=>this.documentationLinkRenderer(e,t,n),renderTag:t=>this.documentationTagRenderer(e,t)})}}documentationLinkRenderer(e,t,n){var r;const i=null!==(r=this.findNameInPrecomputedScopes(e,t))&&void 0!==r?r:this.findNameInGlobalScope(e,t);if(i&&i.nameSegment){const e=i.nameSegment.range.start.line+1,t=i.nameSegment.range.start.character+1;return`[${n}](${i.documentUri.with({fragment:`L${e},${t}`}).toString()})`}}documentationTagRenderer(e,t){}findNameInPrecomputedScopes(e,t){const n=Pe(e).precomputedScopes;if(!n)return;let r=e;do{const e=n.get(r).find((e=>e.name===t));if(e)return e;r=r.$container}while(r)}findNameInGlobalScope(e,t){return this.indexManager.allElements().find((e=>e.name===t))}}class yu{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var t;return function(e){return"string"==typeof e.$comment}(e)?e.$comment:null===(t=x(e.$cstNode,this.grammarConfig().multilineCommentRules))||void 0===t?void 0:t.text}}var Au;n(436);class Tu{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e){return Promise.resolve(this.syncParser.parse(e))}}class vu{constructor(){this.previousTokenSource=new Yc.Qi,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const t=new Yc.Qi;return this.previousTokenSource=t,this.enqueue(this.writeQueue,e,t.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,t,n){const r=new el,i={action:t,deferred:r,cancellationToken:null!=n?n:Yc.XO.None};return e.push(i),this.performNextOperation(),r.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else{if(!(this.readQueue.length>0))return;e.push(...this.readQueue.splice(0,this.readQueue.length))}this.done=!1,await Promise.all(e.map((async({action:e,deferred:t,cancellationToken:n})=>{try{const r=await Promise.resolve().then((()=>e(n)));t.resolve(r)}catch(r){Jc(r)?t.resolve(void 0):t.reject(r)}}))),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class Ru{constructor(e){this.grammarElementIdMap=new Tl,this.tokenTypeIdMap=new Tl,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors.map((e=>Object.assign({},e))),parserErrors:e.parserErrors.map((e=>Object.assign({},e))),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}createDehyrationContext(e){const t=new Map,n=new Map;for(const r of Ue(e))t.set(r,{});if(e.$cstNode)for(const r of T(e.$cstNode))n.set(r,{});return{astNodes:t,cstNodes:n}}dehydrateAstNode(e,t){const n=t.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,void 0!==e.$cstNode&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,t));for(const[s,o]of Object.entries(e))if(!s.startsWith("$"))if(Array.isArray(o)){const e=[];n[s]=e;for(const n of o)r(n)?e.push(this.dehydrateAstNode(n,t)):i(n)?e.push(this.dehydrateReference(n,t)):e.push(n)}else r(o)?n[s]=this.dehydrateAstNode(o,t):i(o)?n[s]=this.dehydrateReference(o,t):void 0!==o&&(n[s]=o);return n}dehydrateReference(e,t){const n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=t.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,t){const n=t.cstNodes.get(e);return l(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=t.astNodes.get(e.astNode),a(e)?n.content=e.content.map((e=>this.dehydrateCstNode(e,t))):c(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){const t=e.value,n=this.createHydrationContext(t);return"$cstNode"in t&&this.hydrateCstNode(t.$cstNode,n),{lexerErrors:e.lexerErrors,parserErrors:e.parserErrors,value:this.hydrateAstNode(t,n)}}createHydrationContext(e){const t=new Map,n=new Map;for(const i of Ue(e))t.set(i,{});let r;if(e.$cstNode)for(const i of T(e.$cstNode)){let e;"fullText"in i?(e=new Ic(i.fullText),r=e):"content"in i?e=new kc:"tokenType"in i&&(e=this.hydrateCstLeafNode(i)),e&&(n.set(i,e),e.root=r)}return{astNodes:t,cstNodes:n}}hydrateAstNode(e,t){const n=t.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=t.cstNodes.get(e.$cstNode));for(const[s,o]of Object.entries(e))if(!s.startsWith("$"))if(Array.isArray(o)){const e=[];n[s]=e;for(const a of o)r(a)?e.push(this.setParent(this.hydrateAstNode(a,t),n)):i(a)?e.push(this.hydrateReference(a,n,s,t)):e.push(a)}else r(o)?n[s]=this.setParent(this.hydrateAstNode(o,t),n):i(o)?n[s]=this.hydrateReference(o,n,s,t):void 0!==o&&(n[s]=o);return n}setParent(e,t){return e.$container=t,e}hydrateReference(e,t,n,r){return this.linker.buildReference(t,n,r.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,t,n=0){const r=t.cstNodes.get(e);if("number"==typeof e.grammarSource&&(r.grammarSource=this.getGrammarElement(e.grammarSource)),r.astNode=t.astNodes.get(e.astNode),a(r))for(const i of e.content){const e=this.hydrateCstNode(i,t,n++);r.content.push(e)}return r}hydrateCstLeafNode(e){const t=this.getTokenType(e.tokenType),n=e.offset,r=e.length,i=e.startLine,s=e.startColumn,o=e.endLine,a=e.endColumn,c=e.hidden;return new Ec(n,r,{start:{line:i,character:s},end:{line:o,character:a}},t,c)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){return 0===this.grammarElementIdMap.size&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){0===this.grammarElementIdMap.size&&this.createGrammarElementIdMap();const t=this.grammarElementIdMap.getKey(e);if(t)return t;throw new Error("Invalid grammar element id: "+e)}createGrammarElementIdMap(){let e=0;for(const n of Ue(this.grammar))t=n,Oe.isInstance(t,b)&&this.grammarElementIdMap.set(n,e++);var t}}function Eu(e){return{documentation:{CommentProvider:e=>new yu(e),DocumentationProvider:e=>new gu(e)},parser:{AsyncParser:e=>new Tu(e),GrammarConfig:e=>function(e){const t=[],n=e.Grammar;for(const i of n.rules)te(i)&&(r=i).hidden&&!vt(r).test(" ")&&st(vt(i))&&t.push(i.name);var r;return{multilineCommentRules:t,nameRegexp:k}}(e),LangiumParser:e=>Vc(e),CompletionParser:e=>function(e){const t=e.Grammar,n=e.parser.Lexer,r=new bc(e);return Mc(t,r,n.definition),r.finalize(),r}(e),ValueConverter:()=>new Wc,TokenBuilder:()=>new Hc,Lexer:e=>new Wl(e),ParserErrorMessageProvider:()=>new Oc},workspace:{AstNodeLocator:()=>new Kl,AstNodeDescriptionProvider:e=>new Fl(e),ReferenceDescriptionProvider:e=>new Gl(e)},references:{Linker:e=>new ml(e),NameProvider:()=>new gl,ScopeProvider:e=>new Nl(e),ScopeComputation:e=>new vl(e),References:e=>new yl(e)},serializer:{Hydrator:e=>new Ru(e),JsonSerializer:e=>new $l(e)},validation:{DocumentValidator:e=>new Ml(e),ValidationRegistry:e=>new Pl(e)},shared:()=>e.shared}}function ku(e){return{ServiceRegistry:()=>new wl,workspace:{LangiumDocuments:e=>new pl(e),LangiumDocumentFactory:e=>new fl(e),DocumentBuilder:e=>new jl(e),IndexManager:e=>new Vl(e),WorkspaceManager:e=>new Hl(e),FileSystemProvider:t=>e.fileSystemProvider(t),WorkspaceLock:()=>new vu,ConfigurationProvider:e=>new Bl(e)}}}function xu(e,t,n,r,i,s,o,a,c){return Su([e,t,n,r,i,s,o,a,c].reduce($u,{}))}!function(e){e.merge=(e,t)=>$u($u({},e),t)}(Au||(Au={}));const Iu=Symbol("isProxy");function Su(e,t){const n=new Proxy({},{deleteProperty:()=>!1,get:(r,i)=>Cu(r,i,e,t||n),getOwnPropertyDescriptor:(r,i)=>(Cu(r,i,e,t||n),Object.getOwnPropertyDescriptor(r,i)),has:(t,n)=>n in e,ownKeys:()=>[...Reflect.ownKeys(e),Iu]});return n[Iu]=!0,n}const Nu=Symbol();function Cu(e,t,n,r){if(t in e){if(e[t]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable.",{cause:e[t]});if(e[t]===Nu)throw new Error('Cycle detected. Please make "'+String(t)+'" lazy. See https://langium.org/docs/configuration-services/#resolving-cyclic-dependencies');return e[t]}if(t in n){const s=n[t];e[t]=Nu;try{e[t]="function"==typeof s?s(r):Su(s,r)}catch(i){throw e[t]=i instanceof Error?i:void 0,i}return e[t]}}function $u(e,t){if(t)for(const[n,r]of Object.entries(t))if(void 0!==r){const t=e[n];e[n]=null!==t&&null!==r&&"object"==typeof t&&"object"==typeof r?$u(t,r):r}return e}class wu{readFile(){throw new Error("No file system is available.")}async readDirectory(){return[]}}const Lu={fileSystemProvider:()=>new wu},Ou={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},bu={AstReflection:()=>new Le};function _u(e){var t;const n=function(){const e=xu(ku(Lu),bu),t=xu(Eu({shared:e}),Ou);return e.ServiceRegistry.register(t),t}(),r=n.serializer.JsonSerializer.deserialize(e);return n.shared.workspace.LangiumDocumentFactory.fromModel(r,ll.parse(`memory://${null!==(t=r.name)&&void 0!==t?t:"grammar"}.langium`)),r}},3884:(e,t,n)=>{n.d(t,{A:()=>i});var r=n(3027);const i=function(e,t,n){for(var i=-1,s=e.length;++i{n.d(t,{A:()=>r});const r=function(e,t){return e{n.d(t,{A:()=>s});var r=n(4753),i=n(2849);const s=function(e,t){var n=-1,s=(0,i.A)(e)?Array(e.length):[];return(0,r.A)(e,(function(e,r,i){s[++n]=t(e,r,i)})),s}},1159:(e,t,n)=>{n.d(t,{A:()=>u});var r=n(2880),i=n(3406),s=n(870),o=n(1408),a=n(9084),c=n(1528);const l=function(e,t,n,r){if(!(0,a.A)(e))return e;for(var l=-1,u=(t=(0,s.A)(t,e)).length,d=u-1,h=e;null!=h&&++l{n.d(t,{A:()=>i});var r=n(8020);const i=function(e){return(0,r.A)(e,4)}},5237:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(4713),i=n(6957),s=n(6599),o=n(6920),a=Object.prototype,c=a.hasOwnProperty;const l=(0,r.A)((function(e,t){e=Object(e);var n=-1,r=t.length,l=r>2?t[2]:void 0;for(l&&(0,s.A)(t[0],t[1],l)&&(r=1);++n{n.d(t,{A:()=>u});var r=n(6095),i=n(2849),s=n(2859);const o=function(e){return function(t,n,o){var a=Object(t);if(!(0,i.A)(t)){var c=(0,r.A)(n,3);t=(0,s.A)(t),n=function(e){return c(a[e],e,a)}}var l=e(t,n,o);return l>-1?a[c?t[l]:l]:void 0}};var a=n(6482),c=n(1066),l=Math.max;const u=o((function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var s=null==n?0:(0,c.A)(n);return s<0&&(s=l(i+s,0)),(0,a.A)(e,(0,r.A)(t,3),s)}))},129:(e,t,n)=>{n.d(t,{A:()=>i});var r=n(9759);const i=function(e){return(null==e?0:e.length)?(0,r.A)(e,1):[]}},2540:(e,t,n)=>{n.d(t,{A:()=>o});var r=Object.prototype.hasOwnProperty;const i=function(e,t){return null!=e&&r.call(e,t)};var s=n(6923);const o=function(e,t){return null!=e&&(0,s.A)(e,t,i)}},586:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(565),i=n(3145),s=n(7427);const o=function(e){return"string"==typeof e||!(0,i.A)(e)&&(0,s.A)(e)&&"[object String]"==(0,r.A)(e)}},8663:(e,t,n)=>{n.d(t,{A:()=>r});const r=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},2185:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(2663),i=n(6095),s=n(1361),o=n(3145);const a=function(e,t){return((0,o.A)(e)?r.A:s.A)(e,(0,i.A)(t,3))}},2675:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(3884),i=n(3855),s=n(6117);const o=function(e){return e&&e.length?(0,r.A)(e,s.A,i.A):void 0}},7001:(e,t,n)=>{n.d(t,{A:()=>m});var r=/\s/;const i=function(e){for(var t=e.length;t--&&r.test(e.charAt(t)););return t};var s=/^\s+/;const o=function(e){return e?e.slice(0,i(e)+1).replace(s,""):e};var a=n(9084),c=n(3027),l=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,d=/^0o[0-7]+$/i,h=parseInt;const f=function(e){if("number"==typeof e)return e;if((0,c.A)(e))return NaN;if((0,a.A)(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=(0,a.A)(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=o(e);var n=u.test(e);return n||d.test(e)?h(e.slice(2),n?2:8):l.test(e)?NaN:+e};var p=1/0;const m=function(e){return e?(e=f(e))===p||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},1066:(e,t,n)=>{n.d(t,{A:()=>i});var r=n(7001);const i=function(e){var t=(0,r.A)(e),n=t%1;return t==t?n?t-n:t:0}}}]); \ No newline at end of file diff --git a/assets/js/a142fdfa.e1f6aa35.js b/assets/js/a142fdfa.676bedd8.js similarity index 99% rename from assets/js/a142fdfa.e1f6aa35.js rename to assets/js/a142fdfa.676bedd8.js index e7586da9..d3c80c59 100644 --- a/assets/js/a142fdfa.e1f6aa35.js +++ b/assets/js/a142fdfa.676bedd8.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1534],{6415:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>o,contentTitle:()=>a,default:()=>d,frontMatter:()=>r,metadata:()=>i,toc:()=>h});const i=JSON.parse('{"id":"tutorials/login-with-wallets/starknet-wallet","title":"Starknet Wallet","description":"Logging in with Starknet","source":"@site/docs/06-tutorials/01-login-with-wallets/02-starknet-wallet.mdx","sourceDirName":"06-tutorials/01-login-with-wallets","slug":"/tutorials/login-with-wallets/starknet-wallet","permalink":"/tutorials/login-with-wallets/starknet-wallet","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/06-tutorials/01-login-with-wallets/02-starknet-wallet.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":2,"frontMatter":{"id":"starknet-wallet","title":"Starknet Wallet"},"sidebar":"tutorialSidebar","previous":{"title":"Near Wallet","permalink":"/tutorials/login-with-wallets/near-wallet"},"next":{"title":"ICP Wallet","permalink":"/tutorials/login-with-wallets/icp-wallet"}}');var s=t(6070),l=t(5248);const r={id:"starknet-wallet",title:"Starknet Wallet"},a=void 0,o={},h=[{value:"Logging in with Starknet",id:"logging-in-with-starknet",level:2},{value:"1. User Initiates Login",id:"1-user-initiates-login",level:3},{value:"2. Wallet Selection",id:"2-wallet-selection",level:3},{value:"3. Wallet Connection",id:"3-wallet-connection",level:3},{value:"For ArgentX:",id:"for-argentx",level:4},{value:"For Metamask Snap:",id:"for-metamask-snap",level:4},{value:"4. Server Issues Challenge",id:"4-server-issues-challenge",level:3},{value:"5. User Signs Challenge",id:"5-user-signs-challenge",level:3},{value:"6. Signature Sent to Backend",id:"6-signature-sent-to-backend",level:3},{value:"7. Signature Verification",id:"7-signature-verification",level:3},{value:"For ArgentX Wallets:",id:"for-argentx-wallets",level:4},{value:"For Metamask Snap:",id:"for-metamask-snap-1",level:4},{value:"Final Steps:",id:"final-steps",level:4},{value:"8. Successful Login",id:"8-successful-login",level:3}];function c(e){const n={code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,l.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h2,{id:"logging-in-with-starknet",children:"Logging in with Starknet"}),"\n",(0,s.jsx)(n.p,{children:"Calimero allows users to authenticate via their Starknet wallet, ensuring secure\naccess to the Admin Dashboard. The process of logging in with a Starknet wallet\ninvolves the following steps:"}),"\n",(0,s.jsx)(n.h3,{id:"1-user-initiates-login",children:"1. User Initiates Login"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:'The user navigates to the Admin Dashboard and selects the option to "Login\nwith Starknet."'}),"\n",(0,s.jsx)(n.li,{children:"They are presented with two wallet options: ArgentX and Metamask Snap."}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"2-wallet-selection",children:"2. Wallet Selection"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"The user chooses their preferred wallet: ArgentX or Metamask Snap."}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"3-wallet-connection",children:"3. Wallet Connection"}),"\n",(0,s.jsx)(n.h4,{id:"for-argentx",children:"For ArgentX:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"If ArgentX is installed, the user is prompted to connect their wallet."}),"\n",(0,s.jsx)(n.li,{children:"If not installed, the user is directed to install the ArgentX browser\nextension."}),"\n"]}),"\n",(0,s.jsx)(n.h4,{id:"for-metamask-snap",children:"For Metamask Snap:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"If Metamask with Starknet Snap is installed, the user is prompted to connect."}),"\n",(0,s.jsx)(n.li,{children:"If not installed, the user is guided to install Metamask and the Starknet\nSnap."}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"4-server-issues-challenge",children:"4. Server Issues Challenge"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Upon selecting the wallet, the server generates a challenge. This challenge is\nthen presented to the user for signing."}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"5-user-signs-challenge",children:"5. User Signs Challenge"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"The user is prompted to sign the server-issued challenge using their selected\nStarknet wallet."}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"6-signature-sent-to-backend",children:"6. Signature Sent to Backend"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"After the user signs the challenge, the signature is sent back to the server\nfor verification."}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"7-signature-verification",children:"7. Signature Verification"}),"\n",(0,s.jsx)(n.p,{children:"The backend verifies the signature to ensure its authenticity using a process\ntailored to Starknet's cryptographic standards. This verification process\ndiffers depending on whether the user is using ArgentX or Metamask Snap."}),"\n",(0,s.jsx)(n.h4,{id:"for-argentx-wallets",children:"For ArgentX Wallets:"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"On-Chain Verification"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"The signature is initially verified on-chain using the Starknet network."}),"\n",(0,s.jsxs)(n.li,{children:["A JSON-RPC call is made to the Starknet node, invoking the\n",(0,s.jsx)(n.code,{children:"isValidSignature"})," function on the user's wallet contract."]}),"\n",(0,s.jsx)(n.li,{children:"This on-chain verification ensures the signature's validity according to\nthe wallet's implementation."}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Message Hash Verification"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"If the on-chain verification succeeds, an additional verification of the\nmessage hash is performed off-chain."}),"\n",(0,s.jsx)(n.li,{children:"This step ensures the integrity of the signed message and prevents any\ntampering."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h4,{id:"for-metamask-snap-1",children:"For Metamask Snap:"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Off-Chain Verification"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"The signature is verified off-chain using Starknet's cryptographic\nlibraries."}),"\n",(0,s.jsxs)(n.li,{children:["This involves using the ",(0,s.jsx)(n.code,{children:"verify"})," function from the ",(0,s.jsx)(n.code,{children:"starknet_crypto"}),"\nlibrary to check the signature against the provided public key."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Message Hash Verification"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"If the signature is valid, an additional verification of the message hash\nis performed."}),"\n",(0,s.jsx)(n.li,{children:"This ensures the integrity of the signed message, similar to the ArgentX\nprocess."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h4,{id:"final-steps",children:"Final Steps:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"If the signature and hash are valid, the user's Starknet address is extracted\nfrom the wallet address used in the verification process."}),"\n",(0,s.jsx)(n.li,{children:"This address serves as the user's Decentralized Identifier (DID), enabling\ndecentralized authentication across different contexts and applications."}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"8-successful-login",children:"8. Successful Login"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Once verified, the user is successfully logged into the Admin Dashboard, with\ntheir Starknet address (DID) serving as their user ID for future interactions."}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"This login flow ensures a secure and seamless authentication process leveraging\nStarknet's robust blockchain-based security."})]})}function d(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},5248:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>a});var i=t(758);const s={},l=i.createContext(s);function r(e){const n=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1534],{6415:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>o,contentTitle:()=>a,default:()=>d,frontMatter:()=>r,metadata:()=>i,toc:()=>h});const i=JSON.parse('{"id":"tutorials/login-with-wallets/starknet-wallet","title":"Starknet Wallet","description":"Logging in with Starknet","source":"@site/docs/06-tutorials/01-login-with-wallets/02-starknet-wallet.mdx","sourceDirName":"06-tutorials/01-login-with-wallets","slug":"/tutorials/login-with-wallets/starknet-wallet","permalink":"/tutorials/login-with-wallets/starknet-wallet","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/06-tutorials/01-login-with-wallets/02-starknet-wallet.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":2,"frontMatter":{"id":"starknet-wallet","title":"Starknet Wallet"},"sidebar":"tutorialSidebar","previous":{"title":"Near Wallet","permalink":"/tutorials/login-with-wallets/near-wallet"},"next":{"title":"ICP Wallet","permalink":"/tutorials/login-with-wallets/icp-wallet"}}');var s=t(6070),l=t(5248);const r={id:"starknet-wallet",title:"Starknet Wallet"},a=void 0,o={},h=[{value:"Logging in with Starknet",id:"logging-in-with-starknet",level:2},{value:"1. User Initiates Login",id:"1-user-initiates-login",level:3},{value:"2. Wallet Selection",id:"2-wallet-selection",level:3},{value:"3. Wallet Connection",id:"3-wallet-connection",level:3},{value:"For ArgentX:",id:"for-argentx",level:4},{value:"For Metamask Snap:",id:"for-metamask-snap",level:4},{value:"4. Server Issues Challenge",id:"4-server-issues-challenge",level:3},{value:"5. User Signs Challenge",id:"5-user-signs-challenge",level:3},{value:"6. Signature Sent to Backend",id:"6-signature-sent-to-backend",level:3},{value:"7. Signature Verification",id:"7-signature-verification",level:3},{value:"For ArgentX Wallets:",id:"for-argentx-wallets",level:4},{value:"For Metamask Snap:",id:"for-metamask-snap-1",level:4},{value:"Final Steps:",id:"final-steps",level:4},{value:"8. Successful Login",id:"8-successful-login",level:3}];function c(e){const n={code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,l.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h2,{id:"logging-in-with-starknet",children:"Logging in with Starknet"}),"\n",(0,s.jsx)(n.p,{children:"Calimero allows users to authenticate via their Starknet wallet, ensuring secure\naccess to the Admin Dashboard. The process of logging in with a Starknet wallet\ninvolves the following steps:"}),"\n",(0,s.jsx)(n.h3,{id:"1-user-initiates-login",children:"1. User Initiates Login"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:'The user navigates to the Admin Dashboard and selects the option to "Login\nwith Starknet."'}),"\n",(0,s.jsx)(n.li,{children:"They are presented with two wallet options: ArgentX and Metamask Snap."}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"2-wallet-selection",children:"2. Wallet Selection"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"The user chooses their preferred wallet: ArgentX or Metamask Snap."}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"3-wallet-connection",children:"3. Wallet Connection"}),"\n",(0,s.jsx)(n.h4,{id:"for-argentx",children:"For ArgentX:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"If ArgentX is installed, the user is prompted to connect their wallet."}),"\n",(0,s.jsx)(n.li,{children:"If not installed, the user is directed to install the ArgentX browser\nextension."}),"\n"]}),"\n",(0,s.jsx)(n.h4,{id:"for-metamask-snap",children:"For Metamask Snap:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"If Metamask with Starknet Snap is installed, the user is prompted to connect."}),"\n",(0,s.jsx)(n.li,{children:"If not installed, the user is guided to install Metamask and the Starknet\nSnap."}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"4-server-issues-challenge",children:"4. Server Issues Challenge"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Upon selecting the wallet, the server generates a challenge. This challenge is\nthen presented to the user for signing."}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"5-user-signs-challenge",children:"5. User Signs Challenge"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"The user is prompted to sign the server-issued challenge using their selected\nStarknet wallet."}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"6-signature-sent-to-backend",children:"6. Signature Sent to Backend"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"After the user signs the challenge, the signature is sent back to the server\nfor verification."}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"7-signature-verification",children:"7. Signature Verification"}),"\n",(0,s.jsx)(n.p,{children:"The backend verifies the signature to ensure its authenticity using a process\ntailored to Starknet's cryptographic standards. This verification process\ndiffers depending on whether the user is using ArgentX or Metamask Snap."}),"\n",(0,s.jsx)(n.h4,{id:"for-argentx-wallets",children:"For ArgentX Wallets:"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"On-Chain Verification"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"The signature is initially verified on-chain using the Starknet network."}),"\n",(0,s.jsxs)(n.li,{children:["A JSON-RPC call is made to the Starknet node, invoking the\n",(0,s.jsx)(n.code,{children:"isValidSignature"})," function on the user's wallet contract."]}),"\n",(0,s.jsx)(n.li,{children:"This on-chain verification ensures the signature's validity according to\nthe wallet's implementation."}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Message Hash Verification"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"If the on-chain verification succeeds, an additional verification of the\nmessage hash is performed off-chain."}),"\n",(0,s.jsx)(n.li,{children:"This step ensures the integrity of the signed message and prevents any\ntampering."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h4,{id:"for-metamask-snap-1",children:"For Metamask Snap:"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Off-Chain Verification"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"The signature is verified off-chain using Starknet's cryptographic\nlibraries."}),"\n",(0,s.jsxs)(n.li,{children:["This involves using the ",(0,s.jsx)(n.code,{children:"verify"})," function from the ",(0,s.jsx)(n.code,{children:"starknet_crypto"}),"\nlibrary to check the signature against the provided public key."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Message Hash Verification"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"If the signature is valid, an additional verification of the message hash\nis performed."}),"\n",(0,s.jsx)(n.li,{children:"This ensures the integrity of the signed message, similar to the ArgentX\nprocess."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h4,{id:"final-steps",children:"Final Steps:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"If the signature and hash are valid, the user's Starknet address is extracted\nfrom the wallet address used in the verification process."}),"\n",(0,s.jsx)(n.li,{children:"This address serves as the user's Decentralized Identifier (DID), enabling\ndecentralized authentication across different contexts and applications."}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"8-successful-login",children:"8. Successful Login"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Once verified, the user is successfully logged into the Admin Dashboard, with\ntheir Starknet address (DID) serving as their user ID for future interactions."}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"This login flow ensures a secure and seamless authentication process leveraging\nStarknet's robust blockchain-based security."})]})}function d(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},5248:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>a});var i=t(758);const s={},l=i.createContext(s);function r(e){const n=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/a1cbb7cd.f5fb8266.js b/assets/js/a1cbb7cd.82717490.js similarity index 98% rename from assets/js/a1cbb7cd.f5fb8266.js rename to assets/js/a1cbb7cd.82717490.js index aaa3c362..b4b54c1b 100644 --- a/assets/js/a1cbb7cd.f5fb8266.js +++ b/assets/js/a1cbb7cd.82717490.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8718],{2253:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>a,default:()=>l,frontMatter:()=>i,metadata:()=>o,toc:()=>d});const o=JSON.parse('{"id":"support/community-and-support","title":"Community and Support","description":"We value our community and are here to support you. Here are the best ways to","source":"@site/docs/10-support/01-community-and-support.mdx","sourceDirName":"10-support","slug":"/support/community-and-support","permalink":"/support/community-and-support","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/10-support/01-community-and-support.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":1,"frontMatter":{"id":"community-and-support","title":"Community and Support"},"sidebar":"tutorialSidebar","previous":{"title":"Bounty Program","permalink":"/contributing/bounty-program"},"next":{"title":"Learning","permalink":"/support/learning"}}');var r=n(6070),s=n(5248);const i={id:"community-and-support",title:"Community and Support"},a="Community and Support",u={},d=[{value:"GitHub",id:"github",level:2},{value:"Discord",id:"discord",level:2},{value:"Social Media",id:"social-media",level:2}];function c(e){const t={a:"a",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.header,{children:(0,r.jsx)(t.h1,{id:"community-and-support",children:"Community and Support"})}),"\n",(0,r.jsx)(t.p,{children:"We value our community and are here to support you. Here are the best ways to\nget in touch and find help:"}),"\n",(0,r.jsx)(t.h2,{id:"github",children:"GitHub"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Issues:"})," For development-related queries, bug reports, and feature\nrequests, please use our\n",(0,r.jsx)(t.a,{href:"https://github.com/calimero-network/core/issues",children:"GitHub Issues"}),"."]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Discussions:"})," For more extensive discussions on various topics, join our\n",(0,r.jsx)(t.a,{href:"https://github.com/orgs/calimero-network/discussions",children:"GitHub Discussions"}),"."]}),"\n"]}),"\n",(0,r.jsx)(t.h2,{id:"discord",children:"Discord"}),"\n",(0,r.jsxs)(t.p,{children:["For news, casual conversations, and random questions, join our\n",(0,r.jsx)(t.a,{href:"https://discord.gg/jxAeJd2E",children:"Discord Server"}),". It\u2019s a great place to connect\nwith other contributors, share ideas, and stay informed about the latest\nupdates."]}),"\n",(0,r.jsx)(t.h2,{id:"social-media",children:"Social Media"}),"\n",(0,r.jsx)(t.p,{children:"Stay connected and get the latest news and updates by following us on social\nmedia:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"LinkedIn:"})," Follow us on\n",(0,r.jsx)(t.a,{href:"https://www.linkedin.com/company/calimero-network/",children:"LinkedIn"})," for\nprofessional updates and networking opportunities."]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Twitter:"})," Stay up-to-date with our latest tweets by following us on\n",(0,r.jsx)(t.a,{href:"https://twitter.com/CalimeroNetwork",children:"Twitter"}),"."]}),"\n"]}),"\n",(0,r.jsx)(t.p,{children:"Thank you for being a part of the Calimero community. Your contributions and\nengagement help us grow and improve!"})]})}function l(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},5248:(e,t,n)=>{n.d(t,{R:()=>i,x:()=>a});var o=n(758);const r={},s=o.createContext(r);function i(e){const t=o.useContext(s);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),o.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8718],{2253:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>a,default:()=>l,frontMatter:()=>i,metadata:()=>o,toc:()=>d});const o=JSON.parse('{"id":"support/community-and-support","title":"Community and Support","description":"We value our community and are here to support you. Here are the best ways to","source":"@site/docs/10-support/01-community-and-support.mdx","sourceDirName":"10-support","slug":"/support/community-and-support","permalink":"/support/community-and-support","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/10-support/01-community-and-support.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":1,"frontMatter":{"id":"community-and-support","title":"Community and Support"},"sidebar":"tutorialSidebar","previous":{"title":"Bounty Program","permalink":"/contributing/bounty-program"},"next":{"title":"Learning","permalink":"/support/learning"}}');var r=n(6070),s=n(5248);const i={id:"community-and-support",title:"Community and Support"},a="Community and Support",u={},d=[{value:"GitHub",id:"github",level:2},{value:"Discord",id:"discord",level:2},{value:"Social Media",id:"social-media",level:2}];function c(e){const t={a:"a",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.header,{children:(0,r.jsx)(t.h1,{id:"community-and-support",children:"Community and Support"})}),"\n",(0,r.jsx)(t.p,{children:"We value our community and are here to support you. Here are the best ways to\nget in touch and find help:"}),"\n",(0,r.jsx)(t.h2,{id:"github",children:"GitHub"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Issues:"})," For development-related queries, bug reports, and feature\nrequests, please use our\n",(0,r.jsx)(t.a,{href:"https://github.com/calimero-network/core/issues",children:"GitHub Issues"}),"."]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Discussions:"})," For more extensive discussions on various topics, join our\n",(0,r.jsx)(t.a,{href:"https://github.com/orgs/calimero-network/discussions",children:"GitHub Discussions"}),"."]}),"\n"]}),"\n",(0,r.jsx)(t.h2,{id:"discord",children:"Discord"}),"\n",(0,r.jsxs)(t.p,{children:["For news, casual conversations, and random questions, join our\n",(0,r.jsx)(t.a,{href:"https://discord.gg/jxAeJd2E",children:"Discord Server"}),". It\u2019s a great place to connect\nwith other contributors, share ideas, and stay informed about the latest\nupdates."]}),"\n",(0,r.jsx)(t.h2,{id:"social-media",children:"Social Media"}),"\n",(0,r.jsx)(t.p,{children:"Stay connected and get the latest news and updates by following us on social\nmedia:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"LinkedIn:"})," Follow us on\n",(0,r.jsx)(t.a,{href:"https://www.linkedin.com/company/calimero-network/",children:"LinkedIn"})," for\nprofessional updates and networking opportunities."]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Twitter:"})," Stay up-to-date with our latest tweets by following us on\n",(0,r.jsx)(t.a,{href:"https://twitter.com/CalimeroNetwork",children:"Twitter"}),"."]}),"\n"]}),"\n",(0,r.jsx)(t.p,{children:"Thank you for being a part of the Calimero community. Your contributions and\nengagement help us grow and improve!"})]})}function l(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},5248:(e,t,n)=>{n.d(t,{R:()=>i,x:()=>a});var o=n(758);const r={},s=o.createContext(r);function i(e){const t=o.useContext(s);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),o.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/a34c5ef3.e66c8d23.js b/assets/js/a34c5ef3.ba766d8d.js similarity index 98% rename from assets/js/a34c5ef3.e66c8d23.js rename to assets/js/a34c5ef3.ba766d8d.js index 88cc9212..95044365 100644 --- a/assets/js/a34c5ef3.e66c8d23.js +++ b/assets/js/a34c5ef3.ba766d8d.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6347],{1043:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>u,frontMatter:()=>a,metadata:()=>i,toc:()=>d});const i=JSON.parse('{"id":"introduction/key-features","title":"Key Features","description":"No Central Authority","source":"@site/docs/01-introduction/03-key-features.mdx","sourceDirName":"01-introduction","slug":"/introduction/key-features","permalink":"/introduction/key-features","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/01-introduction/03-key-features.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":3,"frontMatter":{"id":"key-features","title":"Key Features"},"sidebar":"tutorialSidebar","previous":{"title":"Use Cases","permalink":"/introduction/use-cases"},"next":{"title":"Setup","permalink":"/getting-started/setup"}}');var r=n(6070),o=n(5248);const a={id:"key-features",title:"Key Features"},l=void 0,s={},d=[{value:"No Central Authority",id:"no-central-authority",level:2},{value:"Client Side Verified",id:"client-side-verified",level:2},{value:"Strong Encryption",id:"strong-encryption",level:2},{value:"Local Data Vault",id:"local-data-vault",level:2},{value:"Developer Friendly",id:"developer-friendly",level:2},{value:"Cross Platform Support",id:"cross-platform-support",level:2},{value:"Sovereign Digital Identity",id:"sovereign-digital-identity",level:2}];function c(e){const t={h2:"h2",p:"p",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h2,{id:"no-central-authority",children:"No Central Authority"}),"\n",(0,r.jsx)(t.p,{children:"The networks deployed on Calimero are fully decentralized and managed by the\nnetwork participants. You own your data!"}),"\n",(0,r.jsx)(t.h2,{id:"client-side-verified",children:"Client Side Verified"}),"\n",(0,r.jsx)(t.p,{children:"All actions inside the Self-Sovereign Apps are verified using identity off-chain\nsignatures on the client device to ensure validity."}),"\n",(0,r.jsx)(t.h2,{id:"strong-encryption",children:"Strong Encryption"}),"\n",(0,r.jsx)(t.p,{children:"The peer interactions inside the Self-Sovereign Apps are encrypted and protected\nfrom any unauthorized third parties."}),"\n",(0,r.jsx)(t.h2,{id:"local-data-vault",children:"Local Data Vault"}),"\n",(0,r.jsx)(t.p,{children:"The data is stored on the user's device and all state transitions are applied\nlocally ensuring data ownership."}),"\n",(0,r.jsx)(t.h2,{id:"developer-friendly",children:"Developer Friendly"}),"\n",(0,r.jsx)(t.p,{children:"Build privacy preserving applications in any language without the knowledge of\ncryptography and networking."}),"\n",(0,r.jsx)(t.h2,{id:"cross-platform-support",children:"Cross Platform Support"}),"\n",(0,r.jsx)(t.p,{children:"Calimero is built using a WASM runtime allowing it to be run on different\nplatforms including servers, desktops, browsers and mobile."}),"\n",(0,r.jsx)(t.h2,{id:"sovereign-digital-identity",children:"Sovereign Digital Identity"}),"\n",(0,r.jsx)(t.p,{children:"Unique digital identity for every application, guarded by your wallet of choice\nor a on-device private key."})]})}function u(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},5248:(e,t,n)=>{n.d(t,{R:()=>a,x:()=>l});var i=n(758);const r={},o=i.createContext(r);function a(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),i.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6347],{1043:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>u,frontMatter:()=>a,metadata:()=>i,toc:()=>d});const i=JSON.parse('{"id":"introduction/key-features","title":"Key Features","description":"No Central Authority","source":"@site/docs/01-introduction/03-key-features.mdx","sourceDirName":"01-introduction","slug":"/introduction/key-features","permalink":"/introduction/key-features","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/01-introduction/03-key-features.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":3,"frontMatter":{"id":"key-features","title":"Key Features"},"sidebar":"tutorialSidebar","previous":{"title":"Use Cases","permalink":"/introduction/use-cases"},"next":{"title":"Setup","permalink":"/getting-started/setup"}}');var r=n(6070),o=n(5248);const a={id:"key-features",title:"Key Features"},l=void 0,s={},d=[{value:"No Central Authority",id:"no-central-authority",level:2},{value:"Client Side Verified",id:"client-side-verified",level:2},{value:"Strong Encryption",id:"strong-encryption",level:2},{value:"Local Data Vault",id:"local-data-vault",level:2},{value:"Developer Friendly",id:"developer-friendly",level:2},{value:"Cross Platform Support",id:"cross-platform-support",level:2},{value:"Sovereign Digital Identity",id:"sovereign-digital-identity",level:2}];function c(e){const t={h2:"h2",p:"p",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h2,{id:"no-central-authority",children:"No Central Authority"}),"\n",(0,r.jsx)(t.p,{children:"The networks deployed on Calimero are fully decentralized and managed by the\nnetwork participants. You own your data!"}),"\n",(0,r.jsx)(t.h2,{id:"client-side-verified",children:"Client Side Verified"}),"\n",(0,r.jsx)(t.p,{children:"All actions inside the Self-Sovereign Apps are verified using identity off-chain\nsignatures on the client device to ensure validity."}),"\n",(0,r.jsx)(t.h2,{id:"strong-encryption",children:"Strong Encryption"}),"\n",(0,r.jsx)(t.p,{children:"The peer interactions inside the Self-Sovereign Apps are encrypted and protected\nfrom any unauthorized third parties."}),"\n",(0,r.jsx)(t.h2,{id:"local-data-vault",children:"Local Data Vault"}),"\n",(0,r.jsx)(t.p,{children:"The data is stored on the user's device and all state transitions are applied\nlocally ensuring data ownership."}),"\n",(0,r.jsx)(t.h2,{id:"developer-friendly",children:"Developer Friendly"}),"\n",(0,r.jsx)(t.p,{children:"Build privacy preserving applications in any language without the knowledge of\ncryptography and networking."}),"\n",(0,r.jsx)(t.h2,{id:"cross-platform-support",children:"Cross Platform Support"}),"\n",(0,r.jsx)(t.p,{children:"Calimero is built using a WASM runtime allowing it to be run on different\nplatforms including servers, desktops, browsers and mobile."}),"\n",(0,r.jsx)(t.h2,{id:"sovereign-digital-identity",children:"Sovereign Digital Identity"}),"\n",(0,r.jsx)(t.p,{children:"Unique digital identity for every application, guarded by your wallet of choice\nor a on-device private key."})]})}function u(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},5248:(e,t,n)=>{n.d(t,{R:()=>a,x:()=>l});var i=n(758);const r={},o=i.createContext(r);function a(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),i.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/a759d8d5.9d41141e.js b/assets/js/a759d8d5.b17843ac.js similarity index 98% rename from assets/js/a759d8d5.9d41141e.js rename to assets/js/a759d8d5.b17843ac.js index b7a3b772..ae19bfef 100644 --- a/assets/js/a759d8d5.9d41141e.js +++ b/assets/js/a759d8d5.b17843ac.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8264],{2506:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>s,default:()=>d,frontMatter:()=>r,metadata:()=>i,toc:()=>c});const i=JSON.parse('{"id":"introduction/what-is-calimero","title":"What is Calimero","description":"What is Calimero","source":"@site/docs/01-introduction/01-what-is-calimero.mdx","sourceDirName":"01-introduction","slug":"/introduction/what-is-calimero","permalink":"/introduction/what-is-calimero","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/01-introduction/01-what-is-calimero.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":1,"frontMatter":{"id":"what-is-calimero","title":"What is Calimero"},"sidebar":"tutorialSidebar","next":{"title":"Use Cases","permalink":"/introduction/use-cases"}}');var o=t(6070),a=t(5248);const r={id:"what-is-calimero",title:"What is Calimero"},s=void 0,l={},c=[{value:"What is Calimero",id:"what-is-calimero",level:2},{value:"Calimero vs X",id:"calimero-vs-x",level:2},{value:"Calimero vs Blockchain",id:"calimero-vs-blockchain",level:3},{value:"Calimero vs IPFS",id:"calimero-vs-ipfs",level:3},{value:"Calimero vs ZK",id:"calimero-vs-zk",level:3}];function h(e){const n={h2:"h2",h3:"h3",p:"p",...(0,a.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h2,{id:"what-is-calimero",children:"What is Calimero"}),"\n",(0,o.jsx)(n.p,{children:"Calimero Network is a framework that enables building and running peer-to-peer\nSelf-Sovereign applications focusing on data ownership and harnessing the power\nof verified off-chain computing"}),"\n",(0,o.jsx)(n.h2,{id:"calimero-vs-x",children:"Calimero vs X"}),"\n",(0,o.jsx)(n.h3,{id:"calimero-vs-blockchain",children:"Calimero vs Blockchain"}),"\n",(0,o.jsx)(n.p,{children:"By virtue of blockchain principles, there's a couple of issues that arise. The\nmajor one being that everyone has to agree on the state of the canonical chain,\nand therefore there can be only one network actor at any given time. Different\nchains implement different strategies for electing this actor to alleviate the\nrisk of compromise, but the fundamental issue remains, and hence, the\nlong-standing problem of scalability."}),"\n",(0,o.jsx)(n.p,{children:"Calimero fundamentally rethinks the problem and offers an alternative approach,\nlocal-first execution with eventual consistency. This means that each actor can\nindependently drive their own local state, and the network will eventually\nreconcile to the same state. Essentially pegging the scalability threshold to\nthe number of actors in the network, and executions are practically\ninstantaneous."}),"\n",(0,o.jsx)(n.p,{children:"State reconciliation is context-aware, meaning that all activity revolves around\nan instance of an app. This means that participants of a context only have to\nsynchronize with each other, and not the entire network. This is in stark\ncontrast to blockchains, where everyone is forced to synchronize with everyone\nelse and this competition is reflected in gas fees. Calimero doesn't have gas\nfees, and the cost of execution is directly borne by the actor."}),"\n",(0,o.jsx)(n.p,{children:"Blockchains achieve integrity through transparency, which is a double-edged\nsword, essentially precluding you from using it in private environments.\nCalimero however, leverages the direct-actor relationship to encrypt all network\ntraffic between them, and therefore, the network is inherently private."}),"\n",(0,o.jsx)(n.p,{children:"Calimero is also designed to be embeddable, meaning that client apps themselves\nbecome the network actors, and the network is the app itself. This is in stark\ncontrast to blockchains, where the network is a separate entity from the client\napps."}),"\n",(0,o.jsx)(n.h3,{id:"calimero-vs-ipfs",children:"Calimero vs IPFS"}),"\n",(0,o.jsx)(n.p,{children:"IPFS is a storage solution, it's not designed for generic compute."}),"\n",(0,o.jsx)(n.p,{children:"Calimero is designed to be a general-purpose compute engine that can be used to\nbuild a wide variety of applications. Also worth noting that Calimero does offer\na way to store encrypted data, effectively making it a storage solution as well."}),"\n",(0,o.jsx)(n.h3,{id:"calimero-vs-zk",children:"Calimero vs ZK"}),"\n",(0,o.jsx)(n.p,{children:"Zero-Knowledge (ZK) solutions focus on enhancing privacy and reducing the need\nto reveal data during synchronization, but they don't eliminate the need for\nsynchronization itself."}),"\n",(0,o.jsx)(n.p,{children:"Calimero offers a fundamentally different approach with local-first execution\nand eventual consistency, minimizing synchronization overhead. Additionally, ZK\nsolutions can complement Calimero by providing enhanced privacy features within\nits framework, offering the best of both worlds without inheriting the\nsynchronization complexities of traditional ZK implementations."})]})}function d(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(h,{...e})}):h(e)}},5248:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>s});var i=t(758);const o={},a=i.createContext(o);function r(e){const n=i.useContext(a);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:r(e.components),i.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8264],{2506:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>s,default:()=>d,frontMatter:()=>r,metadata:()=>i,toc:()=>c});const i=JSON.parse('{"id":"introduction/what-is-calimero","title":"What is Calimero","description":"What is Calimero","source":"@site/docs/01-introduction/01-what-is-calimero.mdx","sourceDirName":"01-introduction","slug":"/introduction/what-is-calimero","permalink":"/introduction/what-is-calimero","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/01-introduction/01-what-is-calimero.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":1,"frontMatter":{"id":"what-is-calimero","title":"What is Calimero"},"sidebar":"tutorialSidebar","next":{"title":"Use Cases","permalink":"/introduction/use-cases"}}');var o=t(6070),a=t(5248);const r={id:"what-is-calimero",title:"What is Calimero"},s=void 0,l={},c=[{value:"What is Calimero",id:"what-is-calimero",level:2},{value:"Calimero vs X",id:"calimero-vs-x",level:2},{value:"Calimero vs Blockchain",id:"calimero-vs-blockchain",level:3},{value:"Calimero vs IPFS",id:"calimero-vs-ipfs",level:3},{value:"Calimero vs ZK",id:"calimero-vs-zk",level:3}];function h(e){const n={h2:"h2",h3:"h3",p:"p",...(0,a.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h2,{id:"what-is-calimero",children:"What is Calimero"}),"\n",(0,o.jsx)(n.p,{children:"Calimero Network is a framework that enables building and running peer-to-peer\nSelf-Sovereign applications focusing on data ownership and harnessing the power\nof verified off-chain computing"}),"\n",(0,o.jsx)(n.h2,{id:"calimero-vs-x",children:"Calimero vs X"}),"\n",(0,o.jsx)(n.h3,{id:"calimero-vs-blockchain",children:"Calimero vs Blockchain"}),"\n",(0,o.jsx)(n.p,{children:"By virtue of blockchain principles, there's a couple of issues that arise. The\nmajor one being that everyone has to agree on the state of the canonical chain,\nand therefore there can be only one network actor at any given time. Different\nchains implement different strategies for electing this actor to alleviate the\nrisk of compromise, but the fundamental issue remains, and hence, the\nlong-standing problem of scalability."}),"\n",(0,o.jsx)(n.p,{children:"Calimero fundamentally rethinks the problem and offers an alternative approach,\nlocal-first execution with eventual consistency. This means that each actor can\nindependently drive their own local state, and the network will eventually\nreconcile to the same state. Essentially pegging the scalability threshold to\nthe number of actors in the network, and executions are practically\ninstantaneous."}),"\n",(0,o.jsx)(n.p,{children:"State reconciliation is context-aware, meaning that all activity revolves around\nan instance of an app. This means that participants of a context only have to\nsynchronize with each other, and not the entire network. This is in stark\ncontrast to blockchains, where everyone is forced to synchronize with everyone\nelse and this competition is reflected in gas fees. Calimero doesn't have gas\nfees, and the cost of execution is directly borne by the actor."}),"\n",(0,o.jsx)(n.p,{children:"Blockchains achieve integrity through transparency, which is a double-edged\nsword, essentially precluding you from using it in private environments.\nCalimero however, leverages the direct-actor relationship to encrypt all network\ntraffic between them, and therefore, the network is inherently private."}),"\n",(0,o.jsx)(n.p,{children:"Calimero is also designed to be embeddable, meaning that client apps themselves\nbecome the network actors, and the network is the app itself. This is in stark\ncontrast to blockchains, where the network is a separate entity from the client\napps."}),"\n",(0,o.jsx)(n.h3,{id:"calimero-vs-ipfs",children:"Calimero vs IPFS"}),"\n",(0,o.jsx)(n.p,{children:"IPFS is a storage solution, it's not designed for generic compute."}),"\n",(0,o.jsx)(n.p,{children:"Calimero is designed to be a general-purpose compute engine that can be used to\nbuild a wide variety of applications. Also worth noting that Calimero does offer\na way to store encrypted data, effectively making it a storage solution as well."}),"\n",(0,o.jsx)(n.h3,{id:"calimero-vs-zk",children:"Calimero vs ZK"}),"\n",(0,o.jsx)(n.p,{children:"Zero-Knowledge (ZK) solutions focus on enhancing privacy and reducing the need\nto reveal data during synchronization, but they don't eliminate the need for\nsynchronization itself."}),"\n",(0,o.jsx)(n.p,{children:"Calimero offers a fundamentally different approach with local-first execution\nand eventual consistency, minimizing synchronization overhead. Additionally, ZK\nsolutions can complement Calimero by providing enhanced privacy features within\nits framework, offering the best of both worlds without inheriting the\nsynchronization complexities of traditional ZK implementations."})]})}function d(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(h,{...e})}):h(e)}},5248:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>s});var i=t(758);const o={},a=i.createContext(o);function r(e){const n=i.useContext(a);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:r(e.components),i.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/ab4abc8a.54fb0f39.js b/assets/js/ab4abc8a.07ab6367.js similarity index 99% rename from assets/js/ab4abc8a.54fb0f39.js rename to assets/js/ab4abc8a.07ab6367.js index b50de966..959c62db 100644 --- a/assets/js/ab4abc8a.54fb0f39.js +++ b/assets/js/ab4abc8a.07ab6367.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5675],{7988:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>s,default:()=>h,frontMatter:()=>o,metadata:()=>a,toc:()=>l});const a=JSON.parse('{"id":"introduction/use-cases","title":"Use Cases","description":"There are a lot of use cases where Calimero can be used and here are some of","source":"@site/docs/01-introduction/02-use-cases.mdx","sourceDirName":"01-introduction","slug":"/introduction/use-cases","permalink":"/introduction/use-cases","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/01-introduction/02-use-cases.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":2,"frontMatter":{"id":"use-cases","title":"Use Cases"},"sidebar":"tutorialSidebar","previous":{"title":"What is Calimero","permalink":"/introduction/what-is-calimero"},"next":{"title":"Key Features","permalink":"/introduction/key-features"}}');var i=n(6070),r=n(5248);const o={id:"use-cases",title:"Use Cases"},s=void 0,c={},l=[{value:"Private DAOs Management",id:"private-daos-management",level:2},{value:"Decentralized Voting Systems",id:"decentralized-voting-systems",level:2},{value:"Decentralized Social Platforms",id:"decentralized-social-platforms",level:2},{value:"Decentralized Productivity (DeProd) SaaS",id:"decentralized-productivity-deprod-saas",level:2},{value:"Decentralized Gig Economy",id:"decentralized-gig-economy",level:2},{value:"Trustless Gaming",id:"trustless-gaming",level:2},{value:"Decentralized Edge Compute",id:"decentralized-edge-compute",level:2},{value:"Decentralized Identity Verification",id:"decentralized-identity-verification",level:2},{value:"Decentralized Intellectual Property Management",id:"decentralized-intellectual-property-management",level:2}];function d(e){const t={h2:"h2",p:"p",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.p,{children:"There are a lot of use cases where Calimero can be used and here are some of\nthem:"}),"\n",(0,i.jsx)(t.h2,{id:"private-daos-management",children:"Private DAOs Management"}),"\n",(0,i.jsx)(t.p,{children:"Migrate sensitive on-chain and off-chain data into a DAO-owned private Calimero\napplication, enabling you to interact with the base chain of the DAO. DAO\nmembers keep the core contract logic on-chain, while shielding all the sensitive\ndata."}),"\n",(0,i.jsx)(t.h2,{id:"decentralized-voting-systems",children:"Decentralized Voting Systems"}),"\n",(0,i.jsx)(t.p,{children:"Enhance trust in voting by creating a secure and tamper-proof voting process\napplication, ensuring each vote is counted accurately and cannot be altered.\nThis technology enhances trust in voting by providing verifiable and immutable\nrecords while protecting voter privacy. It empowers voters, reduces the risk of\nfraud, and promotes democratic participation through a transparent and secure\nvoting platform."}),"\n",(0,i.jsx)(t.h2,{id:"decentralized-social-platforms",children:"Decentralized Social Platforms"}),"\n",(0,i.jsx)(t.p,{children:"Build social experiences which need scalable but private data like social\ngroups, direct messages and others, while eliminating high transaction costs\n(gas fees associated with blockchains). This can include exclusive groups and\ngated communities based on ownership of NFTs or token payments which would allow\nparticipation and decryption of the community data content."}),"\n",(0,i.jsx)(t.h2,{id:"decentralized-productivity-deprod-saas",children:"Decentralized Productivity (DeProd) SaaS"}),"\n",(0,i.jsx)(t.p,{children:"Create a decentralized productivity tools suite by self hosting your data on\nCalimero\u2019s private applications and move away from the control of centralized\nentities. The new platform would mitigate the burden of lifetime deals and hard\nmigration processes for the current users of Productivity SaaS solutions."}),"\n",(0,i.jsx)(t.h2,{id:"decentralized-gig-economy",children:"Decentralized Gig Economy"}),"\n",(0,i.jsx)(t.p,{children:"Disrupt the current gig economy players and compose a fully decentralized ride\nsharing, freelancing, temporary work, mechanical turk platform, or any other\nshared economy model where each network participant gets their fair share of the\nprofits."}),"\n",(0,i.jsx)(t.h2,{id:"trustless-gaming",children:"Trustless Gaming"}),"\n",(0,i.jsx)(t.p,{children:"Resolve the transparency and verification problems in games with turn mechanics\n(i.e. Battleship), and in those where private data holds significant importance\n(i.e. poker)."}),"\n",(0,i.jsx)(t.h2,{id:"decentralized-edge-compute",children:"Decentralized Edge Compute"}),"\n",(0,i.jsx)(t.p,{children:"Most of the general compute today happens on cloud service because that is where\nmost of the data lives. With Calimero, all the applications data is stored\nlocally, whereas Calimero enables edge compute on that data. Combined with the\nuse of decentralized AI and Edge Inference LLMs, there are numerous use cases\nhow Calimero can enhance user experience: Edge AI on users data for social spam\nfiltering, e-commerce shopping recommendations across channels, to name a few.\nThis would allow users to finally maximize the endless possibilities from their\ndata, on their own rules."}),"\n",(0,i.jsx)(t.p,{children:"For example, when you used to purchase from a certain merchant, the data was\nfully controlled by that merchant or the platform where the data was hosted,\nwhich would yield to your recommendations being exclusively tied to that\nmerchant. But if the data would have lived on your device, your data\nrecommendations would have been across various market channels, and not\nexclusively tied to that specific merchant."}),"\n",(0,i.jsx)(t.h2,{id:"decentralized-identity-verification",children:"Decentralized Identity Verification"}),"\n",(0,i.jsx)(t.p,{children:"Create a private Calimero application network which provides transparent and\ntrusted identity verification for service providers. With Calimero, sensitive\nprocedures such as opening a bank account or applying for Visas would not\nrequire service providers to host the data of their users at centralized\nentities any more."}),"\n",(0,i.jsx)(t.h2,{id:"decentralized-intellectual-property-management",children:"Decentralized Intellectual Property Management"}),"\n",(0,i.jsx)(t.p,{children:"The traditional platforms for managing and enforcing intellectual property\nrights are not fully transparent, resulting in creators not being able to\nmaximize the utility of their work. Developing a decentralized IP management\nplatform would result in a fairer compensation system for all creators."})]})}function h(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},5248:(e,t,n)=>{n.d(t,{R:()=>o,x:()=>s});var a=n(758);const i={},r=a.createContext(i);function o(e){const t=a.useContext(r);return a.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),a.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5675],{7988:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>s,default:()=>h,frontMatter:()=>o,metadata:()=>a,toc:()=>l});const a=JSON.parse('{"id":"introduction/use-cases","title":"Use Cases","description":"There are a lot of use cases where Calimero can be used and here are some of","source":"@site/docs/01-introduction/02-use-cases.mdx","sourceDirName":"01-introduction","slug":"/introduction/use-cases","permalink":"/introduction/use-cases","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/01-introduction/02-use-cases.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":2,"frontMatter":{"id":"use-cases","title":"Use Cases"},"sidebar":"tutorialSidebar","previous":{"title":"What is Calimero","permalink":"/introduction/what-is-calimero"},"next":{"title":"Key Features","permalink":"/introduction/key-features"}}');var i=n(6070),r=n(5248);const o={id:"use-cases",title:"Use Cases"},s=void 0,c={},l=[{value:"Private DAOs Management",id:"private-daos-management",level:2},{value:"Decentralized Voting Systems",id:"decentralized-voting-systems",level:2},{value:"Decentralized Social Platforms",id:"decentralized-social-platforms",level:2},{value:"Decentralized Productivity (DeProd) SaaS",id:"decentralized-productivity-deprod-saas",level:2},{value:"Decentralized Gig Economy",id:"decentralized-gig-economy",level:2},{value:"Trustless Gaming",id:"trustless-gaming",level:2},{value:"Decentralized Edge Compute",id:"decentralized-edge-compute",level:2},{value:"Decentralized Identity Verification",id:"decentralized-identity-verification",level:2},{value:"Decentralized Intellectual Property Management",id:"decentralized-intellectual-property-management",level:2}];function d(e){const t={h2:"h2",p:"p",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.p,{children:"There are a lot of use cases where Calimero can be used and here are some of\nthem:"}),"\n",(0,i.jsx)(t.h2,{id:"private-daos-management",children:"Private DAOs Management"}),"\n",(0,i.jsx)(t.p,{children:"Migrate sensitive on-chain and off-chain data into a DAO-owned private Calimero\napplication, enabling you to interact with the base chain of the DAO. DAO\nmembers keep the core contract logic on-chain, while shielding all the sensitive\ndata."}),"\n",(0,i.jsx)(t.h2,{id:"decentralized-voting-systems",children:"Decentralized Voting Systems"}),"\n",(0,i.jsx)(t.p,{children:"Enhance trust in voting by creating a secure and tamper-proof voting process\napplication, ensuring each vote is counted accurately and cannot be altered.\nThis technology enhances trust in voting by providing verifiable and immutable\nrecords while protecting voter privacy. It empowers voters, reduces the risk of\nfraud, and promotes democratic participation through a transparent and secure\nvoting platform."}),"\n",(0,i.jsx)(t.h2,{id:"decentralized-social-platforms",children:"Decentralized Social Platforms"}),"\n",(0,i.jsx)(t.p,{children:"Build social experiences which need scalable but private data like social\ngroups, direct messages and others, while eliminating high transaction costs\n(gas fees associated with blockchains). This can include exclusive groups and\ngated communities based on ownership of NFTs or token payments which would allow\nparticipation and decryption of the community data content."}),"\n",(0,i.jsx)(t.h2,{id:"decentralized-productivity-deprod-saas",children:"Decentralized Productivity (DeProd) SaaS"}),"\n",(0,i.jsx)(t.p,{children:"Create a decentralized productivity tools suite by self hosting your data on\nCalimero\u2019s private applications and move away from the control of centralized\nentities. The new platform would mitigate the burden of lifetime deals and hard\nmigration processes for the current users of Productivity SaaS solutions."}),"\n",(0,i.jsx)(t.h2,{id:"decentralized-gig-economy",children:"Decentralized Gig Economy"}),"\n",(0,i.jsx)(t.p,{children:"Disrupt the current gig economy players and compose a fully decentralized ride\nsharing, freelancing, temporary work, mechanical turk platform, or any other\nshared economy model where each network participant gets their fair share of the\nprofits."}),"\n",(0,i.jsx)(t.h2,{id:"trustless-gaming",children:"Trustless Gaming"}),"\n",(0,i.jsx)(t.p,{children:"Resolve the transparency and verification problems in games with turn mechanics\n(i.e. Battleship), and in those where private data holds significant importance\n(i.e. poker)."}),"\n",(0,i.jsx)(t.h2,{id:"decentralized-edge-compute",children:"Decentralized Edge Compute"}),"\n",(0,i.jsx)(t.p,{children:"Most of the general compute today happens on cloud service because that is where\nmost of the data lives. With Calimero, all the applications data is stored\nlocally, whereas Calimero enables edge compute on that data. Combined with the\nuse of decentralized AI and Edge Inference LLMs, there are numerous use cases\nhow Calimero can enhance user experience: Edge AI on users data for social spam\nfiltering, e-commerce shopping recommendations across channels, to name a few.\nThis would allow users to finally maximize the endless possibilities from their\ndata, on their own rules."}),"\n",(0,i.jsx)(t.p,{children:"For example, when you used to purchase from a certain merchant, the data was\nfully controlled by that merchant or the platform where the data was hosted,\nwhich would yield to your recommendations being exclusively tied to that\nmerchant. But if the data would have lived on your device, your data\nrecommendations would have been across various market channels, and not\nexclusively tied to that specific merchant."}),"\n",(0,i.jsx)(t.h2,{id:"decentralized-identity-verification",children:"Decentralized Identity Verification"}),"\n",(0,i.jsx)(t.p,{children:"Create a private Calimero application network which provides transparent and\ntrusted identity verification for service providers. With Calimero, sensitive\nprocedures such as opening a bank account or applying for Visas would not\nrequire service providers to host the data of their users at centralized\nentities any more."}),"\n",(0,i.jsx)(t.h2,{id:"decentralized-intellectual-property-management",children:"Decentralized Intellectual Property Management"}),"\n",(0,i.jsx)(t.p,{children:"The traditional platforms for managing and enforcing intellectual property\nrights are not fully transparent, resulting in creators not being able to\nmaximize the utility of their work. Developing a decentralized IP management\nplatform would result in a fairer compensation system for all creators."})]})}function h(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},5248:(e,t,n)=>{n.d(t,{R:()=>o,x:()=>s});var a=n(758);const i={},r=a.createContext(i);function o(e){const t=a.useContext(r);return a.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),a.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/ae6ff85f.fec9d170.js b/assets/js/ae6ff85f.0a00859c.js similarity index 98% rename from assets/js/ae6ff85f.fec9d170.js rename to assets/js/ae6ff85f.0a00859c.js index 584fbc3a..0c299a62 100644 --- a/assets/js/ae6ff85f.fec9d170.js +++ b/assets/js/ae6ff85f.0a00859c.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8262],{3465:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>a,default:()=>h,frontMatter:()=>s,metadata:()=>i,toc:()=>l});const i=JSON.parse('{"id":"core-concepts/terminology","title":"Terminology","description":"As projects grow, it\'s important to have a shared vocabulary to help communicate","source":"@site/docs/03-core-concepts/01-terminology.mdx","sourceDirName":"03-core-concepts","slug":"/core-concepts/terminology","permalink":"/core-concepts/terminology","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/03-core-concepts/01-terminology.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":1,"frontMatter":{"id":"terminology","title":"Terminology"},"sidebar":"tutorialSidebar","previous":{"title":"Build From Source","permalink":"/getting-started/build-from-source"},"next":{"title":"Identity","permalink":"/core-concepts/identity"}}');var o=n(6070),r=n(5248);const s={id:"terminology",title:"Terminology"},a=void 0,c={},l=[];function d(e){const t={li:"li",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.p,{children:"As projects grow, it's important to have a shared vocabulary to help communicate\neffectively. This page provides a list of terms used in the documentation and\nthroughout the codebase."}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"Node"})," is any individual device or computer that participates in the\nnetwork. To avoid confusion with network layer used in the protocol, instead\nof network we are using term ",(0,o.jsx)(t.strong,{children:"Context"}),"."]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"Peer"})," is a specific instance of a node within a P2P network that interacts\nwith other peers. Peer represents user."]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"Peer Id"})," is a unique identifier assigned to each peer in the network. It is\nused to distinguish between different peers and ensure that messages are\ndelivered to the correct recipient."]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"Context"})," is the core of the Calimero ecosystem. It is an application\nspecific network designed to enable direct communication between users,\neliminating the need for intermediaries"]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"Application"})," is a software program designed to perform specific tasks or\nsolve particular problems. To ensure compatibility and functionality, it\nshould be developed according to the protocol SDK instructions provided. Once\ndeveloped, the application should be published in a format that others can use\nduring runtime, specifically in WebAssembly (WASM) format. Developer can also\nbuild frontend for an application, deployed separately, allowing users to\ninteract with an app directly. This user interface facilitates interaction\nwith the underlying software, making the application accessible and\nuser-friendly."]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"Root key"})," is the public part of a wallet cryptographic key pair used to\nverify the signature of sensitive actions. This public key is used to ensure\nthat any data or actions signed with the corresponding private key can be\ntrusted. Essentially, the root key serves as a trust anchor, enabling users to\nvalidate the authenticity and integrity of operations or communications\nassociated with the node. It does not grant direct control over the node but\nensures that actions authenticated with the private part of the root key are\nlegitimate."]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"Client key"})," is a cryptographic key tailored for each user session, acting\nas a session key or token. Each client key must be signed with the root key to\nbe valid which is done automatically during login. This ensures that only\nsessions authenticated by the trusted root key can interact with the node."]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"Specialized node"})," is third-party node that augment a context's capacity and\nreliability. It participates in a context but have additional capabilities,\nproviding various services while maintaining the decentralized nature of the\nnetwork."]}),"\n"]})]})}function h(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},5248:(e,t,n)=>{n.d(t,{R:()=>s,x:()=>a});var i=n(758);const o={},r=i.createContext(o);function s(e){const t=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),i.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8262],{3465:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>a,default:()=>h,frontMatter:()=>s,metadata:()=>i,toc:()=>l});const i=JSON.parse('{"id":"core-concepts/terminology","title":"Terminology","description":"As projects grow, it\'s important to have a shared vocabulary to help communicate","source":"@site/docs/03-core-concepts/01-terminology.mdx","sourceDirName":"03-core-concepts","slug":"/core-concepts/terminology","permalink":"/core-concepts/terminology","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/03-core-concepts/01-terminology.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":1,"frontMatter":{"id":"terminology","title":"Terminology"},"sidebar":"tutorialSidebar","previous":{"title":"Build From Source","permalink":"/getting-started/build-from-source"},"next":{"title":"Identity","permalink":"/core-concepts/identity"}}');var o=n(6070),r=n(5248);const s={id:"terminology",title:"Terminology"},a=void 0,c={},l=[];function d(e){const t={li:"li",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.p,{children:"As projects grow, it's important to have a shared vocabulary to help communicate\neffectively. This page provides a list of terms used in the documentation and\nthroughout the codebase."}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"Node"})," is any individual device or computer that participates in the\nnetwork. To avoid confusion with network layer used in the protocol, instead\nof network we are using term ",(0,o.jsx)(t.strong,{children:"Context"}),"."]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"Peer"})," is a specific instance of a node within a P2P network that interacts\nwith other peers. Peer represents user."]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"Peer Id"})," is a unique identifier assigned to each peer in the network. It is\nused to distinguish between different peers and ensure that messages are\ndelivered to the correct recipient."]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"Context"})," is the core of the Calimero ecosystem. It is an application\nspecific network designed to enable direct communication between users,\neliminating the need for intermediaries"]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"Application"})," is a software program designed to perform specific tasks or\nsolve particular problems. To ensure compatibility and functionality, it\nshould be developed according to the protocol SDK instructions provided. Once\ndeveloped, the application should be published in a format that others can use\nduring runtime, specifically in WebAssembly (WASM) format. Developer can also\nbuild frontend for an application, deployed separately, allowing users to\ninteract with an app directly. This user interface facilitates interaction\nwith the underlying software, making the application accessible and\nuser-friendly."]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"Root key"})," is the public part of a wallet cryptographic key pair used to\nverify the signature of sensitive actions. This public key is used to ensure\nthat any data or actions signed with the corresponding private key can be\ntrusted. Essentially, the root key serves as a trust anchor, enabling users to\nvalidate the authenticity and integrity of operations or communications\nassociated with the node. It does not grant direct control over the node but\nensures that actions authenticated with the private part of the root key are\nlegitimate."]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"Client key"})," is a cryptographic key tailored for each user session, acting\nas a session key or token. Each client key must be signed with the root key to\nbe valid which is done automatically during login. This ensures that only\nsessions authenticated by the trusted root key can interact with the node."]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"Specialized node"})," is third-party node that augment a context's capacity and\nreliability. It participates in a context but have additional capabilities,\nproviding various services while maintaining the decentralized nature of the\nnetwork."]}),"\n"]})]})}function h(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},5248:(e,t,n)=>{n.d(t,{R:()=>s,x:()=>a});var i=n(758);const o={},r=i.createContext(o);function s(e){const t=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),i.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/af52bc08.d7e26773.js b/assets/js/af52bc08.de76d8d4.js similarity index 99% rename from assets/js/af52bc08.d7e26773.js rename to assets/js/af52bc08.de76d8d4.js index f32fe217..d354a5d7 100644 --- a/assets/js/af52bc08.d7e26773.js +++ b/assets/js/af52bc08.de76d8d4.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6938],{2458:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>s,default:()=>u,frontMatter:()=>r,metadata:()=>i,toc:()=>l});const i=JSON.parse('{"id":"architecture/node/client-node","title":"Client Node","description":"Runtime","source":"@site/docs/04-architecture/03-node/01-client-node.mdx","sourceDirName":"04-architecture/03-node","slug":"/architecture/node/client-node","permalink":"/architecture/node/client-node","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/04-architecture/03-node/01-client-node.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":1,"frontMatter":{"id":"client-node","title":"Client Node"},"sidebar":"tutorialSidebar","previous":{"title":"System Overview","permalink":"/architecture/system-overview"},"next":{"title":"Runtime","permalink":"/architecture/node/runtime"}}');var a=t(6070),o=t(5248);const r={id:"client-node",title:"Client Node"},s=void 0,c={},l=[{value:"Runtime",id:"runtime",level:3},{value:"Recommendations for Developers: Thorough testing of applications in a controlled environment is advised before deploying them in production to ensure stability and security. Additionally, developers are encouraged to implement locked update rules to prevent unauthorized modifications to the application's behavior.",id:"recommendations-for-developers-thorough-testing-of-applications-in-a-controlled-environment-is-advised-before-deploying-them-in-production-to-ensure-stability-and-security-additionally-developers-are-encouraged-to-implement-locked-update-rules-to-prevent-unauthorized-modifications-to-the-applications-behavior",level:4},{value:"Storage",id:"storage",level:3},{value:"Encryption:",id:"encryption",level:3},{value:"Identity Management",id:"identity-management",level:3},{value:"Authentication",id:"authentication",level:3},{value:"Key Management",id:"key-management",level:3},{value:"Application Marketplace",id:"application-marketplace",level:3}];function d(e){const n={h3:"h3",h4:"h4",li:"li",p:"p",ul:"ul",...(0,o.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.h3,{id:"runtime",children:"Runtime"}),"\n",(0,a.jsx)(n.p,{children:"Overview: The runtime environment of a client node in the Calimero Network is\ncrucial for the execution of decentralized applications (DApps), particularly\nthose compiled to WebAssembly (WASM)."}),"\n",(0,a.jsx)(n.p,{children:"Functionality:"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"State Synchronization: Each node can download and synchronize the state with\nexisting applications, ensuring that all nodes participating in a particular\napplication network are consistent and up-to-date."}),"\n",(0,a.jsx)(n.li,{children:"Application Settings: Nodes can be configured with specific settings for each\napplication, including which WASM modules to run, source URLs for fetching\nthese modules, encryption protocols to be used, and more."}),"\n",(0,a.jsx)(n.li,{children:"Network Topology & Update Rules: Defines the structure of the network and how\nnodes communicate and update each other. Proper update rules are crucial for\napplication security and integrity, particularly in a decentralized setting\nwhere trust is distributed."}),"\n"]}),"\n",(0,a.jsx)(n.h4,{id:"recommendations-for-developers-thorough-testing-of-applications-in-a-controlled-environment-is-advised-before-deploying-them-in-production-to-ensure-stability-and-security-additionally-developers-are-encouraged-to-implement-locked-update-rules-to-prevent-unauthorized-modifications-to-the-applications-behavior",children:"Recommendations for Developers: Thorough testing of applications in a controlled environment is advised before deploying them in production to ensure stability and security. Additionally, developers are encouraged to implement locked update rules to prevent unauthorized modifications to the application's behavior."}),"\n",(0,a.jsx)(n.h3,{id:"storage",children:"Storage"}),"\n",(0,a.jsx)(n.p,{children:"Overview: Storage on client nodes involves maintaining the state and data\nrequired for the decentralized applications they support."}),"\n",(0,a.jsx)(n.p,{children:"Functionality:"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"Local Storage: Each node stores application data locally, contributing to the\noverall decentralized storage model of the network. This ensures that data is\ndistributed across the network, enhancing privacy and resilience against\ncentral points of failure."}),"\n"]}),"\n",(0,a.jsx)(n.h3,{id:"encryption",children:"Encryption:"}),"\n",(0,a.jsx)(n.p,{children:"Data stored on client nodes can be encrypted, providing an additional layer of\nsecurity and privacy for user data."}),"\n",(0,a.jsx)(n.h3,{id:"identity-management",children:"Identity Management"}),"\n",(0,a.jsx)(n.p,{children:"Overview: Managing identities on the Calimero Network is fundamental for\nensuring secure and private interactions between nodes and applications.\nFunctionality:"}),"\n",(0,a.jsx)(n.h3,{id:"authentication",children:"Authentication"}),"\n",(0,a.jsx)(n.p,{children:"Nodes implement mechanisms for authenticating users and applications, ensuring\nthat interactions are secure and that entities are who they claim to be."}),"\n",(0,a.jsx)(n.h3,{id:"key-management",children:"Key Management"}),"\n",(0,a.jsx)(n.p,{children:"The management of cryptographic keys is an integral part of identity management,\nenabling secure communication and data encryption across the network."}),"\n",(0,a.jsx)(n.h3,{id:"application-marketplace",children:"Application Marketplace"}),"\n",(0,a.jsx)(n.p,{children:"Current State: The marketplace for decentralized applications within the\nCalimero Network is facilitated by a smart contract on the NEAR blockchain, with\napplication data and metadata hosted on IPFS. This setup serves as a temporary\nsolution while further community engagement and discussions are underway to\nrefine the marketplace's infrastructure and governance. The Calimero Network's\napproach to client nodes emphasizes security, decentralization, and privacy,\nwith a strong recommendation for users to engage with applications that have\nsecurely locked update mechanisms. These applications are more reliable for\ncritical use cases and are the only ones featured in the official marketplace,\nensuring a curated and trustworthy selection of DApps for users. This framework\ndemonstrates Calimero Network's commitment to building a secure and user-centric\ndecentralized ecosystem."})]})}function u(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},5248:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>s});var i=t(758);const a={},o=i.createContext(a);function r(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6938],{2458:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>s,default:()=>u,frontMatter:()=>r,metadata:()=>i,toc:()=>l});const i=JSON.parse('{"id":"architecture/node/client-node","title":"Client Node","description":"Runtime","source":"@site/docs/04-architecture/03-node/01-client-node.mdx","sourceDirName":"04-architecture/03-node","slug":"/architecture/node/client-node","permalink":"/architecture/node/client-node","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/04-architecture/03-node/01-client-node.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":1,"frontMatter":{"id":"client-node","title":"Client Node"},"sidebar":"tutorialSidebar","previous":{"title":"System Overview","permalink":"/architecture/system-overview"},"next":{"title":"Runtime","permalink":"/architecture/node/runtime"}}');var a=t(6070),o=t(5248);const r={id:"client-node",title:"Client Node"},s=void 0,c={},l=[{value:"Runtime",id:"runtime",level:3},{value:"Recommendations for Developers: Thorough testing of applications in a controlled environment is advised before deploying them in production to ensure stability and security. Additionally, developers are encouraged to implement locked update rules to prevent unauthorized modifications to the application's behavior.",id:"recommendations-for-developers-thorough-testing-of-applications-in-a-controlled-environment-is-advised-before-deploying-them-in-production-to-ensure-stability-and-security-additionally-developers-are-encouraged-to-implement-locked-update-rules-to-prevent-unauthorized-modifications-to-the-applications-behavior",level:4},{value:"Storage",id:"storage",level:3},{value:"Encryption:",id:"encryption",level:3},{value:"Identity Management",id:"identity-management",level:3},{value:"Authentication",id:"authentication",level:3},{value:"Key Management",id:"key-management",level:3},{value:"Application Marketplace",id:"application-marketplace",level:3}];function d(e){const n={h3:"h3",h4:"h4",li:"li",p:"p",ul:"ul",...(0,o.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.h3,{id:"runtime",children:"Runtime"}),"\n",(0,a.jsx)(n.p,{children:"Overview: The runtime environment of a client node in the Calimero Network is\ncrucial for the execution of decentralized applications (DApps), particularly\nthose compiled to WebAssembly (WASM)."}),"\n",(0,a.jsx)(n.p,{children:"Functionality:"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"State Synchronization: Each node can download and synchronize the state with\nexisting applications, ensuring that all nodes participating in a particular\napplication network are consistent and up-to-date."}),"\n",(0,a.jsx)(n.li,{children:"Application Settings: Nodes can be configured with specific settings for each\napplication, including which WASM modules to run, source URLs for fetching\nthese modules, encryption protocols to be used, and more."}),"\n",(0,a.jsx)(n.li,{children:"Network Topology & Update Rules: Defines the structure of the network and how\nnodes communicate and update each other. Proper update rules are crucial for\napplication security and integrity, particularly in a decentralized setting\nwhere trust is distributed."}),"\n"]}),"\n",(0,a.jsx)(n.h4,{id:"recommendations-for-developers-thorough-testing-of-applications-in-a-controlled-environment-is-advised-before-deploying-them-in-production-to-ensure-stability-and-security-additionally-developers-are-encouraged-to-implement-locked-update-rules-to-prevent-unauthorized-modifications-to-the-applications-behavior",children:"Recommendations for Developers: Thorough testing of applications in a controlled environment is advised before deploying them in production to ensure stability and security. Additionally, developers are encouraged to implement locked update rules to prevent unauthorized modifications to the application's behavior."}),"\n",(0,a.jsx)(n.h3,{id:"storage",children:"Storage"}),"\n",(0,a.jsx)(n.p,{children:"Overview: Storage on client nodes involves maintaining the state and data\nrequired for the decentralized applications they support."}),"\n",(0,a.jsx)(n.p,{children:"Functionality:"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"Local Storage: Each node stores application data locally, contributing to the\noverall decentralized storage model of the network. This ensures that data is\ndistributed across the network, enhancing privacy and resilience against\ncentral points of failure."}),"\n"]}),"\n",(0,a.jsx)(n.h3,{id:"encryption",children:"Encryption:"}),"\n",(0,a.jsx)(n.p,{children:"Data stored on client nodes can be encrypted, providing an additional layer of\nsecurity and privacy for user data."}),"\n",(0,a.jsx)(n.h3,{id:"identity-management",children:"Identity Management"}),"\n",(0,a.jsx)(n.p,{children:"Overview: Managing identities on the Calimero Network is fundamental for\nensuring secure and private interactions between nodes and applications.\nFunctionality:"}),"\n",(0,a.jsx)(n.h3,{id:"authentication",children:"Authentication"}),"\n",(0,a.jsx)(n.p,{children:"Nodes implement mechanisms for authenticating users and applications, ensuring\nthat interactions are secure and that entities are who they claim to be."}),"\n",(0,a.jsx)(n.h3,{id:"key-management",children:"Key Management"}),"\n",(0,a.jsx)(n.p,{children:"The management of cryptographic keys is an integral part of identity management,\nenabling secure communication and data encryption across the network."}),"\n",(0,a.jsx)(n.h3,{id:"application-marketplace",children:"Application Marketplace"}),"\n",(0,a.jsx)(n.p,{children:"Current State: The marketplace for decentralized applications within the\nCalimero Network is facilitated by a smart contract on the NEAR blockchain, with\napplication data and metadata hosted on IPFS. This setup serves as a temporary\nsolution while further community engagement and discussions are underway to\nrefine the marketplace's infrastructure and governance. The Calimero Network's\napproach to client nodes emphasizes security, decentralization, and privacy,\nwith a strong recommendation for users to engage with applications that have\nsecurely locked update mechanisms. These applications are more reliable for\ncritical use cases and are the only ones featured in the official marketplace,\nensuring a curated and trustworthy selection of DApps for users. This framework\ndemonstrates Calimero Network's commitment to building a secure and user-centric\ndecentralized ecosystem."})]})}function u(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},5248:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>s});var i=t(758);const a={},o=i.createContext(a);function r(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/bcc3649f.1750eb47.js b/assets/js/bcc3649f.bb0f399a.js similarity index 98% rename from assets/js/bcc3649f.1750eb47.js rename to assets/js/bcc3649f.bb0f399a.js index fcf334da..b86a1ccc 100644 --- a/assets/js/bcc3649f.1750eb47.js +++ b/assets/js/bcc3649f.bb0f399a.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1503],{8632:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>r,contentTitle:()=>l,default:()=>c,frontMatter:()=>a,metadata:()=>n,toc:()=>d});const n=JSON.parse('{"id":"developer-tools/apps/desktop-app","title":"Desktop App","description":"Calimero Node Manager Desktop app is a simple desktop application that allows","source":"@site/docs/05-developer-tools/03-apps/06-desktop-app.mdx","sourceDirName":"05-developer-tools/03-apps","slug":"/developer-tools/apps/desktop-app","permalink":"/developer-tools/apps/desktop-app","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/05-developer-tools/03-apps/06-desktop-app.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":6,"frontMatter":{"id":"desktop-app","title":"Desktop App"},"sidebar":"tutorialSidebar","previous":{"title":"Admin Dashboard","permalink":"/developer-tools/apps/admin-dashboard"},"next":{"title":"Tests","permalink":"/developer-tools/tests"}}');var s=o(6070),i=o(5248);const a={id:"desktop-app",title:"Desktop App"},l=void 0,r={},d=[{value:"Download and Install the App",id:"download-and-install-the-app",level:2},{value:"Key Features",id:"key-features",level:3}];function p(e){const t={a:"a",blockquote:"blockquote",em:"em",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.p,{children:"Calimero Node Manager Desktop app is a simple desktop application that allows\nyou to manage and interact with Calimero nodes without needing any technical\nknowledge."}),"\n",(0,s.jsx)(t.h2,{id:"download-and-install-the-app",children:"Download and Install the App"}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsxs)(t.li,{children:["Go to the\n",(0,s.jsx)(t.a,{href:"https://github.com/calimero-network/node-multiplatform-tauri/releases",children:"Calimero Node Manager download page"}),"."]}),"\n",(0,s.jsx)(t.li,{children:"Select the latest version and download the app for your machine from the\nassets list:"}),"\n"]}),"\n",(0,s.jsx)(t.p,{children:"Download and run the installer. Follow the instructions to install the app."}),"\n",(0,s.jsxs)(t.blockquote,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:(0,s.jsx)(t.em,{children:"NOTE:"})})," Supported OS"]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"Linux: Works on modern distributions like Fedora, Red Hat, CentOS, Ubuntu,\nand Debian (64-bit systems)"}),"\n",(0,s.jsx)(t.li,{children:"Mac: Supports macOS for both Intel and Apple Silicon Supported"}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(t.h3,{id:"key-features",children:"Key Features"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"Initialize Node: Create and initialize a new node with specified parameters."}),"\n",(0,s.jsx)(t.li,{children:"Update Node: Modify the configuration of an existing node."}),"\n",(0,s.jsx)(t.li,{children:"Start Node: Start a specified node."}),"\n",(0,s.jsx)(t.li,{children:"Stop Node: Stop a running node."}),"\n",(0,s.jsx)(t.li,{children:"Get Node Log: Retrieve the log file for a specified node."}),"\n",(0,s.jsx)(t.li,{children:"Delete Node: Remove a specified node from the application."}),"\n",(0,s.jsx)(t.li,{children:"Open Dashboard: Open the admin dashboard for a specified node."}),"\n"]}),"\n",(0,s.jsxs)(t.p,{children:["If you'd like to run the app locally or contribute to its development, you can\naccess the source code on our GitHub repository:\n",(0,s.jsx)(t.a,{href:"https://github.com/calimero-network/node-multiplatform-tauri",children:"Node Multiplatform Tauri"})]}),"\n",(0,s.jsx)(t.p,{children:"Feel free to explore, fork the repository, and contribute by submitting pull\nrequests or reporting issues."})]})}function c(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},5248:(e,t,o)=>{o.d(t,{R:()=>a,x:()=>l});var n=o(758);const s={},i=n.createContext(s);function a(e){const t=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),n.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1503],{8632:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>r,contentTitle:()=>l,default:()=>c,frontMatter:()=>a,metadata:()=>n,toc:()=>d});const n=JSON.parse('{"id":"developer-tools/apps/desktop-app","title":"Desktop App","description":"Calimero Node Manager Desktop app is a simple desktop application that allows","source":"@site/docs/05-developer-tools/03-apps/06-desktop-app.mdx","sourceDirName":"05-developer-tools/03-apps","slug":"/developer-tools/apps/desktop-app","permalink":"/developer-tools/apps/desktop-app","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/05-developer-tools/03-apps/06-desktop-app.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":6,"frontMatter":{"id":"desktop-app","title":"Desktop App"},"sidebar":"tutorialSidebar","previous":{"title":"Admin Dashboard","permalink":"/developer-tools/apps/admin-dashboard"},"next":{"title":"Tests","permalink":"/developer-tools/tests"}}');var s=o(6070),i=o(5248);const a={id:"desktop-app",title:"Desktop App"},l=void 0,r={},d=[{value:"Download and Install the App",id:"download-and-install-the-app",level:2},{value:"Key Features",id:"key-features",level:3}];function p(e){const t={a:"a",blockquote:"blockquote",em:"em",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.p,{children:"Calimero Node Manager Desktop app is a simple desktop application that allows\nyou to manage and interact with Calimero nodes without needing any technical\nknowledge."}),"\n",(0,s.jsx)(t.h2,{id:"download-and-install-the-app",children:"Download and Install the App"}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsxs)(t.li,{children:["Go to the\n",(0,s.jsx)(t.a,{href:"https://github.com/calimero-network/node-multiplatform-tauri/releases",children:"Calimero Node Manager download page"}),"."]}),"\n",(0,s.jsx)(t.li,{children:"Select the latest version and download the app for your machine from the\nassets list:"}),"\n"]}),"\n",(0,s.jsx)(t.p,{children:"Download and run the installer. Follow the instructions to install the app."}),"\n",(0,s.jsxs)(t.blockquote,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:(0,s.jsx)(t.em,{children:"NOTE:"})})," Supported OS"]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"Linux: Works on modern distributions like Fedora, Red Hat, CentOS, Ubuntu,\nand Debian (64-bit systems)"}),"\n",(0,s.jsx)(t.li,{children:"Mac: Supports macOS for both Intel and Apple Silicon Supported"}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(t.h3,{id:"key-features",children:"Key Features"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"Initialize Node: Create and initialize a new node with specified parameters."}),"\n",(0,s.jsx)(t.li,{children:"Update Node: Modify the configuration of an existing node."}),"\n",(0,s.jsx)(t.li,{children:"Start Node: Start a specified node."}),"\n",(0,s.jsx)(t.li,{children:"Stop Node: Stop a running node."}),"\n",(0,s.jsx)(t.li,{children:"Get Node Log: Retrieve the log file for a specified node."}),"\n",(0,s.jsx)(t.li,{children:"Delete Node: Remove a specified node from the application."}),"\n",(0,s.jsx)(t.li,{children:"Open Dashboard: Open the admin dashboard for a specified node."}),"\n"]}),"\n",(0,s.jsxs)(t.p,{children:["If you'd like to run the app locally or contribute to its development, you can\naccess the source code on our GitHub repository:\n",(0,s.jsx)(t.a,{href:"https://github.com/calimero-network/node-multiplatform-tauri",children:"Node Multiplatform Tauri"})]}),"\n",(0,s.jsx)(t.p,{children:"Feel free to explore, fork the repository, and contribute by submitting pull\nrequests or reporting issues."})]})}function c(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},5248:(e,t,o)=>{o.d(t,{R:()=>a,x:()=>l});var n=o(758);const s={},i=n.createContext(s);function a(e){const t=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),n.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/c8c2cbf1.ea73a962.js b/assets/js/c8c2cbf1.5c24fdf7.js similarity index 99% rename from assets/js/c8c2cbf1.ea73a962.js rename to assets/js/c8c2cbf1.5c24fdf7.js index f27ca954..ec444634 100644 --- a/assets/js/c8c2cbf1.ea73a962.js +++ b/assets/js/c8c2cbf1.5c24fdf7.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8373],{6679:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>a,frontMatter:()=>c,metadata:()=>i,toc:()=>d});const i=JSON.parse('{"id":"throubleshooting/ssl-tls","title":"SSL/TLS","description":"SSL/TLS Support","source":"@site/docs/08-throubleshooting/02-ssl.mdx","sourceDirName":"08-throubleshooting","slug":"/throubleshooting/ssl-tls","permalink":"/throubleshooting/ssl-tls","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/08-throubleshooting/02-ssl.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":2,"frontMatter":{"id":"ssl-tls","title":"SSL/TLS"},"sidebar":"tutorialSidebar","previous":{"title":"General","permalink":"/throubleshooting/overview"},"next":{"title":"GitHub","permalink":"/contributing/github"}}');var s=n(6070),r=n(5248);const c={id:"ssl-tls",title:"SSL/TLS"},o=void 0,l={},d=[{value:"SSL/TLS Support",id:"ssltls-support",level:3},{value:"Steps to Add the Certificate to Your Device",id:"steps-to-add-the-certificate-to-your-device",level:3},{value:"Rules for Generating SSL Certificates",id:"rules-for-generating-ssl-certificates",level:3}];function h(e){const t={a:"a",blockquote:"blockquote",code:"code",em:"em",h3:"h3",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h3,{id:"ssltls-support",children:"SSL/TLS Support"}),"\n",(0,s.jsx)(t.p,{children:"To be able to access the the node from external source on the same network you\nwill need to install the generated self-signed certificate."}),"\n",(0,s.jsxs)(t.blockquote,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:(0,s.jsx)(t.em,{children:"NOTE:"})})," Installing the SSL certificate is only necessary if you plan to\naccess the node from an external source on the same network. If you are\nrunning the application locally, you do not need to install the certificate."]}),"\n"]}),"\n",(0,s.jsx)(t.h3,{id:"steps-to-add-the-certificate-to-your-device",children:"Steps to Add the Certificate to Your Device"}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"Locate the Certificate"}),":"]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:["Download the certificate from\n",(0,s.jsx)(t.code,{children:"http://localhost:/admin-api/certificate"}),"."]}),"\n",(0,s.jsxs)(t.li,{children:["The ",(0,s.jsx)(t.code,{children:""})," is the port number used as an argument in the\n",(0,s.jsx)(t.code,{children:"--server-port"})," flag in the section\n",(0,s.jsx)(t.a,{href:"../getting-started/setup",children:"Initialize and start your node (separate terminal)"}),"."]}),"\n",(0,s.jsxs)(t.li,{children:["For example: ",(0,s.jsx)(t.code,{children:"bash http://localhost:2428/admin-api/certificate"})]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"Add the Certificate to Trusted Certificates"}),":"]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"For Windows"}),":"]}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsxs)(t.li,{children:["Open the ",(0,s.jsx)(t.code,{children:"Run"})," dialog (Win + R) and type ",(0,s.jsx)(t.code,{children:"mmc"})," to open the Microsoft\nManagement Console."]}),"\n",(0,s.jsxs)(t.li,{children:["Go to ",(0,s.jsx)(t.code,{children:"File"})," -> ",(0,s.jsx)(t.code,{children:"Add/Remove Snap-in..."}),"."]}),"\n",(0,s.jsxs)(t.li,{children:["Select ",(0,s.jsx)(t.code,{children:"Certificates"})," and click ",(0,s.jsx)(t.code,{children:"Add"}),"."]}),"\n",(0,s.jsxs)(t.li,{children:["Choose ",(0,s.jsx)(t.code,{children:"Computer account"}),", then ",(0,s.jsx)(t.code,{children:"Next"})," and ",(0,s.jsx)(t.code,{children:"Finish"}),"."]}),"\n",(0,s.jsxs)(t.li,{children:["Expand ",(0,s.jsx)(t.code,{children:"Certificates (Local Computer)"})," ->\n",(0,s.jsx)(t.code,{children:"Trusted Root Certification Authorities"}),"."]}),"\n",(0,s.jsxs)(t.li,{children:["Right-click ",(0,s.jsx)(t.code,{children:"Certificates"}),", then ",(0,s.jsx)(t.code,{children:"All Tasks"})," -> ",(0,s.jsx)(t.code,{children:"Import..."}),"."]}),"\n",(0,s.jsx)(t.li,{children:"Follow the prompts to import the certificate file."}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"For macOS"}),":"]}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsx)(t.li,{children:"Double-click the certificate file."}),"\n",(0,s.jsxs)(t.li,{children:["This will open the ",(0,s.jsx)(t.code,{children:"Keychain Access"})," application."]}),"\n",(0,s.jsxs)(t.li,{children:["Choose ",(0,s.jsx)(t.code,{children:"System"})," from the list of keychains."]}),"\n",(0,s.jsxs)(t.li,{children:["Drag and drop the certificate into the ",(0,s.jsx)(t.code,{children:"System"})," keychain."]}),"\n",(0,s.jsx)(t.li,{children:"Authenticate with your administrator password if prompted."}),"\n",(0,s.jsxs)(t.li,{children:["Right-click the certificate and select ",(0,s.jsx)(t.code,{children:"Get Info"}),"."]}),"\n",(0,s.jsxs)(t.li,{children:["Expand the ",(0,s.jsx)(t.code,{children:"Trust"})," section and select ",(0,s.jsx)(t.code,{children:"Always Trust"})," from the\n",(0,s.jsx)(t.code,{children:"When using this certificate"})," dropdown."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"For Linux"}),":"]}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsxs)(t.li,{children:["Copy the certificate to ",(0,s.jsx)(t.code,{children:"/usr/local/share/ca-certificates/"})," (or\n",(0,s.jsx)(t.code,{children:"/etc/pki/ca-trust/source/anchors/"})," depending on your distribution)."]}),"\n",(0,s.jsxs)(t.li,{children:["Run ",(0,s.jsx)(t.code,{children:"sudo update-ca-certificates"})," (or ",(0,s.jsx)(t.code,{children:"sudo update-ca-trust extract"})," for\nRed Hat-based distributions)."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"Restart Your Browser"}),":"]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"Close and reopen your web browser to ensure it recognizes the newly added\ncertificate."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(t.h3,{id:"rules-for-generating-ssl-certificates",children:"Rules for Generating SSL Certificates"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"If a certificate doesn't exist, a new one will be generated based on your\ncurrent local IP address."}),"\n",(0,s.jsx)(t.li,{children:"If a certificate exists for the current IP address, it will be used."}),"\n",(0,s.jsx)(t.li,{children:"If a certificate exists but is not configured for the current IP address, a\nnew certificate will be created."}),"\n"]}),"\n",(0,s.jsxs)(t.blockquote,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:(0,s.jsx)(t.em,{children:"NOTE:"})})," Every time a new certificate is generated (e.g., on the first\nstart of the server or when the IP address changes), you will need to add it\nto your device's trusted certificates."]}),"\n"]})]})}function a(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},5248:(e,t,n)=>{n.d(t,{R:()=>c,x:()=>o});var i=n(758);const s={},r=i.createContext(s);function c(e){const t=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:c(e.components),i.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8373],{6679:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>a,frontMatter:()=>c,metadata:()=>i,toc:()=>d});const i=JSON.parse('{"id":"throubleshooting/ssl-tls","title":"SSL/TLS","description":"SSL/TLS Support","source":"@site/docs/08-throubleshooting/02-ssl.mdx","sourceDirName":"08-throubleshooting","slug":"/throubleshooting/ssl-tls","permalink":"/throubleshooting/ssl-tls","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/08-throubleshooting/02-ssl.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":2,"frontMatter":{"id":"ssl-tls","title":"SSL/TLS"},"sidebar":"tutorialSidebar","previous":{"title":"General","permalink":"/throubleshooting/overview"},"next":{"title":"GitHub","permalink":"/contributing/github"}}');var s=n(6070),r=n(5248);const c={id:"ssl-tls",title:"SSL/TLS"},o=void 0,l={},d=[{value:"SSL/TLS Support",id:"ssltls-support",level:3},{value:"Steps to Add the Certificate to Your Device",id:"steps-to-add-the-certificate-to-your-device",level:3},{value:"Rules for Generating SSL Certificates",id:"rules-for-generating-ssl-certificates",level:3}];function h(e){const t={a:"a",blockquote:"blockquote",code:"code",em:"em",h3:"h3",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h3,{id:"ssltls-support",children:"SSL/TLS Support"}),"\n",(0,s.jsx)(t.p,{children:"To be able to access the the node from external source on the same network you\nwill need to install the generated self-signed certificate."}),"\n",(0,s.jsxs)(t.blockquote,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:(0,s.jsx)(t.em,{children:"NOTE:"})})," Installing the SSL certificate is only necessary if you plan to\naccess the node from an external source on the same network. If you are\nrunning the application locally, you do not need to install the certificate."]}),"\n"]}),"\n",(0,s.jsx)(t.h3,{id:"steps-to-add-the-certificate-to-your-device",children:"Steps to Add the Certificate to Your Device"}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"Locate the Certificate"}),":"]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:["Download the certificate from\n",(0,s.jsx)(t.code,{children:"http://localhost:/admin-api/certificate"}),"."]}),"\n",(0,s.jsxs)(t.li,{children:["The ",(0,s.jsx)(t.code,{children:""})," is the port number used as an argument in the\n",(0,s.jsx)(t.code,{children:"--server-port"})," flag in the section\n",(0,s.jsx)(t.a,{href:"../getting-started/setup",children:"Initialize and start your node (separate terminal)"}),"."]}),"\n",(0,s.jsxs)(t.li,{children:["For example: ",(0,s.jsx)(t.code,{children:"bash http://localhost:2428/admin-api/certificate"})]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"Add the Certificate to Trusted Certificates"}),":"]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"For Windows"}),":"]}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsxs)(t.li,{children:["Open the ",(0,s.jsx)(t.code,{children:"Run"})," dialog (Win + R) and type ",(0,s.jsx)(t.code,{children:"mmc"})," to open the Microsoft\nManagement Console."]}),"\n",(0,s.jsxs)(t.li,{children:["Go to ",(0,s.jsx)(t.code,{children:"File"})," -> ",(0,s.jsx)(t.code,{children:"Add/Remove Snap-in..."}),"."]}),"\n",(0,s.jsxs)(t.li,{children:["Select ",(0,s.jsx)(t.code,{children:"Certificates"})," and click ",(0,s.jsx)(t.code,{children:"Add"}),"."]}),"\n",(0,s.jsxs)(t.li,{children:["Choose ",(0,s.jsx)(t.code,{children:"Computer account"}),", then ",(0,s.jsx)(t.code,{children:"Next"})," and ",(0,s.jsx)(t.code,{children:"Finish"}),"."]}),"\n",(0,s.jsxs)(t.li,{children:["Expand ",(0,s.jsx)(t.code,{children:"Certificates (Local Computer)"})," ->\n",(0,s.jsx)(t.code,{children:"Trusted Root Certification Authorities"}),"."]}),"\n",(0,s.jsxs)(t.li,{children:["Right-click ",(0,s.jsx)(t.code,{children:"Certificates"}),", then ",(0,s.jsx)(t.code,{children:"All Tasks"})," -> ",(0,s.jsx)(t.code,{children:"Import..."}),"."]}),"\n",(0,s.jsx)(t.li,{children:"Follow the prompts to import the certificate file."}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"For macOS"}),":"]}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsx)(t.li,{children:"Double-click the certificate file."}),"\n",(0,s.jsxs)(t.li,{children:["This will open the ",(0,s.jsx)(t.code,{children:"Keychain Access"})," application."]}),"\n",(0,s.jsxs)(t.li,{children:["Choose ",(0,s.jsx)(t.code,{children:"System"})," from the list of keychains."]}),"\n",(0,s.jsxs)(t.li,{children:["Drag and drop the certificate into the ",(0,s.jsx)(t.code,{children:"System"})," keychain."]}),"\n",(0,s.jsx)(t.li,{children:"Authenticate with your administrator password if prompted."}),"\n",(0,s.jsxs)(t.li,{children:["Right-click the certificate and select ",(0,s.jsx)(t.code,{children:"Get Info"}),"."]}),"\n",(0,s.jsxs)(t.li,{children:["Expand the ",(0,s.jsx)(t.code,{children:"Trust"})," section and select ",(0,s.jsx)(t.code,{children:"Always Trust"})," from the\n",(0,s.jsx)(t.code,{children:"When using this certificate"})," dropdown."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"For Linux"}),":"]}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsxs)(t.li,{children:["Copy the certificate to ",(0,s.jsx)(t.code,{children:"/usr/local/share/ca-certificates/"})," (or\n",(0,s.jsx)(t.code,{children:"/etc/pki/ca-trust/source/anchors/"})," depending on your distribution)."]}),"\n",(0,s.jsxs)(t.li,{children:["Run ",(0,s.jsx)(t.code,{children:"sudo update-ca-certificates"})," (or ",(0,s.jsx)(t.code,{children:"sudo update-ca-trust extract"})," for\nRed Hat-based distributions)."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"Restart Your Browser"}),":"]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"Close and reopen your web browser to ensure it recognizes the newly added\ncertificate."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(t.h3,{id:"rules-for-generating-ssl-certificates",children:"Rules for Generating SSL Certificates"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"If a certificate doesn't exist, a new one will be generated based on your\ncurrent local IP address."}),"\n",(0,s.jsx)(t.li,{children:"If a certificate exists for the current IP address, it will be used."}),"\n",(0,s.jsx)(t.li,{children:"If a certificate exists but is not configured for the current IP address, a\nnew certificate will be created."}),"\n"]}),"\n",(0,s.jsxs)(t.blockquote,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:(0,s.jsx)(t.em,{children:"NOTE:"})})," Every time a new certificate is generated (e.g., on the first\nstart of the server or when the IP address changes), you will need to add it\nto your device's trusted certificates."]}),"\n"]})]})}function a(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},5248:(e,t,n)=>{n.d(t,{R:()=>c,x:()=>o});var i=n(758);const s={},r=i.createContext(s);function c(e){const t=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:c(e.components),i.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/ca1dcc06.0cb41c50.js b/assets/js/ca1dcc06.80299d2d.js similarity index 94% rename from assets/js/ca1dcc06.0cb41c50.js rename to assets/js/ca1dcc06.80299d2d.js index a204f2aa..fbfcc852 100644 --- a/assets/js/ca1dcc06.0cb41c50.js +++ b/assets/js/ca1dcc06.80299d2d.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4208],{689:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>c,contentTitle:()=>a,default:()=>u,frontMatter:()=>i,metadata:()=>r,toc:()=>l});const r=JSON.parse('{"id":"tutorials/awesome-projects/only-peers","title":"Only Peers","description":"Only Peers is a decentralized social networking app that empowers you to share","source":"@site/docs/06-tutorials/07-awesome-projects/01-only-peers.mdx","sourceDirName":"06-tutorials/07-awesome-projects","slug":"/tutorials/awesome-projects/only-peers","permalink":"/tutorials/awesome-projects/only-peers","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/06-tutorials/07-awesome-projects/01-only-peers.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":1,"frontMatter":{"id":"only-peers","title":"Only Peers"},"sidebar":"tutorialSidebar","previous":{"title":"Install application","permalink":"/tutorials/install-application"},"next":{"title":"Rock Paper Scissors","permalink":"/tutorials/awesome-projects/rock-paper-scissors"}}');var s=o(6070),n=o(5248);const i={id:"only-peers",title:"Only Peers"},a=void 0,c={},l=[];function p(e){const t={a:"a",p:"p",...(0,n.R)(),...e.components};return(0,s.jsxs)(t.p,{children:["Only Peers is a decentralized social networking app that empowers you to share\nyour thoughts and engage with your community without compromising your privacy.\nIt allows you to write posts, leave comments, and interact with friends.\nHowever, unlike traditional social networks, Only Peers ensures your data\nremains under your control, protected from central authorities and prying eyes.\nExperience the freedom of a decentralized platform where your voice cannot be\ncensored and your privacy is prioritized. Explore the source code on\n",(0,s.jsx)(t.a,{href:"https://github.com/calimero-network/only-peers-client",children:"GitHub repository"}),"."]})}function u(e={}){const{wrapper:t}={...(0,n.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},5248:(e,t,o)=>{o.d(t,{R:()=>i,x:()=>a});var r=o(758);const s={},n=r.createContext(s);function i(e){const t=r.useContext(n);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),r.createElement(n.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4208],{689:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>c,contentTitle:()=>a,default:()=>u,frontMatter:()=>i,metadata:()=>r,toc:()=>l});const r=JSON.parse('{"id":"tutorials/awesome-projects/only-peers","title":"Only Peers","description":"Only Peers is a decentralized social networking app that empowers you to share","source":"@site/docs/06-tutorials/07-awesome-projects/01-only-peers.mdx","sourceDirName":"06-tutorials/07-awesome-projects","slug":"/tutorials/awesome-projects/only-peers","permalink":"/tutorials/awesome-projects/only-peers","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/06-tutorials/07-awesome-projects/01-only-peers.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":1,"frontMatter":{"id":"only-peers","title":"Only Peers"},"sidebar":"tutorialSidebar","previous":{"title":"Install application","permalink":"/tutorials/install-application"},"next":{"title":"Rock Paper Scissors","permalink":"/tutorials/awesome-projects/rock-paper-scissors"}}');var s=o(6070),n=o(5248);const i={id:"only-peers",title:"Only Peers"},a=void 0,c={},l=[];function p(e){const t={a:"a",p:"p",...(0,n.R)(),...e.components};return(0,s.jsxs)(t.p,{children:["Only Peers is a decentralized social networking app that empowers you to share\nyour thoughts and engage with your community without compromising your privacy.\nIt allows you to write posts, leave comments, and interact with friends.\nHowever, unlike traditional social networks, Only Peers ensures your data\nremains under your control, protected from central authorities and prying eyes.\nExperience the freedom of a decentralized platform where your voice cannot be\ncensored and your privacy is prioritized. Explore the source code on\n",(0,s.jsx)(t.a,{href:"https://github.com/calimero-network/only-peers-client",children:"GitHub repository"}),"."]})}function u(e={}){const{wrapper:t}={...(0,n.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},5248:(e,t,o)=>{o.d(t,{R:()=>i,x:()=>a});var r=o(758);const s={},n=r.createContext(s);function i(e){const t=r.useContext(n);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),r.createElement(n.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/d4692bc6.7b6d2209.js b/assets/js/d4692bc6.d2286d00.js similarity index 98% rename from assets/js/d4692bc6.7b6d2209.js rename to assets/js/d4692bc6.d2286d00.js index 8d786d5c..f1b39eda 100644 --- a/assets/js/d4692bc6.7b6d2209.js +++ b/assets/js/d4692bc6.d2286d00.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4435],{6444:(e,t,i)=>{i.r(t),i.d(t,{assets:()=>c,contentTitle:()=>s,default:()=>p,frontMatter:()=>a,metadata:()=>n,toc:()=>l});const n=JSON.parse('{"id":"architecture/system-overview","title":"System Overview","description":"Calimero Network offers a robust framework for developing and running","source":"@site/docs/04-architecture/01-system-overview.mdx","sourceDirName":"04-architecture","slug":"/architecture/system-overview","permalink":"/architecture/system-overview","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/04-architecture/01-system-overview.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":1,"frontMatter":{"id":"system-overview","title":"System Overview"},"sidebar":"tutorialSidebar","previous":{"title":"Specialized Nodes","permalink":"/core-concepts/specialized-nodes"},"next":{"title":"Client Node","permalink":"/architecture/node/client-node"}}');var r=i(6070),o=i(5248);const a={id:"system-overview",title:"System Overview"},s=void 0,c={},l=[{value:"Participate",id:"participate",level:2},{value:"Build",id:"build",level:2}];function d(e){const t={h2:"h2",img:"img",li:"li",p:"p",ul:"ul",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.p,{children:"Calimero Network offers a robust framework for developing and running\npeer-to-peer (P2P) applications. Our framework allows users to participate in\nthe network or build applications for others to use."}),"\n",(0,r.jsx)(t.h2,{id:"participate",children:"Participate"}),"\n",(0,r.jsx)(t.p,{children:"Users participate in the network with a client node. By encapsulating the\ncomplexities of operating a client node, we aim to make it easy and intuitive\nfor everyone to engage in the decentralized world."}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"Client node acts as a gateway that runs applications and connects with other\npeers"}),"\n",(0,r.jsx)(t.li,{children:"Each application is loaded and isolated from other applications into a\nseparate context. This ensures that each application runs independently while\nstill allowing interactions through shared states or messages."}),"\n",(0,r.jsx)(t.li,{children:"Context consolidates all necessary components into a secure, isolated\nenvironment."}),"\n"]}),"\n",(0,r.jsx)(t.p,{children:"Some networks may require specialized functionalities, which are provided by a\ndedicated compute market. Users can integrate these special functionalities from\na pool of available specialized nodes."}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"Calimero Architecture",src:i(2885).A+"",width:"1920",height:"1080"})}),"\n",(0,r.jsx)(t.h2,{id:"build",children:"Build"}),"\n",(0,r.jsx)(t.p,{children:"To develop applications on the Calimero Network, we provide comprehensive SDKs:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"Protocol SDK to define how the application should behave and communicate with\nthe node."}),"\n",(0,r.jsx)(t.li,{children:"Client SDK to connect to node and use data in user interface and authenticate\nusing wallets UI."}),"\n"]}),"\n",(0,r.jsx)(t.p,{children:"Developer applications are shared through application registry where developers\nupload their applications and share it with other users"}),"\n",(0,r.jsx)(t.p,{children:"Explore other sections to learn more about each component, and how they\ncontribute to a seamless decentralized experience."})]})}function p(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},2885:(e,t,i)=>{i.d(t,{A:()=>n});const n=i.p+"assets/images/architecture-88be4e09ef7ca7e8a3bf6b5a69783f03.png"},5248:(e,t,i)=>{i.d(t,{R:()=>a,x:()=>s});var n=i(758);const r={},o=n.createContext(r);function a(e){const t=n.useContext(o);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),n.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4435],{6444:(e,t,i)=>{i.r(t),i.d(t,{assets:()=>c,contentTitle:()=>s,default:()=>p,frontMatter:()=>a,metadata:()=>n,toc:()=>l});const n=JSON.parse('{"id":"architecture/system-overview","title":"System Overview","description":"Calimero Network offers a robust framework for developing and running","source":"@site/docs/04-architecture/01-system-overview.mdx","sourceDirName":"04-architecture","slug":"/architecture/system-overview","permalink":"/architecture/system-overview","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/04-architecture/01-system-overview.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":1,"frontMatter":{"id":"system-overview","title":"System Overview"},"sidebar":"tutorialSidebar","previous":{"title":"Specialized Nodes","permalink":"/core-concepts/specialized-nodes"},"next":{"title":"Client Node","permalink":"/architecture/node/client-node"}}');var r=i(6070),o=i(5248);const a={id:"system-overview",title:"System Overview"},s=void 0,c={},l=[{value:"Participate",id:"participate",level:2},{value:"Build",id:"build",level:2}];function d(e){const t={h2:"h2",img:"img",li:"li",p:"p",ul:"ul",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.p,{children:"Calimero Network offers a robust framework for developing and running\npeer-to-peer (P2P) applications. Our framework allows users to participate in\nthe network or build applications for others to use."}),"\n",(0,r.jsx)(t.h2,{id:"participate",children:"Participate"}),"\n",(0,r.jsx)(t.p,{children:"Users participate in the network with a client node. By encapsulating the\ncomplexities of operating a client node, we aim to make it easy and intuitive\nfor everyone to engage in the decentralized world."}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"Client node acts as a gateway that runs applications and connects with other\npeers"}),"\n",(0,r.jsx)(t.li,{children:"Each application is loaded and isolated from other applications into a\nseparate context. This ensures that each application runs independently while\nstill allowing interactions through shared states or messages."}),"\n",(0,r.jsx)(t.li,{children:"Context consolidates all necessary components into a secure, isolated\nenvironment."}),"\n"]}),"\n",(0,r.jsx)(t.p,{children:"Some networks may require specialized functionalities, which are provided by a\ndedicated compute market. Users can integrate these special functionalities from\na pool of available specialized nodes."}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"Calimero Architecture",src:i(2885).A+"",width:"1920",height:"1080"})}),"\n",(0,r.jsx)(t.h2,{id:"build",children:"Build"}),"\n",(0,r.jsx)(t.p,{children:"To develop applications on the Calimero Network, we provide comprehensive SDKs:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"Protocol SDK to define how the application should behave and communicate with\nthe node."}),"\n",(0,r.jsx)(t.li,{children:"Client SDK to connect to node and use data in user interface and authenticate\nusing wallets UI."}),"\n"]}),"\n",(0,r.jsx)(t.p,{children:"Developer applications are shared through application registry where developers\nupload their applications and share it with other users"}),"\n",(0,r.jsx)(t.p,{children:"Explore other sections to learn more about each component, and how they\ncontribute to a seamless decentralized experience."})]})}function p(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},2885:(e,t,i)=>{i.d(t,{A:()=>n});const n=i.p+"assets/images/architecture-88be4e09ef7ca7e8a3bf6b5a69783f03.png"},5248:(e,t,i)=>{i.d(t,{R:()=>a,x:()=>s});var n=i(758);const r={},o=n.createContext(r);function a(e){const t=n.useContext(o);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),n.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/d51dfd58.76736ff7.js b/assets/js/d51dfd58.11d8cfbb.js similarity index 98% rename from assets/js/d51dfd58.76736ff7.js rename to assets/js/d51dfd58.11d8cfbb.js index a27389ea..e3800bc5 100644 --- a/assets/js/d51dfd58.76736ff7.js +++ b/assets/js/d51dfd58.11d8cfbb.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9352],{3999:(e,i,t)=>{t.r(i),t.d(i,{assets:()=>l,contentTitle:()=>p,default:()=>u,frontMatter:()=>o,metadata:()=>n,toc:()=>r});const n=JSON.parse('{"id":"tutorials/publish-app","title":"Publish App","description":"After you have built your application, you can publish it to the network. This","source":"@site/docs/06-tutorials/05-publish-app.mdx","sourceDirName":"06-tutorials","slug":"/tutorials/publish-app","permalink":"/tutorials/publish-app","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/06-tutorials/05-publish-app.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":5,"frontMatter":{"id":"publish-app","title":"Publish App"},"sidebar":"tutorialSidebar","previous":{"title":"Invitations and Joinings","permalink":"/tutorials/invitations-and-joinings"},"next":{"title":"Install application","permalink":"/tutorials/install-application"}}');var a=t(6070),s=t(5248);const o={id:"publish-app",title:"Publish App"},p=void 0,l={},r=[{value:"Publishing application",id:"publishing-application",level:2},{value:"Application preview",id:"application-preview",level:2},{value:"Example app preview",id:"example-app-preview",level:2}];function c(e){const i={a:"a",code:"code",h2:"h2",img:"img",p:"p",...(0,s.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.p,{children:"After you have built your application, you can publish it to the network. This\nwill make it available for users to interact with."}),"\n",(0,a.jsx)(i.h2,{id:"publishing-application",children:"Publishing application"}),"\n",(0,a.jsxs)(i.p,{children:["Navigate to ",(0,a.jsx)(i.a,{href:"../developer-tools/apps/admin-dashboard",children:"Admin Dashboard"})," and\nselect ",(0,a.jsx)(i.code,{children:"Applications"})," tab."]}),"\n",(0,a.jsx)(i.p,{children:(0,a.jsx)(i.img,{alt:"Publish application",src:t(67).A+"",width:"1968",height:"1562"})}),"\n",(0,a.jsx)(i.p,{children:"Enter the required data and publish the application. After publishing, your\napplication will be available for users to interact with in new contexts."}),"\n",(0,a.jsx)(i.h2,{id:"application-preview",children:"Application preview"}),"\n",(0,a.jsx)(i.p,{children:"Good practice allows users to try an app before they decide to use it. You can\ndeploy an app to any host provider."}),"\n",(0,a.jsxs)(i.p,{children:["We have used GitHub Pages to preview our ",(0,a.jsx)(i.a,{href:"./install-application",children:"example app"}),".\nYou can do the same by following the steps below."]}),"\n",(0,a.jsx)(i.h2,{id:"example-app-preview",children:"Example app preview"}),"\n",(0,a.jsxs)(i.p,{children:["First you need to enable GitHub Pages by following\n",(0,a.jsx)(i.a,{href:"https://docs.github.com/en/pages/getting-started-with-github-pages/creating-a-github-pages-site",children:"Creating a GitHub Pages"})]}),"\n",(0,a.jsxs)(i.p,{children:["Our example app is written in next.js and code is available in\n",(0,a.jsx)(i.a,{href:"https://github.com/calimero-network/only-peers-client",children:"only-peers-client"})," After\nenabling GitHub Pages, a few changes are required in your next.js app.\n",(0,a.jsx)(i.code,{children:"next.config.mjs"}),' should contain output: "export" field']}),"\n",(0,a.jsxs)(i.p,{children:["GitHub Actions is a platform used to automate the deployment process. You can\nfind example in\n",(0,a.jsx)(i.a,{href:"https://github.com/calimero-network/only-peers-client/tree/master/.github/workflows",children:"github workflow"})]})]})}function u(e={}){const{wrapper:i}={...(0,s.R)(),...e.components};return i?(0,a.jsx)(i,{...e,children:(0,a.jsx)(c,{...e})}):c(e)}},67:(e,i,t)=>{t.d(i,{A:()=>n});const n=t.p+"assets/images/publish-new-application-f4493f9baa5b1dc59d62ab483b52bb65.png"},5248:(e,i,t)=>{t.d(i,{R:()=>o,x:()=>p});var n=t(758);const a={},s=n.createContext(a);function o(e){const i=n.useContext(s);return n.useMemo((function(){return"function"==typeof e?e(i):{...i,...e}}),[i,e])}function p(e){let i;return i=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:o(e.components),n.createElement(s.Provider,{value:i},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9352],{3999:(e,i,t)=>{t.r(i),t.d(i,{assets:()=>l,contentTitle:()=>p,default:()=>u,frontMatter:()=>o,metadata:()=>n,toc:()=>r});const n=JSON.parse('{"id":"tutorials/publish-app","title":"Publish App","description":"After you have built your application, you can publish it to the network. This","source":"@site/docs/06-tutorials/05-publish-app.mdx","sourceDirName":"06-tutorials","slug":"/tutorials/publish-app","permalink":"/tutorials/publish-app","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/06-tutorials/05-publish-app.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":5,"frontMatter":{"id":"publish-app","title":"Publish App"},"sidebar":"tutorialSidebar","previous":{"title":"Invitations and Joinings","permalink":"/tutorials/invitations-and-joinings"},"next":{"title":"Install application","permalink":"/tutorials/install-application"}}');var a=t(6070),s=t(5248);const o={id:"publish-app",title:"Publish App"},p=void 0,l={},r=[{value:"Publishing application",id:"publishing-application",level:2},{value:"Application preview",id:"application-preview",level:2},{value:"Example app preview",id:"example-app-preview",level:2}];function c(e){const i={a:"a",code:"code",h2:"h2",img:"img",p:"p",...(0,s.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.p,{children:"After you have built your application, you can publish it to the network. This\nwill make it available for users to interact with."}),"\n",(0,a.jsx)(i.h2,{id:"publishing-application",children:"Publishing application"}),"\n",(0,a.jsxs)(i.p,{children:["Navigate to ",(0,a.jsx)(i.a,{href:"../developer-tools/apps/admin-dashboard",children:"Admin Dashboard"})," and\nselect ",(0,a.jsx)(i.code,{children:"Applications"})," tab."]}),"\n",(0,a.jsx)(i.p,{children:(0,a.jsx)(i.img,{alt:"Publish application",src:t(67).A+"",width:"1968",height:"1562"})}),"\n",(0,a.jsx)(i.p,{children:"Enter the required data and publish the application. After publishing, your\napplication will be available for users to interact with in new contexts."}),"\n",(0,a.jsx)(i.h2,{id:"application-preview",children:"Application preview"}),"\n",(0,a.jsx)(i.p,{children:"Good practice allows users to try an app before they decide to use it. You can\ndeploy an app to any host provider."}),"\n",(0,a.jsxs)(i.p,{children:["We have used GitHub Pages to preview our ",(0,a.jsx)(i.a,{href:"./install-application",children:"example app"}),".\nYou can do the same by following the steps below."]}),"\n",(0,a.jsx)(i.h2,{id:"example-app-preview",children:"Example app preview"}),"\n",(0,a.jsxs)(i.p,{children:["First you need to enable GitHub Pages by following\n",(0,a.jsx)(i.a,{href:"https://docs.github.com/en/pages/getting-started-with-github-pages/creating-a-github-pages-site",children:"Creating a GitHub Pages"})]}),"\n",(0,a.jsxs)(i.p,{children:["Our example app is written in next.js and code is available in\n",(0,a.jsx)(i.a,{href:"https://github.com/calimero-network/only-peers-client",children:"only-peers-client"})," After\nenabling GitHub Pages, a few changes are required in your next.js app.\n",(0,a.jsx)(i.code,{children:"next.config.mjs"}),' should contain output: "export" field']}),"\n",(0,a.jsxs)(i.p,{children:["GitHub Actions is a platform used to automate the deployment process. You can\nfind example in\n",(0,a.jsx)(i.a,{href:"https://github.com/calimero-network/only-peers-client/tree/master/.github/workflows",children:"github workflow"})]})]})}function u(e={}){const{wrapper:i}={...(0,s.R)(),...e.components};return i?(0,a.jsx)(i,{...e,children:(0,a.jsx)(c,{...e})}):c(e)}},67:(e,i,t)=>{t.d(i,{A:()=>n});const n=t.p+"assets/images/publish-new-application-f4493f9baa5b1dc59d62ab483b52bb65.png"},5248:(e,i,t)=>{t.d(i,{R:()=>o,x:()=>p});var n=t(758);const a={},s=n.createContext(a);function o(e){const i=n.useContext(s);return n.useMemo((function(){return"function"==typeof e?e(i):{...i,...e}}),[i,e])}function p(e){let i;return i=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:o(e.components),n.createElement(s.Provider,{value:i},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/db8389d5.cf461329.js b/assets/js/db8389d5.cf461329.js deleted file mode 100644 index b5ec7b43..00000000 --- a/assets/js/db8389d5.cf461329.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3154],{2958:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>d,default:()=>p,frontMatter:()=>l,metadata:()=>r,toc:()=>u});const r=JSON.parse('{"id":"getting-started/build-from-source","title":"Build From Source","description":"Setup For Contributors","source":"@site/docs/02-getting-started/02-build-from-source.mdx","sourceDirName":"02-getting-started","slug":"/getting-started/build-from-source","permalink":"/getting-started/build-from-source","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/02-getting-started/02-build-from-source.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":2,"frontMatter":{"id":"build-from-source","title":"Build From Source"},"sidebar":"tutorialSidebar","previous":{"title":"Setup","permalink":"/getting-started/setup"},"next":{"title":"Terminology","permalink":"/core-concepts/terminology"}}');var i=t(6070),s=t(5248),o=t(3505),a=t(7576);const l={id:"build-from-source",title:"Build From Source"},d=void 0,c={},u=[{value:"Setup For Contributors",id:"setup-for-contributors",level:2},{value:"Prerequisites",id:"prerequisites",level:3},{value:"Troubleshooting",id:"troubleshooting",level:3},{value:"Setup steps",id:"setup-steps",level:3},{value:"1. Clone repository from GitHub",id:"1-clone-repository-from-github",level:3},{value:"2. Position in the root of the project",id:"2-position-in-the-root-of-the-project",level:3},{value:"3. Initialize and run node",id:"3-initialize-and-run-node",level:3},{value:"1. Initialize node",id:"1-initialize-node",level:4},{value:"2. Run node",id:"2-run-node",level:4},{value:"1. First build the image",id:"1-first-build-the-image",level:4},{value:"2. Then setup and run the nodes defined in docker-compose.yml file",id:"2-then-setup-and-run-the-nodes-defined-in-docker-composeyml-file",level:4},{value:"3. Connect to the available node by listing running containers",id:"3-connect-to-the-available-node-by-listing-running-containers",level:4}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h2,{id:"setup-for-contributors",children:"Setup For Contributors"}),"\n",(0,i.jsx)(n.p,{children:"If you want to contribute to the Calimero framework or customize its\nfunctionality, you can build it from source."}),"\n",(0,i.jsx)(n.h3,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Ensure Rust is installed. If not, follow the instructions on the\n",(0,i.jsx)(n.a,{href:"https://www.rust-lang.org/tools/install",children:"Rust website"}),"."]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"troubleshooting",children:"Troubleshooting"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"If Rust dependencies fail, ensure your Rust installation is up-to-date:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"rustup update\n"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Verify that you have all required permissions to run the node."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["For further support, open an issue on\n",(0,i.jsx)(n.a,{href:"https://github.com/calimero-network/core/issues",children:"GitHub"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"setup-steps",children:"Setup steps"}),"\n",(0,i.jsx)(n.p,{children:"Setup consists of few steps and is around 9 minutes long. (mostly waiting for\nproject dependencies to download)"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsx)(n.li,{children:"Clone repository from GitHub (1min)"}),"\n",(0,i.jsx)(n.li,{children:"Position in the root of the project (< 1min)"}),"\n",(0,i.jsx)(n.li,{children:"Initialize and run node (~7 mins)"}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"1-clone-repository-from-github",children:"1. Clone repository from GitHub"}),"\n","\n",(0,i.jsxs)(o.A,{defaultValue:"ssh",values:[{label:"SSH",value:"ssh"},{label:"HTTPS",value:"https"}],children:[(0,i.jsx)(a.A,{value:"https",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:'title="Clone using HTTPS"',children:"git clone https://github.com/calimero-network/core.git\n"})})}),(0,i.jsx)(a.A,{value:"ssh",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:'title="Clone using SSH"',children:"git clone git@github.com:calimero-network/core.git\n"})})})]}),"\n",(0,i.jsx)(n.h3,{id:"2-position-in-the-root-of-the-project",children:"2. Position in the root of the project"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"cd core\n"})}),"\n",(0,i.jsx)(n.h3,{id:"3-initialize-and-run-node",children:"3. Initialize and run node"}),"\n",(0,i.jsx)(n.p,{children:"You can do it in two ways."}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Using CLI"}),"\n",(0,i.jsx)(n.li,{children:"Using Docker compose"}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"If this is your first time initializing the node, the process may take a little\nbit more time until all dependencies are downloaded. It will take around 7\nminutes but can vary depending on your internet connection."}),"\n",(0,i.jsxs)(o.A,{defaultValue:"cli",values:[{label:"CLI",value:"cli"},{label:"Docker Compose",value:"docker"}],children:[(0,i.jsxs)(a.A,{value:"cli",children:[(0,i.jsx)(n.h4,{id:"1-initialize-node",children:"1. Initialize node"}),(0,i.jsxs)(o.A,{defaultValue:"near",groupId:"protocol",values:[{label:"NEAR",value:"near"},{label:"Starknet",value:"starknet"},{label:"ICP",value:"icp"}],children:[(0,i.jsx)(a.A,{value:"near",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:" cargo run -p merod -- --node-name node1 init --server-port 2428 --swarm-port 2528\n"})})}),(0,i.jsx)(a.A,{value:"starknet",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:" cargo run -p merod -- --node-name node1 init --server-port 2428 --swarm-port 2528 --protocol starknet\n"})})}),(0,i.jsx)(a.A,{value:"icp",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:" cargo run -p merod -- --node-name node1 init --server-port 2428 --swarm-port 2528 --protocol icp\n"})})})]}),(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["A ",(0,i.jsx)(n.code,{children:"--protocol"})," flag defines protocol for the node contexts."]})}),(0,i.jsxs)(n.p,{children:["Node configuration file contains protocol defined metada. Node file is located\nunder ",(0,i.jsx)(n.code,{children:"data"})," folder."]}),(0,i.jsxs)(o.A,{defaultValue:"near",groupId:"protocol",values:[{label:"NEAR",value:"near"},{label:"Starknet",value:"starknet"},{label:"ICP",value:"icp"}],children:[(0,i.jsx)(a.A,{value:"near",children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"NearConfig",src:t(391).A+"",width:"834",height:"306"})})}),(0,i.jsx)(a.A,{value:"starknet",children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"SnConfig",src:t(2524).A+"",width:"1320",height:"310"})})}),(0,i.jsx)(a.A,{value:"icp",children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"ICPConfig",src:t(5383).A+"",width:"778",height:"316"})})})]}),(0,i.jsx)(n.h4,{id:"2-run-node",children:"2. Run node"}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"cargo run -p merod -- --node-name node1 run\n"})}),(0,i.jsx)(n.p,{children:"Wait for a few moments and node logs should appear."}),(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Node running",src:t(4481).A+"",width:"1712",height:"602"})}),(0,i.jsx)(n.p,{children:"When you see something like this that means that node is now ready for use."})]}),(0,i.jsxs)(a.A,{value:"docker",children:[(0,i.jsx)(n.h4,{id:"1-first-build-the-image",children:"1. First build the image"}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"docker buildx build -t 'merod' .\n"})}),(0,i.jsxs)(n.h4,{id:"2-then-setup-and-run-the-nodes-defined-in-docker-composeyml-file",children:["2. Then setup and run the nodes defined in ",(0,i.jsx)(n.code,{children:"docker-compose.yml"})," file"]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"docker compose up\n"})}),(0,i.jsx)(n.h4,{id:"3-connect-to-the-available-node-by-listing-running-containers",children:"3. Connect to the available node by listing running containers"}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"docker ps\n"})}),(0,i.jsx)(n.p,{children:"and then attach to the selected container"}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:'title="Node Terminal"',children:"docker attach core-app_node_run-1\n"})}),(0,i.jsx)(n.p,{children:"Wait for a few moments and node logs should appear."}),(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Node running",src:t(4481).A+"",width:"1712",height:"602"})}),(0,i.jsx)(n.p,{children:"When you see something like this that means that node is now ready for use."})]})]})]})}function p(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},7576:(e,n,t)=>{t.d(n,{A:()=>o});t(758);var r=t(3526);const i={tabItem:"tabItem_KLga"};var s=t(6070);function o(e){let{children:n,hidden:t,className:o}=e;return(0,s.jsx)("div",{role:"tabpanel",className:(0,r.A)(i.tabItem,o),hidden:t,children:n})}},3505:(e,n,t)=>{t.d(n,{A:()=>w});var r=t(758),i=t(3526),s=t(8155),o=t(5557),a=t(5536),l=t(7852),d=t(1381),c=t(4012);function u(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:t}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return u(e).map((e=>{let{props:{value:n,label:t,attributes:r,default:i}}=e;return{value:n,label:t,attributes:r,default:i}}))}(t);return function(e){const n=(0,d.XI)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function p(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function m(e){let{queryString:n=!1,groupId:t}=e;const i=(0,o.W6)(),s=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,l.aZ)(s),(0,r.useCallback)((e=>{if(!s)return;const n=new URLSearchParams(i.location.search);n.set(s,e),i.replace({...i.location,search:n.toString()})}),[s,i])]}function g(e){const{defaultValue:n,queryString:t=!1,groupId:i}=e,s=h(e),[o,l]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=t.find((e=>e.default))??t[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:s}))),[d,u]=m({queryString:t,groupId:i}),[g,f]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[i,s]=(0,c.Dv)(t);return[i,(0,r.useCallback)((e=>{t&&s.set(e)}),[t,s])]}({groupId:i}),b=(()=>{const e=d??g;return p({value:e,tabValues:s})?e:null})();(0,a.A)((()=>{b&&l(b)}),[b]);return{selectedValue:o,selectValue:(0,r.useCallback)((e=>{if(!p({value:e,tabValues:s}))throw new Error(`Can't select invalid tab value=${e}`);l(e),u(e),f(e)}),[u,f,s]),tabValues:s}}var f=t(2236);const b={tabList:"tabList_B3_y",tabItem:"tabItem_z210"};var x=t(6070);function j(e){let{className:n,block:t,selectedValue:r,selectValue:o,tabValues:a}=e;const l=[],{blockElementScrollPositionUntilNextRender:d}=(0,s.a_)(),c=e=>{const n=e.currentTarget,t=l.indexOf(n),i=a[t].value;i!==r&&(d(n),o(i))},u=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const t=l.indexOf(e.currentTarget)+1;n=l[t]??l[0];break}case"ArrowLeft":{const t=l.indexOf(e.currentTarget)-1;n=l[t]??l[l.length-1];break}}n?.focus()};return(0,x.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,i.A)("tabs",{"tabs--block":t},n),children:a.map((e=>{let{value:n,label:t,attributes:s}=e;return(0,x.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>l.push(e),onKeyDown:u,onClick:c,...s,className:(0,i.A)("tabs__item",b.tabItem,s?.className,{"tabs__item--active":r===n}),children:t??n},n)}))})}function v(e){let{lazy:n,children:t,selectedValue:s}=e;const o=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=o.find((e=>e.props.value===s));return e?(0,r.cloneElement)(e,{className:(0,i.A)("margin-top--md",e.props.className)}):null}return(0,x.jsx)("div",{className:"margin-top--md",children:o.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==s})))})}function y(e){const n=g(e);return(0,x.jsxs)("div",{className:(0,i.A)("tabs-container",b.tabList),children:[(0,x.jsx)(j,{...n,...e}),(0,x.jsx)(v,{...n,...e})]})}function w(e){const n=(0,f.A)();return(0,x.jsx)(y,{...e,children:u(e.children)},String(n))}},5383:(e,n,t)=>{t.d(n,{A:()=>r});const r=t.p+"assets/images/icp-config-ceda025dead6d3c8de0513840466dd31.png"},391:(e,n,t)=>{t.d(n,{A:()=>r});const r=t.p+"assets/images/near-config-7f7de7e5e857b8d6dca8bda6b8a39f0d.png"},2524:(e,n,t)=>{t.d(n,{A:()=>r});const r=t.p+"assets/images/sn-config-a1900f2dc94f3dcd2cd7204c62421de2.png"},4481:(e,n,t)=>{t.d(n,{A:()=>r});const r=t.p+"assets/images/node-running-50b1a27fb9d7f62407382281da4692ab.png"},5248:(e,n,t)=>{t.d(n,{R:()=>o,x:()=>a});var r=t(758);const i={},s=r.createContext(i);function o(e){const n=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),r.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/db8389d5.d58a08db.js b/assets/js/db8389d5.d58a08db.js new file mode 100644 index 00000000..dcc709a9 --- /dev/null +++ b/assets/js/db8389d5.d58a08db.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3154,5512],{2958:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>u,contentTitle:()=>c,default:()=>m,frontMatter:()=>d,metadata:()=>r,toc:()=>h});const r=JSON.parse('{"id":"getting-started/build-from-source","title":"Build From Source","description":"Setup For Contributors","source":"@site/docs/02-getting-started/02-build-from-source.mdx","sourceDirName":"02-getting-started","slug":"/getting-started/build-from-source","permalink":"/getting-started/build-from-source","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/02-getting-started/02-build-from-source.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":2,"frontMatter":{"id":"build-from-source","title":"Build From Source"},"sidebar":"tutorialSidebar","previous":{"title":"Setup","permalink":"/getting-started/setup"},"next":{"title":"Terminology","permalink":"/core-concepts/terminology"}}');var i=t(6070),s=t(5248),o=t(7133),a=t(3505),l=t(7576);const d={id:"build-from-source",title:"Build From Source"},c=void 0,u={},h=[{value:"Setup For Contributors",id:"setup-for-contributors",level:2},{value:"Prerequisites",id:"prerequisites",level:3},{value:"Troubleshooting",id:"troubleshooting",level:3},{value:"Setup steps",id:"setup-steps",level:3},{value:"1. Clone repository from GitHub",id:"1-clone-repository-from-github",level:3},{value:"2. Position in the root of the project",id:"2-position-in-the-root-of-the-project",level:3},{value:"3. Initialize and run node",id:"3-initialize-and-run-node",level:3},{value:"1. Initialize node",id:"1-initialize-node",level:4},...o.toc,{value:"2. Run node",id:"2-run-node",level:4},{value:"1. First build the image",id:"1-first-build-the-image",level:4},{value:"2. Then setup and run the nodes defined in docker-compose.yml file",id:"2-then-setup-and-run-the-nodes-defined-in-docker-composeyml-file",level:4},{value:"3. Connect to the available node by listing running containers",id:"3-connect-to-the-available-node-by-listing-running-containers",level:4}];function p(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",h4:"h4",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h2,{id:"setup-for-contributors",children:"Setup For Contributors"}),"\n",(0,i.jsx)(n.p,{children:"If you want to contribute to the Calimero framework or customize its\nfunctionality, you can build it from source."}),"\n",(0,i.jsx)(n.h3,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Ensure Rust is installed. If not, follow the instructions on the\n",(0,i.jsx)(n.a,{href:"https://www.rust-lang.org/tools/install",children:"Rust website"}),"."]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"troubleshooting",children:"Troubleshooting"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"If Rust dependencies fail, ensure your Rust installation is up-to-date:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"rustup update\n"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Verify that you have all required permissions to run the node."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["For further support, open an issue on\n",(0,i.jsx)(n.a,{href:"https://github.com/calimero-network/core/issues",children:"GitHub"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"setup-steps",children:"Setup steps"}),"\n",(0,i.jsx)(n.p,{children:"Setup consists of few steps and is around 9 minutes long. (mostly waiting for\nproject dependencies to download)"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsx)(n.li,{children:"Clone repository from GitHub (1min)"}),"\n",(0,i.jsx)(n.li,{children:"Position in the root of the project (< 1min)"}),"\n",(0,i.jsx)(n.li,{children:"Initialize and run node (~7 mins)"}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"1-clone-repository-from-github",children:"1. Clone repository from GitHub"}),"\n","\n",(0,i.jsxs)(a.A,{defaultValue:"ssh",values:[{label:"SSH",value:"ssh"},{label:"HTTPS",value:"https"}],children:[(0,i.jsx)(l.A,{value:"https",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:'title="Clone using HTTPS"',children:"git clone https://github.com/calimero-network/core.git\n"})})}),(0,i.jsx)(l.A,{value:"ssh",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:'title="Clone using SSH"',children:"git clone git@github.com:calimero-network/core.git\n"})})})]}),"\n",(0,i.jsx)(n.h3,{id:"2-position-in-the-root-of-the-project",children:"2. Position in the root of the project"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"cd core\n"})}),"\n",(0,i.jsx)(n.h3,{id:"3-initialize-and-run-node",children:"3. Initialize and run node"}),"\n",(0,i.jsx)(n.p,{children:"You can do it in two ways."}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Using CLI"}),"\n",(0,i.jsx)(n.li,{children:"Using Docker compose"}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"If this is your first time initializing the node, the process may take a little\nbit more time until all dependencies are downloaded. It will take around 7\nminutes but can vary depending on your internet connection."}),"\n",(0,i.jsxs)(a.A,{defaultValue:"cli",values:[{label:"CLI",value:"cli"},{label:"Docker Compose",value:"docker"}],children:[(0,i.jsxs)(l.A,{value:"cli",children:[(0,i.jsx)(n.h4,{id:"1-initialize-node",children:"1. Initialize node"}),(0,i.jsx)(o.default,{}),(0,i.jsx)(n.h4,{id:"2-run-node",children:"2. Run node"}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"cargo run -p merod -- --node-name node1 run\n"})}),(0,i.jsx)(n.p,{children:"Wait for a few moments and node logs should appear."}),(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Node running",src:t(4481).A+"",width:"1712",height:"602"})}),(0,i.jsx)(n.p,{children:"When you see something like this that means that node is now ready for use."})]}),(0,i.jsxs)(l.A,{value:"docker",children:[(0,i.jsx)(n.h4,{id:"1-first-build-the-image",children:"1. First build the image"}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"docker buildx build -t 'merod' .\n"})}),(0,i.jsxs)(n.h4,{id:"2-then-setup-and-run-the-nodes-defined-in-docker-composeyml-file",children:["2. Then setup and run the nodes defined in ",(0,i.jsx)(n.code,{children:"docker-compose.yml"})," file"]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"docker compose up\n"})}),(0,i.jsx)(n.h4,{id:"3-connect-to-the-available-node-by-listing-running-containers",children:"3. Connect to the available node by listing running containers"}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:'title="Terminal"',children:"docker ps\n"})}),(0,i.jsx)(n.p,{children:"and then attach to the selected container"}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:'title="Node Terminal"',children:"docker attach core-app_node_run-1\n"})}),(0,i.jsx)(n.p,{children:"Wait for a few moments and node logs should appear."}),(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Node running",src:t(4481).A+"",width:"1712",height:"602"})}),(0,i.jsx)(n.p,{children:"When you see something like this that means that node is now ready for use."})]})]})]})}function m(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(p,{...e})}):p(e)}},7133:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>d,default:()=>p,frontMatter:()=>l,metadata:()=>r,toc:()=>u});const r=JSON.parse('{"id":"shared/node-init-source","title":"node-init-source","description":"{t.d(n,{A:()=>o});t(758);var r=t(3526);const i={tabItem:"tabItem_KLga"};var s=t(6070);function o(e){let{children:n,hidden:t,className:o}=e;return(0,s.jsx)("div",{role:"tabpanel",className:(0,r.A)(i.tabItem,o),hidden:t,children:n})}},3505:(e,n,t)=>{t.d(n,{A:()=>w});var r=t(758),i=t(3526),s=t(8155),o=t(5557),a=t(5536),l=t(7852),d=t(1381),c=t(4012);function u(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:t}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return u(e).map((e=>{let{props:{value:n,label:t,attributes:r,default:i}}=e;return{value:n,label:t,attributes:r,default:i}}))}(t);return function(e){const n=(0,d.XI)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function p(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function m(e){let{queryString:n=!1,groupId:t}=e;const i=(0,o.W6)(),s=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,l.aZ)(s),(0,r.useCallback)((e=>{if(!s)return;const n=new URLSearchParams(i.location.search);n.set(s,e),i.replace({...i.location,search:n.toString()})}),[s,i])]}function g(e){const{defaultValue:n,queryString:t=!1,groupId:i}=e,s=h(e),[o,l]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=t.find((e=>e.default))??t[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:s}))),[d,u]=m({queryString:t,groupId:i}),[g,f]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[i,s]=(0,c.Dv)(t);return[i,(0,r.useCallback)((e=>{t&&s.set(e)}),[t,s])]}({groupId:i}),b=(()=>{const e=d??g;return p({value:e,tabValues:s})?e:null})();(0,a.A)((()=>{b&&l(b)}),[b]);return{selectedValue:o,selectValue:(0,r.useCallback)((e=>{if(!p({value:e,tabValues:s}))throw new Error(`Can't select invalid tab value=${e}`);l(e),u(e),f(e)}),[u,f,s]),tabValues:s}}var f=t(2236);const b={tabList:"tabList_B3_y",tabItem:"tabItem_z210"};var x=t(6070);function j(e){let{className:n,block:t,selectedValue:r,selectValue:o,tabValues:a}=e;const l=[],{blockElementScrollPositionUntilNextRender:d}=(0,s.a_)(),c=e=>{const n=e.currentTarget,t=l.indexOf(n),i=a[t].value;i!==r&&(d(n),o(i))},u=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const t=l.indexOf(e.currentTarget)+1;n=l[t]??l[0];break}case"ArrowLeft":{const t=l.indexOf(e.currentTarget)-1;n=l[t]??l[l.length-1];break}}n?.focus()};return(0,x.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,i.A)("tabs",{"tabs--block":t},n),children:a.map((e=>{let{value:n,label:t,attributes:s}=e;return(0,x.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>l.push(e),onKeyDown:u,onClick:c,...s,className:(0,i.A)("tabs__item",b.tabItem,s?.className,{"tabs__item--active":r===n}),children:t??n},n)}))})}function v(e){let{lazy:n,children:t,selectedValue:s}=e;const o=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=o.find((e=>e.props.value===s));return e?(0,r.cloneElement)(e,{className:(0,i.A)("margin-top--md",e.props.className)}):null}return(0,x.jsx)("div",{className:"margin-top--md",children:o.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==s})))})}function y(e){const n=g(e);return(0,x.jsxs)("div",{className:(0,i.A)("tabs-container",b.tabList),children:[(0,x.jsx)(j,{...n,...e}),(0,x.jsx)(v,{...n,...e})]})}function w(e){const n=(0,f.A)();return(0,x.jsx)(y,{...e,children:u(e.children)},String(n))}},5383:(e,n,t)=>{t.d(n,{A:()=>r});const r=t.p+"assets/images/icp-config-ceda025dead6d3c8de0513840466dd31.png"},391:(e,n,t)=>{t.d(n,{A:()=>r});const r=t.p+"assets/images/near-config-7f7de7e5e857b8d6dca8bda6b8a39f0d.png"},2524:(e,n,t)=>{t.d(n,{A:()=>r});const r=t.p+"assets/images/sn-config-a1900f2dc94f3dcd2cd7204c62421de2.png"},4481:(e,n,t)=>{t.d(n,{A:()=>r});const r=t.p+"assets/images/node-running-50b1a27fb9d7f62407382281da4692ab.png"},5248:(e,n,t)=>{t.d(n,{R:()=>o,x:()=>a});var r=t(758);const i={},s=r.createContext(i);function o(e){const n=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),r.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/e4da674c.4abee3d2.js b/assets/js/e4da674c.70cf11ad.js similarity index 99% rename from assets/js/e4da674c.4abee3d2.js rename to assets/js/e4da674c.70cf11ad.js index 6f67ca03..da4b08d1 100644 --- a/assets/js/e4da674c.4abee3d2.js +++ b/assets/js/e4da674c.70cf11ad.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6567],{9246:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>i,toc:()=>d});const i=JSON.parse('{"id":"developer-tools/apps/admin-dashboard","title":"Admin Dashboard","description":"Node is gated with authentication. In order to interact with the node from any","source":"@site/docs/05-developer-tools/03-apps/05-admin-dashboard.mdx","sourceDirName":"05-developer-tools/03-apps","slug":"/developer-tools/apps/admin-dashboard","permalink":"/developer-tools/apps/admin-dashboard","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/05-developer-tools/03-apps/05-admin-dashboard.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":5,"frontMatter":{"id":"admin-dashboard","title":"Admin Dashboard"},"sidebar":"tutorialSidebar","previous":{"title":"TypeScript Client SDK","permalink":"/developer-tools/SDK/client-sdk/client-ts-sdk"},"next":{"title":"Desktop App","permalink":"/developer-tools/apps/desktop-app"}}');var s=t(6070),a=t(5248);const l={id:"admin-dashboard",title:"Admin Dashboard"},o=void 0,c={},d=[{value:"Access Admin Dashboard",id:"access-admin-dashboard",level:3},{value:"Setup",id:"setup",level:3},{value:"Login",id:"login",level:3},{value:"Add new root key",id:"add-new-root-key",level:3},{value:"Applications",id:"applications",level:3},{value:"Publish new application",id:"publish-new-application",level:4},{value:"Install available application",id:"install-available-application",level:4},{value:"Context",id:"context",level:3},{value:"Start new context",id:"start-new-context",level:4},{value:"Export",id:"export",level:3}];function r(e){const n={a:"a",blockquote:"blockquote",code:"code",em:"em",h3:"h3",h4:"h4",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,a.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:"Node is gated with authentication. In order to interact with the node from any\napp, you need to register a decentralized identity. We have build an Admin\nDashboard which is a web application designed to streamline the management of\nnode states within your system. Connected with the API provided by the Admin\nClient API, this user interface offers a user-friendly platform for overseeing\nand controlling various aspects of your node infrastructure."}),"\n",(0,s.jsx)(n.h3,{id:"access-admin-dashboard",children:"Access Admin Dashboard"}),"\n",(0,s.jsx)(n.p,{children:"The node operates as a server for the Admin Dashboard and can be accessed\ndirectly through a web browser."}),"\n",(0,s.jsxs)(n.p,{children:["The Admin Dashboard is locally available at\n",(0,s.jsx)(n.code,{children:"http://localhost:NODE_PORT/admin-dashboard/"})," but you can also use application\ndeployed on Github Pages at\n",(0,s.jsx)(n.code,{children:"https://calimero-network.github.io/admin-dashboard/"}),"."]}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:(0,s.jsx)(n.em,{children:"NOTE:"})})," Update ",(0,s.jsx)(n.code,{children:"NODE_PORT"})," in the placeholder ",(0,s.jsx)(n.code,{children:"http://localhost:NODE_PORT"}),"\nwith the ",(0,s.jsx)(n.code,{children:"--server-port"})," value defined during node setup in\n",(0,s.jsx)(n.a,{href:"../../getting-started/setup",children:"Getting-started"})]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"setup",children:"Setup"}),"\n",(0,s.jsx)(n.p,{children:"After the initial setup you will see the setup page where you need to enter node\nURL."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"SetupPage",src:t(2091).A+"",width:"1249",height:"795"})}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"NOTE"}),": Error occurs if the entered URL is not valid node url or the node is\nnot running"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"SetupPageError",src:t(9449).A+"",width:"1322",height:"799"})}),"\n",(0,s.jsx)(n.h3,{id:"login",children:"Login"}),"\n",(0,s.jsx)(n.p,{children:'After button "Set node url" is clicked you will be redirected to select wallet\npage.'}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"WalletSelector",src:t(4660).A+"",width:"1247",height:"796"})}),"\n",(0,s.jsx)(n.p,{children:"In this example we will be using Metamask with Ethereum Mainnet."}),"\n",(0,s.jsx)(n.p,{children:'Press "Connect wallet" button to invoke Metamask extension which is needed to\ncontinue login process.'}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"ConnectWallet",src:t(1053).A+"",width:"1229",height:"764"})}),"\n",(0,s.jsx)(n.p,{children:"When wallet is connected you will be shown the next screen with displayed\nconnected wallet address."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"ConnectedAccount",src:t(810).A+"",width:"1249",height:"795"})}),"\n",(0,s.jsx)(n.p,{children:'To finish login process press "Sign authentication transaction" which will\nenvoke Metamask to sign transaction.'}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"SignLoginTxn",src:t(9032).A+"",width:"358",height:"619"})}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"NOTE"}),': Displayed "BNB 2" text is just a wallet name and this is configued\nin Metamask. You might have default wallet name "Account" or "Account 1"']}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"On the first login, your selected wallet will be used as a root key to use\nfurther functionalities."}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"NOTE"}),": If you logout and try to login with different wallet that is not the\nroot key you will get the next error"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"SinginError",src:t(2617).A+"",width:"449",height:"566"})}),"\n",(0,s.jsx)(n.p,{children:"After this request is confimed you will be redirected to the Identity page of\nthe Admin Dashboard where you can see your root key."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"IdentityPage",src:t(8214).A+"",width:"1249",height:"796"})}),"\n",(0,s.jsx)(n.h3,{id:"add-new-root-key",children:"Add new root key"}),"\n",(0,s.jsx)(n.p,{children:'To add new root key press the "Add new root key" button and you will go through\nthe same process.'}),"\n",(0,s.jsx)(n.p,{children:"In this example we will be using Metamask again but this time we will use BNB\nChain network with different wallet."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"AddNewRootKey",src:t(2109).A+"",width:"1247",height:"797"})}),"\n",(0,s.jsx)(n.p,{children:"Again, sign the transaction."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"ConfirmNewRootKey",src:t(7002).A+"",width:"363",height:"619"})}),"\n",(0,s.jsx)(n.p,{children:"You will be redirected back the Identity page and in the list you can see that\nthe new root key with BNB network was added."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"NewRootkeyList",src:t(5791).A+"",width:"1252",height:"799"})}),"\n",(0,s.jsx)(n.h3,{id:"applications",children:"Applications"}),"\n",(0,s.jsx)(n.p,{children:'Navigate to "Applications" tab to view table of available, owned or installed\napplications.'}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Applications",src:t(3040).A+"",width:"1248",height:"796"})}),"\n",(0,s.jsx)(n.h4,{id:"publish-new-application",children:"Publish new application"}),"\n",(0,s.jsx)(n.p,{children:'To publish new application click on the "Publish new application" button and you\nwill be redirected to next page.'}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"NOTE"}),": For this step you will need a NEAR blockchain account because the\nPackage Manager application is a smart contract deployed on the NEAR\nblockchain."]}),"\n"]}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:"This is needed because from your account you interact with the smart contract\ndeployed on the NEAR blockchain"}),"\n"]}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsxs)(n.p,{children:["You can create NEAR blockchain account with\n",(0,s.jsx)(n.a,{href:"https://testnet.mynearwallet.com/",children:"MyNEARWallet"})]}),"\n"]}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:"Package Manager contains metadata of applications used by the node"}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"Metadata for each application contains:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Package name ",(0,s.jsx)(n.code,{children:"String"})]}),"\n",(0,s.jsxs)(n.li,{children:["Description ",(0,s.jsx)(n.code,{children:"String"}),' - optional and can be set to "-"']}),"\n",(0,s.jsxs)(n.li,{children:["Repository URL ",(0,s.jsx)(n.code,{children:"String"}),' - optional and can be set to "-"']}),"\n",(0,s.jsxs)(n.li,{children:["Path ",(0,s.jsx)(n.code,{children:"String"})," - IPFS URL to the application binary, filled automatically when\napplication wasm is uploaded"]}),"\n",(0,s.jsxs)(n.li,{children:["Version ",(0,s.jsx)(n.code,{children:"String"}),' - has "X.X.X" format (e.g. 0.0.1 or 1.0.0)']}),"\n",(0,s.jsxs)(n.li,{children:["Noted ",(0,s.jsx)(n.code,{children:"String"}),' - optional and can be set to "-"']}),"\n",(0,s.jsxs)(n.li,{children:["Hash ",(0,s.jsx)(n.code,{children:"String"})," - Hash value of application wasm, filled automatically when\napplication wasm is uploaded"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"PublishApp",src:t(280).A+"",width:"1244",height:"798"})}),"\n",(0,s.jsxs)(n.p,{children:['After you fill in the Package name, Description, Repository URL click on the\n"Upload wasm" button and select your application ',(0,s.jsx)(n.code,{children:".wasm"})," file (e.g. only-peers\napplication wasm)."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"SelectWasmFile",src:t(3227).A+"",width:"810",height:"451"})}),"\n",(0,s.jsx)(n.p,{children:"After file was uploaded to IPFS, Path and Hash field will be filled\nautomatically and only thing left is to fill in version and notes."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"UploadedWasm",src:t(1078).A+"",width:"898",height:"555"})}),"\n",(0,s.jsx)(n.p,{children:'After you click the "Publish" button, application will be published in the\nPackage Manager contract and it will be available in the available applications\nlist.'}),"\n",(0,s.jsx)(n.p,{children:"You will get a status popup message."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"ApplicationPublished",src:t(9909).A+"",width:"497",height:"171"})}),"\n",(0,s.jsx)(n.h4,{id:"install-available-application",children:"Install available application"}),"\n",(0,s.jsx)(n.p,{children:'To install one of the available application from the Package Manager click on\nthe "install new application" button.'}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Applications",src:t(3040).A+"",width:"1248",height:"796"})}),"\n",(0,s.jsx)(n.p,{children:"You will be redirected to install page where you can browse available\napplications or upload a new one."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"InstallApplication",src:t(7835).A+"",width:"1248",height:"797"})}),"\n",(0,s.jsx)(n.p,{children:'On "Browse" button click you will get a available application list where you can\nselect application you want to install.'}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"BrowseApplications",src:t(9813).A+"",width:"1145",height:"273"})}),"\n",(0,s.jsx)(n.p,{children:'On selection the application Metadata will be displayed and you can press\n"install application" button to install the application.'}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"BrowseApplications",src:t(7340).A+"",width:"1247",height:"800"})}),"\n",(0,s.jsx)(n.p,{children:"On sucessfull installation you will get status popup."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"ApplicationInstalled",src:t(4842).A+"",width:"535",height:"200"})}),"\n",(0,s.jsx)(n.h3,{id:"context",children:"Context"}),"\n",(0,s.jsx)(n.p,{children:"Preview context which you have already joined or invited. You can also create a\nnew context."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"ContextList",src:t(2061).A+"",width:"1246",height:"796"})}),"\n",(0,s.jsx)(n.h4,{id:"start-new-context",children:"Start new context"}),"\n",(0,s.jsx)(n.p,{children:'To start new context press the "Start new context" button on previous page.'}),"\n",(0,s.jsx)(n.p,{children:"You can select application with which you want to create a new context or you\ncan upload a new application."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"StartContextSelect",src:t(77).A+"",width:"1320",height:"796"})}),"\n",(0,s.jsx)(n.p,{children:"If your application requires initialization parameters, you can select the\n'Initialize application state' option during startup."}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"NOTE"}),": To understand this lets take two examples."]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["Consider a JavaScript class MyClass. In some cases, you can create an\ninstance using ",(0,s.jsx)(n.code,{children:"new MyClass()"})," if there are no initialization parameters\nrequired."]}),"\n",(0,s.jsxs)(n.li,{children:["However, if your class requires specific parameters for initialization, you\nneed to pass them like this: ",(0,s.jsx)(n.code,{children:"new MyClass({ application_name: name })"}),".\nThis is similar to your WASM application's requirement for initialization\nparameters during its startup process."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"StartContextSelected",src:t(3978).A+"",width:"1247",height:"795"})}),"\n",(0,s.jsx)(n.p,{children:'On button "Start" click the new context will be created and you will get status\npopup.'}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Context installed",src:t(463).A+"",width:"529",height:"193"})}),"\n",(0,s.jsx)(n.p,{children:"You can now see created context in the context list."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"ContextListInstalled",src:t(162).A+"",width:"1247",height:"799"})}),"\n",(0,s.jsx)(n.h3,{id:"export",children:"Export"}),"\n",(0,s.jsx)(n.p,{children:"Allows you to export you identity on current device and import it on new device."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"ContextList",src:t(3576).A+"",width:"1248",height:"798"})})]})}function h(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(r,{...e})}):r(e)}},5791:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/10new-root-key-added-24f3a7b3c573e4a599ddc8cd970cf30f.png"},3040:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/12applications-21abaddc8de1479b7716aa22b142bf0c.png"},1078:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/13filled-in-fields-ec772e882d2ce524f7e65ae5edf95bdd.png"},9909:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/13published-application-1ee6b729e2c7255e5965e794b1c06e62.png"},3227:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/13select-wasm-c1584e741991c4251c473a1fdf66e327.png"},280:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/13upload-new-app-58a2ecd6e94bd3e666f7586abab475e1.png"},9813:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/14browse-applications-9e98f5d045104d38a97f101006256b99.png"},7835:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/14install-application-c094be7b6bc7f90fcd68e5de3463f435.png"},7340:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/15install-application-0470cad323295a3ab65167fa2017b53a.png"},4842:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/16application-installed-71d5b558454fb9816080c3b90e99bb05.png"},2061:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/18context-list-a18cb6d8b9ebd28d97c2abceff78154e.png"},77:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/19start-context-select-8ec58995af1ea93efff0d362d7738d21.png"},2091:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/1setup-node-url-34001124f987a1c89da445494deebd5c.png"},3978:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/20start-context-selected-5cdfc911bf581c37e518bc343313afb5.png"},463:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/21context-installed-c9464712c8452e13cf9c86df947f8f51.png"},162:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/22context-list-d7aa2127df8a5a9735c4d3bcd4f76fd1.png"},3576:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/23export-identity-083848da6a7637e79b071b96b44ffd94.png"},4660:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/2select-wallet-96c27afc6607a800a4f698f7459375ac.png"},1053:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/3connect-wallet-9585c0e9ce96b9b33dc28e8a5b0b3d30.png"},810:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/4logged-in-acc-c3f51404ab55814bf7844bd973e1d5e7.png"},9032:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/5metamask-sign-msg-login-e744d32c007f9b1a9d10931c8401a2cd.png"},8214:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/6identity-29a8f560fe919c7ee606a2beed7e9eaf.png"},2617:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/7no-root-key-login-e16c042f69f6d6036b24116265658a25.png"},2109:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/8add-new-root-key-e37682ad9c32dfcfdb603e5727473e01.png"},7002:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/9add-root-key-txn-a4c5c13a38da00dd3f75d7a1ba68e499.png"},9449:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/setup-node-url-error-2509e61875b603d7860680da8a3453fd.png"},5248:(e,n,t)=>{t.d(n,{R:()=>l,x:()=>o});var i=t(758);const s={},a=i.createContext(s);function l(e){const n=i.useContext(a);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:l(e.components),i.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6567],{9246:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>i,toc:()=>d});const i=JSON.parse('{"id":"developer-tools/apps/admin-dashboard","title":"Admin Dashboard","description":"Node is gated with authentication. In order to interact with the node from any","source":"@site/docs/05-developer-tools/03-apps/05-admin-dashboard.mdx","sourceDirName":"05-developer-tools/03-apps","slug":"/developer-tools/apps/admin-dashboard","permalink":"/developer-tools/apps/admin-dashboard","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/05-developer-tools/03-apps/05-admin-dashboard.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":5,"frontMatter":{"id":"admin-dashboard","title":"Admin Dashboard"},"sidebar":"tutorialSidebar","previous":{"title":"TypeScript Client SDK","permalink":"/developer-tools/SDK/client-sdk/client-ts-sdk"},"next":{"title":"Desktop App","permalink":"/developer-tools/apps/desktop-app"}}');var s=t(6070),a=t(5248);const l={id:"admin-dashboard",title:"Admin Dashboard"},o=void 0,c={},d=[{value:"Access Admin Dashboard",id:"access-admin-dashboard",level:3},{value:"Setup",id:"setup",level:3},{value:"Login",id:"login",level:3},{value:"Add new root key",id:"add-new-root-key",level:3},{value:"Applications",id:"applications",level:3},{value:"Publish new application",id:"publish-new-application",level:4},{value:"Install available application",id:"install-available-application",level:4},{value:"Context",id:"context",level:3},{value:"Start new context",id:"start-new-context",level:4},{value:"Export",id:"export",level:3}];function r(e){const n={a:"a",blockquote:"blockquote",code:"code",em:"em",h3:"h3",h4:"h4",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,a.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:"Node is gated with authentication. In order to interact with the node from any\napp, you need to register a decentralized identity. We have build an Admin\nDashboard which is a web application designed to streamline the management of\nnode states within your system. Connected with the API provided by the Admin\nClient API, this user interface offers a user-friendly platform for overseeing\nand controlling various aspects of your node infrastructure."}),"\n",(0,s.jsx)(n.h3,{id:"access-admin-dashboard",children:"Access Admin Dashboard"}),"\n",(0,s.jsx)(n.p,{children:"The node operates as a server for the Admin Dashboard and can be accessed\ndirectly through a web browser."}),"\n",(0,s.jsxs)(n.p,{children:["The Admin Dashboard is locally available at\n",(0,s.jsx)(n.code,{children:"http://localhost:NODE_PORT/admin-dashboard/"})," but you can also use application\ndeployed on Github Pages at\n",(0,s.jsx)(n.code,{children:"https://calimero-network.github.io/admin-dashboard/"}),"."]}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:(0,s.jsx)(n.em,{children:"NOTE:"})})," Update ",(0,s.jsx)(n.code,{children:"NODE_PORT"})," in the placeholder ",(0,s.jsx)(n.code,{children:"http://localhost:NODE_PORT"}),"\nwith the ",(0,s.jsx)(n.code,{children:"--server-port"})," value defined during node setup in\n",(0,s.jsx)(n.a,{href:"../../getting-started/setup",children:"Getting-started"})]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"setup",children:"Setup"}),"\n",(0,s.jsx)(n.p,{children:"After the initial setup you will see the setup page where you need to enter node\nURL."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"SetupPage",src:t(2091).A+"",width:"1249",height:"795"})}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"NOTE"}),": Error occurs if the entered URL is not valid node url or the node is\nnot running"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"SetupPageError",src:t(9449).A+"",width:"1322",height:"799"})}),"\n",(0,s.jsx)(n.h3,{id:"login",children:"Login"}),"\n",(0,s.jsx)(n.p,{children:'After button "Set node url" is clicked you will be redirected to select wallet\npage.'}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"WalletSelector",src:t(4660).A+"",width:"1247",height:"796"})}),"\n",(0,s.jsx)(n.p,{children:"In this example we will be using Metamask with Ethereum Mainnet."}),"\n",(0,s.jsx)(n.p,{children:'Press "Connect wallet" button to invoke Metamask extension which is needed to\ncontinue login process.'}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"ConnectWallet",src:t(1053).A+"",width:"1229",height:"764"})}),"\n",(0,s.jsx)(n.p,{children:"When wallet is connected you will be shown the next screen with displayed\nconnected wallet address."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"ConnectedAccount",src:t(810).A+"",width:"1249",height:"795"})}),"\n",(0,s.jsx)(n.p,{children:'To finish login process press "Sign authentication transaction" which will\nenvoke Metamask to sign transaction.'}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"SignLoginTxn",src:t(9032).A+"",width:"358",height:"619"})}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"NOTE"}),': Displayed "BNB 2" text is just a wallet name and this is configued\nin Metamask. You might have default wallet name "Account" or "Account 1"']}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"On the first login, your selected wallet will be used as a root key to use\nfurther functionalities."}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"NOTE"}),": If you logout and try to login with different wallet that is not the\nroot key you will get the next error"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"SinginError",src:t(2617).A+"",width:"449",height:"566"})}),"\n",(0,s.jsx)(n.p,{children:"After this request is confimed you will be redirected to the Identity page of\nthe Admin Dashboard where you can see your root key."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"IdentityPage",src:t(8214).A+"",width:"1249",height:"796"})}),"\n",(0,s.jsx)(n.h3,{id:"add-new-root-key",children:"Add new root key"}),"\n",(0,s.jsx)(n.p,{children:'To add new root key press the "Add new root key" button and you will go through\nthe same process.'}),"\n",(0,s.jsx)(n.p,{children:"In this example we will be using Metamask again but this time we will use BNB\nChain network with different wallet."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"AddNewRootKey",src:t(2109).A+"",width:"1247",height:"797"})}),"\n",(0,s.jsx)(n.p,{children:"Again, sign the transaction."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"ConfirmNewRootKey",src:t(7002).A+"",width:"363",height:"619"})}),"\n",(0,s.jsx)(n.p,{children:"You will be redirected back the Identity page and in the list you can see that\nthe new root key with BNB network was added."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"NewRootkeyList",src:t(5791).A+"",width:"1252",height:"799"})}),"\n",(0,s.jsx)(n.h3,{id:"applications",children:"Applications"}),"\n",(0,s.jsx)(n.p,{children:'Navigate to "Applications" tab to view table of available, owned or installed\napplications.'}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Applications",src:t(3040).A+"",width:"1248",height:"796"})}),"\n",(0,s.jsx)(n.h4,{id:"publish-new-application",children:"Publish new application"}),"\n",(0,s.jsx)(n.p,{children:'To publish new application click on the "Publish new application" button and you\nwill be redirected to next page.'}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"NOTE"}),": For this step you will need a NEAR blockchain account because the\nPackage Manager application is a smart contract deployed on the NEAR\nblockchain."]}),"\n"]}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:"This is needed because from your account you interact with the smart contract\ndeployed on the NEAR blockchain"}),"\n"]}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsxs)(n.p,{children:["You can create NEAR blockchain account with\n",(0,s.jsx)(n.a,{href:"https://testnet.mynearwallet.com/",children:"MyNEARWallet"})]}),"\n"]}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:"Package Manager contains metadata of applications used by the node"}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"Metadata for each application contains:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Package name ",(0,s.jsx)(n.code,{children:"String"})]}),"\n",(0,s.jsxs)(n.li,{children:["Description ",(0,s.jsx)(n.code,{children:"String"}),' - optional and can be set to "-"']}),"\n",(0,s.jsxs)(n.li,{children:["Repository URL ",(0,s.jsx)(n.code,{children:"String"}),' - optional and can be set to "-"']}),"\n",(0,s.jsxs)(n.li,{children:["Path ",(0,s.jsx)(n.code,{children:"String"})," - IPFS URL to the application binary, filled automatically when\napplication wasm is uploaded"]}),"\n",(0,s.jsxs)(n.li,{children:["Version ",(0,s.jsx)(n.code,{children:"String"}),' - has "X.X.X" format (e.g. 0.0.1 or 1.0.0)']}),"\n",(0,s.jsxs)(n.li,{children:["Noted ",(0,s.jsx)(n.code,{children:"String"}),' - optional and can be set to "-"']}),"\n",(0,s.jsxs)(n.li,{children:["Hash ",(0,s.jsx)(n.code,{children:"String"})," - Hash value of application wasm, filled automatically when\napplication wasm is uploaded"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"PublishApp",src:t(280).A+"",width:"1244",height:"798"})}),"\n",(0,s.jsxs)(n.p,{children:['After you fill in the Package name, Description, Repository URL click on the\n"Upload wasm" button and select your application ',(0,s.jsx)(n.code,{children:".wasm"})," file (e.g. only-peers\napplication wasm)."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"SelectWasmFile",src:t(3227).A+"",width:"810",height:"451"})}),"\n",(0,s.jsx)(n.p,{children:"After file was uploaded to IPFS, Path and Hash field will be filled\nautomatically and only thing left is to fill in version and notes."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"UploadedWasm",src:t(1078).A+"",width:"898",height:"555"})}),"\n",(0,s.jsx)(n.p,{children:'After you click the "Publish" button, application will be published in the\nPackage Manager contract and it will be available in the available applications\nlist.'}),"\n",(0,s.jsx)(n.p,{children:"You will get a status popup message."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"ApplicationPublished",src:t(9909).A+"",width:"497",height:"171"})}),"\n",(0,s.jsx)(n.h4,{id:"install-available-application",children:"Install available application"}),"\n",(0,s.jsx)(n.p,{children:'To install one of the available application from the Package Manager click on\nthe "install new application" button.'}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Applications",src:t(3040).A+"",width:"1248",height:"796"})}),"\n",(0,s.jsx)(n.p,{children:"You will be redirected to install page where you can browse available\napplications or upload a new one."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"InstallApplication",src:t(7835).A+"",width:"1248",height:"797"})}),"\n",(0,s.jsx)(n.p,{children:'On "Browse" button click you will get a available application list where you can\nselect application you want to install.'}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"BrowseApplications",src:t(9813).A+"",width:"1145",height:"273"})}),"\n",(0,s.jsx)(n.p,{children:'On selection the application Metadata will be displayed and you can press\n"install application" button to install the application.'}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"BrowseApplications",src:t(7340).A+"",width:"1247",height:"800"})}),"\n",(0,s.jsx)(n.p,{children:"On sucessfull installation you will get status popup."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"ApplicationInstalled",src:t(4842).A+"",width:"535",height:"200"})}),"\n",(0,s.jsx)(n.h3,{id:"context",children:"Context"}),"\n",(0,s.jsx)(n.p,{children:"Preview context which you have already joined or invited. You can also create a\nnew context."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"ContextList",src:t(2061).A+"",width:"1246",height:"796"})}),"\n",(0,s.jsx)(n.h4,{id:"start-new-context",children:"Start new context"}),"\n",(0,s.jsx)(n.p,{children:'To start new context press the "Start new context" button on previous page.'}),"\n",(0,s.jsx)(n.p,{children:"You can select application with which you want to create a new context or you\ncan upload a new application."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"StartContextSelect",src:t(77).A+"",width:"1320",height:"796"})}),"\n",(0,s.jsx)(n.p,{children:"If your application requires initialization parameters, you can select the\n'Initialize application state' option during startup."}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"NOTE"}),": To understand this lets take two examples."]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["Consider a JavaScript class MyClass. In some cases, you can create an\ninstance using ",(0,s.jsx)(n.code,{children:"new MyClass()"})," if there are no initialization parameters\nrequired."]}),"\n",(0,s.jsxs)(n.li,{children:["However, if your class requires specific parameters for initialization, you\nneed to pass them like this: ",(0,s.jsx)(n.code,{children:"new MyClass({ application_name: name })"}),".\nThis is similar to your WASM application's requirement for initialization\nparameters during its startup process."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"StartContextSelected",src:t(3978).A+"",width:"1247",height:"795"})}),"\n",(0,s.jsx)(n.p,{children:'On button "Start" click the new context will be created and you will get status\npopup.'}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Context installed",src:t(463).A+"",width:"529",height:"193"})}),"\n",(0,s.jsx)(n.p,{children:"You can now see created context in the context list."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"ContextListInstalled",src:t(162).A+"",width:"1247",height:"799"})}),"\n",(0,s.jsx)(n.h3,{id:"export",children:"Export"}),"\n",(0,s.jsx)(n.p,{children:"Allows you to export you identity on current device and import it on new device."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"ContextList",src:t(3576).A+"",width:"1248",height:"798"})})]})}function h(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(r,{...e})}):r(e)}},5791:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/10new-root-key-added-24f3a7b3c573e4a599ddc8cd970cf30f.png"},3040:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/12applications-21abaddc8de1479b7716aa22b142bf0c.png"},1078:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/13filled-in-fields-ec772e882d2ce524f7e65ae5edf95bdd.png"},9909:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/13published-application-1ee6b729e2c7255e5965e794b1c06e62.png"},3227:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/13select-wasm-c1584e741991c4251c473a1fdf66e327.png"},280:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/13upload-new-app-58a2ecd6e94bd3e666f7586abab475e1.png"},9813:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/14browse-applications-9e98f5d045104d38a97f101006256b99.png"},7835:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/14install-application-c094be7b6bc7f90fcd68e5de3463f435.png"},7340:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/15install-application-0470cad323295a3ab65167fa2017b53a.png"},4842:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/16application-installed-71d5b558454fb9816080c3b90e99bb05.png"},2061:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/18context-list-a18cb6d8b9ebd28d97c2abceff78154e.png"},77:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/19start-context-select-8ec58995af1ea93efff0d362d7738d21.png"},2091:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/1setup-node-url-34001124f987a1c89da445494deebd5c.png"},3978:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/20start-context-selected-5cdfc911bf581c37e518bc343313afb5.png"},463:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/21context-installed-c9464712c8452e13cf9c86df947f8f51.png"},162:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/22context-list-d7aa2127df8a5a9735c4d3bcd4f76fd1.png"},3576:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/23export-identity-083848da6a7637e79b071b96b44ffd94.png"},4660:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/2select-wallet-96c27afc6607a800a4f698f7459375ac.png"},1053:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/3connect-wallet-9585c0e9ce96b9b33dc28e8a5b0b3d30.png"},810:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/4logged-in-acc-c3f51404ab55814bf7844bd973e1d5e7.png"},9032:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/5metamask-sign-msg-login-e744d32c007f9b1a9d10931c8401a2cd.png"},8214:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/6identity-29a8f560fe919c7ee606a2beed7e9eaf.png"},2617:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/7no-root-key-login-e16c042f69f6d6036b24116265658a25.png"},2109:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/8add-new-root-key-e37682ad9c32dfcfdb603e5727473e01.png"},7002:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/9add-root-key-txn-a4c5c13a38da00dd3f75d7a1ba68e499.png"},9449:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/setup-node-url-error-2509e61875b603d7860680da8a3453fd.png"},5248:(e,n,t)=>{t.d(n,{R:()=>l,x:()=>o});var i=t(758);const s={},a=i.createContext(s);function l(e){const n=i.useContext(a);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:l(e.components),i.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/ec3fec87.07ba7a19.js b/assets/js/ec3fec87.07ba7a19.js deleted file mode 100644 index efafda6f..00000000 --- a/assets/js/ec3fec87.07ba7a19.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9251],{6932:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>o,contentTitle:()=>a,default:()=>u,frontMatter:()=>r,metadata:()=>i,toc:()=>c});const i=JSON.parse('{"id":"tutorials/login-with-wallets/near-wallet","title":"Near Wallet","description":"Logging in with NEAR Wallet","source":"@site/docs/06-tutorials/01-login-with-wallets/01-near-wallet.mdx","sourceDirName":"06-tutorials/01-login-with-wallets","slug":"/tutorials/login-with-wallets/near-wallet","permalink":"/tutorials/login-with-wallets/near-wallet","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/06-tutorials/01-login-with-wallets/01-near-wallet.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":1,"frontMatter":{"id":"near-wallet","title":"Near Wallet"},"sidebar":"tutorialSidebar","previous":{"title":"Tutorials","permalink":"/tutorials/overview"},"next":{"title":"Starknet Wallet","permalink":"/tutorials/login-with-wallets/starknet-wallet"}}');var l=n(6070),s=n(5248);const r={id:"near-wallet",title:"Near Wallet"},a=void 0,o={},c=[{value:"Logging in with NEAR Wallet",id:"logging-in-with-near-wallet",level:2},{value:"1. User Initiates Login",id:"1-user-initiates-login",level:3},{value:"2. Server Issues Challenge",id:"2-server-issues-challenge",level:3},{value:"3. Redirect to MyNearWallet",id:"3-redirect-to-mynearwallet",level:3},{value:"4. Signature Sent to Backend",id:"4-signature-sent-to-backend",level:3},{value:"5. Signature Verification",id:"5-signature-verification",level:3},{value:"6. Successful Login",id:"6-successful-login",level:3}];function h(e){const t={a:"a",h2:"h2",h3:"h3",li:"li",p:"p",ul:"ul",...(0,s.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(t.h2,{id:"logging-in-with-near-wallet",children:"Logging in with NEAR Wallet"}),"\n",(0,l.jsx)(t.p,{children:"Calimero allows users to authenticate via their NEAR wallet, ensuring secure\naccess to the Admin Dashboard. The process of logging in with a NEAR wallet\ninvolves the following steps:"}),"\n",(0,l.jsx)(t.h3,{id:"1-user-initiates-login",children:"1. User Initiates Login"}),"\n",(0,l.jsxs)(t.ul,{children:["\n",(0,l.jsx)(t.li,{children:'The user navigates to the Admin Dashboard and selects the option to "Login\nwith NEAR Wallet."'}),"\n"]}),"\n",(0,l.jsx)(t.h3,{id:"2-server-issues-challenge",children:"2. Server Issues Challenge"}),"\n",(0,l.jsxs)(t.ul,{children:["\n",(0,l.jsx)(t.li,{children:"Upon selecting the login option, the server generates a challenge. This\nchallenge is then presented to the user for signing."}),"\n"]}),"\n",(0,l.jsx)(t.h3,{id:"3-redirect-to-mynearwallet",children:"3. Redirect to MyNearWallet"}),"\n",(0,l.jsxs)(t.ul,{children:["\n",(0,l.jsxs)(t.li,{children:["The user is redirected to the ",(0,l.jsx)(t.a,{href:"https://mynearwallet.com/",children:"MyNearWallet"})," page,\nwhere they will be asked to sign the server-issued challenge using their NEAR\nwallet."]}),"\n"]}),"\n",(0,l.jsx)(t.h3,{id:"4-signature-sent-to-backend",children:"4. Signature Sent to Backend"}),"\n",(0,l.jsxs)(t.ul,{children:["\n",(0,l.jsx)(t.li,{children:"After the user signs the challenge, the signature is sent back to the server\nfor verification."}),"\n"]}),"\n",(0,l.jsx)(t.h3,{id:"5-signature-verification",children:"5. Signature Verification"}),"\n",(0,l.jsxs)(t.ul,{children:["\n",(0,l.jsx)(t.li,{children:"The backend verifies the signature to ensure its authenticity. If the\nsignature is valid, the user's public key is extracted from the signature and\nadded as the user's unique identifier."}),"\n",(0,l.jsx)(t.li,{children:"This public key serves as the user's Decentralized Identifier (DID), not as a\ncontext-specific identity. The DID enables decentralized authentication,\nensuring that the user can interact with the platform securely across\ndifferent contexts and applications."}),"\n"]}),"\n",(0,l.jsx)(t.h3,{id:"6-successful-login",children:"6. Successful Login"}),"\n",(0,l.jsxs)(t.ul,{children:["\n",(0,l.jsx)(t.li,{children:"Once verified, the user is successfully logged into the Admin Dashboard, with\ntheir public key (DID) serving as their user ID for future interactions."}),"\n"]}),"\n",(0,l.jsx)(t.p,{children:"This login flow ensures a secure and seamless authentication process leveraging\nNEAR's robust blockchain-based security."})]})}function u(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,l.jsx)(t,{...e,children:(0,l.jsx)(h,{...e})}):h(e)}},5248:(e,t,n)=>{n.d(t,{R:()=>r,x:()=>a});var i=n(758);const l={},s=i.createContext(l);function r(e){const t=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:r(e.components),i.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/ec3fec87.ce20eaa0.js b/assets/js/ec3fec87.ce20eaa0.js new file mode 100644 index 00000000..8985b7a1 --- /dev/null +++ b/assets/js/ec3fec87.ce20eaa0.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9251],{6932:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>o,contentTitle:()=>a,default:()=>u,frontMatter:()=>r,metadata:()=>i,toc:()=>c});const i=JSON.parse('{"id":"tutorials/login-with-wallets/near-wallet","title":"Near Wallet","description":"Logging in with NEAR Wallet","source":"@site/docs/06-tutorials/01-login-with-wallets/01-near-wallet.mdx","sourceDirName":"06-tutorials/01-login-with-wallets","slug":"/tutorials/login-with-wallets/near-wallet","permalink":"/tutorials/login-with-wallets/near-wallet","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/06-tutorials/01-login-with-wallets/01-near-wallet.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":1,"frontMatter":{"id":"near-wallet","title":"Near Wallet"},"sidebar":"tutorialSidebar","previous":{"title":"Overview","permalink":"/tutorials/overview"},"next":{"title":"Starknet Wallet","permalink":"/tutorials/login-with-wallets/starknet-wallet"}}');var l=n(6070),s=n(5248);const r={id:"near-wallet",title:"Near Wallet"},a=void 0,o={},c=[{value:"Logging in with NEAR Wallet",id:"logging-in-with-near-wallet",level:2},{value:"1. User Initiates Login",id:"1-user-initiates-login",level:3},{value:"2. Server Issues Challenge",id:"2-server-issues-challenge",level:3},{value:"3. Redirect to MyNearWallet",id:"3-redirect-to-mynearwallet",level:3},{value:"4. Signature Sent to Backend",id:"4-signature-sent-to-backend",level:3},{value:"5. Signature Verification",id:"5-signature-verification",level:3},{value:"6. Successful Login",id:"6-successful-login",level:3}];function h(e){const t={a:"a",h2:"h2",h3:"h3",li:"li",p:"p",ul:"ul",...(0,s.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(t.h2,{id:"logging-in-with-near-wallet",children:"Logging in with NEAR Wallet"}),"\n",(0,l.jsx)(t.p,{children:"Calimero allows users to authenticate via their NEAR wallet, ensuring secure\naccess to the Admin Dashboard. The process of logging in with a NEAR wallet\ninvolves the following steps:"}),"\n",(0,l.jsx)(t.h3,{id:"1-user-initiates-login",children:"1. User Initiates Login"}),"\n",(0,l.jsxs)(t.ul,{children:["\n",(0,l.jsx)(t.li,{children:'The user navigates to the Admin Dashboard and selects the option to "Login\nwith NEAR Wallet."'}),"\n"]}),"\n",(0,l.jsx)(t.h3,{id:"2-server-issues-challenge",children:"2. Server Issues Challenge"}),"\n",(0,l.jsxs)(t.ul,{children:["\n",(0,l.jsx)(t.li,{children:"Upon selecting the login option, the server generates a challenge. This\nchallenge is then presented to the user for signing."}),"\n"]}),"\n",(0,l.jsx)(t.h3,{id:"3-redirect-to-mynearwallet",children:"3. Redirect to MyNearWallet"}),"\n",(0,l.jsxs)(t.ul,{children:["\n",(0,l.jsxs)(t.li,{children:["The user is redirected to the ",(0,l.jsx)(t.a,{href:"https://mynearwallet.com/",children:"MyNearWallet"})," page,\nwhere they will be asked to sign the server-issued challenge using their NEAR\nwallet."]}),"\n"]}),"\n",(0,l.jsx)(t.h3,{id:"4-signature-sent-to-backend",children:"4. Signature Sent to Backend"}),"\n",(0,l.jsxs)(t.ul,{children:["\n",(0,l.jsx)(t.li,{children:"After the user signs the challenge, the signature is sent back to the server\nfor verification."}),"\n"]}),"\n",(0,l.jsx)(t.h3,{id:"5-signature-verification",children:"5. Signature Verification"}),"\n",(0,l.jsxs)(t.ul,{children:["\n",(0,l.jsx)(t.li,{children:"The backend verifies the signature to ensure its authenticity. If the\nsignature is valid, the user's public key is extracted from the signature and\nadded as the user's unique identifier."}),"\n",(0,l.jsx)(t.li,{children:"This public key serves as the user's Decentralized Identifier (DID), not as a\ncontext-specific identity. The DID enables decentralized authentication,\nensuring that the user can interact with the platform securely across\ndifferent contexts and applications."}),"\n"]}),"\n",(0,l.jsx)(t.h3,{id:"6-successful-login",children:"6. Successful Login"}),"\n",(0,l.jsxs)(t.ul,{children:["\n",(0,l.jsx)(t.li,{children:"Once verified, the user is successfully logged into the Admin Dashboard, with\ntheir public key (DID) serving as their user ID for future interactions."}),"\n"]}),"\n",(0,l.jsx)(t.p,{children:"This login flow ensures a secure and seamless authentication process leveraging\nNEAR's robust blockchain-based security."})]})}function u(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,l.jsx)(t,{...e,children:(0,l.jsx)(h,{...e})}):h(e)}},5248:(e,t,n)=>{n.d(t,{R:()=>r,x:()=>a});var i=n(758);const l={},s=i.createContext(l);function r(e){const t=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:r(e.components),i.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/ec4801bd.16e45842.js b/assets/js/ec4801bd.52953879.js similarity index 98% rename from assets/js/ec4801bd.16e45842.js rename to assets/js/ec4801bd.52953879.js index a4ddbf91..a5f47b3f 100644 --- a/assets/js/ec4801bd.16e45842.js +++ b/assets/js/ec4801bd.52953879.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1988],{8477:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>p,frontMatter:()=>s,metadata:()=>i,toc:()=>d});const i=JSON.parse('{"id":"developer-tools/overview","title":"Developer Tools","description":"We provide different tools for building decentralized applications.","source":"@site/docs/05-developer-tools/00-overview.mdx","sourceDirName":"05-developer-tools","slug":"/developer-tools/overview","permalink":"/developer-tools/overview","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/05-developer-tools/00-overview.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":0,"frontMatter":{"id":"overview","title":"Developer Tools"},"sidebar":"tutorialSidebar","previous":{"title":"Network","permalink":"/architecture/node/network"},"next":{"title":"Merod","permalink":"/developer-tools/CLI/merod"}}');var n=o(6070),r=o(5248);const s={id:"overview",title:"Developer Tools"},a=void 0,l={},d=[{value:"CLI Tools for interacting with the node and its functionalities",id:"cli-tools-for-interacting-with-the-node-and-its-functionalities",level:3},{value:"SDKs for building the application",id:"sdks-for-building-the-application",level:3},{value:"Apps for node administration throught the UI",id:"apps-for-node-administration-throught-the-ui",level:3},{value:"Examples",id:"examples",level:3}];function c(e){const t={a:"a",h3:"h3",li:"li",p:"p",ul:"ul",...(0,r.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.p,{children:"We provide different tools for building decentralized applications."}),"\n",(0,n.jsx)(t.h3,{id:"cli-tools-for-interacting-with-the-node-and-its-functionalities",children:"CLI Tools for interacting with the node and its functionalities"}),"\n",(0,n.jsxs)(t.p,{children:["You can use CLI to interact with the node using the terminal.\n",(0,n.jsx)(t.a,{href:"./CLI/merod",children:"Merod"})," is a CLI tool for managing nodes. ",(0,n.jsx)(t.a,{href:"./CLI/meroctl",children:"Meroctl"}),"\nis tool for performing various operations with the node such as context\ncreationa or app installation."]}),"\n",(0,n.jsx)(t.h3,{id:"sdks-for-building-the-application",children:"SDKs for building the application"}),"\n",(0,n.jsx)(t.p,{children:"Two primary SDKs are available:"}),"\n",(0,n.jsxs)(t.p,{children:[(0,n.jsx)(t.a,{href:"./SDK/protocol-sdk/protocol-sdk",children:"Protocol SDK"}),": Used for building WebAssembly\n(WASM) application logic in Rust. Provide macros for identifying different\napplication components such as state, logic and events."]}),"\n",(0,n.jsxs)(t.p,{children:[(0,n.jsx)(t.a,{href:"./SDK/client-sdk/client-ts-sdk",children:"Client SDK"}),": Enables frontend development in\nTypeScript, supporting wallet authentication and context data handling via\nJSON-RPC and WebSockets."]}),"\n",(0,n.jsx)(t.h3,{id:"apps-for-node-administration-throught-the-ui",children:"Apps for node administration throught the UI"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.a,{href:"./apps/admin-dashboard",children:"Admin dashboard"})," is web interface for node admin api."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.a,{href:"./apps/desktop-app",children:"Desktop application"})," is a desktop interface for the node\nwhere node is available as a service on the local machine."]}),"\n"]}),"\n",(0,n.jsx)(t.h3,{id:"examples",children:"Examples"}),"\n",(0,n.jsxs)(t.p,{children:["We have few repositories that demonstrate how SDK can be used. Check our\n",(0,n.jsx)(t.a,{href:"https://github.com/calimero-network",children:"GitHub"})]})]})}function p(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(c,{...e})}):c(e)}},5248:(e,t,o)=>{o.d(t,{R:()=>s,x:()=>a});var i=o(758);const n={},r=i.createContext(n);function s(e){const t=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:s(e.components),i.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1988],{8477:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>p,frontMatter:()=>s,metadata:()=>i,toc:()=>d});const i=JSON.parse('{"id":"developer-tools/overview","title":"Developer Tools","description":"We provide different tools for building decentralized applications.","source":"@site/docs/05-developer-tools/00-overview.mdx","sourceDirName":"05-developer-tools","slug":"/developer-tools/overview","permalink":"/developer-tools/overview","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/05-developer-tools/00-overview.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":0,"frontMatter":{"id":"overview","title":"Developer Tools"},"sidebar":"tutorialSidebar","previous":{"title":"Network","permalink":"/architecture/node/network"},"next":{"title":"Merod","permalink":"/developer-tools/CLI/merod"}}');var n=o(6070),r=o(5248);const s={id:"overview",title:"Developer Tools"},a=void 0,l={},d=[{value:"CLI Tools for interacting with the node and its functionalities",id:"cli-tools-for-interacting-with-the-node-and-its-functionalities",level:3},{value:"SDKs for building the application",id:"sdks-for-building-the-application",level:3},{value:"Apps for node administration throught the UI",id:"apps-for-node-administration-throught-the-ui",level:3},{value:"Examples",id:"examples",level:3}];function c(e){const t={a:"a",h3:"h3",li:"li",p:"p",ul:"ul",...(0,r.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.p,{children:"We provide different tools for building decentralized applications."}),"\n",(0,n.jsx)(t.h3,{id:"cli-tools-for-interacting-with-the-node-and-its-functionalities",children:"CLI Tools for interacting with the node and its functionalities"}),"\n",(0,n.jsxs)(t.p,{children:["You can use CLI to interact with the node using the terminal.\n",(0,n.jsx)(t.a,{href:"./CLI/merod",children:"Merod"})," is a CLI tool for managing nodes. ",(0,n.jsx)(t.a,{href:"./CLI/meroctl",children:"Meroctl"}),"\nis tool for performing various operations with the node such as context\ncreationa or app installation."]}),"\n",(0,n.jsx)(t.h3,{id:"sdks-for-building-the-application",children:"SDKs for building the application"}),"\n",(0,n.jsx)(t.p,{children:"Two primary SDKs are available:"}),"\n",(0,n.jsxs)(t.p,{children:[(0,n.jsx)(t.a,{href:"./SDK/protocol-sdk/protocol-sdk",children:"Protocol SDK"}),": Used for building WebAssembly\n(WASM) application logic in Rust. Provide macros for identifying different\napplication components such as state, logic and events."]}),"\n",(0,n.jsxs)(t.p,{children:[(0,n.jsx)(t.a,{href:"./SDK/client-sdk/client-ts-sdk",children:"Client SDK"}),": Enables frontend development in\nTypeScript, supporting wallet authentication and context data handling via\nJSON-RPC and WebSockets."]}),"\n",(0,n.jsx)(t.h3,{id:"apps-for-node-administration-throught-the-ui",children:"Apps for node administration throught the UI"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.a,{href:"./apps/admin-dashboard",children:"Admin dashboard"})," is web interface for node admin api."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.a,{href:"./apps/desktop-app",children:"Desktop application"})," is a desktop interface for the node\nwhere node is available as a service on the local machine."]}),"\n"]}),"\n",(0,n.jsx)(t.h3,{id:"examples",children:"Examples"}),"\n",(0,n.jsxs)(t.p,{children:["We have few repositories that demonstrate how SDK can be used. Check our\n",(0,n.jsx)(t.a,{href:"https://github.com/calimero-network",children:"GitHub"})]})]})}function p(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(c,{...e})}):c(e)}},5248:(e,t,o)=>{o.d(t,{R:()=>s,x:()=>a});var i=o(758);const n={},r=i.createContext(n);function s(e){const t=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:s(e.components),i.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/f96da59b.ba90f566.js b/assets/js/f96da59b.f59bb087.js similarity index 99% rename from assets/js/f96da59b.ba90f566.js rename to assets/js/f96da59b.f59bb087.js index 625d97b5..9d9995f9 100644 --- a/assets/js/f96da59b.ba90f566.js +++ b/assets/js/f96da59b.f59bb087.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5277],{3749:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>a,contentTitle:()=>l,default:()=>h,frontMatter:()=>o,metadata:()=>s,toc:()=>d});const s=JSON.parse('{"id":"architecture/node/network","title":"Network","description":"Overview","source":"@site/docs/04-architecture/03-node/05-network.mdx","sourceDirName":"04-architecture/03-node","slug":"/architecture/node/network","permalink":"/architecture/node/network","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/04-architecture/03-node/05-network.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":5,"frontMatter":{"id":"network","title":"Network"},"sidebar":"tutorialSidebar","previous":{"title":"Storage","permalink":"/architecture/node/storage"},"next":{"title":"Developer Tools","permalink":"/developer-tools/overview"}}');var r=i(6070),t=i(5248);const o={id:"network",title:"Network"},l=void 0,a={},d=[{value:"Overview",id:"overview",level:2},{value:"Node Types",id:"node-types",level:2},{value:"Client Node",id:"client-node",level:3},{value:"Boot Node",id:"boot-node",level:3},{value:"P2P protocols and techniques",id:"p2p-protocols-and-techniques",level:2},{value:"Protocol Descriptions",id:"protocol-descriptions",level:3},{value:"DCUtR (Direct Connection Upgrade through Relay)",id:"dcutr-direct-connection-upgrade-through-relay",level:4},{value:"Gossipsub",id:"gossipsub",level:4},{value:"Identify",id:"identify",level:4},{value:"Kademlia (Kad)",id:"kademlia-kad",level:4},{value:"mDNS (Multicast DNS)",id:"mdns-multicast-dns",level:4},{value:"Ping",id:"ping",level:4},{value:"Relay",id:"relay",level:4},{value:"Rendezvous",id:"rendezvous",level:4},{value:"NAT Traversal Techniques",id:"nat-traversal-techniques",level:3}];function c(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",p:"p",strong:"strong",ul:"ul",...(0,t.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h2,{id:"overview",children:"Overview"}),"\n",(0,r.jsxs)(n.p,{children:["This document provides an overview of the networking component of Calimero\nNetwork, which is implemented using the ",(0,r.jsx)(n.code,{children:"libp2p"})," library. The network consists\nof two types of peers: client nodes and boot nodes, each serving distinct roles\nand utilizing specific protocols to facilitate peer-to-peer communication.\nClient node is the component which hosts and runs client applications,\ncommunicates and shares data between other client nodes. Boot node is the\ncomponent used for the initial discovery of the peers in the network."]}),"\n",(0,r.jsx)(n.h2,{id:"node-types",children:"Node Types"}),"\n",(0,r.jsx)(n.h3,{id:"client-node",children:"Client Node"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Deployment:"})," Can run on any machine"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Protocols Utilized:"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#dcutr-direct-connection-upgrade-through-relay",children:"dcutr"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#gossipsub",children:"gossipsub"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#identify",children:"identify"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#kademlia-kad",children:"kad"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#mdns-multicast-dns",children:"mdns"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#ping",children:"ping"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#rendezvous",children:"rendezvous"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#relay",children:"relay"})}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Behavior:"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Configuration:"})," A client node can be configured to use zero boot nodes."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"External Address:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Direct Public External Address:"})," Nodes with a direct public external\naddress do not require reservation at the relay server. These nodes\npublish their public external address to the Kademlia DHT, making them\ndirectly accessible to other peers."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Relayed External Address:"})," Nodes that do not have a direct public\nexternal address, typically those behind a NAT or firewall, can obtain a\nrelayed external address by requesting a reservation at a relay server.\nOnce the reservation is accepted, the node publishes its new external\naddress to the rendezvous server. This allows other nodes to discover\nrelayed addresses of a peers in a certain rendezvous namespace. The relay\nserver can be used for the coordination of the hole punching between two\nnodes. If the hole punching attempt fails, the relay server will bridge\nthe traffic."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Discovery Protocols:"})," ",(0,r.jsx)(n.code,{children:"mDNS"}),", ",(0,r.jsx)(n.code,{children:"rendezvous"})," and ",(0,r.jsx)(n.code,{children:"Kademlia"})]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Connection Management:"})," A peer, identified via PeerId, can be discovered\neither via mDNS, rendezvous or Kademlia. mDNS discovery provides local\nnetwork addresses, rendezvous discovery provides relayed addresses, and\nKademlia discovery provides direct public external addresses. The node\nmaintains information about its connections to peers, including the\ndiscovery source. For a discovered external address, either relayed or\ndirect public, the node will only attempt to dial the peer if the same peer\nis not already connected via a discovered local address. This ensures that\nlocal connections have higher priority and that there are no unnecessary\nhole punching attempts."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Message Relaying:"})," The node participates in the ",(0,r.jsx)(n.code,{children:"gossipsub"})," protocol,\nrelaying messages to all connected peers that support it. This enables\nefficient and scalable message dissemination across the network."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"boot-node",children:"Boot Node"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Deployment:"})," Must run on a publicly available machine with a static IP\naddress."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Protocols Utilized:"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#identify",children:"identify"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#kademlia-kad",children:"kad"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#ping",children:"ping"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#rendezvous",children:"rendezvous"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#relay",children:"relay"})}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Behavior:"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Characteristics:"})," Boot nodes are publicly available, long-running nodes\nthat provide stable entry points to the network."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Functions:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Bootstrap Node:"})," Acts as a well-known peer for the Kademlia protocol,\nfacilitating peer discovery and network join operations."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Circuit Relay Server:"})," Serves as a generic relay that provides the\nmedium that facilitates the hole punching, enabling peers to establish\ndirect connections even when they are behind NAT or firewalls. The relay\nserver is used for the coordination of the hole punching between two\nnodes, and briding traffic if the hole punching attempt fails."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Rendezvous Server:"})," Facilitates peer discovery by allowing nodes to\nregister their presence and query for other peers within a shared\nrendezvous namespace. This enables dynamic and efficient peer-to-peer\nconnections without relying on a static list of peers."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"p2p-protocols-and-techniques",children:"P2P protocols and techniques"}),"\n",(0,r.jsx)(n.h3,{id:"protocol-descriptions",children:"Protocol Descriptions"}),"\n",(0,r.jsx)(n.h4,{id:"dcutr-direct-connection-upgrade-through-relay",children:"DCUtR (Direct Connection Upgrade through Relay)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"DCUtR is used to upgrade connections through relay nodes, allowing peers to\nestablish direct connections even if they are behind NATs or firewalls. Peers\ninitially connect via a relay node, then use the DCUtR protocol to attempt a\ndirect connection, which reduces latency and bandwidth usage."}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Reference:"}),"\n",(0,r.jsx)(n.a,{href:"https://github.com/libp2p/specs/blob/master/relay/DCUtR.md",children:"libp2p DCUtR Documentation"})]}),"\n"]}),"\n",(0,r.jsx)(n.h4,{id:"gossipsub",children:"Gossipsub"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Gossipsub is a scalable and efficient pub-sub protocol for message\ndissemination. It combines the best aspects of gossip protocols and\ntopic-based pub-sub systems. It minimizes bandwidth usage by only gossiping\nmetadata and ensuring that messages are only sent once per peer."}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Reference:"}),"\n",(0,r.jsx)(n.a,{href:"https://github.com/libp2p/specs/tree/master/pubsub/gossipsub",children:"libp2p Gossipsub Documentation"})]}),"\n"]}),"\n",(0,r.jsx)(n.h4,{id:"identify",children:"Identify"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"The Identify protocol allows peers to identify themselves and share their\ncapabilities with other peers. Peers exchange identification information such\nas supported protocols, listen addresses, and public keys. This helps peers\nmake informed decisions about connecting and interacting."}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Reference:"}),"\n",(0,r.jsx)(n.a,{href:"https://github.com/libp2p/specs/blob/master/identify/README.md",children:"libp2p Identify Documentation"})]}),"\n"]}),"\n",(0,r.jsx)(n.h4,{id:"kademlia-kad",children:"Kademlia (Kad)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Kademlia is a distributed hash table (DHT) protocol used for peer discovery\nand data routing. It uses an XOR metric to ensure efficient and scalable peer\nlookup. Each node maintains a routing table with information about other\nnodes, facilitating quick lookups and robust network operation."}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Reference:"}),"\n",(0,r.jsx)(n.a,{href:"https://github.com/libp2p/specs/tree/master/kad-dht",children:"libp2p Kademlia DHT Documentation"})]}),"\n"]}),"\n",(0,r.jsx)(n.h4,{id:"mdns-multicast-dns",children:"mDNS (Multicast DNS)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"mDNS enables local network peer discovery without the need for a central\nserver. It uses multicast DNS to allow peers to find each other on the same\nlocal network by broadcasting their presence and listening for broadcasts from\nother peers."}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Reference:"}),"\n",(0,r.jsx)(n.a,{href:"https://github.com/libp2p/specs/tree/master/discovery/mdns",children:"libp2p mDNS Documentation"})]}),"\n"]}),"\n",(0,r.jsx)(n.h4,{id:"ping",children:"Ping"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"The Ping protocol measures the round-trip time (latency) between peers. It\nregularly pings connected peers and measures the time it takes for a response.\nThis helps in maintaining healthy connections and understanding network\nlatency."}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Reference:"}),"\n",(0,r.jsx)(n.a,{href:"https://github.com/libp2p/go-libp2p-ping",children:"libp2p Ping Documentation"})]}),"\n"]}),"\n",(0,r.jsx)(n.h4,{id:"relay",children:"Relay"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"The Relay protocol supports relay-based communication, allowing peers to\ncommunicate through intermediary nodes when direct connections are not\npossible. Nodes can use relay nodes to forward their traffic, which is\nespecially useful for nodes behind NATs or firewalls. The protocol includes\nmechanisms for reserving relay slots and managing relay connections."}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Reference:"}),"\n",(0,r.jsx)(n.a,{href:"https://github.com/libp2p/specs/tree/master/relay",children:"libp2p Relay Documentation"})]}),"\n"]}),"\n",(0,r.jsx)(n.h4,{id:"rendezvous",children:"Rendezvous"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"The Rendezvous protocol enables peers to discover each other by registering at\nand querying a shared rendezvous point. This is useful for dynamically finding\npeers without needing a central directory or pre-established list of peers.\nPeers register their presence at a rendezvous server and can also query the\nserver to find other peers."}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Reference:"}),"\n",(0,r.jsx)(n.a,{href:"https://github.com/libp2p/specs/tree/master/rendezvous",children:"libp2p Rendezvous Documentation"})]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"nat-traversal-techniques",children:"NAT Traversal Techniques"}),"\n",(0,r.jsxs)(n.p,{children:["One of the common techniques used for NAT traversal in P2P networks is ",(0,r.jsx)(n.strong,{children:"Hole\nPunching"}),". This technique allows two peers, each behind a NAT, to establish a\ndirect connection with each other. Here's a brief explanation:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Hole Punching:"})," This technique involves three steps:","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Step 1 - Connection to Public Server:"}),' Both peers initially connect to a\npublic server (in this case, the relay server). This creates a NAT mapping\n(a "hole") for outgoing packets to the server.']}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Step 2 - Exchange of Address Information:"})," The server shares the public\naddress information of each peer with the other. This information includes\nthe IP address and port number that the NAT has assigned for the connection\nto the server."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Step 3 - Direct Connection:"})," Each peer sends a packet to the other peer's\npublic address. Since a mapping for this address already exists in the NAT\n(from the connection to the server), the NAT forwards the packet to the\nappropriate internal address, and a direct connection is established."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"This technique is particularly useful in P2P networks, as it allows peers to\ncommunicate directly, reducing the load on relay servers and improving network\nefficiency. However, it's worth noting that hole punching may not work with all\ntypes of NATs, and success can depend on the specific NAT implementation and\nconfiguration."}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Reference:"}),"\n",(0,r.jsx)(n.a,{href:"https://blog.ipfs.tech/2022-01-20-libp2p-hole-punching/",children:"Hole punching in libp2p"})]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Reference:"}),"\n",(0,r.jsx)(n.a,{href:"https://tailscale.com/blog/how-nat-traversal-works",children:"How NAT traversal works"})]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},5248:(e,n,i)=>{i.d(n,{R:()=>o,x:()=>l});var s=i(758);const r={},t=s.createContext(r);function o(e){const n=s.useContext(t);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),s.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5277],{3749:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>a,contentTitle:()=>l,default:()=>h,frontMatter:()=>o,metadata:()=>s,toc:()=>d});const s=JSON.parse('{"id":"architecture/node/network","title":"Network","description":"Overview","source":"@site/docs/04-architecture/03-node/05-network.mdx","sourceDirName":"04-architecture/03-node","slug":"/architecture/node/network","permalink":"/architecture/node/network","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/04-architecture/03-node/05-network.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":5,"frontMatter":{"id":"network","title":"Network"},"sidebar":"tutorialSidebar","previous":{"title":"Storage","permalink":"/architecture/node/storage"},"next":{"title":"Developer Tools","permalink":"/developer-tools/overview"}}');var r=i(6070),t=i(5248);const o={id:"network",title:"Network"},l=void 0,a={},d=[{value:"Overview",id:"overview",level:2},{value:"Node Types",id:"node-types",level:2},{value:"Client Node",id:"client-node",level:3},{value:"Boot Node",id:"boot-node",level:3},{value:"P2P protocols and techniques",id:"p2p-protocols-and-techniques",level:2},{value:"Protocol Descriptions",id:"protocol-descriptions",level:3},{value:"DCUtR (Direct Connection Upgrade through Relay)",id:"dcutr-direct-connection-upgrade-through-relay",level:4},{value:"Gossipsub",id:"gossipsub",level:4},{value:"Identify",id:"identify",level:4},{value:"Kademlia (Kad)",id:"kademlia-kad",level:4},{value:"mDNS (Multicast DNS)",id:"mdns-multicast-dns",level:4},{value:"Ping",id:"ping",level:4},{value:"Relay",id:"relay",level:4},{value:"Rendezvous",id:"rendezvous",level:4},{value:"NAT Traversal Techniques",id:"nat-traversal-techniques",level:3}];function c(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",p:"p",strong:"strong",ul:"ul",...(0,t.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h2,{id:"overview",children:"Overview"}),"\n",(0,r.jsxs)(n.p,{children:["This document provides an overview of the networking component of Calimero\nNetwork, which is implemented using the ",(0,r.jsx)(n.code,{children:"libp2p"})," library. The network consists\nof two types of peers: client nodes and boot nodes, each serving distinct roles\nand utilizing specific protocols to facilitate peer-to-peer communication.\nClient node is the component which hosts and runs client applications,\ncommunicates and shares data between other client nodes. Boot node is the\ncomponent used for the initial discovery of the peers in the network."]}),"\n",(0,r.jsx)(n.h2,{id:"node-types",children:"Node Types"}),"\n",(0,r.jsx)(n.h3,{id:"client-node",children:"Client Node"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Deployment:"})," Can run on any machine"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Protocols Utilized:"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#dcutr-direct-connection-upgrade-through-relay",children:"dcutr"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#gossipsub",children:"gossipsub"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#identify",children:"identify"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#kademlia-kad",children:"kad"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#mdns-multicast-dns",children:"mdns"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#ping",children:"ping"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#rendezvous",children:"rendezvous"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#relay",children:"relay"})}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Behavior:"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Configuration:"})," A client node can be configured to use zero boot nodes."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"External Address:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Direct Public External Address:"})," Nodes with a direct public external\naddress do not require reservation at the relay server. These nodes\npublish their public external address to the Kademlia DHT, making them\ndirectly accessible to other peers."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Relayed External Address:"})," Nodes that do not have a direct public\nexternal address, typically those behind a NAT or firewall, can obtain a\nrelayed external address by requesting a reservation at a relay server.\nOnce the reservation is accepted, the node publishes its new external\naddress to the rendezvous server. This allows other nodes to discover\nrelayed addresses of a peers in a certain rendezvous namespace. The relay\nserver can be used for the coordination of the hole punching between two\nnodes. If the hole punching attempt fails, the relay server will bridge\nthe traffic."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Discovery Protocols:"})," ",(0,r.jsx)(n.code,{children:"mDNS"}),", ",(0,r.jsx)(n.code,{children:"rendezvous"})," and ",(0,r.jsx)(n.code,{children:"Kademlia"})]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Connection Management:"})," A peer, identified via PeerId, can be discovered\neither via mDNS, rendezvous or Kademlia. mDNS discovery provides local\nnetwork addresses, rendezvous discovery provides relayed addresses, and\nKademlia discovery provides direct public external addresses. The node\nmaintains information about its connections to peers, including the\ndiscovery source. For a discovered external address, either relayed or\ndirect public, the node will only attempt to dial the peer if the same peer\nis not already connected via a discovered local address. This ensures that\nlocal connections have higher priority and that there are no unnecessary\nhole punching attempts."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Message Relaying:"})," The node participates in the ",(0,r.jsx)(n.code,{children:"gossipsub"})," protocol,\nrelaying messages to all connected peers that support it. This enables\nefficient and scalable message dissemination across the network."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"boot-node",children:"Boot Node"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Deployment:"})," Must run on a publicly available machine with a static IP\naddress."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Protocols Utilized:"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#identify",children:"identify"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#kademlia-kad",children:"kad"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#ping",children:"ping"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#rendezvous",children:"rendezvous"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#relay",children:"relay"})}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Behavior:"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Characteristics:"})," Boot nodes are publicly available, long-running nodes\nthat provide stable entry points to the network."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Functions:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Bootstrap Node:"})," Acts as a well-known peer for the Kademlia protocol,\nfacilitating peer discovery and network join operations."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Circuit Relay Server:"})," Serves as a generic relay that provides the\nmedium that facilitates the hole punching, enabling peers to establish\ndirect connections even when they are behind NAT or firewalls. The relay\nserver is used for the coordination of the hole punching between two\nnodes, and briding traffic if the hole punching attempt fails."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Rendezvous Server:"})," Facilitates peer discovery by allowing nodes to\nregister their presence and query for other peers within a shared\nrendezvous namespace. This enables dynamic and efficient peer-to-peer\nconnections without relying on a static list of peers."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"p2p-protocols-and-techniques",children:"P2P protocols and techniques"}),"\n",(0,r.jsx)(n.h3,{id:"protocol-descriptions",children:"Protocol Descriptions"}),"\n",(0,r.jsx)(n.h4,{id:"dcutr-direct-connection-upgrade-through-relay",children:"DCUtR (Direct Connection Upgrade through Relay)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"DCUtR is used to upgrade connections through relay nodes, allowing peers to\nestablish direct connections even if they are behind NATs or firewalls. Peers\ninitially connect via a relay node, then use the DCUtR protocol to attempt a\ndirect connection, which reduces latency and bandwidth usage."}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Reference:"}),"\n",(0,r.jsx)(n.a,{href:"https://github.com/libp2p/specs/blob/master/relay/DCUtR.md",children:"libp2p DCUtR Documentation"})]}),"\n"]}),"\n",(0,r.jsx)(n.h4,{id:"gossipsub",children:"Gossipsub"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Gossipsub is a scalable and efficient pub-sub protocol for message\ndissemination. It combines the best aspects of gossip protocols and\ntopic-based pub-sub systems. It minimizes bandwidth usage by only gossiping\nmetadata and ensuring that messages are only sent once per peer."}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Reference:"}),"\n",(0,r.jsx)(n.a,{href:"https://github.com/libp2p/specs/tree/master/pubsub/gossipsub",children:"libp2p Gossipsub Documentation"})]}),"\n"]}),"\n",(0,r.jsx)(n.h4,{id:"identify",children:"Identify"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"The Identify protocol allows peers to identify themselves and share their\ncapabilities with other peers. Peers exchange identification information such\nas supported protocols, listen addresses, and public keys. This helps peers\nmake informed decisions about connecting and interacting."}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Reference:"}),"\n",(0,r.jsx)(n.a,{href:"https://github.com/libp2p/specs/blob/master/identify/README.md",children:"libp2p Identify Documentation"})]}),"\n"]}),"\n",(0,r.jsx)(n.h4,{id:"kademlia-kad",children:"Kademlia (Kad)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Kademlia is a distributed hash table (DHT) protocol used for peer discovery\nand data routing. It uses an XOR metric to ensure efficient and scalable peer\nlookup. Each node maintains a routing table with information about other\nnodes, facilitating quick lookups and robust network operation."}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Reference:"}),"\n",(0,r.jsx)(n.a,{href:"https://github.com/libp2p/specs/tree/master/kad-dht",children:"libp2p Kademlia DHT Documentation"})]}),"\n"]}),"\n",(0,r.jsx)(n.h4,{id:"mdns-multicast-dns",children:"mDNS (Multicast DNS)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"mDNS enables local network peer discovery without the need for a central\nserver. It uses multicast DNS to allow peers to find each other on the same\nlocal network by broadcasting their presence and listening for broadcasts from\nother peers."}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Reference:"}),"\n",(0,r.jsx)(n.a,{href:"https://github.com/libp2p/specs/tree/master/discovery/mdns",children:"libp2p mDNS Documentation"})]}),"\n"]}),"\n",(0,r.jsx)(n.h4,{id:"ping",children:"Ping"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"The Ping protocol measures the round-trip time (latency) between peers. It\nregularly pings connected peers and measures the time it takes for a response.\nThis helps in maintaining healthy connections and understanding network\nlatency."}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Reference:"}),"\n",(0,r.jsx)(n.a,{href:"https://github.com/libp2p/go-libp2p-ping",children:"libp2p Ping Documentation"})]}),"\n"]}),"\n",(0,r.jsx)(n.h4,{id:"relay",children:"Relay"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"The Relay protocol supports relay-based communication, allowing peers to\ncommunicate through intermediary nodes when direct connections are not\npossible. Nodes can use relay nodes to forward their traffic, which is\nespecially useful for nodes behind NATs or firewalls. The protocol includes\nmechanisms for reserving relay slots and managing relay connections."}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Reference:"}),"\n",(0,r.jsx)(n.a,{href:"https://github.com/libp2p/specs/tree/master/relay",children:"libp2p Relay Documentation"})]}),"\n"]}),"\n",(0,r.jsx)(n.h4,{id:"rendezvous",children:"Rendezvous"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"The Rendezvous protocol enables peers to discover each other by registering at\nand querying a shared rendezvous point. This is useful for dynamically finding\npeers without needing a central directory or pre-established list of peers.\nPeers register their presence at a rendezvous server and can also query the\nserver to find other peers."}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Reference:"}),"\n",(0,r.jsx)(n.a,{href:"https://github.com/libp2p/specs/tree/master/rendezvous",children:"libp2p Rendezvous Documentation"})]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"nat-traversal-techniques",children:"NAT Traversal Techniques"}),"\n",(0,r.jsxs)(n.p,{children:["One of the common techniques used for NAT traversal in P2P networks is ",(0,r.jsx)(n.strong,{children:"Hole\nPunching"}),". This technique allows two peers, each behind a NAT, to establish a\ndirect connection with each other. Here's a brief explanation:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Hole Punching:"})," This technique involves three steps:","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Step 1 - Connection to Public Server:"}),' Both peers initially connect to a\npublic server (in this case, the relay server). This creates a NAT mapping\n(a "hole") for outgoing packets to the server.']}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Step 2 - Exchange of Address Information:"})," The server shares the public\naddress information of each peer with the other. This information includes\nthe IP address and port number that the NAT has assigned for the connection\nto the server."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Step 3 - Direct Connection:"})," Each peer sends a packet to the other peer's\npublic address. Since a mapping for this address already exists in the NAT\n(from the connection to the server), the NAT forwards the packet to the\nappropriate internal address, and a direct connection is established."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"This technique is particularly useful in P2P networks, as it allows peers to\ncommunicate directly, reducing the load on relay servers and improving network\nefficiency. However, it's worth noting that hole punching may not work with all\ntypes of NATs, and success can depend on the specific NAT implementation and\nconfiguration."}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Reference:"}),"\n",(0,r.jsx)(n.a,{href:"https://blog.ipfs.tech/2022-01-20-libp2p-hole-punching/",children:"Hole punching in libp2p"})]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Reference:"}),"\n",(0,r.jsx)(n.a,{href:"https://tailscale.com/blog/how-nat-traversal-works",children:"How NAT traversal works"})]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},5248:(e,n,i)=>{i.d(n,{R:()=>o,x:()=>l});var s=i(758);const r={},t=s.createContext(r);function o(e){const n=s.useContext(t);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),s.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/fddb659c.d2603a4e.js b/assets/js/fddb659c.d2603a4e.js new file mode 100644 index 00000000..90690455 --- /dev/null +++ b/assets/js/fddb659c.d2603a4e.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4376,8493],{1105:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>h,frontMatter:()=>s,metadata:()=>r,toc:()=>d});const r=JSON.parse('{"id":"core-concepts/blockchains-integration","title":"Blockchains Integration","description":"Calimero offers integration with multiple blockchain protocols, allowing users","source":"@site/docs/03-core-concepts/06-blockchain-integration.mdx","sourceDirName":"03-core-concepts","slug":"/core-concepts/blockchains-integration","permalink":"/core-concepts/blockchains-integration","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/03-core-concepts/06-blockchain-integration.mdx","tags":[],"version":"current","lastUpdatedAt":1734699364000,"sidebarPosition":6,"frontMatter":{"id":"blockchains-integration","title":"Blockchains Integration"},"sidebar":"tutorialSidebar","previous":{"title":"Applications","permalink":"/core-concepts/applications"},"next":{"title":"Encryption","permalink":"/core-concepts/encryption"}}');var o=t(6070),a=t(5248),i=t(6846);const s={id:"blockchains-integration",title:"Blockchains Integration"},l="Blockchain Integrations",c={},d=[{value:"Current Blockchain Integrations",id:"current-blockchain-integrations",level:2},{value:"Operations",id:"operations",level:2},{value:"Functionalities",id:"functionalities",level:2},{value:"Functionality Details",id:"functionality-details",level:2},{value:"Calimero Contracts",id:"calimero-contracts",level:2},{value:"Context Contract",id:"context-contract",level:3},{value:"Proxy Contract",id:"proxy-contract",level:3},{value:"Deployment of Contracts",id:"deployment-of-contracts",level:3},{value:"Context Contract",id:"context-contract-1",level:4},{value:"Proxy Contract",id:"proxy-contract-1",level:4},{value:"Example Application",id:"example-application",level:3},...i.toc];function u(e){const n={a:"a",admonition:"admonition",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",li:"li",mermaid:"mermaid",p:"p",strong:"strong",ul:"ul",...(0,a.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.header,{children:(0,o.jsx)(n.h1,{id:"blockchain-integrations",children:"Blockchain Integrations"})}),"\n",(0,o.jsx)(n.p,{children:"Calimero offers integration with multiple blockchain protocols, allowing users\nto interact with the blockchain and perform read and write operations."}),"\n",(0,o.jsx)(n.h2,{id:"current-blockchain-integrations",children:"Current Blockchain Integrations"}),"\n",(0,o.jsx)(n.p,{children:"Calimero currently supports the following blockchain protocols:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"NEAR"}),"\n",(0,o.jsx)(n.li,{children:"Starknet"}),"\n",(0,o.jsx)(n.li,{children:"Internet Computer (ICP)"}),"\n"]}),"\n",(0,o.jsx)("div",{style:{display:"flex",justifyContent:"center"},children:(0,o.jsx)(n.mermaid,{value:"graph TD\nA[Calimero] --\x3e B[Integrations]\nB --\x3e C[NEAR]\nB --\x3e D[Starknet]\nB --\x3e E[ICP]"})}),"\n",(0,o.jsx)(n.h2,{id:"operations",children:"Operations"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"Read"}),"\n",(0,o.jsx)(n.li,{children:"Read the data from the Calimero contracts."}),"\n",(0,o.jsx)(n.li,{children:"Write"}),"\n",(0,o.jsx)(n.li,{children:"Write data to any contract on the same blockchain protocol through\ncross-contract calls in the Proxy Contract."}),"\n"]}),"\n",(0,o.jsx)("div",{style:{display:"flex",justifyContent:"center"},children:(0,o.jsx)(n.mermaid,{value:"graph TD\nA[Calimero]\nB[Context Contract]\nC[Proxy Contract]\nD[Transfers]\nE[Cross-Contract Calls]\n\nA <--\x3e B\nA <--\x3e C\nC --\x3e D\nC --\x3e E"})}),"\n",(0,o.jsx)(n.h2,{id:"functionalities",children:"Functionalities"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"Cross-contract calls"}),"\n",(0,o.jsx)(n.li,{children:"Transfers"}),"\n",(0,o.jsx)(n.li,{children:"Storage of arbitrary data"}),"\n",(0,o.jsx)(n.li,{children:"Configuration of the internal configuration variables"}),"\n",(0,o.jsx)(n.li,{children:"Proposal creation and execution"}),"\n"]}),"\n",(0,o.jsx)("div",{style:{display:"flex",justifyContent:"center"},children:(0,o.jsx)(n.mermaid,{value:"graph TD\nA[Proxy Contract] --\x3e|Cross-contract Calls| B[Other Contracts]\nA --\x3e|Transfers| C[Token Transfers]\nA --\x3e|Data Storage| D[Key-Value Storage]\nA --\x3e|Configuration| E[Internal Variables]\nE --\x3e|Change Votes Required| F[Vote Configuration]\nE --\x3e|Change Proposal Limits| G[Proposal Limits]"})}),"\n",(0,o.jsx)(n.h2,{id:"functionality-details",children:"Functionality Details"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Cross-contract calls"}),": Proxy contract allows making cross-contract calls to\nother contracts on the same blockchain protocol. Users need to specify the\ncontract address, the method to call, and the arguments for that method."]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Transfers"}),": Proxy contract allows transferring tokens to the specified\naddress. Users need to specify the recipient address and the amount of tokens\nto transfer."]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Storage of arbitrary data"}),": Proxy contract allows storing arbitrary data in\nthe context storage. Users need to specify the key and the value for the data\nto be stored."]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Configuration of the internal configuration variables"}),": Configure the\ninternal configuration variables of the Calimero contracts:"]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Vote configuration"}),": Number of votes required for a proposals to be\napproved (u32)"]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Proposal limits"}),": Maximum number of proposals that one user can have at the\nsame time(u32)"]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Proposal creation and execution"}),": Proposals are created by users and\ncontain one or multiple actions that are voted on by the users of the context.\nIf a proposal is approved, it is automatically executed by the Calimero Proxy\nContract."]}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"calimero-contracts",children:"Calimero Contracts"}),"\n",(0,o.jsx)(n.p,{children:"Calimero integrates two types of contracts for each blockchain protocol:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"Context Contract"}),"\n",(0,o.jsx)(n.li,{children:"Proxy Contract"}),"\n"]}),"\n",(0,o.jsx)("div",{style:{display:"flex",justifyContent:"center"},children:(0,o.jsx)(n.mermaid,{value:"graph TD\nA[User] --\x3e|Creates Context| B[Context Contract]\nB --\x3e|Creates| C[Context]\nB --\x3e|Adds Admin| D[User as Admin]\nB --\x3e|Deploys| E[Proxy Contract]\nE --\x3e|Handles| F[Proposals, Votes, Execution]\nF --\x3e|Executes Actions| G[Blockchain Operations]"})}),"\n",(0,o.jsx)(n.h3,{id:"context-contract",children:"Context Contract"}),"\n",(0,o.jsx)(n.p,{children:"The Context Contract is responsible for creating contexts, adding and removing\nmembers, editing their privileges, and associating specific applications with a\ncontext."}),"\n",(0,o.jsx)(n.h3,{id:"proxy-contract",children:"Proxy Contract"}),"\n",(0,o.jsx)(n.p,{children:"Each context has its own Proxy Contract instance which is deployed during the\ncontext creation."}),"\n",(0,o.jsx)("div",{style:{display:"flex",justifyContent:"center",margin:"2rem"},children:(0,o.jsx)(n.mermaid,{value:"graph TD\nA[User] --\x3e|Creates Proposal| B[Proxy Contract]\nB --\x3e|Stores Proposal| C[Proposal Storage]\nC --\x3e|Voting by Members| D{Required Votes Met?}\nD --\x3e|Yes| E[Execute Proposal]\nD --\x3e|No| F[Store Vote Count]"})}),"\n",(0,o.jsxs)(n.p,{children:["Tutorial on how to use proxy contract functionalities is available in\n",(0,o.jsx)(n.a,{href:"../../tutorials/proxy-contract-interaction",children:"tutorials section"})]}),"\n",(0,o.jsx)(n.h3,{id:"deployment-of-contracts",children:"Deployment of Contracts"}),"\n",(0,o.jsx)(n.h4,{id:"context-contract-1",children:"Context Contract"}),"\n",(0,o.jsx)(n.p,{children:"Context Contract is predeployed on each blockchain by the Calimero team."}),"\n",(0,o.jsx)(n.h4,{id:"proxy-contract-1",children:"Proxy Contract"}),"\n",(0,o.jsx)(n.p,{children:"Proxy Contract is deployed during the context creation."}),"\n",(0,o.jsx)("div",{style:{display:"flex",justifyContent:"center",margin:"2rem"},children:(0,o.jsx)(n.mermaid,{value:"graph TD\nA[Calimero Team] --\x3e|Pre-deploys| B[Context Contract]\nB --\x3e|During Context Creation| C[Proxy Contract]\nC --\x3e|Unique Instance| D[Context-specific Proxy]"})}),"\n",(0,o.jsx)(n.admonition,{type:"info",children:(0,o.jsx)(n.p,{children:"Proxy Contract is deployed on the same blockchain as the Context Contract."})}),"\n",(0,o.jsx)(n.admonition,{type:"warning",children:(0,o.jsx)(n.p,{children:"Users are responsible for funding the Proxy Contract."})}),"\n",(0,o.jsx)(n.h3,{id:"example-application",children:"Example Application"}),"\n",(0,o.jsx)(n.p,{children:"We have an example application that connects to Calimero Proxy Contract and\nallows creating proposals, voting on them, and executing the approved proposals."}),"\n",(0,o.jsx)("div",{style:{display:"flex",justifyContent:"center",margin:"2rem"},children:(0,o.jsx)(n.mermaid,{value:"graph TD\nA[Application] --\x3e|Connects to| B[Calimero Proxy Contract]\nB --\x3e|Handles| C[Proposals]\nC --\x3e|Create| D[New Proposals]\nC --\x3e|Approve| E[Proposal Voting]\nC --\x3e|Delete| J[Delete Proposal]\nE --\x3e|Check Votes| F{Required Votes Met?}\nF --\x3e|Yes| G[Execute Proposal]\nG --\x3e|Perform Actions| H[Blockchain Operations]\nF --\x3e|No| I[Store Vote Count]"})}),"\n",(0,o.jsx)(n.p,{children:"Application showcases all the actions that can be done on the Proxy Contract."}),"\n",(0,o.jsx)(n.p,{children:"To create context on specific blockchain user will need to add the --protocol\nwhen initializing the node"}),"\n",(0,o.jsx)(i.default,{}),"\n",(0,o.jsxs)(n.p,{children:["Full source code is available in our GitHub\n",(0,o.jsx)(n.a,{href:"https://github.com/calimero-network/demo-blockchain-integrations",children:"repository"}),"."]})]})}function h(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(u,{...e})}):u(e)}},6846:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>c,default:()=>p,frontMatter:()=>l,metadata:()=>r,toc:()=>u});const r=JSON.parse('{"id":"shared/node-init-binary","title":"node-init-binary","description":"{t.d(n,{A:()=>i});t(758);var r=t(3526);const o={tabItem:"tabItem_KLga"};var a=t(6070);function i(e){let{children:n,hidden:t,className:i}=e;return(0,a.jsx)("div",{role:"tabpanel",className:(0,r.A)(o.tabItem,i),hidden:t,children:n})}},3505:(e,n,t)=>{t.d(n,{A:()=>y});var r=t(758),o=t(3526),a=t(8155),i=t(5557),s=t(5536),l=t(7852),c=t(1381),d=t(4012);function u(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:t}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return u(e).map((e=>{let{props:{value:n,label:t,attributes:r,default:o}}=e;return{value:n,label:t,attributes:r,default:o}}))}(t);return function(e){const n=(0,c.XI)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function p(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:t}=e;const o=(0,i.W6)(),a=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,l.aZ)(a),(0,r.useCallback)((e=>{if(!a)return;const n=new URLSearchParams(o.location.search);n.set(a,e),o.replace({...o.location,search:n.toString()})}),[a,o])]}function m(e){const{defaultValue:n,queryString:t=!1,groupId:o}=e,a=h(e),[i,l]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=t.find((e=>e.default))??t[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:a}))),[c,u]=x({queryString:t,groupId:o}),[m,f]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[o,a]=(0,d.Dv)(t);return[o,(0,r.useCallback)((e=>{t&&a.set(e)}),[t,a])]}({groupId:o}),g=(()=>{const e=c??m;return p({value:e,tabValues:a})?e:null})();(0,s.A)((()=>{g&&l(g)}),[g]);return{selectedValue:i,selectValue:(0,r.useCallback)((e=>{if(!p({value:e,tabValues:a}))throw new Error(`Can't select invalid tab value=${e}`);l(e),u(e),f(e)}),[u,f,a]),tabValues:a}}var f=t(2236);const g={tabList:"tabList_B3_y",tabItem:"tabItem_z210"};var b=t(6070);function C(e){let{className:n,block:t,selectedValue:r,selectValue:i,tabValues:s}=e;const l=[],{blockElementScrollPositionUntilNextRender:c}=(0,a.a_)(),d=e=>{const n=e.currentTarget,t=l.indexOf(n),o=s[t].value;o!==r&&(c(n),i(o))},u=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const t=l.indexOf(e.currentTarget)+1;n=l[t]??l[0];break}case"ArrowLeft":{const t=l.indexOf(e.currentTarget)-1;n=l[t]??l[l.length-1];break}}n?.focus()};return(0,b.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.A)("tabs",{"tabs--block":t},n),children:s.map((e=>{let{value:n,label:t,attributes:a}=e;return(0,b.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>l.push(e),onKeyDown:u,onClick:d,...a,className:(0,o.A)("tabs__item",g.tabItem,a?.className,{"tabs__item--active":r===n}),children:t??n},n)}))})}function j(e){let{lazy:n,children:t,selectedValue:a}=e;const i=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=i.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:(0,o.A)("margin-top--md",e.props.className)}):null}return(0,b.jsx)("div",{className:"margin-top--md",children:i.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==a})))})}function v(e){const n=m(e);return(0,b.jsxs)("div",{className:(0,o.A)("tabs-container",g.tabList),children:[(0,b.jsx)(C,{...n,...e}),(0,b.jsx)(j,{...n,...e})]})}function y(e){const n=(0,f.A)();return(0,b.jsx)(v,{...e,children:u(e.children)},String(n))}},5383:(e,n,t)=>{t.d(n,{A:()=>r});const r=t.p+"assets/images/icp-config-ceda025dead6d3c8de0513840466dd31.png"},391:(e,n,t)=>{t.d(n,{A:()=>r});const r=t.p+"assets/images/near-config-7f7de7e5e857b8d6dca8bda6b8a39f0d.png"},2524:(e,n,t)=>{t.d(n,{A:()=>r});const r=t.p+"assets/images/sn-config-a1900f2dc94f3dcd2cd7204c62421de2.png"},5248:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>s});var r=t(758);const o={},a=r.createContext(o);function i(e){const n=r.useContext(a);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:i(e.components),r.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/ff529293.44665598.js b/assets/js/ff529293.44665598.js deleted file mode 100644 index ca5a1f51..00000000 --- a/assets/js/ff529293.44665598.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5183],{1307:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>l,contentTitle:()=>i,default:()=>d,frontMatter:()=>a,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"core-concepts/blockchains-integration/proxy-contract-interaction","title":"Proxy Contract Interaction Guide","description":"Overview","source":"@site/docs/03-core-concepts/06-blockchains-integration/04-proxy-contract-interaction.mdx","sourceDirName":"03-core-concepts/06-blockchains-integration","slug":"/core-concepts/blockchains-integration/proxy-contract-interaction","permalink":"/core-concepts/blockchains-integration/proxy-contract-interaction","draft":false,"unlisted":false,"editUrl":"https://github.com/calimero-network/calimero-network.github.io/edit/master/docs/03-core-concepts/06-blockchains-integration/04-proxy-contract-interaction.mdx","tags":[],"version":"current","lastUpdatedAt":1734697738000,"sidebarPosition":4,"frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"Proxy Contract","permalink":"/core-concepts/blockchains-integration/proxy-contract"},"next":{"title":"Encryption","permalink":"/core-concepts/encryption"}}');var o=r(6070),s=r(5248);const a={},i="Proxy Contract Interaction Guide",l={},c=[{value:"Overview",id:"overview",level:2},{value:"Backend Implementation",id:"backend-implementation",level:2},{value:"API Types",id:"api-types",level:2},{value:"API Implementation",id:"api-implementation",level:2},{value:"Creating Proposals",id:"creating-proposals",level:2},{value:"1. External Function Call",id:"1-external-function-call",level:3},{value:"2. Token Transfer",id:"2-token-transfer",level:3},{value:"3. Set Context Value",id:"3-set-context-value",level:3},{value:"4. Set Number of Approvals",id:"4-set-number-of-approvals",level:3},{value:"5. Set Active Proposals Limit",id:"5-set-active-proposals-limit",level:3},{value:"Approving Proposals",id:"approving-proposals",level:2},{value:"Error Handling",id:"error-handling",level:2},{value:"Best Practices",id:"best-practices",level:2}];function p(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.header,{children:(0,o.jsx)(n.h1,{id:"proxy-contract-interaction-guide",children:"Proxy Contract Interaction Guide"})}),"\n",(0,o.jsx)(n.h2,{id:"overview",children:"Overview"}),"\n",(0,o.jsx)(n.p,{children:"The Calimero proxy contract enables cross-chain interactions through a\nproposal-based system. The integration consists of:"}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsx)(n.li,{children:"Backend Application (Rust)"}),"\n",(0,o.jsx)(n.li,{children:"Frontend Application (TypeScript/React)"}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"backend-implementation",children:"Backend Implementation"}),"\n",(0,o.jsx)(n.p,{children:"The backend contract handles proposal creation and management. Here's the core\nfunctionality:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-rust",children:"#[app::logic]\nimpl AppState {\n pub fn create_new_proposal(&mut self, request: CreateProposalRequest) -> Result {\n // Implementation handles different types of proposals:\n // 1. ExternalFunctionCall\n // 2. Transfer\n // 3. SetContextValue\n // 4. SetNumApprovals\n // 5. SetActiveProposalsLimit\n }\n\n pub fn approve_proposal(&self, proposal_id: ProposalId) -> Result<(), Error> {\n Self::external().approve(proposal_id);\n env::emit(&Event::ApprovedProposal { id: proposal_id });\n Ok(())\n }\n}\n"})}),"\n",(0,o.jsx)(n.h2,{id:"api-types",children:"API Types"}),"\n",(0,o.jsx)(n.p,{children:"Define your types for the integration:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typescript",children:"// types.ts\nexport enum ProposalActionType {\n ExternalFunctionCall = 'ExternalFunctionCall',\n Transfer = 'Transfer',\n SetNumApprovals = 'SetNumApprovals',\n SetActiveProposalsLimit = 'SetActiveProposalsLimit',\n SetContextValue = 'SetContextValue',\n}\n\nexport interface CreateProposalRequest {\n action_type: ProposalActionType;\n params: {\n receiver_id?: string;\n method_name?: string;\n args?: string;\n deposit?: string;\n gas?: string;\n amount?: string;\n num_approvals?: number;\n active_proposals_limit?: number;\n key?: string;\n value?: string;\n };\n}\n"})}),"\n",(0,o.jsx)(n.h2,{id:"api-implementation",children:"API Implementation"}),"\n",(0,o.jsx)(n.p,{children:"Create a data source to handle API calls:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typescript",children:"// LogicApiDataSource.ts\nexport class LogicApiDataSource implements ClientApi {\n async createProposal(\n request: CreateProposalRequest,\n ): ApiResponse {\n const params: RpcQueryParams = {\n contextId: getContextId(),\n method: ClientMethod.CREATE_PROPOSAL,\n argsJson: { request },\n executorPublicKey: jwtObject.executor_public_key,\n };\n\n return await getJsonRpcClient().execute(params, config);\n }\n\n async approveProposal(\n request: ApproveProposalRequest,\n ): ApiResponse {\n // Implementation\n }\n}\n"})}),"\n",(0,o.jsx)(n.h2,{id:"creating-proposals",children:"Creating Proposals"}),"\n",(0,o.jsx)(n.p,{children:"Here are examples of creating different types of proposals:"}),"\n",(0,o.jsx)(n.h3,{id:"1-external-function-call",children:"1. External Function Call"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typescript",children:"const request: CreateProposalRequest = {\n action_type: 'ExternalFunctionCall',\n params: {\n receiver_id: 'contract.near',\n method_name: 'transfer',\n args: JSON.stringify({ amount: '100' }),\n deposit: '1000000000000000000000', // 1 NEAR\n gas: '30000000000000', // 30 TGas\n },\n};\n"})}),"\n",(0,o.jsx)(n.h3,{id:"2-token-transfer",children:"2. Token Transfer"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typescript",children:"const request: CreateProposalRequest = {\n action_type: 'Transfer',\n params: {\n receiver_id: 'recipient.near',\n amount: '1000000000000000000000', // 1 NEAR\n },\n};\n"})}),"\n",(0,o.jsx)(n.h3,{id:"3-set-context-value",children:"3. Set Context Value"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typescript",children:"const request: CreateProposalRequest = {\n action_type: 'SetContextValue',\n params: {\n key: 'my_key',\n value: 'my_value',\n },\n};\n"})}),"\n",(0,o.jsx)(n.h3,{id:"4-set-number-of-approvals",children:"4. Set Number of Approvals"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typescript",children:"const request: CreateProposalRequest = {\n action_type: 'SetNumApprovals',\n params: {\n num_approvals: 3,\n },\n};\n"})}),"\n",(0,o.jsx)(n.h3,{id:"5-set-active-proposals-limit",children:"5. Set Active Proposals Limit"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typescript",children:"const request: CreateProposalRequest = {\n action_type: 'SetActiveProposalsLimit',\n params: {\n active_proposals_limit: 10,\n },\n};\n"})}),"\n",(0,o.jsx)(n.h2,{id:"approving-proposals",children:"Approving Proposals"}),"\n",(0,o.jsx)(n.p,{children:"To approve a proposal:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typescript",children:"const approvalRequest: ApproveProposalRequest = {\n proposal_id: 'proposal-id-here',\n};\n\nawait logicApiDataSource.approveProposal(approvalRequest);\n"})}),"\n",(0,o.jsx)(n.h2,{id:"error-handling",children:"Error Handling"}),"\n",(0,o.jsx)(n.p,{children:"The implementation includes comprehensive error handling:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typescript",children:"try {\n const result = await logicApiDataSource.createProposal(request);\n if (result?.error) {\n console.error('Error:', result.error);\n // Handle error appropriately\n }\n} catch (error) {\n console.error('Unexpected error:', error);\n // Handle unexpected errors\n}\n"})}),"\n",(0,o.jsx)(n.h2,{id:"best-practices",children:"Best Practices"}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Input Validation"})}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"Validate all parameters before sending"}),"\n",(0,o.jsx)(n.li,{children:"Use appropriate types for amounts (strings for large numbers)"}),"\n",(0,o.jsx)(n.li,{children:"Format JSON strings properly"}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Error Handling"})}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"Implement proper error handling"}),"\n",(0,o.jsx)(n.li,{children:"Log important operations"}),"\n",(0,o.jsx)(n.li,{children:"Handle all possible error cases"}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Gas Management"})}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"Use appropriate gas limits"}),"\n",(0,o.jsx)(n.li,{children:"Default to 30 TGas for NEAR"}),"\n",(0,o.jsx)(n.li,{children:"Monitor gas usage"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:["Need help? Join our ",(0,o.jsx)(n.a,{href:"https://discord.gg/calimero",children:"Discord"})," or check our\n",(0,o.jsx)(n.a,{href:"https://github.com/calimero-network/docs",children:"GitHub"}),"."]})]})}function d(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(p,{...e})}):p(e)}},5248:(e,n,r)=>{r.d(n,{R:()=>a,x:()=>i});var t=r(758);const o={},s=t.createContext(o);function a(e){const n=t.useContext(s);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:a(e.components),t.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/main.62468ba4.js b/assets/js/main.62468ba4.js deleted file mode 100644 index b35c0790..00000000 --- a/assets/js/main.62468ba4.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see main.62468ba4.js.LICENSE.txt */ -(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8792],{934:(e,t,n)=>{"use strict";n.d(t,{Bc:()=>T,E8:()=>Zn,a1:()=>Qn});var r=n(758);n(8143);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"),c=r.call(i,"finallyLoc");if(s&&c){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),j(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;j(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 v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(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,c=!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){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)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(h())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&v(o,n.prototype),o}(e,arguments,f(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),v(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"],A="Ctrl",T=r.forwardRef((function(e,t){var n=e.translations,o=void 0===n?{}:n,a=y(e,O),i=o.buttonText,l=void 0===i?"Search":i,s=o.buttonAriaLabel,c=void 0===s?"Search":s,u=w((0,r.useState)(null),2),f=u[0],p=u[1];(0,r.useEffect)((function(){"undefined"!=typeof navigator&&(/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)?p("\u2318"):p(A))}),[]);var h=w(f===A?[A,"Ctrl",r.createElement(E,null)]:["Meta","Command",f],3),m=h[0],g=h[1],b=h[2];return r.createElement("button",d({type:"button",className:"DocSearch DocSearch-Button","aria-label":"".concat(c," (").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!==f&&r.createElement(r.Fragment,null,r.createElement(C,{reactsToKey:m},b),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 j(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 W(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 K(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",Y(t),t[0].items)},clickedObjectIDs:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&a("clickedObjectIDs",Y(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",Y(t),t[0].items)},convertedObjectIDs:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&a("convertedObjectIDs",Y(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=q(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 Z(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 X(e){return e.objectID&&e.__autocomplete_indexName&&e.__autocomplete_queryID}function J(e){return J="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},J(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:c,state:t}))}}),0);return{name:"aa.algoliaInsightsPlugin",subscribe:function(e){var t=e.setContext,n=e.onSelect,r=e.onActive,o=!1;function u(e){t({algoliaInsightsPlugin:{__algoliaSearchParameters:re(re({},l?{clickAnalytics:!0}:{}),e?{userToken:ue(e)}:{}),insights:c}})}s("addAlgoliaAgent","insights-plugin"),u(),s("onUserTokenChange",(function(e){o||u(e)})),s("getUserToken",null,(function(e,t){o||u(t)})),s("onAuthenticatedUserTokenChange",(function(e){e?(o=!0,u(e)):(o=!1,s("getUserToken",null,(function(e,t){return u(t)})))})),s("getAuthenticatedUserToken",null,(function(e,t){t&&(o=!0,u(t))})),n((function(e){var t=e.item,n=e.state,r=e.event,o=e.source;X(t)&&a({state:n,event:r,insights:c,item:t,insightsEvents:[re({eventName:"Item Selected"},F({item:t,items:o.getItems().filter(X)}))]})})),r((function(e){var t=e.item,n=e.source,r=e.state,o=e.event;X(t)&&i({state:r,event:o,insights:c,item:t,insightsEvents:[re({eventName:"Item Active"},F({item:t,items:n.getItems().filter(X)}))]})}))},onStateChange:function(e){var t=e.state;d({state:t})},__autocomplete_pluginOptions:e}}function ce(){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 ue(e){return"number"==typeof e?e.toString():e}function de(e,t){var n=t;return{then:function(t,r){return de(e.then(pe(t,n,e),pe(r,n,e)),n)},catch:function(t){return de(e.catch(pe(t,n,e)),n)},finally:function(t){return t&&n.onCancelList.push(t),de(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 fe(e){return de(e,{isCanceled:!1,onCancelList:[]})}function pe(e,t,n){return e?function(n){return t.isCanceled?n:e(n)}:n}function he(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 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 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:D,onResolve:D};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 De(e){return De="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},De(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,Ye);nt&&o.environment.clearTimeout(nt);var c=s.setCollections,u=s.setIsOpen,d=s.setQuery,f=s.setActiveItemId,p=s.setStatus,h=s.setContext;if(d(a),f(o.defaultActiveItemId),!a&&!1===o.openOnFocus){var m,g=l.getState().collections.map((function(e){return Ze(Ze({},e),{},{items:[]})}));p("idle"),c(g),u(null!==(m=r.isOpen)&&void 0!==m?m:o.shouldPanelOpen({state:l.getState()}));var y=fe(rt(g).then((function(){return Promise.resolve()})));return l.pendingRequests.add(y)}p("loading"),nt=o.environment.setTimeout((function(){p("stalled")}),o.stallThreshold);var b=fe(rt(o.getSources(Ze({query:a,refresh:i,state:l.getState()},s)).then((function(e){return Promise.all(e.map((function(e){return Promise.resolve(e.getItems(Ze({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(Ve(Object.keys(n.context).map((function(e){var t;return null===(t=n.context[e])||void 0===t?void 0:t.__algoliaSearchParameters}))))):{};return $e($e({},e),{},{requests:e.queries.map((function(n){return{query:"algolia"===e.requesterId?$e($e({},n),{},{params:$e($e({},r),n.params)}):n,sourceId:t,transformResponse:e.transformResponse}}))})}var o;return{items:e,sourceId:t}}(t,e.sourceId,l.getState())}))}))).then(Ke).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&&h({algoliaInsightsPlugin:Ze(Ze({},(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"),c(e);var d=o.shouldPanelOpen({state:l.getState()});u(null!==(n=r.isOpen)&&void 0!==n?n:o.openOnFocus&&!a&&d||d);var f=ve(l.getState());if(null!==l.getState().activeItemId&&f){var h=f.item,m=f.itemInputValue,g=f.itemUrl,y=f.source;y.onActive(Ze({event:t,item:h,itemInputValue:m,itemUrl:g,refresh:i,source:y,state:l.getState()},s))}})).finally((function(){p("idle"),nt&&o.environment.clearTimeout(nt)}));return l.pendingRequests.add(b)}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,dt);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 bt({onTouchStart:i,onMouseDown:i,onTouchMove:function(e){!1!==r.getState().isOpen&&n===t.environment.document.activeElement&&e.target!==n&&n.blur()}},wt(e,ft))},getRootProps:function(e){return bt({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,bt({action:"",noValidate:!0,role:"search",onSubmit:function(a){var i;a.preventDefault(),t.onSubmit(bt({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(bt({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 bt({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(bt({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,c=void 0===s?512:s,u=wt(l,ht),d=ve(r.getState()),f=function(e){return Boolean(e&&e.match(Se))}((null===(a=t.environment.navigator)||void 0===a?void 0:a.userAgent)||""),p=t.enterKeyHint||(null!=d&&d.itemUrl&&!f?"go":"search");return bt({"aria-autocomplete":"both","aria-activedescendant":r.getState().isOpen&&null!==r.getState().activeItemId?we(t.id,"item-".concat(r.getState().activeItemId),null==d?void 0:d.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:c,type:"search",onChange:function(e){var a=e.currentTarget.value;t.ignoreCompositionEvents&&ke(e).isComposing?o.setQuery(a):ot(bt({event:e,props:t,query:a.slice(0,c),refresh:n,store:r},o))},onCompositionEnd:function(e){ot(bt({event:e,props:t,query:e.currentTarget.value.slice(0,c),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=ve(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=ve(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=ve(o.getState()),c=s.item,u=s.itemInputValue,d=s.itemUrl,f=s.source;if(t.metaKey||t.ctrlKey)void 0!==d&&(f.onSelect(st({event:t,item:c,itemInputValue:u,itemUrl:d,refresh:r,source:f,state:o.getState()},a)),n.navigator.navigateNewTab({itemUrl:d,item:c,state:o.getState()}));else if(t.shiftKey)void 0!==d&&(f.onSelect(st({event:t,item:c,itemInputValue:u,itemUrl:d,refresh:r,source:f,state:o.getState()},a)),n.navigator.navigateNewWindow({itemUrl:d,item:c,state:o.getState()}));else if(t.altKey);else{if(void 0!==d)return f.onSelect(st({event:t,item:c,itemInputValue:u,itemUrl:d,refresh:r,source:f,state:o.getState()},a)),void n.navigator.navigate({itemUrl:d,item:c,state:o.getState()});ot(st({event:t,nextState:{isOpen:!1},props:n,query:u,refresh:r,store:o},a)).then((function(){f.onSelect(st({event:t,item:c,itemInputValue:u,itemUrl:d,refresh:r,source:f,state:o.getState()},a))}))}}}(bt({event:e,props:t,refresh:n,store:r},o))},onFocus:i,onBlur:D,onClick:function(n){e.inputElement!==t.environment.document.activeElement||r.getState().isOpen||i(n)}},u)},getPanelProps:function(e){return bt({onMouseDown:function(e){e.preventDefault()},onMouseLeave:function(){r.dispatch("mouseleave",null)}},e)},getListProps:function(e){var n=e||{},r=n.source,o=wt(n,mt);return bt({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 bt({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=ve(r.getState());if(null!==r.getState().activeItemId&&t){var i=t.item,l=t.itemInputValue,s=t.itemUrl,c=t.source;c.onActive(bt({event:e,item:i,itemInputValue:l,itemUrl:s,refresh:n,source:c,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(bt({event:e,nextState:{isOpen:!1},props:t,query:l,refresh:n,store:r},o))).then((function(){i.onSelect(bt({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(u," "),r.createElement("a",{href:o.getMissingResultsUrl({query:o.state.query}),target:"_blank",rel:"noopener noreferrer"},f)))}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=y(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,d({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,c=e.hitComponent,u=w(r.useState(!1),2),f=u[0],p=u[1],h=w(r.useState(!1),2),m=h[0],g=h[1],y=r.useRef(null),b=c;return r.createElement("li",d({className:["DocSearch-Hit",t.__docsearch_parent&&"DocSearch-Hit--Child",f&&"DocSearch-Hit--deleting",m&&"DocSearch-Hit--favoriting"].filter(Boolean).join(" "),onTransitionEnd:function(){y.current&&y.current()}},i({item:t,source:s.source,onClick:function(e){l(t,e)}})),r.createElement(b,{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),y.current=e},runFavoriteTransition:function(e){g(!0),y.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 cn(e){return e}function un(e){return 1===e.button||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}function dn(){}var fn=/(|<\/mark>)/g,pn=RegExp(fn.source);function hn(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(fn,""):o.value:e.hierarchy.lvl0}function mn(e){return r.createElement("div",{className:"DocSearch-Dropdown-Container"},e.state.collections.map((function(t){if(0===t.items.length)return null;var n=hn(t.items[0]);return r.createElement(an,d({},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(Kt,{type:o.type})))},renderAction:function(){return r.createElement("div",{className:"DocSearch-Hit-action"},r.createElement(qt,null))}}))})),e.resultsFooterComponent&&r.createElement("section",{className:"DocSearch-HitsFooter"},r.createElement(e.resultsFooterComponent,{state:e.state})))}var gn=["translations"];function yn(e){var t=e.translations,n=void 0===t?{}:t,o=y(e,gn),a=n.recentSearchesTitle,i=void 0===a?"Recent":a,l=n.noRecentSearchesText,s=void 0===l?"No recent searches":l,c=n.saveRecentSearchButtonTitle,u=void 0===c?"Save this search":c,f=n.removeRecentSearchButtonTitle,p=void 0===f?"Remove this search from history":f,h=n.favoriteSearchesTitle,m=void 0===h?"Favorite":h,g=n.removeFavoriteSearchButtonTitle,b=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,d({},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:u,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),n((function(){o.favoriteSearches.add(t),o.recentSearches.remove(t),o.refresh()}))}},r.createElement(Qt,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(Vt,null))))}})),r.createElement(an,d({},o,{title:m,collection:o.state.collections[1],renderIcon:function(){return r.createElement("div",{className:"DocSearch-Hit-icon"},r.createElement(Qt,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:b,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),n((function(){o.favoriteSearches.remove(t),o.refresh()}))}},r.createElement(Vt,null)))}})))}var bn=["translations"],vn=r.memo((function(e){var t=e.translations,n=void 0===t?{}:t,o=y(e,bn);if("error"===o.state.status)return r.createElement(Jt,{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,d({},o,{translations:null==n?void 0:n.noResultsScreen})):r.createElement(mn,o):r.createElement(yn,d({},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=y(e,wn),a=n.resetButtonTitle,i=void 0===a?"Clear the query":a,l=n.resetButtonAriaLabel,s=void 0===l?"Clear the query":l,c=n.cancelButtonText,u=void 0===c?"Cancel":c,f=n.cancelButtonAriaLabel,p=void 0===f?"Cancel":f,h=n.searchInputLabel,m=void 0===h?"Search":h,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",d({className:"DocSearch-MagnifierLabel"},o.getLabelProps()),r.createElement(_,null),r.createElement("span",{className:"DocSearch-VisuallyHiddenForAccessibility"},m)),r.createElement("div",{className:"DocSearch-LoadingIndicator"},r.createElement($t,null)),r.createElement("input",d({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(Vt,null))),r.createElement("button",{className:"DocSearch-Cancel",type:"reset","aria-label":p,onClick:o.onClose},u))}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=y(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 An(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 Tn=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>Tn},isTimedOut:function(){return"timed out"===t&&Date.now()-n<=Tn}})}var jn=function(){function e(t,n){var r;return s(this,e),u(r=l(this,e,[t]),"name","AlgoliaError"),n&&(r.name=n),r}return p(e,x(Error)),c(e)}(),Pn=function(){function e(t,n,r){var o;return s(this,e),u(o=l(this,e,[t,r]),"stackTrace",void 0),o.stackTrace=n,o}return p(e,jn),c(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),c(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),u(o=l(this,e,[t,r,a]),"status",void 0),o.status=n,o}return p(e,Pn),c(e)}(),Ln=function(){function e(t,n){var r;return s(this,e),u(r=l(this,e,[t,"DeserializationError"]),"response",void 0),r.response=n,r}return p(e,jn),c(e)}(),Rn=function(){function e(t,n,r,o){var a;return s(this,e),u(a=l(this,e,[t,n,o,"DetailedApiError"]),"error",void 0),a.error=r,a}return p(e,Nn),c(e)}();function Dn(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 Ln(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 Rn(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 $n(e)}))}function $n(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"],Vn=["params"],qn="5.14.2";function Wn(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 Kn="3.8.2";function Gn(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=y(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,c=e.requester,u=e.requestsCache,d=e.responsesCache;function f(e){return p.apply(this,arguments)}function p(){return(p=i(b().mark((function e(t){var r,o,a,i,l;return b().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 h(e,t){return m.apply(this,arguments)}function m(){return m=i(b().mark((function e(u,d){var p,h,m,y,v,w,k,x,E,_,O,A,T,C=arguments;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(p=!(C.length>2&&void 0!==C[2])||C[2],h=[],m=Mn(u,d),y=Fn(r,u.headers,d.headers),v="GET"===u.method?g(g({},u.data),d.data):{},w=g(g(g({},a),u.queryParameters),v),l.value&&(w["x-algolia-agent"]=l.value),d&&d.queryParameters)for(k=0,x=Object.keys(d.queryParameters);k1&&void 0!==arguments[1]?arguments[1]:{},n=e.useReadTransporter||"GET"===e.method;if(!n)return h(e,t,n);var o=function(){return h(e,t)};if(!0!==(t.cacheable||e.cacheable))return o();var i={request:e,requestOptions:t,transporter:{queryParameters:a,headers:r}};return d.get(i,(function(){return u.get(i,(function(){return u.set(i,o()).then((function(e){return Promise.all([u.delete(i),e])}),(function(e){return Promise.all([u.delete(i),Promise.reject(e)])})).then((function(e){var t=w(e,2);return t[0],t[1]}))}))}),{miss:function(e){return d.set(i,e)}})},requestsCache:u,responsesCache:d}}(g(g({hosts:Wn(t)},a),{},{algoliaAgent:An({algoliaAgents:o,client:"Lite",version:qn}),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=y(e,Vn);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(qn,"-").concat(e)}),On()]})},void 0))}(e,t);return r.addAlgoliaAgent("docsearch",Kn),!1===/docsearch.js \(.*\)/.test(r.transporter.algoliaAgent.value)&&r.addAlgoliaAgent("docsearch-react",Kn),n(r)}),[e,t,n])}var Yn=["footer","searchBox"];function Qn(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,c=e.onClose,u=void 0===c?dn:c,f=e.transformItems,p=void 0===f?cn:f,h=e.hitComponent,m=void 0===h?Ut:h,b=e.resultsFooterComponent,v=void 0===b?function(){return null}:b,S=e.navigator,k=e.initialScrollY,x=void 0===k?0:k,E=e.transformSearchClient,_=void 0===E?cn:E,O=e.disableUserPersonalization,A=void 0!==O&&O,T=e.initialQuery,C=void 0===T?"":T,j=e.translations,P=void 0===j?{}:j,I=e.getMissingResultsUrl,N=e.insights,L=void 0!==N&&N,R=P.footer,D=P.searchBox,M=y(P,Yn),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),$=r.useRef(null),H=r.useRef(null),V=r.useRef(null),q=r.useRef(null),W=r.useRef(10),K=r.useRef("undefined"!=typeof window?window.getSelection().toString().slice(0,64):"").current,G=r.useRef(C||K).current,Y=Gn(t,n,_),Q=r.useRef(xn({key:"__DOCSEARCH_FAVORITE_SEARCHES__".concat(o),limit:10})).current,Z=r.useRef(xn({key:"__DOCSEARCH_RECENT_SEARCHES__".concat(o),limit:0===Q.getAll().length?7:4})).current,X=r.useCallback((function(e){if(!A){var t="content"===e.type?e.__docsearch_parent:e;t&&-1===Q.getAll().findIndex((function(e){return e.objectID===t.objectID}))&&Z.add(t)}}),[Q,Z,A]),J=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:G,context:{searchSuggestions:[]}},insights:L,navigator:S,onStateChange:function(e){z(e.state)},getSources:function(e){var r=e.query,a=e.state,i=e.setContext,c=e.setStatus;if(!r)return A?[]:[{sourceId:"recentSearches",onSelect:function(e){var t=e.item,n=e.event;X(t),un(n)||u()},getItemUrl:function(e){return e.item.url},getItems:function(){return Z.getAll()}},{sourceId:"favoriteSearches",onSelect:function(e){var t=e.item,n=e.event;X(t),un(n)||u()},getItemUrl:function(e){return e.item.url},getItems:function(){return Q.getAll()}}];var d=Boolean(L);return Y.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(W.current),"hierarchy.lvl2:".concat(W.current),"hierarchy.lvl3:".concat(W.current),"hierarchy.lvl4:".concat(W.current),"hierarchy.lvl5:".concat(W.current),"hierarchy.lvl6:".concat(W.current),"content:".concat(W.current)],snippetEllipsisText:"\u2026",highlightPreTag:"",highlightPostTag:"",hitsPerPage:20,clickAnalytics:d},l)]}).catch((function(e){throw"RetryError"===e.name&&c("error"),e})).then((function(e){var r=e.results[0],l=r.hits,c=r.nbHits,f=sn(l,(function(e){return hn(e)}),s);a.context.searchSuggestions.length0&&(re(),q.current&&q.current.focus())}),[G,re]),r.useEffect((function(){function e(){if($.current){var e=.01*window.innerHeight;$.current.style.setProperty("--docsearch-vh","".concat(e,"px"))}}return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]),r.createElement("div",d({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&&u()}}),r.createElement("div",{className:"DocSearch-Modal",ref:$},r.createElement("header",{className:"DocSearch-SearchBar",ref:H},r.createElement(Sn,d({},ee,{state:B,autoFocus:0===G.length,inputRef:q,isFromSelection:Boolean(G)&&G===K,translations:D,onClose:u}))),r.createElement("div",{className:"DocSearch-Dropdown",ref:V},r.createElement(vn,d({},ee,{indexName:o,state:B,hitComponent:m,resultsFooterComponent:v,disableUserPersonalization:A,recentSearches:Z,favoriteSearches:Q,inputRef:q,translations:M,getMissingResultsUrl:I,onItemClick:function(e,t){J(e),X(e),un(t)||u()}}))),r.createElement("footer",{className:"DocSearch-Footer"},r.createElement(zt,{translations:R}))))}function Zn(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])}},9571:(e,t,n)=>{var r={"./prism-bash":8520,"./prism-toml":6290};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=9571},7103:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});n(758);var r=n(2625),o=n.n(r),a=n(4054);const i={"0b74d420":[()=>n.e(7154).then(n.bind(n,7128)),"@site/docs/03-core-concepts/07-encryption.mdx",7128],"0b99a0c5":[()=>n.e(5524).then(n.bind(n,8504)),"@site/docs/03-core-concepts/04-context.mdx",8504],"0c9c7602":[()=>n.e(3365).then(n.bind(n,7803)),"@site/docs/05-developer-tools/02-SDK/03-protocol-sdk/02-protocol-rs-sdk.mdx",7803],"0fd0086a":[()=>n.e(6114).then(n.bind(n,3133)),"@site/docs/06-tutorials/07-awesome-projects/02-rock-paper-scissors.mdx",3133],"100c5efa":[()=>n.e(3490).then(n.bind(n,8934)),"@site/docs/08-throubleshooting/01-overview.mdx",8934],"13e31531":[()=>n.e(6189).then(n.bind(n,2002)),"@site/docs/03-core-concepts/06-blockchains-integration/01-blockchain-integration-general.mdx",2002],17896441:[()=>Promise.all([n.e(1869),n.e(1710),n.e(8401)]).then(n.bind(n,7206)),"@theme/DocItem",7206],"1a4e3797":[()=>Promise.all([n.e(1869),n.e(2138)]).then(n.bind(n,7593)),"@theme/SearchPage",7593],"1df93b7f":[()=>n.e(4583).then(n.bind(n,5322)),"@site/src/pages/index.tsx",5322],"20df42f5":[()=>n.e(3690).then(n.bind(n,5046)),"@site/docs/03-core-concepts/03-identity.mdx",5046],"22dd74f7":[()=>n.e(1567).then(n.t.bind(n,5226,19)),"@generated/docusaurus-plugin-content-docs/default/p/index-466.json",5226],"2dc47f99":[()=>n.e(9413).then(n.bind(n,4580)),"@site/docs/04-architecture/03-node/03-server.mdx",4580],"381aad9e":[()=>n.e(4005).then(n.bind(n,7228)),"@site/docs/07-resources/01-manifesto.mdx",7228],"3b243cb4":[()=>n.e(8870).then(n.bind(n,7753)),"@site/docs/03-core-concepts/05-applications.mdx",7753],"3e581231":[()=>n.e(2897).then(n.bind(n,945)),"@site/docs/04-architecture/03-node/04-storage.mdx",945],"4098c589":[()=>n.e(6093).then(n.bind(n,9740)),"@site/docs/07-resources/02-eli5.mdx",9740],"4406af8f":[()=>n.e(7302).then(n.bind(n,2018)),"@site/docs/06-tutorials/01-login-with-wallets/03-icp-wallet.mdx",2018],"4be05fc7":[()=>n.e(5013).then(n.bind(n,7068)),"@site/docs/03-core-concepts/08-specialized-nodes.mdx",7068],"4c2451ff":[()=>n.e(1420).then(n.bind(n,5578)),"@site/docs/04-architecture/03-node/02-runtime.mdx",5578],"50c4ee78":[()=>n.e(4594).then(n.bind(n,5108)),"@site/docs/06-tutorials/06-install-application.mdx",5108],"52c33f34":[()=>Promise.all([n.e(1869),n.e(8282)]).then(n.bind(n,8096)),"@site/docs/05-developer-tools/01-CLI/01-merod.mdx",8096],"5ccd261d":[()=>n.e(3001).then(n.bind(n,9631)),"@site/docs/06-tutorials/00-overview.mdx",9631],"5e95c892":[()=>n.e(9647).then(n.bind(n,1008)),"@theme/DocsRoot",1008],"5e9f5e1a":[()=>Promise.resolve().then(n.bind(n,4784)),"@generated/docusaurus.config",4784],"63333f6c":[()=>n.e(3574).then(n.bind(n,1652)),"@site/docs/03-core-concepts/06-blockchains-integration/03-proxy-contract.mdx",1652],"6e6ab436":[()=>Promise.all([n.e(1869),n.e(8934)]).then(n.bind(n,1531)),"@site/docs/shared/install-merod.mdx",1531],"6e6cd14f":[()=>n.e(1050).then(n.bind(n,9627)),"@site/docs/05-developer-tools/06-testing.mdx",9627],"6fe37e69":[()=>n.e(5088).then(n.bind(n,7747)),"@site/docs/09-contributing/02-hackathons.mdx",7747],"7161e778":[()=>Promise.all([n.e(1869),n.e(4101)]).then(n.bind(n,1961)),"@site/docs/05-developer-tools/01-CLI/02-meroctl.mdx",1961],"71e069fb":[()=>n.e(1663).then(n.bind(n,7151)),"@site/docs/06-tutorials/03-invitations-and-joinings.mdx",7151],"788edaf7":[()=>Promise.all([n.e(1869),n.e(4259)]).then(n.bind(n,4207)),"@site/docs/03-core-concepts/06-blockchains-integration/02-context-contract.mdx",4207],"7d19853e":[()=>n.e(3917).then(n.bind(n,4425)),"@site/docs/09-contributing/03-bounty-program.mdx",4425],"811bcaba":[()=>n.e(4420).then(n.bind(n,7331)),"@site/docs/05-developer-tools/02-SDK/04-client-sdk/calimero-client-js.mdx",7331],"85fabe5c":[()=>Promise.all([n.e(1869),n.e(7718)]).then(n.bind(n,6486)),"@site/docs/shared/install-meroctl.mdx",6486],"877e5bd4":[()=>Promise.all([n.e(1869),n.e(5413)]).then(n.bind(n,2180)),"@site/docs/02-getting-started/01-setup.mdx",2180],"87ab5444":[()=>n.e(3174).then(n.bind(n,3333)),"@site/docs/05-developer-tools/02-SDK/03-protocol-sdk/01-protocol-sdk.mdx",3333],"87ed36b6":[()=>n.e(4480).then(n.bind(n,7272)),"@site/docs/09-contributing/01-github.mdx",7272],"8ed5093a":[()=>n.e(4302).then(n.bind(n,7166)),"@site/docs/10-support/02-learning.mdx",7166],"961bc6b0":[()=>n.e(8778).then(n.bind(n,4849)),"@site/docs/06-tutorials/02-create-context.mdx",4849],a142fdfa:[()=>n.e(1534).then(n.bind(n,6415)),"@site/docs/06-tutorials/01-login-with-wallets/02-starknet-wallet.mdx",6415],a1cbb7cd:[()=>n.e(8718).then(n.bind(n,2253)),"@site/docs/10-support/01-community-and-support.mdx",2253],a34c5ef3:[()=>n.e(6347).then(n.bind(n,1043)),"@site/docs/01-introduction/03-key-features.mdx",1043],a7456010:[()=>n.e(1235).then(n.t.bind(n,8552,19)),"@generated/docusaurus-plugin-content-pages/default/__plugin.json",8552],a759d8d5:[()=>n.e(8264).then(n.bind(n,2506)),"@site/docs/01-introduction/01-what-is-calimero.mdx",2506],a7bd4aaa:[()=>n.e(7098).then(n.bind(n,3549)),"@theme/DocVersionRoot",3549],a94703ab:[()=>Promise.all([n.e(1869),n.e(9048)]).then(n.bind(n,2168)),"@theme/DocRoot",2168],ab4abc8a:[()=>n.e(5675).then(n.bind(n,7988)),"@site/docs/01-introduction/02-use-cases.mdx",7988],aba21aa0:[()=>n.e(5742).then(n.t.bind(n,7093,19)),"@generated/docusaurus-plugin-content-docs/default/__plugin.json",7093],ae6ff85f:[()=>n.e(8262).then(n.bind(n,3465)),"@site/docs/03-core-concepts/01-terminology.mdx",3465],af52bc08:[()=>n.e(6938).then(n.bind(n,2458)),"@site/docs/04-architecture/03-node/01-client-node.mdx",2458],bcc3649f:[()=>n.e(1503).then(n.bind(n,8632)),"@site/docs/05-developer-tools/03-apps/06-desktop-app.mdx",8632],c141421f:[()=>n.e(957).then(n.t.bind(n,936,19)),"@generated/docusaurus-theme-search-algolia/default/__plugin.json",936],c8c2cbf1:[()=>n.e(8373).then(n.bind(n,6679)),"@site/docs/08-throubleshooting/02-ssl.mdx",6679],ca1dcc06:[()=>n.e(4208).then(n.bind(n,689)),"@site/docs/06-tutorials/07-awesome-projects/01-only-peers.mdx",689],d4692bc6:[()=>n.e(4435).then(n.bind(n,6444)),"@site/docs/04-architecture/01-system-overview.mdx",6444],d51dfd58:[()=>n.e(9352).then(n.bind(n,3999)),"@site/docs/06-tutorials/05-publish-app.mdx",3999],db8389d5:[()=>Promise.all([n.e(1869),n.e(3154)]).then(n.bind(n,2958)),"@site/docs/02-getting-started/02-build-from-source.mdx",2958],e4da674c:[()=>n.e(6567).then(n.bind(n,9246)),"@site/docs/05-developer-tools/03-apps/05-admin-dashboard.mdx",9246],ec3fec87:[()=>n.e(9251).then(n.bind(n,6932)),"@site/docs/06-tutorials/01-login-with-wallets/01-near-wallet.mdx",6932],ec4801bd:[()=>n.e(1988).then(n.bind(n,8477)),"@site/docs/05-developer-tools/00-overview.mdx",8477],f96da59b:[()=>n.e(5277).then(n.bind(n,3749)),"@site/docs/04-architecture/03-node/05-network.mdx",3749],ff529293:[()=>n.e(5183).then(n.bind(n,1307)),"@site/docs/03-core-concepts/06-blockchains-integration/04-proxy-contract-interaction.mdx",1307]};var l=n(6070);function s(e){let{error:t,retry:n,pastDelay:r}=e;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 c=n(678),u=n(9181);function d(e,t){if("*"===e)return o()({loading:s,loader:()=>n.e(2228).then(n.bind(n,2228)),modules:["@theme/NotFound"],webpack:()=>[2228],render(e,t){const n=e.default;return(0,l.jsx)(u.W,{value:{plugin:{name:"native",id:"default"}},children:(0,l.jsx)(n,{...t})})}});const r=a[`${e}-${t}`],d={},f=[],p=[],h=(0,c.A)(r);return Object.entries(h).forEach((e=>{let[t,n]=e;const r=i[n];r&&(d[t]=r[0],f.push(r[1]),p.push(r[2]))})),o().Map({loading:s,loader:d,modules:f,webpack:()=>p,render(t,n){const o=JSON.parse(JSON.stringify(r));Object.entries(t).forEach((t=>{let[n,r]=t;const 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((e=>"default"!==e)).forEach((e=>{a[e]=r[e]}));let i=o;const l=n.split(".");l.slice(0,-1).forEach((e=>{i=i[e]})),i[l[l.length-1]]=a}));const a=o.__comp;delete o.__comp;const i=o.__context;delete o.__context;const s=o.__props;return delete o.__props,(0,l.jsx)(u.W,{value:i,children:(0,l.jsx)(a,{...o,...s,...n})})}})}const f=[{path:"/search",component:d("/search","5de"),exact:!0},{path:"/",component:d("/","e5f"),exact:!0},{path:"/",component:d("/","169"),routes:[{path:"/",component:d("/","483"),routes:[{path:"/",component:d("/","363"),routes:[{path:"/architecture/node/client-node",component:d("/architecture/node/client-node","022"),exact:!0,sidebar:"tutorialSidebar"},{path:"/architecture/node/network",component:d("/architecture/node/network","a13"),exact:!0,sidebar:"tutorialSidebar"},{path:"/architecture/node/runtime",component:d("/architecture/node/runtime","930"),exact:!0,sidebar:"tutorialSidebar"},{path:"/architecture/node/server",component:d("/architecture/node/server","3fa"),exact:!0,sidebar:"tutorialSidebar"},{path:"/architecture/node/storage",component:d("/architecture/node/storage","7fa"),exact:!0,sidebar:"tutorialSidebar"},{path:"/architecture/system-overview",component:d("/architecture/system-overview","b57"),exact:!0,sidebar:"tutorialSidebar"},{path:"/contributing/bounty-program",component:d("/contributing/bounty-program","c27"),exact:!0,sidebar:"tutorialSidebar"},{path:"/contributing/github",component:d("/contributing/github","912"),exact:!0,sidebar:"tutorialSidebar"},{path:"/contributing/hackathons",component:d("/contributing/hackathons","82a"),exact:!0,sidebar:"tutorialSidebar"},{path:"/core-concepts/applications",component:d("/core-concepts/applications","1c5"),exact:!0,sidebar:"tutorialSidebar"},{path:"/core-concepts/blockchains-integration/blockchain-integrations",component:d("/core-concepts/blockchains-integration/blockchain-integrations","bef"),exact:!0,sidebar:"tutorialSidebar"},{path:"/core-concepts/blockchains-integration/context-contract",component:d("/core-concepts/blockchains-integration/context-contract","95f"),exact:!0,sidebar:"tutorialSidebar"},{path:"/core-concepts/blockchains-integration/proxy-contract",component:d("/core-concepts/blockchains-integration/proxy-contract","929"),exact:!0,sidebar:"tutorialSidebar"},{path:"/core-concepts/blockchains-integration/proxy-contract-interaction",component:d("/core-concepts/blockchains-integration/proxy-contract-interaction","f0c"),exact:!0,sidebar:"tutorialSidebar"},{path:"/core-concepts/contexts",component:d("/core-concepts/contexts","ceb"),exact:!0,sidebar:"tutorialSidebar"},{path:"/core-concepts/encryption",component:d("/core-concepts/encryption","a65"),exact:!0,sidebar:"tutorialSidebar"},{path:"/core-concepts/identity",component:d("/core-concepts/identity","cea"),exact:!0,sidebar:"tutorialSidebar"},{path:"/core-concepts/specialized-nodes",component:d("/core-concepts/specialized-nodes","2fa"),exact:!0,sidebar:"tutorialSidebar"},{path:"/core-concepts/terminology",component:d("/core-concepts/terminology","619"),exact:!0,sidebar:"tutorialSidebar"},{path:"/developer-tools/apps/admin-dashboard",component:d("/developer-tools/apps/admin-dashboard","a75"),exact:!0,sidebar:"tutorialSidebar"},{path:"/developer-tools/apps/desktop-app",component:d("/developer-tools/apps/desktop-app","18d"),exact:!0,sidebar:"tutorialSidebar"},{path:"/developer-tools/CLI/meroctl",component:d("/developer-tools/CLI/meroctl","8a6"),exact:!0,sidebar:"tutorialSidebar"},{path:"/developer-tools/CLI/merod",component:d("/developer-tools/CLI/merod","3ed"),exact:!0,sidebar:"tutorialSidebar"},{path:"/developer-tools/overview",component:d("/developer-tools/overview","b28"),exact:!0,sidebar:"tutorialSidebar"},{path:"/developer-tools/SDK/client-sdk/client-ts-sdk",component:d("/developer-tools/SDK/client-sdk/client-ts-sdk","54d"),exact:!0,sidebar:"tutorialSidebar"},{path:"/developer-tools/SDK/protocol-sdk/protocol-rs-sdk",component:d("/developer-tools/SDK/protocol-sdk/protocol-rs-sdk","d06"),exact:!0,sidebar:"tutorialSidebar"},{path:"/developer-tools/SDK/protocol-sdk/protocol-sdk",component:d("/developer-tools/SDK/protocol-sdk/protocol-sdk","4e8"),exact:!0,sidebar:"tutorialSidebar"},{path:"/developer-tools/tests",component:d("/developer-tools/tests","7b8"),exact:!0,sidebar:"tutorialSidebar"},{path:"/getting-started/build-from-source",component:d("/getting-started/build-from-source","cdd"),exact:!0,sidebar:"tutorialSidebar"},{path:"/getting-started/setup",component:d("/getting-started/setup","88f"),exact:!0,sidebar:"tutorialSidebar"},{path:"/introduction/key-features",component:d("/introduction/key-features","dc6"),exact:!0,sidebar:"tutorialSidebar"},{path:"/introduction/use-cases",component:d("/introduction/use-cases","715"),exact:!0,sidebar:"tutorialSidebar"},{path:"/introduction/what-is-calimero",component:d("/introduction/what-is-calimero","24c"),exact:!0,sidebar:"tutorialSidebar"},{path:"/resources/eli5",component:d("/resources/eli5","bbc"),exact:!0,sidebar:"tutorialSidebar"},{path:"/resources/manifesto",component:d("/resources/manifesto","ed7"),exact:!0,sidebar:"tutorialSidebar"},{path:"/shared/install-meroctl",component:d("/shared/install-meroctl","ce3"),exact:!0,sidebar:"tutorialSidebar"},{path:"/shared/install-merod",component:d("/shared/install-merod","8ff"),exact:!0,sidebar:"tutorialSidebar"},{path:"/support/community-and-support",component:d("/support/community-and-support","c4a"),exact:!0,sidebar:"tutorialSidebar"},{path:"/support/learning",component:d("/support/learning","9af"),exact:!0,sidebar:"tutorialSidebar"},{path:"/throubleshooting/overview",component:d("/throubleshooting/overview","a07"),exact:!0,sidebar:"tutorialSidebar"},{path:"/throubleshooting/ssl-tls",component:d("/throubleshooting/ssl-tls","7a0"),exact:!0,sidebar:"tutorialSidebar"},{path:"/tutorials/awesome-projects/only-peers",component:d("/tutorials/awesome-projects/only-peers","290"),exact:!0,sidebar:"tutorialSidebar"},{path:"/tutorials/awesome-projects/rock-paper-scissors",component:d("/tutorials/awesome-projects/rock-paper-scissors","c03"),exact:!0,sidebar:"tutorialSidebar"},{path:"/tutorials/create-context",component:d("/tutorials/create-context","744"),exact:!0,sidebar:"tutorialSidebar"},{path:"/tutorials/install-application",component:d("/tutorials/install-application","0d3"),exact:!0,sidebar:"tutorialSidebar"},{path:"/tutorials/invitations-and-joinings",component:d("/tutorials/invitations-and-joinings","6cd"),exact:!0,sidebar:"tutorialSidebar"},{path:"/tutorials/login-with-wallets/icp-wallet",component:d("/tutorials/login-with-wallets/icp-wallet","277"),exact:!0,sidebar:"tutorialSidebar"},{path:"/tutorials/login-with-wallets/near-wallet",component:d("/tutorials/login-with-wallets/near-wallet","6b2"),exact:!0,sidebar:"tutorialSidebar"},{path:"/tutorials/login-with-wallets/starknet-wallet",component:d("/tutorials/login-with-wallets/starknet-wallet","cf7"),exact:!0,sidebar:"tutorialSidebar"},{path:"/tutorials/overview",component:d("/tutorials/overview","a29"),exact:!0,sidebar:"tutorialSidebar"},{path:"/tutorials/publish-app",component:d("/tutorials/publish-app","e90"),exact:!0,sidebar:"tutorialSidebar"}]}]}]},{path:"*",component:d("*")}]},7010:(e,t,n)=>{"use strict";n.d(t,{o:()=>a,x:()=>i});var r=n(758),o=n(6070);const a=r.createContext(!1);function i(e){let{children:t}=e;const[n,i]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{i(!0)}),[]),(0,o.jsx)(a.Provider,{value:n,children:t})}},9687:(e,t,n)=>{"use strict";var r=n(758),o=n(9576),a=n(932),i=n(1742),l=n(4784),s=n(6234);const c=[n(577),n(1878),n(1541),n(4464)];var u=n(7103),d=n(5557),f=n(1977),p=n(6070);function h(e){let{children:t}=e;return(0,p.jsx)(p.Fragment,{children:t})}var m=n(3563),g=n(785),y=n(7042),b=n(8859),v=n(9904),w=n(1352),S=n(6130),k=n(1956),x=n(8924),E=n(7246);function _(){const{i18n:{currentLocale:e,defaultLocale:t,localeConfigs:n}}=(0,g.A)(),r=(0,w.o)(),o=n[e].htmlLang,a=e=>e.replace("-","_");return(0,p.jsxs)(m.A,{children:[Object.entries(n).map((e=>{let[t,{htmlLang:n}]=e;return(0,p.jsx)("link",{rel:"alternate",href:r.createUrl({locale:t,fullyQualified:!0}),hrefLang:n},t)})),(0,p.jsx)("link",{rel:"alternate",href:r.createUrl({locale:t,fullyQualified:!0}),hrefLang:"x-default"}),(0,p.jsx)("meta",{property:"og:locale",content:a(o)}),Object.values(n).filter((e=>o!==e.htmlLang)).map((e=>(0,p.jsx)("meta",{property:"og:locale:alternate",content:a(e.htmlLang)},`meta-og-${e.htmlLang}`)))]})}function O(e){let{permalink:t}=e;const{siteConfig:{url:n}}=(0,g.A)(),r=function(){const{siteConfig:{url:e,baseUrl:t,trailingSlash:n}}=(0,g.A)(),{pathname:r}=(0,d.zy)();return e+(0,x.Ks)((0,y.Ay)(r),{trailingSlash:n,baseUrl:t})}(),o=t?`${n}${t}`:r;return(0,p.jsxs)(m.A,{children:[(0,p.jsx)("meta",{property:"og:url",content:o}),(0,p.jsx)("link",{rel:"canonical",href:o})]})}function A(){const{i18n:{currentLocale:e}}=(0,g.A)(),{metadata:t,image:n}=(0,b.p)();return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(m.A,{children:[(0,p.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,p.jsx)("body",{className:S.w})]}),n&&(0,p.jsx)(v.be,{image:n}),(0,p.jsx)(O,{}),(0,p.jsx)(_,{}),(0,p.jsx)(E.A,{tag:k.C,locale:e}),(0,p.jsx)(m.A,{children:t.map(((e,t)=>(0,p.jsx)("meta",{...e},t)))})]})}const T=new Map;var C=n(7010),j=n(9716),P=n(5536);function I(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{const r=t.default?.[e]??t[e];return r?.(...n)}));return()=>o.forEach((e=>e?.()))}const N=function(e){let{children:t,location:n,previousLocation:r}=e;return(0,P.A)((()=>{r!==n&&(!function(e){let{location:t,previousLocation:n}=e;if(!n)return;const r=t.pathname===n.pathname,o=t.hash===n.hash,a=t.search===n.search;if(r&&o&&!a)return;const{hash:i}=t;if(i){const e=decodeURIComponent(i.substring(1)),t=document.getElementById(e);t?.scrollIntoView()}else window.scrollTo(0,0)}({location:n,previousLocation:r}),I("onRouteDidUpdate",{previousLocation:r,location:n}))}),[r,n]),t};function L(e){const t=Array.from(new Set([e,decodeURI(e)])).map((e=>(0,f.u)(u.A,e))).flat();return Promise.all(t.map((e=>e.route.component.preload?.())))}class R extends r.Component{previousLocation;routeUpdateCleanupCb;constructor(e){super(e),this.previousLocation=null,this.routeUpdateCleanupCb=s.A.canUseDOM?I("onRouteUpdate",{previousLocation:null,location:this.props.location}):()=>{},this.state={nextRouteHasLoaded:!0}}shouldComponentUpdate(e,t){if(e.location===this.props.location)return t.nextRouteHasLoaded;const n=e.location;return this.previousLocation=this.props.location,this.setState({nextRouteHasLoaded:!1}),this.routeUpdateCleanupCb=I("onRouteUpdate",{previousLocation:this.previousLocation,location:n}),L(n.pathname).then((()=>{this.routeUpdateCleanupCb(),this.setState({nextRouteHasLoaded:!0})})).catch((e=>{console.warn(e),window.location.reload()})),!1}render(){const{children:e,location:t}=this.props;return(0,p.jsx)(N,{previousLocation:this.previousLocation,location:t,children:(0,p.jsx)(d.qh,{location:t,render:()=>e})})}}const D=R,M="__docusaurus-base-url-issue-banner-suggestion-container";function F(e){return`\ndocument.addEventListener('DOMContentLoaded', function maybeInsertBanner() {\n var shouldInsert = typeof window['docusaurus'] === 'undefined';\n shouldInsert && insertBanner();\n});\n\nfunction insertBanner() {\n var bannerContainer = document.createElement('div');\n bannerContainer.id = '__docusaurus-base-url-issue-banner-container';\n var bannerHtml = ${JSON.stringify(function(e){return`\n
\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(/{let{route:t}=e;return!0===t.exact})))return T.set(e.pathname,e.pathname),e;const t=e.pathname.trim().replace(/(?:\/index)?\.html$/,"")||"/";return T.set(e.pathname,t),{...e,pathname:t}}((0,d.zy)());return(0,p.jsx)(D,{location:e,children:q})}function K(){return(0,p.jsx)($.A,{children:(0,p.jsx)(j.l,{children:(0,p.jsxs)(C.x,{children:[(0,p.jsxs)(h,{children:[(0,p.jsx)(U,{}),(0,p.jsx)(A,{}),(0,p.jsx)(z,{}),(0,p.jsx)(W,{})]}),(0,p.jsx)(V,{})]})})})}var G=n(4054);const Y=function(e){try{return document.createElement("link").relList.supports(e)}catch{return!1}}("prefetch")?function(e){return new Promise(((t,n)=>{if("undefined"==typeof document)return void n();const r=document.createElement("link");r.setAttribute("rel","prefetch"),r.setAttribute("href",e),r.onload=()=>t(),r.onerror=()=>n();const o=document.getElementsByTagName("head")[0]??document.getElementsByName("script")[0]?.parentNode;o?.appendChild(r)}))}:function(e){return new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("GET",e,!0),r.withCredentials=!0,r.onload=()=>{200===r.status?t():n()},r.send(null)}))};var Q=n(678);const Z=new Set,X=new Set,J=()=>navigator.connection?.effectiveType.includes("2g")||navigator.connection?.saveData,ee={prefetch:e=>{if(!(e=>!J()&&!X.has(e)&&!Z.has(e))(e))return!1;Z.add(e);const t=(0,f.u)(u.A,e).flatMap((e=>{return t=e.route.path,Object.entries(G).filter((e=>{let[n]=e;return n.replace(/-[^-]+$/,"")===t})).flatMap((e=>{let[,t]=e;return Object.values((0,Q.A)(t))}));var t}));return Promise.all(t.map((e=>{const t=n.gca(e);return t&&!t.includes("undefined")?Y(t).catch((()=>{})):Promise.resolve()})))},preload:e=>!!(e=>!J()&&!X.has(e))(e)&&(X.add(e),L(e))},te=Object.freeze(ee);function ne(e){let{children:t}=e;return"hash"===l.default.future.experimental_router?(0,p.jsx)(i.I9,{children:t}):(0,p.jsx)(i.Kd,{children:t})}const re=Boolean(!0);if(s.A.canUseDOM){window.docusaurus=te;const e=document.getElementById("__docusaurus"),t=(0,p.jsx)(a.vd,{children:(0,p.jsx)(ne,{children:(0,p.jsx)(K,{})})}),n=(e,t)=>{console.error("Docusaurus React Root onRecoverableError:",e,t)},i=()=>{if(window.docusaurusRoot)window.docusaurusRoot.render(t);else if(re)window.docusaurusRoot=o.hydrateRoot(e,t,{onRecoverableError:n});else{const r=o.createRoot(e,{onRecoverableError:n});r.render(t),window.docusaurusRoot=r}};L(window.location.pathname).then((()=>{(0,r.startTransition)(i)}))}},9716:(e,t,n)=>{"use strict";n.d(t,{o:()=>d,l:()=>f});var r=n(758),o=n(4784);const a=JSON.parse('{"docusaurus-plugin-content-docs":{"default":{"path":"/","versions":[{"name":"current","label":"0.2.0","isLast":true,"path":"/","mainDocId":"introduction/what-is-calimero","docs":[{"id":"architecture/node/client-node","path":"/architecture/node/client-node","sidebar":"tutorialSidebar"},{"id":"architecture/node/network","path":"/architecture/node/network","sidebar":"tutorialSidebar"},{"id":"architecture/node/runtime","path":"/architecture/node/runtime","sidebar":"tutorialSidebar"},{"id":"architecture/node/server","path":"/architecture/node/server","sidebar":"tutorialSidebar"},{"id":"architecture/node/storage","path":"/architecture/node/storage","sidebar":"tutorialSidebar"},{"id":"architecture/system-overview","path":"/architecture/system-overview","sidebar":"tutorialSidebar"},{"id":"contributing/bounty-program","path":"/contributing/bounty-program","sidebar":"tutorialSidebar"},{"id":"contributing/github","path":"/contributing/github","sidebar":"tutorialSidebar"},{"id":"contributing/hackathons","path":"/contributing/hackathons","sidebar":"tutorialSidebar"},{"id":"core-concepts/applications","path":"/core-concepts/applications","sidebar":"tutorialSidebar"},{"id":"core-concepts/blockchains-integration/blockchain-integrations","path":"/core-concepts/blockchains-integration/blockchain-integrations","sidebar":"tutorialSidebar"},{"id":"core-concepts/blockchains-integration/context-contract","path":"/core-concepts/blockchains-integration/context-contract","sidebar":"tutorialSidebar"},{"id":"core-concepts/blockchains-integration/proxy-contract","path":"/core-concepts/blockchains-integration/proxy-contract","sidebar":"tutorialSidebar"},{"id":"core-concepts/blockchains-integration/proxy-contract-interaction","path":"/core-concepts/blockchains-integration/proxy-contract-interaction","sidebar":"tutorialSidebar"},{"id":"core-concepts/contexts","path":"/core-concepts/contexts","sidebar":"tutorialSidebar"},{"id":"core-concepts/encryption","path":"/core-concepts/encryption","sidebar":"tutorialSidebar"},{"id":"core-concepts/identity","path":"/core-concepts/identity","sidebar":"tutorialSidebar"},{"id":"core-concepts/specialized-nodes","path":"/core-concepts/specialized-nodes","sidebar":"tutorialSidebar"},{"id":"core-concepts/terminology","path":"/core-concepts/terminology","sidebar":"tutorialSidebar"},{"id":"developer-tools/apps/admin-dashboard","path":"/developer-tools/apps/admin-dashboard","sidebar":"tutorialSidebar"},{"id":"developer-tools/apps/desktop-app","path":"/developer-tools/apps/desktop-app","sidebar":"tutorialSidebar"},{"id":"developer-tools/CLI/meroctl","path":"/developer-tools/CLI/meroctl","sidebar":"tutorialSidebar"},{"id":"developer-tools/CLI/merod","path":"/developer-tools/CLI/merod","sidebar":"tutorialSidebar"},{"id":"developer-tools/overview","path":"/developer-tools/overview","sidebar":"tutorialSidebar"},{"id":"developer-tools/SDK/client-sdk/client-ts-sdk","path":"/developer-tools/SDK/client-sdk/client-ts-sdk","sidebar":"tutorialSidebar"},{"id":"developer-tools/SDK/protocol-sdk/protocol-rs-sdk","path":"/developer-tools/SDK/protocol-sdk/protocol-rs-sdk","sidebar":"tutorialSidebar"},{"id":"developer-tools/SDK/protocol-sdk/protocol-sdk","path":"/developer-tools/SDK/protocol-sdk/protocol-sdk","sidebar":"tutorialSidebar"},{"id":"developer-tools/tests","path":"/developer-tools/tests","sidebar":"tutorialSidebar"},{"id":"getting-started/build-from-source","path":"/getting-started/build-from-source","sidebar":"tutorialSidebar"},{"id":"getting-started/setup","path":"/getting-started/setup","sidebar":"tutorialSidebar"},{"id":"introduction/key-features","path":"/introduction/key-features","sidebar":"tutorialSidebar"},{"id":"introduction/use-cases","path":"/introduction/use-cases","sidebar":"tutorialSidebar"},{"id":"introduction/what-is-calimero","path":"/introduction/what-is-calimero","sidebar":"tutorialSidebar"},{"id":"resources/eli5","path":"/resources/eli5","sidebar":"tutorialSidebar"},{"id":"resources/manifesto","path":"/resources/manifesto","sidebar":"tutorialSidebar"},{"id":"shared/install-meroctl","path":"/shared/install-meroctl","sidebar":"tutorialSidebar"},{"id":"shared/install-merod","path":"/shared/install-merod","sidebar":"tutorialSidebar"},{"id":"support/community-and-support","path":"/support/community-and-support","sidebar":"tutorialSidebar"},{"id":"support/learning","path":"/support/learning","sidebar":"tutorialSidebar"},{"id":"throubleshooting/overview","path":"/throubleshooting/overview","sidebar":"tutorialSidebar"},{"id":"throubleshooting/ssl-tls","path":"/throubleshooting/ssl-tls","sidebar":"tutorialSidebar"},{"id":"tutorials/awesome-projects/only-peers","path":"/tutorials/awesome-projects/only-peers","sidebar":"tutorialSidebar"},{"id":"tutorials/awesome-projects/rock-paper-scissors","path":"/tutorials/awesome-projects/rock-paper-scissors","sidebar":"tutorialSidebar"},{"id":"tutorials/create-context","path":"/tutorials/create-context","sidebar":"tutorialSidebar"},{"id":"tutorials/install-application","path":"/tutorials/install-application","sidebar":"tutorialSidebar"},{"id":"tutorials/invitations-and-joinings","path":"/tutorials/invitations-and-joinings","sidebar":"tutorialSidebar"},{"id":"tutorials/login-with-wallets/icp-wallet","path":"/tutorials/login-with-wallets/icp-wallet","sidebar":"tutorialSidebar"},{"id":"tutorials/login-with-wallets/near-wallet","path":"/tutorials/login-with-wallets/near-wallet","sidebar":"tutorialSidebar"},{"id":"tutorials/login-with-wallets/starknet-wallet","path":"/tutorials/login-with-wallets/starknet-wallet","sidebar":"tutorialSidebar"},{"id":"tutorials/overview","path":"/tutorials/overview","sidebar":"tutorialSidebar"},{"id":"tutorials/publish-app","path":"/tutorials/publish-app","sidebar":"tutorialSidebar"}],"draftIds":[],"sidebars":{"tutorialSidebar":{"link":{"path":"/introduction/what-is-calimero","label":"introduction/what-is-calimero"}}}}],"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":"0.0.0","pluginVersions":{"docusaurus-plugin-content-docs":{"type":"package","name":"@docusaurus/plugin-content-docs","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"},"docusaurus-plugin-sass":{"type":"package","name":"docusaurus-plugin-sass","version":"0.2.6"},"docusaurus-theme-mermaid":{"type":"package","name":"@docusaurus/theme-mermaid","version":"3.6.3"}}}');var c=n(6070);const u={siteConfig:o.default,siteMetadata:s,globalData:a,i18n:i,codeTranslations:l},d=r.createContext(u);function f(e){let{children:t}=e;return(0,c.jsx)(d.Provider,{value:u,children:t})}},152:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var r=n(758),o=n(6234),a=n(3563),i=n(8924),l=n(8556),s=n(9181),c=n(6070);function u(e){let{error:t,tryAgain:n}=e;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){let{error:t}=e;const n=(0,i.rA)(t).map((e=>e.message)).join("\n\nCause:\n");return(0,c.jsx)("p",{style:{whiteSpace:"pre-wrap"},children:n})}function f(e){let{children:t}=e;return(0,c.jsx)(s.W,{value:{plugin:{name:"docusaurus-core-error-boundary",id:"default"}},children:t})}function p(e){let{error:t,tryAgain:n}=e;return(0,c.jsx)(f,{children:(0,c.jsxs)(m,{fallback:()=>(0,c.jsx)(u,{error:t,tryAgain:n}),children:[(0,c.jsx)(a.A,{children:(0,c.jsx)("title",{children:"Page Error"})}),(0,c.jsx)(l.A,{children:(0,c.jsx)(u,{error:t,tryAgain:n})})]})})}const h=e=>(0,c.jsx)(p,{...e});class m extends r.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){o.A.canUseDOM&&this.setState({error:e})}render(){const{children:e}=this.props,{error:t}=this.state;if(t){const e={error:t,tryAgain:()=>this.setState({error:null})};return(this.props.fallback??h)(e)}return e??null}}},6234:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});const r="undefined"!=typeof window&&"document"in window&&"createElement"in window.document,o={canUseDOM:r,canUseEventListeners:r&&("addEventListener"in window||"attachEvent"in window),canUseIntersectionObserver:r&&"IntersectionObserver"in window,canUseViewport:r&&"screen"in window}},3563:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});n(758);var r=n(932),o=n(6070);function a(e){return(0,o.jsx)(r.mg,{...e})}},7125:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var r=n(758),o=n(1742),a=n(8924),i=n(785),l=n(6347),s=n(6234),c=n(5432),u=n(7042),d=n(6070);function f(e,t){let{isNavLink:n,to:f,href:p,activeClassName:h,isActive:m,"data-noBrokenLinkCheck":g,autoAddBaseUrl:y=!0,...b}=e;const{siteConfig:v}=(0,i.A)(),{trailingSlash:w,baseUrl:S}=v,k=v.future.experimental_router,{withBaseUrl:x}=(0,u.hH)(),E=(0,c.A)(),_=(0,r.useRef)(null);(0,r.useImperativeHandle)(t,(()=>_.current));const O=f||p;const A=(0,l.A)(O),T=O?.replace("pathname://","");let C=void 0!==T?(j=T,y&&(e=>e.startsWith("/"))(j)?x(j):j):void 0;var j;"hash"===k&&C?.startsWith("./")&&(C=C?.slice(1)),C&&A&&(C=(0,a.Ks)(C,{trailingSlash:w,baseUrl:S}));const P=(0,r.useRef)(!1),I=n?o.k2:o.N_,N=s.A.canUseIntersectionObserver,L=(0,r.useRef)(),R=()=>{P.current||null==C||(window.docusaurus.preload(C),P.current=!0)};(0,r.useEffect)((()=>(!N&&A&&s.A.canUseDOM&&null!=C&&window.docusaurus.prefetch(C),()=>{N&&L.current&&L.current.disconnect()})),[L,C,N,A]);const D=C?.startsWith("#")??!1,M=!b.target||"_self"===b.target,F=!C||!A||!M||D&&"hash"!==k;g||!D&&F||E.collectLink(C),b.id&&E.collectAnchor(b.id);const B={};return F?(0,d.jsx)("a",{ref:_,href:C,...O&&!A&&{target:"_blank",rel:"noopener noreferrer"},...b,...B}):(0,d.jsx)(I,{...b,onMouseEnter:R,onTouchStart:R,innerRef:e=>{_.current=e,N&&e&&A&&(L.current=new window.IntersectionObserver((t=>{t.forEach((t=>{e===t.target&&(t.isIntersecting||t.intersectionRatio>0)&&(L.current.unobserve(e),L.current.disconnect(),null!=C&&window.docusaurus.prefetch(C))}))})),L.current.observe(e))},to:C,...n&&{isActive:m,activeClassName:h},...B})}const p=r.forwardRef(f)},9562:(e,t,n)=>{"use strict";n.d(t,{A:()=>c,T:()=>s});var r=n(758),o=n(6070);function a(e,t){const n=e.split(/(\{\w+\})/).map(((e,n)=>{if(n%2==1){const n=t?.[e.slice(1,-1)];if(void 0!==n)return n}return e}));return n.some((e=>(0,r.isValidElement)(e)))?n.map(((e,t)=>(0,r.isValidElement)(e)?r.cloneElement(e,{key:t}):e)).filter((e=>""!==e)):n.join("")}var i=n(2654);function l(e){let{id:t,message:n}=e;if(void 0===t&&void 0===n)throw new Error("Docusaurus translation declarations must have at least a translation id or a default translation message");return i[t??n]??n??t}function s(e,t){let{message:n,id:r}=e;return a(l({message:n,id:r}),t)}function c(e){let{children:t,id:n,values:r}=e;if(t&&"string"!=typeof t)throw console.warn("Illegal children",t),new Error("The Docusaurus component only accept simple string values");const i=l({message:t,id:n});return(0,o.jsx)(o.Fragment,{children:a(i,r)})}},3600:(e,t,n)=>{"use strict";n.d(t,{W:()=>r});const r="default"},6347:(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})},7042:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>l,hH:()=>i});var r=n(758),o=n(785),a=n(6347);function i(){const{siteConfig:e}=(0,o.A)(),{baseUrl:t,url:n}=e,i=e.future.experimental_router,l=(0,r.useCallback)(((e,r)=>function(e){let{siteUrl:t,baseUrl:n,url:r,options:{forcePrependBaseUrl:o=!1,absolute:i=!1}={},router:l}=e;if(!r||r.startsWith("#")||(0,a.z)(r))return r;if("hash"===l)return r.startsWith("/")?`.${r}`:`./${r}`;if(o)return n+r.replace(/^\//,"");if(r===n.replace(/\/$/,""))return n;const s=r.startsWith(n)?r:n+r.replace(/^\//,"");return i?t+s:s}({siteUrl:n,baseUrl:t,url:e,options:r,router:i})),[n,t,i]);return{withBaseUrl:l}}function l(e,t){void 0===t&&(t={});const{withBaseUrl:n}=i();return n(e,t)}},5432:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(758);n(6070);const o=r.createContext({collectAnchor:()=>{},collectLink:()=>{}}),a=()=>(0,r.useContext)(o);function i(){return a()}},785:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(758),o=n(9716);function a(){return(0,r.useContext)(o.o)}},2236:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(758),o=n(7010);function a(){return(0,r.useContext)(o.o)}},5536:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(758);const o=n(6234).A.canUseDOM?r.useLayoutEffect:r.useEffect},678:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});const r=e=>"object"==typeof e&&!!e&&Object.keys(e).length>0;function o(e){const t={};return function e(n,o){Object.entries(n).forEach((n=>{let[a,i]=n;const l=o?`${o}.${a}`:a;r(i)?e(i,l):t[l]=i}))}(e),t}},9181:(e,t,n)=>{"use strict";n.d(t,{W:()=>i,o:()=>a});var r=n(758),o=n(6070);const a=r.createContext(null);function i(e){let{children:t,value:n}=e;const i=r.useContext(a),l=(0,r.useMemo)((()=>function(e){let{parent:t,value:n}=e;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}const r={...t.data,...n?.data};return{plugin:t.plugin,data:r}}({parent:i,value:n})),[i,n]);return(0,o.jsx)(a.Provider,{value:l,children:t})}},1487:(e,t,n)=>{"use strict";n.d(t,{VQ:()=>g,XK:()=>v,g1:()=>b});var r=n(758),o=n(9517),a=n(3600),i=n(8859),l=n(4012),s=n(9713),c=n(6070);const u=e=>`docs-preferred-version-${e}`,d={save:(e,t,n)=>{(0,l.Wf)(u(e),{persistence:t}).set(n)},read:(e,t)=>(0,l.Wf)(u(e),{persistence:t}).get(),clear:(e,t)=>{(0,l.Wf)(u(e),{persistence:t}).del()}},f=e=>Object.fromEntries(e.map((e=>[e,{preferredVersionName:null}])));const p=r.createContext(null);function h(){const e=(0,o.Gy)(),t=(0,i.p)().docs.versionPersistence,n=(0,r.useMemo)((()=>Object.keys(e)),[e]),[a,l]=(0,r.useState)((()=>f(n)));(0,r.useEffect)((()=>{l(function(e){let{pluginIds:t,versionPersistence:n,allDocsData:r}=e;function o(e){const t=d.read(e,n);return r[e].versions.some((e=>e.name===t))?{preferredVersionName:t}:(d.clear(e,n),{preferredVersionName:null})}return Object.fromEntries(t.map((e=>[e,o(e)])))}({allDocsData:e,versionPersistence:t,pluginIds:n}))}),[e,t,n]);return[a,(0,r.useMemo)((()=>({savePreferredVersion:function(e,n){d.save(e,t,n),l((t=>({...t,[e]:{preferredVersionName:n}})))}})),[t])]}function m(e){let{children:t}=e;const n=h();return(0,c.jsx)(p.Provider,{value:n,children:t})}function g(e){let{children:t}=e;return(0,c.jsx)(m,{children:t})}function y(){const e=(0,r.useContext)(p);if(!e)throw new s.dV("DocsPreferredVersionContextProvider");return e}function b(e){void 0===e&&(e=a.W);const t=(0,o.ht)(e),[n,i]=y(),{preferredVersionName:l}=n[e];return{preferredVersion:t.versions.find((e=>e.name===l))??null,savePreferredVersionName:(0,r.useCallback)((t=>{i.savePreferredVersion(e,t)}),[i,e])}}function v(){const e=(0,o.Gy)(),[t]=y();function n(n){const r=e[n],{preferredVersionName:o}=t[n];return r.versions.find((e=>e.name===o))??null}const r=Object.keys(e);return Object.fromEntries(r.map((e=>[e,n(e)])))}},5604:(e,t,n)=>{"use strict";n.d(t,{k:()=>a,v:()=>i});var r=n(9517),o=n(1487);function a(e,t){return`docs-${e}-${t}`}function i(){const e=(0,r.Gy)(),t=(0,r.gk)(),n=(0,o.XK)();return[...Object.keys(e).map((function(r){const o=t?.activePlugin.pluginId===r?t.activeVersion:void 0,i=n[r],l=e[r].versions.find((e=>e.isLast));return a(r,(o??i??l).name)}))]}},7778:(e,t,n)=>{"use strict";n.d(t,{V:()=>s,t:()=>c});var r=n(758),o=n(9713),a=n(6070);const i=Symbol("EmptyContext"),l=r.createContext(i);function s(e){let{children:t,name:n,items:o}=e;const i=(0,r.useMemo)((()=>n&&o?{name:n,items:o}:null),[n,o]);return(0,a.jsx)(l.Provider,{value:i,children:t})}function c(){const e=(0,r.useContext)(l);if(e===i)throw new o.dV("DocsSidebarProvider");return e}},2903:(e,t,n)=>{"use strict";n.d(t,{B5:()=>x,Nr:()=>f,OF:()=>v,QB:()=>k,Vd:()=>w,Y:()=>y,fW:()=>S,w8:()=>m});var r=n(758),o=n(5557),a=n(1977),i=n(9517),l=n(4694),s=n(1381),c=n(1487),u=n(8082),d=n(7778);function f(e){return"link"!==e.type||e.unlisted?"category"===e.type?function(e){if(e.href&&!e.linkUnlisted)return e.href;for(const t of e.items){const e=f(t);if(e)return e}}(e):void 0:e.href}const p=(e,t)=>void 0!==e&&(0,l.ys)(e,t),h=(e,t)=>e.some((e=>m(e,t)));function m(e,t){return"link"===e.type?p(e.href,t):"category"===e.type&&(p(e.href,t)||h(e.items,t))}function g(e,t){switch(e.type){case"category":return m(e,t)||e.items.some((e=>g(e,t)));case"link":return!e.unlisted||m(e,t);default:return!0}}function y(e,t){return(0,r.useMemo)((()=>e.filter((e=>g(e,t)))),[e,t])}function b(e){let{sidebarItems:t,pathname:n,onlyCategories:r=!1}=e;const o=[];return function e(t){for(const a of t)if("category"===a.type&&((0,l.ys)(a.href,n)||e(a.items))||"link"===a.type&&(0,l.ys)(a.href,n)){return r&&"category"!==a.type||o.unshift(a),!0}return!1}(t),o}function v(){const e=(0,d.t)(),{pathname:t}=(0,o.zy)(),n=(0,i.vT)()?.pluginData.breadcrumbs;return!1!==n&&e?b({sidebarItems:e.items,pathname:t}):null}function w(e){const{activeVersion:t}=(0,i.zK)(e),{preferredVersion:n}=(0,c.g1)(e),o=(0,i.r7)(e);return(0,r.useMemo)((()=>(0,s.sb)([t,n,o].filter(Boolean))),[t,n,o])}function S(e,t){const n=w(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.sidebars?Object.entries(e.sidebars):[])),r=t.find((t=>t[0]===e));if(!r)throw new Error(`Can't find any sidebar with id "${e}" in version${n.length>1?"s":""} ${n.map((e=>e.name)).join(", ")}".\nAvailable sidebar ids are:\n- ${t.map((e=>e[0])).join("\n- ")}`);return r[1]}),[e,n])}function k(e,t){const n=w(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.docs)),r=t.find((t=>t.id===e));if(!r){if(n.flatMap((e=>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((e=>e.name)).join(", ")}".\nAvailable doc ids are:\n- ${(0,s.sb)(t.map((e=>e.id))).join("\n- ")}`)}return r}),[e,n])}function x(e){let{route:t}=e;const n=(0,o.zy)(),r=(0,u.r)(),i=t.routes,l=i.find((e=>(0,o.B6)(n.pathname,e)));if(!l)return null;const s=l.sidebar,c=s?r.docsSidebars[s]:void 0;return{docElement:(0,a.v)(i),sidebarName:s,sidebarItems:c}}},8082:(e,t,n)=>{"use strict";n.d(t,{n:()=>l,r:()=>s});var r=n(758),o=n(9713),a=n(6070);const i=r.createContext(null);function l(e){let{children:t,version:n}=e;return(0,a.jsx)(i.Provider,{value:n,children:t})}function s(){const e=(0,r.useContext)(i);if(null===e)throw new o.dV("DocsVersionProvider");return e}},9517:(e,t,n)=>{"use strict";n.d(t,{zK:()=>y,vT:()=>p,gk:()=>h,Gy:()=>d,HW:()=>b,ht:()=>f,r7:()=>g,jh:()=>m});var r=n(5557),o=n(785),a=n(3600);function i(e,t){void 0===t&&(t={});const n=function(){const{globalData:e}=(0,o.A)();return e}()[e];if(!n&&t.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin.`);return n}const l=e=>e.versions.find((e=>e.isLast));function s(e,t){return[...e.versions].sort(((e,t)=>e.path===t.path?0:e.path.includes(t.path)?-1:t.path.includes(e.path)?1:0)).find((e=>!!(0,r.B6)(t,{path:e.path,exact:!1,strict:!1})))}function c(e,t){const n=s(e,t),o=n?.docs.find((e=>!!(0,r.B6)(t,{path:e.path,exact:!0,strict:!1})));return{activeVersion:n,activeDoc:o,alternateDocVersions:o?function(t){const n={};return e.versions.forEach((e=>{e.docs.forEach((r=>{r.id===t&&(n[e.name]=r)}))})),n}(o.id):{}}}const u={},d=()=>i("docusaurus-plugin-content-docs")??u,f=e=>{try{return function(e,t,n){void 0===t&&(t=a.W),void 0===n&&(n={});const r=i(e),o=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){void 0===e&&(e={});const t=d(),{pathname:n}=(0,r.zy)();return function(e,t,n){void 0===n&&(n={});const o=Object.entries(e).sort(((e,t)=>t[1].path.localeCompare(e[1].path))).find((e=>{let[,n]=e;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((e=>e.path)).join(", ")}`);return a}(t,n,e)}function h(e){void 0===e&&(e={});const t=p(e),{pathname:n}=(0,r.zy)();if(!t)return;return{activePlugin:t,activeVersion:s(t.pluginData,n)}}function m(e){return f(e).versions}function g(e){const t=f(e);return l(t)}function y(e){const t=f(e),{pathname:n}=(0,r.zy)();return c(t,n)}function b(e){const t=f(e),{pathname:n}=(0,r.zy)();return function(e,t){const n=l(e);return{latestDocSuggestion:c(e,t).alternateDocVersions[n.name],latestVersionSuggestion:n}}(t,n)}},2625:(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(8744),o=n.n(r);o().configure({showSpinner:!1});const a={onRouteUpdate(e){let{location:t,previousLocation:n}=e;if(n&&t.pathname!==n.pathname){const e=window.setTimeout((()=>{o().start()}),200);return()=>window.clearTimeout(e)}},onRouteDidUpdate(){o().done()}}},1878:(e,t,n)=>{"use strict";var r=n(6194),o=n(4784);!function(e){const{themeConfig:{prism:t}}=o.default,{additionalLanguages:r}=t,a=globalThis.Prism;globalThis.Prism=e,r.forEach((e=>{"php"===e&&n(1274),n(9571)(`./prism-${e}`)})),delete globalThis.Prism,void 0!==a&&(globalThis.Prism=e)}(r.My)},3570:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});n(758);var r=n(3526),o=n(9562),a=n(8859),i=n(7125),l=n(5432);const s={anchorWithStickyNavbar:"anchorWithStickyNavbar_iI2l",anchorWithHideOnScrollNavbar:"anchorWithHideOnScrollNavbar_Xbb9"};var c=n(6070);function u(e){let{as:t,id:n,...u}=e;const d=(0,l.A)(),{navbar:{hideOnScroll:f}}=(0,a.p)();if("h1"===t||!n)return(0,c.jsx)(t,{...u,id:void 0});d.collectAnchor(n);const p=(0,o.T)({id:"theme.common.headingLinkTitle",message:"Direct link to {heading}",description:"Title for link to heading"},{heading:"string"==typeof u.children?u.children:n});return(0,c.jsxs)(t,{...u,className:(0,r.A)("anchor",f?s.anchorWithHideOnScrollNavbar:s.anchorWithStickyNavbar,u.className),id:n,children:[u.children,(0,c.jsx)(i.A,{className:"hash-link",to:`#${n}`,"aria-label":p,title:p,children:"\u200b"})]})}},490:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});n(758);const r={iconExternalLink:"iconExternalLink_Pj1s"};var o=n(6070);function a(e){let{width:t=13.5,height:n=13.5}=e;return(0,o.jsx)("svg",{width:t,height:n,"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"})})}},8556:(e,t,n)=>{"use strict";n.d(t,{A:()=>kt});var r=n(758),o=n(3526),a=n(152),i=n(9904),l=n(5557),s=n(9562),c=n(8997),u=n(6070);const d="__docusaurus_skipToContent_fallback";function f(e){e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")}function p(){const e=(0,r.useRef)(null),{action:t}=(0,l.W6)(),n=(0,r.useCallback)((e=>{e.preventDefault();const t=document.querySelector("main:first-of-type")??document.getElementById(d);t&&f(t)}),[]);return(0,c.$)((n=>{let{location:r}=n;e.current&&!r.hash&&"PUSH"===t&&f(e.current)})),{containerRef:e,onClick:n}}const h=(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 m(e){const t=e.children??h,{containerRef:n,onClick:r}=p();return(0,u.jsx)("div",{ref:n,role:"region","aria-label":h,children:(0,u.jsx)("a",{...e,href:`#${d}`,onClick:r,children:t})})}var g=n(6860),y=n(6130);const b={skipToContent:"skipToContent_dVN0"};function v(){return(0,u.jsx)(m,{className:b.skipToContent})}var w=n(8859),S=n(5076);function k(e){let{width:t=21,height:n=21,color:r="currentColor",strokeWidth:o=1.2,className:a,...i}=e;return(0,u.jsx)("svg",{viewBox:"0 0 15 15",width:t,height:n,...i,children:(0,u.jsx)("g",{stroke:r,strokeWidth:o,children:(0,u.jsx)("path",{d:"M.75.75l13.5 13.5M14.25.75L.75 14.25"})})})}const x={closeButton:"closeButton_Us5y"};function E(e){return(0,u.jsx)("button",{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",x.closeButton,e.className),children:(0,u.jsx)(k,{width:14,height:14,strokeWidth:3.1})})}const _={content:"content_KjGk"};function O(e){const{announcementBar:t}=(0,w.p)(),{content:n}=t;return(0,u.jsx)("div",{...e,className:(0,o.A)(_.content,e.className),dangerouslySetInnerHTML:{__html:n}})}const A={announcementBar:"announcementBar_qxyS",announcementBarPlaceholder:"announcementBarPlaceholder_BqXI",announcementBarClose:"announcementBarClose_Ni_9",announcementBarContent:"announcementBarContent_ucGr"};function T(){const{announcementBar:e}=(0,w.p)(),{isActive:t,close:n}=(0,S.M)();if(!t)return null;const{backgroundColor:r,textColor:o,isCloseable:a}=e;return(0,u.jsxs)("div",{className:A.announcementBar,style:{backgroundColor:r,color:o},role:"banner",children:[a&&(0,u.jsx)("div",{className:A.announcementBarPlaceholder}),(0,u.jsx)(O,{className:A.announcementBarContent}),a&&(0,u.jsx)(E,{onClick:n,className:A.announcementBarClose})]})}var C=n(5624),j=n(8155);var P=n(9713),I=n(217);const N=r.createContext(null);function L(e){let{children:t}=e;const n=function(){const e=(0,C.M)(),t=(0,I.YL)(),[n,o]=(0,r.useState)(!1),a=null!==t.component,i=(0,P.ZC)(a);return(0,r.useEffect)((()=>{a&&!i&&o(!0)}),[a,i]),(0,r.useEffect)((()=>{a?e.shown||o(!0):o(!1)}),[e.shown,a]),(0,r.useMemo)((()=>[n,o]),[n])}();return(0,u.jsx)(N.Provider,{value:n,children:t})}function R(e){if(e.component){const t=e.component;return(0,u.jsx)(t,{...e.props})}}function D(){const e=(0,r.useContext)(N);if(!e)throw new P.dV("NavbarSecondaryMenuDisplayProvider");const[t,n]=e,o=(0,r.useCallback)((()=>n(!1)),[n]),a=(0,I.YL)();return(0,r.useMemo)((()=>({shown:t,hide:o,content:R(a)})),[o,a,t])}function M(e){let{header:t,primaryMenu:n,secondaryMenu:r}=e;const{shown:a}=D();return(0,u.jsxs)("div",{className:"navbar-sidebar",children:[t,(0,u.jsxs)("div",{className:(0,o.A)("navbar-sidebar__items",{"navbar-sidebar__items--show-secondary":a}),children:[(0,u.jsx)("div",{className:"navbar-sidebar__item menu",children:n}),(0,u.jsx)("div",{className:"navbar-sidebar__item menu",children:r})]})]})}var F=n(2916),B=n(2236);function z(e){return(0,u.jsx)("svg",{viewBox:"0 0 24 24",width:24,height:24,...e,children:(0,u.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 U(e){return(0,u.jsx)("svg",{viewBox:"0 0 24 24",width:24,height:24,...e,children:(0,u.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_CLc4",toggleButton:"toggleButton_HWRK",darkToggleIcon:"darkToggleIcon_vtMU",lightToggleIcon:"lightToggleIcon_HfO8",toggleButtonDisabled:"toggleButtonDisabled_ONEb"};function H(e){let{className:t,buttonClassName:n,value:r,onChange:a}=e;const i=(0,B.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,u.jsx)("div",{className:(0,o.A)($.toggle,t),children:(0,u.jsxs)("button",{className:(0,o.A)("clean-btn",$.toggleButton,!i&&$.toggleButtonDisabled,n),type:"button",onClick:()=>a("dark"===r?"light":"dark"),disabled:!i,title:l,"aria-label":l,"aria-live":"polite","aria-pressed":"dark"===r?"true":"false",children:[(0,u.jsx)(z,{className:(0,o.A)($.toggleIcon,$.lightToggleIcon)}),(0,u.jsx)(U,{className:(0,o.A)($.toggleIcon,$.darkToggleIcon)})]})})}const V=r.memo(H),q={darkNavbarColorModeToggle:"darkNavbarColorModeToggle_bkkN"};function W(e){let{className:t}=e;const n=(0,w.p)().navbar.style,r=(0,w.p)().colorMode.disableSwitch,{colorMode:o,setColorMode:a}=(0,F.G)();return r?null:(0,u.jsx)(V,{className:t,buttonClassName:"dark"===n?q.darkNavbarColorModeToggle:void 0,value:o,onChange:a})}var K=n(3448);function G(){return(0,u.jsx)(K.A,{className:"navbar__brand",imageClassName:"navbar__logo",titleClassName:"navbar__title text--truncate"})}function Y(){const e=(0,C.M)();return(0,u.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:()=>e.toggle(),children:(0,u.jsx)(k,{color:"var(--ifm-color-emphasis-600)"})})}function Q(){return(0,u.jsxs)("div",{className:"navbar-sidebar__brand",children:[(0,u.jsx)(G,{}),(0,u.jsx)(W,{className:"margin-right--md"}),(0,u.jsx)(Y,{})]})}var Z=n(7125),X=n(7042),J=n(6347),ee=n(6639),te=n(490);function ne(e){let{activeBasePath:t,activeBaseRegex:n,to:r,href:o,label:a,html:i,isDropdownLink:l,prependBaseUrlToHref:s,...c}=e;const d=(0,X.Ay)(r),f=(0,X.Ay)(t),p=(0,X.Ay)(o,{forcePrependBaseUrl:!0}),h=a&&o&&!(0,J.A)(o),m=i?{dangerouslySetInnerHTML:{__html:i}}:{children:(0,u.jsxs)(u.Fragment,{children:[a,h&&(0,u.jsx)(te.A,{...l&&{width:12,height:12}})]})};return o?(0,u.jsx)(Z.A,{href:s?p:o,...c,...m}):(0,u.jsx)(Z.A,{to:d,isNavLink:!0,...(t||n)&&{isActive:(e,t)=>n?(0,ee.G)(n,t.pathname):t.pathname.startsWith(f)},...c,...m})}function re(e){let{className:t,isDropdownItem:n=!1,...r}=e;const a=(0,u.jsx)(ne,{className:(0,o.A)(n?"dropdown__link":"navbar__item navbar__link",t),isDropdownLink:n,...r});return n?(0,u.jsx)("li",{children:a}):a}function oe(e){let{className:t,isDropdownItem:n,...r}=e;return(0,u.jsx)("li",{className:"menu__list-item",children:(0,u.jsx)(ne,{className:(0,o.A)("menu__link",t),...r})})}function ae(e){let{mobile:t=!1,position:n,...r}=e;const o=t?oe:re;return(0,u.jsx)(o,{...r,activeClassName:r.activeClassName??(t?"menu__link--active":"navbar__link--active")})}var ie=n(1359),le=n(4694),se=n(785);const ce="dropdownNavbarItemMobile_gMU3";function ue(e,t){return e.some((e=>function(e,t){return!!(0,le.ys)(e.to,t)||!!(0,ee.G)(e.activeBaseRegex,t)||!(!e.activeBasePath||!t.startsWith(e.activeBasePath))}(e,t)))}function de(e){let{items:t,position:n,className:a,onClick:i,...l}=e;const s=(0,r.useRef)(null),[c,d]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{const e=e=>{s.current&&!s.current.contains(e.target)&&d(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),document.addEventListener("focusin",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e),document.removeEventListener("focusin",e)}}),[s]),(0,u.jsxs)("div",{ref:s,className:(0,o.A)("navbar__item","dropdown","dropdown--hoverable",{"dropdown--right":"right"===n,"dropdown--show":c}),children:[(0,u.jsx)(ne,{"aria-haspopup":"true","aria-expanded":c,role:"button",href:l.to?void 0:"#",className:(0,o.A)("navbar__link",a),...l,onClick:l.to?void 0:e=>e.preventDefault(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),d(!c))},children:l.children??l.label}),(0,u.jsx)("ul",{className:"dropdown__menu",children:t.map(((e,t)=>(0,r.createElement)(Fe,{isDropdownItem:!0,activeClassName:"dropdown__link--active",...e,key:t})))})]})}function fe(e){let{items:t,className:n,position:a,onClick:i,...s}=e;const c=function(){const{siteConfig:{baseUrl:e}}=(0,se.A)(),{pathname:t}=(0,l.zy)();return t.replace(e,"/")}(),d=ue(t,c),{collapsed:f,toggleCollapsed:p,setCollapsed:h}=(0,ie.u)({initialState:()=>!d});return(0,r.useEffect)((()=>{d&&h(!d)}),[c,d,h]),(0,u.jsxs)("li",{className:(0,o.A)("menu__list-item",{"menu__list-item--collapsed":f}),children:[(0,u.jsx)(ne,{role:"button",className:(0,o.A)(ce,"menu__link menu__link--sublist menu__link--sublist-caret",n),...s,onClick:e=>{e.preventDefault(),p()},children:s.children??s.label}),(0,u.jsx)(ie.N,{lazy:!0,as:"ul",className:"menu__list",collapsed:f,children:t.map(((e,t)=>(0,r.createElement)(Fe,{mobile:!0,isDropdownItem:!0,onClick:i,activeClassName:"menu__link--active",...e,key:t})))})]})}function pe(e){let{mobile:t=!1,...n}=e;const r=t?fe:de;return(0,u.jsx)(r,{...n})}var he=n(1352);function me(e){let{width:t=20,height:n=20,...r}=e;return(0,u.jsx)("svg",{viewBox:"0 0 24 24",width:t,height:n,"aria-hidden":!0,...r,children:(0,u.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 ge="iconLanguage_E4tn";var ye=n(8143),be=n(934),ve=n(3563),we=n(6472),Se=n(7651),ke=n(1956),xe=n(5604);function Ee(){return[`language:${(0,se.A)().i18n.currentLocale}`,function(){const e=(0,xe.v)();return[ke.C,...e]}().map((e=>`docusaurus_tag:${e}`))]}const _e={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"})};let Oe=null;function Ae(e){let{hit:t,children:n}=e;return(0,u.jsx)(Z.A,{to:t.url,children:n})}function Te(e){let{state:t,onClose:n}=e;const r=(0,we.w)();return(0,u.jsx)(Z.A,{to:r(t.query),onClick:n,children:(0,u.jsx)(s.A,{id:"theme.SearchBar.seeAll",values:{count:t.context.nbHits},children:"See all {count} results"})})}function Ce(e){let{contextualSearch:t,externalUrlRegex:o,...a}=e;const{siteMetadata:i}=(0,se.A)(),s=(0,Se.C)(),c=Ee(),d=a.searchParameters?.facetFilters??[],f=t?function(e,t){const n=e=>"string"==typeof e?[e]:e;return[...n(e),...n(t)]}(c,d):d,p={...a.searchParameters,facetFilters:f},h=(0,l.W6)(),m=(0,r.useRef)(null),g=(0,r.useRef)(null),[y,b]=(0,r.useState)(!1),[v,w]=(0,r.useState)(void 0),S=(0,r.useCallback)((()=>Oe?Promise.resolve():Promise.all([n.e(7416).then(n.bind(n,7416)),Promise.all([n.e(1869),n.e(8235)]).then(n.bind(n,8235)),Promise.all([n.e(1869),n.e(8087)]).then(n.bind(n,8087))]).then((e=>{let[{DocSearchModal:t}]=e;Oe=t}))),[]),k=(0,r.useCallback)((()=>{if(!m.current){const e=document.createElement("div");m.current=e,document.body.insertBefore(e,document.body.firstChild)}}),[]),x=(0,r.useCallback)((()=>{k(),S().then((()=>b(!0)))}),[S,k]),E=(0,r.useCallback)((()=>{b(!1),g.current?.focus()}),[]),_=(0,r.useCallback)((e=>{"f"===e.key&&(e.metaKey||e.ctrlKey)||(e.preventDefault(),w(e.key),x())}),[x]),O=(0,r.useRef)({navigate(e){let{itemUrl:t}=e;(0,ee.G)(o,t)?window.location.href=t:h.push(t)}}).current,A=(0,r.useRef)((e=>a.transformItems?a.transformItems(e):e.map((e=>({...e,url:s(e.url)}))))).current,T=(0,r.useMemo)((()=>e=>(0,u.jsx)(Te,{...e,onClose:E})),[E]),C=(0,r.useCallback)((e=>(e.addAlgoliaAgent("docusaurus",i.docusaurusVersion),e)),[i.docusaurusVersion]);return(0,be.E8)({isOpen:y,onOpen:x,onClose:E,onInput:_,searchButtonRef:g}),(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ve.A,{children:(0,u.jsx)("link",{rel:"preconnect",href:`https://${a.appId}-dsn.algolia.net`,crossOrigin:"anonymous"})}),(0,u.jsx)(be.Bc,{onTouchStart:S,onFocus:S,onMouseOver:S,onClick:x,ref:g,translations:_e.button}),y&&Oe&&m.current&&(0,ye.createPortal)((0,u.jsx)(Oe,{onClose:E,initialScrollY:window.scrollY,initialQuery:v,navigator:O,transformItems:A,hitComponent:Ae,transformSearchClient:C,...a.searchPagePath&&{resultsFooterComponent:T},...a,searchParameters:p,placeholder:_e.placeholder,translations:_e.modal}),m.current)]})}function je(){const{siteConfig:e}=(0,se.A)();return(0,u.jsx)(Ce,{...e.themeConfig.algolia})}const Pe={navbarSearchContainer:"navbarSearchContainer_MwwF"};function Ie(e){let{children:t,className:n}=e;return(0,u.jsx)("div",{className:(0,o.A)(n,Pe.navbarSearchContainer),children:t})}var Ne=n(9517),Le=n(2903);var Re=n(1487);function De(e,t){return t.alternateDocVersions[e.name]??function(e){return e.docs.find((t=>t.id===e.mainDocId))}(e)}const Me={default:ae,localeDropdown:function(e){let{mobile:t,dropdownItemsBefore:n,dropdownItemsAfter:r,queryString:o="",...a}=e;const{i18n:{currentLocale:i,locales:c,localeConfigs:d}}=(0,se.A)(),f=(0,he.o)(),{search:p,hash:h}=(0,l.zy)(),m=[...n,...c.map((e=>{const n=`${`pathname://${f.createUrl({locale:e,fullyQualified:!1})}`}${p}${h}${o}`;return{label:d[e].label,lang:d[e].htmlLang,to:n,target:"_self",autoAddBaseUrl:!1,className:e===i?t?"menu__link--active":"dropdown__link--active":""}})),...r],g=t?(0,s.T)({message:"Languages",id:"theme.navbar.mobileLanguageDropdown.label",description:"The label for the mobile language switcher dropdown"}):d[i].label;return(0,u.jsx)(pe,{...a,mobile:t,label:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(me,{className:ge}),g]}),items:m})},search:function(e){let{mobile:t,className:n}=e;return t?null:(0,u.jsx)(Ie,{className:n,children:(0,u.jsx)(je,{})})},dropdown:pe,html:function(e){let{value:t,className:n,mobile:r=!1,isDropdownItem:a=!1}=e;const i=a?"li":"div";return(0,u.jsx)(i,{className:(0,o.A)({navbar__item:!r&&!a,"menu__list-item":r},n),dangerouslySetInnerHTML:{__html:t}})},doc:function(e){let{docId:t,label:n,docsPluginId:r,...o}=e;const{activeDoc:a}=(0,Ne.zK)(r),i=(0,Le.QB)(t,r),l=a?.path===i?.path;return null===i||i.unlisted&&!l?null:(0,u.jsx)(ae,{exact:!0,...o,isActive:()=>l||!!a?.sidebar&&a.sidebar===i.sidebar,label:n??i.id,to:i.path})},docSidebar:function(e){let{sidebarId:t,label:n,docsPluginId:r,...o}=e;const{activeDoc:a}=(0,Ne.zK)(r),i=(0,Le.fW)(t,r).link;if(!i)throw new Error(`DocSidebarNavbarItem: Sidebar with ID "${t}" doesn't have anything to be linked to.`);return(0,u.jsx)(ae,{exact:!0,...o,isActive:()=>a?.sidebar===t,label:n??i.label,to:i.path})},docsVersion:function(e){let{label:t,to:n,docsPluginId:r,...o}=e;const a=(0,Le.Vd)(r)[0],i=t??a.label,l=n??(e=>e.docs.find((t=>t.id===e.mainDocId)))(a).path;return(0,u.jsx)(ae,{...o,label:i,to:l})},docsVersionDropdown:function(e){let{mobile:t,docsPluginId:n,dropdownActiveClassDisabled:r,dropdownItemsBefore:o,dropdownItemsAfter:a,...i}=e;const{search:c,hash:d}=(0,l.zy)(),f=(0,Ne.zK)(n),p=(0,Ne.jh)(n),{savePreferredVersionName:h}=(0,Re.g1)(n),m=[...o,...p.map((function(e){const t=De(e,f);return{label:e.label,to:`${t.path}${c}${d}`,isActive:()=>e===f.activeVersion,onClick:()=>h(e.name)}})),...a],g=(0,Le.Vd)(n)[0],y=t&&m.length>1?(0,s.T)({id:"theme.navbar.mobileVersionsDropdown.label",message:"Versions",description:"The label for the navbar versions dropdown on mobile view"}):g.label,b=t&&m.length>1?void 0:De(g,f).path;return m.length<=1?(0,u.jsx)(ae,{...i,mobile:t,label:y,to:b,isActive:r?()=>!1:void 0}):(0,u.jsx)(pe,{...i,mobile:t,label:y,to:b,items:m,isActive:r?()=>!1:void 0})}};function Fe(e){let{type:t,...n}=e;const r=function(e,t){return e&&"default"!==e?e:"items"in t?"dropdown":"default"}(t,n),o=Me[r];if(!o)throw new Error(`No NavbarItem component found for type "${t}".`);return(0,u.jsx)(o,{...n})}function Be(){const e=(0,C.M)(),t=(0,w.p)().navbar.items;return(0,u.jsx)("ul",{className:"menu__list",children:t.map(((t,n)=>(0,r.createElement)(Fe,{mobile:!0,...t,onClick:()=>e.toggle(),key:n})))})}function ze(e){return(0,u.jsx)("button",{...e,type:"button",className:"clean-btn navbar-sidebar__back",children:(0,u.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 Ue(){const e=0===(0,w.p)().navbar.items.length,t=D();return(0,u.jsxs)(u.Fragment,{children:[!e&&(0,u.jsx)(ze,{onClick:()=>t.hide()}),t.content]})}function $e(){const e=(0,C.M)();var t;return void 0===(t=e.shown)&&(t=!0),(0,r.useEffect)((()=>(document.body.style.overflow=t?"hidden":"visible",()=>{document.body.style.overflow="visible"})),[t]),e.shouldRender?(0,u.jsx)(M,{header:(0,u.jsx)(Q,{}),primaryMenu:(0,u.jsx)(Be,{}),secondaryMenu:(0,u.jsx)(Ue,{})}):null}const He={navbarHideable:"navbarHideable_A1bd",navbarHidden:"navbarHidden_FXjS"};function Ve(e){return(0,u.jsx)("div",{role:"presentation",...e,className:(0,o.A)("navbar-sidebar__backdrop",e.className)})}function qe(e){let{children:t}=e;const{navbar:{hideOnScroll:n,style:a}}=(0,w.p)(),i=(0,C.M)(),{navbarRef:l,isNavbarVisible:d}=function(e){const[t,n]=(0,r.useState)(e),o=(0,r.useRef)(!1),a=(0,r.useRef)(0),i=(0,r.useCallback)((e=>{null!==e&&(a.current=e.getBoundingClientRect().height)}),[]);return(0,j.Mq)(((t,r)=>{let{scrollY:i}=t;if(!e)return;if(i=l?n(!1):i+c{if(!e)return;const r=t.location.hash;if(r?document.getElementById(r.substring(1)):void 0)return o.current=!0,void n(!1);n(!0)})),{navbarRef:i,isNavbarVisible:t}}(n);return(0,u.jsxs)("nav",{ref:l,"aria-label":(0,s.T)({id:"theme.NavBar.navAriaLabel",message:"Main",description:"The ARIA label for the main navigation"}),className:(0,o.A)("navbar","navbar--fixed-top",n&&[He.navbarHideable,!d&&He.navbarHidden],{"navbar--dark":"dark"===a,"navbar--primary":"primary"===a,"navbar-sidebar--show":i.shown}),children:[t,(0,u.jsx)(Ve,{onClick:i.toggle}),(0,u.jsx)($e,{})]})}var We=n(3385);const Ke="right";function Ge(e){let{width:t=30,height:n=30,className:r,...o}=e;return(0,u.jsx)("svg",{className:r,width:t,height:n,viewBox:"0 0 30 30","aria-hidden":"true",...o,children:(0,u.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M4 7h22M4 15h22M4 23h22"})})}function Ye(){const{toggle:e,shown:t}=(0,C.M)();return(0,u.jsx)("button",{onClick:e,"aria-label":(0,s.T)({id:"theme.docs.sidebar.toggleSidebarButtonAriaLabel",message:"Toggle navigation bar",description:"The ARIA label for hamburger menu button of mobile navigation"}),"aria-expanded":t,className:"navbar__toggle clean-btn",type:"button",children:(0,u.jsx)(Ge,{})})}const Qe={colorModeToggle:"colorModeToggle_bX7e"};function Ze(e){let{items:t}=e;return(0,u.jsx)(u.Fragment,{children:t.map(((e,t)=>(0,u.jsx)(We.k2,{onError:t=>new Error(`A theme navbar item failed to render.\nPlease double-check the following navbar item (themeConfig.navbar.items) of your Docusaurus config:\n${JSON.stringify(e,null,2)}`,{cause:t}),children:(0,u.jsx)(Fe,{...e})},t)))})}function Xe(e){let{left:t,right:n}=e;return(0,u.jsxs)("div",{className:"navbar__inner",children:[(0,u.jsx)("div",{className:"navbar__items",children:t}),(0,u.jsx)("div",{className:"navbar__items navbar__items--right",children:n})]})}function Je(){const e=(0,C.M)(),t=(0,w.p)().navbar.items,[n,r]=function(e){function t(e){return"left"===(e.position??Ke)}return[e.filter(t),e.filter((e=>!t(e)))]}(t),o=t.find((e=>"search"===e.type));return(0,u.jsx)(Xe,{left:(0,u.jsxs)(u.Fragment,{children:[!e.disabled&&(0,u.jsx)(Ye,{}),(0,u.jsx)(G,{}),(0,u.jsx)(Ze,{items:n})]}),right:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Ze,{items:r}),(0,u.jsx)(W,{className:Qe.colorModeToggle}),!o&&(0,u.jsx)(Ie,{children:(0,u.jsx)(je,{})})]})})}function et(){return(0,u.jsx)(qe,{children:(0,u.jsx)(Je,{})})}function tt(e){let{item:t}=e;const{to:n,href:r,label:o,prependBaseUrlToHref:a,...i}=t,l=(0,X.Ay)(n),s=(0,X.Ay)(r,{forcePrependBaseUrl:!0});return(0,u.jsxs)(Z.A,{className:"footer__link-item",...r?{href:a?s:r}:{to:l},...i,children:[o,r&&!(0,J.A)(r)&&(0,u.jsx)(te.A,{})]})}function nt(e){let{item:t}=e;return t.html?(0,u.jsx)("li",{className:"footer__item",dangerouslySetInnerHTML:{__html:t.html}}):(0,u.jsx)("li",{className:"footer__item",children:(0,u.jsx)(tt,{item:t})},t.href??t.to)}function rt(e){let{column:t}=e;return(0,u.jsxs)("div",{className:"col footer__col",children:[(0,u.jsx)("div",{className:"footer__title",children:t.title}),(0,u.jsx)("ul",{className:"footer__items clean-list",children:t.items.map(((e,t)=>(0,u.jsx)(nt,{item:e},t)))})]})}function ot(e){let{columns:t}=e;return(0,u.jsx)("div",{className:"row footer__links",children:t.map(((e,t)=>(0,u.jsx)(rt,{column:e},t)))})}function at(){return(0,u.jsx)("span",{className:"footer__link-separator",children:"\xb7"})}function it(e){let{item:t}=e;return t.html?(0,u.jsx)("span",{className:"footer__link-item",dangerouslySetInnerHTML:{__html:t.html}}):(0,u.jsx)(tt,{item:t})}function lt(e){let{links:t}=e;return(0,u.jsx)("div",{className:"footer__links text--center",children:(0,u.jsx)("div",{className:"footer__links",children:t.map(((e,n)=>(0,u.jsxs)(r.Fragment,{children:[(0,u.jsx)(it,{item:e}),t.length!==n+1&&(0,u.jsx)(at,{})]},n)))})})}function st(e){let{links:t}=e;return function(e){return"title"in e[0]}(t)?(0,u.jsx)(ot,{columns:t}):(0,u.jsx)(lt,{links:t})}var ct=n(6741);const ut="footerLogoLink_LZ5w";function dt(e){let{logo:t}=e;const{withBaseUrl:n}=(0,X.hH)(),r={light:n(t.src),dark:n(t.srcDark??t.src)};return(0,u.jsx)(ct.A,{className:(0,o.A)("footer__logo",t.className),alt:t.alt,sources:r,width:t.width,height:t.height,style:t.style})}function ft(e){let{logo:t}=e;return t.href?(0,u.jsx)(Z.A,{href:t.href,className:ut,target:t.target,children:(0,u.jsx)(dt,{logo:t})}):(0,u.jsx)(dt,{logo:t})}function pt(e){let{copyright:t}=e;return(0,u.jsx)("div",{className:"footer__copyright",dangerouslySetInnerHTML:{__html:t}})}function ht(e){let{style:t,links:n,logo:r,copyright:a}=e;return(0,u.jsx)("footer",{className:(0,o.A)("footer",{"footer--dark":"dark"===t}),children:(0,u.jsxs)("div",{className:"container container-fluid",children:[n,(r||a)&&(0,u.jsxs)("div",{className:"footer__bottom text--center",children:[r&&(0,u.jsx)("div",{className:"margin-bottom--sm",children:r}),a]})]})})}function mt(){const{footer:e}=(0,w.p)();if(!e)return null;const{copyright:t,links:n,logo:r,style:o}=e;return(0,u.jsx)(ht,{style:o,links:n&&n.length>0&&(0,u.jsx)(st,{links:n}),logo:r&&(0,u.jsx)(ft,{logo:r}),copyright:t&&(0,u.jsx)(pt,{copyright:t})})}const gt=r.memo(mt),yt=(0,P.fM)([F.a,S.o,j.Tv,Re.VQ,i.Jx,function(e){let{children:t}=e;return(0,u.jsx)(I.y_,{children:(0,u.jsx)(C.e,{children:(0,u.jsx)(L,{children:t})})})}]);function bt(e){let{children:t}=e;return(0,u.jsx)(yt,{children:t})}var vt=n(3570);function wt(e){let{error:t,tryAgain:n}=e;return(0,u.jsx)("main",{className:"container margin-vert--xl",children:(0,u.jsx)("div",{className:"row",children:(0,u.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,u.jsx)(vt.A,{as:"h1",className:"hero__title",children:(0,u.jsx)(s.A,{id:"theme.ErrorPageContent.title",description:"The title of the fallback page when the page crashed",children:"This page crashed."})}),(0,u.jsx)("div",{className:"margin-vert--lg",children:(0,u.jsx)(We.a2,{onClick:n,className:"button button--primary shadow--lw"})}),(0,u.jsx)("hr",{}),(0,u.jsx)("div",{className:"margin-vert--md",children:(0,u.jsx)(We.bq,{error:t})})]})})})}const St={mainWrapper:"mainWrapper_o_KS"};function kt(e){const{children:t,noFooter:n,wrapperClassName:r,title:l,description:s}=e;return(0,y.J)(),(0,u.jsxs)(bt,{children:[(0,u.jsx)(i.be,{title:l,description:s}),(0,u.jsx)(v,{}),(0,u.jsx)(T,{}),(0,u.jsx)(et,{}),(0,u.jsx)("div",{id:d,className:(0,o.A)(g.G.wrapper.main,St.mainWrapper,r),children:(0,u.jsx)(a.A,{fallback:e=>(0,u.jsx)(wt,{...e}),children:t})}),!n&&(0,u.jsx)(gt,{})]})}},3448:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});n(758);var r=n(7125),o=n(7042),a=n(785),i=n(8859),l=n(6741),s=n(6070);function c(e){let{logo:t,alt:n,imageClassName:r}=e;const a={light:(0,o.Ay)(t.src),dark:(0,o.Ay)(t.srcDark||t.src)},i=(0,s.jsx)(l.A,{className:t.className,sources:a,height:t.height,width:t.width,alt:n,style:t.style});return r?(0,s.jsx)("div",{className:r,children:i}):i}function u(e){const{siteConfig:{title:t}}=(0,a.A)(),{navbar:{title:n,logo:l}}=(0,i.p)(),{imageClassName:u,titleClassName:d,...f}=e,p=(0,o.Ay)(l?.href||"/"),h=n?"":t,m=l?.alt??h;return(0,s.jsxs)(r.A,{to:p,...f,...l?.target&&{target:l.target},children:[l&&(0,s.jsx)(c,{logo:l,alt:m,imageClassName:u}),null!=n&&(0,s.jsx)("b",{className:d,children:n})]})}},7246:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});n(758);var r=n(3563),o=n(6070);function a(e){let{locale:t,version:n,tag:a}=e;const 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})]})}},6741:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var r=n(758),o=n(3526),a=n(2236),i=n(2916);const l={themedComponent:"themedComponent_qyia","themedComponent--light":"themedComponent--light_v0Bt","themedComponent--dark":"themedComponent--dark_Hnwb"};var s=n(6070);function c(e){let{className:t,children:n}=e;const c=(0,a.A)(),{colorMode:u}=(0,i.G)();return(0,s.jsx)(s.Fragment,{children:(c?"dark"===u?["dark"]:["light"]:["light","dark"]).map((e=>{const a=n({theme:e,className:(0,o.A)(t,l.themedComponent,l[`themedComponent--${e}`])});return(0,s.jsx)(r.Fragment,{children:a},e)}))})}function u(e){const{sources:t,className:n,alt:r,...o}=e;return(0,s.jsx)(c,{className:n,children:e=>{let{theme:n,className:a}=e;return(0,s.jsx)("img",{src:t[n],alt:r,className:a,...o})}})}},1359:(e,t,n)=>{"use strict";n.d(t,{N:()=>y,u:()=>c});var r=n(758),o=n(6234),a=n(5536),i=n(5500),l=n(6070);const s="ease-in-out";function c(e){let{initialState:t}=e;const[n,o]=(0,r.useState)(t??!1),a=(0,r.useCallback)((()=>{o((e=>!e))}),[]);return{collapsed:n,setCollapsed:o,toggleCollapsed:a}}const u={display:"none",overflow:"hidden",height:"0px"},d={display:"block",overflow:"visible",height:"auto"};function f(e,t){const n=t?u:d;e.style.display=n.display,e.style.overflow=n.overflow,e.style.height=n.height}function p(e){let{collapsibleRef:t,collapsed:n,animation:o}=e;const a=(0,r.useRef)(!1);(0,r.useEffect)((()=>{const e=t.current;function r(){const t=e.scrollHeight,n=o?.duration??function(e){if((0,i.O)())return 1;const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}(t);return{transition:`height ${n}ms ${o?.easing??s}`,height:`${t}px`}}function l(){const t=r();e.style.transition=t.transition,e.style.height=t.height}if(!a.current)return f(e,n),void(a.current=!0);return e.style.willChange="height",function(){const t=requestAnimationFrame((()=>{n?(l(),requestAnimationFrame((()=>{e.style.height=u.height,e.style.overflow=u.overflow}))):(e.style.display="block",requestAnimationFrame((()=>{l()})))}));return()=>cancelAnimationFrame(t)}()}),[t,n,o])}function h(e){if(!o.A.canUseDOM)return e?u:d}function m(e){let{as:t="div",collapsed:n,children:o,animation:a,onCollapseTransitionEnd:i,className:s,disableSSRStyle:c}=e;const u=(0,r.useRef)(null);return p({collapsibleRef:u,collapsed:n,animation:a}),(0,l.jsx)(t,{ref:u,style:c?void 0:h(n),onTransitionEnd:e=>{"height"===e.propertyName&&(f(u.current,n),i?.(n))},className:s,children:o})}function g(e){let{collapsed:t,...n}=e;const[o,i]=(0,r.useState)(!t),[s,c]=(0,r.useState)(t);return(0,a.A)((()=>{t||i(!0)}),[t]),(0,a.A)((()=>{o&&c(t)}),[o,t]),o?(0,l.jsx)(m,{...n,collapsed:s}):null}function y(e){let{lazy:t,...n}=e;const r=t?g:m;return(0,l.jsx)(r,{...n})}},5076:(e,t,n)=>{"use strict";n.d(t,{M:()=>m,o:()=>h});var r=n(758),o=n(2236),a=n(4012),i=n(9713),l=n(8859),s=n(6070);const c=(0,a.Wf)("docusaurus.announcement.dismiss"),u=(0,a.Wf)("docusaurus.announcement.id"),d=()=>"true"===c.get(),f=e=>c.set(String(e)),p=r.createContext(null);function h(e){let{children:t}=e;const n=function(){const{announcementBar:e}=(0,l.p)(),t=(0,o.A)(),[n,a]=(0,r.useState)((()=>!!t&&d()));(0,r.useEffect)((()=>{a(d())}),[]);const i=(0,r.useCallback)((()=>{f(!0),a(!0)}),[]);return(0,r.useEffect)((()=>{if(!e)return;const{id:t}=e;let n=u.get();"annoucement-bar"===n&&(n="announcement-bar");const r=t!==n;u.set(t),r&&f(!1),!r&&d()||a(!1)}),[e]),(0,r.useMemo)((()=>({isActive:!!e&&!n,close:i})),[e,n,i])}();return(0,s.jsx)(p.Provider,{value:n,children:t})}function m(){const e=(0,r.useContext)(p);if(!e)throw new i.dV("AnnouncementBarProvider");return e}},2916:(e,t,n)=>{"use strict";n.d(t,{G:()=>y,a:()=>g});var r=n(758),o=n(6234),a=n(9713),i=n(4012),l=n(8859),s=n(6070);const c=r.createContext(void 0),u="theme",d=(0,i.Wf)(u),f={light:"light",dark:"dark"},p=e=>e===f.dark?f.dark:f.light,h=e=>o.A.canUseDOM?p(document.documentElement.getAttribute("data-theme")):p(e),m=e=>{d.set(p(e))};function g(e){let{children:t}=e;const n=function(){const{colorMode:{defaultMode:e,disableSwitch:t,respectPrefersColorScheme:n}}=(0,l.p)(),[o,a]=(0,r.useState)(h(e));(0,r.useEffect)((()=>{t&&d.del()}),[t]);const i=(0,r.useCallback)((function(t,r){void 0===r&&(r={});const{persist:o=!0}=r;t?(a(t),o&&m(t)):(a(n?window.matchMedia("(prefers-color-scheme: dark)").matches?f.dark:f.light:e),d.del())}),[n,e]);(0,r.useEffect)((()=>{document.documentElement.setAttribute("data-theme",p(o))}),[o]),(0,r.useEffect)((()=>{if(t)return;const e=e=>{if(e.key!==u)return;const t=d.get();null!==t&&i(p(t))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}),[t,i]);const s=(0,r.useRef)(!1);return(0,r.useEffect)((()=>{if(t&&!n)return;const e=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>{window.matchMedia("print").matches||s.current?s.current=window.matchMedia("print").matches:i(null)};return e.addListener(r),()=>e.removeListener(r)}),[i,t,n]),(0,r.useMemo)((()=>({colorMode:o,setColorMode:i,get isDarkTheme(){return o===f.dark},setLightTheme(){i(f.light)},setDarkTheme(){i(f.dark)}})),[o,i])}();return(0,s.jsx)(c.Provider,{value:n,children:t})}function y(){const e=(0,r.useContext)(c);if(null==e)throw new a.dV("ColorModeProvider","Please see https://docusaurus.io/docs/api/themes/configuration#use-color-mode.");return e}},5624:(e,t,n)=>{"use strict";n.d(t,{M:()=>p,e:()=>f});var r=n(758),o=n(217),a=n(7210),i=n(7852),l=n(8859),s=n(9713),c=n(6070);const u=r.createContext(void 0);function d(){const e=function(){const e=(0,o.YL)(),{items:t}=(0,l.p)().navbar;return 0===t.length&&!e.component}(),t=(0,a.l)(),n=!e&&"mobile"===t,[s,c]=(0,r.useState)(!1);(0,i.$Z)((()=>{if(s)return c(!1),!1}));const u=(0,r.useCallback)((()=>{c((e=>!e))}),[]);return(0,r.useEffect)((()=>{"desktop"===t&&c(!1)}),[t]),(0,r.useMemo)((()=>({disabled:e,shouldRender:n,toggle:u,shown:s})),[e,n,u,s])}function f(e){let{children:t}=e;const n=d();return(0,c.jsx)(u.Provider,{value:n,children:t})}function p(){const e=r.useContext(u);if(void 0===e)throw new s.dV("NavbarMobileSidebarProvider");return e}},217:(e,t,n)=>{"use strict";n.d(t,{GX:()=>c,YL:()=>s,y_:()=>l});var r=n(758),o=n(9713),a=n(6070);const i=r.createContext(null);function l(e){let{children:t}=e;const n=(0,r.useState)({component:null,props:null});return(0,a.jsx)(i.Provider,{value:n,children:t})}function s(){const e=(0,r.useContext)(i);if(!e)throw new o.dV("NavbarSecondaryMenuContentProvider");return e[0]}function c(e){let{component:t,props:n}=e;const a=(0,r.useContext)(i);if(!a)throw new o.dV("NavbarSecondaryMenuContentProvider");const[,l]=a,s=(0,o.Be)(n);return(0,r.useEffect)((()=>{l({component:t,props:s})}),[l,t,s]),(0,r.useEffect)((()=>()=>l({component:null,props:null})),[l]),null}},6130:(e,t,n)=>{"use strict";n.d(t,{w:()=>o,J:()=>a});var r=n(758);const o="navigation-with-keyboard";function a(){(0,r.useEffect)((()=>{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),()=>{document.body.classList.remove(o),document.removeEventListener("keydown",e),document.removeEventListener("mousedown",e)}}),[])}},6472:(e,t,n)=>{"use strict";n.d(t,{b:()=>l,w:()=>s});var r=n(758),o=n(785),a=n(7852);const i="q";function l(){return(0,a.l)(i)}function s(){const{siteConfig:{baseUrl:e,themeConfig:t}}=(0,o.A)(),{algolia:{searchPagePath:n}}=t;return(0,r.useCallback)((t=>`${e}${n}?${i}=${encodeURIComponent(t)}`),[e,n])}},7210:(e,t,n)=>{"use strict";n.d(t,{l:()=>l});var r=n(758),o=n(6234);const a={desktop:"desktop",mobile:"mobile",ssr:"ssr"},i=996;function l(e){let{desktopBreakpoint:t=i}=void 0===e?{}:e;const[n,l]=(0,r.useState)((()=>"ssr"));return(0,r.useEffect)((()=>{function e(){l(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}(t))}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[t]),n}},6860:(e,t,n)=>{"use strict";n.d(t,{G:()=>r});const 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:e=>`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:e=>`theme-doc-sidebar-item-category-level-${e}`,docSidebarItemLinkLevel:e=>`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"}}},5500:(e,t,n)=>{"use strict";function r(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}n.d(t,{O:()=>r})},3385:(e,t,n)=>{"use strict";n.d(t,{bq:()=>u,MN:()=>c,a2:()=>s,k2:()=>d});var r=n(758),o=n(9562),a=n(8924);const i={errorBoundaryError:"errorBoundaryError_ca8J",errorBoundaryFallback:"errorBoundaryFallback_aRoS"};var l=n(6070);function s(e){return(0,l.jsx)("button",{type:"button",...e,children:(0,l.jsx)(o.A,{id:"theme.ErrorPageContent.tryAgain",description:"The label of the button to try again rendering when the React error boundary captures an error",children:"Try again"})})}function c(e){let{error:t,tryAgain:n}=e;return(0,l.jsxs)("div",{className:i.errorBoundaryFallback,children:[(0,l.jsx)("p",{children:t.message}),(0,l.jsx)(s,{onClick:n})]})}function u(e){let{error:t}=e;const n=(0,a.rA)(t).map((e=>e.message)).join("\n\nCause:\n");return(0,l.jsx)("p",{className:i.errorBoundaryError,children:n})}class d extends r.Component{componentDidCatch(e,t){throw this.props.onError(e,t)}render(){return this.props.children}}},2780:(e,t,n)=>{"use strict";n.d(t,{s:()=>o});var r=n(785);function o(e){const{siteConfig:t}=(0,r.A)(),{title:n,titleDelimiter:o}=t;return e?.trim().length?`${e.trim()} ${o} ${n}`:n}},7852:(e,t,n)=>{"use strict";n.d(t,{$Z:()=>i,aZ:()=>s,l:()=>c});var r=n(758),o=n(5557),a=n(9713);function i(e){!function(e){const t=(0,o.W6)(),n=(0,a._q)(e);(0,r.useEffect)((()=>t.block(((e,t)=>n(e,t)))),[t,n])}(((t,n)=>{if("POP"===n)return e(t,n)}))}function l(e){const t=(0,o.W6)();return(0,r.useSyncExternalStore)(t.listen,(()=>e(t)),(()=>e(t)))}function s(e){return l((t=>null===e?null:new URLSearchParams(t.location.search).get(e)))}function c(e){const t=s(e)??"",n=function(e){const t=(0,o.W6)();return(0,r.useCallback)(((n,r)=>{const o=new URLSearchParams(t.location.search);n?o.set(e,n):o.delete(e),(r?.push?t.push:t.replace)({search:o.toString()})}),[e,t])}(e);return[t,n]}},1381:(e,t,n)=>{"use strict";function r(e,t){return void 0===t&&(t=(e,t)=>e===t),e.filter(((n,r)=>e.findIndex((e=>t(e,n)))!==r))}function o(e){return Array.from(new Set(e))}n.d(t,{XI:()=>r,sb:()=>o})},9904:(e,t,n)=>{"use strict";n.d(t,{e3:()=>p,be:()=>d,Jx:()=>h});var r=n(758),o=n(3526),a=n(3563),i=n(9181);function l(){const e=r.useContext(i.o);if(!e)throw new Error("Unexpected: no Docusaurus route context found");return e}var s=n(7042),c=n(2780),u=n(6070);function d(e){let{title:t,description:n,keywords:r,image:o,children:i}=e;const l=(0,c.s)(t),{withBaseUrl:d}=(0,s.hH)(),f=o?d(o,{absolute:!0}):void 0;return(0,u.jsxs)(a.A,{children:[t&&(0,u.jsx)("title",{children:l}),t&&(0,u.jsx)("meta",{property:"og:title",content:l}),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}),f&&(0,u.jsx)("meta",{property:"og:image",content:f}),f&&(0,u.jsx)("meta",{name:"twitter:image",content:f}),i]})}const f=r.createContext(void 0);function p(e){let{className:t,children:n}=e;const 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 h(e){let{children:t}=e;const n=l(),r=`plugin-${n.plugin.name.replace(/docusaurus-(?:plugin|theme)-(?:content-)?/gi,"")}`;const a=`plugin-id-${n.plugin.id}`;return(0,u.jsx)(p,{className:(0,o.A)(r,a),children:t})}},9713:(e,t,n)=>{"use strict";n.d(t,{Be:()=>c,ZC:()=>l,_q:()=>i,dV:()=>s,fM:()=>u});var r=n(758),o=n(5536),a=n(6070);function i(e){const t=(0,r.useRef)(e);return(0,o.A)((()=>{t.current=e}),[e]),(0,r.useCallback)((function(){return t.current(...arguments)}),[])}function l(e){const t=(0,r.useRef)();return(0,o.A)((()=>{t.current=e})),t.current}class s extends Error{constructor(e,t){super(),this.name="ReactContextError",this.message=`Hook ${this.stack?.split("\n")[1]?.match(/at (?:\w+\.)?(?\w+)/)?.groups.name??""} is called outside the <${e}>. ${t??""}`}}function c(e){const t=Object.entries(e);return t.sort(((e,t)=>e[0].localeCompare(t[0]))),(0,r.useMemo)((()=>e),t.flat())}function u(e){return t=>{let{children:n}=t;return(0,a.jsx)(a.Fragment,{children:e.reduceRight(((e,t)=>(0,a.jsx)(t,{children:e})),n)})}}},6639:(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})},4694:(e,t,n)=>{"use strict";n.d(t,{Dt:()=>l,ys:()=>i});var r=n(758),o=n(7103),a=n(785);function i(e,t){const n=e=>(!e||e.endsWith("/")?e:`${e}/`)?.toLowerCase();return n(e)===n(t)}function l(){const{baseUrl:e}=(0,a.A)().siteConfig;return(0,r.useMemo)((()=>function(e){let{baseUrl:t,routes:n}=e;function r(e){return e.path===t&&!0===e.exact}function o(e){return e.path===t&&!e.exact}return function e(t){if(0===t.length)return;return t.find(r)||e(t.filter(o).flatMap((e=>e.routes??[])))}(n)}({routes:o.A,baseUrl:e})),[e])}},8155:(e,t,n)=>{"use strict";n.d(t,{Mq:()=>p,Tv:()=>u,a_:()=>h,gk:()=>m});var r=n(758),o=n(6234),a=n(2236),i=n(5536),l=n(9713),s=n(6070);const c=r.createContext(void 0);function u(e){let{children:t}=e;const n=function(){const e=(0,r.useRef)(!0);return(0,r.useMemo)((()=>({scrollEventsEnabledRef:e,enableScrollEvents:()=>{e.current=!0},disableScrollEvents:()=>{e.current=!1}})),[])}();return(0,s.jsx)(c.Provider,{value:n,children:t})}function d(){const e=(0,r.useContext)(c);if(null==e)throw new l.dV("ScrollControllerProvider");return e}const f=()=>o.A.canUseDOM?{scrollX:window.pageXOffset,scrollY:window.pageYOffset}:null;function p(e,t){void 0===t&&(t=[]);const{scrollEventsEnabledRef:n}=d(),o=(0,r.useRef)(f()),a=(0,l._q)(e);(0,r.useEffect)((()=>{const e=()=>{if(!n.current)return;const e=f();a(e,o.current),o.current=e},t={passive:!0};return e(),window.addEventListener("scroll",e,t),()=>window.removeEventListener("scroll",e,t)}),[a,n,...t])}function h(){const e=d(),t=function(){const e=(0,r.useRef)({elem:null,top:0}),t=(0,r.useCallback)((t=>{e.current={elem:t,top:t.getBoundingClientRect().top}}),[]),n=(0,r.useCallback)((()=>{const{current:{elem:t,top:n}}=e;if(!t)return{restored:!1};const r=t.getBoundingClientRect().top-n;return r&&window.scrollBy({left:0,top:r}),e.current={elem:null,top:0},{restored:0!==r}}),[]);return(0,r.useMemo)((()=>({save:t,restore:n})),[n,t])}(),n=(0,r.useRef)(void 0),o=(0,r.useCallback)((r=>{t.save(r),e.disableScrollEvents(),n.current=()=>{const{restored:r}=t.restore();if(n.current=void 0,r){const t=()=>{e.enableScrollEvents(),window.removeEventListener("scroll",t)};window.addEventListener("scroll",t)}else e.enableScrollEvents()}}),[e,t]);return(0,i.A)((()=>{queueMicrotask((()=>n.current?.()))})),{blockElementScrollPositionUntilNextRender:o}}function m(){const e=(0,r.useRef)(null),t=(0,a.A)()&&"smooth"===getComputedStyle(document.documentElement).scrollBehavior;return{startScroll:n=>{e.current=t?function(e){return window.scrollTo({top:e,behavior:"smooth"}),()=>{}}(n):function(e){let t=null;const n=document.documentElement.scrollTop>e;return function r(){const o=document.documentElement.scrollTop;(n&&o>e||!n&&ot&&cancelAnimationFrame(t)}(n)},cancelScroll:()=>e.current?.()}}},1956:(e,t,n)=>{"use strict";n.d(t,{C:()=>r});const r="default"},4012:(e,t,n)=>{"use strict";n.d(t,{Wf:()=>u,Dv:()=>d});var r=n(758);const o=JSON.parse('{"N":"localStorage","M":""}'),a=o.N;function i(e){let{key:t,oldValue:n,newValue:r,storage:o}=e;if(n===r)return;const a=document.createEvent("StorageEvent");a.initStorageEvent("storage",!1,!1,t,n,r,window.location.href,o),window.dispatchEvent(a)}function l(e){if(void 0===e&&(e=a),"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,s||(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),s=!0),null}var t}let s=!1;const c={get:()=>null,set:()=>{},del:()=>{},listen:()=>()=>{}};function u(e,t){const n=`${e}${o.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);const r=l(t?.persistence);return null===r?c:{get:()=>{try{return r.getItem(n)}catch(e){return console.error(`Docusaurus storage error, can't get key=${n}`,e),null}},set:e=>{try{const t=r.getItem(n);r.setItem(n,e),i({key:n,oldValue:t,newValue:e,storage:r})}catch(t){console.error(`Docusaurus storage error, can't set ${n}=${e}`,t)}},del:()=>{try{const e=r.getItem(n);r.removeItem(n),i({key:n,oldValue:e,newValue:null,storage:r})}catch(e){console.error(`Docusaurus storage error, can't delete key=${n}`,e)}},listen:e=>{try{const t=t=>{t.storageArea===r&&t.key===n&&e(t)};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)}catch(t){return console.error(`Docusaurus storage error, can't listen for changes of key=${n}`,t),()=>{}}}}}function d(e,t){const n=(0,r.useRef)((()=>null===e?c:u(e,t))).current(),o=(0,r.useCallback)((e=>"undefined"==typeof window?()=>{}:n.listen(e)),[n]);return[(0,r.useSyncExternalStore)(o,(()=>"undefined"==typeof window?null:n.get()),(()=>null)),n]}},1352:(e,t,n)=>{"use strict";n.d(t,{o:()=>i});var r=n(785),o=n(5557),a=n(8924);function i(){const{siteConfig:{baseUrl:e,url:t,trailingSlash:n},i18n:{defaultLocale:i,currentLocale:l}}=(0,r.A)(),{pathname:s}=(0,o.zy)(),c=(0,a.Ks)(s,{trailingSlash:n,baseUrl:e}),u=l===i?e:e.replace(`/${l}/`,"/"),d=c.replace(e,"");return{createUrl:function(e){let{locale:n,fullyQualified:r}=e;return`${r?t:""}${function(e){return e===i?`${u}`:`${u}${e}/`}(n)}${d}`}}}},8997:(e,t,n)=>{"use strict";n.d(t,{$:()=>i});var r=n(758),o=n(5557),a=n(9713);function i(e){const t=(0,o.zy)(),n=(0,a.ZC)(t),i=(0,a._q)(e);(0,r.useEffect)((()=>{n&&t!==n&&i({location:t,previousLocation:n})}),[i,t,n])}},8859:(e,t,n)=>{"use strict";n.d(t,{p:()=>o});var r=n(785);function o(){return(0,r.A)().siteConfig.themeConfig}},3367:(e,t,n)=>{"use strict";n.d(t,{c:()=>o});var r=n(785);function o(){const{siteConfig:{themeConfig:e}}=(0,r.A)();return e}},7651:(e,t,n)=>{"use strict";n.d(t,{C:()=>l});var r=n(758),o=n(6639),a=n(7042),i=n(3367);function l(){const{withBaseUrl:e}=(0,a.hH)(),{algolia:{externalUrlRegex:t,replaceSearchResultPathname:n}}=(0,i.c)();return(0,r.useCallback)((r=>{const a=new URL(r);if((0,o.G)(t,a.href))return r;const i=`${a.pathname+a.hash}`;return e(function(e,t){return t?e.replaceAll(new RegExp(t.from,"g"),t.to):e}(i,n))}),[e,t,n])}},5307:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addTrailingSlash=o,t.default=function(e,t){const{trailingSlash:n,baseUrl:r}=t;if(e.startsWith("#"))return e;if(void 0===n)return e;const[i]=e.split(/[#?]/),l="/"===i||i===r?i:(s=i,c=n,c?o(s):a(s));var s,c;return e.replace(i,l)},t.addLeadingSlash=function(e){return(0,r.addPrefix)(e,"/")},t.removeTrailingSlash=a;const r=n(498);function o(e){return e.endsWith("/")?e:`${e}/`}function a(e){return(0,r.removeSuffix)(e,"/")}},5801:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=function e(t){if(t.cause)return[t,...e(t.cause)];return[t]}},8924:(e,t,n)=>{"use strict";t.rA=t.Ks=void 0;const r=n(5482);var o=n(5307);Object.defineProperty(t,"Ks",{enumerable:!0,get:function(){return r.__importDefault(o).default}});var a=n(498);var i=n(5801);Object.defineProperty(t,"rA",{enumerable:!0,get:function(){return i.getErrorCausalChain}})},498:(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}},8602:(e,t,n)=>{"use strict";n.d(t,{zR:()=>x,TM:()=>C,yJ:()=>m,sC:()=>P,AO:()=>h,Fu:()=>g});var r=n(5890);function o(e){return"/"===e.charAt(0)}function a(e,t){for(var n=t,r=n+1,o=e.length;r=0;f--){var p=i[f];"."===p?a(i,f):".."===p?(a(i,f),d++):d&&(a(i,f),d--)}if(!c)for(;d--;d)i.unshift("..");!c||""===i[0]||i[0]&&o(i[0])||i.unshift("");var h=i.join("/");return n&&"/"!==h.substr(-1)&&(h+="/"),h};function l(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}const s=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"==typeof t||"object"==typeof n){var r=l(t),o=l(n);return r!==t||o!==n?e(r,o):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1};var c=n(5385);function u(e){return"/"===e.charAt(0)?e:"/"+e}function d(e){return"/"===e.charAt(0)?e.substr(1):e}function f(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 p(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function h(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 m(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 g(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&s(e.state,t.state)}function y(){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),d({action:r,location:o,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",o=m(e,t,f(),w.location);u.confirmTransitionTo(o,r,n,(function(e){e&&(w.entries[w.index]=o,d({action:r,location:o}))}))},go:v,goBack:function(){v(-1)},goForward:function(){v(1)},canGo:function(e){var t=w.index+e;return t>=0&&t{"use strict";var r=n(5959),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 c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var o=p(n);o&&o!==h&&e(t,o,r)}var i=u(n);d&&(i=i.concat(d(n)));for(var l=s(t),m=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 c=[n,r,o,a,i,l],u=0;(s=new Error(t.replace(/%s/g,(function(){return c[u++]})))).name="Invariant Violation"}throw s.framesToPop=1,s}}},5526:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},4464:(e,t,n)=>{"use strict";n.r(t)},577:(e,t,n)=>{"use strict";n.r(t)},8744: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),c=a.querySelector(r.barSelector),u=r.speed,d=r.easing;return a.offsetWidth,l((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),s(c,i(e,u,d)),1===e?(s(a,{transition:"none",opacity:1}),a.offsetWidth,setTimeout((function(){s(a,{transition:"all "+u+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),u)}),u)):setTimeout(t,u)})),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");u(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),c=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),c!=document.body&&u(c,"nprogress-custom-parent"),c.appendChild(t),t},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(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 c(e,t){return("string"==typeof e?e:f(e)).indexOf(" "+t+" ")>=0}function u(e,t){var n=f(e),r=n+t;c(n,t)||(e.className=r.substring(1))}function d(e,t){var n,r=f(e);c(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function f(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)},4785:(e,t,n)=>{var r=n(5526);e.exports=h,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="",c=t&&t.delimiter||"/";null!=(n=o.exec(e));){var d=n[0],f=n[1],p=n.index;if(s+=e.slice(l,p),l=p+d.length,f)s+=f[1];else{var h=e[l],m=n[2],g=n[3],y=n[4],b=n[5],v=n[6],w=n[7];s&&(r.push(s),s="");var S=null!=m&&null!=h&&h!==m,k="+"===v||"*"===v,x="?"===v||"*"===v,E=m||c,_=y||b,O=m||("string"==typeof r[r.length-1]?r[r.length-1]:"");r.push({name:g||a++,prefix:m||"",delimiter:E,optional:x,repeat:k,partial:S,asterisk:!!w,pattern:_?u(_):w?".*":i(E,O)})}}return l-1?"[^"+c(e)+"]+?":c(t)+"|(?:(?!"+c(t)+")[^"+c(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{!function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var o=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=r.variable[1].inside,i=0;i{!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 c=l[s];if("string"==typeof c||c.content&&"string"==typeof c.content){var u=a[o],d=n.tokenStack[u],f="string"==typeof c?c:c.content,p=t(r,u),h=f.indexOf(p);if(h>-1){++o;var m=f.substring(0,h),g=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),y=f.substring(h+p.length),b=[];m&&b.push.apply(b,i([m])),b.push(g),y&&b.push.apply(b,i([y])),"string"==typeof c?l.splice.apply(l,[s,1].concat(b)):c.content=b}}else c.content&&i(c.content)}return l}(n.tokens)}}}})}(Prism)},6290:()=>{!function(e){var t=/(?:[\w-]+|'[^'\n\r]*'|"(?:\\.|[^\\"\r\n])*")/.source;function n(e){return e.replace(/__/g,(function(){return t}))}e.languages.toml={comment:{pattern:/#.*/,greedy:!0},table:{pattern:RegExp(n(/(^[\t ]*\[\s*(?:\[\s*)?)__(?:\s*\.\s*__)*(?=\s*\])/.source),"m"),lookbehind:!0,greedy:!0,alias:"class-name"},key:{pattern:RegExp(n(/(^[\t ]*|[{,]\s*)__(?:\s*\.\s*__)*(?=\s*=)/.source),"m"),lookbehind:!0,greedy:!0,alias:"property"},string:{pattern:/"""(?:\\[\s\S]|[^\\])*?"""|'''[\s\S]*?'''|'[^'\n\r]*'|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},date:[{pattern:/\b\d{4}-\d{2}-\d{2}(?:[T\s]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?)?\b/i,alias:"number"},{pattern:/\b\d{2}:\d{2}:\d{2}(?:\.\d+)?\b/,alias:"number"}],number:/(?:\b0(?:x[\da-zA-Z]+(?:_[\da-zA-Z]+)*|o[0-7]+(?:_[0-7]+)*|b[10]+(?:_[10]+)*))\b|[-+]?\b\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?\b|[-+]?\b(?:inf|nan)\b/,boolean:/\b(?:false|true)\b/,punctuation:/[.,=[\]{}]/}}(Prism)},6186:(e,t,n)=>{"use strict";var r=n(2985);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}},2736:(e,t,n)=>{e.exports=n(6186)()},2985:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},9481:(e,t,n)=>{"use strict";var r=n(758),o=n(1896);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n