@c4a/server-cli 0.4.12-alpha.2 → 0.4.12-beta.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. package/index.js +4255 -1109
  2. package/package.json +2 -1
  3. package/serve.js +11236 -2504
  4. package/web/assets/ContentCard-D0mL7yOO.js +1 -0
  5. package/web/assets/ContentCard-_I22pq8z.js +1 -0
  6. package/web/assets/ContentDetail-BlCJjlr2.js +65 -0
  7. package/web/assets/ContentDetail-BtrIxG3F.js +1 -0
  8. package/web/assets/ContentDetail-DVIbcpNs.js +65 -0
  9. package/web/assets/EntityDetail-BBLfJ9LL.js +3 -0
  10. package/web/assets/EntityDetail-CHe5PkO9.js +1 -0
  11. package/web/assets/EntityDetail-CQNu3A3D.js +3 -0
  12. package/web/assets/JsonTree-BRUca2ED.js +1 -0
  13. package/web/assets/JsonTree-Dd_iNoWA.js +1 -0
  14. package/web/assets/RelationDetail-BoTv8wr4.js +1 -0
  15. package/web/assets/RelationDetail-CZwj9HUp.js +1 -0
  16. package/web/assets/RelationDetail-CkBj9cCj.js +1 -0
  17. package/web/assets/andromeeda-C4gqWexZ.js +1 -0
  18. package/web/assets/angular-html-DA-rfuFy.js +1 -0
  19. package/web/assets/angular-ts-BrjP3tb8.js +1 -0
  20. package/web/assets/astro-HNnZUWAn.js +1 -0
  21. package/web/assets/aurora-x-D-2ljcwZ.js +1 -0
  22. package/web/assets/ayu-dark-DYE7WIF3.js +1 -0
  23. package/web/assets/ayu-light-BA47KaF1.js +1 -0
  24. package/web/assets/ayu-mirage-32ctXXKs.js +1 -0
  25. package/web/assets/blade-BjGOyj-B.js +1 -0
  26. package/web/assets/c-BIGW1oBm.js +1 -0
  27. package/web/assets/catppuccin-frappe-DFWUc33u.js +1 -0
  28. package/web/assets/catppuccin-latte-C9dUb6Cb.js +1 -0
  29. package/web/assets/catppuccin-macchiato-DQyhUUbL.js +1 -0
  30. package/web/assets/catppuccin-mocha-D87Tk5Gz.js +1 -0
  31. package/web/assets/coffee-Ch7k5sss.js +1 -0
  32. package/web/assets/cpp-CofmeUqb.js +1 -0
  33. package/web/assets/css-CLj8gQPS.js +1 -0
  34. package/web/assets/csv-fuZLfV_i.js +1 -0
  35. package/web/assets/dark-plus-C3mMm8J8.js +1 -0
  36. package/web/assets/dracula-BzJJZx-M.js +1 -0
  37. package/web/assets/dracula-soft-BXkSAIEj.js +1 -0
  38. package/web/assets/everforest-dark-BgDCqdQA.js +1 -0
  39. package/web/assets/everforest-light-C8M2exoo.js +1 -0
  40. package/web/assets/github-dark-DHJKELXO.js +1 -0
  41. package/web/assets/github-dark-default-Cuk6v7N8.js +1 -0
  42. package/web/assets/github-dark-dimmed-DH5Ifo-i.js +1 -0
  43. package/web/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
  44. package/web/assets/github-light-DAi9KRSo.js +1 -0
  45. package/web/assets/github-light-default-D7oLnXFd.js +1 -0
  46. package/web/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
  47. package/web/assets/glsl-DplSGwfg.js +1 -0
  48. package/web/assets/graphql-ChdNCCLP.js +1 -0
  49. package/web/assets/gruvbox-dark-hard-CFHQjOhq.js +1 -0
  50. package/web/assets/gruvbox-dark-medium-GsRaNv29.js +1 -0
  51. package/web/assets/gruvbox-dark-soft-CVdnzihN.js +1 -0
  52. package/web/assets/gruvbox-light-hard-CH1njM8p.js +1 -0
  53. package/web/assets/gruvbox-light-medium-DRw_LuNl.js +1 -0
  54. package/web/assets/gruvbox-light-soft-hJgmCMqR.js +1 -0
  55. package/web/assets/haml-D5jkg6IW.js +1 -0
  56. package/web/assets/handlebars-BpdQsYii.js +1 -0
  57. package/web/assets/horizon-BUw7H-hv.js +1 -0
  58. package/web/assets/horizon-bright-CUuTKBJd.js +1 -0
  59. package/web/assets/houston-DnULxvSX.js +1 -0
  60. package/web/assets/html-derivative-DlHx6ybY.js +1 -0
  61. package/web/assets/html-pp8916En.js +1 -0
  62. package/web/assets/http-jrhK8wxY.js +1 -0
  63. package/web/assets/hurl-irOxFIW8.js +1 -0
  64. package/web/assets/imba-DGztddWO.js +1 -0
  65. package/web/assets/index-1QkfhsIS.js +12 -0
  66. package/web/assets/index-8J6WgTr0.js +238 -0
  67. package/web/assets/index-B1KeXpYL.css +1 -0
  68. package/web/assets/index-B1zrTc3w.js +12 -0
  69. package/web/assets/index-B6uGMtfP.css +1 -0
  70. package/web/assets/index-BCzQnf3x.css +1 -0
  71. package/web/assets/index-BE9z9PQF.js +238 -0
  72. package/web/assets/index-BF6rVrre.js +238 -0
  73. package/web/assets/index-BLskFmu3.js +193 -0
  74. package/web/assets/index-BMVKFQ7h.js +238 -0
  75. package/web/assets/index-BRwgHwhm.js +12 -0
  76. package/web/assets/index-BU6YkKWq.css +1 -0
  77. package/web/assets/index-BXaK4HKi.js +12 -0
  78. package/web/assets/index-BaBWjAP7.css +1 -0
  79. package/web/assets/index-Be3yvSxB.js +12 -0
  80. package/web/assets/index-Bh0nrxkS.css +1 -0
  81. package/web/assets/index-BjM7CFih.js +12 -0
  82. package/web/assets/index-BoqItESG.js +13 -0
  83. package/web/assets/index-Bxc-msf3.js +238 -0
  84. package/web/assets/index-Bxkj7nBM.css +1 -0
  85. package/web/assets/index-ByCT34eF.css +1 -0
  86. package/web/assets/index-C0SbV7Fr.js +238 -0
  87. package/web/assets/index-C1T-mIJp.js +238 -0
  88. package/web/assets/index-C1tbhKrB.css +1 -0
  89. package/web/assets/index-C6uqUNjs.js +238 -0
  90. package/web/assets/index-CKPy6nsr.js +238 -0
  91. package/web/assets/index-CSQvEPnB.js +238 -0
  92. package/web/assets/index-CU-x3HVJ.js +12 -0
  93. package/web/assets/index-CVcqJsfJ.js +12 -0
  94. package/web/assets/index-CWKka1Dm.css +1 -0
  95. package/web/assets/index-Cs1wjzzB.css +1 -0
  96. package/web/assets/index-D0FYwi5D.css +1 -0
  97. package/web/assets/index-D9pKIRoL.js +12 -0
  98. package/web/assets/index-DHMM5gmZ.js +12 -0
  99. package/web/assets/index-DMIK6qP9.js +12 -0
  100. package/web/assets/index-DNSKIsZU.js +238 -0
  101. package/web/assets/index-DW-afpe4.js +12 -0
  102. package/web/assets/index-DYi5EQi6.css +1 -0
  103. package/web/assets/index-DaUMALOp.css +1 -0
  104. package/web/assets/index-DeStbuhs.css +1 -0
  105. package/web/assets/index-DfXQnmId.js +12 -0
  106. package/web/assets/index-DisDw0E0.css +1 -0
  107. package/web/assets/index-Dm-_KwmC.css +1 -0
  108. package/web/assets/index-DmRvWfJA.js +12 -0
  109. package/web/assets/index-Drfhm6bu.js +12 -0
  110. package/web/assets/index-DvnO8hAI.js +12 -0
  111. package/web/assets/index-G3fxfqeh.js +238 -0
  112. package/web/assets/index-JdgClnFG.css +1 -0
  113. package/web/assets/index-P648JtKx.js +12 -0
  114. package/web/assets/index-PGORoGGx.js +13 -0
  115. package/web/assets/index-VCinLKUc.css +1 -0
  116. package/web/assets/index-ZtrM6iGG.js +12 -0
  117. package/web/assets/index-oRdZsAv2.js +238 -0
  118. package/web/assets/index-snZ8He7E.js +12 -0
  119. package/web/assets/index-zH92nrE5.css +1 -0
  120. package/web/assets/java-CylS5w8V.js +1 -0
  121. package/web/assets/javascript-wDzz0qaB.js +1 -0
  122. package/web/assets/jinja-f2NsQr07.js +1 -0
  123. package/web/assets/jison-wvAkD_A8.js +1 -0
  124. package/web/assets/json-Cp-IABpG.js +1 -0
  125. package/web/assets/json5-C9tS-k6U.js +1 -0
  126. package/web/assets/jsonc-Des-eS-w.js +1 -0
  127. package/web/assets/jsonl-DcaNXYhu.js +1 -0
  128. package/web/assets/jsx-g9-lgVsj.js +1 -0
  129. package/web/assets/julia-CxzCAyBv.js +1 -0
  130. package/web/assets/kanagawa-dragon-CkXjmgJE.js +1 -0
  131. package/web/assets/kanagawa-lotus-CfQXZHmo.js +1 -0
  132. package/web/assets/kanagawa-wave-DWedfzmr.js +1 -0
  133. package/web/assets/laserwave-DUszq2jm.js +1 -0
  134. package/web/assets/less-B1dDrJ26.js +1 -0
  135. package/web/assets/light-plus-B7mTdjB0.js +1 -0
  136. package/web/assets/markdown-Cvjx9yec.js +1 -0
  137. package/web/assets/marko-DjSrsDqO.js +1 -0
  138. package/web/assets/material-theme-D5KoaKCx.js +1 -0
  139. package/web/assets/material-theme-darker-BfHTSMKl.js +1 -0
  140. package/web/assets/material-theme-lighter-B0m2ddpp.js +1 -0
  141. package/web/assets/material-theme-ocean-CyktbL80.js +1 -0
  142. package/web/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
  143. package/web/assets/mdc-DTYItulj.js +1 -0
  144. package/web/assets/mdx-Cmh6b_Ma.js +1 -0
  145. package/web/assets/min-dark-CafNBF8u.js +1 -0
  146. package/web/assets/min-light-CTRr51gU.js +1 -0
  147. package/web/assets/monokai-D4h5O-jR.js +1 -0
  148. package/web/assets/night-owl-C39BiMTA.js +1 -0
  149. package/web/assets/night-owl-light-CMTm3GFP.js +1 -0
  150. package/web/assets/nord-Ddv68eIx.js +1 -0
  151. package/web/assets/one-dark-pro-DVMEJ2y_.js +1 -0
  152. package/web/assets/one-light-C3Wv6jpd.js +1 -0
  153. package/web/assets/php-R6g_5hLQ.js +1 -0
  154. package/web/assets/plastic-3e1v2bzS.js +1 -0
  155. package/web/assets/poimandres-CS3Unz2-.js +1 -0
  156. package/web/assets/postcss-CXtECtnM.js +1 -0
  157. package/web/assets/pug-DKIMFp6K.js +1 -0
  158. package/web/assets/python-B6aJPvgy.js +1 -0
  159. package/web/assets/r-Dspwwk_N.js +1 -0
  160. package/web/assets/red-bN70gL4F.js +1 -0
  161. package/web/assets/regexp-CDVJQ6XC.js +1 -0
  162. package/web/assets/rose-pine-dawn-DHQR4-dF.js +1 -0
  163. package/web/assets/rose-pine-moon-D4_iv3hh.js +1 -0
  164. package/web/assets/rose-pine-qdsjHGoJ.js +1 -0
  165. package/web/assets/sass-Cj5Yp3dK.js +1 -0
  166. package/web/assets/scss-D5BDwBP9.js +1 -0
  167. package/web/assets/shellscript-Yzrsuije.js +1 -0
  168. package/web/assets/slack-dark-BthQWCQV.js +1 -0
  169. package/web/assets/slack-ochin-DqwNpetd.js +1 -0
  170. package/web/assets/snazzy-light-Bw305WKR.js +1 -0
  171. package/web/assets/solarized-dark-DXbdFlpD.js +1 -0
  172. package/web/assets/solarized-light-L9t79GZl.js +1 -0
  173. package/web/assets/sql-BLtJtn59.js +1 -0
  174. package/web/assets/stylus-BEDo0Tqx.js +1 -0
  175. package/web/assets/svelte-Cy7k_4gC.js +1 -0
  176. package/web/assets/synthwave-84-CbfX1IO0.js +1 -0
  177. package/web/assets/tokyo-night-hegEt444.js +1 -0
  178. package/web/assets/ts-tags-DQrlYJgV.js +1 -0
  179. package/web/assets/tsx-COt5Ahok.js +1 -0
  180. package/web/assets/typescript-BPQ3VLAy.js +1 -0
  181. package/web/assets/vesper-DU1UobuO.js +1 -0
  182. package/web/assets/vitesse-black-Bkuqu6BP.js +1 -0
  183. package/web/assets/vitesse-dark-D0r3Knsf.js +1 -0
  184. package/web/assets/vitesse-light-CVO1_9PV.js +1 -0
  185. package/web/assets/vue-D2xRrEX4.js +1 -0
  186. package/web/assets/vue-html-AaS7Mt5G.js +1 -0
  187. package/web/assets/vue-vine-BoDAl6tE.js +1 -0
  188. package/web/assets/wasm-CG6Dc4jp.js +1 -0
  189. package/web/assets/wasm-MzD3tlZU.js +1 -0
  190. package/web/assets/wgsl-Dx-B1_4e.js +1 -0
  191. package/web/assets/wit-5i3qLPDT.js +1 -0
  192. package/web/assets/xml-sdJ4AIDG.js +1 -0
  193. package/web/assets/yaml-Buea-lGh.js +1 -0
  194. package/web/index.html +2 -2
@@ -0,0 +1,12 @@
1
+ function db(n,l){for(var s=0;s<l.length;s++){const i=l[s];if(typeof i!="string"&&!Array.isArray(i)){for(const o in i)if(o!=="default"&&!(o in n)){const u=Object.getOwnPropertyDescriptor(i,o);u&&Object.defineProperty(n,o,u.get?u:{enumerable:!0,get:()=>i[o]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const m of u.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&i(m)}).observe(document,{childList:!0,subtree:!0});function s(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function i(o){if(o.ep)return;o.ep=!0;const u=s(o);fetch(o.href,u)}})();function fb(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Lu={exports:{}},js={};var xp;function mb(){if(xp)return js;xp=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function s(i,o,u){var m=null;if(u!==void 0&&(m=""+u),o.key!==void 0&&(m=""+o.key),"key"in o){u={};for(var p in o)p!=="key"&&(u[p]=o[p])}else u=o;return o=u.ref,{$$typeof:n,type:i,key:m,ref:o!==void 0?o:null,props:u}}return js.Fragment=l,js.jsx=s,js.jsxs=s,js}var yp;function hb(){return yp||(yp=1,Lu.exports=mb()),Lu.exports}var f=hb();const Oe=n=>typeof n=="string",Ns=()=>{let n,l;const s=new Promise((i,o)=>{n=i,l=o});return s.resolve=n,s.reject=l,s},bp=n=>n==null?"":""+n,pb=(n,l,s)=>{n.forEach(i=>{l[i]&&(s[i]=l[i])})},gb=/###/g,vp=n=>n&&n.indexOf("###")>-1?n.replace(gb,"."):n,Sp=n=>!n||Oe(n),Ds=(n,l,s)=>{const i=Oe(l)?l.split("."):l;let o=0;for(;o<i.length-1;){if(Sp(n))return{};const u=vp(i[o]);!n[u]&&s&&(n[u]=new s),Object.prototype.hasOwnProperty.call(n,u)?n=n[u]:n={},++o}return Sp(n)?{}:{obj:n,k:vp(i[o])}},_p=(n,l,s)=>{const{obj:i,k:o}=Ds(n,l,Object);if(i!==void 0||l.length===1){i[o]=s;return}let u=l[l.length-1],m=l.slice(0,l.length-1),p=Ds(n,m,Object);for(;p.obj===void 0&&m.length;)u=`${m[m.length-1]}.${u}`,m=m.slice(0,m.length-1),p=Ds(n,m,Object),p?.obj&&typeof p.obj[`${p.k}.${u}`]<"u"&&(p.obj=void 0);p.obj[`${p.k}.${u}`]=s},xb=(n,l,s,i)=>{const{obj:o,k:u}=Ds(n,l,Object);o[u]=o[u]||[],o[u].push(s)},go=(n,l)=>{const{obj:s,k:i}=Ds(n,l);if(s&&Object.prototype.hasOwnProperty.call(s,i))return s[i]},yb=(n,l,s)=>{const i=go(n,s);return i!==void 0?i:go(l,s)},Kg=(n,l,s)=>{for(const i in l)i!=="__proto__"&&i!=="constructor"&&(i in n?Oe(n[i])||n[i]instanceof String||Oe(l[i])||l[i]instanceof String?s&&(n[i]=l[i]):Kg(n[i],l[i],s):n[i]=l[i]);return n},zl=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var bb={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const vb=n=>Oe(n)?n.replace(/[&<>"'\/]/g,l=>bb[l]):n;class Sb{constructor(l){this.capacity=l,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(l){const s=this.regExpMap.get(l);if(s!==void 0)return s;const i=new RegExp(l);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(l,i),this.regExpQueue.push(l),i}}const _b=[" ",",","?","!",";"],jb=new Sb(20),Nb=(n,l,s)=>{l=l||"",s=s||"";const i=_b.filter(m=>l.indexOf(m)<0&&s.indexOf(m)<0);if(i.length===0)return!0;const o=jb.getRegExp(`(${i.map(m=>m==="?"?"\\?":m).join("|")})`);let u=!o.test(n);if(!u){const m=n.indexOf(s);m>0&&!o.test(n.substring(0,m))&&(u=!0)}return u},sd=(n,l,s=".")=>{if(!n)return;if(n[l])return Object.prototype.hasOwnProperty.call(n,l)?n[l]:void 0;const i=l.split(s);let o=n;for(let u=0;u<i.length;){if(!o||typeof o!="object")return;let m,p="";for(let g=u;g<i.length;++g)if(g!==u&&(p+=s),p+=i[g],m=o[p],m!==void 0){if(["string","number","boolean"].indexOf(typeof m)>-1&&g<i.length-1)continue;u+=g-u+1;break}o=m}return o},As=n=>n?.replace("_","-"),wb={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,l){console?.[n]?.apply?.(console,l)}};class xo{constructor(l,s={}){this.init(l,s)}init(l,s={}){this.prefix=s.prefix||"i18next:",this.logger=l||wb,this.options=s,this.debug=s.debug}log(...l){return this.forward(l,"log","",!0)}warn(...l){return this.forward(l,"warn","",!0)}error(...l){return this.forward(l,"error","")}deprecate(...l){return this.forward(l,"warn","WARNING DEPRECATED: ",!0)}forward(l,s,i,o){return o&&!this.debug?null:(Oe(l[0])&&(l[0]=`${i}${this.prefix} ${l[0]}`),this.logger[s](l))}create(l){return new xo(this.logger,{prefix:`${this.prefix}:${l}:`,...this.options})}clone(l){return l=l||this.options,l.prefix=l.prefix||this.prefix,new xo(this.logger,l)}}var dn=new xo;class vo{constructor(){this.observers={}}on(l,s){return l.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const o=this.observers[i].get(s)||0;this.observers[i].set(s,o+1)}),this}off(l,s){if(this.observers[l]){if(!s){delete this.observers[l];return}this.observers[l].delete(s)}}emit(l,...s){this.observers[l]&&Array.from(this.observers[l].entries()).forEach(([o,u])=>{for(let m=0;m<u;m++)o(...s)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([o,u])=>{for(let m=0;m<u;m++)o.apply(o,[l,...s])})}}class jp extends vo{constructor(l,s={ns:["translation"],defaultNS:"translation"}){super(),this.data=l||{},this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(l){this.options.ns.indexOf(l)<0&&this.options.ns.push(l)}removeNamespaces(l){const s=this.options.ns.indexOf(l);s>-1&&this.options.ns.splice(s,1)}getResource(l,s,i,o={}){const u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,m=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let p;l.indexOf(".")>-1?p=l.split("."):(p=[l,s],i&&(Array.isArray(i)?p.push(...i):Oe(i)&&u?p.push(...i.split(u)):p.push(i)));const g=go(this.data,p);return!g&&!s&&!i&&l.indexOf(".")>-1&&(l=p[0],s=p[1],i=p.slice(2).join(".")),g||!m||!Oe(i)?g:sd(this.data?.[l]?.[s],i,u)}addResource(l,s,i,o,u={silent:!1}){const m=u.keySeparator!==void 0?u.keySeparator:this.options.keySeparator;let p=[l,s];i&&(p=p.concat(m?i.split(m):i)),l.indexOf(".")>-1&&(p=l.split("."),o=s,s=p[1]),this.addNamespaces(s),_p(this.data,p,o),u.silent||this.emit("added",l,s,i,o)}addResources(l,s,i,o={silent:!1}){for(const u in i)(Oe(i[u])||Array.isArray(i[u]))&&this.addResource(l,s,u,i[u],{silent:!0});o.silent||this.emit("added",l,s,i)}addResourceBundle(l,s,i,o,u,m={silent:!1,skipCopy:!1}){let p=[l,s];l.indexOf(".")>-1&&(p=l.split("."),o=i,i=s,s=p[1]),this.addNamespaces(s);let g=go(this.data,p)||{};m.skipCopy||(i=JSON.parse(JSON.stringify(i))),o?Kg(g,i,u):g={...g,...i},_p(this.data,p,g),m.silent||this.emit("added",l,s,i)}removeResourceBundle(l,s){this.hasResourceBundle(l,s)&&delete this.data[l][s],this.removeNamespaces(s),this.emit("removed",l,s)}hasResourceBundle(l,s){return this.getResource(l,s)!==void 0}getResourceBundle(l,s){return s||(s=this.options.defaultNS),this.getResource(l,s)}getDataByLanguage(l){return this.data[l]}hasLanguageSomeTranslations(l){const s=this.getDataByLanguage(l);return!!(s&&Object.keys(s)||[]).find(o=>s[o]&&Object.keys(s[o]).length>0)}toJSON(){return this.data}}var Xg={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,l,s,i,o){return n.forEach(u=>{l=this.processors[u]?.process(l,s,i,o)??l}),l}};const Qg=Symbol("i18next/PATH_KEY");function Eb(){const n=[],l=Object.create(null);let s;return l.get=(i,o)=>(s?.revoke?.(),o===Qg?n:(n.push(o),s=Proxy.revocable(i,l),s.proxy)),Proxy.revocable(Object.create(null),l).proxy}function id(n,l){const{[Qg]:s}=n(Eb());return s.join(l?.keySeparator??".")}const Np={},Uu=n=>!Oe(n)&&typeof n!="boolean"&&typeof n!="number";class yo extends vo{constructor(l,s={}){super(),pb(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],l,this),this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=dn.create("translator")}changeLanguage(l){l&&(this.language=l)}exists(l,s={interpolation:{}}){const i={...s};if(l==null)return!1;const o=this.resolve(l,i);if(o?.res===void 0)return!1;const u=Uu(o.res);return!(i.returnObjects===!1&&u)}extractFromKey(l,s){let i=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let u=s.ns||this.options.defaultNS||[];const m=i&&l.indexOf(i)>-1,p=!this.options.userDefinedKeySeparator&&!s.keySeparator&&!this.options.userDefinedNsSeparator&&!s.nsSeparator&&!Nb(l,i,o);if(m&&!p){const g=l.match(this.interpolator.nestingRegexp);if(g&&g.length>0)return{key:l,namespaces:Oe(u)?[u]:u};const h=l.split(i);(i!==o||i===o&&this.options.ns.indexOf(h[0])>-1)&&(u=h.shift()),l=h.join(o)}return{key:l,namespaces:Oe(u)?[u]:u}}translate(l,s,i){let o=typeof s=="object"?{...s}:s;if(typeof o!="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),typeof o=="object"&&(o={...o}),o||(o={}),l==null)return"";typeof l=="function"&&(l=id(l,{...this.options,...o})),Array.isArray(l)||(l=[String(l)]);const u=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,m=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,{key:p,namespaces:g}=this.extractFromKey(l[l.length-1],o),h=g[g.length-1];let v=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;v===void 0&&(v=":");const y=o.lng||this.language,_=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(y?.toLowerCase()==="cimode")return _?u?{res:`${h}${v}${p}`,usedKey:p,exactUsedKey:p,usedLng:y,usedNS:h,usedParams:this.getUsedParamsDetails(o)}:`${h}${v}${p}`:u?{res:p,usedKey:p,exactUsedKey:p,usedLng:y,usedNS:h,usedParams:this.getUsedParamsDetails(o)}:p;const j=this.resolve(l,o);let N=j?.res;const T=j?.usedKey||p,O=j?.exactUsedKey||p,G=["[object Number]","[object Function]","[object RegExp]"],Z=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,$=!this.i18nFormat||this.i18nFormat.handleAsObject,V=o.count!==void 0&&!Oe(o.count),X=yo.hasDefaultValue(o),W=V?this.pluralResolver.getSuffix(y,o.count,o):"",F=o.ordinal&&V?this.pluralResolver.getSuffix(y,o.count,{ordinal:!1}):"",E=V&&!o.ordinal&&o.count===0,q=E&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${W}`]||o[`defaultValue${F}`]||o.defaultValue;let ee=N;$&&!N&&X&&(ee=q);const de=Uu(ee),oe=Object.prototype.toString.apply(ee);if($&&ee&&de&&G.indexOf(oe)<0&&!(Oe(Z)&&Array.isArray(ee))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const re=this.options.returnedObjectHandler?this.options.returnedObjectHandler(T,ee,{...o,ns:g}):`key '${p} (${this.language})' returned an object instead of string.`;return u?(j.res=re,j.usedParams=this.getUsedParamsDetails(o),j):re}if(m){const re=Array.isArray(ee),ue=re?[]:{},ge=re?O:T;for(const k in ee)if(Object.prototype.hasOwnProperty.call(ee,k)){const P=`${ge}${m}${k}`;X&&!N?ue[k]=this.translate(P,{...o,defaultValue:Uu(q)?q[k]:void 0,joinArrays:!1,ns:g}):ue[k]=this.translate(P,{...o,joinArrays:!1,ns:g}),ue[k]===P&&(ue[k]=ee[k])}N=ue}}else if($&&Oe(Z)&&Array.isArray(N))N=N.join(Z),N&&(N=this.extendTranslation(N,l,o,i));else{let re=!1,ue=!1;!this.isValidLookup(N)&&X&&(re=!0,N=q),this.isValidLookup(N)||(ue=!0,N=p);const k=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ue?void 0:N,P=X&&q!==N&&this.options.updateMissing;if(ue||re||P){if(this.logger.log(P?"updateKey":"missingKey",y,h,p,P?q:N),m){const w=this.resolve(p,{...o,keySeparator:!1});w&&w.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let fe=[];const me=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&me&&me[0])for(let w=0;w<me.length;w++)fe.push(me[w]);else this.options.saveMissingTo==="all"?fe=this.languageUtils.toResolveHierarchy(o.lng||this.language):fe.push(o.lng||this.language);const le=(w,B,te)=>{const ae=X&&te!==N?te:k;this.options.missingKeyHandler?this.options.missingKeyHandler(w,h,B,ae,P,o):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(w,h,B,ae,P,o),this.emit("missingKey",w,h,B,N)};this.options.saveMissing&&(this.options.saveMissingPlurals&&V?fe.forEach(w=>{const B=this.pluralResolver.getSuffixes(w,o);E&&o[`defaultValue${this.options.pluralSeparator}zero`]&&B.indexOf(`${this.options.pluralSeparator}zero`)<0&&B.push(`${this.options.pluralSeparator}zero`),B.forEach(te=>{le([w],p+te,o[`defaultValue${te}`]||q)})}):le(fe,p,q))}N=this.extendTranslation(N,l,o,j,i),ue&&N===p&&this.options.appendNamespaceToMissingKey&&(N=`${h}${v}${p}`),(ue||re)&&this.options.parseMissingKeyHandler&&(N=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${v}${p}`:p,re?N:void 0,o))}return u?(j.res=N,j.usedParams=this.getUsedParamsDetails(o),j):N}extendTranslation(l,s,i,o,u){if(this.i18nFormat?.parse)l=this.i18nFormat.parse(l,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const g=Oe(l)&&(i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(g){const y=l.match(this.interpolator.nestingRegexp);h=y&&y.length}let v=i.replace&&!Oe(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(v={...this.options.interpolation.defaultVariables,...v}),l=this.interpolator.interpolate(l,v,i.lng||this.language||o.usedLng,i),g){const y=l.match(this.interpolator.nestingRegexp),_=y&&y.length;h<_&&(i.nest=!1)}!i.lng&&o&&o.res&&(i.lng=this.language||o.usedLng),i.nest!==!1&&(l=this.interpolator.nest(l,(...y)=>u?.[0]===y[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${y[0]} in key: ${s[0]}`),null):this.translate(...y,s),i)),i.interpolation&&this.interpolator.reset()}const m=i.postProcess||this.options.postProcess,p=Oe(m)?[m]:m;return l!=null&&p?.length&&i.applyPostProcessor!==!1&&(l=Xg.handle(p,l,s,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),l}resolve(l,s={}){let i,o,u,m,p;return Oe(l)&&(l=[l]),l.forEach(g=>{if(this.isValidLookup(i))return;const h=this.extractFromKey(g,s),v=h.key;o=v;let y=h.namespaces;this.options.fallbackNS&&(y=y.concat(this.options.fallbackNS));const _=s.count!==void 0&&!Oe(s.count),j=_&&!s.ordinal&&s.count===0,N=s.context!==void 0&&(Oe(s.context)||typeof s.context=="number")&&s.context!=="",T=s.lngs?s.lngs:this.languageUtils.toResolveHierarchy(s.lng||this.language,s.fallbackLng);y.forEach(O=>{this.isValidLookup(i)||(p=O,!Np[`${T[0]}-${O}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(p)&&(Np[`${T[0]}-${O}`]=!0,this.logger.warn(`key "${o}" for languages "${T.join(", ")}" won't get resolved as namespace "${p}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),T.forEach(G=>{if(this.isValidLookup(i))return;m=G;const Z=[v];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(Z,v,G,O,s);else{let V;_&&(V=this.pluralResolver.getSuffix(G,s.count,s));const X=`${this.options.pluralSeparator}zero`,W=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(_&&(s.ordinal&&V.indexOf(W)===0&&Z.push(v+V.replace(W,this.options.pluralSeparator)),Z.push(v+V),j&&Z.push(v+X)),N){const F=`${v}${this.options.contextSeparator||"_"}${s.context}`;Z.push(F),_&&(s.ordinal&&V.indexOf(W)===0&&Z.push(F+V.replace(W,this.options.pluralSeparator)),Z.push(F+V),j&&Z.push(F+X))}}let $;for(;$=Z.pop();)this.isValidLookup(i)||(u=$,i=this.getResource(G,O,$,s))}))})}),{res:i,usedKey:o,exactUsedKey:u,usedLng:m,usedNS:p}}isValidLookup(l){return l!==void 0&&!(!this.options.returnNull&&l===null)&&!(!this.options.returnEmptyString&&l==="")}getResource(l,s,i,o={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(l,s,i,o):this.resourceStore.getResource(l,s,i,o)}getUsedParamsDetails(l={}){const s=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=l.replace&&!Oe(l.replace);let o=i?l.replace:l;if(i&&typeof l.count<"u"&&(o.count=l.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!i){o={...o};for(const u of s)delete o[u]}return o}static hasDefaultValue(l){const s="defaultValue";for(const i in l)if(Object.prototype.hasOwnProperty.call(l,i)&&s===i.substring(0,s.length)&&l[i]!==void 0)return!0;return!1}}class wp{constructor(l){this.options=l,this.supportedLngs=this.options.supportedLngs||!1,this.logger=dn.create("languageUtils")}getScriptPartFromCode(l){if(l=As(l),!l||l.indexOf("-")<0)return null;const s=l.split("-");return s.length===2||(s.pop(),s[s.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(s.join("-"))}getLanguagePartFromCode(l){if(l=As(l),!l||l.indexOf("-")<0)return l;const s=l.split("-");return this.formatLanguageCode(s[0])}formatLanguageCode(l){if(Oe(l)&&l.indexOf("-")>-1){let s;try{s=Intl.getCanonicalLocales(l)[0]}catch{}return s&&this.options.lowerCaseLng&&(s=s.toLowerCase()),s||(this.options.lowerCaseLng?l.toLowerCase():l)}return this.options.cleanCode||this.options.lowerCaseLng?l.toLowerCase():l}isSupportedCode(l){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(l=this.getLanguagePartFromCode(l)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(l)>-1}getBestMatchFromCodes(l){if(!l)return null;let s;return l.forEach(i=>{if(s)return;const o=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(o))&&(s=o)}),!s&&this.options.supportedLngs&&l.forEach(i=>{if(s)return;const o=this.getScriptPartFromCode(i);if(this.isSupportedCode(o))return s=o;const u=this.getLanguagePartFromCode(i);if(this.isSupportedCode(u))return s=u;s=this.options.supportedLngs.find(m=>{if(m===u)return m;if(!(m.indexOf("-")<0&&u.indexOf("-")<0)&&(m.indexOf("-")>0&&u.indexOf("-")<0&&m.substring(0,m.indexOf("-"))===u||m.indexOf(u)===0&&u.length>1))return m})}),s||(s=this.getFallbackCodes(this.options.fallbackLng)[0]),s}getFallbackCodes(l,s){if(!l)return[];if(typeof l=="function"&&(l=l(s)),Oe(l)&&(l=[l]),Array.isArray(l))return l;if(!s)return l.default||[];let i=l[s];return i||(i=l[this.getScriptPartFromCode(s)]),i||(i=l[this.formatLanguageCode(s)]),i||(i=l[this.getLanguagePartFromCode(s)]),i||(i=l.default),i||[]}toResolveHierarchy(l,s){const i=this.getFallbackCodes((s===!1?[]:s)||this.options.fallbackLng||[],l),o=[],u=m=>{m&&(this.isSupportedCode(m)?o.push(m):this.logger.warn(`rejecting language code not found in supportedLngs: ${m}`))};return Oe(l)&&(l.indexOf("-")>-1||l.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&u(this.formatLanguageCode(l)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&u(this.getScriptPartFromCode(l)),this.options.load!=="currentOnly"&&u(this.getLanguagePartFromCode(l))):Oe(l)&&u(this.formatLanguageCode(l)),i.forEach(m=>{o.indexOf(m)<0&&u(this.formatLanguageCode(m))}),o}}const Ep={zero:0,one:1,two:2,few:3,many:4,other:5},Cp={select:n=>n===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Cb{constructor(l,s={}){this.languageUtils=l,this.options=s,this.logger=dn.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(l,s={}){const i=As(l==="dev"?"en":l),o=s.ordinal?"ordinal":"cardinal",u=JSON.stringify({cleanedCode:i,type:o});if(u in this.pluralRulesCache)return this.pluralRulesCache[u];let m;try{m=new Intl.PluralRules(i,{type:o})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Cp;if(!l.match(/-|_/))return Cp;const g=this.languageUtils.getLanguagePartFromCode(l);m=this.getRule(g,s)}return this.pluralRulesCache[u]=m,m}needsPlural(l,s={}){let i=this.getRule(l,s);return i||(i=this.getRule("dev",s)),i?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(l,s,i={}){return this.getSuffixes(l,i).map(o=>`${s}${o}`)}getSuffixes(l,s={}){let i=this.getRule(l,s);return i||(i=this.getRule("dev",s)),i?i.resolvedOptions().pluralCategories.sort((o,u)=>Ep[o]-Ep[u]).map(o=>`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(l,s,i={}){const o=this.getRule(l,i);return o?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${o.select(s)}`:(this.logger.warn(`no plural rule found for: ${l}`),this.getSuffix("dev",s,i))}}const Rp=(n,l,s,i=".",o=!0)=>{let u=yb(n,l,s);return!u&&o&&Oe(s)&&(u=sd(n,s,i),u===void 0&&(u=sd(l,s,i))),u},Hu=n=>n.replace(/\$/g,"$$$$");class Tp{constructor(l={}){this.logger=dn.create("interpolator"),this.options=l,this.format=l?.interpolation?.format||(s=>s),this.init(l)}init(l={}){l.interpolation||(l.interpolation={escapeValue:!0});const{escape:s,escapeValue:i,useRawValueToEscape:o,prefix:u,prefixEscaped:m,suffix:p,suffixEscaped:g,formatSeparator:h,unescapeSuffix:v,unescapePrefix:y,nestingPrefix:_,nestingPrefixEscaped:j,nestingSuffix:N,nestingSuffixEscaped:T,nestingOptionsSeparator:O,maxReplaces:G,alwaysFormat:Z}=l.interpolation;this.escape=s!==void 0?s:vb,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=u?zl(u):m||"{{",this.suffix=p?zl(p):g||"}}",this.formatSeparator=h||",",this.unescapePrefix=v?"":y||"-",this.unescapeSuffix=this.unescapePrefix?"":v||"",this.nestingPrefix=_?zl(_):j||zl("$t("),this.nestingSuffix=N?zl(N):T||zl(")"),this.nestingOptionsSeparator=O||",",this.maxReplaces=G||1e3,this.alwaysFormat=Z!==void 0?Z:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const l=(s,i)=>s?.source===i?(s.lastIndex=0,s):new RegExp(i,"g");this.regexp=l(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=l(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=l(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(l,s,i,o){let u,m,p;const g=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=j=>{if(j.indexOf(this.formatSeparator)<0){const G=Rp(s,g,j,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(G,void 0,i,{...o,...s,interpolationkey:j}):G}const N=j.split(this.formatSeparator),T=N.shift().trim(),O=N.join(this.formatSeparator).trim();return this.format(Rp(s,g,T,this.options.keySeparator,this.options.ignoreJSONStructure),O,i,{...o,...s,interpolationkey:T})};this.resetRegExp();const v=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,y=o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:j=>Hu(j)},{regex:this.regexp,safeValue:j=>this.escapeValue?Hu(this.escape(j)):Hu(j)}].forEach(j=>{for(p=0;u=j.regex.exec(l);){const N=u[1].trim();if(m=h(N),m===void 0)if(typeof v=="function"){const O=v(l,u,o);m=Oe(O)?O:""}else if(o&&Object.prototype.hasOwnProperty.call(o,N))m="";else if(y){m=u[0];continue}else this.logger.warn(`missed to pass in variable ${N} for interpolating ${l}`),m="";else!Oe(m)&&!this.useRawValueToEscape&&(m=bp(m));const T=j.safeValue(m);if(l=l.replace(u[0],T),y?(j.regex.lastIndex+=m.length,j.regex.lastIndex-=u[0].length):j.regex.lastIndex=0,p++,p>=this.maxReplaces)break}}),l}nest(l,s,i={}){let o,u,m;const p=(g,h)=>{const v=this.nestingOptionsSeparator;if(g.indexOf(v)<0)return g;const y=g.split(new RegExp(`${zl(v)}[ ]*{`));let _=`{${y[1]}`;g=y[0],_=this.interpolate(_,m);const j=_.match(/'/g),N=_.match(/"/g);((j?.length??0)%2===0&&!N||(N?.length??0)%2!==0)&&(_=_.replace(/'/g,'"'));try{m=JSON.parse(_),h&&(m={...h,...m})}catch(T){return this.logger.warn(`failed parsing options string in nesting for key ${g}`,T),`${g}${v}${_}`}return m.defaultValue&&m.defaultValue.indexOf(this.prefix)>-1&&delete m.defaultValue,g};for(;o=this.nestingRegexp.exec(l);){let g=[];m={...i},m=m.replace&&!Oe(m.replace)?m.replace:m,m.applyPostProcessor=!1,delete m.defaultValue;const h=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(h!==-1&&(g=o[1].slice(h).split(this.formatSeparator).map(v=>v.trim()).filter(Boolean),o[1]=o[1].slice(0,h)),u=s(p.call(this,o[1].trim(),m),m),u&&o[0]===l&&!Oe(u))return u;Oe(u)||(u=bp(u)),u||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${l}`),u=""),g.length&&(u=g.reduce((v,y)=>this.format(v,y,i.lng,{...i,interpolationkey:o[1].trim()}),u.trim())),l=l.replace(o[0],u),this.regexp.lastIndex=0}return l}}const Rb=n=>{let l=n.toLowerCase().trim();const s={};if(n.indexOf("(")>-1){const i=n.split("(");l=i[0].toLowerCase().trim();const o=i[1].substring(0,i[1].length-1);l==="currency"&&o.indexOf(":")<0?s.currency||(s.currency=o.trim()):l==="relativetime"&&o.indexOf(":")<0?s.range||(s.range=o.trim()):o.split(";").forEach(m=>{if(m){const[p,...g]=m.split(":"),h=g.join(":").trim().replace(/^'+|'+$/g,""),v=p.trim();s[v]||(s[v]=h),h==="false"&&(s[v]=!1),h==="true"&&(s[v]=!0),isNaN(h)||(s[v]=parseInt(h,10))}})}return{formatName:l,formatOptions:s}},zp=n=>{const l={};return(s,i,o)=>{let u=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(u={...u,[o.interpolationkey]:void 0});const m=i+JSON.stringify(u);let p=l[m];return p||(p=n(As(i),o),l[m]=p),p(s)}},Tb=n=>(l,s,i)=>n(As(s),i)(l);class zb{constructor(l={}){this.logger=dn.create("formatter"),this.options=l,this.init(l)}init(l,s={interpolation:{}}){this.formatSeparator=s.interpolation.formatSeparator||",";const i=s.cacheInBuiltFormats?zp:Tb;this.formats={number:i((o,u)=>{const m=new Intl.NumberFormat(o,{...u});return p=>m.format(p)}),currency:i((o,u)=>{const m=new Intl.NumberFormat(o,{...u,style:"currency"});return p=>m.format(p)}),datetime:i((o,u)=>{const m=new Intl.DateTimeFormat(o,{...u});return p=>m.format(p)}),relativetime:i((o,u)=>{const m=new Intl.RelativeTimeFormat(o,{...u});return p=>m.format(p,u.range||"day")}),list:i((o,u)=>{const m=new Intl.ListFormat(o,{...u});return p=>m.format(p)})}}add(l,s){this.formats[l.toLowerCase().trim()]=s}addCached(l,s){this.formats[l.toLowerCase().trim()]=zp(s)}format(l,s,i,o={}){const u=s.split(this.formatSeparator);if(u.length>1&&u[0].indexOf("(")>1&&u[0].indexOf(")")<0&&u.find(p=>p.indexOf(")")>-1)){const p=u.findIndex(g=>g.indexOf(")")>-1);u[0]=[u[0],...u.splice(1,p)].join(this.formatSeparator)}return u.reduce((p,g)=>{const{formatName:h,formatOptions:v}=Rb(g);if(this.formats[h]){let y=p;try{const _=o?.formatParams?.[o.interpolationkey]||{},j=_.locale||_.lng||o.locale||o.lng||i;y=this.formats[h](p,j,{...v,...o,..._})}catch(_){this.logger.warn(_)}return y}else this.logger.warn(`there was no format function for ${h}`);return p},l)}}const Ob=(n,l)=>{n.pending[l]!==void 0&&(delete n.pending[l],n.pendingCount--)};class Db extends vo{constructor(l,s,i,o={}){super(),this.backend=l,this.store=s,this.services=i,this.languageUtils=i.languageUtils,this.options=o,this.logger=dn.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(i,o.backend,o)}queueLoad(l,s,i,o){const u={},m={},p={},g={};return l.forEach(h=>{let v=!0;s.forEach(y=>{const _=`${h}|${y}`;!i.reload&&this.store.hasResourceBundle(h,y)?this.state[_]=2:this.state[_]<0||(this.state[_]===1?m[_]===void 0&&(m[_]=!0):(this.state[_]=1,v=!1,m[_]===void 0&&(m[_]=!0),u[_]===void 0&&(u[_]=!0),g[y]===void 0&&(g[y]=!0)))}),v||(p[h]=!0)}),(Object.keys(u).length||Object.keys(m).length)&&this.queue.push({pending:m,pendingCount:Object.keys(m).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(u),pending:Object.keys(m),toLoadLanguages:Object.keys(p),toLoadNamespaces:Object.keys(g)}}loaded(l,s,i){const o=l.split("|"),u=o[0],m=o[1];s&&this.emit("failedLoading",u,m,s),!s&&i&&this.store.addResourceBundle(u,m,i,void 0,void 0,{skipCopy:!0}),this.state[l]=s?-1:2,s&&i&&(this.state[l]=0);const p={};this.queue.forEach(g=>{xb(g.loaded,[u],m),Ob(g,l),s&&g.errors.push(s),g.pendingCount===0&&!g.done&&(Object.keys(g.loaded).forEach(h=>{p[h]||(p[h]={});const v=g.loaded[h];v.length&&v.forEach(y=>{p[h][y]===void 0&&(p[h][y]=!0)})}),g.done=!0,g.errors.length?g.callback(g.errors):g.callback())}),this.emit("loaded",p),this.queue=this.queue.filter(g=>!g.done)}read(l,s,i,o=0,u=this.retryTimeout,m){if(!l.length)return m(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:l,ns:s,fcName:i,tried:o,wait:u,callback:m});return}this.readingCalls++;const p=(h,v)=>{if(this.readingCalls--,this.waitingReads.length>0){const y=this.waitingReads.shift();this.read(y.lng,y.ns,y.fcName,y.tried,y.wait,y.callback)}if(h&&v&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,l,s,i,o+1,u*2,m)},u);return}m(h,v)},g=this.backend[i].bind(this.backend);if(g.length===2){try{const h=g(l,s);h&&typeof h.then=="function"?h.then(v=>p(null,v)).catch(p):p(null,h)}catch(h){p(h)}return}return g(l,s,p)}prepareLoading(l,s,i={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();Oe(l)&&(l=this.languageUtils.toResolveHierarchy(l)),Oe(s)&&(s=[s]);const u=this.queueLoad(l,s,i,o);if(!u.toLoad.length)return u.pending.length||o(),null;u.toLoad.forEach(m=>{this.loadOne(m)})}load(l,s,i){this.prepareLoading(l,s,{},i)}reload(l,s,i){this.prepareLoading(l,s,{reload:!0},i)}loadOne(l,s=""){const i=l.split("|"),o=i[0],u=i[1];this.read(o,u,"read",void 0,void 0,(m,p)=>{m&&this.logger.warn(`${s}loading namespace ${u} for language ${o} failed`,m),!m&&p&&this.logger.log(`${s}loaded namespace ${u} for language ${o}`,p),this.loaded(l,m,p)})}saveMissing(l,s,i,o,u,m={},p=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(s)){this.logger.warn(`did not save key "${i}" as the namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if(this.backend?.create){const g={...m,isUpdate:u},h=this.backend.create.bind(this.backend);if(h.length<6)try{let v;h.length===5?v=h(l,s,i,o,g):v=h(l,s,i,o),v&&typeof v.then=="function"?v.then(y=>p(null,y)).catch(p):p(null,v)}catch(v){p(v)}else h(l,s,i,o,p,g)}!l||!l[0]||this.store.addResource(l[0],s,i,o)}}}const Bu=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:n=>{let l={};if(typeof n[1]=="object"&&(l=n[1]),Oe(n[1])&&(l.defaultValue=n[1]),Oe(n[2])&&(l.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const s=n[3]||n[2];Object.keys(s).forEach(i=>{l[i]=s[i]})}return l},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Op=n=>(Oe(n.ns)&&(n.ns=[n.ns]),Oe(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),Oe(n.fallbackNS)&&(n.fallbackNS=[n.fallbackNS]),n.supportedLngs?.indexOf?.("cimode")<0&&(n.supportedLngs=n.supportedLngs.concat(["cimode"])),typeof n.initImmediate=="boolean"&&(n.initAsync=n.initImmediate),n),no=()=>{},Mb=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(s=>{typeof n[s]=="function"&&(n[s]=n[s].bind(n))})},Zg="__i18next_supportNoticeShown",kb=()=>typeof globalThis<"u"&&!!globalThis[Zg],Ab=()=>{typeof globalThis<"u"&&(globalThis[Zg]=!0)},Lb=n=>!!(n?.modules?.backend?.name?.indexOf("Locize")>0||n?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||n?.options?.backend?.backends&&n.options.backend.backends.some(l=>l?.name?.indexOf("Locize")>0||l?.constructor?.name?.indexOf("Locize")>0)||n?.options?.backend?.projectId||n?.options?.backend?.backendOptions&&n.options.backend.backendOptions.some(l=>l?.projectId));class Ms extends vo{constructor(l={},s){if(super(),this.options=Op(l),this.services={},this.logger=dn,this.modules={external:[]},Mb(this),s&&!this.isInitialized&&!l.isClone){if(!this.options.initAsync)return this.init(l,s),this;setTimeout(()=>{this.init(l,s)},0)}}init(l={},s){this.isInitializing=!0,typeof l=="function"&&(s=l,l={}),l.defaultNS==null&&l.ns&&(Oe(l.ns)?l.defaultNS=l.ns:l.ns.indexOf("translation")<0&&(l.defaultNS=l.ns[0]));const i=Bu();this.options={...i,...this.options,...Op(l)},this.options.interpolation={...i.interpolation,...this.options.interpolation},l.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=l.keySeparator),l.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=l.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!Lb(this)&&!kb()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is maintained with support from Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),Ab());const o=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?dn.init(o(this.modules.logger),this.options):dn.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:h=zb;const v=new wp(this.options);this.store=new jp(this.options.resources,this.options);const y=this.services;y.logger=dn,y.resourceStore=this.store,y.languageUtils=v,y.pluralResolver=new Cb(v,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),h&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(y.formatter=o(h),y.formatter.init&&y.formatter.init(y,this.options),this.options.interpolation.format=y.formatter.format.bind(y.formatter)),y.interpolator=new Tp(this.options),y.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},y.backendConnector=new Db(o(this.modules.backend),y.resourceStore,y,this.options),y.backendConnector.on("*",(j,...N)=>{this.emit(j,...N)}),this.modules.languageDetector&&(y.languageDetector=o(this.modules.languageDetector),y.languageDetector.init&&y.languageDetector.init(y,this.options.detection,this.options)),this.modules.i18nFormat&&(y.i18nFormat=o(this.modules.i18nFormat),y.i18nFormat.init&&y.i18nFormat.init(this)),this.translator=new yo(this.services,this.options),this.translator.on("*",(j,...N)=>{this.emit(j,...N)}),this.modules.external.forEach(j=>{j.init&&j.init(this)})}if(this.format=this.options.interpolation.format,s||(s=no),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(h=>{this[h]=(...v)=>this.store[h](...v)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=(...v)=>(this.store[h](...v),this)});const p=Ns(),g=()=>{const h=(v,y)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),p.resolve(y),s(v,y)};if(this.languages&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initAsync?g():setTimeout(g,0),p}loadResources(l,s=no){let i=s;const o=Oe(l)?l:this.language;if(typeof l=="function"&&(i=l),!this.options.resources||this.options.partialBundledLanguages){if(o?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const u=[],m=p=>{if(!p||p==="cimode")return;this.services.languageUtils.toResolveHierarchy(p).forEach(h=>{h!=="cimode"&&u.indexOf(h)<0&&u.push(h)})};o?m(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(g=>m(g)),this.options.preload?.forEach?.(p=>m(p)),this.services.backendConnector.load(u,this.options.ns,p=>{!p&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(p)})}else i(null)}reloadResources(l,s,i){const o=Ns();return typeof l=="function"&&(i=l,l=void 0),typeof s=="function"&&(i=s,s=void 0),l||(l=this.languages),s||(s=this.options.ns),i||(i=no),this.services.backendConnector.reload(l,s,u=>{o.resolve(),i(u)}),o}use(l){if(!l)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!l.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return l.type==="backend"&&(this.modules.backend=l),(l.type==="logger"||l.log&&l.warn&&l.error)&&(this.modules.logger=l),l.type==="languageDetector"&&(this.modules.languageDetector=l),l.type==="i18nFormat"&&(this.modules.i18nFormat=l),l.type==="postProcessor"&&Xg.addPostProcessor(l),l.type==="formatter"&&(this.modules.formatter=l),l.type==="3rdParty"&&this.modules.external.push(l),this}setResolvedLanguage(l){if(!(!l||!this.languages)&&!(["cimode","dev"].indexOf(l)>-1)){for(let s=0;s<this.languages.length;s++){const i=this.languages[s];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&this.languages.indexOf(l)<0&&this.store.hasLanguageSomeTranslations(l)&&(this.resolvedLanguage=l,this.languages.unshift(l))}}changeLanguage(l,s){this.isLanguageChangingTo=l;const i=Ns();this.emit("languageChanging",l);const o=p=>{this.language=p,this.languages=this.services.languageUtils.toResolveHierarchy(p),this.resolvedLanguage=void 0,this.setResolvedLanguage(p)},u=(p,g)=>{g?this.isLanguageChangingTo===l&&(o(g),this.translator.changeLanguage(g),this.isLanguageChangingTo=void 0,this.emit("languageChanged",g),this.logger.log("languageChanged",g)):this.isLanguageChangingTo=void 0,i.resolve((...h)=>this.t(...h)),s&&s(p,(...h)=>this.t(...h))},m=p=>{!l&&!p&&this.services.languageDetector&&(p=[]);const g=Oe(p)?p:p&&p[0],h=this.store.hasLanguageSomeTranslations(g)?g:this.services.languageUtils.getBestMatchFromCodes(Oe(p)?[p]:p);h&&(this.language||o(h),this.translator.language||this.translator.changeLanguage(h),this.services.languageDetector?.cacheUserLanguage?.(h)),this.loadResources(h,v=>{u(v,h)})};return!l&&this.services.languageDetector&&!this.services.languageDetector.async?m(this.services.languageDetector.detect()):!l&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(m):this.services.languageDetector.detect(m):m(l),i}getFixedT(l,s,i){const o=(u,m,...p)=>{let g;typeof m!="object"?g=this.options.overloadTranslationOptionHandler([u,m].concat(p)):g={...m},g.lng=g.lng||o.lng,g.lngs=g.lngs||o.lngs,g.ns=g.ns||o.ns,g.keyPrefix!==""&&(g.keyPrefix=g.keyPrefix||i||o.keyPrefix);const h=this.options.keySeparator||".";let v;return g.keyPrefix&&Array.isArray(u)?v=u.map(y=>(typeof y=="function"&&(y=id(y,{...this.options,...m})),`${g.keyPrefix}${h}${y}`)):(typeof u=="function"&&(u=id(u,{...this.options,...m})),v=g.keyPrefix?`${g.keyPrefix}${h}${u}`:u),this.t(v,g)};return Oe(l)?o.lng=l:o.lngs=l,o.ns=s,o.keyPrefix=i,o}t(...l){return this.translator?.translate(...l)}exists(...l){return this.translator?.exists(...l)}setDefaultNamespace(l){this.options.defaultNS=l}hasLoadedNamespace(l,s={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=s.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const m=(p,g)=>{const h=this.services.backendConnector.state[`${p}|${g}`];return h===-1||h===0||h===2};if(s.precheck){const p=s.precheck(this,m);if(p!==void 0)return p}return!!(this.hasResourceBundle(i,l)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||m(i,l)&&(!o||m(u,l)))}loadNamespaces(l,s){const i=Ns();return this.options.ns?(Oe(l)&&(l=[l]),l.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{i.resolve(),s&&s(o)}),i):(s&&s(),Promise.resolve())}loadLanguages(l,s){const i=Ns();Oe(l)&&(l=[l]);const o=this.options.preload||[],u=l.filter(m=>o.indexOf(m)<0&&this.services.languageUtils.isSupportedCode(m));return u.length?(this.options.preload=o.concat(u),this.loadResources(m=>{i.resolve(),s&&s(m)}),i):(s&&s(),Promise.resolve())}dir(l){if(l||(l=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!l)return"rtl";try{const o=new Intl.Locale(l);if(o&&o.getTextInfo){const u=o.getTextInfo();if(u&&u.direction)return u.direction}}catch{}const s=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=this.services?.languageUtils||new wp(Bu());return l.toLowerCase().indexOf("-latn")>1?"ltr":s.indexOf(i.getLanguagePartFromCode(l))>-1||l.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(l={},s){const i=new Ms(l,s);return i.createInstance=Ms.createInstance,i}cloneInstance(l={},s=no){const i=l.forkResourceStore;i&&delete l.forkResourceStore;const o={...this.options,...l,isClone:!0},u=new Ms(o);if((l.debug!==void 0||l.prefix!==void 0)&&(u.logger=u.logger.clone(l)),["store","services","language"].forEach(p=>{u[p]=this[p]}),u.services={...this.services},u.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},i){const p=Object.keys(this.store.data).reduce((g,h)=>(g[h]={...this.store.data[h]},g[h]=Object.keys(g[h]).reduce((v,y)=>(v[y]={...g[h][y]},v),g[h]),g),{});u.store=new jp(p,o),u.services.resourceStore=u.store}if(l.interpolation){const g={...Bu().interpolation,...this.options.interpolation,...l.interpolation},h={...o,interpolation:g};u.services.interpolator=new Tp(h)}return u.translator=new yo(u.services,o),u.translator.on("*",(p,...g)=>{u.emit(p,...g)}),u.init(o,s),u.translator.options=o,u.translator.backendConnector.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const fa=Ms.createInstance();fa.createInstance;fa.dir;fa.init;fa.loadResources;fa.reloadResources;fa.use;fa.changeLanguage;fa.getFixedT;fa.t;fa.exists;fa.setDefaultNamespace;fa.hasLoadedNamespace;fa.loadNamespaces;fa.loadLanguages;var $u={exports:{}},Le={};var Dp;function Ub(){if(Dp)return Le;Dp=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),m=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),_=Symbol.iterator;function j(w){return w===null||typeof w!="object"?null:(w=_&&w[_]||w["@@iterator"],typeof w=="function"?w:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,O={};function G(w,B,te){this.props=w,this.context=B,this.refs=O,this.updater=te||N}G.prototype.isReactComponent={},G.prototype.setState=function(w,B){if(typeof w!="object"&&typeof w!="function"&&w!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,w,B,"setState")},G.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function Z(){}Z.prototype=G.prototype;function $(w,B,te){this.props=w,this.context=B,this.refs=O,this.updater=te||N}var V=$.prototype=new Z;V.constructor=$,T(V,G.prototype),V.isPureReactComponent=!0;var X=Array.isArray;function W(){}var F={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function q(w,B,te){var ae=te.ref;return{$$typeof:n,type:w,key:B,ref:ae!==void 0?ae:null,props:te}}function ee(w,B){return q(w.type,B,w.props)}function de(w){return typeof w=="object"&&w!==null&&w.$$typeof===n}function oe(w){var B={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(te){return B[te]})}var re=/\/+/g;function ue(w,B){return typeof w=="object"&&w!==null&&w.key!=null?oe(""+w.key):B.toString(36)}function ge(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(W,W):(w.status="pending",w.then(function(B){w.status==="pending"&&(w.status="fulfilled",w.value=B)},function(B){w.status==="pending"&&(w.status="rejected",w.reason=B)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function k(w,B,te,ae,xe){var ve=typeof w;(ve==="undefined"||ve==="boolean")&&(w=null);var ze=!1;if(w===null)ze=!0;else switch(ve){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(w.$$typeof){case n:case l:ze=!0;break;case v:return ze=w._init,k(ze(w._payload),B,te,ae,xe)}}if(ze)return xe=xe(w),ze=ae===""?"."+ue(w,0):ae,X(xe)?(te="",ze!=null&&(te=ze.replace(re,"$&/")+"/"),k(xe,B,te,"",function(Wt){return Wt})):xe!=null&&(de(xe)&&(xe=ee(xe,te+(xe.key==null||w&&w.key===xe.key?"":(""+xe.key).replace(re,"$&/")+"/")+ze)),B.push(xe)),1;ze=0;var Pe=ae===""?".":ae+":";if(X(w))for(var Xe=0;Xe<w.length;Xe++)ae=w[Xe],ve=Pe+ue(ae,Xe),ze+=k(ae,B,te,ve,xe);else if(Xe=j(w),typeof Xe=="function")for(w=Xe.call(w),Xe=0;!(ae=w.next()).done;)ae=ae.value,ve=Pe+ue(ae,Xe++),ze+=k(ae,B,te,ve,xe);else if(ve==="object"){if(typeof w.then=="function")return k(ge(w),B,te,ae,xe);throw B=String(w),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return ze}function P(w,B,te){if(w==null)return w;var ae=[],xe=0;return k(w,ae,"","",function(ve){return B.call(te,ve,xe++)}),ae}function fe(w){if(w._status===-1){var B=w._result;B=B(),B.then(function(te){(w._status===0||w._status===-1)&&(w._status=1,w._result=te)},function(te){(w._status===0||w._status===-1)&&(w._status=2,w._result=te)}),w._status===-1&&(w._status=0,w._result=B)}if(w._status===1)return w._result.default;throw w._result}var me=typeof reportError=="function"?reportError:function(w){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof w=="object"&&w!==null&&typeof w.message=="string"?String(w.message):String(w),error:w});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)},le={map:P,forEach:function(w,B,te){P(w,function(){B.apply(this,arguments)},te)},count:function(w){var B=0;return P(w,function(){B++}),B},toArray:function(w){return P(w,function(B){return B})||[]},only:function(w){if(!de(w))throw Error("React.Children.only expected to receive a single React element child.");return w}};return Le.Activity=y,Le.Children=le,Le.Component=G,Le.Fragment=s,Le.Profiler=o,Le.PureComponent=$,Le.StrictMode=i,Le.Suspense=g,Le.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,Le.__COMPILER_RUNTIME={__proto__:null,c:function(w){return F.H.useMemoCache(w)}},Le.cache=function(w){return function(){return w.apply(null,arguments)}},Le.cacheSignal=function(){return null},Le.cloneElement=function(w,B,te){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var ae=T({},w.props),xe=w.key;if(B!=null)for(ve in B.key!==void 0&&(xe=""+B.key),B)!E.call(B,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&B.ref===void 0||(ae[ve]=B[ve]);var ve=arguments.length-2;if(ve===1)ae.children=te;else if(1<ve){for(var ze=Array(ve),Pe=0;Pe<ve;Pe++)ze[Pe]=arguments[Pe+2];ae.children=ze}return q(w.type,xe,ae)},Le.createContext=function(w){return w={$$typeof:m,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:u,_context:w},w},Le.createElement=function(w,B,te){var ae,xe={},ve=null;if(B!=null)for(ae in B.key!==void 0&&(ve=""+B.key),B)E.call(B,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(xe[ae]=B[ae]);var ze=arguments.length-2;if(ze===1)xe.children=te;else if(1<ze){for(var Pe=Array(ze),Xe=0;Xe<ze;Xe++)Pe[Xe]=arguments[Xe+2];xe.children=Pe}if(w&&w.defaultProps)for(ae in ze=w.defaultProps,ze)xe[ae]===void 0&&(xe[ae]=ze[ae]);return q(w,ve,xe)},Le.createRef=function(){return{current:null}},Le.forwardRef=function(w){return{$$typeof:p,render:w}},Le.isValidElement=de,Le.lazy=function(w){return{$$typeof:v,_payload:{_status:-1,_result:w},_init:fe}},Le.memo=function(w,B){return{$$typeof:h,type:w,compare:B===void 0?null:B}},Le.startTransition=function(w){var B=F.T,te={};F.T=te;try{var ae=w(),xe=F.S;xe!==null&&xe(te,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(W,me)}catch(ve){me(ve)}finally{B!==null&&te.types!==null&&(B.types=te.types),F.T=B}},Le.unstable_useCacheRefresh=function(){return F.H.useCacheRefresh()},Le.use=function(w){return F.H.use(w)},Le.useActionState=function(w,B,te){return F.H.useActionState(w,B,te)},Le.useCallback=function(w,B){return F.H.useCallback(w,B)},Le.useContext=function(w){return F.H.useContext(w)},Le.useDebugValue=function(){},Le.useDeferredValue=function(w,B){return F.H.useDeferredValue(w,B)},Le.useEffect=function(w,B){return F.H.useEffect(w,B)},Le.useEffectEvent=function(w){return F.H.useEffectEvent(w)},Le.useId=function(){return F.H.useId()},Le.useImperativeHandle=function(w,B,te){return F.H.useImperativeHandle(w,B,te)},Le.useInsertionEffect=function(w,B){return F.H.useInsertionEffect(w,B)},Le.useLayoutEffect=function(w,B){return F.H.useLayoutEffect(w,B)},Le.useMemo=function(w,B){return F.H.useMemo(w,B)},Le.useOptimistic=function(w,B){return F.H.useOptimistic(w,B)},Le.useReducer=function(w,B,te){return F.H.useReducer(w,B,te)},Le.useRef=function(w){return F.H.useRef(w)},Le.useState=function(w){return F.H.useState(w)},Le.useSyncExternalStore=function(w,B,te){return F.H.useSyncExternalStore(w,B,te)},Le.useTransition=function(){return F.H.useTransition()},Le.version="19.2.4",Le}var Mp;function So(){return Mp||(Mp=1,$u.exports=Ub()),$u.exports}var b=So();const Rr=fb(b),Hb=db({__proto__:null,default:Rr},[b]),Bb=(n,l,s,i)=>{const o=[s,{code:l,...i||{}}];if(n?.services?.logger?.forward)return n.services.logger.forward(o,"warn","react-i18next::",!0);kl(o[0])&&(o[0]=`react-i18next:: ${o[0]}`),n?.services?.logger?.warn?n.services.logger.warn(...o):console?.warn&&console.warn(...o)},kp={},Fg=(n,l,s,i)=>{kl(s)&&kp[s]||(kl(s)&&(kp[s]=new Date),Bb(n,l,s,i))},Jg=(n,l)=>()=>{if(n.isInitialized)l();else{const s=()=>{setTimeout(()=>{n.off("initialized",s)},0),l()};n.on("initialized",s)}},od=(n,l,s)=>{n.loadNamespaces(l,Jg(n,s))},Ap=(n,l,s,i)=>{if(kl(s)&&(s=[s]),n.options.preload&&n.options.preload.indexOf(l)>-1)return od(n,s,i);s.forEach(o=>{n.options.ns.indexOf(o)<0&&n.options.ns.push(o)}),n.loadLanguages(l,Jg(n,i))},$b=(n,l,s={})=>!l.languages||!l.languages.length?(Fg(l,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:l.languages}),!0):l.hasLoadedNamespace(n,{lng:s.lng,precheck:(i,o)=>{if(s.bindI18n&&s.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!o(i.isLanguageChangingTo,n))return!1}}),kl=n=>typeof n=="string",qb=n=>typeof n=="object"&&n!==null,Yb=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Gb={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Vb=n=>Gb[n],Kb=n=>n.replace(Yb,Vb);let cd={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Kb,transDefaultProps:void 0};const Xb=(n={})=>{cd={...cd,...n}},Qb=()=>cd;let Pg;const Zb=n=>{Pg=n},Fb=()=>Pg,Jb={type:"3rdParty",init(n){Xb(n.options.react),Zb(n)}},Pb=b.createContext();class Ib{constructor(){this.usedNamespaces={}}addUsedNamespaces(l){l.forEach(s=>{this.usedNamespaces[s]||(this.usedNamespaces[s]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var qu={exports:{}},Yu={};var Lp;function Wb(){if(Lp)return Yu;Lp=1;var n=So();function l(y,_){return y===_&&(y!==0||1/y===1/_)||y!==y&&_!==_}var s=typeof Object.is=="function"?Object.is:l,i=n.useState,o=n.useEffect,u=n.useLayoutEffect,m=n.useDebugValue;function p(y,_){var j=_(),N=i({inst:{value:j,getSnapshot:_}}),T=N[0].inst,O=N[1];return u(function(){T.value=j,T.getSnapshot=_,g(T)&&O({inst:T})},[y,j,_]),o(function(){return g(T)&&O({inst:T}),y(function(){g(T)&&O({inst:T})})},[y]),m(j),j}function g(y){var _=y.getSnapshot;y=y.value;try{var j=_();return!s(y,j)}catch{return!0}}function h(y,_){return _()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:p;return Yu.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:v,Yu}var Up;function ev(){return Up||(Up=1,qu.exports=Wb()),qu.exports}var tv=ev();const av=(n,l)=>kl(l)?l:qb(l)&&kl(l.defaultValue)?l.defaultValue:Array.isArray(n)?n[n.length-1]:n,nv={t:av,ready:!1},lv=()=>()=>{},Te=(n,l={})=>{const{i18n:s}=l,{i18n:i,defaultNS:o}=b.useContext(Pb)||{},u=s||i||Fb();u&&!u.reportNamespaces&&(u.reportNamespaces=new Ib),u||Fg(u,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const m=b.useMemo(()=>({...Qb(),...u?.options?.react,...l}),[u,l]),{useSuspense:p,keyPrefix:g}=m,h=o||u?.options?.defaultNS,v=kl(h)?[h]:h||["translation"],y=b.useMemo(()=>v,v);u?.reportNamespaces?.addUsedNamespaces?.(y);const _=b.useRef(0),j=b.useCallback(q=>{if(!u)return lv;const{bindI18n:ee,bindI18nStore:de}=m,oe=()=>{_.current+=1,q()};return ee&&u.on(ee,oe),de&&u.store.on(de,oe),()=>{ee&&ee.split(" ").forEach(re=>u.off(re,oe)),de&&de.split(" ").forEach(re=>u.store.off(re,oe))}},[u,m]),N=b.useRef(),T=b.useCallback(()=>{if(!u)return nv;const q=!!(u.isInitialized||u.initializedStoreOnce)&&y.every(ge=>$b(ge,u,m)),ee=l.lng||u.language,de=_.current,oe=N.current;if(oe&&oe.ready===q&&oe.lng===ee&&oe.keyPrefix===g&&oe.revision===de)return oe;const ue={t:u.getFixedT(ee,m.nsMode==="fallback"?y:y[0],g),ready:q,lng:ee,keyPrefix:g,revision:de};return N.current=ue,ue},[u,y,g,m,l.lng]),[O,G]=b.useState(0),{t:Z,ready:$}=tv.useSyncExternalStore(j,T,T);b.useEffect(()=>{if(u&&!$&&!p){const q=()=>G(ee=>ee+1);l.lng?Ap(u,l.lng,y,q):od(u,y,q)}},[u,l.lng,y,$,p,O]);const V=u||{},X=b.useRef(null),W=b.useRef(),F=q=>{const ee=Object.getOwnPropertyDescriptors(q);ee.__original&&delete ee.__original;const de=Object.create(Object.getPrototypeOf(q),ee);if(!Object.prototype.hasOwnProperty.call(de,"__original"))try{Object.defineProperty(de,"__original",{value:q,writable:!1,enumerable:!1,configurable:!1})}catch{}return de},E=b.useMemo(()=>{const q=V,ee=q?.language;let de=q;q&&(X.current&&X.current.__original===q?W.current!==ee?(de=F(q),X.current=de,W.current=ee):de=X.current:(de=F(q),X.current=de,W.current=ee));const oe=[Z,de,$];return oe.t=Z,oe.i18n=de,oe.ready=$,oe},[Z,V,$,V.resolvedLanguage,V.language,V.languages]);if(u&&p&&!$)throw new Promise(q=>{const ee=()=>q();l.lng?Ap(u,l.lng,y,ee):od(u,y,ee)});return E},{slice:rv,forEach:sv}=[];function iv(n){return sv.call(rv.call(arguments,1),l=>{if(l)for(const s in l)n[s]===void 0&&(n[s]=l[s])}),n}function ov(n){return typeof n!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(s=>s.test(n))}const Hp=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,cv=function(n,l){const i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},o=encodeURIComponent(l);let u=`${n}=${o}`;if(i.maxAge>0){const m=i.maxAge-0;if(Number.isNaN(m))throw new Error("maxAge should be a Number");u+=`; Max-Age=${Math.floor(m)}`}if(i.domain){if(!Hp.test(i.domain))throw new TypeError("option domain is invalid");u+=`; Domain=${i.domain}`}if(i.path){if(!Hp.test(i.path))throw new TypeError("option path is invalid");u+=`; Path=${i.path}`}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");u+=`; Expires=${i.expires.toUTCString()}`}if(i.httpOnly&&(u+="; HttpOnly"),i.secure&&(u+="; Secure"),i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:u+="; SameSite=Strict";break;case"lax":u+="; SameSite=Lax";break;case"strict":u+="; SameSite=Strict";break;case"none":u+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i.partitioned&&(u+="; Partitioned"),u},Bp={create(n,l,s,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};s&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+s*60*1e3)),i&&(o.domain=i),document.cookie=cv(n,l,o)},read(n){const l=`${n}=`,s=document.cookie.split(";");for(let i=0;i<s.length;i++){let o=s[i];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(l)===0)return o.substring(l.length,o.length)}return null},remove(n,l){this.create(n,"",-1,l)}};var uv={name:"cookie",lookup(n){let{lookupCookie:l}=n;if(l&&typeof document<"u")return Bp.read(l)||void 0},cacheUserLanguage(n,l){let{lookupCookie:s,cookieMinutes:i,cookieDomain:o,cookieOptions:u}=l;s&&typeof document<"u"&&Bp.create(s,n,i,o,u)}},dv={name:"querystring",lookup(n){let{lookupQuerystring:l}=n,s;if(typeof window<"u"){let{search:i}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));const u=i.substring(1).split("&");for(let m=0;m<u.length;m++){const p=u[m].indexOf("=");p>0&&u[m].substring(0,p)===l&&(s=u[m].substring(p+1))}}return s}},fv={name:"hash",lookup(n){let{lookupHash:l,lookupFromHashIndex:s}=n,i;if(typeof window<"u"){const{hash:o}=window.location;if(o&&o.length>2){const u=o.substring(1);if(l){const m=u.split("&");for(let p=0;p<m.length;p++){const g=m[p].indexOf("=");g>0&&m[p].substring(0,g)===l&&(i=m[p].substring(g+1))}}if(i)return i;if(!i&&s>-1){const m=o.match(/\/([a-zA-Z-]*)/g);return Array.isArray(m)?m[typeof s=="number"?s:0]?.replace("/",""):void 0}}}return i}};let Nr=null;const $p=()=>{if(Nr!==null)return Nr;try{if(Nr=typeof window<"u"&&window.localStorage!==null,!Nr)return!1;const n="i18next.translate.boo";window.localStorage.setItem(n,"foo"),window.localStorage.removeItem(n)}catch{Nr=!1}return Nr};var mv={name:"localStorage",lookup(n){let{lookupLocalStorage:l}=n;if(l&&$p())return window.localStorage.getItem(l)||void 0},cacheUserLanguage(n,l){let{lookupLocalStorage:s}=l;s&&$p()&&window.localStorage.setItem(s,n)}};let wr=null;const qp=()=>{if(wr!==null)return wr;try{if(wr=typeof window<"u"&&window.sessionStorage!==null,!wr)return!1;const n="i18next.translate.boo";window.sessionStorage.setItem(n,"foo"),window.sessionStorage.removeItem(n)}catch{wr=!1}return wr};var hv={name:"sessionStorage",lookup(n){let{lookupSessionStorage:l}=n;if(l&&qp())return window.sessionStorage.getItem(l)||void 0},cacheUserLanguage(n,l){let{lookupSessionStorage:s}=l;s&&qp()&&window.sessionStorage.setItem(s,n)}},pv={name:"navigator",lookup(n){const l=[];if(typeof navigator<"u"){const{languages:s,userLanguage:i,language:o}=navigator;if(s)for(let u=0;u<s.length;u++)l.push(s[u]);i&&l.push(i),o&&l.push(o)}return l.length>0?l:void 0}},gv={name:"htmlTag",lookup(n){let{htmlTag:l}=n,s;const i=l||(typeof document<"u"?document.documentElement:null);return i&&typeof i.getAttribute=="function"&&(s=i.getAttribute("lang")),s}},xv={name:"path",lookup(n){let{lookupFromPathIndex:l}=n;if(typeof window>"u")return;const s=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(s)?s[typeof l=="number"?l:0]?.replace("/",""):void 0}},yv={name:"subdomain",lookup(n){let{lookupFromSubdomainIndex:l}=n;const s=typeof l=="number"?l+1:1,i=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(i)return i[s]}};let Ig=!1;try{document.cookie,Ig=!0}catch{}const Wg=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Ig||Wg.splice(1,1);const bv=()=>({order:Wg,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:n=>n});class ex{constructor(l){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(l,s)}init(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=l,this.options=iv(s,this.options||{},bv()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=o=>o.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(uv),this.addDetector(dv),this.addDetector(mv),this.addDetector(hv),this.addDetector(pv),this.addDetector(gv),this.addDetector(xv),this.addDetector(yv),this.addDetector(fv)}addDetector(l){return this.detectors[l.name]=l,this}detect(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,s=[];return l.forEach(i=>{if(this.detectors[i]){let o=this.detectors[i].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(s=s.concat(o))}}),s=s.filter(i=>i!=null&&!ov(i)).map(i=>this.options.convertDetectedLanguage(i)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?s:s.length>0?s[0]:null}cacheUserLanguage(l){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;s&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(l)>-1||s.forEach(i=>{this.detectors[i]&&this.detectors[i].cacheUserLanguage(l,this.options)}))}}ex.type="languageDetector";const vv={"nav.home":"Home","nav.studio":"Studio","nav.docs":"Docs","nav.login":"Login","nav.logout":"Logout","header.status.connected":"Connected","header.status.disconnected":"Disconnected","header.status.reconnecting":"Reconnecting","footer.copyright":"GitHub · @Context4AI {{year}}. All rights reserved.","footer.copyright_compact":"@Context4AI {{year}}. All rights reserved.","footer.tagline":"Knowledge Factory","footer.theme.dark":"Dark","footer.theme.light":"Light","footer.theme.system":"System","studio.sidebar.sources":"Sources","studio.sidebar.modeling":"Modeling","studio.sidebar.brain":"Brain","studio.sidebar.discovery":"Discovery","studio.sidebar.sharing":"Sharing","studio.sidebar.collaboration":"Collaboration","studio.sidebar.settings":"Settings","placeholder.coming":"Coming in {{version}}","page.login.title":"Login","page.login.description":"Authentication and user management.","page.docs.title":"Docs","page.docs.description":"Public documentation portal.","page.sources.title":"Sources","page.sources.description":"Add code repositories, documents, and other input materials for your brain to index.","page.modeling.title":"Modeling","page.modeling.description":"Model indexed content with AI — only what stands up to scrutiny gets written to the knowledge graph.","page.brain.title":"Brain","page.brain.description":"All modeled knowledge lives here — browse, search, analyze, and use it anytime.","page.discovery.title":"Discovery","page.discovery.description":"Explore knowledge curated by others and add what's useful to your own brain.","page.sharing.title":"Sharing","page.sharing.description":"Package and export knowledge from your brain for others and AI to use directly.","page.collaboration.title":"Collaboration","page.collaboration.description":"Stay in sync with other brains — get notified on updates, no manual transfer needed.","page.settings.title":"Settings","page.settings.description":"Manage workspace members and configuration.","page.code_setup.title":"Code Setup","page.code_setup.description":"Repository selection and configuration for code modeling.","page.code_compile.title":"Code Compile","page.code_compile.description":"Compilation progress tracking for code modeling.","page.code_review.title":"Code Review","page.code_review.description":"Review and approve modeling results.","page.code_result.title":"Code Result","page.code_result.description":"View final modeling results and generated knowledge graph.","home.hero.title":"Context For AI","home.hero.description":"Transform code repositories and business documents into structured knowledge graphs.","home.hero.cta.studio":"Enter Studio","home.hero.cta.github":"GitHub","notfound.title":"404","notfound.description":"The page you're looking for doesn't exist.","notfound.back":"Back to Home","error.description":"Something went wrong. Please try again.","error.reload":"Reload","sources.menu.add_client":"Add Client","sources.menu.online":"online","sources.menu.offline":"offline","sources.menu.status_online":"{{machine}} connected","sources.menu.status_offline":"{{machine}} not connected, click for setup guide","sources.library.default_cloud_name":"Personal Cloud","sources.library.rename":"Rename","sources.library.rename_placeholder":"Enter library name","sources.header.daemon_status":"{{online}}/{{total}} online","sources.header.all_offline":"All offline","sources.actions.new_folder":"New Folder","sources.folder.name_placeholder":"Enter folder name","sources.actions.import_repo":"Import Repository","sources.actions.rename":"Rename","sources.actions.move_to":"Move to...","sources.actions.delete":"Delete","sources.filter.all":"All","sources.filter.indexed":"Indexed","sources.filter.not_indexed":"Not Indexed","sources.status.none":"None","sources.status.indexed":"Indexed","sources.status.stale":"Index outdated","sources.status.go_index":"Index","sources.type.code":"Code","sources.type.doc":"Document","sources.empty.cloud.title":"Your personal knowledge input zone","sources.empty.cloud.description":"Create folders to organize your documents and materials. These are visible only to you and will serve as the foundation for building your digital brain.","sources.empty.daemon.title":"Connect your local code assets","sources.empty.daemon.description":"Import local code repositories. The system will automatically extract code structures and technical documents, transforming them into structured knowledge.","sources.empty.indexed.title":"Knowledge not yet indexed","sources.empty.indexed.description":"Select sources and complete indexing. They will be transformed into structured summaries, providing material for your future speculations.","sources.empty.folder.title":"This folder is empty","sources.empty.folder.daemon_description":"You can add or edit documents locally, and they will appear here after the next sync.","sources.safety.notice.repo":"In local mode, your code has absolute privacy. Source code never leaves your computer. The system only extracts structured summaries for knowledge modeling (function signatures, dependencies, etc.).","sources.safety.notice.dir":"The system extracts document content and summaries for knowledge modeling. Although unsafe text is filtered, please ensure sensitive data is not included in indexing or modeling.","sources.import.title":"Import Repository","sources.import.step.select":"Select Repository","sources.import.step.version":"Select Version","sources.import.step.confirm":"Import Complete","sources.import.daemon_offline":"Client {{name}} is not connected. Please start the local Daemon and connect to the server before importing.","sources.import.view_guide":"View Connection Guide","sources.import.select_root":"Select repository root directory","sources.import.current_path":"Current path","sources.import.not_git":"This directory is not a Git repository. Please select a directory containing .git.","sources.import.branch":"Branch","sources.import.commit":"Commit","sources.import.branch_warning":"Currently based on {{branch}} branch HEAD","sources.import.uncommitted_warning":"Uncommitted changes will not be collected","sources.import.recognized":"Recognized {{packages}} packages and {{docs}} documents","sources.import.no_packages":"No package structure detected. Will be imported as a single-package repository.","sources.import.confirm_heading":"About to import the following repository to {{name}}:","sources.import.packages":"Packages","sources.import.documents":"Documents","sources.import.loading_repo":"Loading repository info...","sources.import.loading_repo_slow":"Large repositories (>10 GB) may take 5–10 seconds...","sources.import.importing":"Importing...","sources.import.error_title":"Import Failed","sources.import.success":"Import complete","sources.import.stage.prepare":"Preparing environment","sources.import.stage.clone":"Cloning repository","sources.import.stage.scan":"Scanning project","sources.import.stage.save":"Saving sources","sources.import.stage.done_suffix":"done","sources.import.stage.complete":"Import complete","sources.import.step.loading":"Data Import","sources.import.done":"Done","sources.import.back":"Back","sources.import.retry":"Retry","sources.add_client.title":"Connect Local Knowledge Source","sources.add_client.description":"Start a client (Daemon) on your local computer to mount local code repositories as input material into your digital brain.","sources.add_client.step1":"Install Daemon","sources.add_client.step2":"Start Daemon","sources.add_client.step2_allow":"Restrict access to specific directories (does not affect existing imports)","sources.add_client.step3":"Wait for connection","sources.add_client.step3_desc":"This page will update automatically once connected.","sources.add_client.waiting":"Waiting for new client connection...","sources.add_client.detected":"New client detected","sources.add_client.machine_name":"Machine ID","sources.add_client.os":"Operating system","sources.add_client.daemon_version":"Daemon version","sources.add_client.client_name":"Client name","sources.add_client.confirm":"Confirm Add","sources.add_client.reconnected":"Client {{name}} has reconnected","sources.add_client.go_to":"Go to {{name}}","sources.detail.tab.original":"Original","sources.detail.tab.overview":"Overview","sources.detail.tab.digest":"Digest","sources.detail.tab.modeling":"Modeling Result","sources.detail.digest_placeholder":"Structured summary will be available here after indexing is complete.","sources.detail.modeling_placeholder":"Knowledge entities derived from this source will appear here after modeling in the speculation zone.","sources.detail.type":"Type","sources.detail.origin":"Origin","sources.detail.origin.upload":"Upload","sources.detail.origin.local":"Local file","sources.detail.path":"Path","sources.detail.status":"Status","sources.detail.repo":"Repository","sources.detail.branch":"Branch","sources.detail.commit":"Commit","sources.detail.tech_stack":"Tech stack","sources.detail.original_code_placeholder":"Package overview will be available after indexing.","sources.detail.original_doc_placeholder":"Document content will be available after upload.","sources.detail.dependencies":"Dependencies","sources.delete.confirm_title":"Confirm Delete","sources.delete.resource":"Are you sure you want to delete {{name}}?","sources.delete.resource_impact":"The following data will be permanently deleted: original content, structured digest (if any).","sources.delete.session_warning":"If your personal speculation zone is using this source, related candidate speculations will be affected.","sources.delete.entity_safe":"Formal knowledge already merged into the brain will not be affected.","sources.delete.folder":"Are you sure you want to delete folder {{name}}?","sources.delete.folder_impact":"All resources inside will be recursively deleted: {{folders}} sub-folders, {{sources}} sources.","sources.delete.folder_contents":"Contains {{folders}} sub-folders, {{sources}} sources.","sources.delete.folder_impact_generic":"All sub-folders and resources inside will be recursively deleted.","sources.delete.irreversible":"This action cannot be undone.","sources.delete.repo":"Are you sure you want to remove repository {{name}} from {{library}}?","sources.delete.repo_impact":"Will delete: {{packages}} package index records, {{docs}} document index records.","sources.delete.repo_contents":"Contains {{packages}} packages, {{docs}} documents.","sources.delete.indexed_hint":"{{indexed}}/{{total}} have been indexed; their index data will be deleted.","sources.delete.repo_impact_generic":"All package and document index records will be deleted.","sources.delete.local_safe":"Local files will not be affected.","sources.delete.client":"Are you sure you want to delete client {{name}}?","sources.delete.client_impact":"All imported repository records and related index data under this client will be deleted.","sources.delete.client_reregister":"This client will need to re-register on next connection.","sources.error.name_conflict":'An item named "{{name}}" already exists in this directory.',"sources.move.current":"Current","sources.move.target":"Move to","sources.breadcrumb.sources":"Sources","common.cancel":"Cancel","common.confirm":"Confirm","common.back":"Back","common.next":"Next","common.previous":"Previous","common.items":"{{count}} items","common.loading":"Loading...","sources.import.no_entries":"No entries found","sources.import.allowed_dirs":"Client authorized directories","sources.import.allowed_dirs_tooltip_restrict":"Restrict to specific directories:","sources.import.allowed_dirs_tooltip_all":"Or allow all directories (default):","sources.import.wildcard_home":"Home","sources.import.wildcard_path_placeholder":"Enter a directory path…","sources.import.wildcard_go":"Go","sources.import.wildcard_goto":"Go to","sources.import.wildcard_go_title":"Go to Directory","sources.import.wildcard_path_not_found":"Path does not exist on the remote machine","sources.import.already_imported":"Imported","sources.import.dir_title":"Import Directory","sources.import.dir_step.select":"Select Directory","sources.import.dir_step.scan":"Scan","sources.import.dir_step.confirm":"Confirm Import","sources.import.dir_confirm_heading":"About to import the following directory to {{name}}:","sources.import.dir_name":"Directory Name","sources.import.dir_name_hint":"Display name in the source tree after import. Leave empty to use the default repository name.","sources.import.dir_name_duplicate":"This name already exists. Please use a different name.","sources.import.dir_path":"Directory Path","sources.import.dir_files":"Files","sources.import.dir_subdirs":"Subdirectories","sources.import.dir_git_repos":"Repositories (skipped)","sources.import.dir_git_hint":"Git repositories inside the directory will not be expanded for indexing. Import them separately if needed.","sources.import.dir_scanning":"Scanning directory contents...","sources.import.dir_scan_complete":"Scan complete","sources.import.dir_scan_error":"Failed to scan directory","sources.import.dir_scan_retry":"Retry","sources.import.dir_code_packages":"Code Packages","sources.import.dir_code_packages_tip":"Supported: package.json, pyproject.toml, setup.py, go.mod, Cargo.toml, pom.xml, build.gradle","sources.import.dir_doc_files":"Documents","sources.import.dir_doc_files_tip":"Supported: Markdown (.md)","sources.import.dir_total_files":"Total Files","sources.import.dir_total_dirs":"Directories","sources.import.dir_git_skip_hint":"Git repos are skipped. Use 'Import Repository' instead.","sources.actions.upload":"Upload","sources.actions.upload_md":"Markdown Document","sources.actions.upload_doc":"Document","sources.actions.add":"Add","sources.actions.add_folder":"Folder","sources.actions.add_web":"Web Page","sources.actions.add_feishu":"Feishu Document","sources.actions.import_dir":"Import Directory","sources.actions.import_repo_url":"Import Repository","sources.upgrade.title":"Feature Upgrading","sources.upgrade.description":"This feature will be available in version 0.5.x. Stay tuned.","sources.upload.title":"Upload Documents","sources.upload.drop_hint":"Click to select or drag files here","sources.upload.supported_formats":"Supported: .md, .doc, .docx, .pdf, .ppt, .pptx, .txt (max 5MB each, up to 10 files)","sources.upload.file_too_large":'"{{name}}" exceeds 5MB limit',"sources.upload.too_many_files":"Maximum 10 files allowed, please re-select","sources.upload.unsupported_type":'"{{name}}" is not a supported file type',"sources.upload.uploading":"Uploading...","sources.upload.success":"Uploaded {{count}} documents","sources.upload.selected":"{{count}} files selected","sources.upload.remove":"Remove","sources.import_remote.title":"Import Remote Repository","sources.import_remote.step.loading":"Data Import","sources.import_remote.url_label":"Repository URL","sources.import_remote.url_placeholder":"https://github.com/org/repo.git","sources.import_remote.url_hint_format":"Only HTTPS URLs are accepted. SSH support is planned for a future release","sources.import_remote.url_hint_public":"Supports public Git repositories without authentication, and Git services with OAuth configured: ","sources.import_remote.url_hint_no_auth":"Supports public Git repositories and Git services with OAuth configured","sources.import_remote.url_invalid":"Only HTTPS Git URLs are supported","sources.import_remote.ref_label":"Branch / Tag","sources.import_remote.ref_branches":"Branches","sources.import_remote.ref_tags":"Tags","sources.import_remote.ref_search":"Search branches or tags…","sources.import_remote.commit_label":"Commit","sources.import_remote.commit_hint":"Auto-filled with the latest commit of selected branch. You can also type or search","sources.import_remote.commit_search":"Search commit…","sources.import_remote.loading_refs":"Querying repository branches...","sources.import_remote.loading_refs_slow":"Large projects may take 10–30s, please wait...","sources.import_remote.summary_repo":"Repository","sources.import_remote.summary_branch":"Branch","sources.import_remote.summary_commit":"Commit","sources.import_remote.commit_latest":"(latest)","sources.import_remote.stage.prepare":"Preparing environment","sources.import_remote.stage.clone":"Cloning repository","sources.import_remote.stage.scan":"Scanning project","sources.import_remote.stage.save":"Saving sources","sources.import_remote.complete":"Import complete","sources.import_remote.back_to_library":"Done","sources.import_remote.retry":"Retry","sources.import_remote.back":"Back","sources.import_remote.error.auth_required":"This repository requires authentication. Please configure an access token for {{host}} in Server Settings → Git Tokens.","sources.import_remote.error.auth_failed":"Authentication failed. Please check your Git token configuration.","sources.import_remote.error.not_found":"Repository not found or no access. Please check the URL.","sources.import_remote.error.network":"Cannot connect to the remote repository. Please check your network or try again later.","sources.import_remote.error.capacity":"Import queue is full. Please try again later.","sources.import_remote.error.clone_failed":"Clone failed","sources.import_remote.error.scan_failed":"Scan failed","sources.import_remote.error.save_failed":"Save failed","sources.change_detection.has_updates":"Has updates","sources.change_detection.reimport":"Re-import","sources.safety.notice.remote":"The remote repository will be cloned to the server for analysis. Code will not be uploaded to any third-party services."},Sv={"nav.home":"首页","nav.studio":"工作台","nav.docs":"文档","nav.login":"登录","nav.logout":"退出登录","header.status.connected":"已连接","header.status.disconnected":"已断开","header.status.reconnecting":"重连中","footer.copyright":"GitHub · @Context4AI {{year}}. 版权所有","footer.copyright_compact":"@Context4AI {{year}}. 版权所有","footer.tagline":"知识工厂","footer.theme.dark":"暗色","footer.theme.light":"亮色","footer.theme.system":"跟随系统","studio.sidebar.sources":"知识索引","studio.sidebar.modeling":"知识建模","studio.sidebar.brain":"知识大脑","studio.sidebar.discovery":"发现知识","studio.sidebar.sharing":"分享知识","studio.sidebar.collaboration":"知识协同","studio.sidebar.settings":"设置","placeholder.coming":"计划在 {{version}} 版本实现","page.login.title":"登录","page.login.description":"身份验证与用户管理。","page.docs.title":"文档","page.docs.description":"公开文档门户。","page.sources.title":"知识索引","page.sources.description":"添加代码仓库、文档等输入材料,让大脑完成初步索引。","page.modeling.title":"知识建模","page.modeling.description":"和 AI 一起对索引内容建模,只有经得起推敲的才写入知识图谱。","page.brain.title":"知识大脑","page.brain.description":"建模完成的全部知识都在这里——浏览、搜索、分析,随时调用。","page.discovery.title":"发现知识","page.discovery.description":"看看别人整理好的知识,发现有用的一键补充到自己的大脑。","page.sharing.title":"分享知识","page.sharing.description":"把大脑中的知识打包输出,让别人和 AI 都能直接使用。","page.collaboration.title":"知识协同","page.collaboration.description":"和其他大脑保持同步,知识更新时自动通知,不用手动搬运。","page.settings.title":"设置","page.settings.description":"管理大脑的成员和配置。","page.code_setup.title":"代码设置","page.code_setup.description":"代码建模的仓库选择与配置。","page.code_compile.title":"代码编译","page.code_compile.description":"代码建模的编译进度追踪。","page.code_review.title":"代码审查","page.code_review.description":"审查并确认建模结果。","page.code_result.title":"代码结果","page.code_result.description":"查看最终建模结果与生成的知识图谱。","home.hero.title":"Context For AI","home.hero.description":"将代码仓库和业务文档转化为结构化知识图谱。","home.hero.cta.studio":"进入工作台","home.hero.cta.github":"GitHub","notfound.title":"404","notfound.description":"您访问的页面不存在。","notfound.back":"返回首页","error.description":"页面出现了问题,请重试。","error.reload":"重新加载","sources.menu.add_client":"添加客户端","sources.menu.online":"在线","sources.menu.offline":"离线","sources.menu.status_online":"{{machine}} 已连接","sources.menu.status_offline":"{{machine}} 未连接,点击前往教程","sources.library.default_cloud_name":"个人云","sources.library.rename":"重命名","sources.library.rename_placeholder":"输入名称","sources.header.daemon_status":"{{online}}/{{total}} 在线","sources.header.all_offline":"全部离线","sources.actions.new_folder":"新文件夹","sources.folder.name_placeholder":"输入文件夹名称","sources.actions.import_repo":"导入仓库","sources.actions.rename":"重命名","sources.actions.move_to":"移动到...","sources.actions.delete":"删除","sources.filter.all":"全部","sources.filter.indexed":"已索引","sources.filter.not_indexed":"未索引","sources.status.none":"未索引","sources.status.indexed":"已索引","sources.status.stale":"有新变更未更新索引","sources.status.go_index":"去索引","sources.type.code":"代码","sources.type.doc":"文档","sources.empty.cloud.title":"这里是你专属的知识输入区","sources.empty.cloud.description":"创建文件夹来整理你的文档和材料。这些内容仅你个人可见,将成为后续推演、构建数字大脑的基础。","sources.empty.daemon.title":"连接你的本地代码资产","sources.empty.daemon.description":"导入本地代码仓库,系统会自动提取代码结构与技术文档,将其转化为结构化知识。","sources.empty.indexed.title":"这些知识尚未被索引","sources.empty.indexed.description":"选择资源并完成索引后,它们将转化为结构化摘要,为你后续的推演提供素材。","sources.empty.folder.title":"当前文件夹还没有内容","sources.empty.folder.daemon_description":"你可以在本地进行文档新增、编辑后查看。","sources.safety.notice.repo":"在本地模式下,你的代码保有绝对隐私,源代码永远不会离开你的电脑,系统仅提取用于知识建模的结构化摘要(函数签名、依赖关系等)。","sources.safety.notice.dir":"系统会提取用于知识建模的文档内容及摘要,尽管会过滤不安全的文本内容,但请确保敏感数据不要参与索引及建模。","sources.import.title":"导入代码仓库","sources.import.step.select":"选择仓库","sources.import.step.version":"选择版本","sources.import.step.confirm":"导入完成","sources.import.daemon_offline":"客户端 {{name}} 未连接,请先启动本地 Daemon 并连接到服务器后再导入仓库。","sources.import.view_guide":"查看连接指引","sources.import.select_root":"选择仓库根目录","sources.import.current_path":"当前路径","sources.import.not_git":"该目录不是 Git 仓库,请选择包含 .git 的目录。","sources.import.branch":"分支","sources.import.commit":"提交","sources.import.branch_warning":"当前基于 {{branch}} 分支的 HEAD","sources.import.uncommitted_warning":"未提交的修改不会被采集","sources.import.recognized":"已识别 {{packages}} 个包和 {{docs}} 篇文档","sources.import.no_packages":"未识别到包结构,将作为单包仓库导入。","sources.import.confirm_heading":"即将导入以下仓库到 {{name}}:","sources.import.packages":"包数","sources.import.documents":"文档","sources.import.loading_repo":"正在加载仓库信息...","sources.import.loading_repo_slow":"大型仓库(>10 GB)可能需要 5~10 秒...","sources.import.importing":"导入中...","sources.import.error_title":"导入失败","sources.import.success":"导入完成","sources.import.stage.prepare":"准备执行环境","sources.import.stage.clone":"克隆仓库","sources.import.stage.scan":"扫描项目","sources.import.stage.save":"保存数据源","sources.import.stage.done_suffix":"✓","sources.import.stage.complete":"导入完成","sources.import.step.loading":"数据导入","sources.import.done":"完成","sources.import.back":"返回","sources.import.retry":"重试","sources.add_client.title":"接入本地知识源","sources.add_client.description":"在本地计算机上启动客户端 (Daemon),即可将本地代码仓库作为输入材料,挂载到你的数字大脑中。","sources.add_client.step1":"安装 Daemon","sources.add_client.step2":"启动 Daemon","sources.add_client.step2_allow":"限制访问目录(不影响已有导入)","sources.add_client.step3":"等待连接","sources.add_client.step3_desc":"连接成功后,本页面将自动更新。","sources.add_client.waiting":"等待新的客户端连接...","sources.add_client.detected":"检测到新的本地客户端","sources.add_client.machine_name":"机器标识","sources.add_client.os":"操作系统","sources.add_client.daemon_version":"Daemon 版本","sources.add_client.client_name":"客户端名称","sources.add_client.confirm":"确认添加","sources.add_client.reconnected":"客户端 {{name}} 已重新连接","sources.add_client.go_to":"前往 {{name}}","sources.detail.tab.original":"原文","sources.detail.tab.overview":"概览","sources.detail.tab.digest":"摘要","sources.detail.tab.modeling":"建模结果","sources.detail.digest_placeholder":"完成索引后,即可在此查看结构化摘要。","sources.detail.modeling_placeholder":"在推演区完成建模后,此处将展示由该源产生的知识实体。","sources.detail.type":"类型","sources.detail.origin":"来源","sources.detail.origin.upload":"直接上传","sources.detail.origin.local":"本地文件","sources.detail.path":"路径","sources.detail.status":"状态","sources.detail.repo":"仓库","sources.detail.branch":"分支","sources.detail.commit":"提交","sources.detail.tech_stack":"技术栈","sources.detail.original_code_placeholder":"完成索引后即可查看包概览。","sources.detail.original_doc_placeholder":"文档内容将在上传后展示。","sources.detail.dependencies":"依赖","sources.delete.confirm_title":"确认删除","sources.delete.resource":"确定要删除 {{name}}?","sources.delete.resource_impact":"以下数据将被永久删除:原文内容、结构化摘要(如有)。","sources.delete.session_warning":"如果你的个人推演区正在使用此知识源,相关的候选推演将受到影响。","sources.delete.entity_safe":"已汇入大脑的正式知识不受影响。","sources.delete.folder":"确定要删除文件夹 {{name}}?","sources.delete.folder_impact":"文件夹内的所有资源将被递归删除:{{folders}} 个子文件夹、{{sources}} 个知识源。","sources.delete.folder_contents":"包含 {{folders}} 个子文件夹、{{sources}} 个知识源。","sources.delete.folder_impact_generic":"文件夹内的所有子文件夹和知识源将被递归删除。","sources.delete.irreversible":"此操作不可撤销。","sources.delete.repo":"确定要从 {{library}} 中移除仓库 {{name}}?","sources.delete.repo_impact":"将删除:{{packages}} 个包的索引记录、{{docs}} 篇文档的索引记录。","sources.delete.repo_contents":"包含 {{packages}} 个包、{{docs}} 个文档。","sources.delete.indexed_hint":"其中 {{indexed}}/{{total}} 个已建立索引,索引数据将被删除。","sources.delete.repo_impact_generic":"所有包和文档的索引记录将被删除。","sources.delete.local_safe":"本地文件不受影响。","sources.delete.client":"确定要删除客户端 {{name}}?","sources.delete.client_impact":"该客户端下的所有已导入仓库记录和相关索引数据将被删除。","sources.delete.client_reregister":"该客户端下次连接时将触发重新注册。","sources.error.name_conflict":'该目录下已存在同名项"{{name}}"。',"sources.move.current":"当前位置","sources.move.target":"移动到","sources.breadcrumb.sources":"知识索引","common.cancel":"取消","common.confirm":"确认","common.back":"返回","common.next":"下一步","common.previous":"上一步","common.items":"{{count}} 项","common.loading":"加载中...","sources.import.no_entries":"未找到任何条目","sources.import.allowed_dirs":"客户端授权目录","sources.import.allowed_dirs_tooltip_restrict":"通过参数设定有权限的目录:","sources.import.allowed_dirs_tooltip_all":"或默认允许全部目录:","sources.import.wildcard_home":"主目录","sources.import.wildcard_path_placeholder":"输入目录路径…","sources.import.wildcard_go":"前往","sources.import.wildcard_goto":"前往","sources.import.wildcard_go_title":"前往目录","sources.import.wildcard_path_not_found":"该路径在远程机器上不存在","sources.import.already_imported":"已导入","sources.import.dir_title":"导入目录","sources.import.dir_step.select":"选择目录","sources.import.dir_step.scan":"扫描","sources.import.dir_step.confirm":"确认导入","sources.import.dir_confirm_heading":"即将导入以下目录到 {{name}}:","sources.import.dir_name":"目录名","sources.import.dir_name_hint":"导入后在目录树中的显示名称,留空使用默认仓库名。","sources.import.dir_name_duplicate":"该名称已存在,请使用其他名称。","sources.import.dir_path":"目录路径","sources.import.dir_files":"文件数","sources.import.dir_subdirs":"子目录数","sources.import.dir_git_repos":"仓库(已跳过)","sources.import.dir_git_hint":"目录内的 Git 仓库不会被展开索引,如需索引请单独导入仓库。","sources.import.dir_scanning":"正在扫描目录内容...","sources.import.dir_scan_complete":"扫描完成","sources.import.dir_scan_error":"目录扫描失败","sources.import.dir_scan_retry":"重试","sources.import.dir_code_packages":"代码包","sources.import.dir_code_packages_tip":"支持:package.json、pyproject.toml、setup.py、go.mod、Cargo.toml、pom.xml、build.gradle","sources.import.dir_doc_files":"文档","sources.import.dir_doc_files_tip":"支持:Markdown (.md)","sources.import.dir_total_files":"文件总数","sources.import.dir_total_dirs":"目录","sources.import.dir_git_skip_hint":"Git 仓库将被跳过,建议单独使用「导入仓库」。","sources.actions.upload":"上传","sources.actions.upload_md":"Markdown 文档","sources.actions.upload_doc":"文档","sources.actions.add":"新增","sources.actions.add_folder":"文件夹","sources.actions.add_web":"网页","sources.actions.add_feishu":"飞书文档","sources.actions.import_dir":"导入目录","sources.actions.import_repo_url":"导入仓库","sources.upgrade.title":"功能升级中","sources.upgrade.description":"此功能将在 0.5.x 版本中推出,敬请期待。","sources.upload.title":"上传文档","sources.upload.drop_hint":"点击选择文件或拖拽至此","sources.upload.supported_formats":"支持格式:.md, .doc, .docx, .pdf, .ppt, .pptx, .txt(每个最大 5MB,最多 10 个)","sources.upload.file_too_large":'"{{name}}" 超过 5MB 限制',"sources.upload.too_many_files":"最多上传 10 个文件,请重新选择","sources.upload.unsupported_type":'"{{name}}" 不是支持的文件类型',"sources.upload.uploading":"上传中...","sources.upload.success":"已上传 {{count}} 个文档","sources.upload.selected":"已选择 {{count}} 个文件","sources.upload.remove":"移除","sources.import_remote.title":"导入远程仓库","sources.import_remote.step.loading":"数据导入","sources.import_remote.url_label":"仓库地址","sources.import_remote.url_placeholder":"https://github.com/org/repo.git","sources.import_remote.url_hint_format":"仅接受 HTTPS 地址,SSH 地址未来版本支持","sources.import_remote.url_hint_public":"除了支持无需鉴权的公开 Git 仓库,也支持已配置 OAuth 的 Git 服务:","sources.import_remote.url_hint_no_auth":"除了支持无需鉴权的公开 Git 仓库,也支持已配置 OAuth 的 Git 服务","sources.import_remote.url_invalid":"仅支持 HTTPS 格式的 Git URL","sources.import_remote.ref_label":"分支 / Tag","sources.import_remote.ref_branches":"分支","sources.import_remote.ref_tags":"Tag","sources.import_remote.ref_search":"搜索分支或 Tag…","sources.import_remote.commit_label":"Commit","sources.import_remote.commit_hint":"已自动填入所选分支最新 commit,也可手动输入或搜索","sources.import_remote.commit_search":"搜索 commit…","sources.import_remote.loading_refs":"正在查询仓库分支...","sources.import_remote.loading_refs_slow":"大型项目可能需要 10~30s,请耐心等待...","sources.import_remote.summary_repo":"仓库","sources.import_remote.summary_branch":"分支","sources.import_remote.summary_commit":"Commit","sources.import_remote.commit_latest":"(latest)","sources.import_remote.stage.prepare":"准备执行环境","sources.import_remote.stage.clone":"克隆仓库","sources.import_remote.stage.scan":"识别项目结构","sources.import_remote.stage.save":"写入知识源","sources.import_remote.complete":"导入完成","sources.import_remote.back_to_library":"完成","sources.import_remote.retry":"重试","sources.import_remote.back":"返回","sources.import_remote.error.auth_required":"该仓库需要认证。请在 服务设置 → Git 令牌 中配置 {{host}} 的访问令牌。","sources.import_remote.error.auth_failed":"认证失败,请检查 Git 令牌配置。","sources.import_remote.error.not_found":"仓库不存在或无权访问。请检查 URL 是否正确。","sources.import_remote.error.network":"无法连接到远程仓库。请检查网络或稍后重试。","sources.import_remote.error.capacity":"当前导入任务已满,请稍后再试。","sources.import_remote.error.clone_failed":"克隆失败","sources.import_remote.error.scan_failed":"识别失败","sources.import_remote.error.save_failed":"写入失败","sources.change_detection.has_updates":"有更新","sources.change_detection.reimport":"重新导入","sources.safety.notice.remote":"远程仓库将被克隆到服务器本地进行分析,代码不会上传到任何第三方服务。"};fa.use(ex).use(Jb).init({resources:{en:{translation:vv},zh:{translation:Sv}},fallbackLng:"en",interpolation:{escapeValue:!1},detection:{order:["localStorage"],caches:["localStorage"],lookupLocalStorage:"lang"}});var Gu={exports:{}},ws={},Vu={exports:{}},Ku={};var Yp;function _v(){return Yp||(Yp=1,(function(n){function l(k,P){var fe=k.length;k.push(P);e:for(;0<fe;){var me=fe-1>>>1,le=k[me];if(0<o(le,P))k[me]=P,k[fe]=le,fe=me;else break e}}function s(k){return k.length===0?null:k[0]}function i(k){if(k.length===0)return null;var P=k[0],fe=k.pop();if(fe!==P){k[0]=fe;e:for(var me=0,le=k.length,w=le>>>1;me<w;){var B=2*(me+1)-1,te=k[B],ae=B+1,xe=k[ae];if(0>o(te,fe))ae<le&&0>o(xe,te)?(k[me]=xe,k[ae]=fe,me=ae):(k[me]=te,k[B]=fe,me=B);else if(ae<le&&0>o(xe,fe))k[me]=xe,k[ae]=fe,me=ae;else break e}}return P}function o(k,P){var fe=k.sortIndex-P.sortIndex;return fe!==0?fe:k.id-P.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var m=Date,p=m.now();n.unstable_now=function(){return m.now()-p}}var g=[],h=[],v=1,y=null,_=3,j=!1,N=!1,T=!1,O=!1,G=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function V(k){for(var P=s(h);P!==null;){if(P.callback===null)i(h);else if(P.startTime<=k)i(h),P.sortIndex=P.expirationTime,l(g,P);else break;P=s(h)}}function X(k){if(T=!1,V(k),!N)if(s(g)!==null)N=!0,W||(W=!0,oe());else{var P=s(h);P!==null&&ge(X,P.startTime-k)}}var W=!1,F=-1,E=5,q=-1;function ee(){return O?!0:!(n.unstable_now()-q<E)}function de(){if(O=!1,W){var k=n.unstable_now();q=k;var P=!0;try{e:{N=!1,T&&(T=!1,Z(F),F=-1),j=!0;var fe=_;try{t:{for(V(k),y=s(g);y!==null&&!(y.expirationTime>k&&ee());){var me=y.callback;if(typeof me=="function"){y.callback=null,_=y.priorityLevel;var le=me(y.expirationTime<=k);if(k=n.unstable_now(),typeof le=="function"){y.callback=le,V(k),P=!0;break t}y===s(g)&&i(g),V(k)}else i(g);y=s(g)}if(y!==null)P=!0;else{var w=s(h);w!==null&&ge(X,w.startTime-k),P=!1}}break e}finally{y=null,_=fe,j=!1}P=void 0}}finally{P?oe():W=!1}}}var oe;if(typeof $=="function")oe=function(){$(de)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,ue=re.port2;re.port1.onmessage=de,oe=function(){ue.postMessage(null)}}else oe=function(){G(de,0)};function ge(k,P){F=G(function(){k(n.unstable_now())},P)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(k){k.callback=null},n.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<k?Math.floor(1e3/k):5},n.unstable_getCurrentPriorityLevel=function(){return _},n.unstable_next=function(k){switch(_){case 1:case 2:case 3:var P=3;break;default:P=_}var fe=_;_=P;try{return k()}finally{_=fe}},n.unstable_requestPaint=function(){O=!0},n.unstable_runWithPriority=function(k,P){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var fe=_;_=k;try{return P()}finally{_=fe}},n.unstable_scheduleCallback=function(k,P,fe){var me=n.unstable_now();switch(typeof fe=="object"&&fe!==null?(fe=fe.delay,fe=typeof fe=="number"&&0<fe?me+fe:me):fe=me,k){case 1:var le=-1;break;case 2:le=250;break;case 5:le=1073741823;break;case 4:le=1e4;break;default:le=5e3}return le=fe+le,k={id:v++,callback:P,priorityLevel:k,startTime:fe,expirationTime:le,sortIndex:-1},fe>me?(k.sortIndex=fe,l(h,k),s(g)===null&&k===s(h)&&(T?(Z(F),F=-1):T=!0,ge(X,fe-me))):(k.sortIndex=le,l(g,k),N||j||(N=!0,W||(W=!0,oe()))),k},n.unstable_shouldYield=ee,n.unstable_wrapCallback=function(k){var P=_;return function(){var fe=_;_=P;try{return k.apply(this,arguments)}finally{_=fe}}}})(Ku)),Ku}var Gp;function jv(){return Gp||(Gp=1,Vu.exports=_v()),Vu.exports}var Xu={exports:{}},na={};var Vp;function Nv(){if(Vp)return na;Vp=1;var n=So();function l(g){var h="https://react.dev/errors/"+g;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)h+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+g+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var i={d:{f:s,r:function(){throw Error(l(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(g,h,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:y==null?null:""+y,children:g,containerInfo:h,implementation:v}}var m=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,h){if(g==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return na.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,na.createPortal=function(g,h){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(l(299));return u(g,h,null,v)},na.flushSync=function(g){var h=m.T,v=i.p;try{if(m.T=null,i.p=2,g)return g()}finally{m.T=h,i.p=v,i.d.f()}},na.preconnect=function(g,h){typeof g=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(g,h))},na.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},na.preinit=function(g,h){if(typeof g=="string"&&h&&typeof h.as=="string"){var v=h.as,y=p(v,h.crossOrigin),_=typeof h.integrity=="string"?h.integrity:void 0,j=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;v==="style"?i.d.S(g,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:y,integrity:_,fetchPriority:j}):v==="script"&&i.d.X(g,{crossOrigin:y,integrity:_,fetchPriority:j,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},na.preinitModule=function(g,h){if(typeof g=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var v=p(h.as,h.crossOrigin);i.d.M(g,{crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(g)},na.preload=function(g,h){if(typeof g=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var v=h.as,y=p(v,h.crossOrigin);i.d.L(g,v,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},na.preloadModule=function(g,h){if(typeof g=="string")if(h){var v=p(h.as,h.crossOrigin);i.d.m(g,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(g)},na.requestFormReset=function(g){i.d.r(g)},na.unstable_batchedUpdates=function(g,h){return g(h)},na.useFormState=function(g,h,v){return m.H.useFormState(g,h,v)},na.useFormStatus=function(){return m.H.useHostTransitionStatus()},na.version="19.2.4",na}var Kp;function wv(){if(Kp)return Xu.exports;Kp=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Xu.exports=Nv(),Xu.exports}var Xp;function Ev(){if(Xp)return ws;Xp=1;var n=jv(),l=So(),s=wv();function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function m(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(u(e)!==e)throw Error(i(188))}function h(e){var t=e.alternate;if(!t){if(t=u(e),t===null)throw Error(i(188));return t!==e?null:e}for(var a=e,r=t;;){var c=a.return;if(c===null)break;var d=c.alternate;if(d===null){if(r=c.return,r!==null){a=r;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===a)return g(c),e;if(d===r)return g(c),t;d=d.sibling}throw Error(i(188))}if(a.return!==r.return)a=c,r=d;else{for(var x=!1,S=c.child;S;){if(S===a){x=!0,a=c,r=d;break}if(S===r){x=!0,r=c,a=d;break}S=S.sibling}if(!x){for(S=d.child;S;){if(S===a){x=!0,a=d,r=c;break}if(S===r){x=!0,r=d,a=c;break}S=S.sibling}if(!x)throw Error(i(189))}}if(a.alternate!==r)throw Error(i(190))}if(a.tag!==3)throw Error(i(188));return a.stateNode.current===a?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,_=Symbol.for("react.element"),j=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),Z=Symbol.for("react.consumer"),$=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),ee=Symbol.for("react.memo_cache_sentinel"),de=Symbol.iterator;function oe(e){return e===null||typeof e!="object"?null:(e=de&&e[de]||e["@@iterator"],typeof e=="function"?e:null)}var re=Symbol.for("react.client.reference");function ue(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case G:return"Profiler";case O:return"StrictMode";case X:return"Suspense";case W:return"SuspenseList";case q:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case $:return e.displayName||"Context";case Z:return(e._context.displayName||"Context")+".Consumer";case V:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case F:return t=e.displayName||null,t!==null?t:ue(e.type)||"Memo";case E:t=e._payload,e=e._init;try{return ue(e(t))}catch{}}return null}var ge=Array.isArray,k=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe={pending:!1,data:null,method:null,action:null},me=[],le=-1;function w(e){return{current:e}}function B(e){0>le||(e.current=me[le],me[le]=null,le--)}function te(e,t){le++,me[le]=e.current,e.current=t}var ae=w(null),xe=w(null),ve=w(null),ze=w(null);function Pe(e,t){switch(te(ve,t),te(xe,e),te(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?$h(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=$h(t),e=qh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}B(ae),te(ae,e)}function Xe(){B(ae),B(xe),B(ve)}function Wt(e){e.memoizedState!==null&&te(ze,e);var t=ae.current,a=qh(t,e.type);t!==a&&(te(xe,e),te(ae,a))}function ma(e){xe.current===e&&(B(ae),B(xe)),ze.current===e&&(B(ze),bs._currentValue=fe)}var Qe,tt;function dt(e){if(Qe===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Qe=t&&t[1]||"",tt=-1<a.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+Qe+e+tt}var $t=!1;function Gt(e,t){if(!e||$t)return"";$t=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var I=function(){throw Error()};if(Object.defineProperty(I.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(I,[])}catch(Y){var U=Y}Reflect.construct(e,[],I)}else{try{I.call()}catch(Y){U=Y}e.call(I.prototype)}}else{try{throw Error()}catch(Y){U=Y}(I=e())&&typeof I.catch=="function"&&I.catch(function(){})}}catch(Y){if(Y&&U&&typeof Y.stack=="string")return[Y.stack,U.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=r.DetermineComponentFrameRoot(),x=d[0],S=d[1];if(x&&S){var R=x.split(`
4
+ `),L=S.split(`
5
+ `);for(c=r=0;r<R.length&&!R[r].includes("DetermineComponentFrameRoot");)r++;for(;c<L.length&&!L[c].includes("DetermineComponentFrameRoot");)c++;if(r===R.length||c===L.length)for(r=R.length-1,c=L.length-1;1<=r&&0<=c&&R[r]!==L[c];)c--;for(;1<=r&&0<=c;r--,c--)if(R[r]!==L[c]){if(r!==1||c!==1)do if(r--,c--,0>c||R[r]!==L[c]){var Q=`
6
+ `+R[r].replace(" at new "," at ");return e.displayName&&Q.includes("<anonymous>")&&(Q=Q.replace("<anonymous>",e.displayName)),Q}while(1<=r&&0<=c);break}}}finally{$t=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?dt(a):""}function ea(e,t){switch(e.tag){case 26:case 27:case 5:return dt(e.type);case 16:return dt("Lazy");case 13:return e.child!==t&&t!==null?dt("Suspense Fallback"):dt("Suspense");case 19:return dt("SuspenseList");case 0:case 15:return Gt(e.type,!1);case 11:return Gt(e.type.render,!1);case 1:return Gt(e.type,!0);case 31:return dt("Activity");default:return""}}function ta(e){try{var t="",a=null;do t+=ea(e,a),a=e,e=e.return;while(e);return t}catch(r){return`
7
+ Error generating stack: `+r.message+`
8
+ `+r.stack}}var Sa=Object.prototype.hasOwnProperty,_a=n.unstable_scheduleCallback,ka=n.unstable_cancelCallback,ra=n.unstable_shouldYield,sa=n.unstable_requestPaint,ht=n.unstable_now,ia=n.unstable_getCurrentPriorityLevel,Se=n.unstable_ImmediatePriority,ke=n.unstable_UserBlockingPriority,Ze=n.unstable_NormalPriority,pt=n.unstable_LowPriority,Nt=n.unstable_IdlePriority,Xt=n.log,Ja=n.unstable_setDisableYieldValue,Qt=null,Tt=null;function gt(e){if(typeof Xt=="function"&&Ja(e),Tt&&typeof Tt.setStrictMode=="function")try{Tt.setStrictMode(Qt,e)}catch{}}var Mt=Math.clz32?Math.clz32:Ie,Ce=Math.log,Ae=Math.LN2;function Ie(e){return e>>>=0,e===0?32:31-(Ce(e)/Ae|0)|0}var K=256,se=262144,De=4194304;function $e(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ue(e,t,a){var r=e.pendingLanes;if(r===0)return 0;var c=0,d=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var S=r&134217727;return S!==0?(r=S&~d,r!==0?c=$e(r):(x&=S,x!==0?c=$e(x):a||(a=S&~e,a!==0&&(c=$e(a))))):(S=r&~d,S!==0?c=$e(S):x!==0?c=$e(x):a||(a=r&~e,a!==0&&(c=$e(a)))),c===0?0:t!==0&&t!==c&&(t&d)===0&&(d=c&-c,a=t&-t,d>=a||d===32&&(a&4194048)!==0)?t:c}function kt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function oa(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ca(){var e=De;return De<<=1,(De&62914560)===0&&(De=4194304),e}function Aa(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function ja(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function dl(e,t,a,r,c,d){var x=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var S=e.entanglements,R=e.expirationTimes,L=e.hiddenUpdates;for(a=x&~a;0<a;){var Q=31-Mt(a),I=1<<Q;S[Q]=0,R[Q]=-1;var U=L[Q];if(U!==null)for(L[Q]=null,Q=0;Q<U.length;Q++){var Y=U[Q];Y!==null&&(Y.lane&=-536870913)}a&=~I}r!==0&&$l(e,r,0),d!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=d&~(x&~t))}function $l(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Mt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|a&261930}function ql(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-Mt(a),c=1<<r;c&t|e[r]&t&&(e[r]|=t),a&=~c}}function C(e,t){var a=t&-t;return a=(a&42)!==0?1:D(a),(a&(e.suspendedLanes|t))!==0?0:a}function D(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function H(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ne(){var e=P.p;return e!==0?e:(e=window.event,e===void 0?32:up(e.type))}function ie(e,t){var a=P.p;try{return P.p=e,t()}finally{P.p=a}}var ye=Math.random().toString(36).slice(2),ce="__reactFiber$"+ye,he="__reactProps$"+ye,pe="__reactContainer$"+ye,Ne="__reactEvents$"+ye,Ee="__reactListeners$"+ye,je="__reactHandles$"+ye,at="__reactResources$"+ye,Ye="__reactMarker$"+ye;function ft(e){delete e[ce],delete e[he],delete e[Ne],delete e[Ee],delete e[je]}function yt(e){var t=e[ce];if(t)return t;for(var a=e.parentNode;a;){if(t=a[pe]||a[ce]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Zh(e);e!==null;){if(a=e[ce])return a;e=Zh(e)}return t}e=a,a=e.parentNode}return null}function wt(e){if(e=e[ce]||e[pe]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function et(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function qt(e){var t=e[at];return t||(t=e[at]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function xt(e){e[Ye]=!0}var An=new Set,Pa={};function Vt(e,t){ln(e,t),ln(e+"Capture",t)}function ln(e,t){for(Pa[e]=t,e=0;e<t.length;e++)An.add(t[e])}var fl=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),rn={},ml={};function Yl(e){return Sa.call(ml,e)?!0:Sa.call(rn,e)?!1:fl.test(e)?ml[e]=!0:(rn[e]=!0,!1)}function Ge(e,t,a){if(Yl(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function zt(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function aa(e,t,a,r){if(r===null)e.removeAttribute(a);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+r)}}function At(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function bt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Gl(e,t,a){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var c=r.get,d=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(x){a=""+x,d.call(this,x)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(x){a=""+x},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Vl(e){if(!e._valueTracker){var t=bt(e)?"checked":"value";e._valueTracker=Gl(e,t,""+e[t])}}function Xs(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=bt(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function Qs(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var ry=/[\n"\\]/g;function La(e){return e.replace(ry,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function zo(e,t,a,r,c,d,x,S){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),t!=null?x==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+At(t)):e.value!==""+At(t)&&(e.value=""+At(t)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),t!=null?Oo(e,x,At(t)):a!=null?Oo(e,x,At(a)):r!=null&&e.removeAttribute("value"),c==null&&d!=null&&(e.defaultChecked=!!d),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.name=""+At(S):e.removeAttribute("name")}function Md(e,t,a,r,c,d,x,S){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||a!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){Vl(e);return}a=a!=null?""+At(a):"",t=t!=null?""+At(t):a,S||t===e.value||(e.value=t),e.defaultValue=t}r=r??c,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=S?e.checked:!!r,e.defaultChecked=!!r,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),Vl(e)}function Oo(e,t,a){t==="number"&&Qs(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Kl(e,t,a,r){if(e=e.options,t){t={};for(var c=0;c<a.length;c++)t["$"+a[c]]=!0;for(a=0;a<e.length;a++)c=t.hasOwnProperty("$"+e[a].value),e[a].selected!==c&&(e[a].selected=c),c&&r&&(e[a].defaultSelected=!0)}else{for(a=""+At(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,r&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function kd(e,t,a){if(t!=null&&(t=""+At(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+At(a):""}function Ad(e,t,a,r){if(t==null){if(r!=null){if(a!=null)throw Error(i(92));if(ge(r)){if(1<r.length)throw Error(i(93));r=r[0]}a=r}a==null&&(a=""),t=a}a=At(t),e.defaultValue=a,r=e.textContent,r===a&&r!==""&&r!==null&&(e.value=r),Vl(e)}function Xl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var sy=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Ld(e,t,a){var r=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,a):typeof a!="number"||a===0||sy.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Ud(e,t,a){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,a!=null){for(var r in a)!a.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var c in t)r=t[c],t.hasOwnProperty(c)&&a[c]!==r&&Ld(e,c,r)}else for(var d in t)t.hasOwnProperty(d)&&Ld(e,d,t[d])}function Do(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var iy=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),oy=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Zs(e){return oy.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function hn(){}var Mo=null;function ko(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ql=null,Zl=null;function Hd(e){var t=wt(e);if(t&&(e=t.stateNode)){var a=e[he]||null;e:switch(e=t.stateNode,t.type){case"input":if(zo(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+La(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var c=r[he]||null;if(!c)throw Error(i(90));zo(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<a.length;t++)r=a[t],r.form===e.form&&Xs(r)}break e;case"textarea":kd(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Kl(e,!!a.multiple,t,!1)}}}var Ao=!1;function Bd(e,t,a){if(Ao)return e(t,a);Ao=!0;try{var r=e(t);return r}finally{if(Ao=!1,(Ql!==null||Zl!==null)&&(Ai(),Ql&&(t=Ql,e=Zl,Zl=Ql=null,Hd(t),e)))for(t=0;t<e.length;t++)Hd(e[t])}}function Lr(e,t){var a=e.stateNode;if(a===null)return null;var r=a[he]||null;if(r===null)return null;a=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(i(231,t,typeof a));return a}var pn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Lo=!1;if(pn)try{var Ur={};Object.defineProperty(Ur,"passive",{get:function(){Lo=!0}}),window.addEventListener("test",Ur,Ur),window.removeEventListener("test",Ur,Ur)}catch{Lo=!1}var Ln=null,Uo=null,Fs=null;function $d(){if(Fs)return Fs;var e,t=Uo,a=t.length,r,c="value"in Ln?Ln.value:Ln.textContent,d=c.length;for(e=0;e<a&&t[e]===c[e];e++);var x=a-e;for(r=1;r<=x&&t[a-r]===c[d-r];r++);return Fs=c.slice(e,1<r?1-r:void 0)}function Js(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ps(){return!0}function qd(){return!1}function ha(e){function t(a,r,c,d,x){this._reactName=a,this._targetInst=c,this.type=r,this.nativeEvent=d,this.target=x,this.currentTarget=null;for(var S in e)e.hasOwnProperty(S)&&(a=e[S],this[S]=a?a(d):d[S]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Ps:qd,this.isPropagationStopped=qd,this}return y(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Ps)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Ps)},persist:function(){},isPersistent:Ps}),t}var hl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Is=ha(hl),Hr=y({},hl,{view:0,detail:0}),cy=ha(Hr),Ho,Bo,Br,Ws=y({},Hr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qo,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Br&&(Br&&e.type==="mousemove"?(Ho=e.screenX-Br.screenX,Bo=e.screenY-Br.screenY):Bo=Ho=0,Br=e),Ho)},movementY:function(e){return"movementY"in e?e.movementY:Bo}}),Yd=ha(Ws),uy=y({},Ws,{dataTransfer:0}),dy=ha(uy),fy=y({},Hr,{relatedTarget:0}),$o=ha(fy),my=y({},hl,{animationName:0,elapsedTime:0,pseudoElement:0}),hy=ha(my),py=y({},hl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),gy=ha(py),xy=y({},hl,{data:0}),Gd=ha(xy),yy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},by={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},vy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Sy(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=vy[e])?!!t[e]:!1}function qo(){return Sy}var _y=y({},Hr,{key:function(e){if(e.key){var t=yy[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Js(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?by[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qo,charCode:function(e){return e.type==="keypress"?Js(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Js(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),jy=ha(_y),Ny=y({},Ws,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Vd=ha(Ny),wy=y({},Hr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qo}),Ey=ha(wy),Cy=y({},hl,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ry=ha(Cy),Ty=y({},Ws,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),zy=ha(Ty),Oy=y({},hl,{newState:0,oldState:0}),Dy=ha(Oy),My=[9,13,27,32],Yo=pn&&"CompositionEvent"in window,$r=null;pn&&"documentMode"in document&&($r=document.documentMode);var ky=pn&&"TextEvent"in window&&!$r,Kd=pn&&(!Yo||$r&&8<$r&&11>=$r),Xd=" ",Qd=!1;function Zd(e,t){switch(e){case"keyup":return My.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Fl=!1;function Ay(e,t){switch(e){case"compositionend":return Fd(t);case"keypress":return t.which!==32?null:(Qd=!0,Xd);case"textInput":return e=t.data,e===Xd&&Qd?null:e;default:return null}}function Ly(e,t){if(Fl)return e==="compositionend"||!Yo&&Zd(e,t)?(e=$d(),Fs=Uo=Ln=null,Fl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Kd&&t.locale!=="ko"?null:t.data;default:return null}}var Uy={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Jd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Uy[e.type]:t==="textarea"}function Pd(e,t,a,r){Ql?Zl?Zl.push(r):Zl=[r]:Ql=r,t=Yi(t,"onChange"),0<t.length&&(a=new Is("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var qr=null,Yr=null;function Hy(e){kh(e,0)}function ei(e){var t=et(e);if(Xs(t))return e}function Id(e,t){if(e==="change")return t}var Wd=!1;if(pn){var Go;if(pn){var Vo="oninput"in document;if(!Vo){var ef=document.createElement("div");ef.setAttribute("oninput","return;"),Vo=typeof ef.oninput=="function"}Go=Vo}else Go=!1;Wd=Go&&(!document.documentMode||9<document.documentMode)}function tf(){qr&&(qr.detachEvent("onpropertychange",af),Yr=qr=null)}function af(e){if(e.propertyName==="value"&&ei(Yr)){var t=[];Pd(t,Yr,e,ko(e)),Bd(Hy,t)}}function By(e,t,a){e==="focusin"?(tf(),qr=t,Yr=a,qr.attachEvent("onpropertychange",af)):e==="focusout"&&tf()}function $y(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ei(Yr)}function qy(e,t){if(e==="click")return ei(t)}function Yy(e,t){if(e==="input"||e==="change")return ei(t)}function Gy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Na=typeof Object.is=="function"?Object.is:Gy;function Gr(e,t){if(Na(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var c=a[r];if(!Sa.call(t,c)||!Na(e[c],t[c]))return!1}return!0}function nf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function lf(e,t){var a=nf(e);e=0;for(var r;a;){if(a.nodeType===3){if(r=e+a.textContent.length,e<=t&&r>=t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=nf(a)}}function rf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?rf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function sf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Qs(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Qs(e.document)}return t}function Ko(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Vy=pn&&"documentMode"in document&&11>=document.documentMode,Jl=null,Xo=null,Vr=null,Qo=!1;function of(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Qo||Jl==null||Jl!==Qs(r)||(r=Jl,"selectionStart"in r&&Ko(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Vr&&Gr(Vr,r)||(Vr=r,r=Yi(Xo,"onSelect"),0<r.length&&(t=new Is("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=Jl)))}function pl(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Pl={animationend:pl("Animation","AnimationEnd"),animationiteration:pl("Animation","AnimationIteration"),animationstart:pl("Animation","AnimationStart"),transitionrun:pl("Transition","TransitionRun"),transitionstart:pl("Transition","TransitionStart"),transitioncancel:pl("Transition","TransitionCancel"),transitionend:pl("Transition","TransitionEnd")},Zo={},cf={};pn&&(cf=document.createElement("div").style,"AnimationEvent"in window||(delete Pl.animationend.animation,delete Pl.animationiteration.animation,delete Pl.animationstart.animation),"TransitionEvent"in window||delete Pl.transitionend.transition);function gl(e){if(Zo[e])return Zo[e];if(!Pl[e])return e;var t=Pl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in cf)return Zo[e]=t[a];return e}var uf=gl("animationend"),df=gl("animationiteration"),ff=gl("animationstart"),Ky=gl("transitionrun"),Xy=gl("transitionstart"),Qy=gl("transitioncancel"),mf=gl("transitionend"),hf=new Map,Fo="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Fo.push("scrollEnd");function Ia(e,t){hf.set(e,t),Vt(t,[e])}var ti=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Ua=[],Il=0,Jo=0;function ai(){for(var e=Il,t=Jo=Il=0;t<e;){var a=Ua[t];Ua[t++]=null;var r=Ua[t];Ua[t++]=null;var c=Ua[t];Ua[t++]=null;var d=Ua[t];if(Ua[t++]=null,r!==null&&c!==null){var x=r.pending;x===null?c.next=c:(c.next=x.next,x.next=c),r.pending=c}d!==0&&pf(a,c,d)}}function ni(e,t,a,r){Ua[Il++]=e,Ua[Il++]=t,Ua[Il++]=a,Ua[Il++]=r,Jo|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Po(e,t,a,r){return ni(e,t,a,r),li(e)}function xl(e,t){return ni(e,null,null,t),li(e)}function pf(e,t,a){e.lanes|=a;var r=e.alternate;r!==null&&(r.lanes|=a);for(var c=!1,d=e.return;d!==null;)d.childLanes|=a,r=d.alternate,r!==null&&(r.childLanes|=a),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(c=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,c&&t!==null&&(c=31-Mt(a),e=d.hiddenUpdates,r=e[c],r===null?e[c]=[t]:r.push(t),t.lane=a|536870912),d):null}function li(e){if(50<fs)throw fs=0,su=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Wl={};function Zy(e,t,a,r){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wa(e,t,a,r){return new Zy(e,t,a,r)}function Io(e){return e=e.prototype,!(!e||!e.isReactComponent)}function gn(e,t){var a=e.alternate;return a===null?(a=wa(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function gf(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ri(e,t,a,r,c,d){var x=0;if(r=e,typeof e=="function")Io(e)&&(x=1);else if(typeof e=="string")x=W0(e,a,ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case q:return e=wa(31,a,t,c),e.elementType=q,e.lanes=d,e;case T:return yl(a.children,c,d,t);case O:x=8,c|=24;break;case G:return e=wa(12,a,t,c|2),e.elementType=G,e.lanes=d,e;case X:return e=wa(13,a,t,c),e.elementType=X,e.lanes=d,e;case W:return e=wa(19,a,t,c),e.elementType=W,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case $:x=10;break e;case Z:x=9;break e;case V:x=11;break e;case F:x=14;break e;case E:x=16,r=null;break e}x=29,a=Error(i(130,e===null?"null":typeof e,"")),r=null}return t=wa(x,a,t,c),t.elementType=e,t.type=r,t.lanes=d,t}function yl(e,t,a,r){return e=wa(7,e,r,t),e.lanes=a,e}function Wo(e,t,a){return e=wa(6,e,null,t),e.lanes=a,e}function xf(e){var t=wa(18,null,null,0);return t.stateNode=e,t}function ec(e,t,a){return t=wa(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var yf=new WeakMap;function Ha(e,t){if(typeof e=="object"&&e!==null){var a=yf.get(e);return a!==void 0?a:(t={value:e,source:t,stack:ta(t)},yf.set(e,t),t)}return{value:e,source:t,stack:ta(t)}}var er=[],tr=0,si=null,Kr=0,Ba=[],$a=0,Un=null,sn=1,on="";function xn(e,t){er[tr++]=Kr,er[tr++]=si,si=e,Kr=t}function bf(e,t,a){Ba[$a++]=sn,Ba[$a++]=on,Ba[$a++]=Un,Un=e;var r=sn;e=on;var c=32-Mt(r)-1;r&=~(1<<c),a+=1;var d=32-Mt(t)+c;if(30<d){var x=c-c%5;d=(r&(1<<x)-1).toString(32),r>>=x,c-=x,sn=1<<32-Mt(t)+c|a<<c|r,on=d+e}else sn=1<<d|a<<c|r,on=e}function tc(e){e.return!==null&&(xn(e,1),bf(e,1,0))}function ac(e){for(;e===si;)si=er[--tr],er[tr]=null,Kr=er[--tr],er[tr]=null;for(;e===Un;)Un=Ba[--$a],Ba[$a]=null,on=Ba[--$a],Ba[$a]=null,sn=Ba[--$a],Ba[$a]=null}function vf(e,t){Ba[$a++]=sn,Ba[$a++]=on,Ba[$a++]=Un,sn=t.id,on=t.overflow,Un=e}var Zt=null,vt=null,We=!1,Hn=null,qa=!1,nc=Error(i(519));function Bn(e){var t=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Xr(Ha(t,e)),nc}function Sf(e){var t=e.stateNode,a=e.type,r=e.memoizedProps;switch(t[ce]=e,t[he]=r,a){case"dialog":Ke("cancel",t),Ke("close",t);break;case"iframe":case"object":case"embed":Ke("load",t);break;case"video":case"audio":for(a=0;a<hs.length;a++)Ke(hs[a],t);break;case"source":Ke("error",t);break;case"img":case"image":case"link":Ke("error",t),Ke("load",t);break;case"details":Ke("toggle",t);break;case"input":Ke("invalid",t),Md(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Ke("invalid",t);break;case"textarea":Ke("invalid",t),Ad(t,r.value,r.defaultValue,r.children)}a=r.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||r.suppressHydrationWarning===!0||Hh(t.textContent,a)?(r.popover!=null&&(Ke("beforetoggle",t),Ke("toggle",t)),r.onScroll!=null&&Ke("scroll",t),r.onScrollEnd!=null&&Ke("scrollend",t),r.onClick!=null&&(t.onclick=hn),t=!0):t=!1,t||Bn(e,!0)}function _f(e){for(Zt=e.return;Zt;)switch(Zt.tag){case 5:case 31:case 13:qa=!1;return;case 27:case 3:qa=!0;return;default:Zt=Zt.return}}function ar(e){if(e!==Zt)return!1;if(!We)return _f(e),We=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Su(e.type,e.memoizedProps)),a=!a),a&&vt&&Bn(e),_f(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));vt=Qh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));vt=Qh(e)}else t===27?(t=vt,Wn(e.type)?(e=Eu,Eu=null,vt=e):vt=t):vt=Zt?Ga(e.stateNode.nextSibling):null;return!0}function bl(){vt=Zt=null,We=!1}function lc(){var e=Hn;return e!==null&&(ya===null?ya=e:ya.push.apply(ya,e),Hn=null),e}function Xr(e){Hn===null?Hn=[e]:Hn.push(e)}var rc=w(null),vl=null,yn=null;function $n(e,t,a){te(rc,t._currentValue),t._currentValue=a}function bn(e){e._currentValue=rc.current,B(rc)}function sc(e,t,a){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===a)break;e=e.return}}function ic(e,t,a,r){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var d=c.dependencies;if(d!==null){var x=c.child;d=d.firstContext;e:for(;d!==null;){var S=d;d=c;for(var R=0;R<t.length;R++)if(S.context===t[R]){d.lanes|=a,S=d.alternate,S!==null&&(S.lanes|=a),sc(d.return,a,e),r||(x=null);break e}d=S.next}}else if(c.tag===18){if(x=c.return,x===null)throw Error(i(341));x.lanes|=a,d=x.alternate,d!==null&&(d.lanes|=a),sc(x,a,e),x=null}else x=c.child;if(x!==null)x.return=c;else for(x=c;x!==null;){if(x===e){x=null;break}if(c=x.sibling,c!==null){c.return=x.return,x=c;break}x=x.return}c=x}}function nr(e,t,a,r){e=null;for(var c=t,d=!1;c!==null;){if(!d){if((c.flags&524288)!==0)d=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var x=c.alternate;if(x===null)throw Error(i(387));if(x=x.memoizedProps,x!==null){var S=c.type;Na(c.pendingProps.value,x.value)||(e!==null?e.push(S):e=[S])}}else if(c===ze.current){if(x=c.alternate,x===null)throw Error(i(387));x.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(bs):e=[bs])}c=c.return}e!==null&&ic(t,e,a,r),t.flags|=262144}function ii(e){for(e=e.firstContext;e!==null;){if(!Na(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Sl(e){vl=e,yn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ft(e){return jf(vl,e)}function oi(e,t){return vl===null&&Sl(e),jf(e,t)}function jf(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},yn===null){if(e===null)throw Error(i(308));yn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else yn=yn.next=t;return a}var Fy=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Jy=n.unstable_scheduleCallback,Py=n.unstable_NormalPriority,Lt={$$typeof:$,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function oc(){return{controller:new Fy,data:new Map,refCount:0}}function Qr(e){e.refCount--,e.refCount===0&&Jy(Py,function(){e.controller.abort()})}var Zr=null,cc=0,lr=0,rr=null;function Iy(e,t){if(Zr===null){var a=Zr=[];cc=0,lr=fu(),rr={status:"pending",value:void 0,then:function(r){a.push(r)}}}return cc++,t.then(Nf,Nf),t}function Nf(){if(--cc===0&&Zr!==null){rr!==null&&(rr.status="fulfilled");var e=Zr;Zr=null,lr=0,rr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Wy(e,t){var a=[],r={status:"pending",value:null,reason:null,then:function(c){a.push(c)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var c=0;c<a.length;c++)(0,a[c])(t)},function(c){for(r.status="rejected",r.reason=c,c=0;c<a.length;c++)(0,a[c])(void 0)}),r}var wf=k.S;k.S=function(e,t){oh=ht(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Iy(e,t),wf!==null&&wf(e,t)};var _l=w(null);function uc(){var e=_l.current;return e!==null?e:mt.pooledCache}function ci(e,t){t===null?te(_l,_l.current):te(_l,t.pool)}function Ef(){var e=uc();return e===null?null:{parent:Lt._currentValue,pool:e}}var sr=Error(i(460)),dc=Error(i(474)),ui=Error(i(542)),di={then:function(){}};function Cf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Rf(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(hn,hn),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,zf(e),e;default:if(typeof t.status=="string")t.then(hn,hn);else{if(e=mt,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=r}},function(r){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,zf(e),e}throw Nl=t,sr}}function jl(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Nl=a,sr):a}}var Nl=null;function Tf(){if(Nl===null)throw Error(i(459));var e=Nl;return Nl=null,e}function zf(e){if(e===sr||e===ui)throw Error(i(483))}var ir=null,Fr=0;function fi(e){var t=Fr;return Fr+=1,ir===null&&(ir=[]),Rf(ir,e,t)}function Jr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function mi(e,t){throw t.$$typeof===_?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Of(e){function t(M,z){if(e){var A=M.deletions;A===null?(M.deletions=[z],M.flags|=16):A.push(z)}}function a(M,z){if(!e)return null;for(;z!==null;)t(M,z),z=z.sibling;return null}function r(M){for(var z=new Map;M!==null;)M.key!==null?z.set(M.key,M):z.set(M.index,M),M=M.sibling;return z}function c(M,z){return M=gn(M,z),M.index=0,M.sibling=null,M}function d(M,z,A){return M.index=A,e?(A=M.alternate,A!==null?(A=A.index,A<z?(M.flags|=67108866,z):A):(M.flags|=67108866,z)):(M.flags|=1048576,z)}function x(M){return e&&M.alternate===null&&(M.flags|=67108866),M}function S(M,z,A,J){return z===null||z.tag!==6?(z=Wo(A,M.mode,J),z.return=M,z):(z=c(z,A),z.return=M,z)}function R(M,z,A,J){var we=A.type;return we===T?Q(M,z,A.props.children,J,A.key):z!==null&&(z.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===E&&jl(we)===z.type)?(z=c(z,A.props),Jr(z,A),z.return=M,z):(z=ri(A.type,A.key,A.props,null,M.mode,J),Jr(z,A),z.return=M,z)}function L(M,z,A,J){return z===null||z.tag!==4||z.stateNode.containerInfo!==A.containerInfo||z.stateNode.implementation!==A.implementation?(z=ec(A,M.mode,J),z.return=M,z):(z=c(z,A.children||[]),z.return=M,z)}function Q(M,z,A,J,we){return z===null||z.tag!==7?(z=yl(A,M.mode,J,we),z.return=M,z):(z=c(z,A),z.return=M,z)}function I(M,z,A){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=Wo(""+z,M.mode,A),z.return=M,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case j:return A=ri(z.type,z.key,z.props,null,M.mode,A),Jr(A,z),A.return=M,A;case N:return z=ec(z,M.mode,A),z.return=M,z;case E:return z=jl(z),I(M,z,A)}if(ge(z)||oe(z))return z=yl(z,M.mode,A,null),z.return=M,z;if(typeof z.then=="function")return I(M,fi(z),A);if(z.$$typeof===$)return I(M,oi(M,z),A);mi(M,z)}return null}function U(M,z,A,J){var we=z!==null?z.key:null;if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return we!==null?null:S(M,z,""+A,J);if(typeof A=="object"&&A!==null){switch(A.$$typeof){case j:return A.key===we?R(M,z,A,J):null;case N:return A.key===we?L(M,z,A,J):null;case E:return A=jl(A),U(M,z,A,J)}if(ge(A)||oe(A))return we!==null?null:Q(M,z,A,J,null);if(typeof A.then=="function")return U(M,z,fi(A),J);if(A.$$typeof===$)return U(M,z,oi(M,A),J);mi(M,A)}return null}function Y(M,z,A,J,we){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return M=M.get(A)||null,S(z,M,""+J,we);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case j:return M=M.get(J.key===null?A:J.key)||null,R(z,M,J,we);case N:return M=M.get(J.key===null?A:J.key)||null,L(z,M,J,we);case E:return J=jl(J),Y(M,z,A,J,we)}if(ge(J)||oe(J))return M=M.get(A)||null,Q(z,M,J,we,null);if(typeof J.then=="function")return Y(M,z,A,fi(J),we);if(J.$$typeof===$)return Y(M,z,A,oi(z,J),we);mi(z,J)}return null}function be(M,z,A,J){for(var we=null,nt=null,_e=z,Be=z=0,Je=null;_e!==null&&Be<A.length;Be++){_e.index>Be?(Je=_e,_e=null):Je=_e.sibling;var lt=U(M,_e,A[Be],J);if(lt===null){_e===null&&(_e=Je);break}e&&_e&&lt.alternate===null&&t(M,_e),z=d(lt,z,Be),nt===null?we=lt:nt.sibling=lt,nt=lt,_e=Je}if(Be===A.length)return a(M,_e),We&&xn(M,Be),we;if(_e===null){for(;Be<A.length;Be++)_e=I(M,A[Be],J),_e!==null&&(z=d(_e,z,Be),nt===null?we=_e:nt.sibling=_e,nt=_e);return We&&xn(M,Be),we}for(_e=r(_e);Be<A.length;Be++)Je=Y(_e,M,Be,A[Be],J),Je!==null&&(e&&Je.alternate!==null&&_e.delete(Je.key===null?Be:Je.key),z=d(Je,z,Be),nt===null?we=Je:nt.sibling=Je,nt=Je);return e&&_e.forEach(function(ll){return t(M,ll)}),We&&xn(M,Be),we}function Re(M,z,A,J){if(A==null)throw Error(i(151));for(var we=null,nt=null,_e=z,Be=z=0,Je=null,lt=A.next();_e!==null&&!lt.done;Be++,lt=A.next()){_e.index>Be?(Je=_e,_e=null):Je=_e.sibling;var ll=U(M,_e,lt.value,J);if(ll===null){_e===null&&(_e=Je);break}e&&_e&&ll.alternate===null&&t(M,_e),z=d(ll,z,Be),nt===null?we=ll:nt.sibling=ll,nt=ll,_e=Je}if(lt.done)return a(M,_e),We&&xn(M,Be),we;if(_e===null){for(;!lt.done;Be++,lt=A.next())lt=I(M,lt.value,J),lt!==null&&(z=d(lt,z,Be),nt===null?we=lt:nt.sibling=lt,nt=lt);return We&&xn(M,Be),we}for(_e=r(_e);!lt.done;Be++,lt=A.next())lt=Y(_e,M,Be,lt.value,J),lt!==null&&(e&&lt.alternate!==null&&_e.delete(lt.key===null?Be:lt.key),z=d(lt,z,Be),nt===null?we=lt:nt.sibling=lt,nt=lt);return e&&_e.forEach(function(ub){return t(M,ub)}),We&&xn(M,Be),we}function ut(M,z,A,J){if(typeof A=="object"&&A!==null&&A.type===T&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case j:e:{for(var we=A.key;z!==null;){if(z.key===we){if(we=A.type,we===T){if(z.tag===7){a(M,z.sibling),J=c(z,A.props.children),J.return=M,M=J;break e}}else if(z.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===E&&jl(we)===z.type){a(M,z.sibling),J=c(z,A.props),Jr(J,A),J.return=M,M=J;break e}a(M,z);break}else t(M,z);z=z.sibling}A.type===T?(J=yl(A.props.children,M.mode,J,A.key),J.return=M,M=J):(J=ri(A.type,A.key,A.props,null,M.mode,J),Jr(J,A),J.return=M,M=J)}return x(M);case N:e:{for(we=A.key;z!==null;){if(z.key===we)if(z.tag===4&&z.stateNode.containerInfo===A.containerInfo&&z.stateNode.implementation===A.implementation){a(M,z.sibling),J=c(z,A.children||[]),J.return=M,M=J;break e}else{a(M,z);break}else t(M,z);z=z.sibling}J=ec(A,M.mode,J),J.return=M,M=J}return x(M);case E:return A=jl(A),ut(M,z,A,J)}if(ge(A))return be(M,z,A,J);if(oe(A)){if(we=oe(A),typeof we!="function")throw Error(i(150));return A=we.call(A),Re(M,z,A,J)}if(typeof A.then=="function")return ut(M,z,fi(A),J);if(A.$$typeof===$)return ut(M,z,oi(M,A),J);mi(M,A)}return typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint"?(A=""+A,z!==null&&z.tag===6?(a(M,z.sibling),J=c(z,A),J.return=M,M=J):(a(M,z),J=Wo(A,M.mode,J),J.return=M,M=J),x(M)):a(M,z)}return function(M,z,A,J){try{Fr=0;var we=ut(M,z,A,J);return ir=null,we}catch(_e){if(_e===sr||_e===ui)throw _e;var nt=wa(29,_e,null,M.mode);return nt.lanes=J,nt.return=M,nt}}}var wl=Of(!0),Df=Of(!1),qn=!1;function fc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Yn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Gn(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(rt&2)!==0){var c=r.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),r.pending=t,t=li(e),pf(e,null,a),t}return ni(e,r,t,a),li(e)}function Pr(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,ql(e,a)}}function hc(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var c=null,d=null;if(a=a.firstBaseUpdate,a!==null){do{var x={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};d===null?c=d=x:d=d.next=x,a=a.next}while(a!==null);d===null?c=d=t:d=d.next=t}else c=d=t;a={baseState:r.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:r.shared,callbacks:r.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var pc=!1;function Ir(){if(pc){var e=rr;if(e!==null)throw e}}function Wr(e,t,a,r){pc=!1;var c=e.updateQueue;qn=!1;var d=c.firstBaseUpdate,x=c.lastBaseUpdate,S=c.shared.pending;if(S!==null){c.shared.pending=null;var R=S,L=R.next;R.next=null,x===null?d=L:x.next=L,x=R;var Q=e.alternate;Q!==null&&(Q=Q.updateQueue,S=Q.lastBaseUpdate,S!==x&&(S===null?Q.firstBaseUpdate=L:S.next=L,Q.lastBaseUpdate=R))}if(d!==null){var I=c.baseState;x=0,Q=L=R=null,S=d;do{var U=S.lane&-536870913,Y=U!==S.lane;if(Y?(Fe&U)===U:(r&U)===U){U!==0&&U===lr&&(pc=!0),Q!==null&&(Q=Q.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var be=e,Re=S;U=t;var ut=a;switch(Re.tag){case 1:if(be=Re.payload,typeof be=="function"){I=be.call(ut,I,U);break e}I=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=Re.payload,U=typeof be=="function"?be.call(ut,I,U):be,U==null)break e;I=y({},I,U);break e;case 2:qn=!0}}U=S.callback,U!==null&&(e.flags|=64,Y&&(e.flags|=8192),Y=c.callbacks,Y===null?c.callbacks=[U]:Y.push(U))}else Y={lane:U,tag:S.tag,payload:S.payload,callback:S.callback,next:null},Q===null?(L=Q=Y,R=I):Q=Q.next=Y,x|=U;if(S=S.next,S===null){if(S=c.shared.pending,S===null)break;Y=S,S=Y.next,Y.next=null,c.lastBaseUpdate=Y,c.shared.pending=null}}while(!0);Q===null&&(R=I),c.baseState=R,c.firstBaseUpdate=L,c.lastBaseUpdate=Q,d===null&&(c.shared.lanes=0),Zn|=x,e.lanes=x,e.memoizedState=I}}function Mf(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function kf(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Mf(a[e],t)}var or=w(null),hi=w(0);function Af(e,t){e=Rn,te(hi,e),te(or,t),Rn=e|t.baseLanes}function gc(){te(hi,Rn),te(or,or.current)}function xc(){Rn=hi.current,B(or),B(hi)}var Ea=w(null),Ya=null;function Vn(e){var t=e.alternate;te(Ot,Ot.current&1),te(Ea,e),Ya===null&&(t===null||or.current!==null||t.memoizedState!==null)&&(Ya=e)}function yc(e){te(Ot,Ot.current),te(Ea,e),Ya===null&&(Ya=e)}function Lf(e){e.tag===22?(te(Ot,Ot.current),te(Ea,e),Ya===null&&(Ya=e)):Kn()}function Kn(){te(Ot,Ot.current),te(Ea,Ea.current)}function Ca(e){B(Ea),Ya===e&&(Ya=null),B(Ot)}var Ot=w(0);function pi(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Nu(a)||wu(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var vn=0,He=null,ot=null,Ut=null,gi=!1,cr=!1,El=!1,xi=0,es=0,ur=null,e0=0;function Et(){throw Error(i(321))}function bc(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Na(e[a],t[a]))return!1;return!0}function vc(e,t,a,r,c,d){return vn=d,He=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?bm:Ac,El=!1,d=a(r,c),El=!1,cr&&(d=Hf(t,a,r,c)),Uf(e),d}function Uf(e){k.H=ns;var t=ot!==null&&ot.next!==null;if(vn=0,Ut=ot=He=null,gi=!1,es=0,ur=null,t)throw Error(i(300));e===null||Ht||(e=e.dependencies,e!==null&&ii(e)&&(Ht=!0))}function Hf(e,t,a,r){He=e;var c=0;do{if(cr&&(ur=null),es=0,cr=!1,25<=c)throw Error(i(301));if(c+=1,Ut=ot=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}k.H=vm,d=t(a,r)}while(cr);return d}function t0(){var e=k.H,t=e.useState()[0];return t=typeof t.then=="function"?ts(t):t,e=e.useState()[0],(ot!==null?ot.memoizedState:null)!==e&&(He.flags|=1024),t}function Sc(){var e=xi!==0;return xi=0,e}function _c(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function jc(e){if(gi){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}gi=!1}vn=0,Ut=ot=He=null,cr=!1,es=xi=0,ur=null}function ua(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?He.memoizedState=Ut=e:Ut=Ut.next=e,Ut}function Dt(){if(ot===null){var e=He.alternate;e=e!==null?e.memoizedState:null}else e=ot.next;var t=Ut===null?He.memoizedState:Ut.next;if(t!==null)Ut=t,ot=e;else{if(e===null)throw He.alternate===null?Error(i(467)):Error(i(310));ot=e,e={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},Ut===null?He.memoizedState=Ut=e:Ut=Ut.next=e}return Ut}function yi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ts(e){var t=es;return es+=1,ur===null&&(ur=[]),e=Rf(ur,e,t),t=He,(Ut===null?t.memoizedState:Ut.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?bm:Ac),e}function bi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ts(e);if(e.$$typeof===$)return Ft(e)}throw Error(i(438,String(e)))}function Nc(e){var t=null,a=He.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var r=He.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=yi(),He.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),r=0;r<e;r++)a[r]=ee;return t.index++,a}function Sn(e,t){return typeof t=="function"?t(e):t}function vi(e){var t=Dt();return wc(t,ot,e)}function wc(e,t,a){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=a;var c=e.baseQueue,d=r.pending;if(d!==null){if(c!==null){var x=c.next;c.next=d.next,d.next=x}t.baseQueue=c=d,r.pending=null}if(d=e.baseState,c===null)e.memoizedState=d;else{t=c.next;var S=x=null,R=null,L=t,Q=!1;do{var I=L.lane&-536870913;if(I!==L.lane?(Fe&I)===I:(vn&I)===I){var U=L.revertLane;if(U===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),I===lr&&(Q=!0);else if((vn&U)===U){L=L.next,U===lr&&(Q=!0);continue}else I={lane:0,revertLane:L.revertLane,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},R===null?(S=R=I,x=d):R=R.next=I,He.lanes|=U,Zn|=U;I=L.action,El&&a(d,I),d=L.hasEagerState?L.eagerState:a(d,I)}else U={lane:I,revertLane:L.revertLane,gesture:L.gesture,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},R===null?(S=R=U,x=d):R=R.next=U,He.lanes|=I,Zn|=I;L=L.next}while(L!==null&&L!==t);if(R===null?x=d:R.next=S,!Na(d,e.memoizedState)&&(Ht=!0,Q&&(a=rr,a!==null)))throw a;e.memoizedState=d,e.baseState=x,e.baseQueue=R,r.lastRenderedState=d}return c===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Ec(e){var t=Dt(),a=t.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=e;var r=a.dispatch,c=a.pending,d=t.memoizedState;if(c!==null){a.pending=null;var x=c=c.next;do d=e(d,x.action),x=x.next;while(x!==c);Na(d,t.memoizedState)||(Ht=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),a.lastRenderedState=d}return[d,r]}function Bf(e,t,a){var r=He,c=Dt(),d=We;if(d){if(a===void 0)throw Error(i(407));a=a()}else a=t();var x=!Na((ot||c).memoizedState,a);if(x&&(c.memoizedState=a,Ht=!0),c=c.queue,Tc(Yf.bind(null,r,c,e),[e]),c.getSnapshot!==t||x||Ut!==null&&Ut.memoizedState.tag&1){if(r.flags|=2048,dr(9,{destroy:void 0},qf.bind(null,r,c,a,t),null),mt===null)throw Error(i(349));d||(vn&127)!==0||$f(r,t,a)}return a}function $f(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=He.updateQueue,t===null?(t=yi(),He.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function qf(e,t,a,r){t.value=a,t.getSnapshot=r,Gf(t)&&Vf(e)}function Yf(e,t,a){return a(function(){Gf(t)&&Vf(e)})}function Gf(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Na(e,a)}catch{return!0}}function Vf(e){var t=xl(e,2);t!==null&&ba(t,e,2)}function Cc(e){var t=ua();if(typeof e=="function"){var a=e;if(e=a(),El){gt(!0);try{a()}finally{gt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sn,lastRenderedState:e},t}function Kf(e,t,a,r){return e.baseState=a,wc(e,ot,typeof r=="function"?r:Sn)}function a0(e,t,a,r,c){if(ji(e))throw Error(i(485));if(e=t.action,e!==null){var d={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){d.listeners.push(x)}};k.T!==null?a(!0):d.isTransition=!1,r(d),a=t.pending,a===null?(d.next=t.pending=d,Xf(t,d)):(d.next=a.next,t.pending=a.next=d)}}function Xf(e,t){var a=t.action,r=t.payload,c=e.state;if(t.isTransition){var d=k.T,x={};k.T=x;try{var S=a(c,r),R=k.S;R!==null&&R(x,S),Qf(e,t,S)}catch(L){Rc(e,t,L)}finally{d!==null&&x.types!==null&&(d.types=x.types),k.T=d}}else try{d=a(c,r),Qf(e,t,d)}catch(L){Rc(e,t,L)}}function Qf(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){Zf(e,t,r)},function(r){return Rc(e,t,r)}):Zf(e,t,a)}function Zf(e,t,a){t.status="fulfilled",t.value=a,Ff(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Xf(e,a)))}function Rc(e,t,a){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=a,Ff(t),t=t.next;while(t!==r)}e.action=null}function Ff(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Jf(e,t){return t}function Pf(e,t){if(We){var a=mt.formState;if(a!==null){e:{var r=He;if(We){if(vt){t:{for(var c=vt,d=qa;c.nodeType!==8;){if(!d){c=null;break t}if(c=Ga(c.nextSibling),c===null){c=null;break t}}d=c.data,c=d==="F!"||d==="F"?c:null}if(c){vt=Ga(c.nextSibling),r=c.data==="F!";break e}}Bn(r)}r=!1}r&&(t=a[0])}}return a=ua(),a.memoizedState=a.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jf,lastRenderedState:t},a.queue=r,a=gm.bind(null,He,r),r.dispatch=a,r=Cc(!1),d=kc.bind(null,He,!1,r.queue),r=ua(),c={state:t,dispatch:null,action:e,pending:null},r.queue=c,a=a0.bind(null,He,c,d,a),c.dispatch=a,r.memoizedState=e,[t,a,!1]}function If(e){var t=Dt();return Wf(t,ot,e)}function Wf(e,t,a){if(t=wc(e,t,Jf)[0],e=vi(Sn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=ts(t)}catch(x){throw x===sr?ui:x}else r=t;t=Dt();var c=t.queue,d=c.dispatch;return a!==t.memoizedState&&(He.flags|=2048,dr(9,{destroy:void 0},n0.bind(null,c,a),null)),[r,d,e]}function n0(e,t){e.action=t}function em(e){var t=Dt(),a=ot;if(a!==null)return Wf(t,a,e);Dt(),t=t.memoizedState,a=Dt();var r=a.queue.dispatch;return a.memoizedState=e,[t,r,!1]}function dr(e,t,a,r){return e={tag:e,create:a,deps:r,inst:t,next:null},t=He.updateQueue,t===null&&(t=yi(),He.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e),e}function tm(){return Dt().memoizedState}function Si(e,t,a,r){var c=ua();He.flags|=e,c.memoizedState=dr(1|t,{destroy:void 0},a,r===void 0?null:r)}function _i(e,t,a,r){var c=Dt();r=r===void 0?null:r;var d=c.memoizedState.inst;ot!==null&&r!==null&&bc(r,ot.memoizedState.deps)?c.memoizedState=dr(t,d,a,r):(He.flags|=e,c.memoizedState=dr(1|t,d,a,r))}function am(e,t){Si(8390656,8,e,t)}function Tc(e,t){_i(2048,8,e,t)}function l0(e){He.flags|=4;var t=He.updateQueue;if(t===null)t=yi(),He.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function nm(e){var t=Dt().memoizedState;return l0({ref:t,nextImpl:e}),function(){if((rt&2)!==0)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function lm(e,t){return _i(4,2,e,t)}function rm(e,t){return _i(4,4,e,t)}function sm(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function im(e,t,a){a=a!=null?a.concat([e]):null,_i(4,4,sm.bind(null,t,e),a)}function zc(){}function om(e,t){var a=Dt();t=t===void 0?null:t;var r=a.memoizedState;return t!==null&&bc(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function cm(e,t){var a=Dt();t=t===void 0?null:t;var r=a.memoizedState;if(t!==null&&bc(t,r[1]))return r[0];if(r=e(),El){gt(!0);try{e()}finally{gt(!1)}}return a.memoizedState=[r,t],r}function Oc(e,t,a){return a===void 0||(vn&1073741824)!==0&&(Fe&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=uh(),He.lanes|=e,Zn|=e,a)}function um(e,t,a,r){return Na(a,t)?a:or.current!==null?(e=Oc(e,a,r),Na(e,t)||(Ht=!0),e):(vn&42)===0||(vn&1073741824)!==0&&(Fe&261930)===0?(Ht=!0,e.memoizedState=a):(e=uh(),He.lanes|=e,Zn|=e,t)}function dm(e,t,a,r,c){var d=P.p;P.p=d!==0&&8>d?d:8;var x=k.T,S={};k.T=S,kc(e,!1,t,a);try{var R=c(),L=k.S;if(L!==null&&L(S,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var Q=Wy(R,r);as(e,t,Q,za(e))}else as(e,t,r,za(e))}catch(I){as(e,t,{then:function(){},status:"rejected",reason:I},za())}finally{P.p=d,x!==null&&S.types!==null&&(x.types=S.types),k.T=x}}function r0(){}function Dc(e,t,a,r){if(e.tag!==5)throw Error(i(476));var c=fm(e).queue;dm(e,c,t,fe,a===null?r0:function(){return mm(e),a(r)})}function fm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:fe,baseState:fe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sn,lastRenderedState:fe},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function mm(e){var t=fm(e);t.next===null&&(t=e.alternate.memoizedState),as(e,t.next.queue,{},za())}function Mc(){return Ft(bs)}function hm(){return Dt().memoizedState}function pm(){return Dt().memoizedState}function s0(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=za();e=Yn(a);var r=Gn(t,e,a);r!==null&&(ba(r,t,a),Pr(r,t,a)),t={cache:oc()},e.payload=t;return}t=t.return}}function i0(e,t,a){var r=za();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},ji(e)?xm(t,a):(a=Po(e,t,a,r),a!==null&&(ba(a,e,r),ym(a,t,r)))}function gm(e,t,a){var r=za();as(e,t,a,r)}function as(e,t,a,r){var c={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(ji(e))xm(t,c);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var x=t.lastRenderedState,S=d(x,a);if(c.hasEagerState=!0,c.eagerState=S,Na(S,x))return ni(e,t,c,0),mt===null&&ai(),!1}catch{}if(a=Po(e,t,c,r),a!==null)return ba(a,e,r),ym(a,t,r),!0}return!1}function kc(e,t,a,r){if(r={lane:2,revertLane:fu(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ji(e)){if(t)throw Error(i(479))}else t=Po(e,a,r,2),t!==null&&ba(t,e,2)}function ji(e){var t=e.alternate;return e===He||t!==null&&t===He}function xm(e,t){cr=gi=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function ym(e,t,a){if((a&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,ql(e,a)}}var ns={readContext:Ft,use:bi,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useLayoutEffect:Et,useInsertionEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useSyncExternalStore:Et,useId:Et,useHostTransitionStatus:Et,useFormState:Et,useActionState:Et,useOptimistic:Et,useMemoCache:Et,useCacheRefresh:Et};ns.useEffectEvent=Et;var bm={readContext:Ft,use:bi,useCallback:function(e,t){return ua().memoizedState=[e,t===void 0?null:t],e},useContext:Ft,useEffect:am,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Si(4194308,4,sm.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Si(4194308,4,e,t)},useInsertionEffect:function(e,t){Si(4,2,e,t)},useMemo:function(e,t){var a=ua();t=t===void 0?null:t;var r=e();if(El){gt(!0);try{e()}finally{gt(!1)}}return a.memoizedState=[r,t],r},useReducer:function(e,t,a){var r=ua();if(a!==void 0){var c=a(t);if(El){gt(!0);try{a(t)}finally{gt(!1)}}}else c=t;return r.memoizedState=r.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},r.queue=e,e=e.dispatch=i0.bind(null,He,e),[r.memoizedState,e]},useRef:function(e){var t=ua();return e={current:e},t.memoizedState=e},useState:function(e){e=Cc(e);var t=e.queue,a=gm.bind(null,He,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:zc,useDeferredValue:function(e,t){var a=ua();return Oc(a,e,t)},useTransition:function(){var e=Cc(!1);return e=dm.bind(null,He,e.queue,!0,!1),ua().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var r=He,c=ua();if(We){if(a===void 0)throw Error(i(407));a=a()}else{if(a=t(),mt===null)throw Error(i(349));(Fe&127)!==0||$f(r,t,a)}c.memoizedState=a;var d={value:a,getSnapshot:t};return c.queue=d,am(Yf.bind(null,r,d,e),[e]),r.flags|=2048,dr(9,{destroy:void 0},qf.bind(null,r,d,a,t),null),a},useId:function(){var e=ua(),t=mt.identifierPrefix;if(We){var a=on,r=sn;a=(r&~(1<<32-Mt(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=xi++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=e0++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Mc,useFormState:Pf,useActionState:Pf,useOptimistic:function(e){var t=ua();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=kc.bind(null,He,!0,a),a.dispatch=t,[e,t]},useMemoCache:Nc,useCacheRefresh:function(){return ua().memoizedState=s0.bind(null,He)},useEffectEvent:function(e){var t=ua(),a={impl:e};return t.memoizedState=a,function(){if((rt&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}},Ac={readContext:Ft,use:bi,useCallback:om,useContext:Ft,useEffect:Tc,useImperativeHandle:im,useInsertionEffect:lm,useLayoutEffect:rm,useMemo:cm,useReducer:vi,useRef:tm,useState:function(){return vi(Sn)},useDebugValue:zc,useDeferredValue:function(e,t){var a=Dt();return um(a,ot.memoizedState,e,t)},useTransition:function(){var e=vi(Sn)[0],t=Dt().memoizedState;return[typeof e=="boolean"?e:ts(e),t]},useSyncExternalStore:Bf,useId:hm,useHostTransitionStatus:Mc,useFormState:If,useActionState:If,useOptimistic:function(e,t){var a=Dt();return Kf(a,ot,e,t)},useMemoCache:Nc,useCacheRefresh:pm};Ac.useEffectEvent=nm;var vm={readContext:Ft,use:bi,useCallback:om,useContext:Ft,useEffect:Tc,useImperativeHandle:im,useInsertionEffect:lm,useLayoutEffect:rm,useMemo:cm,useReducer:Ec,useRef:tm,useState:function(){return Ec(Sn)},useDebugValue:zc,useDeferredValue:function(e,t){var a=Dt();return ot===null?Oc(a,e,t):um(a,ot.memoizedState,e,t)},useTransition:function(){var e=Ec(Sn)[0],t=Dt().memoizedState;return[typeof e=="boolean"?e:ts(e),t]},useSyncExternalStore:Bf,useId:hm,useHostTransitionStatus:Mc,useFormState:em,useActionState:em,useOptimistic:function(e,t){var a=Dt();return ot!==null?Kf(a,ot,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Nc,useCacheRefresh:pm};vm.useEffectEvent=nm;function Lc(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:y({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Uc={enqueueSetState:function(e,t,a){e=e._reactInternals;var r=za(),c=Yn(r);c.payload=t,a!=null&&(c.callback=a),t=Gn(e,c,r),t!==null&&(ba(t,e,r),Pr(t,e,r))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=za(),c=Yn(r);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=Gn(e,c,r),t!==null&&(ba(t,e,r),Pr(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=za(),r=Yn(a);r.tag=2,t!=null&&(r.callback=t),t=Gn(e,r,a),t!==null&&(ba(t,e,a),Pr(t,e,a))}};function Sm(e,t,a,r,c,d,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,d,x):t.prototype&&t.prototype.isPureReactComponent?!Gr(a,r)||!Gr(c,d):!0}function _m(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&Uc.enqueueReplaceState(t,t.state,null)}function Cl(e,t){var a=t;if("ref"in t){a={};for(var r in t)r!=="ref"&&(a[r]=t[r])}if(e=e.defaultProps){a===t&&(a=y({},a));for(var c in e)a[c]===void 0&&(a[c]=e[c])}return a}function jm(e){ti(e)}function Nm(e){console.error(e)}function wm(e){ti(e)}function Ni(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Em(e,t,a){try{var r=e.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Hc(e,t,a){return a=Yn(a),a.tag=3,a.payload={element:null},a.callback=function(){Ni(e,t)},a}function Cm(e){return e=Yn(e),e.tag=3,e}function Rm(e,t,a,r){var c=a.type.getDerivedStateFromError;if(typeof c=="function"){var d=r.value;e.payload=function(){return c(d)},e.callback=function(){Em(t,a,r)}}var x=a.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){Em(t,a,r),typeof c!="function"&&(Fn===null?Fn=new Set([this]):Fn.add(this));var S=r.stack;this.componentDidCatch(r.value,{componentStack:S!==null?S:""})})}function o0(e,t,a,r,c){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=a.alternate,t!==null&&nr(t,a,c,!0),a=Ea.current,a!==null){switch(a.tag){case 31:case 13:return Ya===null?Li():a.alternate===null&&Ct===0&&(Ct=3),a.flags&=-257,a.flags|=65536,a.lanes=c,r===di?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([r]):t.add(r),cu(e,r,c)),!1;case 22:return a.flags|=65536,r===di?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([r]):a.add(r)),cu(e,r,c)),!1}throw Error(i(435,a.tag))}return cu(e,r,c),Li(),!1}if(We)return t=Ea.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,r!==nc&&(e=Error(i(422),{cause:r}),Xr(Ha(e,a)))):(r!==nc&&(t=Error(i(423),{cause:r}),Xr(Ha(t,a))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,r=Ha(r,a),c=Hc(e.stateNode,r,c),hc(e,c),Ct!==4&&(Ct=2)),!1;var d=Error(i(520),{cause:r});if(d=Ha(d,a),ds===null?ds=[d]:ds.push(d),Ct!==4&&(Ct=2),t===null)return!0;r=Ha(r,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=c&-c,a.lanes|=e,e=Hc(a.stateNode,r,e),hc(a,e),!1;case 1:if(t=a.type,d=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(Fn===null||!Fn.has(d))))return a.flags|=65536,c&=-c,a.lanes|=c,c=Cm(c),Rm(c,e,a,r),hc(a,c),!1}a=a.return}while(a!==null);return!1}var Bc=Error(i(461)),Ht=!1;function Jt(e,t,a,r){t.child=e===null?Df(t,null,a,r):wl(t,e.child,a,r)}function Tm(e,t,a,r,c){a=a.render;var d=t.ref;if("ref"in r){var x={};for(var S in r)S!=="ref"&&(x[S]=r[S])}else x=r;return Sl(t),r=vc(e,t,a,x,d,c),S=Sc(),e!==null&&!Ht?(_c(e,t,c),_n(e,t,c)):(We&&S&&tc(t),t.flags|=1,Jt(e,t,r,c),t.child)}function zm(e,t,a,r,c){if(e===null){var d=a.type;return typeof d=="function"&&!Io(d)&&d.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=d,Om(e,t,d,r,c)):(e=ri(a.type,null,r,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!Qc(e,c)){var x=d.memoizedProps;if(a=a.compare,a=a!==null?a:Gr,a(x,r)&&e.ref===t.ref)return _n(e,t,c)}return t.flags|=1,e=gn(d,r),e.ref=t.ref,e.return=t,t.child=e}function Om(e,t,a,r,c){if(e!==null){var d=e.memoizedProps;if(Gr(d,r)&&e.ref===t.ref)if(Ht=!1,t.pendingProps=r=d,Qc(e,c))(e.flags&131072)!==0&&(Ht=!0);else return t.lanes=e.lanes,_n(e,t,c)}return $c(e,t,a,r,c)}function Dm(e,t,a,r){var c=r.children,d=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(d=d!==null?d.baseLanes|a:a,e!==null){for(r=t.child=e.child,c=0;r!==null;)c=c|r.lanes|r.childLanes,r=r.sibling;r=c&~d}else r=0,t.child=null;return Mm(e,t,d,a,r)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ci(t,d!==null?d.cachePool:null),d!==null?Af(t,d):gc(),Lf(t);else return r=t.lanes=536870912,Mm(e,t,d!==null?d.baseLanes|a:a,a,r)}else d!==null?(ci(t,d.cachePool),Af(t,d),Kn(),t.memoizedState=null):(e!==null&&ci(t,null),gc(),Kn());return Jt(e,t,c,a),t.child}function ls(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Mm(e,t,a,r,c){var d=uc();return d=d===null?null:{parent:Lt._currentValue,pool:d},t.memoizedState={baseLanes:a,cachePool:d},e!==null&&ci(t,null),gc(),Lf(t),e!==null&&nr(e,t,r,!0),t.childLanes=c,null}function wi(e,t){return t=Ci({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function km(e,t,a){return wl(t,e.child,null,a),e=wi(t,t.pendingProps),e.flags|=2,Ca(t),t.memoizedState=null,e}function c0(e,t,a){var r=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(We){if(r.mode==="hidden")return e=wi(t,r),t.lanes=536870912,ls(null,e);if(yc(t),(e=vt)?(e=Xh(e,qa),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Un!==null?{id:sn,overflow:on}:null,retryLane:536870912,hydrationErrors:null},a=xf(e),a.return=t,t.child=a,Zt=t,vt=null)):e=null,e===null)throw Bn(t);return t.lanes=536870912,null}return wi(t,r)}var d=e.memoizedState;if(d!==null){var x=d.dehydrated;if(yc(t),c)if(t.flags&256)t.flags&=-257,t=km(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Ht||nr(e,t,a,!1),c=(a&e.childLanes)!==0,Ht||c){if(r=mt,r!==null&&(x=C(r,a),x!==0&&x!==d.retryLane))throw d.retryLane=x,xl(e,x),ba(r,e,x),Bc;Li(),t=km(e,t,a)}else e=d.treeContext,vt=Ga(x.nextSibling),Zt=t,We=!0,Hn=null,qa=!1,e!==null&&vf(t,e),t=wi(t,r),t.flags|=4096;return t}return e=gn(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ei(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(i(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function $c(e,t,a,r,c){return Sl(t),a=vc(e,t,a,r,void 0,c),r=Sc(),e!==null&&!Ht?(_c(e,t,c),_n(e,t,c)):(We&&r&&tc(t),t.flags|=1,Jt(e,t,a,c),t.child)}function Am(e,t,a,r,c,d){return Sl(t),t.updateQueue=null,a=Hf(t,r,a,c),Uf(e),r=Sc(),e!==null&&!Ht?(_c(e,t,d),_n(e,t,d)):(We&&r&&tc(t),t.flags|=1,Jt(e,t,a,d),t.child)}function Lm(e,t,a,r,c){if(Sl(t),t.stateNode===null){var d=Wl,x=a.contextType;typeof x=="object"&&x!==null&&(d=Ft(x)),d=new a(r,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Uc,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=r,d.state=t.memoizedState,d.refs={},fc(t),x=a.contextType,d.context=typeof x=="object"&&x!==null?Ft(x):Wl,d.state=t.memoizedState,x=a.getDerivedStateFromProps,typeof x=="function"&&(Lc(t,a,x,r),d.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(x=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),x!==d.state&&Uc.enqueueReplaceState(d,d.state,null),Wr(t,r,d,c),Ir(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){d=t.stateNode;var S=t.memoizedProps,R=Cl(a,S);d.props=R;var L=d.context,Q=a.contextType;x=Wl,typeof Q=="object"&&Q!==null&&(x=Ft(Q));var I=a.getDerivedStateFromProps;Q=typeof I=="function"||typeof d.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,Q||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(S||L!==x)&&_m(t,d,r,x),qn=!1;var U=t.memoizedState;d.state=U,Wr(t,r,d,c),Ir(),L=t.memoizedState,S||U!==L||qn?(typeof I=="function"&&(Lc(t,a,I,r),L=t.memoizedState),(R=qn||Sm(t,a,R,r,U,L,x))?(Q||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=L),d.props=r,d.state=L,d.context=x,r=R):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{d=t.stateNode,mc(e,t),x=t.memoizedProps,Q=Cl(a,x),d.props=Q,I=t.pendingProps,U=d.context,L=a.contextType,R=Wl,typeof L=="object"&&L!==null&&(R=Ft(L)),S=a.getDerivedStateFromProps,(L=typeof S=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(x!==I||U!==R)&&_m(t,d,r,R),qn=!1,U=t.memoizedState,d.state=U,Wr(t,r,d,c),Ir();var Y=t.memoizedState;x!==I||U!==Y||qn||e!==null&&e.dependencies!==null&&ii(e.dependencies)?(typeof S=="function"&&(Lc(t,a,S,r),Y=t.memoizedState),(Q=qn||Sm(t,a,Q,r,U,Y,R)||e!==null&&e.dependencies!==null&&ii(e.dependencies))?(L||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(r,Y,R),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(r,Y,R)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||x===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=Y),d.props=r,d.state=Y,d.context=R,r=Q):(typeof d.componentDidUpdate!="function"||x===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),r=!1)}return d=r,Ei(e,t),r=(t.flags&128)!==0,d||r?(d=t.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&r?(t.child=wl(t,e.child,null,c),t.child=wl(t,null,a,c)):Jt(e,t,a,c),t.memoizedState=d.state,e=t.child):e=_n(e,t,c),e}function Um(e,t,a,r){return bl(),t.flags|=256,Jt(e,t,a,r),t.child}var qc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Yc(e){return{baseLanes:e,cachePool:Ef()}}function Gc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Ta),e}function Hm(e,t,a){var r=t.pendingProps,c=!1,d=(t.flags&128)!==0,x;if((x=d)||(x=e!==null&&e.memoizedState===null?!1:(Ot.current&2)!==0),x&&(c=!0,t.flags&=-129),x=(t.flags&32)!==0,t.flags&=-33,e===null){if(We){if(c?Vn(t):Kn(),(e=vt)?(e=Xh(e,qa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Un!==null?{id:sn,overflow:on}:null,retryLane:536870912,hydrationErrors:null},a=xf(e),a.return=t,t.child=a,Zt=t,vt=null)):e=null,e===null)throw Bn(t);return wu(e)?t.lanes=32:t.lanes=536870912,null}var S=r.children;return r=r.fallback,c?(Kn(),c=t.mode,S=Ci({mode:"hidden",children:S},c),r=yl(r,c,a,null),S.return=t,r.return=t,S.sibling=r,t.child=S,r=t.child,r.memoizedState=Yc(a),r.childLanes=Gc(e,x,a),t.memoizedState=qc,ls(null,r)):(Vn(t),Vc(t,S))}var R=e.memoizedState;if(R!==null&&(S=R.dehydrated,S!==null)){if(d)t.flags&256?(Vn(t),t.flags&=-257,t=Kc(e,t,a)):t.memoizedState!==null?(Kn(),t.child=e.child,t.flags|=128,t=null):(Kn(),S=r.fallback,c=t.mode,r=Ci({mode:"visible",children:r.children},c),S=yl(S,c,a,null),S.flags|=2,r.return=t,S.return=t,r.sibling=S,t.child=r,wl(t,e.child,null,a),r=t.child,r.memoizedState=Yc(a),r.childLanes=Gc(e,x,a),t.memoizedState=qc,t=ls(null,r));else if(Vn(t),wu(S)){if(x=S.nextSibling&&S.nextSibling.dataset,x)var L=x.dgst;x=L,r=Error(i(419)),r.stack="",r.digest=x,Xr({value:r,source:null,stack:null}),t=Kc(e,t,a)}else if(Ht||nr(e,t,a,!1),x=(a&e.childLanes)!==0,Ht||x){if(x=mt,x!==null&&(r=C(x,a),r!==0&&r!==R.retryLane))throw R.retryLane=r,xl(e,r),ba(x,e,r),Bc;Nu(S)||Li(),t=Kc(e,t,a)}else Nu(S)?(t.flags|=192,t.child=e.child,t=null):(e=R.treeContext,vt=Ga(S.nextSibling),Zt=t,We=!0,Hn=null,qa=!1,e!==null&&vf(t,e),t=Vc(t,r.children),t.flags|=4096);return t}return c?(Kn(),S=r.fallback,c=t.mode,R=e.child,L=R.sibling,r=gn(R,{mode:"hidden",children:r.children}),r.subtreeFlags=R.subtreeFlags&65011712,L!==null?S=gn(L,S):(S=yl(S,c,a,null),S.flags|=2),S.return=t,r.return=t,r.sibling=S,t.child=r,ls(null,r),r=t.child,S=e.child.memoizedState,S===null?S=Yc(a):(c=S.cachePool,c!==null?(R=Lt._currentValue,c=c.parent!==R?{parent:R,pool:R}:c):c=Ef(),S={baseLanes:S.baseLanes|a,cachePool:c}),r.memoizedState=S,r.childLanes=Gc(e,x,a),t.memoizedState=qc,ls(e.child,r)):(Vn(t),a=e.child,e=a.sibling,a=gn(a,{mode:"visible",children:r.children}),a.return=t,a.sibling=null,e!==null&&(x=t.deletions,x===null?(t.deletions=[e],t.flags|=16):x.push(e)),t.child=a,t.memoizedState=null,a)}function Vc(e,t){return t=Ci({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ci(e,t){return e=wa(22,e,null,t),e.lanes=0,e}function Kc(e,t,a){return wl(t,e.child,null,a),e=Vc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Bm(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),sc(e.return,t,a)}function Xc(e,t,a,r,c,d){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:c,treeForkCount:d}:(x.isBackwards=t,x.rendering=null,x.renderingStartTime=0,x.last=r,x.tail=a,x.tailMode=c,x.treeForkCount=d)}function $m(e,t,a){var r=t.pendingProps,c=r.revealOrder,d=r.tail;r=r.children;var x=Ot.current,S=(x&2)!==0;if(S?(x=x&1|2,t.flags|=128):x&=1,te(Ot,x),Jt(e,t,r,a),r=We?Kr:0,!S&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Bm(e,a,t);else if(e.tag===19)Bm(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(a=t.child,c=null;a!==null;)e=a.alternate,e!==null&&pi(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),Xc(t,!1,c,a,d,r);break;case"backwards":case"unstable_legacy-backwards":for(a=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&pi(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}Xc(t,!0,a,null,d,r);break;case"together":Xc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function _n(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Zn|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(nr(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,a=gn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=gn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Qc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ii(e)))}function u0(e,t,a){switch(t.tag){case 3:Pe(t,t.stateNode.containerInfo),$n(t,Lt,e.memoizedState.cache),bl();break;case 27:case 5:Wt(t);break;case 4:Pe(t,t.stateNode.containerInfo);break;case 10:$n(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,yc(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(Vn(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Hm(e,t,a):(Vn(t),e=_n(e,t,a),e!==null?e.sibling:null);Vn(t);break;case 19:var c=(e.flags&128)!==0;if(r=(a&t.childLanes)!==0,r||(nr(e,t,a,!1),r=(a&t.childLanes)!==0),c){if(r)return $m(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),te(Ot,Ot.current),r)break;return null;case 22:return t.lanes=0,Dm(e,t,a,t.pendingProps);case 24:$n(t,Lt,e.memoizedState.cache)}return _n(e,t,a)}function qm(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ht=!0;else{if(!Qc(e,a)&&(t.flags&128)===0)return Ht=!1,u0(e,t,a);Ht=(e.flags&131072)!==0}else Ht=!1,We&&(t.flags&1048576)!==0&&bf(t,Kr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=jl(t.elementType),t.type=e,typeof e=="function")Io(e)?(r=Cl(e,r),t.tag=1,t=Lm(null,t,e,r,a)):(t.tag=0,t=$c(null,t,e,r,a));else{if(e!=null){var c=e.$$typeof;if(c===V){t.tag=11,t=Tm(null,t,e,r,a);break e}else if(c===F){t.tag=14,t=zm(null,t,e,r,a);break e}}throw t=ue(e)||e,Error(i(306,t,""))}}return t;case 0:return $c(e,t,t.type,t.pendingProps,a);case 1:return r=t.type,c=Cl(r,t.pendingProps),Lm(e,t,r,c,a);case 3:e:{if(Pe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var d=t.memoizedState;c=d.element,mc(e,t),Wr(t,r,null,a);var x=t.memoizedState;if(r=x.cache,$n(t,Lt,r),r!==d.cache&&ic(t,[Lt],a,!0),Ir(),r=x.element,d.isDehydrated)if(d={element:r,isDehydrated:!1,cache:x.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=Um(e,t,r,a);break e}else if(r!==c){c=Ha(Error(i(424)),t),Xr(c),t=Um(e,t,r,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,vt=Ga(e.firstChild),Zt=t,We=!0,Hn=null,qa=!0,a=Df(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(bl(),r===c){t=_n(e,t,a);break e}Jt(e,t,r,a)}t=t.child}return t;case 26:return Ei(e,t),e===null?(a=Ih(t.type,null,t.pendingProps,null))?t.memoizedState=a:We||(a=t.type,e=t.pendingProps,r=Gi(ve.current).createElement(a),r[ce]=t,r[he]=e,Pt(r,a,e),xt(r),t.stateNode=r):t.memoizedState=Ih(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Wt(t),e===null&&We&&(r=t.stateNode=Fh(t.type,t.pendingProps,ve.current),Zt=t,qa=!0,c=vt,Wn(t.type)?(Eu=c,vt=Ga(r.firstChild)):vt=c),Jt(e,t,t.pendingProps.children,a),Ei(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&We&&((c=r=vt)&&(r=$0(r,t.type,t.pendingProps,qa),r!==null?(t.stateNode=r,Zt=t,vt=Ga(r.firstChild),qa=!1,c=!0):c=!1),c||Bn(t)),Wt(t),c=t.type,d=t.pendingProps,x=e!==null?e.memoizedProps:null,r=d.children,Su(c,d)?r=null:x!==null&&Su(c,x)&&(t.flags|=32),t.memoizedState!==null&&(c=vc(e,t,t0,null,null,a),bs._currentValue=c),Ei(e,t),Jt(e,t,r,a),t.child;case 6:return e===null&&We&&((e=a=vt)&&(a=q0(a,t.pendingProps,qa),a!==null?(t.stateNode=a,Zt=t,vt=null,e=!0):e=!1),e||Bn(t)),null;case 13:return Hm(e,t,a);case 4:return Pe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=wl(t,null,r,a):Jt(e,t,r,a),t.child;case 11:return Tm(e,t,t.type,t.pendingProps,a);case 7:return Jt(e,t,t.pendingProps,a),t.child;case 8:return Jt(e,t,t.pendingProps.children,a),t.child;case 12:return Jt(e,t,t.pendingProps.children,a),t.child;case 10:return r=t.pendingProps,$n(t,t.type,r.value),Jt(e,t,r.children,a),t.child;case 9:return c=t.type._context,r=t.pendingProps.children,Sl(t),c=Ft(c),r=r(c),t.flags|=1,Jt(e,t,r,a),t.child;case 14:return zm(e,t,t.type,t.pendingProps,a);case 15:return Om(e,t,t.type,t.pendingProps,a);case 19:return $m(e,t,a);case 31:return c0(e,t,a);case 22:return Dm(e,t,a,t.pendingProps);case 24:return Sl(t),r=Ft(Lt),e===null?(c=uc(),c===null&&(c=mt,d=oc(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=a),c=d),t.memoizedState={parent:r,cache:c},fc(t),$n(t,Lt,c)):((e.lanes&a)!==0&&(mc(e,t),Wr(t,null,null,a),Ir()),c=e.memoizedState,d=t.memoizedState,c.parent!==r?(c={parent:r,cache:r},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),$n(t,Lt,r)):(r=d.cache,$n(t,Lt,r),r!==c.cache&&ic(t,[Lt],a,!0))),Jt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function jn(e){e.flags|=4}function Zc(e,t,a,r,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(hh())e.flags|=8192;else throw Nl=di,dc}else e.flags&=-16777217}function Ym(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!np(t))if(hh())e.flags|=8192;else throw Nl=di,dc}function Ri(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?ca():536870912,e.lanes|=t,pr|=t)}function rs(e,t){if(!We)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function St(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var c=e.child;c!==null;)a|=c.lanes|c.childLanes,r|=c.subtreeFlags&65011712,r|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)a|=c.lanes|c.childLanes,r|=c.subtreeFlags,r|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function d0(e,t,a){var r=t.pendingProps;switch(ac(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return St(t),null;case 1:return St(t),null;case 3:return a=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),bn(Lt),Xe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(ar(t)?jn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,lc())),St(t),null;case 26:var c=t.type,d=t.memoizedState;return e===null?(jn(t),d!==null?(St(t),Ym(t,d)):(St(t),Zc(t,c,null,r,a))):d?d!==e.memoizedState?(jn(t),St(t),Ym(t,d)):(St(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&jn(t),St(t),Zc(t,c,e,r,a)),null;case 27:if(ma(t),a=ve.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jn(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return St(t),null}e=ae.current,ar(t)?Sf(t):(e=Fh(c,r,a),t.stateNode=e,jn(t))}return St(t),null;case 5:if(ma(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jn(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return St(t),null}if(d=ae.current,ar(t))Sf(t);else{var x=Gi(ve.current);switch(d){case 1:d=x.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:d=x.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":d=x.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":d=x.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":d=x.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof r.is=="string"?x.createElement("select",{is:r.is}):x.createElement("select"),r.multiple?d.multiple=!0:r.size&&(d.size=r.size);break;default:d=typeof r.is=="string"?x.createElement(c,{is:r.is}):x.createElement(c)}}d[ce]=t,d[he]=r;e:for(x=t.child;x!==null;){if(x.tag===5||x.tag===6)d.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===t)break e;for(;x.sibling===null;){if(x.return===null||x.return===t)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}t.stateNode=d;e:switch(Pt(d,c,r),c){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&jn(t)}}return St(t),Zc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&jn(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(i(166));if(e=ve.current,ar(t)){if(e=t.stateNode,a=t.memoizedProps,r=null,c=Zt,c!==null)switch(c.tag){case 27:case 5:r=c.memoizedProps}e[ce]=t,e=!!(e.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||Hh(e.nodeValue,a)),e||Bn(t,!0)}else e=Gi(e).createTextNode(r),e[ce]=t,t.stateNode=e}return St(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(r=ar(t),a!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[ce]=t}else bl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;St(t),e=!1}else a=lc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Ca(t),t):(Ca(t),null);if((t.flags&128)!==0)throw Error(i(558))}return St(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=ar(t),r!==null&&r.dehydrated!==null){if(e===null){if(!c)throw Error(i(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[ce]=t}else bl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;St(t),c=!1}else c=lc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Ca(t),t):(Ca(t),null)}return Ca(t),(t.flags&128)!==0?(t.lanes=a,t):(a=r!==null,e=e!==null&&e.memoizedState!==null,a&&(r=t.child,c=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(c=r.alternate.memoizedState.cachePool.pool),d=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(d=r.memoizedState.cachePool.pool),d!==c&&(r.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Ri(t,t.updateQueue),St(t),null);case 4:return Xe(),e===null&&gu(t.stateNode.containerInfo),St(t),null;case 10:return bn(t.type),St(t),null;case 19:if(B(Ot),r=t.memoizedState,r===null)return St(t),null;if(c=(t.flags&128)!==0,d=r.rendering,d===null)if(c)rs(r,!1);else{if(Ct!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=pi(e),d!==null){for(t.flags|=128,rs(r,!1),e=d.updateQueue,t.updateQueue=e,Ri(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)gf(a,e),a=a.sibling;return te(Ot,Ot.current&1|2),We&&xn(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&ht()>Mi&&(t.flags|=128,c=!0,rs(r,!1),t.lanes=4194304)}else{if(!c)if(e=pi(d),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,Ri(t,e),rs(r,!0),r.tail===null&&r.tailMode==="hidden"&&!d.alternate&&!We)return St(t),null}else 2*ht()-r.renderingStartTime>Mi&&a!==536870912&&(t.flags|=128,c=!0,rs(r,!1),t.lanes=4194304);r.isBackwards?(d.sibling=t.child,t.child=d):(e=r.last,e!==null?e.sibling=d:t.child=d,r.last=d)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ht(),e.sibling=null,a=Ot.current,te(Ot,c?a&1|2:a&1),We&&xn(t,r.treeForkCount),e):(St(t),null);case 22:case 23:return Ca(t),xc(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(a&536870912)!==0&&(t.flags&128)===0&&(St(t),t.subtreeFlags&6&&(t.flags|=8192)):St(t),a=t.updateQueue,a!==null&&Ri(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==a&&(t.flags|=2048),e!==null&&B(_l),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),bn(Lt),St(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function f0(e,t){switch(ac(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return bn(Lt),Xe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ma(t),null;case 31:if(t.memoizedState!==null){if(Ca(t),t.alternate===null)throw Error(i(340));bl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ca(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));bl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return B(Ot),null;case 4:return Xe(),null;case 10:return bn(t.type),null;case 22:case 23:return Ca(t),xc(),e!==null&&B(_l),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return bn(Lt),null;case 25:return null;default:return null}}function Gm(e,t){switch(ac(t),t.tag){case 3:bn(Lt),Xe();break;case 26:case 27:case 5:ma(t);break;case 4:Xe();break;case 31:t.memoizedState!==null&&Ca(t);break;case 13:Ca(t);break;case 19:B(Ot);break;case 10:bn(t.type);break;case 22:case 23:Ca(t),xc(),e!==null&&B(_l);break;case 24:bn(Lt)}}function ss(e,t){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var c=r.next;a=c;do{if((a.tag&e)===e){r=void 0;var d=a.create,x=a.inst;r=d(),x.destroy=r}a=a.next}while(a!==c)}}catch(S){it(t,t.return,S)}}function Xn(e,t,a){try{var r=t.updateQueue,c=r!==null?r.lastEffect:null;if(c!==null){var d=c.next;r=d;do{if((r.tag&e)===e){var x=r.inst,S=x.destroy;if(S!==void 0){x.destroy=void 0,c=t;var R=a,L=S;try{L()}catch(Q){it(c,R,Q)}}}r=r.next}while(r!==d)}}catch(Q){it(t,t.return,Q)}}function Vm(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{kf(t,a)}catch(r){it(e,e.return,r)}}}function Km(e,t,a){a.props=Cl(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(r){it(e,t,r)}}function is(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof a=="function"?e.refCleanup=a(r):a.current=r}}catch(c){it(e,t,c)}}function cn(e,t){var a=e.ref,r=e.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(c){it(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(c){it(e,t,c)}else a.current=null}function Xm(e){var t=e.type,a=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(c){it(e,e.return,c)}}function Fc(e,t,a){try{var r=e.stateNode;k0(r,e.type,a,t),r[he]=t}catch(c){it(e,e.return,c)}}function Qm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Wn(e.type)||e.tag===4}function Jc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Qm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Wn(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Pc(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=hn));else if(r!==4&&(r===27&&Wn(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Pc(e,t,a),e=e.sibling;e!==null;)Pc(e,t,a),e=e.sibling}function Ti(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(r!==4&&(r===27&&Wn(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Ti(e,t,a),e=e.sibling;e!==null;)Ti(e,t,a),e=e.sibling}function Zm(e){var t=e.stateNode,a=e.memoizedProps;try{for(var r=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Pt(t,r,a),t[ce]=e,t[he]=a}catch(d){it(e,e.return,d)}}var Nn=!1,Bt=!1,Ic=!1,Fm=typeof WeakSet=="function"?WeakSet:Set,Kt=null;function m0(e,t){if(e=e.containerInfo,bu=Ji,e=sf(e),Ko(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var c=r.anchorOffset,d=r.focusNode;r=r.focusOffset;try{a.nodeType,d.nodeType}catch{a=null;break e}var x=0,S=-1,R=-1,L=0,Q=0,I=e,U=null;t:for(;;){for(var Y;I!==a||c!==0&&I.nodeType!==3||(S=x+c),I!==d||r!==0&&I.nodeType!==3||(R=x+r),I.nodeType===3&&(x+=I.nodeValue.length),(Y=I.firstChild)!==null;)U=I,I=Y;for(;;){if(I===e)break t;if(U===a&&++L===c&&(S=x),U===d&&++Q===r&&(R=x),(Y=I.nextSibling)!==null)break;I=U,U=I.parentNode}I=Y}a=S===-1||R===-1?null:{start:S,end:R}}else a=null}a=a||{start:0,end:0}}else a=null;for(vu={focusedElem:e,selectionRange:a},Ji=!1,Kt=t;Kt!==null;)if(t=Kt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Kt=e;else for(;Kt!==null;){switch(t=Kt,d=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)c=e[a],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,a=t,c=d.memoizedProps,d=d.memoizedState,r=a.stateNode;try{var be=Cl(a.type,c);e=r.getSnapshotBeforeUpdate(be,d),r.__reactInternalSnapshotBeforeUpdate=e}catch(Re){it(a,a.return,Re)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)ju(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":ju(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,Kt=e;break}Kt=t.return}}function Jm(e,t,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:En(e,a),r&4&&ss(5,a);break;case 1:if(En(e,a),r&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(x){it(a,a.return,x)}else{var c=Cl(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(x){it(a,a.return,x)}}r&64&&Vm(a),r&512&&is(a,a.return);break;case 3:if(En(e,a),r&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{kf(e,t)}catch(x){it(a,a.return,x)}}break;case 27:t===null&&r&4&&Zm(a);case 26:case 5:En(e,a),t===null&&r&4&&Xm(a),r&512&&is(a,a.return);break;case 12:En(e,a);break;case 31:En(e,a),r&4&&Wm(e,a);break;case 13:En(e,a),r&4&&eh(e,a),r&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=_0.bind(null,a),Y0(e,a))));break;case 22:if(r=a.memoizedState!==null||Nn,!r){t=t!==null&&t.memoizedState!==null||Bt,c=Nn;var d=Bt;Nn=r,(Bt=t)&&!d?Cn(e,a,(a.subtreeFlags&8772)!==0):En(e,a),Nn=c,Bt=d}break;case 30:break;default:En(e,a)}}function Pm(e){var t=e.alternate;t!==null&&(e.alternate=null,Pm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ft(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var jt=null,pa=!1;function wn(e,t,a){for(a=a.child;a!==null;)Im(e,t,a),a=a.sibling}function Im(e,t,a){if(Tt&&typeof Tt.onCommitFiberUnmount=="function")try{Tt.onCommitFiberUnmount(Qt,a)}catch{}switch(a.tag){case 26:Bt||cn(a,t),wn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Bt||cn(a,t);var r=jt,c=pa;Wn(a.type)&&(jt=a.stateNode,pa=!1),wn(e,t,a),gs(a.stateNode),jt=r,pa=c;break;case 5:Bt||cn(a,t);case 6:if(r=jt,c=pa,jt=null,wn(e,t,a),jt=r,pa=c,jt!==null)if(pa)try{(jt.nodeType===9?jt.body:jt.nodeName==="HTML"?jt.ownerDocument.body:jt).removeChild(a.stateNode)}catch(d){it(a,t,d)}else try{jt.removeChild(a.stateNode)}catch(d){it(a,t,d)}break;case 18:jt!==null&&(pa?(e=jt,Vh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),jr(e)):Vh(jt,a.stateNode));break;case 4:r=jt,c=pa,jt=a.stateNode.containerInfo,pa=!0,wn(e,t,a),jt=r,pa=c;break;case 0:case 11:case 14:case 15:Xn(2,a,t),Bt||Xn(4,a,t),wn(e,t,a);break;case 1:Bt||(cn(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"&&Km(a,t,r)),wn(e,t,a);break;case 21:wn(e,t,a);break;case 22:Bt=(r=Bt)||a.memoizedState!==null,wn(e,t,a),Bt=r;break;default:wn(e,t,a)}}function Wm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{jr(e)}catch(a){it(t,t.return,a)}}}function eh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{jr(e)}catch(a){it(t,t.return,a)}}function h0(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Fm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Fm),t;default:throw Error(i(435,e.tag))}}function zi(e,t){var a=h0(e);t.forEach(function(r){if(!a.has(r)){a.add(r);var c=j0.bind(null,e,r);r.then(c,c)}})}function ga(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var c=a[r],d=e,x=t,S=x;e:for(;S!==null;){switch(S.tag){case 27:if(Wn(S.type)){jt=S.stateNode,pa=!1;break e}break;case 5:jt=S.stateNode,pa=!1;break e;case 3:case 4:jt=S.stateNode.containerInfo,pa=!0;break e}S=S.return}if(jt===null)throw Error(i(160));Im(d,x,c),jt=null,pa=!1,d=c.alternate,d!==null&&(d.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)th(t,e),t=t.sibling}var Wa=null;function th(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ga(t,e),xa(e),r&4&&(Xn(3,e,e.return),ss(3,e),Xn(5,e,e.return));break;case 1:ga(t,e),xa(e),r&512&&(Bt||a===null||cn(a,a.return)),r&64&&Nn&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?r:a.concat(r))));break;case 26:var c=Wa;if(ga(t,e),xa(e),r&512&&(Bt||a===null||cn(a,a.return)),r&4){var d=a!==null?a.memoizedState:null;if(r=e.memoizedState,a===null)if(r===null)if(e.stateNode===null){e:{r=e.type,a=e.memoizedProps,c=c.ownerDocument||c;t:switch(r){case"title":d=c.getElementsByTagName("title")[0],(!d||d[Ye]||d[ce]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=c.createElement(r),c.head.insertBefore(d,c.querySelector("head > title"))),Pt(d,r,a),d[ce]=e,xt(d),r=d;break e;case"link":var x=tp("link","href",c).get(r+(a.href||""));if(x){for(var S=0;S<x.length;S++)if(d=x[S],d.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&d.getAttribute("rel")===(a.rel==null?null:a.rel)&&d.getAttribute("title")===(a.title==null?null:a.title)&&d.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){x.splice(S,1);break t}}d=c.createElement(r),Pt(d,r,a),c.head.appendChild(d);break;case"meta":if(x=tp("meta","content",c).get(r+(a.content||""))){for(S=0;S<x.length;S++)if(d=x[S],d.getAttribute("content")===(a.content==null?null:""+a.content)&&d.getAttribute("name")===(a.name==null?null:a.name)&&d.getAttribute("property")===(a.property==null?null:a.property)&&d.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&d.getAttribute("charset")===(a.charSet==null?null:a.charSet)){x.splice(S,1);break t}}d=c.createElement(r),Pt(d,r,a),c.head.appendChild(d);break;default:throw Error(i(468,r))}d[ce]=e,xt(d),r=d}e.stateNode=r}else ap(c,e.type,e.stateNode);else e.stateNode=ep(c,r,e.memoizedProps);else d!==r?(d===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):d.count--,r===null?ap(c,e.type,e.stateNode):ep(c,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Fc(e,e.memoizedProps,a.memoizedProps)}break;case 27:ga(t,e),xa(e),r&512&&(Bt||a===null||cn(a,a.return)),a!==null&&r&4&&Fc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(ga(t,e),xa(e),r&512&&(Bt||a===null||cn(a,a.return)),e.flags&32){c=e.stateNode;try{Xl(c,"")}catch(be){it(e,e.return,be)}}r&4&&e.stateNode!=null&&(c=e.memoizedProps,Fc(e,c,a!==null?a.memoizedProps:c)),r&1024&&(Ic=!0);break;case 6:if(ga(t,e),xa(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,a=e.stateNode;try{a.nodeValue=r}catch(be){it(e,e.return,be)}}break;case 3:if(Xi=null,c=Wa,Wa=Vi(t.containerInfo),ga(t,e),Wa=c,xa(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{jr(t.containerInfo)}catch(be){it(e,e.return,be)}Ic&&(Ic=!1,ah(e));break;case 4:r=Wa,Wa=Vi(e.stateNode.containerInfo),ga(t,e),xa(e),Wa=r;break;case 12:ga(t,e),xa(e);break;case 31:ga(t,e),xa(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,zi(e,r)));break;case 13:ga(t,e),xa(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Di=ht()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,zi(e,r)));break;case 22:c=e.memoizedState!==null;var R=a!==null&&a.memoizedState!==null,L=Nn,Q=Bt;if(Nn=L||c,Bt=Q||R,ga(t,e),Bt=Q,Nn=L,xa(e),r&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(a===null||R||Nn||Bt||Rl(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){R=a=t;try{if(d=R.stateNode,c)x=d.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{S=R.stateNode;var I=R.memoizedProps.style,U=I!=null&&I.hasOwnProperty("display")?I.display:null;S.style.display=U==null||typeof U=="boolean"?"":(""+U).trim()}}catch(be){it(R,R.return,be)}}}else if(t.tag===6){if(a===null){R=t;try{R.stateNode.nodeValue=c?"":R.memoizedProps}catch(be){it(R,R.return,be)}}}else if(t.tag===18){if(a===null){R=t;try{var Y=R.stateNode;c?Kh(Y,!0):Kh(R.stateNode,!1)}catch(be){it(R,R.return,be)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,zi(e,a))));break;case 19:ga(t,e),xa(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,zi(e,r)));break;case 30:break;case 21:break;default:ga(t,e),xa(e)}}function xa(e){var t=e.flags;if(t&2){try{for(var a,r=e.return;r!==null;){if(Qm(r)){a=r;break}r=r.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var c=a.stateNode,d=Jc(e);Ti(e,d,c);break;case 5:var x=a.stateNode;a.flags&32&&(Xl(x,""),a.flags&=-33);var S=Jc(e);Ti(e,S,x);break;case 3:case 4:var R=a.stateNode.containerInfo,L=Jc(e);Pc(e,L,R);break;default:throw Error(i(161))}}catch(Q){it(e,e.return,Q)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ah(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ah(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function En(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Jm(e,t.alternate,t),t=t.sibling}function Rl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Xn(4,t,t.return),Rl(t);break;case 1:cn(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Km(t,t.return,a),Rl(t);break;case 27:gs(t.stateNode);case 26:case 5:cn(t,t.return),Rl(t);break;case 22:t.memoizedState===null&&Rl(t);break;case 30:Rl(t);break;default:Rl(t)}e=e.sibling}}function Cn(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,c=e,d=t,x=d.flags;switch(d.tag){case 0:case 11:case 15:Cn(c,d,a),ss(4,d);break;case 1:if(Cn(c,d,a),r=d,c=r.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(L){it(r,r.return,L)}if(r=d,c=r.updateQueue,c!==null){var S=r.stateNode;try{var R=c.shared.hiddenCallbacks;if(R!==null)for(c.shared.hiddenCallbacks=null,c=0;c<R.length;c++)Mf(R[c],S)}catch(L){it(r,r.return,L)}}a&&x&64&&Vm(d),is(d,d.return);break;case 27:Zm(d);case 26:case 5:Cn(c,d,a),a&&r===null&&x&4&&Xm(d),is(d,d.return);break;case 12:Cn(c,d,a);break;case 31:Cn(c,d,a),a&&x&4&&Wm(c,d);break;case 13:Cn(c,d,a),a&&x&4&&eh(c,d);break;case 22:d.memoizedState===null&&Cn(c,d,a),is(d,d.return);break;case 30:break;default:Cn(c,d,a)}t=t.sibling}}function Wc(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Qr(a))}function eu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Qr(e))}function en(e,t,a,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)nh(e,t,a,r),t=t.sibling}function nh(e,t,a,r){var c=t.flags;switch(t.tag){case 0:case 11:case 15:en(e,t,a,r),c&2048&&ss(9,t);break;case 1:en(e,t,a,r);break;case 3:en(e,t,a,r),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Qr(e)));break;case 12:if(c&2048){en(e,t,a,r),e=t.stateNode;try{var d=t.memoizedProps,x=d.id,S=d.onPostCommit;typeof S=="function"&&S(x,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(R){it(t,t.return,R)}}else en(e,t,a,r);break;case 31:en(e,t,a,r);break;case 13:en(e,t,a,r);break;case 23:break;case 22:d=t.stateNode,x=t.alternate,t.memoizedState!==null?d._visibility&2?en(e,t,a,r):os(e,t):d._visibility&2?en(e,t,a,r):(d._visibility|=2,fr(e,t,a,r,(t.subtreeFlags&10256)!==0||!1)),c&2048&&Wc(x,t);break;case 24:en(e,t,a,r),c&2048&&eu(t.alternate,t);break;default:en(e,t,a,r)}}function fr(e,t,a,r,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,x=t,S=a,R=r,L=x.flags;switch(x.tag){case 0:case 11:case 15:fr(d,x,S,R,c),ss(8,x);break;case 23:break;case 22:var Q=x.stateNode;x.memoizedState!==null?Q._visibility&2?fr(d,x,S,R,c):os(d,x):(Q._visibility|=2,fr(d,x,S,R,c)),c&&L&2048&&Wc(x.alternate,x);break;case 24:fr(d,x,S,R,c),c&&L&2048&&eu(x.alternate,x);break;default:fr(d,x,S,R,c)}t=t.sibling}}function os(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,r=t,c=r.flags;switch(r.tag){case 22:os(a,r),c&2048&&Wc(r.alternate,r);break;case 24:os(a,r),c&2048&&eu(r.alternate,r);break;default:os(a,r)}t=t.sibling}}var cs=8192;function mr(e,t,a){if(e.subtreeFlags&cs)for(e=e.child;e!==null;)lh(e,t,a),e=e.sibling}function lh(e,t,a){switch(e.tag){case 26:mr(e,t,a),e.flags&cs&&e.memoizedState!==null&&eb(a,Wa,e.memoizedState,e.memoizedProps);break;case 5:mr(e,t,a);break;case 3:case 4:var r=Wa;Wa=Vi(e.stateNode.containerInfo),mr(e,t,a),Wa=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=cs,cs=16777216,mr(e,t,a),cs=r):mr(e,t,a));break;default:mr(e,t,a)}}function rh(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function us(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];Kt=r,ih(r,e)}rh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)sh(e),e=e.sibling}function sh(e){switch(e.tag){case 0:case 11:case 15:us(e),e.flags&2048&&Xn(9,e,e.return);break;case 3:us(e);break;case 12:us(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Oi(e)):us(e);break;default:us(e)}}function Oi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];Kt=r,ih(r,e)}rh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Xn(8,t,t.return),Oi(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Oi(t));break;default:Oi(t)}e=e.sibling}}function ih(e,t){for(;Kt!==null;){var a=Kt;switch(a.tag){case 0:case 11:case 15:Xn(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var r=a.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Qr(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,Kt=r;else e:for(a=e;Kt!==null;){r=Kt;var c=r.sibling,d=r.return;if(Pm(r),r===a){Kt=null;break e}if(c!==null){c.return=d,Kt=c;break e}Kt=d}}}var p0={getCacheForType:function(e){var t=Ft(Lt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Ft(Lt).controller.signal}},g0=typeof WeakMap=="function"?WeakMap:Map,rt=0,mt=null,Ve=null,Fe=0,st=0,Ra=null,Qn=!1,hr=!1,tu=!1,Rn=0,Ct=0,Zn=0,Tl=0,au=0,Ta=0,pr=0,ds=null,ya=null,nu=!1,Di=0,oh=0,Mi=1/0,ki=null,Fn=null,Yt=0,Jn=null,gr=null,Tn=0,lu=0,ru=null,ch=null,fs=0,su=null;function za(){return(rt&2)!==0&&Fe!==0?Fe&-Fe:k.T!==null?fu():ne()}function uh(){if(Ta===0)if((Fe&536870912)===0||We){var e=se;se<<=1,(se&3932160)===0&&(se=262144),Ta=e}else Ta=536870912;return e=Ea.current,e!==null&&(e.flags|=32),Ta}function ba(e,t,a){(e===mt&&(st===2||st===9)||e.cancelPendingCommit!==null)&&(xr(e,0),Pn(e,Fe,Ta,!1)),ja(e,a),((rt&2)===0||e!==mt)&&(e===mt&&((rt&2)===0&&(Tl|=a),Ct===4&&Pn(e,Fe,Ta,!1)),un(e))}function dh(e,t,a){if((rt&6)!==0)throw Error(i(327));var r=!a&&(t&127)===0&&(t&e.expiredLanes)===0||kt(e,t),c=r?b0(e,t):ou(e,t,!0),d=r;do{if(c===0){hr&&!r&&Pn(e,t,0,!1);break}else{if(a=e.current.alternate,d&&!x0(a)){c=ou(e,t,!1),d=!1;continue}if(c===2){if(d=t,e.errorRecoveryDisabledLanes&d)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){t=x;e:{var S=e;c=ds;var R=S.current.memoizedState.isDehydrated;if(R&&(xr(S,x).flags|=256),x=ou(S,x,!1),x!==2){if(tu&&!R){S.errorRecoveryDisabledLanes|=d,Tl|=d,c=4;break e}d=ya,ya=c,d!==null&&(ya===null?ya=d:ya.push.apply(ya,d))}c=x}if(d=!1,c!==2)continue}}if(c===1){xr(e,0),Pn(e,t,0,!0);break}e:{switch(r=e,d=c,d){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Pn(r,t,Ta,!Qn);break e;case 2:ya=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=Di+300-ht(),10<c)){if(Pn(r,t,Ta,!Qn),Ue(r,0,!0)!==0)break e;Tn=t,r.timeoutHandle=Yh(fh.bind(null,r,a,ya,ki,nu,t,Ta,Tl,pr,Qn,d,"Throttled",-0,0),c);break e}fh(r,a,ya,ki,nu,t,Ta,Tl,pr,Qn,d,null,-0,0)}}break}while(!0);un(e)}function fh(e,t,a,r,c,d,x,S,R,L,Q,I,U,Y){if(e.timeoutHandle=-1,I=t.subtreeFlags,I&8192||(I&16785408)===16785408){I={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:hn},lh(t,d,I);var be=(d&62914560)===d?Di-ht():(d&4194048)===d?oh-ht():0;if(be=tb(I,be),be!==null){Tn=d,e.cancelPendingCommit=be(vh.bind(null,e,t,d,a,r,c,x,S,R,Q,I,null,U,Y)),Pn(e,d,x,!L);return}}vh(e,t,d,a,r,c,x,S,R)}function x0(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var r=0;r<a.length;r++){var c=a[r],d=c.getSnapshot;c=c.value;try{if(!Na(d(),c))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Pn(e,t,a,r){t&=~au,t&=~Tl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var c=t;0<c;){var d=31-Mt(c),x=1<<d;r[d]=-1,c&=~x}a!==0&&$l(e,a,t)}function Ai(){return(rt&6)===0?(ms(0),!1):!0}function iu(){if(Ve!==null){if(st===0)var e=Ve.return;else e=Ve,yn=vl=null,jc(e),ir=null,Fr=0,e=Ve;for(;e!==null;)Gm(e.alternate,e),e=e.return;Ve=null}}function xr(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,U0(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Tn=0,iu(),mt=e,Ve=a=gn(e.current,null),Fe=t,st=0,Ra=null,Qn=!1,hr=kt(e,t),tu=!1,pr=Ta=au=Tl=Zn=Ct=0,ya=ds=null,nu=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var c=31-Mt(r),d=1<<c;t|=e[c],r&=~d}return Rn=t,ai(),a}function mh(e,t){He=null,k.H=ns,t===sr||t===ui?(t=Tf(),st=3):t===dc?(t=Tf(),st=4):st=t===Bc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ra=t,Ve===null&&(Ct=1,Ni(e,Ha(t,e.current)))}function hh(){var e=Ea.current;return e===null?!0:(Fe&4194048)===Fe?Ya===null:(Fe&62914560)===Fe||(Fe&536870912)!==0?e===Ya:!1}function ph(){var e=k.H;return k.H=ns,e===null?ns:e}function gh(){var e=k.A;return k.A=p0,e}function Li(){Ct=4,Qn||(Fe&4194048)!==Fe&&Ea.current!==null||(hr=!0),(Zn&134217727)===0&&(Tl&134217727)===0||mt===null||Pn(mt,Fe,Ta,!1)}function ou(e,t,a){var r=rt;rt|=2;var c=ph(),d=gh();(mt!==e||Fe!==t)&&(ki=null,xr(e,t)),t=!1;var x=Ct;e:do try{if(st!==0&&Ve!==null){var S=Ve,R=Ra;switch(st){case 8:iu(),x=6;break e;case 3:case 2:case 9:case 6:Ea.current===null&&(t=!0);var L=st;if(st=0,Ra=null,yr(e,S,R,L),a&&hr){x=0;break e}break;default:L=st,st=0,Ra=null,yr(e,S,R,L)}}y0(),x=Ct;break}catch(Q){mh(e,Q)}while(!0);return t&&e.shellSuspendCounter++,yn=vl=null,rt=r,k.H=c,k.A=d,Ve===null&&(mt=null,Fe=0,ai()),x}function y0(){for(;Ve!==null;)xh(Ve)}function b0(e,t){var a=rt;rt|=2;var r=ph(),c=gh();mt!==e||Fe!==t?(ki=null,Mi=ht()+500,xr(e,t)):hr=kt(e,t);e:do try{if(st!==0&&Ve!==null){t=Ve;var d=Ra;t:switch(st){case 1:st=0,Ra=null,yr(e,t,d,1);break;case 2:case 9:if(Cf(d)){st=0,Ra=null,yh(t);break}t=function(){st!==2&&st!==9||mt!==e||(st=7),un(e)},d.then(t,t);break e;case 3:st=7;break e;case 4:st=5;break e;case 7:Cf(d)?(st=0,Ra=null,yh(t)):(st=0,Ra=null,yr(e,t,d,7));break;case 5:var x=null;switch(Ve.tag){case 26:x=Ve.memoizedState;case 5:case 27:var S=Ve;if(x?np(x):S.stateNode.complete){st=0,Ra=null;var R=S.sibling;if(R!==null)Ve=R;else{var L=S.return;L!==null?(Ve=L,Ui(L)):Ve=null}break t}}st=0,Ra=null,yr(e,t,d,5);break;case 6:st=0,Ra=null,yr(e,t,d,6);break;case 8:iu(),Ct=6;break e;default:throw Error(i(462))}}v0();break}catch(Q){mh(e,Q)}while(!0);return yn=vl=null,k.H=r,k.A=c,rt=a,Ve!==null?0:(mt=null,Fe=0,ai(),Ct)}function v0(){for(;Ve!==null&&!ra();)xh(Ve)}function xh(e){var t=qm(e.alternate,e,Rn);e.memoizedProps=e.pendingProps,t===null?Ui(e):Ve=t}function yh(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Am(a,t,t.pendingProps,t.type,void 0,Fe);break;case 11:t=Am(a,t,t.pendingProps,t.type.render,t.ref,Fe);break;case 5:jc(t);default:Gm(a,t),t=Ve=gf(t,Rn),t=qm(a,t,Rn)}e.memoizedProps=e.pendingProps,t===null?Ui(e):Ve=t}function yr(e,t,a,r){yn=vl=null,jc(t),ir=null,Fr=0;var c=t.return;try{if(o0(e,c,t,a,Fe)){Ct=1,Ni(e,Ha(a,e.current)),Ve=null;return}}catch(d){if(c!==null)throw Ve=c,d;Ct=1,Ni(e,Ha(a,e.current)),Ve=null;return}t.flags&32768?(We||r===1?e=!0:hr||(Fe&536870912)!==0?e=!1:(Qn=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ea.current,r!==null&&r.tag===13&&(r.flags|=16384))),bh(t,e)):Ui(t)}function Ui(e){var t=e;do{if((t.flags&32768)!==0){bh(t,Qn);return}e=t.return;var a=d0(t.alternate,t,Rn);if(a!==null){Ve=a;return}if(t=t.sibling,t!==null){Ve=t;return}Ve=t=e}while(t!==null);Ct===0&&(Ct=5)}function bh(e,t){do{var a=f0(e.alternate,e);if(a!==null){a.flags&=32767,Ve=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Ve=e;return}Ve=e=a}while(e!==null);Ct=6,Ve=null}function vh(e,t,a,r,c,d,x,S,R){e.cancelPendingCommit=null;do Hi();while(Yt!==0);if((rt&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(d=t.lanes|t.childLanes,d|=Jo,dl(e,a,d,x,S,R),e===mt&&(Ve=mt=null,Fe=0),gr=t,Jn=e,Tn=a,lu=d,ru=c,ch=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,N0(Ze,function(){return wh(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=k.T,k.T=null,c=P.p,P.p=2,x=rt,rt|=4;try{m0(e,t,a)}finally{rt=x,P.p=c,k.T=r}}Yt=1,Sh(),_h(),jh()}}function Sh(){if(Yt===1){Yt=0;var e=Jn,t=gr,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=k.T,k.T=null;var r=P.p;P.p=2;var c=rt;rt|=4;try{th(t,e);var d=vu,x=sf(e.containerInfo),S=d.focusedElem,R=d.selectionRange;if(x!==S&&S&&S.ownerDocument&&rf(S.ownerDocument.documentElement,S)){if(R!==null&&Ko(S)){var L=R.start,Q=R.end;if(Q===void 0&&(Q=L),"selectionStart"in S)S.selectionStart=L,S.selectionEnd=Math.min(Q,S.value.length);else{var I=S.ownerDocument||document,U=I&&I.defaultView||window;if(U.getSelection){var Y=U.getSelection(),be=S.textContent.length,Re=Math.min(R.start,be),ut=R.end===void 0?Re:Math.min(R.end,be);!Y.extend&&Re>ut&&(x=ut,ut=Re,Re=x);var M=lf(S,Re),z=lf(S,ut);if(M&&z&&(Y.rangeCount!==1||Y.anchorNode!==M.node||Y.anchorOffset!==M.offset||Y.focusNode!==z.node||Y.focusOffset!==z.offset)){var A=I.createRange();A.setStart(M.node,M.offset),Y.removeAllRanges(),Re>ut?(Y.addRange(A),Y.extend(z.node,z.offset)):(A.setEnd(z.node,z.offset),Y.addRange(A))}}}}for(I=[],Y=S;Y=Y.parentNode;)Y.nodeType===1&&I.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<I.length;S++){var J=I[S];J.element.scrollLeft=J.left,J.element.scrollTop=J.top}}Ji=!!bu,vu=bu=null}finally{rt=c,P.p=r,k.T=a}}e.current=t,Yt=2}}function _h(){if(Yt===2){Yt=0;var e=Jn,t=gr,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=k.T,k.T=null;var r=P.p;P.p=2;var c=rt;rt|=4;try{Jm(e,t.alternate,t)}finally{rt=c,P.p=r,k.T=a}}Yt=3}}function jh(){if(Yt===4||Yt===3){Yt=0,sa();var e=Jn,t=gr,a=Tn,r=ch;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Yt=5:(Yt=0,gr=Jn=null,Nh(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(Fn=null),H(a),t=t.stateNode,Tt&&typeof Tt.onCommitFiberRoot=="function")try{Tt.onCommitFiberRoot(Qt,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=k.T,c=P.p,P.p=2,k.T=null;try{for(var d=e.onRecoverableError,x=0;x<r.length;x++){var S=r[x];d(S.value,{componentStack:S.stack})}}finally{k.T=t,P.p=c}}(Tn&3)!==0&&Hi(),un(e),c=e.pendingLanes,(a&261930)!==0&&(c&42)!==0?e===su?fs++:(fs=0,su=e):fs=0,ms(0)}}function Nh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Qr(t)))}function Hi(){return Sh(),_h(),jh(),wh()}function wh(){if(Yt!==5)return!1;var e=Jn,t=lu;lu=0;var a=H(Tn),r=k.T,c=P.p;try{P.p=32>a?32:a,k.T=null,a=ru,ru=null;var d=Jn,x=Tn;if(Yt=0,gr=Jn=null,Tn=0,(rt&6)!==0)throw Error(i(331));var S=rt;if(rt|=4,sh(d.current),nh(d,d.current,x,a),rt=S,ms(0,!1),Tt&&typeof Tt.onPostCommitFiberRoot=="function")try{Tt.onPostCommitFiberRoot(Qt,d)}catch{}return!0}finally{P.p=c,k.T=r,Nh(e,t)}}function Eh(e,t,a){t=Ha(a,t),t=Hc(e.stateNode,t,2),e=Gn(e,t,2),e!==null&&(ja(e,2),un(e))}function it(e,t,a){if(e.tag===3)Eh(e,e,a);else for(;t!==null;){if(t.tag===3){Eh(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Fn===null||!Fn.has(r))){e=Ha(a,e),a=Cm(2),r=Gn(t,a,2),r!==null&&(Rm(a,r,t,e),ja(r,2),un(r));break}}t=t.return}}function cu(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new g0;var c=new Set;r.set(t,c)}else c=r.get(t),c===void 0&&(c=new Set,r.set(t,c));c.has(a)||(tu=!0,c.add(a),e=S0.bind(null,e,t,a),t.then(e,e))}function S0(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,mt===e&&(Fe&a)===a&&(Ct===4||Ct===3&&(Fe&62914560)===Fe&&300>ht()-Di?(rt&2)===0&&xr(e,0):au|=a,pr===Fe&&(pr=0)),un(e)}function Ch(e,t){t===0&&(t=ca()),e=xl(e,t),e!==null&&(ja(e,t),un(e))}function _0(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Ch(e,a)}function j0(e,t){var a=0;switch(e.tag){case 31:case 13:var r=e.stateNode,c=e.memoizedState;c!==null&&(a=c.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Ch(e,a)}function N0(e,t){return _a(e,t)}var Bi=null,br=null,uu=!1,$i=!1,du=!1,In=0;function un(e){e!==br&&e.next===null&&(br===null?Bi=br=e:br=br.next=e),$i=!0,uu||(uu=!0,E0())}function ms(e,t){if(!du&&$i){du=!0;do for(var a=!1,r=Bi;r!==null;){if(e!==0){var c=r.pendingLanes;if(c===0)var d=0;else{var x=r.suspendedLanes,S=r.pingedLanes;d=(1<<31-Mt(42|e)+1)-1,d&=c&~(x&~S),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(a=!0,Oh(r,d))}else d=Fe,d=Ue(r,r===mt?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(d&3)===0||kt(r,d)||(a=!0,Oh(r,d));r=r.next}while(a);du=!1}}function w0(){Rh()}function Rh(){$i=uu=!1;var e=0;In!==0&&L0()&&(e=In);for(var t=ht(),a=null,r=Bi;r!==null;){var c=r.next,d=Th(r,t);d===0?(r.next=null,a===null?Bi=c:a.next=c,c===null&&(br=a)):(a=r,(e!==0||(d&3)!==0)&&($i=!0)),r=c}Yt!==0&&Yt!==5||ms(e),In!==0&&(In=0)}function Th(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var x=31-Mt(d),S=1<<x,R=c[x];R===-1?((S&a)===0||(S&r)!==0)&&(c[x]=oa(S,t)):R<=t&&(e.expiredLanes|=S),d&=~S}if(t=mt,a=Fe,a=Ue(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,a===0||e===t&&(st===2||st===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ka(r),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||kt(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(r!==null&&ka(r),H(a)){case 2:case 8:a=ke;break;case 32:a=Ze;break;case 268435456:a=Nt;break;default:a=Ze}return r=zh.bind(null,e),a=_a(a,r),e.callbackPriority=t,e.callbackNode=a,t}return r!==null&&r!==null&&ka(r),e.callbackPriority=2,e.callbackNode=null,2}function zh(e,t){if(Yt!==0&&Yt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Hi()&&e.callbackNode!==a)return null;var r=Fe;return r=Ue(e,e===mt?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(dh(e,r,t),Th(e,ht()),e.callbackNode!=null&&e.callbackNode===a?zh.bind(null,e):null)}function Oh(e,t){if(Hi())return null;dh(e,t,!0)}function E0(){H0(function(){(rt&6)!==0?_a(Se,w0):Rh()})}function fu(){if(In===0){var e=lr;e===0&&(e=K,K<<=1,(K&261888)===0&&(K=256)),In=e}return In}function Dh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Zs(""+e)}function Mh(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function C0(e,t,a,r,c){if(t==="submit"&&a&&a.stateNode===c){var d=Dh((c[he]||null).action),x=r.submitter;x&&(t=(t=x[he]||null)?Dh(t.formAction):x.getAttribute("formAction"),t!==null&&(d=t,x=null));var S=new Is("action","action",null,r,c);e.push({event:S,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(In!==0){var R=x?Mh(c,x):new FormData(c);Dc(a,{pending:!0,data:R,method:c.method,action:d},null,R)}}else typeof d=="function"&&(S.preventDefault(),R=x?Mh(c,x):new FormData(c),Dc(a,{pending:!0,data:R,method:c.method,action:d},d,R))},currentTarget:c}]})}}for(var mu=0;mu<Fo.length;mu++){var hu=Fo[mu],R0=hu.toLowerCase(),T0=hu[0].toUpperCase()+hu.slice(1);Ia(R0,"on"+T0)}Ia(uf,"onAnimationEnd"),Ia(df,"onAnimationIteration"),Ia(ff,"onAnimationStart"),Ia("dblclick","onDoubleClick"),Ia("focusin","onFocus"),Ia("focusout","onBlur"),Ia(Ky,"onTransitionRun"),Ia(Xy,"onTransitionStart"),Ia(Qy,"onTransitionCancel"),Ia(mf,"onTransitionEnd"),ln("onMouseEnter",["mouseout","mouseover"]),ln("onMouseLeave",["mouseout","mouseover"]),ln("onPointerEnter",["pointerout","pointerover"]),ln("onPointerLeave",["pointerout","pointerover"]),Vt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Vt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Vt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Vt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Vt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Vt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hs="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),z0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(hs));function kh(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],c=r.event;r=r.listeners;e:{var d=void 0;if(t)for(var x=r.length-1;0<=x;x--){var S=r[x],R=S.instance,L=S.currentTarget;if(S=S.listener,R!==d&&c.isPropagationStopped())break e;d=S,c.currentTarget=L;try{d(c)}catch(Q){ti(Q)}c.currentTarget=null,d=R}else for(x=0;x<r.length;x++){if(S=r[x],R=S.instance,L=S.currentTarget,S=S.listener,R!==d&&c.isPropagationStopped())break e;d=S,c.currentTarget=L;try{d(c)}catch(Q){ti(Q)}c.currentTarget=null,d=R}}}}function Ke(e,t){var a=t[Ne];a===void 0&&(a=t[Ne]=new Set);var r=e+"__bubble";a.has(r)||(Ah(t,e,2,!1),a.add(r))}function pu(e,t,a){var r=0;t&&(r|=4),Ah(a,e,r,t)}var qi="_reactListening"+Math.random().toString(36).slice(2);function gu(e){if(!e[qi]){e[qi]=!0,An.forEach(function(a){a!=="selectionchange"&&(z0.has(a)||pu(a,!1,e),pu(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[qi]||(t[qi]=!0,pu("selectionchange",!1,t))}}function Ah(e,t,a,r){switch(up(t)){case 2:var c=lb;break;case 8:c=rb;break;default:c=Ou}a=c.bind(null,t,a,e),c=void 0,!Lo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),r?c!==void 0?e.addEventListener(t,a,{capture:!0,passive:c}):e.addEventListener(t,a,!0):c!==void 0?e.addEventListener(t,a,{passive:c}):e.addEventListener(t,a,!1)}function xu(e,t,a,r,c){var d=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var x=r.tag;if(x===3||x===4){var S=r.stateNode.containerInfo;if(S===c)break;if(x===4)for(x=r.return;x!==null;){var R=x.tag;if((R===3||R===4)&&x.stateNode.containerInfo===c)return;x=x.return}for(;S!==null;){if(x=yt(S),x===null)return;if(R=x.tag,R===5||R===6||R===26||R===27){r=d=x;continue e}S=S.parentNode}}r=r.return}Bd(function(){var L=d,Q=ko(a),I=[];e:{var U=hf.get(e);if(U!==void 0){var Y=Is,be=e;switch(e){case"keypress":if(Js(a)===0)break e;case"keydown":case"keyup":Y=jy;break;case"focusin":be="focus",Y=$o;break;case"focusout":be="blur",Y=$o;break;case"beforeblur":case"afterblur":Y=$o;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Y=Yd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=dy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=Ey;break;case uf:case df:case ff:Y=hy;break;case mf:Y=Ry;break;case"scroll":case"scrollend":Y=cy;break;case"wheel":Y=zy;break;case"copy":case"cut":case"paste":Y=gy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=Vd;break;case"toggle":case"beforetoggle":Y=Dy}var Re=(t&4)!==0,ut=!Re&&(e==="scroll"||e==="scrollend"),M=Re?U!==null?U+"Capture":null:U;Re=[];for(var z=L,A;z!==null;){var J=z;if(A=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||A===null||M===null||(J=Lr(z,M),J!=null&&Re.push(ps(z,J,A))),ut)break;z=z.return}0<Re.length&&(U=new Y(U,be,null,a,Q),I.push({event:U,listeners:Re}))}}if((t&7)===0){e:{if(U=e==="mouseover"||e==="pointerover",Y=e==="mouseout"||e==="pointerout",U&&a!==Mo&&(be=a.relatedTarget||a.fromElement)&&(yt(be)||be[pe]))break e;if((Y||U)&&(U=Q.window===Q?Q:(U=Q.ownerDocument)?U.defaultView||U.parentWindow:window,Y?(be=a.relatedTarget||a.toElement,Y=L,be=be?yt(be):null,be!==null&&(ut=u(be),Re=be.tag,be!==ut||Re!==5&&Re!==27&&Re!==6)&&(be=null)):(Y=null,be=L),Y!==be)){if(Re=Yd,J="onMouseLeave",M="onMouseEnter",z="mouse",(e==="pointerout"||e==="pointerover")&&(Re=Vd,J="onPointerLeave",M="onPointerEnter",z="pointer"),ut=Y==null?U:et(Y),A=be==null?U:et(be),U=new Re(J,z+"leave",Y,a,Q),U.target=ut,U.relatedTarget=A,J=null,yt(Q)===L&&(Re=new Re(M,z+"enter",be,a,Q),Re.target=A,Re.relatedTarget=ut,J=Re),ut=J,Y&&be)t:{for(Re=O0,M=Y,z=be,A=0,J=M;J;J=Re(J))A++;J=0;for(var we=z;we;we=Re(we))J++;for(;0<A-J;)M=Re(M),A--;for(;0<J-A;)z=Re(z),J--;for(;A--;){if(M===z||z!==null&&M===z.alternate){Re=M;break t}M=Re(M),z=Re(z)}Re=null}else Re=null;Y!==null&&Lh(I,U,Y,Re,!1),be!==null&&ut!==null&&Lh(I,ut,be,Re,!0)}}e:{if(U=L?et(L):window,Y=U.nodeName&&U.nodeName.toLowerCase(),Y==="select"||Y==="input"&&U.type==="file")var nt=Id;else if(Jd(U))if(Wd)nt=Yy;else{nt=$y;var _e=By}else Y=U.nodeName,!Y||Y.toLowerCase()!=="input"||U.type!=="checkbox"&&U.type!=="radio"?L&&Do(L.elementType)&&(nt=Id):nt=qy;if(nt&&(nt=nt(e,L))){Pd(I,nt,a,Q);break e}_e&&_e(e,U,L),e==="focusout"&&L&&U.type==="number"&&L.memoizedProps.value!=null&&Oo(U,"number",U.value)}switch(_e=L?et(L):window,e){case"focusin":(Jd(_e)||_e.contentEditable==="true")&&(Jl=_e,Xo=L,Vr=null);break;case"focusout":Vr=Xo=Jl=null;break;case"mousedown":Qo=!0;break;case"contextmenu":case"mouseup":case"dragend":Qo=!1,of(I,a,Q);break;case"selectionchange":if(Vy)break;case"keydown":case"keyup":of(I,a,Q)}var Be;if(Yo)e:{switch(e){case"compositionstart":var Je="onCompositionStart";break e;case"compositionend":Je="onCompositionEnd";break e;case"compositionupdate":Je="onCompositionUpdate";break e}Je=void 0}else Fl?Zd(e,a)&&(Je="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Je="onCompositionStart");Je&&(Kd&&a.locale!=="ko"&&(Fl||Je!=="onCompositionStart"?Je==="onCompositionEnd"&&Fl&&(Be=$d()):(Ln=Q,Uo="value"in Ln?Ln.value:Ln.textContent,Fl=!0)),_e=Yi(L,Je),0<_e.length&&(Je=new Gd(Je,e,null,a,Q),I.push({event:Je,listeners:_e}),Be?Je.data=Be:(Be=Fd(a),Be!==null&&(Je.data=Be)))),(Be=ky?Ay(e,a):Ly(e,a))&&(Je=Yi(L,"onBeforeInput"),0<Je.length&&(_e=new Gd("onBeforeInput","beforeinput",null,a,Q),I.push({event:_e,listeners:Je}),_e.data=Be)),C0(I,e,L,a,Q)}kh(I,t)})}function ps(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Yi(e,t){for(var a=t+"Capture",r=[];e!==null;){var c=e,d=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||d===null||(c=Lr(e,a),c!=null&&r.unshift(ps(e,c,d)),c=Lr(e,t),c!=null&&r.push(ps(e,c,d))),e.tag===3)return r;e=e.return}return[]}function O0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Lh(e,t,a,r,c){for(var d=t._reactName,x=[];a!==null&&a!==r;){var S=a,R=S.alternate,L=S.stateNode;if(S=S.tag,R!==null&&R===r)break;S!==5&&S!==26&&S!==27||L===null||(R=L,c?(L=Lr(a,d),L!=null&&x.unshift(ps(a,L,R))):c||(L=Lr(a,d),L!=null&&x.push(ps(a,L,R)))),a=a.return}x.length!==0&&e.push({event:t,listeners:x})}var D0=/\r\n?/g,M0=/\u0000|\uFFFD/g;function Uh(e){return(typeof e=="string"?e:""+e).replace(D0,`
9
+ `).replace(M0,"")}function Hh(e,t){return t=Uh(t),Uh(e)===t}function ct(e,t,a,r,c,d){switch(a){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Xl(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Xl(e,""+r);break;case"className":zt(e,"class",r);break;case"tabIndex":zt(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":zt(e,a,r);break;case"style":Ud(e,r,d);break;case"data":if(t!=="object"){zt(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Zs(""+r),e.setAttribute(a,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof d=="function"&&(a==="formAction"?(t!=="input"&&ct(e,t,"name",c.name,c,null),ct(e,t,"formEncType",c.formEncType,c,null),ct(e,t,"formMethod",c.formMethod,c,null),ct(e,t,"formTarget",c.formTarget,c,null)):(ct(e,t,"encType",c.encType,c,null),ct(e,t,"method",c.method,c,null),ct(e,t,"target",c.target,c,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Zs(""+r),e.setAttribute(a,r);break;case"onClick":r!=null&&(e.onclick=hn);break;case"onScroll":r!=null&&Ke("scroll",e);break;case"onScrollEnd":r!=null&&Ke("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(a=r.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}a=Zs(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""+r):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":r===!0?e.setAttribute(a,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,r):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(a,r):e.removeAttribute(a);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(a):e.setAttribute(a,r);break;case"popover":Ke("beforetoggle",e),Ke("toggle",e),Ge(e,"popover",r);break;case"xlinkActuate":aa(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":aa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":aa(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":aa(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":aa(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":aa(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":aa(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":aa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":aa(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Ge(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=iy.get(a)||a,Ge(e,a,r))}}function yu(e,t,a,r,c,d){switch(a){case"style":Ud(e,r,d);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(a=r.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"children":typeof r=="string"?Xl(e,r):(typeof r=="number"||typeof r=="bigint")&&Xl(e,""+r);break;case"onScroll":r!=null&&Ke("scroll",e);break;case"onScrollEnd":r!=null&&Ke("scrollend",e);break;case"onClick":r!=null&&(e.onclick=hn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Pa.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(c=a.endsWith("Capture"),t=a.slice(2,c?a.length-7:void 0),d=e[he]||null,d=d!=null?d[a]:null,typeof d=="function"&&e.removeEventListener(t,d,c),typeof r=="function")){typeof d!="function"&&d!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,r,c);break e}a in e?e[a]=r:r===!0?e.setAttribute(a,""):Ge(e,a,r)}}}function Pt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ke("error",e),Ke("load",e);var r=!1,c=!1,d;for(d in a)if(a.hasOwnProperty(d)){var x=a[d];if(x!=null)switch(d){case"src":r=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:ct(e,t,d,x,a,null)}}c&&ct(e,t,"srcSet",a.srcSet,a,null),r&&ct(e,t,"src",a.src,a,null);return;case"input":Ke("invalid",e);var S=d=x=c=null,R=null,L=null;for(r in a)if(a.hasOwnProperty(r)){var Q=a[r];if(Q!=null)switch(r){case"name":c=Q;break;case"type":x=Q;break;case"checked":R=Q;break;case"defaultChecked":L=Q;break;case"value":d=Q;break;case"defaultValue":S=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(i(137,t));break;default:ct(e,t,r,Q,a,null)}}Md(e,d,S,R,L,x,c,!1);return;case"select":Ke("invalid",e),r=x=d=null;for(c in a)if(a.hasOwnProperty(c)&&(S=a[c],S!=null))switch(c){case"value":d=S;break;case"defaultValue":x=S;break;case"multiple":r=S;default:ct(e,t,c,S,a,null)}t=d,a=x,e.multiple=!!r,t!=null?Kl(e,!!r,t,!1):a!=null&&Kl(e,!!r,a,!0);return;case"textarea":Ke("invalid",e),d=c=r=null;for(x in a)if(a.hasOwnProperty(x)&&(S=a[x],S!=null))switch(x){case"value":r=S;break;case"defaultValue":c=S;break;case"children":d=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(i(91));break;default:ct(e,t,x,S,a,null)}Ad(e,r,c,d);return;case"option":for(R in a)a.hasOwnProperty(R)&&(r=a[R],r!=null)&&(R==="selected"?e.selected=r&&typeof r!="function"&&typeof r!="symbol":ct(e,t,R,r,a,null));return;case"dialog":Ke("beforetoggle",e),Ke("toggle",e),Ke("cancel",e),Ke("close",e);break;case"iframe":case"object":Ke("load",e);break;case"video":case"audio":for(r=0;r<hs.length;r++)Ke(hs[r],e);break;case"image":Ke("error",e),Ke("load",e);break;case"details":Ke("toggle",e);break;case"embed":case"source":case"link":Ke("error",e),Ke("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(L in a)if(a.hasOwnProperty(L)&&(r=a[L],r!=null))switch(L){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:ct(e,t,L,r,a,null)}return;default:if(Do(t)){for(Q in a)a.hasOwnProperty(Q)&&(r=a[Q],r!==void 0&&yu(e,t,Q,r,a,void 0));return}}for(S in a)a.hasOwnProperty(S)&&(r=a[S],r!=null&&ct(e,t,S,r,a,null))}function k0(e,t,a,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,d=null,x=null,S=null,R=null,L=null,Q=null;for(Y in a){var I=a[Y];if(a.hasOwnProperty(Y)&&I!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":R=I;default:r.hasOwnProperty(Y)||ct(e,t,Y,null,r,I)}}for(var U in r){var Y=r[U];if(I=a[U],r.hasOwnProperty(U)&&(Y!=null||I!=null))switch(U){case"type":d=Y;break;case"name":c=Y;break;case"checked":L=Y;break;case"defaultChecked":Q=Y;break;case"value":x=Y;break;case"defaultValue":S=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(i(137,t));break;default:Y!==I&&ct(e,t,U,Y,r,I)}}zo(e,x,S,R,L,Q,d,c);return;case"select":Y=x=S=U=null;for(d in a)if(R=a[d],a.hasOwnProperty(d)&&R!=null)switch(d){case"value":break;case"multiple":Y=R;default:r.hasOwnProperty(d)||ct(e,t,d,null,r,R)}for(c in r)if(d=r[c],R=a[c],r.hasOwnProperty(c)&&(d!=null||R!=null))switch(c){case"value":U=d;break;case"defaultValue":S=d;break;case"multiple":x=d;default:d!==R&&ct(e,t,c,d,r,R)}t=S,a=x,r=Y,U!=null?Kl(e,!!a,U,!1):!!r!=!!a&&(t!=null?Kl(e,!!a,t,!0):Kl(e,!!a,a?[]:"",!1));return;case"textarea":Y=U=null;for(S in a)if(c=a[S],a.hasOwnProperty(S)&&c!=null&&!r.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:ct(e,t,S,null,r,c)}for(x in r)if(c=r[x],d=a[x],r.hasOwnProperty(x)&&(c!=null||d!=null))switch(x){case"value":U=c;break;case"defaultValue":Y=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==d&&ct(e,t,x,c,r,d)}kd(e,U,Y);return;case"option":for(var be in a)U=a[be],a.hasOwnProperty(be)&&U!=null&&!r.hasOwnProperty(be)&&(be==="selected"?e.selected=!1:ct(e,t,be,null,r,U));for(R in r)U=r[R],Y=a[R],r.hasOwnProperty(R)&&U!==Y&&(U!=null||Y!=null)&&(R==="selected"?e.selected=U&&typeof U!="function"&&typeof U!="symbol":ct(e,t,R,U,r,Y));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Re in a)U=a[Re],a.hasOwnProperty(Re)&&U!=null&&!r.hasOwnProperty(Re)&&ct(e,t,Re,null,r,U);for(L in r)if(U=r[L],Y=a[L],r.hasOwnProperty(L)&&U!==Y&&(U!=null||Y!=null))switch(L){case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(i(137,t));break;default:ct(e,t,L,U,r,Y)}return;default:if(Do(t)){for(var ut in a)U=a[ut],a.hasOwnProperty(ut)&&U!==void 0&&!r.hasOwnProperty(ut)&&yu(e,t,ut,void 0,r,U);for(Q in r)U=r[Q],Y=a[Q],!r.hasOwnProperty(Q)||U===Y||U===void 0&&Y===void 0||yu(e,t,Q,U,r,Y);return}}for(var M in a)U=a[M],a.hasOwnProperty(M)&&U!=null&&!r.hasOwnProperty(M)&&ct(e,t,M,null,r,U);for(I in r)U=r[I],Y=a[I],!r.hasOwnProperty(I)||U===Y||U==null&&Y==null||ct(e,t,I,U,r,Y)}function Bh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function A0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var c=a[r],d=c.transferSize,x=c.initiatorType,S=c.duration;if(d&&S&&Bh(x)){for(x=0,S=c.responseEnd,r+=1;r<a.length;r++){var R=a[r],L=R.startTime;if(L>S)break;var Q=R.transferSize,I=R.initiatorType;Q&&Bh(I)&&(R=R.responseEnd,x+=Q*(R<S?1:(S-L)/(R-L)))}if(--r,t+=8*(d+x)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var bu=null,vu=null;function Gi(e){return e.nodeType===9?e:e.ownerDocument}function $h(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function qh(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Su(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var _u=null;function L0(){var e=window.event;return e&&e.type==="popstate"?e===_u?!1:(_u=e,!0):(_u=null,!1)}var Yh=typeof setTimeout=="function"?setTimeout:void 0,U0=typeof clearTimeout=="function"?clearTimeout:void 0,Gh=typeof Promise=="function"?Promise:void 0,H0=typeof queueMicrotask=="function"?queueMicrotask:typeof Gh<"u"?function(e){return Gh.resolve(null).then(e).catch(B0)}:Yh;function B0(e){setTimeout(function(){throw e})}function Wn(e){return e==="head"}function Vh(e,t){var a=t,r=0;do{var c=a.nextSibling;if(e.removeChild(a),c&&c.nodeType===8)if(a=c.data,a==="/$"||a==="/&"){if(r===0){e.removeChild(c),jr(t);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")gs(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,gs(a);for(var d=a.firstChild;d;){var x=d.nextSibling,S=d.nodeName;d[Ye]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&d.rel.toLowerCase()==="stylesheet"||a.removeChild(d),d=x}}else a==="body"&&gs(e.ownerDocument.body);a=c}while(a);jr(t)}function Kh(e,t){var a=e;e=0;do{var r=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),r&&r.nodeType===8)if(a=r.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=r}while(a)}function ju(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":ju(a),ft(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function $0(e,t,a,r){for(;e.nodeType===1;){var c=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Ye])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=Ga(e.nextSibling),e===null)break}return null}function q0(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Ga(e.nextSibling),e===null))return null;return e}function Xh(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ga(e.nextSibling),e===null))return null;return e}function Nu(e){return e.data==="$?"||e.data==="$~"}function wu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Y0(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var r=function(){t(),a.removeEventListener("DOMContentLoaded",r)};a.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function Ga(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Eu=null;function Qh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return Ga(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function Zh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function Fh(e,t,a){switch(t=Gi(a),e){case"html":if(e=t.documentElement,!e)throw Error(i(452));return e;case"head":if(e=t.head,!e)throw Error(i(453));return e;case"body":if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function gs(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ft(e)}var Va=new Map,Jh=new Set;function Vi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var zn=P.d;P.d={f:G0,r:V0,D:K0,C:X0,L:Q0,m:Z0,X:J0,S:F0,M:P0};function G0(){var e=zn.f(),t=Ai();return e||t}function V0(e){var t=wt(e);t!==null&&t.tag===5&&t.type==="form"?mm(t):zn.r(e)}var vr=typeof document>"u"?null:document;function Ph(e,t,a){var r=vr;if(r&&typeof t=="string"&&t){var c=La(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),Jh.has(c)||(Jh.add(c),e={rel:e,crossOrigin:a,href:t},r.querySelector(c)===null&&(t=r.createElement("link"),Pt(t,"link",e),xt(t),r.head.appendChild(t)))}}function K0(e){zn.D(e),Ph("dns-prefetch",e,null)}function X0(e,t){zn.C(e,t),Ph("preconnect",e,t)}function Q0(e,t,a){zn.L(e,t,a);var r=vr;if(r&&e&&t){var c='link[rel="preload"][as="'+La(t)+'"]';t==="image"&&a&&a.imageSrcSet?(c+='[imagesrcset="'+La(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(c+='[imagesizes="'+La(a.imageSizes)+'"]')):c+='[href="'+La(e)+'"]';var d=c;switch(t){case"style":d=Sr(e);break;case"script":d=_r(e)}Va.has(d)||(e=y({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Va.set(d,e),r.querySelector(c)!==null||t==="style"&&r.querySelector(xs(d))||t==="script"&&r.querySelector(ys(d))||(t=r.createElement("link"),Pt(t,"link",e),xt(t),r.head.appendChild(t)))}}function Z0(e,t){zn.m(e,t);var a=vr;if(a&&e){var r=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+La(r)+'"][href="'+La(e)+'"]',d=c;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=_r(e)}if(!Va.has(d)&&(e=y({rel:"modulepreload",href:e},t),Va.set(d,e),a.querySelector(c)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(ys(d)))return}r=a.createElement("link"),Pt(r,"link",e),xt(r),a.head.appendChild(r)}}}function F0(e,t,a){zn.S(e,t,a);var r=vr;if(r&&e){var c=qt(r).hoistableStyles,d=Sr(e);t=t||"default";var x=c.get(d);if(!x){var S={loading:0,preload:null};if(x=r.querySelector(xs(d)))S.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Va.get(d))&&Cu(e,a);var R=x=r.createElement("link");xt(R),Pt(R,"link",e),R._p=new Promise(function(L,Q){R.onload=L,R.onerror=Q}),R.addEventListener("load",function(){S.loading|=1}),R.addEventListener("error",function(){S.loading|=2}),S.loading|=4,Ki(x,t,r)}x={type:"stylesheet",instance:x,count:1,state:S},c.set(d,x)}}}function J0(e,t){zn.X(e,t);var a=vr;if(a&&e){var r=qt(a).hoistableScripts,c=_r(e),d=r.get(c);d||(d=a.querySelector(ys(c)),d||(e=y({src:e,async:!0},t),(t=Va.get(c))&&Ru(e,t),d=a.createElement("script"),xt(d),Pt(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(c,d))}}function P0(e,t){zn.M(e,t);var a=vr;if(a&&e){var r=qt(a).hoistableScripts,c=_r(e),d=r.get(c);d||(d=a.querySelector(ys(c)),d||(e=y({src:e,async:!0,type:"module"},t),(t=Va.get(c))&&Ru(e,t),d=a.createElement("script"),xt(d),Pt(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(c,d))}}function Ih(e,t,a,r){var c=(c=ve.current)?Vi(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Sr(a.href),a=qt(c).hoistableStyles,r=a.get(t),r||(r={type:"style",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Sr(a.href);var d=qt(c).hoistableStyles,x=d.get(e);if(x||(c=c.ownerDocument||c,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,x),(d=c.querySelector(xs(e)))&&!d._p&&(x.instance=d,x.state.loading=5),Va.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Va.set(e,a),d||I0(c,e,a,x.state))),t&&r===null)throw Error(i(528,""));return x}if(t&&r!==null)throw Error(i(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=_r(a),a=qt(c).hoistableScripts,r=a.get(t),r||(r={type:"script",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Sr(e){return'href="'+La(e)+'"'}function xs(e){return'link[rel="stylesheet"]['+e+"]"}function Wh(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function I0(e,t,a,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),Pt(t,"link",a),xt(t),e.head.appendChild(t))}function _r(e){return'[src="'+La(e)+'"]'}function ys(e){return"script[async]"+e}function ep(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+La(a.href)+'"]');if(r)return t.instance=r,xt(r),r;var c=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),xt(r),Pt(r,"style",c),Ki(r,a.precedence,e),t.instance=r;case"stylesheet":c=Sr(a.href);var d=e.querySelector(xs(c));if(d)return t.state.loading|=4,t.instance=d,xt(d),d;r=Wh(a),(c=Va.get(c))&&Cu(r,c),d=(e.ownerDocument||e).createElement("link"),xt(d);var x=d;return x._p=new Promise(function(S,R){x.onload=S,x.onerror=R}),Pt(d,"link",r),t.state.loading|=4,Ki(d,a.precedence,e),t.instance=d;case"script":return d=_r(a.src),(c=e.querySelector(ys(d)))?(t.instance=c,xt(c),c):(r=a,(c=Va.get(d))&&(r=y({},a),Ru(r,c)),e=e.ownerDocument||e,c=e.createElement("script"),xt(c),Pt(c,"link",r),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(i(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Ki(r,a.precedence,e));return t.instance}function Ki(e,t,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=r.length?r[r.length-1]:null,d=c,x=0;x<r.length;x++){var S=r[x];if(S.dataset.precedence===t)d=S;else if(d!==c)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Cu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Ru(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Xi=null;function tp(e,t,a){if(Xi===null){var r=new Map,c=Xi=new Map;c.set(a,r)}else c=Xi,r=c.get(a),r||(r=new Map,c.set(a,r));if(r.has(e))return r;for(r.set(e,null),a=a.getElementsByTagName(e),c=0;c<a.length;c++){var d=a[c];if(!(d[Ye]||d[ce]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var x=d.getAttribute(t)||"";x=e+x;var S=r.get(x);S?S.push(d):r.set(x,[d])}}return r}function ap(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function W0(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function np(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function eb(e,t,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var c=Sr(r.href),d=t.querySelector(xs(c));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Qi.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=d,xt(d);return}d=t.ownerDocument||t,r=Wh(r),(c=Va.get(c))&&Cu(r,c),d=d.createElement("link"),xt(d);var x=d;x._p=new Promise(function(S,R){x.onload=S,x.onerror=R}),Pt(d,"link",r),a.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Qi.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Tu=0;function tb(e,t){return e.stylesheets&&e.count===0&&Fi(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var r=setTimeout(function(){if(e.stylesheets&&Fi(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&Tu===0&&(Tu=62500*A0());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Fi(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>Tu?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(c)}}:null}function Qi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Fi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zi=null;function Fi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zi=new Map,t.forEach(ab,e),Zi=null,Qi.call(e))}function ab(e,t){if(!(t.state.loading&4)){var a=Zi.get(e);if(a)var r=a.get(null);else{a=new Map,Zi.set(e,a);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<c.length;d++){var x=c[d];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(a.set(x.dataset.precedence,x),r=x)}r&&a.set(null,r)}c=t.instance,x=c.getAttribute("data-precedence"),d=a.get(x)||r,d===r&&a.set(null,c),a.set(x,c),this.count++,r=Qi.bind(this),c.addEventListener("load",r),c.addEventListener("error",r),d?d.parentNode.insertBefore(c,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var bs={$$typeof:$,Provider:null,Consumer:null,_currentValue:fe,_currentValue2:fe,_threadCount:0};function nb(e,t,a,r,c,d,x,S,R){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Aa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Aa(0),this.hiddenUpdates=Aa(null),this.identifierPrefix=r,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function lp(e,t,a,r,c,d,x,S,R,L,Q,I){return e=new nb(e,t,a,x,R,L,Q,I,S),t=1,d===!0&&(t|=24),d=wa(3,null,null,t),e.current=d,d.stateNode=e,t=oc(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:r,isDehydrated:a,cache:t},fc(d),e}function rp(e){return e?(e=Wl,e):Wl}function sp(e,t,a,r,c,d){c=rp(c),r.context===null?r.context=c:r.pendingContext=c,r=Yn(t),r.payload={element:a},d=d===void 0?null:d,d!==null&&(r.callback=d),a=Gn(e,r,t),a!==null&&(ba(a,e,t),Pr(a,e,t))}function ip(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function zu(e,t){ip(e,t),(e=e.alternate)&&ip(e,t)}function op(e){if(e.tag===13||e.tag===31){var t=xl(e,67108864);t!==null&&ba(t,e,67108864),zu(e,67108864)}}function cp(e){if(e.tag===13||e.tag===31){var t=za();t=D(t);var a=xl(e,t);a!==null&&ba(a,e,t),zu(e,t)}}var Ji=!0;function lb(e,t,a,r){var c=k.T;k.T=null;var d=P.p;try{P.p=2,Ou(e,t,a,r)}finally{P.p=d,k.T=c}}function rb(e,t,a,r){var c=k.T;k.T=null;var d=P.p;try{P.p=8,Ou(e,t,a,r)}finally{P.p=d,k.T=c}}function Ou(e,t,a,r){if(Ji){var c=Du(r);if(c===null)xu(e,t,r,Pi,a),dp(e,r);else if(ib(c,e,t,a,r))r.stopPropagation();else if(dp(e,r),t&4&&-1<sb.indexOf(e)){for(;c!==null;){var d=wt(c);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var x=$e(d.pendingLanes);if(x!==0){var S=d;for(S.pendingLanes|=2,S.entangledLanes|=2;x;){var R=1<<31-Mt(x);S.entanglements[1]|=R,x&=~R}un(d),(rt&6)===0&&(Mi=ht()+500,ms(0))}}break;case 31:case 13:S=xl(d,2),S!==null&&ba(S,d,2),Ai(),zu(d,2)}if(d=Du(r),d===null&&xu(e,t,r,Pi,a),d===c)break;c=d}c!==null&&r.stopPropagation()}else xu(e,t,r,null,a)}}function Du(e){return e=ko(e),Mu(e)}var Pi=null;function Mu(e){if(Pi=null,e=yt(e),e!==null){var t=u(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=m(t),e!==null)return e;e=null}else if(a===31){if(e=p(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Pi=e,null}function up(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ia()){case Se:return 2;case ke:return 8;case Ze:case pt:return 32;case Nt:return 268435456;default:return 32}default:return 32}}var ku=!1,el=null,tl=null,al=null,vs=new Map,Ss=new Map,nl=[],sb="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function dp(e,t){switch(e){case"focusin":case"focusout":el=null;break;case"dragenter":case"dragleave":tl=null;break;case"mouseover":case"mouseout":al=null;break;case"pointerover":case"pointerout":vs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ss.delete(t.pointerId)}}function _s(e,t,a,r,c,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:d,targetContainers:[c]},t!==null&&(t=wt(t),t!==null&&op(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function ib(e,t,a,r,c){switch(t){case"focusin":return el=_s(el,e,t,a,r,c),!0;case"dragenter":return tl=_s(tl,e,t,a,r,c),!0;case"mouseover":return al=_s(al,e,t,a,r,c),!0;case"pointerover":var d=c.pointerId;return vs.set(d,_s(vs.get(d)||null,e,t,a,r,c)),!0;case"gotpointercapture":return d=c.pointerId,Ss.set(d,_s(Ss.get(d)||null,e,t,a,r,c)),!0}return!1}function fp(e){var t=yt(e.target);if(t!==null){var a=u(t);if(a!==null){if(t=a.tag,t===13){if(t=m(a),t!==null){e.blockedOn=t,ie(e.priority,function(){cp(a)});return}}else if(t===31){if(t=p(a),t!==null){e.blockedOn=t,ie(e.priority,function(){cp(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ii(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Du(e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);Mo=r,a.target.dispatchEvent(r),Mo=null}else return t=wt(a),t!==null&&op(t),e.blockedOn=a,!1;t.shift()}return!0}function mp(e,t,a){Ii(e)&&a.delete(t)}function ob(){ku=!1,el!==null&&Ii(el)&&(el=null),tl!==null&&Ii(tl)&&(tl=null),al!==null&&Ii(al)&&(al=null),vs.forEach(mp),Ss.forEach(mp)}function Wi(e,t){e.blockedOn===t&&(e.blockedOn=null,ku||(ku=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,ob)))}var eo=null;function hp(e){eo!==e&&(eo=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){eo===e&&(eo=null);for(var t=0;t<e.length;t+=3){var a=e[t],r=e[t+1],c=e[t+2];if(typeof r!="function"){if(Mu(r||a)===null)continue;break}var d=wt(a);d!==null&&(e.splice(t,3),t-=3,Dc(d,{pending:!0,data:c,method:a.method,action:r},r,c))}}))}function jr(e){function t(R){return Wi(R,e)}el!==null&&Wi(el,e),tl!==null&&Wi(tl,e),al!==null&&Wi(al,e),vs.forEach(t),Ss.forEach(t);for(var a=0;a<nl.length;a++){var r=nl[a];r.blockedOn===e&&(r.blockedOn=null)}for(;0<nl.length&&(a=nl[0],a.blockedOn===null);)fp(a),a.blockedOn===null&&nl.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var c=a[r],d=a[r+1],x=c[he]||null;if(typeof d=="function")x||hp(a);else if(x){var S=null;if(d&&d.hasAttribute("formAction")){if(c=d,x=d[he]||null)S=x.formAction;else if(Mu(c)!==null)continue}else S=x.action;typeof S=="function"?a[r+1]=S:(a.splice(r,3),r-=3),hp(a)}}}function pp(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(x){return c=x})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),r||setTimeout(a,20)}function a(){if(!r&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function Au(e){this._internalRoot=e}to.prototype.render=Au.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var a=t.current,r=za();sp(a,r,e,t,null,null)},to.prototype.unmount=Au.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;sp(e.current,2,null,e,null,null),Ai(),t[pe]=null}};function to(e){this._internalRoot=e}to.prototype.unstable_scheduleHydration=function(e){if(e){var t=ne();e={blockedOn:null,target:e,priority:t};for(var a=0;a<nl.length&&t!==0&&t<nl[a].priority;a++);nl.splice(a,0,e),a===0&&fp(e)}};var gp=l.version;if(gp!=="19.2.4")throw Error(i(527,gp,"19.2.4"));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=h(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var cb={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ao=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ao.isDisabled&&ao.supportsFiber)try{Qt=ao.inject(cb),Tt=ao}catch{}}return ws.createRoot=function(e,t){if(!o(e))throw Error(i(299));var a=!1,r="",c=jm,d=Nm,x=wm;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(x=t.onRecoverableError)),t=lp(e,1,!1,null,null,a,r,null,c,d,x,pp),e[pe]=t.current,gu(e),new Au(t)},ws.hydrateRoot=function(e,t,a){if(!o(e))throw Error(i(299));var r=!1,c="",d=jm,x=Nm,S=wm,R=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(d=a.onUncaughtError),a.onCaughtError!==void 0&&(x=a.onCaughtError),a.onRecoverableError!==void 0&&(S=a.onRecoverableError),a.formState!==void 0&&(R=a.formState)),t=lp(e,1,!0,t,a??null,r,c,R,d,x,S,pp),t.context=rp(null),a=t.current,r=za(),r=D(r),c=Yn(r),c.callback=null,Gn(a,c,r),a=r,t.current.lanes=a,ja(t,a),un(t),e[pe]=t.current,gu(e),new to(t)},ws.version="19.2.4",ws}var Qp;function Cv(){if(Qp)return Gu.exports;Qp=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Gu.exports=Ev(),Gu.exports}var Rv=Cv();var tx=n=>{throw TypeError(n)},Tv=(n,l,s)=>l.has(n)||tx("Cannot "+s),Qu=(n,l,s)=>(Tv(n,l,"read from private field"),s?s.call(n):l.get(n)),zv=(n,l,s)=>l.has(n)?tx("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(n):l.set(n,s),Zp="popstate";function Fp(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function Ov(n={}){function l(i,o){let u=o.state?.masked,{pathname:m,search:p,hash:g}=u||i.location;return Ls("",{pathname:m,search:p,hash:g},o.state&&o.state.usr||null,o.state&&o.state.key||"default",u?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function s(i,o){return typeof o=="string"?o:mn(o)}return Mv(l,s,null,n)}function qe(n,l){if(n===!1||n===null||typeof n>"u")throw new Error(l)}function Rt(n,l){if(!n){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function Dv(){return Math.random().toString(36).substring(2,10)}function Jp(n,l){return{usr:n.state,key:n.key,idx:l,masked:n.unstable_mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function Ls(n,l,s=null,i,o){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof l=="string"?Mn(l):l,state:s,key:l&&l.key||i||Dv(),unstable_mask:o}}function mn({pathname:n="/",search:l="",hash:s=""}){return l&&l!=="?"&&(n+=l.charAt(0)==="?"?l:"?"+l),s&&s!=="#"&&(n+=s.charAt(0)==="#"?s:"#"+s),n}function Mn(n){let l={};if(n){let s=n.indexOf("#");s>=0&&(l.hash=n.substring(s),n=n.substring(0,s));let i=n.indexOf("?");i>=0&&(l.search=n.substring(i),n=n.substring(0,i)),n&&(l.pathname=n)}return l}function Mv(n,l,s,i={}){let{window:o=document.defaultView,v5Compat:u=!1}=i,m=o.history,p="POP",g=null,h=v();h==null&&(h=0,m.replaceState({...m.state,idx:h},""));function v(){return(m.state||{idx:null}).idx}function y(){p="POP";let O=v(),G=O==null?null:O-h;h=O,g&&g({action:p,location:T.location,delta:G})}function _(O,G){p="PUSH";let Z=Fp(O)?O:Ls(T.location,O,G);h=v()+1;let $=Jp(Z,h),V=T.createHref(Z.unstable_mask||Z);try{m.pushState($,"",V)}catch(X){if(X instanceof DOMException&&X.name==="DataCloneError")throw X;o.location.assign(V)}u&&g&&g({action:p,location:T.location,delta:1})}function j(O,G){p="REPLACE";let Z=Fp(O)?O:Ls(T.location,O,G);h=v();let $=Jp(Z,h),V=T.createHref(Z.unstable_mask||Z);m.replaceState($,"",V),u&&g&&g({action:p,location:T.location,delta:0})}function N(O){return ax(O)}let T={get action(){return p},get location(){return n(o,m)},listen(O){if(g)throw new Error("A history only accepts one active listener");return o.addEventListener(Zp,y),g=O,()=>{o.removeEventListener(Zp,y),g=null}},createHref(O){return l(o,O)},createURL:N,encodeLocation(O){let G=N(O);return{pathname:G.pathname,search:G.search,hash:G.hash}},push:_,replace:j,go(O){return m.go(O)}};return T}function ax(n,l=!1){let s="http://localhost";typeof window<"u"&&(s=window.location.origin!=="null"?window.location.origin:window.location.href),qe(s,"No window.location.(origin|href) available to create URL");let i=typeof n=="string"?n:mn(n);return i=i.replace(/ $/,"%20"),!l&&i.startsWith("//")&&(i=s+i),new URL(i,s)}var Ts,Pp=class{constructor(n){if(zv(this,Ts,new Map),n)for(let[l,s]of n)this.set(l,s)}get(n){if(Qu(this,Ts).has(n))return Qu(this,Ts).get(n);if(n.defaultValue!==void 0)return n.defaultValue;throw new Error("No value found for context")}set(n,l){Qu(this,Ts).set(n,l)}};Ts=new WeakMap;var kv=new Set(["lazy","caseSensitive","path","id","index","children"]);function Av(n){return kv.has(n)}var Lv=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function Uv(n){return Lv.has(n)}function Hv(n){return n.index===!0}function Us(n,l,s=[],i={},o=!1){return n.map((u,m)=>{let p=[...s,String(m)],g=typeof u.id=="string"?u.id:p.join("-");if(qe(u.index!==!0||!u.children,"Cannot specify children on an index route"),qe(o||!i[g],`Found a route id collision on id "${g}". Route id's must be globally unique within Data Router usages`),Hv(u)){let h={...u,id:g};return i[g]=Ip(h,l(h)),h}else{let h={...u,id:g,children:void 0};return i[g]=Ip(h,l(h)),u.children&&(h.children=Us(u.children,l,p,i,o)),h}})}function Ip(n,l){return Object.assign(n,{...l,...typeof l.lazy=="object"&&l.lazy!=null?{lazy:{...n.lazy,...l.lazy}}:{}})}function rl(n,l,s="/"){return zs(n,l,s,!1)}function zs(n,l,s,i){let o=typeof l=="string"?Mn(l):l,u=Qa(o.pathname||"/",s);if(u==null)return null;let m=nx(n);$v(m);let p=null;for(let g=0;p==null&&g<m.length;++g){let h=Pv(u);p=Fv(m[g],h,i)}return p}function Bv(n,l){let{route:s,pathname:i,params:o}=n;return{id:s.id,pathname:i,params:o,data:l[s.id],loaderData:l[s.id],handle:s.handle}}function nx(n,l=[],s=[],i="",o=!1){let u=(m,p,g=o,h)=>{let v={relativePath:h===void 0?m.path||"":h,caseSensitive:m.caseSensitive===!0,childrenIndex:p,route:m};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(i)&&g)return;qe(v.relativePath.startsWith(i),`Absolute route path "${v.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(i.length)}let y=tn([i,v.relativePath]),_=s.concat(v);m.children&&m.children.length>0&&(qe(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),nx(m.children,l,_,y,g)),!(m.path==null&&!m.index)&&l.push({path:y,score:Qv(y,m.index),routesMeta:_})};return n.forEach((m,p)=>{if(m.path===""||!m.path?.includes("?"))u(m,p);else for(let g of lx(m.path))u(m,p,!0,g)}),l}function lx(n){let l=n.split("/");if(l.length===0)return[];let[s,...i]=l,o=s.endsWith("?"),u=s.replace(/\?$/,"");if(i.length===0)return o?[u,""]:[u];let m=lx(i.join("/")),p=[];return p.push(...m.map(g=>g===""?u:[u,g].join("/"))),o&&p.push(...m),p.map(g=>n.startsWith("/")&&g===""?"/":g)}function $v(n){n.sort((l,s)=>l.score!==s.score?s.score-l.score:Zv(l.routesMeta.map(i=>i.childrenIndex),s.routesMeta.map(i=>i.childrenIndex)))}var qv=/^:[\w-]+$/,Yv=3,Gv=2,Vv=1,Kv=10,Xv=-2,Wp=n=>n==="*";function Qv(n,l){let s=n.split("/"),i=s.length;return s.some(Wp)&&(i+=Xv),l&&(i+=Gv),s.filter(o=>!Wp(o)).reduce((o,u)=>o+(qv.test(u)?Yv:u===""?Vv:Kv),i)}function Zv(n,l){return n.length===l.length&&n.slice(0,-1).every((i,o)=>i===l[o])?n[n.length-1]-l[l.length-1]:0}function Fv(n,l,s=!1){let{routesMeta:i}=n,o={},u="/",m=[];for(let p=0;p<i.length;++p){let g=i[p],h=p===i.length-1,v=u==="/"?l:l.slice(u.length)||"/",y=bo({path:g.relativePath,caseSensitive:g.caseSensitive,end:h},v),_=g.route;if(!y&&h&&s&&!i[i.length-1].route.index&&(y=bo({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},v)),!y)return null;Object.assign(o,y.params),m.push({params:o,pathname:tn([u,y.pathname]),pathnameBase:e1(tn([u,y.pathnameBase])),route:_}),y.pathnameBase!=="/"&&(u=tn([u,y.pathnameBase]))}return m}function bo(n,l){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[s,i]=Jv(n.path,n.caseSensitive,n.end),o=l.match(s);if(!o)return null;let u=o[0],m=u.replace(/(.)\/+$/,"$1"),p=o.slice(1);return{params:i.reduce((h,{paramName:v,isOptional:y},_)=>{if(v==="*"){let N=p[_]||"";m=u.slice(0,u.length-N.length).replace(/(.)\/+$/,"$1")}const j=p[_];return y&&!j?h[v]=void 0:h[v]=(j||"").replace(/%2F/g,"/"),h},{}),pathname:u,pathnameBase:m,pattern:n}}function Jv(n,l=!1,s=!0){Rt(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let i=[],o="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,p,g,h,v)=>{if(i.push({paramName:p,isOptional:g!=null}),g){let y=v.charAt(h+m.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(i.push({paramName:"*"}),o+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?o+="\\/*$":n!==""&&n!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,l?void 0:"i"),i]}function Pv(n){try{return n.split("/").map(l=>decodeURIComponent(l).replace(/\//g,"%2F")).join("/")}catch(l){return Rt(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${l}).`),n}}function Qa(n,l){if(l==="/")return n;if(!n.toLowerCase().startsWith(l.toLowerCase()))return null;let s=l.endsWith("/")?l.length-1:l.length,i=n.charAt(s);return i&&i!=="/"?null:n.slice(s)||"/"}function Iv({basename:n,pathname:l}){return l==="/"?n:tn([n,l])}var rx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_d=n=>rx.test(n);function Wv(n,l="/"){let{pathname:s,search:i="",hash:o=""}=typeof n=="string"?Mn(n):n,u;return s?(s=s.replace(/\/\/+/g,"/"),s.startsWith("/")?u=eg(s.substring(1),"/"):u=eg(s,l)):u=l,{pathname:u,search:t1(i),hash:a1(o)}}function eg(n,l){let s=l.replace(/\/+$/,"").split("/");return n.split("/").forEach(o=>{o===".."?s.length>1&&s.pop():o!=="."&&s.push(o)}),s.length>1?s.join("/"):"/"}function Zu(n,l,s,i){return`Cannot include a '${n}' character in a manually specified \`to.${l}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function sx(n){return n.filter((l,s)=>s===0||l.route.path&&l.route.path.length>0)}function _o(n){let l=sx(n);return l.map((s,i)=>i===l.length-1?s.pathname:s.pathnameBase)}function $s(n,l,s,i=!1){let o;typeof n=="string"?o=Mn(n):(o={...n},qe(!o.pathname||!o.pathname.includes("?"),Zu("?","pathname","search",o)),qe(!o.pathname||!o.pathname.includes("#"),Zu("#","pathname","hash",o)),qe(!o.search||!o.search.includes("#"),Zu("#","search","hash",o)));let u=n===""||o.pathname==="",m=u?"/":o.pathname,p;if(m==null)p=s;else{let y=l.length-1;if(!i&&m.startsWith("..")){let _=m.split("/");for(;_[0]==="..";)_.shift(),y-=1;o.pathname=_.join("/")}p=y>=0?l[y]:"/"}let g=Wv(o,p),h=m&&m!=="/"&&m.endsWith("/"),v=(u||m===".")&&s.endsWith("/");return!g.pathname.endsWith("/")&&(h||v)&&(g.pathname+="/"),g}var tn=n=>n.join("/").replace(/\/\/+/g,"/"),e1=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),t1=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,a1=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,qs=class{constructor(n,l,s,i=!1){this.status=n,this.statusText=l||"",this.internal=i,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function Dr(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function Ys(n){return n.map(l=>l.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var ix=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ox(n,l){let s=n;if(typeof s!="string"||!rx.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let i=s,o=!1;if(ix)try{let u=new URL(window.location.href),m=s.startsWith("//")?new URL(u.protocol+s):new URL(s),p=Qa(m.pathname,l);m.origin===u.origin&&p!=null?s=p+m.search+m.hash:o=!0}catch{Rt(!1,`<Link to="${s}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:o,to:s}}var ol=Symbol("Uninstrumented");function n1(n,l){let s={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};n.forEach(o=>o({id:l.id,index:l.index,path:l.path,instrument(u){let m=Object.keys(s);for(let p of m)u[p]&&s[p].push(u[p])}}));let i={};if(typeof l.lazy=="function"&&s.lazy.length>0){let o=Tr(s.lazy,l.lazy,()=>{});o&&(i.lazy=o)}if(typeof l.lazy=="object"){let o=l.lazy;["middleware","loader","action"].forEach(u=>{let m=o[u],p=s[`lazy.${u}`];if(typeof m=="function"&&p.length>0){let g=Tr(p,m,()=>{});g&&(i.lazy=Object.assign(i.lazy||{},{[u]:g}))}})}return["loader","action"].forEach(o=>{let u=l[o];if(typeof u=="function"&&s[o].length>0){let m=u[ol]??u,p=Tr(s[o],m,(...g)=>tg(g[0]));p&&(o==="loader"&&m.hydrate===!0&&(p.hydrate=!0),p[ol]=m,i[o]=p)}}),l.middleware&&l.middleware.length>0&&s.middleware.length>0&&(i.middleware=l.middleware.map(o=>{let u=o[ol]??o,m=Tr(s.middleware,u,(...p)=>tg(p[0]));return m?(m[ol]=u,m):o})),i}function l1(n,l){let s={navigate:[],fetch:[]};if(l.forEach(i=>i({instrument(o){let u=Object.keys(o);for(let m of u)o[m]&&s[m].push(o[m])}})),s.navigate.length>0){let i=n.navigate[ol]??n.navigate,o=Tr(s.navigate,i,(...u)=>{let[m,p]=u;return{to:typeof m=="number"||typeof m=="string"?m:m?mn(m):".",...ag(n,p??{})}});o&&(o[ol]=i,n.navigate=o)}if(s.fetch.length>0){let i=n.fetch[ol]??n.fetch,o=Tr(s.fetch,i,(...u)=>{let[m,,p,g]=u;return{href:p??".",fetcherKey:m,...ag(n,g??{})}});o&&(o[ol]=i,n.fetch=o)}return n}function Tr(n,l,s){return n.length===0?null:async(...i)=>{let o=await cx(n,s(...i),()=>l(...i),n.length-1);if(o.type==="error")throw o.value;return o.value}}async function cx(n,l,s,i){let o=n[i],u;if(o){let m,p=async()=>(m?console.error("You cannot call instrumented handlers more than once"):m=cx(n,l,s,i-1),u=await m,qe(u,"Expected a result"),u.type==="error"&&u.value instanceof Error?{status:"error",error:u.value}:{status:"success",error:void 0});try{await o(p,l)}catch(g){console.error("An instrumentation function threw an error:",g)}m||await p(),await m}else try{u={type:"success",value:await s()}}catch(m){u={type:"error",value:m}}return u||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function tg(n){let{request:l,context:s,params:i,unstable_pattern:o}=n;return{request:r1(l),params:{...i},unstable_pattern:o,context:s1(s)}}function ag(n,l){return{currentUrl:mn(n.state.location),..."formMethod"in l?{formMethod:l.formMethod}:{},..."formEncType"in l?{formEncType:l.formEncType}:{},..."formData"in l?{formData:l.formData}:{},..."body"in l?{body:l.body}:{}}}function r1(n){return{method:n.method,url:n.url,headers:{get:(...l)=>n.headers.get(...l)}}}function s1(n){if(o1(n)){let l={...n};return Object.freeze(l),l}else return{get:l=>n.get(l)}}var i1=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function o1(n){if(n===null||typeof n!="object")return!1;const l=Object.getPrototypeOf(n);return l===Object.prototype||l===null||Object.getOwnPropertyNames(l).sort().join("\0")===i1}var ux=["POST","PUT","PATCH","DELETE"],c1=new Set(ux),u1=["GET",...ux],d1=new Set(u1),dx=new Set([301,302,303,307,308]),f1=new Set([307,308]),Fu={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},m1={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Es={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},h1=n=>({hasErrorBoundary:!!n.hasErrorBoundary}),fx="remix-router-transitions",mx=Symbol("ResetLoaderData");function p1(n){const l=n.window?n.window:typeof window<"u"?window:void 0,s=typeof l<"u"&&typeof l.document<"u"&&typeof l.document.createElement<"u";qe(n.routes.length>0,"You must provide a non-empty routes array to createRouter");let i=n.hydrationRouteProperties||[],o=n.mapRouteProperties||h1,u=o;if(n.unstable_instrumentations){let C=n.unstable_instrumentations;u=D=>({...o(D),...n1(C.map(H=>H.route).filter(Boolean),D)})}let m={},p=Us(n.routes,u,void 0,m),g,h=n.basename||"/";h.startsWith("/")||(h=`/${h}`);let v=n.dataStrategy||v1,y={...n.future},_=null,j=new Set,N=null,T=null,O=null,G=n.hydrationData!=null,Z=rl(p,n.history.location,h),$=!1,V=null,X,W;if(Z==null&&!n.patchRoutesOnNavigation){let C=Ka(404,{pathname:n.history.location.pathname}),{matches:D,route:H}=lo(p);X=!0,W=!X,Z=D,V={[H.id]:C}}else if(Z&&!n.hydrationData&&Aa(Z,p,n.history.location.pathname).active&&(Z=null),Z)if(Z.some(C=>C.route.lazy))X=!1,W=!X;else if(!Z.some(C=>jd(C.route)))X=!0,W=!X;else{let C=n.hydrationData?n.hydrationData.loaderData:null,D=n.hydrationData?n.hydrationData.errors:null,H=Z;if(D){let ne=Z.findIndex(ie=>D[ie.route.id]!==void 0);H=H.slice(0,ne+1)}W=!1,X=H.every(ne=>{let ie=hx(ne.route,C,D);return W=W||ie.renderFallback,!ie.shouldLoad})}else{X=!1,W=!X,Z=[];let C=Aa(null,p,n.history.location.pathname);C.active&&C.matches&&($=!0,Z=C.matches)}let F,E={historyAction:n.history.action,location:n.history.location,matches:Z,initialized:X,renderFallback:W,navigation:Fu,restoreScrollPosition:n.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:n.hydrationData&&n.hydrationData.loaderData||{},actionData:n.hydrationData&&n.hydrationData.actionData||null,errors:n.hydrationData&&n.hydrationData.errors||V,fetchers:new Map,blockers:new Map},q="POP",ee=null,de=!1,oe,re=!1,ue=new Map,ge=null,k=!1,P=!1,fe=new Set,me=new Map,le=0,w=-1,B=new Map,te=new Set,ae=new Map,xe=new Map,ve=new Set,ze=new Map,Pe,Xe=null;function Wt(){if(_=n.history.listen(({action:C,location:D,delta:H})=>{if(Pe){Pe(),Pe=void 0;return}Rt(ze.size===0||H!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ne=De({currentLocation:E.location,nextLocation:D,historyAction:C});if(ne&&H!=null){let ie=new Promise(ye=>{Pe=ye});n.history.go(H*-1),se(ne,{state:"blocked",location:D,proceed(){se(ne,{state:"proceeding",proceed:void 0,reset:void 0,location:D}),ie.then(()=>n.history.go(H))},reset(){let ye=new Map(E.blockers);ye.set(ne,Es),tt({blockers:ye})}}),ee?.resolve(),ee=null;return}return ea(C,D)}),s){H1(l,ue);let C=()=>B1(l,ue);l.addEventListener("pagehide",C),ge=()=>l.removeEventListener("pagehide",C)}return E.initialized||ea("POP",E.location,{initialHydration:!0}),F}function ma(){_&&_(),ge&&ge(),j.clear(),oe&&oe.abort(),E.fetchers.forEach((C,D)=>Qt(D)),E.blockers.forEach((C,D)=>K(D))}function Qe(C){return j.add(C),()=>j.delete(C)}function tt(C,D={}){C.matches&&(C.matches=C.matches.map(ie=>{let ye=m[ie.route.id],ce=ie.route;return ce.element!==ye.element||ce.errorElement!==ye.errorElement||ce.hydrateFallbackElement!==ye.hydrateFallbackElement?{...ie,route:ye}:ie})),E={...E,...C};let H=[],ne=[];E.fetchers.forEach((ie,ye)=>{ie.state==="idle"&&(ve.has(ye)?H.push(ye):ne.push(ye))}),ve.forEach(ie=>{!E.fetchers.has(ie)&&!me.has(ie)&&H.push(ie)}),[...j].forEach(ie=>ie(E,{deletedFetchers:H,newErrors:C.errors??null,viewTransitionOpts:D.viewTransitionOpts,flushSync:D.flushSync===!0})),H.forEach(ie=>Qt(ie)),ne.forEach(ie=>E.fetchers.delete(ie))}function dt(C,D,{flushSync:H}={}){let ne=E.actionData!=null&&E.navigation.formMethod!=null&&la(E.navigation.formMethod)&&E.navigation.state==="loading"&&C.state?._isRedirect!==!0,ie;D.actionData?Object.keys(D.actionData).length>0?ie=D.actionData:ie=null:ne?ie=E.actionData:ie=null;let ye=D.loaderData?fg(E.loaderData,D.loaderData,D.matches||[],D.errors):E.loaderData,ce=E.blockers;ce.size>0&&(ce=new Map(ce),ce.forEach((Ee,je)=>ce.set(je,Es)));let he=k?!1:ca(C,D.matches||E.matches),pe=de===!0||E.navigation.formMethod!=null&&la(E.navigation.formMethod)&&C.state?._isRedirect!==!0;g&&(p=g,g=void 0),k||q==="POP"||(q==="PUSH"?n.history.push(C,C.state):q==="REPLACE"&&n.history.replace(C,C.state));let Ne;if(q==="POP"){let Ee=ue.get(E.location.pathname);Ee&&Ee.has(C.pathname)?Ne={currentLocation:E.location,nextLocation:C}:ue.has(C.pathname)&&(Ne={currentLocation:C,nextLocation:E.location})}else if(re){let Ee=ue.get(E.location.pathname);Ee?Ee.add(C.pathname):(Ee=new Set([C.pathname]),ue.set(E.location.pathname,Ee)),Ne={currentLocation:E.location,nextLocation:C}}tt({...D,actionData:ie,loaderData:ye,historyAction:q,location:C,initialized:!0,renderFallback:!1,navigation:Fu,revalidation:"idle",restoreScrollPosition:he,preventScrollReset:pe,blockers:ce},{viewTransitionOpts:Ne,flushSync:H===!0}),q="POP",de=!1,re=!1,k=!1,P=!1,ee?.resolve(),ee=null,Xe?.resolve(),Xe=null}async function $t(C,D){if(ee?.resolve(),ee=null,typeof C=="number"){ee||(ee=gg());let ft=ee.promise;return n.history.go(C),ft}let H=ud(E.location,E.matches,h,C,D?.fromRouteId,D?.relative),{path:ne,submission:ie,error:ye}=ng(!1,H,D),ce;D?.unstable_mask&&(ce={pathname:"",search:"",hash:"",...typeof D.unstable_mask=="string"?Mn(D.unstable_mask):{...E.location.unstable_mask,...D.unstable_mask}});let he=E.location,pe=Ls(he,ne,D&&D.state,void 0,ce);pe={...pe,...n.history.encodeLocation(pe)};let Ne=D&&D.replace!=null?D.replace:void 0,Ee="PUSH";Ne===!0?Ee="REPLACE":Ne===!1||ie!=null&&la(ie.formMethod)&&ie.formAction===E.location.pathname+E.location.search&&(Ee="REPLACE");let je=D&&"preventScrollReset"in D?D.preventScrollReset===!0:void 0,at=(D&&D.flushSync)===!0,Ye=De({currentLocation:he,nextLocation:pe,historyAction:Ee});if(Ye){se(Ye,{state:"blocked",location:pe,proceed(){se(Ye,{state:"proceeding",proceed:void 0,reset:void 0,location:pe}),$t(C,D)},reset(){let ft=new Map(E.blockers);ft.set(Ye,Es),tt({blockers:ft})}});return}await ea(Ee,pe,{submission:ie,pendingError:ye,preventScrollReset:je,replace:D&&D.replace,enableViewTransition:D&&D.viewTransition,flushSync:at,callSiteDefaultShouldRevalidate:D&&D.unstable_defaultShouldRevalidate})}function Gt(){Xe||(Xe=gg()),Ze(),tt({revalidation:"loading"});let C=Xe.promise;return E.navigation.state==="submitting"?C:E.navigation.state==="idle"?(ea(E.historyAction,E.location,{startUninterruptedRevalidation:!0}),C):(ea(q||E.historyAction,E.navigation.location,{overrideNavigation:E.navigation,enableViewTransition:re===!0}),C)}async function ea(C,D,H){oe&&oe.abort(),oe=null,q=C,k=(H&&H.startUninterruptedRevalidation)===!0,oa(E.location,E.matches),de=(H&&H.preventScrollReset)===!0,re=(H&&H.enableViewTransition)===!0;let ne=g||p,ie=H&&H.overrideNavigation,ye=H?.initialHydration&&E.matches&&E.matches.length>0&&!$?E.matches:rl(ne,D,h),ce=(H&&H.flushSync)===!0;if(ye&&E.initialized&&!P&&R1(E.location,D)&&!(H&&H.submission&&la(H.submission.formMethod))){dt(D,{matches:ye},{flushSync:ce});return}let he=Aa(ye,ne,D.pathname);if(he.active&&he.matches&&(ye=he.matches),!ye){let{error:yt,notFoundMatches:wt,route:et}=$e(D.pathname);dt(D,{matches:wt,loaderData:{},errors:{[et.id]:yt}},{flushSync:ce});return}oe=new AbortController;let pe=Cr(n.history,D,oe.signal,H&&H.submission),Ne=n.getContext?await n.getContext():new Pp,Ee;if(H&&H.pendingError)Ee=[sl(ye).route.id,{type:"error",error:H.pendingError}];else if(H&&H.submission&&la(H.submission.formMethod)){let yt=await ta(pe,D,H.submission,ye,Ne,he.active,H&&H.initialHydration===!0,{replace:H.replace,flushSync:ce});if(yt.shortCircuited)return;if(yt.pendingActionResult){let[wt,et]=yt.pendingActionResult;if(Oa(et)&&Dr(et.error)&&et.error.status===404){oe=null,dt(D,{matches:yt.matches,loaderData:{},errors:{[wt]:et.error}});return}}ye=yt.matches||ye,Ee=yt.pendingActionResult,ie=Ju(D,H.submission),ce=!1,he.active=!1,pe=Cr(n.history,pe.url,pe.signal)}let{shortCircuited:je,matches:at,loaderData:Ye,errors:ft}=await Sa(pe,D,ye,Ne,he.active,ie,H&&H.submission,H&&H.fetcherSubmission,H&&H.replace,H&&H.initialHydration===!0,ce,Ee,H&&H.callSiteDefaultShouldRevalidate);je||(oe=null,dt(D,{matches:at||ye,...mg(Ee),loaderData:Ye,errors:ft}))}async function ta(C,D,H,ne,ie,ye,ce,he={}){Ze();let pe=L1(D,H);if(tt({navigation:pe},{flushSync:he.flushSync===!0}),ye){let je=await ja(ne,D.pathname,C.signal);if(je.type==="aborted")return{shortCircuited:!0};if(je.type==="error"){if(je.partialMatches.length===0){let{matches:Ye,route:ft}=lo(p);return{matches:Ye,pendingActionResult:[ft.id,{type:"error",error:je.error}]}}let at=sl(je.partialMatches).route.id;return{matches:je.partialMatches,pendingActionResult:[at,{type:"error",error:je.error}]}}else if(je.matches)ne=je.matches;else{let{notFoundMatches:at,error:Ye,route:ft}=$e(D.pathname);return{matches:at,pendingActionResult:[ft.id,{type:"error",error:Ye}]}}}let Ne,Ee=mo(ne,D);if(!Ee.route.action&&!Ee.route.lazy)Ne={type:"error",error:Ka(405,{method:C.method,pathname:D.pathname,routeId:Ee.route.id})};else{let je=zr(u,m,C,ne,Ee,ce?[]:i,ie),at=await Se(C,je,ie,null);if(Ne=at[Ee.route.id],!Ne){for(let Ye of ne)if(at[Ye.route.id]){Ne=at[Ye.route.id];break}}if(C.signal.aborted)return{shortCircuited:!0}}if(Ol(Ne)){let je;return he&&he.replace!=null?je=he.replace:je=cg(Ne.response.headers.get("Location"),new URL(C.url),h,n.history)===E.location.pathname+E.location.search,await ia(C,Ne,!0,{submission:H,replace:je}),{shortCircuited:!0}}if(Oa(Ne)){let je=sl(ne,Ee.route.id);return(he&&he.replace)!==!0&&(q="PUSH"),{matches:ne,pendingActionResult:[je.route.id,Ne,Ee.route.id]}}return{matches:ne,pendingActionResult:[Ee.route.id,Ne]}}async function Sa(C,D,H,ne,ie,ye,ce,he,pe,Ne,Ee,je,at){let Ye=ye||Ju(D,ce),ft=ce||he||pg(Ye),yt=!k&&!Ne;if(ie){if(yt){let zt=_a(je);tt({navigation:Ye,...zt!==void 0?{actionData:zt}:{}},{flushSync:Ee})}let Ge=await ja(H,D.pathname,C.signal);if(Ge.type==="aborted")return{shortCircuited:!0};if(Ge.type==="error"){if(Ge.partialMatches.length===0){let{matches:aa,route:At}=lo(p);return{matches:aa,loaderData:{},errors:{[At.id]:Ge.error}}}let zt=sl(Ge.partialMatches).route.id;return{matches:Ge.partialMatches,loaderData:{},errors:{[zt]:Ge.error}}}else if(Ge.matches)H=Ge.matches;else{let{error:zt,notFoundMatches:aa,route:At}=$e(D.pathname);return{matches:aa,loaderData:{},errors:{[At.id]:zt}}}}let wt=g||p,{dsMatches:et,revalidatingFetchers:qt}=lg(C,ne,u,m,n.history,E,H,ft,D,Ne?[]:i,Ne===!0,P,fe,ve,ae,te,wt,h,n.patchRoutesOnNavigation!=null,je,at);if(w=++le,!n.dataStrategy&&!et.some(Ge=>Ge.shouldLoad)&&!et.some(Ge=>Ge.route.middleware&&Ge.route.middleware.length>0)&&qt.length===0){let Ge=Ce();return dt(D,{matches:H,loaderData:{},errors:je&&Oa(je[1])?{[je[0]]:je[1].error}:null,...mg(je),...Ge?{fetchers:new Map(E.fetchers)}:{}},{flushSync:Ee}),{shortCircuited:!0}}if(yt){let Ge={};if(!ie){Ge.navigation=Ye;let zt=_a(je);zt!==void 0&&(Ge.actionData=zt)}qt.length>0&&(Ge.fetchers=ka(qt)),tt(Ge,{flushSync:Ee})}qt.forEach(Ge=>{gt(Ge.key),Ge.controller&&me.set(Ge.key,Ge.controller)});let xt=()=>qt.forEach(Ge=>gt(Ge.key));oe&&oe.signal.addEventListener("abort",xt);let{loaderResults:An,fetcherResults:Pa}=await ke(et,qt,C,ne);if(C.signal.aborted)return{shortCircuited:!0};oe&&oe.signal.removeEventListener("abort",xt),qt.forEach(Ge=>me.delete(Ge.key));let Vt=ro(An);if(Vt)return await ia(C,Vt.result,!0,{replace:pe}),{shortCircuited:!0};if(Vt=ro(Pa),Vt)return te.add(Vt.key),await ia(C,Vt.result,!0,{replace:pe}),{shortCircuited:!0};let{loaderData:ln,errors:fl}=dg(E,H,An,je,qt,Pa);Ne&&E.errors&&(fl={...E.errors,...fl});let rn=Ce(),ml=Ae(w),Yl=rn||ml||qt.length>0;return{matches:H,loaderData:ln,errors:fl,...Yl?{fetchers:new Map(E.fetchers)}:{}}}function _a(C){if(C&&!Oa(C[1]))return{[C[0]]:C[1].data};if(E.actionData)return Object.keys(E.actionData).length===0?null:E.actionData}function ka(C){return C.forEach(D=>{let H=E.fetchers.get(D.key),ne=Cs(void 0,H?H.data:void 0);E.fetchers.set(D.key,ne)}),new Map(E.fetchers)}async function ra(C,D,H,ne){gt(C);let ie=(ne&&ne.flushSync)===!0,ye=g||p,ce=ud(E.location,E.matches,h,H,D,ne?.relative),he=rl(ye,ce,h),pe=Aa(he,ye,ce);if(pe.active&&pe.matches&&(he=pe.matches),!he){Nt(C,D,Ka(404,{pathname:ce}),{flushSync:ie});return}let{path:Ne,submission:Ee,error:je}=ng(!0,ce,ne);if(je){Nt(C,D,je,{flushSync:ie});return}let at=n.getContext?await n.getContext():new Pp,Ye=(ne&&ne.preventScrollReset)===!0;if(Ee&&la(Ee.formMethod)){await sa(C,D,Ne,he,at,pe.active,ie,Ye,Ee,ne&&ne.unstable_defaultShouldRevalidate);return}ae.set(C,{routeId:D,path:Ne}),await ht(C,D,Ne,he,at,pe.active,ie,Ye,Ee)}async function sa(C,D,H,ne,ie,ye,ce,he,pe,Ne){Ze(),ae.delete(C);let Ee=E.fetchers.get(C);pt(C,U1(pe,Ee),{flushSync:ce});let je=new AbortController,at=Cr(n.history,H,je.signal,pe);if(ye){let bt=await ja(ne,new URL(at.url).pathname,at.signal,C);if(bt.type==="aborted")return;if(bt.type==="error"){Nt(C,D,bt.error,{flushSync:ce});return}else if(bt.matches)ne=bt.matches;else{Nt(C,D,Ka(404,{pathname:H}),{flushSync:ce});return}}let Ye=mo(ne,H);if(!Ye.route.action&&!Ye.route.lazy){let bt=Ka(405,{method:pe.formMethod,pathname:H,routeId:D});Nt(C,D,bt,{flushSync:ce});return}me.set(C,je);let ft=le,yt=zr(u,m,at,ne,Ye,i,ie),wt=await Se(at,yt,ie,C),et=wt[Ye.route.id];if(!et){for(let bt of yt)if(wt[bt.route.id]){et=wt[bt.route.id];break}}if(at.signal.aborted){me.get(C)===je&&me.delete(C);return}if(ve.has(C)){if(Ol(et)||Oa(et)){pt(C,On(void 0));return}}else{if(Ol(et))if(me.delete(C),w>ft){pt(C,On(void 0));return}else return te.add(C),pt(C,Cs(pe)),ia(at,et,!1,{fetcherSubmission:pe,preventScrollReset:he});if(Oa(et)){Nt(C,D,et.error);return}}let qt=E.navigation.location||E.location,xt=Cr(n.history,qt,je.signal),An=g||p,Pa=E.navigation.state!=="idle"?rl(An,E.navigation.location,h):E.matches;qe(Pa,"Didn't find any matches after fetcher action");let Vt=++le;B.set(C,Vt);let ln=Cs(pe,et.data);E.fetchers.set(C,ln);let{dsMatches:fl,revalidatingFetchers:rn}=lg(xt,ie,u,m,n.history,E,Pa,pe,qt,i,!1,P,fe,ve,ae,te,An,h,n.patchRoutesOnNavigation!=null,[Ye.route.id,et],Ne);rn.filter(bt=>bt.key!==C).forEach(bt=>{let Gl=bt.key,Vl=E.fetchers.get(Gl),Xs=Cs(void 0,Vl?Vl.data:void 0);E.fetchers.set(Gl,Xs),gt(Gl),bt.controller&&me.set(Gl,bt.controller)}),tt({fetchers:new Map(E.fetchers)});let ml=()=>rn.forEach(bt=>gt(bt.key));je.signal.addEventListener("abort",ml);let{loaderResults:Yl,fetcherResults:Ge}=await ke(fl,rn,xt,ie);if(je.signal.aborted)return;if(je.signal.removeEventListener("abort",ml),B.delete(C),me.delete(C),rn.forEach(bt=>me.delete(bt.key)),E.fetchers.has(C)){let bt=On(et.data);E.fetchers.set(C,bt)}let zt=ro(Yl);if(zt)return ia(xt,zt.result,!1,{preventScrollReset:he});if(zt=ro(Ge),zt)return te.add(zt.key),ia(xt,zt.result,!1,{preventScrollReset:he});let{loaderData:aa,errors:At}=dg(E,Pa,Yl,void 0,rn,Ge);Ae(Vt),E.navigation.state==="loading"&&Vt>w?(qe(q,"Expected pending action"),oe&&oe.abort(),dt(E.navigation.location,{matches:Pa,loaderData:aa,errors:At,fetchers:new Map(E.fetchers)})):(tt({errors:At,loaderData:fg(E.loaderData,aa,Pa,At),fetchers:new Map(E.fetchers)}),P=!1)}async function ht(C,D,H,ne,ie,ye,ce,he,pe){let Ne=E.fetchers.get(C);pt(C,Cs(pe,Ne?Ne.data:void 0),{flushSync:ce});let Ee=new AbortController,je=Cr(n.history,H,Ee.signal);if(ye){let et=await ja(ne,new URL(je.url).pathname,je.signal,C);if(et.type==="aborted")return;if(et.type==="error"){Nt(C,D,et.error,{flushSync:ce});return}else if(et.matches)ne=et.matches;else{Nt(C,D,Ka(404,{pathname:H}),{flushSync:ce});return}}let at=mo(ne,H);me.set(C,Ee);let Ye=le,ft=zr(u,m,je,ne,at,i,ie),wt=(await Se(je,ft,ie,C))[at.route.id];if(me.get(C)===Ee&&me.delete(C),!je.signal.aborted){if(ve.has(C)){pt(C,On(void 0));return}if(Ol(wt))if(w>Ye){pt(C,On(void 0));return}else{te.add(C),await ia(je,wt,!1,{preventScrollReset:he});return}if(Oa(wt)){Nt(C,D,wt.error);return}pt(C,On(wt.data))}}async function ia(C,D,H,{submission:ne,fetcherSubmission:ie,preventScrollReset:ye,replace:ce}={}){H||(ee?.resolve(),ee=null),D.response.headers.has("X-Remix-Revalidate")&&(P=!0);let he=D.response.headers.get("Location");qe(he,"Expected a Location header on the redirect Response"),he=cg(he,new URL(C.url),h,n.history);let pe=Ls(E.location,he,{_isRedirect:!0});if(s){let ft=!1;if(D.response.headers.has("X-Remix-Reload-Document"))ft=!0;else if(_d(he)){const yt=ax(he,!0);ft=yt.origin!==l.location.origin||Qa(yt.pathname,h)==null}if(ft){ce?l.location.replace(he):l.location.assign(he);return}}oe=null;let Ne=ce===!0||D.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ee,formAction:je,formEncType:at}=E.navigation;!ne&&!ie&&Ee&&je&&at&&(ne=pg(E.navigation));let Ye=ne||ie;if(f1.has(D.response.status)&&Ye&&la(Ye.formMethod))await ea(Ne,pe,{submission:{...Ye,formAction:he},preventScrollReset:ye||de,enableViewTransition:H?re:void 0});else{let ft=Ju(pe,ne);await ea(Ne,pe,{overrideNavigation:ft,fetcherSubmission:ie,preventScrollReset:ye||de,enableViewTransition:H?re:void 0})}}async function Se(C,D,H,ne){let ie,ye={};try{ie=await _1(v,C,D,ne,H,!1)}catch(ce){return D.filter(he=>he.shouldLoad).forEach(he=>{ye[he.route.id]={type:"error",error:ce}}),ye}if(C.signal.aborted)return ye;if(!la(C.method))for(let ce of D){if(ie[ce.route.id]?.type==="error")break;!ie.hasOwnProperty(ce.route.id)&&!E.loaderData.hasOwnProperty(ce.route.id)&&(!E.errors||!E.errors.hasOwnProperty(ce.route.id))&&ce.shouldCallHandler()&&(ie[ce.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${ce.route.id}`)})}for(let[ce,he]of Object.entries(ie))if(D1(he)){let pe=he.result;ye[ce]={type:"redirect",response:E1(pe,C,ce,D,h)}}else ye[ce]=await w1(he);return ye}async function ke(C,D,H,ne){let ie=Se(H,C,ne,null),ye=Promise.all(D.map(async pe=>{if(pe.matches&&pe.match&&pe.request&&pe.controller){let Ee=(await Se(pe.request,pe.matches,ne,pe.key))[pe.match.route.id];return{[pe.key]:Ee}}else return Promise.resolve({[pe.key]:{type:"error",error:Ka(404,{pathname:pe.path})}})})),ce=await ie,he=(await ye).reduce((pe,Ne)=>Object.assign(pe,Ne),{});return{loaderResults:ce,fetcherResults:he}}function Ze(){P=!0,ae.forEach((C,D)=>{me.has(D)&&fe.add(D),gt(D)})}function pt(C,D,H={}){E.fetchers.set(C,D),tt({fetchers:new Map(E.fetchers)},{flushSync:(H&&H.flushSync)===!0})}function Nt(C,D,H,ne={}){let ie=sl(E.matches,D);Qt(C),tt({errors:{[ie.route.id]:H},fetchers:new Map(E.fetchers)},{flushSync:(ne&&ne.flushSync)===!0})}function Xt(C){return xe.set(C,(xe.get(C)||0)+1),ve.has(C)&&ve.delete(C),E.fetchers.get(C)||m1}function Ja(C,D){gt(C,D?.reason),pt(C,On(null))}function Qt(C){let D=E.fetchers.get(C);me.has(C)&&!(D&&D.state==="loading"&&B.has(C))&&gt(C),ae.delete(C),B.delete(C),te.delete(C),ve.delete(C),fe.delete(C),E.fetchers.delete(C)}function Tt(C){let D=(xe.get(C)||0)-1;D<=0?(xe.delete(C),ve.add(C)):xe.set(C,D),tt({fetchers:new Map(E.fetchers)})}function gt(C,D){let H=me.get(C);H&&(H.abort(D),me.delete(C))}function Mt(C){for(let D of C){let H=Xt(D),ne=On(H.data);E.fetchers.set(D,ne)}}function Ce(){let C=[],D=!1;for(let H of te){let ne=E.fetchers.get(H);qe(ne,`Expected fetcher: ${H}`),ne.state==="loading"&&(te.delete(H),C.push(H),D=!0)}return Mt(C),D}function Ae(C){let D=[];for(let[H,ne]of B)if(ne<C){let ie=E.fetchers.get(H);qe(ie,`Expected fetcher: ${H}`),ie.state==="loading"&&(gt(H),B.delete(H),D.push(H))}return Mt(D),D.length>0}function Ie(C,D){let H=E.blockers.get(C)||Es;return ze.get(C)!==D&&ze.set(C,D),H}function K(C){E.blockers.delete(C),ze.delete(C)}function se(C,D){let H=E.blockers.get(C)||Es;qe(H.state==="unblocked"&&D.state==="blocked"||H.state==="blocked"&&D.state==="blocked"||H.state==="blocked"&&D.state==="proceeding"||H.state==="blocked"&&D.state==="unblocked"||H.state==="proceeding"&&D.state==="unblocked",`Invalid blocker state transition: ${H.state} -> ${D.state}`);let ne=new Map(E.blockers);ne.set(C,D),tt({blockers:ne})}function De({currentLocation:C,nextLocation:D,historyAction:H}){if(ze.size===0)return;ze.size>1&&Rt(!1,"A router only supports one blocker at a time");let ne=Array.from(ze.entries()),[ie,ye]=ne[ne.length-1],ce=E.blockers.get(ie);if(!(ce&&ce.state==="proceeding")&&ye({currentLocation:C,nextLocation:D,historyAction:H}))return ie}function $e(C){let D=Ka(404,{pathname:C}),H=g||p,{matches:ne,route:ie}=lo(H);return{notFoundMatches:ne,route:ie,error:D}}function Ue(C,D,H){if(N=C,O=D,T=H||null,!G&&E.navigation===Fu){G=!0;let ne=ca(E.location,E.matches);ne!=null&&tt({restoreScrollPosition:ne})}return()=>{N=null,O=null,T=null}}function kt(C,D){return T&&T(C,D.map(ne=>Bv(ne,E.loaderData)))||C.key}function oa(C,D){if(N&&O){let H=kt(C,D);N[H]=O()}}function ca(C,D){if(N){let H=kt(C,D),ne=N[H];if(typeof ne=="number")return ne}return null}function Aa(C,D,H){if(n.patchRoutesOnNavigation)if(C){if(Object.keys(C[0].params).length>0)return{active:!0,matches:zs(D,H,h,!0)}}else return{active:!0,matches:zs(D,H,h,!0)||[]};return{active:!1,matches:null}}async function ja(C,D,H,ne){if(!n.patchRoutesOnNavigation)return{type:"success",matches:C};let ie=C;for(;;){let ye=g==null,ce=g||p,he=m;try{await n.patchRoutesOnNavigation({signal:H,path:D,matches:ie,fetcherKey:ne,patch:(Ee,je)=>{H.aborted||rg(Ee,je,ce,he,u,!1)}})}catch(Ee){return{type:"error",error:Ee,partialMatches:ie}}finally{ye&&!H.aborted&&(p=[...p])}if(H.aborted)return{type:"aborted"};let pe=rl(ce,D,h),Ne=null;if(pe){if(Object.keys(pe[0].params).length===0)return{type:"success",matches:pe};if(Ne=zs(ce,D,h,!0),!(Ne&&ie.length<Ne.length&&dl(ie,Ne.slice(0,ie.length))))return{type:"success",matches:pe}}if(Ne||(Ne=zs(ce,D,h,!0)),!Ne||dl(ie,Ne))return{type:"success",matches:null};ie=Ne}}function dl(C,D){return C.length===D.length&&C.every((H,ne)=>H.route.id===D[ne].route.id)}function $l(C){m={},g=Us(C,u,void 0,m)}function ql(C,D,H=!1){let ne=g==null;rg(C,D,g||p,m,u,H),ne&&(p=[...p],tt({}))}return F={get basename(){return h},get future(){return y},get state(){return E},get routes(){return p},get window(){return l},initialize:Wt,subscribe:Qe,enableScrollRestoration:Ue,navigate:$t,fetch:ra,revalidate:Gt,createHref:C=>n.history.createHref(C),encodeLocation:C=>n.history.encodeLocation(C),getFetcher:Xt,resetFetcher:Ja,deleteFetcher:Tt,dispose:ma,getBlocker:Ie,deleteBlocker:K,patchRoutes:ql,_internalFetchControllers:me,_internalSetRoutes:$l,_internalSetStateDoNotUseOrYouWillBreakYourApp(C){tt(C)}},n.unstable_instrumentations&&(F=l1(F,n.unstable_instrumentations.map(C=>C.router).filter(Boolean))),F}function g1(n){return n!=null&&("formData"in n&&n.formData!=null||"body"in n&&n.body!==void 0)}function ud(n,l,s,i,o,u){let m,p;if(o){m=[];for(let h of l)if(m.push(h),h.route.id===o){p=h;break}}else m=l,p=l[l.length-1];let g=$s(i||".",_o(m),Qa(n.pathname,s)||n.pathname,u==="path");if(i==null&&(g.search=n.search,g.hash=n.hash),(i==null||i===""||i===".")&&p){let h=wd(g.search);if(p.route.index&&!h)g.search=g.search?g.search.replace(/^\?/,"?index&"):"?index";else if(!p.route.index&&h){let v=new URLSearchParams(g.search),y=v.getAll("index");v.delete("index"),y.filter(j=>j).forEach(j=>v.append("index",j));let _=v.toString();g.search=_?`?${_}`:""}}return s!=="/"&&(g.pathname=Iv({basename:s,pathname:g.pathname})),mn(g)}function ng(n,l,s){if(!s||!g1(s))return{path:l};if(s.formMethod&&!A1(s.formMethod))return{path:l,error:Ka(405,{method:s.formMethod})};let i=()=>({path:l,error:Ka(400,{type:"invalid-body"})}),u=(s.formMethod||"get").toUpperCase(),m=vx(l);if(s.body!==void 0){if(s.formEncType==="text/plain"){if(!la(u))return i();let y=typeof s.body=="string"?s.body:s.body instanceof FormData||s.body instanceof URLSearchParams?Array.from(s.body.entries()).reduce((_,[j,N])=>`${_}${j}=${N}
10
+ `,""):String(s.body);return{path:l,submission:{formMethod:u,formAction:m,formEncType:s.formEncType,formData:void 0,json:void 0,text:y}}}else if(s.formEncType==="application/json"){if(!la(u))return i();try{let y=typeof s.body=="string"?JSON.parse(s.body):s.body;return{path:l,submission:{formMethod:u,formAction:m,formEncType:s.formEncType,formData:void 0,json:y,text:void 0}}}catch{return i()}}}qe(typeof FormData=="function","FormData is not available in this environment");let p,g;if(s.formData)p=fd(s.formData),g=s.formData;else if(s.body instanceof FormData)p=fd(s.body),g=s.body;else if(s.body instanceof URLSearchParams)p=s.body,g=ug(p);else if(s.body==null)p=new URLSearchParams,g=new FormData;else try{p=new URLSearchParams(s.body),g=ug(p)}catch{return i()}let h={formMethod:u,formAction:m,formEncType:s&&s.formEncType||"application/x-www-form-urlencoded",formData:g,json:void 0,text:void 0};if(la(h.formMethod))return{path:l,submission:h};let v=Mn(l);return n&&v.search&&wd(v.search)&&p.append("index",""),v.search=`?${p}`,{path:mn(v),submission:h}}function lg(n,l,s,i,o,u,m,p,g,h,v,y,_,j,N,T,O,G,Z,$,V){let X=$?Oa($[1])?$[1].error:$[1].data:void 0,W=o.createURL(u.location),F=o.createURL(g),E;if(v&&u.errors){let ge=Object.keys(u.errors)[0];E=m.findIndex(k=>k.route.id===ge)}else if($&&Oa($[1])){let ge=$[0];E=m.findIndex(k=>k.route.id===ge)-1}let q=$?$[1].statusCode:void 0,ee=q&&q>=400,de={currentUrl:W,currentParams:u.matches[0]?.params||{},nextUrl:F,nextParams:m[0].params,...p,actionResult:X,actionStatus:q},oe=Ys(m),re=m.map((ge,k)=>{let{route:P}=ge,fe=null;if(E!=null&&k>E)fe=!1;else if(P.lazy)fe=!0;else if(!jd(P))fe=!1;else if(v){let{shouldLoad:B}=hx(P,u.loaderData,u.errors);fe=B}else x1(u.loaderData,u.matches[k],ge)&&(fe=!0);if(fe!==null)return dd(s,i,n,oe,ge,h,l,fe);let me=!1;typeof V=="boolean"?me=V:ee?me=!1:(y||W.pathname+W.search===F.pathname+F.search||W.search!==F.search||y1(u.matches[k],ge))&&(me=!0);let le={...de,defaultShouldRevalidate:me},w=ks(ge,le);return dd(s,i,n,oe,ge,h,l,w,le,V)}),ue=[];return N.forEach((ge,k)=>{if(v||!m.some(ae=>ae.route.id===ge.routeId)||j.has(k))return;let P=u.fetchers.get(k),fe=P&&P.state!=="idle"&&P.data===void 0,me=rl(O,ge.path,G);if(!me){if(Z&&fe)return;ue.push({key:k,routeId:ge.routeId,path:ge.path,matches:null,match:null,request:null,controller:null});return}if(T.has(k))return;let le=mo(me,ge.path),w=new AbortController,B=Cr(o,ge.path,w.signal),te=null;if(_.has(k))_.delete(k),te=zr(s,i,B,me,le,h,l);else if(fe)y&&(te=zr(s,i,B,me,le,h,l));else{let ae;typeof V=="boolean"?ae=V:ee?ae=!1:ae=y;let xe={...de,defaultShouldRevalidate:ae};ks(le,xe)&&(te=zr(s,i,B,me,le,h,l,xe))}te&&ue.push({key:k,routeId:ge.routeId,path:ge.path,matches:te,match:le,request:B,controller:w})}),{dsMatches:re,revalidatingFetchers:ue}}function jd(n){return n.loader!=null||n.middleware!=null&&n.middleware.length>0}function hx(n,l,s){if(n.lazy)return{shouldLoad:!0,renderFallback:!0};if(!jd(n))return{shouldLoad:!1,renderFallback:!1};let i=l!=null&&n.id in l,o=s!=null&&s[n.id]!==void 0;if(!i&&o)return{shouldLoad:!1,renderFallback:!1};if(typeof n.loader=="function"&&n.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!i};let u=!i&&!o;return{shouldLoad:u,renderFallback:u}}function x1(n,l,s){let i=!l||s.route.id!==l.route.id,o=!n.hasOwnProperty(s.route.id);return i||o}function y1(n,l){let s=n.route.path;return n.pathname!==l.pathname||s!=null&&s.endsWith("*")&&n.params["*"]!==l.params["*"]}function ks(n,l){if(n.route.shouldRevalidate){let s=n.route.shouldRevalidate(l);if(typeof s=="boolean")return s}return l.defaultShouldRevalidate}function rg(n,l,s,i,o,u){let m;if(n){let h=i[n];qe(h,`No route found to patch children into: routeId = ${n}`),h.children||(h.children=[]),m=h.children}else m=s;let p=[],g=[];if(l.forEach(h=>{let v=m.find(y=>px(h,y));v?g.push({existingRoute:v,newRoute:h}):p.push(h)}),p.length>0){let h=Us(p,o,[n||"_","patch",String(m?.length||"0")],i);m.push(...h)}if(u&&g.length>0)for(let h=0;h<g.length;h++){let{existingRoute:v,newRoute:y}=g[h],_=v,[j]=Us([y],o,[],{},!0);Object.assign(_,{element:j.element?j.element:_.element,errorElement:j.errorElement?j.errorElement:_.errorElement,hydrateFallbackElement:j.hydrateFallbackElement?j.hydrateFallbackElement:_.hydrateFallbackElement})}}function px(n,l){return"id"in n&&"id"in l&&n.id===l.id?!0:n.index===l.index&&n.path===l.path&&n.caseSensitive===l.caseSensitive?(!n.children||n.children.length===0)&&(!l.children||l.children.length===0)?!0:n.children?.every((s,i)=>l.children?.some(o=>px(s,o)))??!1:!1}var sg=new WeakMap,gx=({key:n,route:l,manifest:s,mapRouteProperties:i})=>{let o=s[l.id];if(qe(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let u=o.lazy[n];if(!u)return;let m=sg.get(o);m||(m={},sg.set(o,m));let p=m[n];if(p)return p;let g=(async()=>{let h=Av(n),y=o[n]!==void 0&&n!=="hasErrorBoundary";if(h)Rt(!h,"Route property "+n+" is not a supported lazy route property. This property will be ignored."),m[n]=Promise.resolve();else if(y)Rt(!1,`Route "${o.id}" has a static property "${n}" defined. The lazy property will be ignored.`);else{let _=await u();_!=null&&(Object.assign(o,{[n]:_}),Object.assign(o,i(o)))}typeof o.lazy=="object"&&(o.lazy[n]=void 0,Object.values(o.lazy).every(_=>_===void 0)&&(o.lazy=void 0))})();return m[n]=g,g},ig=new WeakMap;function b1(n,l,s,i,o){let u=s[n.id];if(qe(u,"No route found in manifest"),!n.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof n.lazy=="function"){let v=ig.get(u);if(v)return{lazyRoutePromise:v,lazyHandlerPromise:v};let y=(async()=>{qe(typeof n.lazy=="function","No lazy route function found");let _=await n.lazy(),j={};for(let N in _){let T=_[N];if(T===void 0)continue;let O=Uv(N),Z=u[N]!==void 0&&N!=="hasErrorBoundary";O?Rt(!O,"Route property "+N+" is not a supported property to be returned from a lazy route function. This property will be ignored."):Z?Rt(!Z,`Route "${u.id}" has a static property "${N}" defined but its lazy function is also returning a value for this property. The lazy route property "${N}" will be ignored.`):j[N]=T}Object.assign(u,j),Object.assign(u,{...i(u),lazy:void 0})})();return ig.set(u,y),y.catch(()=>{}),{lazyRoutePromise:y,lazyHandlerPromise:y}}let m=Object.keys(n.lazy),p=[],g;for(let v of m){if(o&&o.includes(v))continue;let y=gx({key:v,route:n,manifest:s,mapRouteProperties:i});y&&(p.push(y),v===l&&(g=y))}let h=p.length>0?Promise.all(p).then(()=>{}):void 0;return h?.catch(()=>{}),g?.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:g}}async function og(n){let l=n.matches.filter(o=>o.shouldLoad),s={};return(await Promise.all(l.map(o=>o.resolve()))).forEach((o,u)=>{s[l[u].route.id]=o}),s}async function v1(n){return n.matches.some(l=>l.route.middleware)?xx(n,()=>og(n)):og(n)}function xx(n,l){return S1(n,l,i=>{if(k1(i))throw i;return i},z1,s);function s(i,o,u){if(u)return Promise.resolve(Object.assign(u.value,{[o]:{type:"error",result:i}}));{let{matches:m}=n,p=Math.min(Math.max(m.findIndex(h=>h.route.id===o),0),Math.max(m.findIndex(h=>h.shouldCallHandler()),0)),g=sl(m,m[p].route.id).route.id;return Promise.resolve({[g]:{type:"error",result:i}})}}}async function S1(n,l,s,i,o){let{matches:u,request:m,params:p,context:g,unstable_pattern:h}=n,v=u.flatMap(_=>_.route.middleware?_.route.middleware.map(j=>[_.route.id,j]):[]);return await yx({request:m,params:p,context:g,unstable_pattern:h},v,l,s,i,o)}async function yx(n,l,s,i,o,u,m=0){let{request:p}=n;if(p.signal.aborted)throw p.signal.reason??new Error(`Request aborted: ${p.method} ${p.url}`);let g=l[m];if(!g)return await s();let[h,v]=g,y,_=async()=>{if(y)throw new Error("You may only call `next()` once per middleware");try{return y={value:await yx(n,l,s,i,o,u,m+1)},y.value}catch(j){return y={value:await u(j,h,y)},y.value}};try{let j=await v(n,_),N=j!=null?i(j):void 0;return o(N)?N:y?N??y.value:(y={value:await _()},y.value)}catch(j){return await u(j,h,y)}}function bx(n,l,s,i,o){let u=gx({key:"middleware",route:i.route,manifest:l,mapRouteProperties:n}),m=b1(i.route,la(s.method)?"action":"loader",l,n,o);return{middleware:u,route:m.lazyRoutePromise,handler:m.lazyHandlerPromise}}function dd(n,l,s,i,o,u,m,p,g=null,h){let v=!1,y=bx(n,l,s,o,u);return{...o,_lazyPromises:y,shouldLoad:p,shouldRevalidateArgs:g,shouldCallHandler(_){return v=!0,g?typeof h=="boolean"?ks(o,{...g,defaultShouldRevalidate:h}):typeof _=="boolean"?ks(o,{...g,defaultShouldRevalidate:_}):ks(o,g):p},resolve(_){let{lazy:j,loader:N,middleware:T}=o.route,O=v||p||_&&!la(s.method)&&(j||N),G=T&&T.length>0&&!N&&!j;return O&&(la(s.method)||!G)?j1({request:s,unstable_pattern:i,match:o,lazyHandlerPromise:y?.handler,lazyRoutePromise:y?.route,handlerOverride:_,scopedContext:m}):Promise.resolve({type:"data",result:void 0})}}}function zr(n,l,s,i,o,u,m,p=null){return i.map(g=>g.route.id!==o.route.id?{...g,shouldLoad:!1,shouldRevalidateArgs:p,shouldCallHandler:()=>!1,_lazyPromises:bx(n,l,s,g,u),resolve:()=>Promise.resolve({type:"data",result:void 0})}:dd(n,l,s,Ys(i),g,u,m,!0,p))}async function _1(n,l,s,i,o,u){s.some(h=>h._lazyPromises?.middleware)&&await Promise.all(s.map(h=>h._lazyPromises?.middleware));let m={request:l,unstable_pattern:Ys(s),params:s[0].params,context:o,matches:s},g=await n({...m,fetcherKey:i,runClientMiddleware:h=>{let v=m;return xx(v,()=>h({...v,fetcherKey:i,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(s.flatMap(h=>[h._lazyPromises?.handler,h._lazyPromises?.route]))}catch{}return g}async function j1({request:n,unstable_pattern:l,match:s,lazyHandlerPromise:i,lazyRoutePromise:o,handlerOverride:u,scopedContext:m}){let p,g,h=la(n.method),v=h?"action":"loader",y=_=>{let j,N=new Promise((G,Z)=>j=Z);g=()=>j(),n.signal.addEventListener("abort",g);let T=G=>typeof _!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${v}" [routeId: ${s.route.id}]`)):_({request:n,unstable_pattern:l,params:s.params,context:m},...G!==void 0?[G]:[]),O=(async()=>{try{return{type:"data",result:await(u?u(Z=>T(Z)):T())}}catch(G){return{type:"error",result:G}}})();return Promise.race([O,N])};try{let _=h?s.route.action:s.route.loader;if(i||o)if(_){let j,[N]=await Promise.all([y(_).catch(T=>{j=T}),i,o]);if(j!==void 0)throw j;p=N}else{await i;let j=h?s.route.action:s.route.loader;if(j)[p]=await Promise.all([y(j),o]);else if(v==="action"){let N=new URL(n.url),T=N.pathname+N.search;throw Ka(405,{method:n.method,pathname:T,routeId:s.route.id})}else return{type:"data",result:void 0}}else if(_)p=await y(_);else{let j=new URL(n.url),N=j.pathname+j.search;throw Ka(404,{pathname:N})}}catch(_){return{type:"error",result:_}}finally{g&&n.signal.removeEventListener("abort",g)}return p}async function N1(n){let l=n.headers.get("Content-Type");return l&&/\bapplication\/json\b/.test(l)?n.body==null?null:n.json():n.text()}async function w1(n){let{result:l,type:s}=n;if(Nd(l)){let i;try{i=await N1(l)}catch(o){return{type:"error",error:o}}return s==="error"?{type:"error",error:new qs(l.status,l.statusText,i),statusCode:l.status,headers:l.headers}:{type:"data",data:i,statusCode:l.status,headers:l.headers}}return s==="error"?hg(l)?l.data instanceof Error?{type:"error",error:l.data,statusCode:l.init?.status,headers:l.init?.headers?new Headers(l.init.headers):void 0}:{type:"error",error:T1(l),statusCode:Dr(l)?l.status:void 0,headers:l.init?.headers?new Headers(l.init.headers):void 0}:{type:"error",error:l,statusCode:Dr(l)?l.status:void 0}:hg(l)?{type:"data",data:l.data,statusCode:l.init?.status,headers:l.init?.headers?new Headers(l.init.headers):void 0}:{type:"data",data:l}}function E1(n,l,s,i,o){let u=n.headers.get("Location");if(qe(u,"Redirects returned/thrown from loaders/actions must have a Location header"),!_d(u)){let m=i.slice(0,i.findIndex(p=>p.route.id===s)+1);u=ud(new URL(l.url),m,o,u),n.headers.set("Location",u)}return n}function cg(n,l,s,i){let o=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(_d(n)){let u=n,m=u.startsWith("//")?new URL(l.protocol+u):new URL(u);if(o.includes(m.protocol))throw new Error("Invalid redirect location");let p=Qa(m.pathname,s)!=null;if(m.origin===l.origin&&p)return m.pathname+m.search+m.hash}try{let u=i.createURL(n);if(o.includes(u.protocol))throw new Error("Invalid redirect location")}catch{}return n}function Cr(n,l,s,i){let o=n.createURL(vx(l)).toString(),u={signal:s};if(i&&la(i.formMethod)){let{formMethod:m,formEncType:p}=i;u.method=m.toUpperCase(),p==="application/json"?(u.headers=new Headers({"Content-Type":p}),u.body=JSON.stringify(i.json)):p==="text/plain"?u.body=i.text:p==="application/x-www-form-urlencoded"&&i.formData?u.body=fd(i.formData):u.body=i.formData}return new Request(o,u)}function fd(n){let l=new URLSearchParams;for(let[s,i]of n.entries())l.append(s,typeof i=="string"?i:i.name);return l}function ug(n){let l=new FormData;for(let[s,i]of n.entries())l.append(s,i);return l}function C1(n,l,s,i=!1,o=!1){let u={},m=null,p,g=!1,h={},v=s&&Oa(s[1])?s[1].error:void 0;return n.forEach(y=>{if(!(y.route.id in l))return;let _=y.route.id,j=l[_];if(qe(!Ol(j),"Cannot handle redirect results in processLoaderData"),Oa(j)){let N=j.error;if(v!==void 0&&(N=v,v=void 0),m=m||{},o)m[_]=N;else{let T=sl(n,_);m[T.route.id]==null&&(m[T.route.id]=N)}i||(u[_]=mx),g||(g=!0,p=Dr(j.error)?j.error.status:500),j.headers&&(h[_]=j.headers)}else u[_]=j.data,j.statusCode&&j.statusCode!==200&&!g&&(p=j.statusCode),j.headers&&(h[_]=j.headers)}),v!==void 0&&s&&(m={[s[0]]:v},s[2]&&(u[s[2]]=void 0)),{loaderData:u,errors:m,statusCode:p||200,loaderHeaders:h}}function dg(n,l,s,i,o,u){let{loaderData:m,errors:p}=C1(l,s,i);return o.filter(g=>!g.matches||g.matches.some(h=>h.shouldLoad)).forEach(g=>{let{key:h,match:v,controller:y}=g;if(y&&y.signal.aborted)return;let _=u[h];if(qe(_,"Did not find corresponding fetcher result"),Oa(_)){let j=sl(n.matches,v?.route.id);p&&p[j.route.id]||(p={...p,[j.route.id]:_.error}),n.fetchers.delete(h)}else if(Ol(_))qe(!1,"Unhandled fetcher revalidation redirect");else{let j=On(_.data);n.fetchers.set(h,j)}}),{loaderData:m,errors:p}}function fg(n,l,s,i){let o=Object.entries(l).filter(([,u])=>u!==mx).reduce((u,[m,p])=>(u[m]=p,u),{});for(let u of s){let m=u.route.id;if(!l.hasOwnProperty(m)&&n.hasOwnProperty(m)&&u.route.loader&&(o[m]=n[m]),i&&i.hasOwnProperty(m))break}return o}function mg(n){return n?Oa(n[1])?{actionData:{}}:{actionData:{[n[0]]:n[1].data}}:{}}function sl(n,l){return(l?n.slice(0,n.findIndex(i=>i.route.id===l)+1):[...n]).reverse().find(i=>i.route.hasErrorBoundary===!0)||n[0]}function lo(n){let l=n.length===1?n[0]:n.find(s=>s.index||!s.path||s.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:l}],route:l}}function Ka(n,{pathname:l,routeId:s,method:i,type:o,message:u}={}){let m="Unknown Server Error",p="Unknown @remix-run/router error";return n===400?(m="Bad Request",i&&l&&s?p=`You made a ${i} request to "${l}" but did not provide a \`loader\` for route "${s}", so there is no way to handle the request.`:o==="invalid-body"&&(p="Unable to encode submission body")):n===403?(m="Forbidden",p=`Route "${s}" does not match URL "${l}"`):n===404?(m="Not Found",p=`No route matches URL "${l}"`):n===405&&(m="Method Not Allowed",i&&l&&s?p=`You made a ${i.toUpperCase()} request to "${l}" but did not provide an \`action\` for route "${s}", so there is no way to handle the request.`:i&&(p=`Invalid request method "${i.toUpperCase()}"`)),new qs(n||500,m,new Error(p),!0)}function ro(n){let l=Object.entries(n);for(let s=l.length-1;s>=0;s--){let[i,o]=l[s];if(Ol(o))return{key:i,result:o}}}function vx(n){let l=typeof n=="string"?Mn(n):n;return mn({...l,hash:""})}function R1(n,l){return n.pathname!==l.pathname||n.search!==l.search?!1:n.hash===""?l.hash!=="":n.hash===l.hash?!0:l.hash!==""}function T1(n){return new qs(n.init?.status??500,n.init?.statusText??"Internal Server Error",n.data)}function z1(n){return n!=null&&typeof n=="object"&&Object.entries(n).every(([l,s])=>typeof l=="string"&&O1(s))}function O1(n){return n!=null&&typeof n=="object"&&"type"in n&&"result"in n&&(n.type==="data"||n.type==="error")}function D1(n){return Nd(n.result)&&dx.has(n.result.status)}function Oa(n){return n.type==="error"}function Ol(n){return(n&&n.type)==="redirect"}function hg(n){return typeof n=="object"&&n!=null&&"type"in n&&"data"in n&&"init"in n&&n.type==="DataWithResponseInit"}function Nd(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.headers=="object"&&typeof n.body<"u"}function M1(n){return dx.has(n)}function k1(n){return Nd(n)&&M1(n.status)&&n.headers.has("Location")}function A1(n){return d1.has(n.toUpperCase())}function la(n){return c1.has(n.toUpperCase())}function wd(n){return new URLSearchParams(n).getAll("index").some(l=>l==="")}function mo(n,l){let s=typeof l=="string"?Mn(l).search:l.search;if(n[n.length-1].route.index&&wd(s||""))return n[n.length-1];let i=sx(n);return i[i.length-1]}function pg(n){let{formMethod:l,formAction:s,formEncType:i,text:o,formData:u,json:m}=n;if(!(!l||!s||!i)){if(o!=null)return{formMethod:l,formAction:s,formEncType:i,formData:void 0,json:void 0,text:o};if(u!=null)return{formMethod:l,formAction:s,formEncType:i,formData:u,json:void 0,text:void 0};if(m!==void 0)return{formMethod:l,formAction:s,formEncType:i,formData:void 0,json:m,text:void 0}}}function Ju(n,l){return l?{state:"loading",location:n,formMethod:l.formMethod,formAction:l.formAction,formEncType:l.formEncType,formData:l.formData,json:l.json,text:l.text}:{state:"loading",location:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function L1(n,l){return{state:"submitting",location:n,formMethod:l.formMethod,formAction:l.formAction,formEncType:l.formEncType,formData:l.formData,json:l.json,text:l.text}}function Cs(n,l){return n?{state:"loading",formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text,data:l}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:l}}function U1(n,l){return{state:"submitting",formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text,data:l?l.data:void 0}}function On(n){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:n}}function H1(n,l){try{let s=n.sessionStorage.getItem(fx);if(s){let i=JSON.parse(s);for(let[o,u]of Object.entries(i||{}))u&&Array.isArray(u)&&l.set(o,new Set(u||[]))}}catch{}}function B1(n,l){if(l.size>0){let s={};for(let[i,o]of l)s[i]=[...o];try{n.sessionStorage.setItem(fx,JSON.stringify(s))}catch(i){Rt(!1,`Failed to save applied view transitions in sessionStorage (${i}).`)}}}function gg(){let n,l,s=new Promise((i,o)=>{n=async u=>{i(u);try{await s}catch{}},l=async u=>{o(u);try{await s}catch{}}});return{promise:s,resolve:n,reject:l}}var Ll=b.createContext(null);Ll.displayName="DataRouter";var Gs=b.createContext(null);Gs.displayName="DataRouterState";var Sx=b.createContext(!1);function $1(){return b.useContext(Sx)}var Ed=b.createContext({isTransitioning:!1});Ed.displayName="ViewTransition";var _x=b.createContext(new Map);_x.displayName="Fetchers";var q1=b.createContext(null);q1.displayName="Await";var Ma=b.createContext(null);Ma.displayName="Navigation";var jo=b.createContext(null);jo.displayName="Location";var Za=b.createContext({outlet:null,matches:[],isDataRoute:!1});Za.displayName="Route";var Cd=b.createContext(null);Cd.displayName="RouteError";var jx="REACT_ROUTER_ERROR",Y1="REDIRECT",G1="ROUTE_ERROR_RESPONSE";function V1(n){if(n.startsWith(`${jx}:${Y1}:{`))try{let l=JSON.parse(n.slice(28));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.location=="string"&&typeof l.reloadDocument=="boolean"&&typeof l.replace=="boolean")return l}catch{}}function K1(n){if(n.startsWith(`${jx}:${G1}:{`))try{let l=JSON.parse(n.slice(40));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string")return new qs(l.status,l.statusText,l.data)}catch{}}function X1(n,{relative:l}={}){qe(Mr(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:i}=b.useContext(Ma),{hash:o,pathname:u,search:m}=Ks(n,{relative:l}),p=u;return s!=="/"&&(p=u==="/"?s:tn([s,u])),i.createHref({pathname:p,search:m,hash:o})}function Mr(){return b.useContext(jo)!=null}function nn(){return qe(Mr(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(jo).location}var Nx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function wx(n){b.useContext(Ma).static||b.useLayoutEffect(n)}function kn(){let{isDataRoute:n}=b.useContext(Za);return n?s4():Q1()}function Q1(){qe(Mr(),"useNavigate() may be used only in the context of a <Router> component.");let n=b.useContext(Ll),{basename:l,navigator:s}=b.useContext(Ma),{matches:i}=b.useContext(Za),{pathname:o}=nn(),u=JSON.stringify(_o(i)),m=b.useRef(!1);return wx(()=>{m.current=!0}),b.useCallback((g,h={})=>{if(Rt(m.current,Nx),!m.current)return;if(typeof g=="number"){s.go(g);return}let v=$s(g,JSON.parse(u),o,h.relative==="path");n==null&&l!=="/"&&(v.pathname=v.pathname==="/"?l:tn([l,v.pathname])),(h.replace?s.replace:s.push)(v,h.state,h)},[l,s,u,o,n])}var Z1=b.createContext(null);function F1(n){let l=b.useContext(Za).outlet;return b.useMemo(()=>l&&b.createElement(Z1.Provider,{value:n},l),[l,n])}function Vs(){let{matches:n}=b.useContext(Za),l=n[n.length-1];return l?l.params:{}}function Ks(n,{relative:l}={}){let{matches:s}=b.useContext(Za),{pathname:i}=nn(),o=JSON.stringify(_o(s));return b.useMemo(()=>$s(n,JSON.parse(o),i,l==="path"),[n,o,i,l])}function J1(n,l,s){qe(Mr(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=b.useContext(Ma),{matches:o}=b.useContext(Za),u=o[o.length-1],m=u?u.params:{},p=u?u.pathname:"/",g=u?u.pathnameBase:"/",h=u&&u.route;{let O=h&&h.path||"";Rx(p,!h||O.endsWith("*")||O.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${O}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
11
+
12
+ Please change the parent <Route path="${O}"> to <Route path="${O==="/"?"*":`${O}/*`}">.`)}let v=nn(),y;y=v;let _=y.pathname||"/",j=_;if(g!=="/"){let O=g.replace(/^\//,"").split("/");j="/"+_.replace(/^\//,"").split("/").slice(O.length).join("/")}let N=rl(n,{pathname:j});return Rt(h||N!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),Rt(N==null||N[N.length-1].route.element!==void 0||N[N.length-1].route.Component!==void 0||N[N.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),t4(N&&N.map(O=>Object.assign({},O,{params:Object.assign({},m,O.params),pathname:tn([g,i.encodeLocation?i.encodeLocation(O.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:O.pathname]),pathnameBase:O.pathnameBase==="/"?g:tn([g,i.encodeLocation?i.encodeLocation(O.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:O.pathnameBase])})),o,s)}function P1(){let n=Cx(),l=Dr(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),s=n instanceof Error?n.stack:null,i="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:i},u={padding:"2px 4px",backgroundColor:i},m=null;return console.error("Error handled by React Router default ErrorBoundary:",n),m=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:u},"ErrorBoundary")," or"," ",b.createElement("code",{style:u},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},l),s?b.createElement("pre",{style:o},s):null,m)}var I1=b.createElement(P1,null),Ex=class extends b.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,l){return l.location!==n.location||l.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:l.error,location:l.location,revalidation:n.revalidation||l.revalidation}}componentDidCatch(n,l){this.props.onError?this.props.onError(n,l):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const s=K1(n.digest);s&&(n=s)}let l=n!==void 0?b.createElement(Za.Provider,{value:this.props.routeContext},b.createElement(Cd.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?b.createElement(W1,{error:n},l):l}};Ex.contextType=Sx;var Pu=new WeakMap;function W1({children:n,error:l}){let{basename:s}=b.useContext(Ma);if(typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){let i=V1(l.digest);if(i){let o=Pu.get(l);if(o)throw o;let u=ox(i.location,s);if(ix&&!Pu.get(l))if(u.isExternal||i.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:i.replace}));throw Pu.set(l,m),m}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return n}function e4({routeContext:n,match:l,children:s}){let i=b.useContext(Ll);return i&&i.static&&i.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=l.route.id),b.createElement(Za.Provider,{value:n},s)}function t4(n,l=[],s){let i=s?.state;if(n==null){if(!i)return null;if(i.errors)n=i.matches;else if(l.length===0&&!i.initialized&&i.matches.length>0)n=i.matches;else return null}let o=n,u=i?.errors;if(u!=null){let v=o.findIndex(y=>y.route.id&&u?.[y.route.id]!==void 0);qe(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),o=o.slice(0,Math.min(o.length,v+1))}let m=!1,p=-1;if(s&&i){m=i.renderFallback;for(let v=0;v<o.length;v++){let y=o[v];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(p=v),y.route.id){let{loaderData:_,errors:j}=i,N=y.route.loader&&!_.hasOwnProperty(y.route.id)&&(!j||j[y.route.id]===void 0);if(y.route.lazy||N){s.isStatic&&(m=!0),p>=0?o=o.slice(0,p+1):o=[o[0]];break}}}}let g=s?.onError,h=i&&g?(v,y)=>{g(v,{location:i.location,params:i.matches?.[0]?.params??{},unstable_pattern:Ys(i.matches),errorInfo:y})}:void 0;return o.reduceRight((v,y,_)=>{let j,N=!1,T=null,O=null;i&&(j=u&&y.route.id?u[y.route.id]:void 0,T=y.route.errorElement||I1,m&&(p<0&&_===0?(Rx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),N=!0,O=null):p===_&&(N=!0,O=y.route.hydrateFallbackElement||null)));let G=l.concat(o.slice(0,_+1)),Z=()=>{let $;return j?$=T:N?$=O:y.route.Component?$=b.createElement(y.route.Component,null):y.route.element?$=y.route.element:$=v,b.createElement(e4,{match:y,routeContext:{outlet:v,matches:G,isDataRoute:i!=null},children:$})};return i&&(y.route.ErrorBoundary||y.route.errorElement||_===0)?b.createElement(Ex,{location:i.location,revalidation:i.revalidation,component:T,error:j,children:Z(),routeContext:{outlet:null,matches:G,isDataRoute:!0},onError:h}):Z()},null)}function Rd(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function a4(n){let l=b.useContext(Ll);return qe(l,Rd(n)),l}function n4(n){let l=b.useContext(Gs);return qe(l,Rd(n)),l}function l4(n){let l=b.useContext(Za);return qe(l,Rd(n)),l}function Td(n){let l=l4(n),s=l.matches[l.matches.length-1];return qe(s.route.id,`${n} can only be used on routes that contain a unique "id"`),s.route.id}function r4(){return Td("useRouteId")}function Cx(){let n=b.useContext(Cd),l=n4("useRouteError"),s=Td("useRouteError");return n!==void 0?n:l.errors?.[s]}function s4(){let{router:n}=a4("useNavigate"),l=Td("useNavigate"),s=b.useRef(!1);return wx(()=>{s.current=!0}),b.useCallback(async(o,u={})=>{Rt(s.current,Nx),s.current&&(typeof o=="number"?await n.navigate(o):await n.navigate(o,{fromRouteId:l,...u}))},[n,l])}var xg={};function Rx(n,l,s){!l&&!xg[n]&&(xg[n]=!0,Rt(!1,s))}var yg={};function bg(n,l){!n&&!yg[l]&&(yg[l]=!0,console.warn(l))}var i4="useOptimistic",vg=Hb[i4],o4=()=>{};function c4(n){return vg?vg(n):[n,o4]}function u4(n){let l={hasErrorBoundary:n.hasErrorBoundary||n.ErrorBoundary!=null||n.errorElement!=null};return n.Component&&(n.element&&Rt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(l,{element:b.createElement(n.Component),Component:void 0})),n.HydrateFallback&&(n.hydrateFallbackElement&&Rt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(l,{hydrateFallbackElement:b.createElement(n.HydrateFallback),HydrateFallback:void 0})),n.ErrorBoundary&&(n.errorElement&&Rt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(l,{errorElement:b.createElement(n.ErrorBoundary),ErrorBoundary:void 0})),l}var d4=["HydrateFallback","hydrateFallbackElement"],f4=class{constructor(){this.status="pending",this.promise=new Promise((n,l)=>{this.resolve=s=>{this.status==="pending"&&(this.status="resolved",n(s))},this.reject=s=>{this.status==="pending"&&(this.status="rejected",l(s))}})}};function m4({router:n,flushSync:l,onError:s,unstable_useTransitions:i}){i=$1()||i;let[u,m]=b.useState(n.state),[p,g]=c4(u),[h,v]=b.useState(),[y,_]=b.useState({isTransitioning:!1}),[j,N]=b.useState(),[T,O]=b.useState(),[G,Z]=b.useState(),$=b.useRef(new Map),V=b.useCallback((E,{deletedFetchers:q,newErrors:ee,flushSync:de,viewTransitionOpts:oe})=>{ee&&s&&Object.values(ee).forEach(ue=>s(ue,{location:E.location,params:E.matches[0]?.params??{},unstable_pattern:Ys(E.matches)})),E.fetchers.forEach((ue,ge)=>{ue.data!==void 0&&$.current.set(ge,ue.data)}),q.forEach(ue=>$.current.delete(ue)),bg(de===!1||l!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let re=n.window!=null&&n.window.document!=null&&typeof n.window.document.startViewTransition=="function";if(bg(oe==null||re,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!oe||!re){l&&de?l(()=>m(E)):i===!1?m(E):b.startTransition(()=>{i===!0&&g(ue=>Sg(ue,E)),m(E)});return}if(l&&de){l(()=>{T&&(j?.resolve(),T.skipTransition()),_({isTransitioning:!0,flushSync:!0,currentLocation:oe.currentLocation,nextLocation:oe.nextLocation})});let ue=n.window.document.startViewTransition(()=>{l(()=>m(E))});ue.finished.finally(()=>{l(()=>{N(void 0),O(void 0),v(void 0),_({isTransitioning:!1})})}),l(()=>O(ue));return}T?(j?.resolve(),T.skipTransition(),Z({state:E,currentLocation:oe.currentLocation,nextLocation:oe.nextLocation})):(v(E),_({isTransitioning:!0,flushSync:!1,currentLocation:oe.currentLocation,nextLocation:oe.nextLocation}))},[n.window,l,T,j,i,g,s]);b.useLayoutEffect(()=>n.subscribe(V),[n,V]),b.useEffect(()=>{y.isTransitioning&&!y.flushSync&&N(new f4)},[y]),b.useEffect(()=>{if(j&&h&&n.window){let E=h,q=j.promise,ee=n.window.document.startViewTransition(async()=>{i===!1?m(E):b.startTransition(()=>{i===!0&&g(de=>Sg(de,E)),m(E)}),await q});ee.finished.finally(()=>{N(void 0),O(void 0),v(void 0),_({isTransitioning:!1})}),O(ee)}},[h,j,n.window,i,g]),b.useEffect(()=>{j&&h&&p.location.key===h.location.key&&j.resolve()},[j,T,p.location,h]),b.useEffect(()=>{!y.isTransitioning&&G&&(v(G.state),_({isTransitioning:!0,flushSync:!1,currentLocation:G.currentLocation,nextLocation:G.nextLocation}),Z(void 0))},[y.isTransitioning,G]);let X=b.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:E=>n.navigate(E),push:(E,q,ee)=>n.navigate(E,{state:q,preventScrollReset:ee?.preventScrollReset}),replace:(E,q,ee)=>n.navigate(E,{replace:!0,state:q,preventScrollReset:ee?.preventScrollReset})}),[n]),W=n.basename||"/",F=b.useMemo(()=>({router:n,navigator:X,static:!1,basename:W,onError:s}),[n,X,W,s]);return b.createElement(b.Fragment,null,b.createElement(Ll.Provider,{value:F},b.createElement(Gs.Provider,{value:p},b.createElement(_x.Provider,{value:$.current},b.createElement(Ed.Provider,{value:y},b.createElement(g4,{basename:W,location:p.location,navigationType:p.historyAction,navigator:X,unstable_useTransitions:i},b.createElement(h4,{routes:n.routes,future:n.future,state:p,isStatic:!1,onError:s})))))),null)}function Sg(n,l){return{...n,navigation:l.navigation.state!=="idle"?l.navigation:n.navigation,revalidation:l.revalidation!=="idle"?l.revalidation:n.revalidation,actionData:l.navigation.state!=="submitting"?l.actionData:n.actionData,fetchers:l.fetchers}}var h4=b.memo(p4);function p4({routes:n,future:l,state:s,isStatic:i,onError:o}){return J1(n,void 0,{state:s,isStatic:i,onError:o})}function _g({to:n,replace:l,state:s,relative:i}){qe(Mr(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=b.useContext(Ma);Rt(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=b.useContext(Za),{pathname:m}=nn(),p=kn(),g=$s(n,_o(u),m,i==="path"),h=JSON.stringify(g);return b.useEffect(()=>{p(JSON.parse(h),{replace:l,state:s,relative:i})},[p,h,i,l,s]),null}function Tx(n){return F1(n.context)}function g4({basename:n="/",children:l=null,location:s,navigationType:i="POP",navigator:o,static:u=!1,unstable_useTransitions:m}){qe(!Mr(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=n.replace(/^\/*/,"/"),g=b.useMemo(()=>({basename:p,navigator:o,static:u,unstable_useTransitions:m,future:{}}),[p,o,u,m]);typeof s=="string"&&(s=Mn(s));let{pathname:h="/",search:v="",hash:y="",state:_=null,key:j="default",unstable_mask:N}=s,T=b.useMemo(()=>{let O=Qa(h,p);return O==null?null:{location:{pathname:O,search:v,hash:y,state:_,key:j,unstable_mask:N},navigationType:i}},[p,h,v,y,_,j,i,N]);return Rt(T!=null,`<Router basename="${p}"> is not able to match the URL "${h}${v}${y}" because it does not start with the basename, so the <Router> won't render anything.`),T==null?null:b.createElement(Ma.Provider,{value:g},b.createElement(jo.Provider,{children:l,value:T}))}var ho="get",po="application/x-www-form-urlencoded";function No(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function x4(n){return No(n)&&n.tagName.toLowerCase()==="button"}function y4(n){return No(n)&&n.tagName.toLowerCase()==="form"}function b4(n){return No(n)&&n.tagName.toLowerCase()==="input"}function v4(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function S4(n,l){return n.button===0&&(!l||l==="_self")&&!v4(n)}function md(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((l,s)=>{let i=n[s];return l.concat(Array.isArray(i)?i.map(o=>[s,o]):[[s,i]])},[]))}function _4(n,l){let s=md(n);return l&&l.forEach((i,o)=>{s.has(o)||l.getAll(o).forEach(u=>{s.append(o,u)})}),s}var so=null;function j4(){if(so===null)try{new FormData(document.createElement("form"),0),so=!1}catch{so=!0}return so}var N4=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Iu(n){return n!=null&&!N4.has(n)?(Rt(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${po}"`),null):n}function w4(n,l){let s,i,o,u,m;if(y4(n)){let p=n.getAttribute("action");i=p?Qa(p,l):null,s=n.getAttribute("method")||ho,o=Iu(n.getAttribute("enctype"))||po,u=new FormData(n)}else if(x4(n)||b4(n)&&(n.type==="submit"||n.type==="image")){let p=n.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=n.getAttribute("formaction")||p.getAttribute("action");if(i=g?Qa(g,l):null,s=n.getAttribute("formmethod")||p.getAttribute("method")||ho,o=Iu(n.getAttribute("formenctype"))||Iu(p.getAttribute("enctype"))||po,u=new FormData(p,n),!j4()){let{name:h,type:v,value:y}=n;if(v==="image"){let _=h?`${h}.`:"";u.append(`${_}x`,"0"),u.append(`${_}y`,"0")}else h&&u.append(h,y)}}else{if(No(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=ho,i=null,o=po,m=n}return u&&o==="text/plain"&&(m=u,u=void 0),{action:i,method:s.toLowerCase(),encType:o,formData:u,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function zd(n,l){if(n===!1||n===null||typeof n>"u")throw new Error(l)}function E4(n,l,s,i){let o=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return s?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${i}`:o.pathname=`${o.pathname}.${i}`:o.pathname==="/"?o.pathname=`_root.${i}`:l&&Qa(o.pathname,l)==="/"?o.pathname=`${l.replace(/\/$/,"")}/_root.${i}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${i}`,o}async function C4(n,l){if(n.id in l)return l[n.id];try{let s=await import(n.module);return l[n.id]=s,s}catch(s){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(s),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function R4(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function T4(n,l,s){let i=await Promise.all(n.map(async o=>{let u=l.routes[o.route.id];if(u){let m=await C4(u,s);return m.links?m.links():[]}return[]}));return M4(i.flat(1).filter(R4).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function jg(n,l,s,i,o,u){let m=(g,h)=>s[h]?g.route.id!==s[h].route.id:!0,p=(g,h)=>s[h].pathname!==g.pathname||s[h].route.path?.endsWith("*")&&s[h].params["*"]!==g.params["*"];return u==="assets"?l.filter((g,h)=>m(g,h)||p(g,h)):u==="data"?l.filter((g,h)=>{let v=i.routes[g.route.id];if(!v||!v.hasLoader)return!1;if(m(g,h)||p(g,h))return!0;if(g.route.shouldRevalidate){let y=g.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:s[0]?.params||{},nextUrl:new URL(n,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function z4(n,l,{includeHydrateFallback:s}={}){return O4(n.map(i=>{let o=l.routes[i.route.id];if(!o)return[];let u=[o.module];return o.clientActionModule&&(u=u.concat(o.clientActionModule)),o.clientLoaderModule&&(u=u.concat(o.clientLoaderModule)),s&&o.hydrateFallbackModule&&(u=u.concat(o.hydrateFallbackModule)),o.imports&&(u=u.concat(o.imports)),u}).flat(1))}function O4(n){return[...new Set(n)]}function D4(n){let l={},s=Object.keys(n).sort();for(let i of s)l[i]=n[i];return l}function M4(n,l){let s=new Set;return new Set(l),n.reduce((i,o)=>{let u=JSON.stringify(D4(o));return s.has(u)||(s.add(u),i.push({key:u,link:o})),i},[])}function zx(){let n=b.useContext(Ll);return zd(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function k4(){let n=b.useContext(Gs);return zd(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Od=b.createContext(void 0);Od.displayName="FrameworkContext";function Ox(){let n=b.useContext(Od);return zd(n,"You must render this element inside a <HydratedRouter> element"),n}function A4(n,l){let s=b.useContext(Od),[i,o]=b.useState(!1),[u,m]=b.useState(!1),{onFocus:p,onBlur:g,onMouseEnter:h,onMouseLeave:v,onTouchStart:y}=l,_=b.useRef(null);b.useEffect(()=>{if(n==="render"&&m(!0),n==="viewport"){let T=G=>{G.forEach(Z=>{m(Z.isIntersecting)})},O=new IntersectionObserver(T,{threshold:.5});return _.current&&O.observe(_.current),()=>{O.disconnect()}}},[n]),b.useEffect(()=>{if(i){let T=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(T)}}},[i]);let j=()=>{o(!0)},N=()=>{o(!1),m(!1)};return s?n!=="intent"?[u,_,{}]:[u,_,{onFocus:Rs(p,j),onBlur:Rs(g,N),onMouseEnter:Rs(h,j),onMouseLeave:Rs(v,N),onTouchStart:Rs(y,j)}]:[!1,_,{}]}function Rs(n,l){return s=>{n&&n(s),s.defaultPrevented||l(s)}}function L4({page:n,...l}){let{router:s}=zx(),i=b.useMemo(()=>rl(s.routes,n,s.basename),[s.routes,n,s.basename]);return i?b.createElement(H4,{page:n,matches:i,...l}):null}function U4(n){let{manifest:l,routeModules:s}=Ox(),[i,o]=b.useState([]);return b.useEffect(()=>{let u=!1;return T4(n,l,s).then(m=>{u||o(m)}),()=>{u=!0}},[n,l,s]),i}function H4({page:n,matches:l,...s}){let i=nn(),{future:o,manifest:u,routeModules:m}=Ox(),{basename:p}=zx(),{loaderData:g,matches:h}=k4(),v=b.useMemo(()=>jg(n,l,h,u,i,"data"),[n,l,h,u,i]),y=b.useMemo(()=>jg(n,l,h,u,i,"assets"),[n,l,h,u,i]),_=b.useMemo(()=>{if(n===i.pathname+i.search+i.hash)return[];let T=new Set,O=!1;if(l.forEach(Z=>{let $=u.routes[Z.route.id];!$||!$.hasLoader||(!v.some(V=>V.route.id===Z.route.id)&&Z.route.id in g&&m[Z.route.id]?.shouldRevalidate||$.hasClientLoader?O=!0:T.add(Z.route.id))}),T.size===0)return[];let G=E4(n,p,o.unstable_trailingSlashAwareDataRequests,"data");return O&&T.size>0&&G.searchParams.set("_routes",l.filter(Z=>T.has(Z.route.id)).map(Z=>Z.route.id).join(",")),[G.pathname+G.search]},[p,o.unstable_trailingSlashAwareDataRequests,g,i,u,v,l,n,m]),j=b.useMemo(()=>z4(y,u),[y,u]),N=U4(y);return b.createElement(b.Fragment,null,_.map(T=>b.createElement("link",{key:T,rel:"prefetch",as:"fetch",href:T,...s})),j.map(T=>b.createElement("link",{key:T,rel:"modulepreload",href:T,...s})),N.map(({key:T,link:O})=>b.createElement("link",{key:T,nonce:s.nonce,...O,crossOrigin:O.crossOrigin??s.crossOrigin})))}function B4(...n){return l=>{n.forEach(s=>{typeof s=="function"?s(l):s!=null&&(s.current=l)})}}var $4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{$4&&(window.__reactRouterVersion="7.13.1")}catch{}function q4(n,l){return p1({basename:l?.basename,getContext:l?.getContext,future:l?.future,history:Ov({window:l?.window}),hydrationData:Y4(),routes:n,mapRouteProperties:u4,hydrationRouteProperties:d4,dataStrategy:l?.dataStrategy,patchRoutesOnNavigation:l?.patchRoutesOnNavigation,window:l?.window,unstable_instrumentations:l?.unstable_instrumentations}).initialize()}function Y4(){let n=window?.__staticRouterHydrationData;return n&&n.errors&&(n={...n,errors:G4(n.errors)}),n}function G4(n){if(!n)return null;let l=Object.entries(n),s={};for(let[i,o]of l)if(o&&o.__type==="RouteErrorResponse")s[i]=new qs(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let u=window[o.__subType];if(typeof u=="function")try{let m=new u(o.message);m.stack="",s[i]=m}catch{}}if(s[i]==null){let u=new Error(o.message);u.stack="",s[i]=u}}else s[i]=o;return s}var Dx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,va=b.forwardRef(function({onClick:l,discover:s="render",prefetch:i="none",relative:o,reloadDocument:u,replace:m,unstable_mask:p,state:g,target:h,to:v,preventScrollReset:y,viewTransition:_,unstable_defaultShouldRevalidate:j,...N},T){let{basename:O,navigator:G,unstable_useTransitions:Z}=b.useContext(Ma),$=typeof v=="string"&&Dx.test(v),V=ox(v,O);v=V.to;let X=X1(v,{relative:o}),W=nn(),F=null;if(p){let ge=$s(p,[],W.unstable_mask?W.unstable_mask.pathname:"/",!0);O!=="/"&&(ge.pathname=ge.pathname==="/"?O:tn([O,ge.pathname])),F=G.createHref(ge)}let[E,q,ee]=A4(i,N),de=X4(v,{replace:m,unstable_mask:p,state:g,target:h,preventScrollReset:y,relative:o,viewTransition:_,unstable_defaultShouldRevalidate:j,unstable_useTransitions:Z});function oe(ge){l&&l(ge),ge.defaultPrevented||de(ge)}let re=!(V.isExternal||u),ue=b.createElement("a",{...N,...ee,href:(re?F:void 0)||V.absoluteURL||X,onClick:re?oe:l,ref:B4(T,q),target:h,"data-discover":!$&&s==="render"?"true":void 0});return E&&!$?b.createElement(b.Fragment,null,ue,b.createElement(L4,{page:X})):ue});va.displayName="Link";var Hs=b.forwardRef(function({"aria-current":l="page",caseSensitive:s=!1,className:i="",end:o=!1,style:u,to:m,viewTransition:p,children:g,...h},v){let y=Ks(m,{relative:h.relative}),_=nn(),j=b.useContext(Gs),{navigator:N,basename:T}=b.useContext(Ma),O=j!=null&&P4(y)&&p===!0,G=N.encodeLocation?N.encodeLocation(y).pathname:y.pathname,Z=_.pathname,$=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;s||(Z=Z.toLowerCase(),$=$?$.toLowerCase():null,G=G.toLowerCase()),$&&T&&($=Qa($,T)||$);const V=G!=="/"&&G.endsWith("/")?G.length-1:G.length;let X=Z===G||!o&&Z.startsWith(G)&&Z.charAt(V)==="/",W=$!=null&&($===G||!o&&$.startsWith(G)&&$.charAt(G.length)==="/"),F={isActive:X,isPending:W,isTransitioning:O},E=X?l:void 0,q;typeof i=="function"?q=i(F):q=[i,X?"active":null,W?"pending":null,O?"transitioning":null].filter(Boolean).join(" ");let ee=typeof u=="function"?u(F):u;return b.createElement(va,{...h,"aria-current":E,className:q,ref:v,style:ee,to:m,viewTransition:p},typeof g=="function"?g(F):g)});Hs.displayName="NavLink";var V4=b.forwardRef(({discover:n="render",fetcherKey:l,navigate:s,reloadDocument:i,replace:o,state:u,method:m=ho,action:p,onSubmit:g,relative:h,preventScrollReset:v,viewTransition:y,unstable_defaultShouldRevalidate:_,...j},N)=>{let{unstable_useTransitions:T}=b.useContext(Ma),O=F4(),G=J4(p,{relative:h}),Z=m.toLowerCase()==="get"?"get":"post",$=typeof p=="string"&&Dx.test(p),V=X=>{if(g&&g(X),X.defaultPrevented)return;X.preventDefault();let W=X.nativeEvent.submitter,F=W?.getAttribute("formmethod")||m,E=()=>O(W||X.currentTarget,{fetcherKey:l,method:F,navigate:s,replace:o,state:u,relative:h,preventScrollReset:v,viewTransition:y,unstable_defaultShouldRevalidate:_});T&&s!==!1?b.startTransition(()=>E()):E()};return b.createElement("form",{ref:N,method:Z,action:G,onSubmit:i?g:V,...j,"data-discover":!$&&n==="render"?"true":void 0})});V4.displayName="Form";function K4(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Mx(n){let l=b.useContext(Ll);return qe(l,K4(n)),l}function X4(n,{target:l,replace:s,unstable_mask:i,state:o,preventScrollReset:u,relative:m,viewTransition:p,unstable_defaultShouldRevalidate:g,unstable_useTransitions:h}={}){let v=kn(),y=nn(),_=Ks(n,{relative:m});return b.useCallback(j=>{if(S4(j,l)){j.preventDefault();let N=s!==void 0?s:mn(y)===mn(_),T=()=>v(n,{replace:N,unstable_mask:i,state:o,preventScrollReset:u,relative:m,viewTransition:p,unstable_defaultShouldRevalidate:g});h?b.startTransition(()=>T()):T()}},[y,v,_,s,i,o,l,n,u,m,p,g,h])}function wo(n){Rt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let l=b.useRef(md(n)),s=b.useRef(!1),i=nn(),o=b.useMemo(()=>_4(i.search,s.current?null:l.current),[i.search]),u=kn(),m=b.useCallback((p,g)=>{const h=md(typeof p=="function"?p(new URLSearchParams(o)):p);s.current=!0,u("?"+h,g)},[u,o]);return[o,m]}var Q4=0,Z4=()=>`__${String(++Q4)}__`;function F4(){let{router:n}=Mx("useSubmit"),{basename:l}=b.useContext(Ma),s=r4(),i=n.fetch,o=n.navigate;return b.useCallback(async(u,m={})=>{let{action:p,method:g,encType:h,formData:v,body:y}=w4(u,l);if(m.navigate===!1){let _=m.fetcherKey||Z4();await i(_,s,m.action||p,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:v,body:y,formMethod:m.method||g,formEncType:m.encType||h,flushSync:m.flushSync})}else await o(m.action||p,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:v,body:y,formMethod:m.method||g,formEncType:m.encType||h,replace:m.replace,state:m.state,fromRouteId:s,flushSync:m.flushSync,viewTransition:m.viewTransition})},[i,o,l,s])}function J4(n,{relative:l}={}){let{basename:s}=b.useContext(Ma),i=b.useContext(Za);qe(i,"useFormAction must be used inside a RouteContext");let[o]=i.matches.slice(-1),u={...Ks(n||".",{relative:l})},m=nn();if(n==null){u.search=m.search;let p=new URLSearchParams(u.search),g=p.getAll("index");if(g.some(v=>v==="")){p.delete("index"),g.filter(y=>y).forEach(y=>p.append("index",y));let v=p.toString();u.search=v?`?${v}`:""}}return(!n||n===".")&&o.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(u.pathname=u.pathname==="/"?s:tn([s,u.pathname])),mn(u)}function P4(n,{relative:l}={}){let s=b.useContext(Ed);qe(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Mx("useViewTransitionState"),o=Ks(n,{relative:l});if(!s.isTransitioning)return!1;let u=Qa(s.currentLocation.pathname,i)||s.currentLocation.pathname,m=Qa(s.nextLocation.pathname,i)||s.nextLocation.pathname;return bo(o.pathname,m)!=null||bo(o.pathname,u)!=null}const Ng=n=>{let l;const s=new Set,i=(h,v)=>{const y=typeof h=="function"?h(l):h;if(!Object.is(y,l)){const _=l;l=v??(typeof y!="object"||y===null)?y:Object.assign({},l,y),s.forEach(j=>j(l,_))}},o=()=>l,p={setState:i,getState:o,getInitialState:()=>g,subscribe:h=>(s.add(h),()=>s.delete(h))},g=l=n(i,o,p);return p},I4=(n=>n?Ng(n):Ng),W4=n=>n;function eS(n,l=W4){const s=Rr.useSyncExternalStore(n.subscribe,Rr.useCallback(()=>l(n.getState()),[n,l]),Rr.useCallback(()=>l(n.getInitialState()),[n,l]));return Rr.useDebugValue(s),s}const wg=n=>{const l=I4(n),s=i=>eS(l,i);return Object.assign(s,l),s},Eo=(n=>n?wg(n):wg),kx="/api/v1";class Dl extends Error{constructor(l,s,i){super(i),this.status=l,this.code=s,this.name="ApiError"}}async function io(n,l,s,i,o){let u=`${kx}${l}`;if(i){const g=new URLSearchParams(i).toString();g&&(u+=`?${g}`)}const m={method:n,headers:{"Content-Type":"application/json"}};s!==void 0&&(m.body=JSON.stringify(s)),o?.signal&&(m.signal=o.signal);const p=await fetch(u,m);if(!p.ok){let g="UNKNOWN",h=p.statusText;try{const v=await p.json();v.code&&(g=v.code),v.message&&(h=v.message)}catch{}throw new Dl(p.status,g,h)}return p.json()}const Wu=new Map;function tS(n,l){let s=`${kx}${n}`;if(l){const i=new URLSearchParams(l).toString();i&&(s+=`?${i}`)}return s}const _t={get(n,l,s){const i=tS(n,l),o=Wu.get(i);if(o)return o;const u=io("GET",n,void 0,l,s).finally(()=>{Wu.delete(i)});return Wu.set(i,u),u},post(n,l,s){return io("POST",n,l,void 0,s)},put(n,l){return io("PUT",n,l)},delete(n){return io("DELETE",n)}},aS=3e4,nS=1e3,lS=3e4;class rS{ws=null;url="";handlers=new Map;statusHandlers=new Set;heartbeatTimer=null;reconnectTimer=null;reconnectAttempt=0;intentionalClose=!1;_status="disconnected";get status(){return this._status}setStatus(l){this._status=l;for(const s of this.statusHandlers)s(l)}onStatusChange(l){return this.statusHandlers.add(l),()=>{this.statusHandlers.delete(l)}}connect(l){this.url=l,this.intentionalClose=!1,this.reconnectAttempt=0,this.open()}disconnect(){this.intentionalClose=!0,this.clearTimers(),this.ws&&(this.ws.close(),this.ws=null),this.setStatus("disconnected")}on(l,s){let i=this.handlers.get(l);return i||(i=new Set,this.handlers.set(l,i)),i.add(s),()=>{i.delete(s),i.size===0&&this.handlers.delete(l)}}send(l,s){if(this.ws?.readyState!==WebSocket.OPEN)return;const i={event:l,payload:s,timestamp:Date.now()};this.ws.send(JSON.stringify(i))}open(){this.setStatus("connecting");const l=new WebSocket(this.url);l.onopen=()=>{this.reconnectAttempt=0,this.setStatus("connected"),this.startHeartbeat()},l.onmessage=s=>{try{const i=JSON.parse(String(s.data));if(i.event==="pong")return;const o=this.handlers.get(i.event);if(o)for(const u of o)u(i.payload)}catch{}},l.onclose=()=>{this.stopHeartbeat(),this.intentionalClose||(this.setStatus("reconnecting"),this.scheduleReconnect())},l.onerror=()=>{},this.ws=l}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({event:"ping",payload:null,timestamp:Date.now()}))},aS)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}scheduleReconnect(){if(this.reconnectTimer)return;const l=Math.min(nS*2**this.reconnectAttempt,lS);this.reconnectAttempt++,this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.open()},l)}clearTimers(){this.stopHeartbeat(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}const an=new rS,ul="lib_cloud_default",It=Eo((n,l)=>({libraries:[],loading:!1,error:null,fetchLibraries:async()=>{n({loading:!0,error:null});try{const s=await _t.get("/libraries");n({libraries:s,loading:!1})}catch(s){n({error:s instanceof Error?s.message:"Failed to load libraries",loading:!1})}},createLibrary:async s=>{const i=await _t.post("/libraries",s);return n(o=>({libraries:[...o.libraries,i]})),i},deleteLibrary:async s=>{await _t.delete(`/libraries/${s}`),n(i=>({libraries:i.libraries.filter(o=>o.id!==s)}))},updateLibraryName:async(s,i)=>{const o=await _t.put(`/libraries/${s}`,{name:i});n(u=>({libraries:u.libraries.map(m=>m.id===s?o:m)}))},_updateLibraryOnline:(s,i)=>{n(o=>({libraries:o.libraries.map(u=>u.id===s?{...u,is_online:i}:u)}))},_refreshLibrary:async s=>{try{const i=await _t.get(`/libraries/${s}`);n(o=>({libraries:o.libraries.map(u=>u.id===s?i:u)}))}catch{l().fetchLibraries()}}})),kr=n=>{const l=n.libraries.filter(i=>i.type==="cloud").sort((i,o)=>i.created_at.localeCompare(o.created_at)),s=n.libraries.filter(i=>i.type==="daemon").sort((i,o)=>i.name.localeCompare(o.name));return[...l,...s]},sS=n=>n.libraries.filter(l=>l.type==="daemon");an.on("ws:daemon:status",n=>{const l=n;l.lib_id&&It.getState()._updateLibraryOnline(l.lib_id,l.is_online),It.getState().fetchLibraries()});an.on("ws:daemon:connected",n=>{const l=n;l.lib_id&&It.getState()._updateLibraryOnline(l.lib_id,!0),It.getState().fetchLibraries()});an.on("ws:library:updated",n=>{const l=n;It.getState()._refreshLibrary(l.library_id)});const Ax=(...n)=>n.filter((l,s,i)=>!!l&&l.trim()!==""&&i.indexOf(l)===s).join(" ").trim();const iS=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const oS=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(l,s,i)=>i?i.toUpperCase():s.toLowerCase());const Eg=n=>{const l=oS(n);return l.charAt(0).toUpperCase()+l.slice(1)};var cS={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const uS=n=>{for(const l in n)if(l.startsWith("aria-")||l==="role"||l==="title")return!0;return!1};const dS=b.forwardRef(({color:n="currentColor",size:l=24,strokeWidth:s=2,absoluteStrokeWidth:i,className:o="",children:u,iconNode:m,...p},g)=>b.createElement("svg",{ref:g,...cS,width:l,height:l,stroke:n,strokeWidth:i?Number(s)*24/Number(l):s,className:Ax("lucide",o),...!u&&!uS(p)&&{"aria-hidden":"true"},...p},[...m.map(([h,v])=>b.createElement(h,v)),...Array.isArray(u)?u:[u]]));const Me=(n,l)=>{const s=b.forwardRef(({className:i,...o},u)=>b.createElement(dS,{ref:u,iconNode:l,className:Ax(`lucide-${iS(Eg(n))}`,`lucide-${n}`,i),...o}));return s.displayName=Eg(n),s};const fS=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Lx=Me("arrow-right",fS);const mS=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Cg=Me("arrow-up-right",mS);const hS=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],pS=Me("boxes",hS);const gS=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],xS=Me("brain",gS);const yS=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Al=Me("check",yS);const bS=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],da=Me("chevron-right",bS);const vS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Ux=Me("circle-alert",vS);const SS=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],_S=Me("cloud",SS);const jS=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],hd=Me("copy",jS);const NS=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],wS=Me("database",NS);const ES=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],CS=Me("file-spreadsheet",ES);const RS=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],cl=Me("file-text",RS);const TS=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],Hx=Me("file",TS);const zS=[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]],OS=Me("files",zS);const DS=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],Co=Me("folder-git-2",DS);const MS=[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]],kS=Me("folder-input",MS);const AS=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],LS=Me("folder-open",AS);const US=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Bx=Me("folder-plus",US);const HS=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Xa=Me("folder",HS);const BS=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],pd=Me("git-branch",BS);const $S=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],qS=Me("git-commit-horizontal",$S);const YS=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],Rg=Me("github",YS);const GS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],VS=Me("globe",GS);const KS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],XS=Me("info",KS);const QS=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],ZS=Me("laptop",QS);const FS=[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]],JS=Me("list-filter",FS);const PS=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Da=Me("loader-circle",PS);const IS=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],WS=Me("menu",IS);const e2=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],t2=Me("monitor",e2);const a2=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],n2=Me("moon",a2);const l2=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Or=Me("package",l2);const r2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],s2=Me("panel-left",r2);const i2=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],gd=Me("pencil",i2);const o2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],$x=Me("plus",o2);const c2=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],u2=Me("refresh-cw",c2);const d2=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],f2=Me("rotate-cw",d2);const m2=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],xd=Me("search",m2);const h2=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],p2=Me("settings",h2);const g2=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],x2=Me("share-2",g2);const y2=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],b2=Me("sparkles",y2);const v2=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],S2=Me("sun",v2);const _2=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],qx=Me("trash-2",_2);const j2=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],yd=Me("upload",j2);const N2=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],w2=Me("users",N2);const E2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ul=Me("x",E2),Tg=n=>Symbol.iterator in n,zg=n=>"entries"in n,Og=(n,l)=>{const s=n instanceof Map?n:new Map(n.entries()),i=l instanceof Map?l:new Map(l.entries());if(s.size!==i.size)return!1;for(const[o,u]of s)if(!i.has(o)||!Object.is(u,i.get(o)))return!1;return!0},C2=(n,l)=>{const s=n[Symbol.iterator](),i=l[Symbol.iterator]();let o=s.next(),u=i.next();for(;!o.done&&!u.done;){if(!Object.is(o.value,u.value))return!1;o=s.next(),u=i.next()}return!!o.done&&!!u.done};function R2(n,l){return Object.is(n,l)?!0:typeof n!="object"||n===null||typeof l!="object"||l===null||Object.getPrototypeOf(n)!==Object.getPrototypeOf(l)?!1:Tg(n)&&Tg(l)?zg(n)&&zg(l)?Og(n,l):C2(n,l):Og({entries:()=>Object.entries(n)},{entries:()=>Object.entries(l)})}function Hl(n){const l=Rr.useRef(void 0);return s=>{const i=n(s);return R2(l.current,i)?l.current:l.current=i}}function bd(){const{t:n}=Te(),l=It(Hl(sS));if(l.length===0)return null;const s=l.filter(m=>m.is_online).length,i=l.length,o=s>0,u=o?n("sources.header.daemon_status",{online:s,total:i}):n("sources.header.all_offline");return f.jsxs("div",{className:"group relative flex items-center",title:u,children:[f.jsx("span",{className:`inline-block h-[7px] w-[7px] rounded-full ${o?"bg-c4a-success":"bg-c4a-error"}`}),f.jsx("span",{className:"pointer-events-none absolute right-full mr-2 hidden whitespace-nowrap rounded bg-c4a-bg-elevated px-2 py-1 font-mono text-xs text-c4a-text-secondary shadow-c4a-md group-hover:block",children:u})]})}const Dg=[{to:"/",labelKey:"nav.home"},{to:"/studio",labelKey:"nav.studio"},{to:"/docs",labelKey:"nav.docs"}];function T2(){const{t:n}=Te(),[l,s]=b.useState(!1);return f.jsxs("header",{className:"sticky top-0 z-40 border-b border-c4a-border-subtle bg-c4a-bg-base/95 backdrop-blur-sm",children:[f.jsxs("div",{className:"flex h-14 items-center justify-between px-4",children:[f.jsxs(va,{to:"/",className:"flex items-center gap-2 text-c4a-text-primary",children:[f.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"}),f.jsx("span",{className:"hidden font-mono text-sm font-semibold uppercase tracking-tight md:inline",children:"Context4AI"})]}),f.jsxs("div",{className:"hidden items-center gap-6 md:flex",children:[f.jsx("nav",{className:"flex items-center gap-4",children:Dg.map(({to:i,labelKey:o})=>f.jsx(Hs,{to:i,end:i==="/",className:({isActive:u})=>`font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${u?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:n(o)},i))}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(bd,{}),f.jsx(va,{to:"/login",className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-primary",children:n("nav.login")})]})]}),f.jsx("button",{onClick:()=>s(!l),className:"text-c4a-text-secondary md:hidden",children:l?f.jsx(Ul,{size:20}):f.jsx(WS,{size:20})})]}),l&&f.jsxs("div",{className:"border-t border-c4a-border-subtle bg-c4a-bg-surface px-4 pb-4 pt-2 md:hidden",children:[f.jsx("nav",{className:"flex flex-col gap-2",children:Dg.map(({to:i,labelKey:o})=>f.jsx(Hs,{to:i,end:i==="/",onClick:()=>s(!1),className:({isActive:u})=>`block py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${u?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:n(o)},i))}),f.jsx("div",{className:"mt-2 border-t border-c4a-border-subtle pt-2",children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(bd,{}),f.jsx(va,{to:"/login",onClick:()=>s(!1),className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-primary",children:n("nav.login")})]})})]})]})}function z2(n){return n==="system"&&typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":n==="system"?"dark":n}function Yx(n){if(typeof window>"u")return;const l=z2(n);document.documentElement.setAttribute("data-theme",l),localStorage.setItem("theme",n)}function O2(){try{return localStorage.getItem("theme")||"system"}catch{return"system"}}const Gx=Eo(n=>({theme:O2(),setTheme:l=>{Yx(l),n({theme:l})}}));let Mg=!1;function D2(){if(Mg||typeof window>"u")return;Mg=!0;const n=window.matchMedia("(prefers-color-scheme: dark)"),l=()=>{const{theme:s}=Gx.getState();s==="system"&&Yx("system")};n.addEventListener("change",l)}D2();const M2=[{mode:"light",icon:S2,labelKey:"footer.theme.light"},{mode:"dark",icon:n2,labelKey:"footer.theme.dark"},{mode:"system",icon:t2,labelKey:"footer.theme.system"}];function Vx(){const{t:n}=Te(),{theme:l,setTheme:s}=Gx();return f.jsx("div",{className:"flex items-center gap-1",children:M2.map(({mode:i,icon:o,labelKey:u})=>f.jsx("button",{onClick:()=>s(i),title:n(u),className:`cursor-pointer rounded p-1.5 transition-colors duration-150 ${l===i?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:f.jsx(o,{size:14})},i))})}function Kx(){const{i18n:n}=Te(),l=()=>{const s=n.language==="en"?"zh":"en";n.changeLanguage(s)};return f.jsx("button",{onClick:l,className:"cursor-pointer rounded px-2 py-1 font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-secondary hover:bg-c4a-bg-hover",children:n.language==="en"?"CN":"EN"})}function Xx({compact:n}){const{t:l}=Te(),s=new Date().getFullYear(),i=n?"footer.copyright_compact":"footer.copyright";return f.jsx("p",{className:"font-mono text-[11px] text-c4a-text-muted",children:l(i,{year:s})})}const k2="_brandIcon_1c7st_1",A2="_iconPulse_1c7st_35",kg={brandIcon:k2,iconPulse:A2};function L2({variant:n}){const{t:l}=Te(),s=n==="studio"?"bg-c4a-bg-surface":"bg-c4a-bg-base";return f.jsx("footer",{className:`border-t border-c4a-border-subtle ${s} px-4 py-4`,children:f.jsxs("div",{className:"flex items-end justify-between gap-4",children:[f.jsxs("div",{className:"hidden items-center gap-3 md:flex",children:[f.jsx("div",{className:kg.brandIcon,children:f.jsx("span",{className:kg.iconPulse,children:"C4A"})}),f.jsxs("div",{className:"flex flex-col",children:[f.jsx("span",{className:"font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-primary",children:"Context4AI"}),f.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wider text-c4a-text-muted",children:l("footer.tagline")})]})]}),f.jsxs("div",{className:"ml-auto flex flex-col items-end gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Vx,{}),f.jsx(Kx,{})]}),f.jsx(Xx,{})]})]})})}function U2(){return f.jsxs("div",{className:"flex min-h-screen flex-col",children:[f.jsx(T2,{}),f.jsx("main",{className:"mx-auto flex w-full max-w-[1200px] flex-1 flex-col px-4",children:f.jsx(Tx,{})}),f.jsx(L2,{})]})}function H2({onToggleSidebar:n}){const{t:l}=Te();return f.jsx("header",{className:"sticky top-0 z-40 border-b border-c4a-border-subtle bg-c4a-bg-surface/95 backdrop-blur-sm",children:f.jsxs("div",{className:"relative flex h-14 items-center justify-between px-4",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[n&&f.jsx("button",{onClick:n,className:"text-c4a-text-secondary transition-colors duration-150 hover:text-c4a-text-primary md:hidden",children:f.jsx(s2,{size:20})}),f.jsxs(va,{to:"/",className:"hidden items-center gap-2 text-c4a-text-primary md:flex",children:[f.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"}),f.jsx("span",{className:"font-mono text-sm font-semibold uppercase tracking-tight",children:"Context4AI"})]})]}),f.jsx(va,{to:"/",className:"absolute left-1/2 flex -translate-x-1/2 items-center gap-2 text-c4a-text-primary md:hidden",children:f.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"})}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(bd,{}),f.jsx(va,{to:"/login",className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-primary",children:l("nav.login")})]})]})})}const B2=n=>`flex items-center gap-2 rounded px-3 py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${n?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover hover:text-c4a-text-primary"}`,$2=[{to:"/studio/modeling",icon:pS,i18nKey:"studio.sidebar.modeling"},{to:"/studio/brain",icon:xS,i18nKey:"studio.sidebar.brain"},{to:"/studio/discovery",icon:xd,i18nKey:"studio.sidebar.discovery"},{to:"/studio/sharing",icon:x2,i18nKey:"studio.sidebar.sharing"},{to:"/studio/collaboration",icon:w2,i18nKey:"studio.sidebar.collaboration"},{to:"/studio/settings",icon:p2,i18nKey:"studio.sidebar.settings"}];function Ag({onNavigate:n}){const{t:l}=Te(),s=nn(),i=kn(),o=It(Hl(kr)),u=s.pathname.startsWith("/studio/sources")||s.pathname.startsWith("/studio/source/"),[m,p]=b.useState(u);b.useEffect(()=>{u&&p(!0)},[u]);const g=h=>h.id===ul?l("sources.library.default_cloud_name"):h.name;return f.jsxs("aside",{className:"flex h-full w-[220px] shrink-0 flex-col border-r border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsxs("nav",{className:"flex flex-col gap-1",children:[f.jsxs("div",{className:"group/sources",children:[f.jsxs("button",{onClick:()=>p(h=>!h),className:`flex w-full cursor-pointer items-center gap-2 rounded px-3 py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${u?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[f.jsx(wS,{size:14}),l("studio.sidebar.sources"),f.jsx("span",{role:"button",tabIndex:0,onClick:h=>{h.stopPropagation(),i("/studio/sources/add-client"),n?.()},onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.stopPropagation(),i("/studio/sources/add-client"),n?.())},className:"rounded p-0.5 text-c4a-text-muted opacity-0 transition-all hover:bg-c4a-bg-hover max-md:opacity-100 group-hover/sources:opacity-100 group-hover/sources:text-c4a-accent",title:l("sources.menu.add_client"),children:f.jsx($x,{size:12})}),f.jsx(da,{size:12,className:`ml-auto shrink-0 transition-transform duration-200 ${m?"rotate-90":""}`})]}),m&&f.jsx("div",{className:"mt-0.5 flex flex-col gap-0.5",children:o.map(h=>{const v=g(h);return f.jsxs(Hs,{to:`/studio/sources/${h.id}`,onClick:n,className:({isActive:y})=>`flex items-center gap-2 rounded py-1.5 pl-8 pr-3 font-mono text-xs tracking-tight transition-colors duration-150 ${y?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover hover:text-c4a-text-primary"}`,children:[h.type==="cloud"?f.jsx(_S,{size:13,className:"shrink-0 opacity-60"}):f.jsx(ZS,{size:13,className:"shrink-0 opacity-60"}),f.jsx("span",{className:"truncate",children:v}),h.type==="daemon"&&(()=>{const y=h.config?.machine_id;return f.jsxs("span",{role:"button",tabIndex:0,onClick:_=>{_.preventDefault(),_.stopPropagation(),i("/studio/sources/add-client"),n?.()},onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),_.stopPropagation(),i("/studio/sources/add-client"),n?.())},className:"group/dot relative ml-auto shrink-0 cursor-pointer rounded-full p-1",children:[f.jsx("span",{className:`block h-[7px] w-[7px] rounded-full ${h.is_online?"bg-c4a-success":"bg-c4a-error"}`}),f.jsx("span",{className:"pointer-events-none absolute left-full top-1/2 z-50 ml-2 hidden -translate-y-1/2 whitespace-nowrap rounded border border-c4a-border-default bg-c4a-bg-elevated px-2.5 py-1.5 text-[11px] leading-relaxed text-c4a-text-secondary shadow-c4a-lg group-hover/dot:block",children:h.is_online?l("sources.menu.status_online",{machine:y??""}):l("sources.menu.status_offline",{machine:y??""})})]})})()]},h.id)})})]}),$2.map(({to:h,icon:v,i18nKey:y})=>f.jsxs(Hs,{to:h,onClick:n,className:({isActive:_})=>B2(_),children:[f.jsx(v,{size:14}),l(y)]},h))]}),f.jsxs("div",{className:"mt-auto flex flex-col gap-2 pt-3",children:[f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx(Vx,{}),f.jsx(Kx,{})]}),f.jsx(Xx,{compact:!0})]})]})}const Bs=Eo(n=>({status:"disconnected",onlineCount:0,connections:[],setStatus:l=>n({status:l}),fetchDaemonStatus:async()=>{try{const l=await _t.get("/daemons/status");n({onlineCount:l.online_count,connections:l.connections})}catch{}}})),q2=n=>n==="connecting"?"disconnected":n;an.onStatusChange(n=>{Bs.getState().setStatus(q2(n))});an.on("ws:daemon:connected",n=>{const l=n;Bs.setState(s=>{if(s.connections.some(m=>m.machine_id===l.machine_id))return s;const o={machine_id:l.machine_id};l.lib_id&&(o.lib_id=l.lib_id);const u=[...s.connections,o];return{connections:u,onlineCount:u.length}})});an.on("ws:daemon:status",n=>{const l=n;Bs.setState(s=>{if(l.is_online){if(s.connections.some(p=>p.machine_id===l.machine_id))return s;const u={machine_id:l.machine_id};l.lib_id&&(u.lib_id=l.lib_id);const m=[...s.connections,u];return{connections:m,onlineCount:m.length}}const i=s.connections.filter(o=>o.machine_id!==l.machine_id);return{connections:i,onlineCount:i.length}})});function Y2(){const[n,l]=b.useState(!1);return b.useEffect(()=>{It.getState().fetchLibraries(),Bs.getState().fetchDaemonStatus()},[]),b.useEffect(()=>an.onStatusChange(s=>{s==="connected"&&(It.getState().fetchLibraries(),Bs.getState().fetchDaemonStatus())}),[]),f.jsxs("div",{className:"flex h-screen flex-col overflow-hidden",children:[f.jsx(H2,{onToggleSidebar:()=>l(!n)}),f.jsxs("div",{className:"flex min-h-0 flex-1",children:[f.jsx("div",{className:"hidden md:block",children:f.jsx(Ag,{})}),n&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"fixed inset-0 top-14 z-30 bg-black/40 md:hidden",onClick:()=>l(!1)}),f.jsx("div",{className:"fixed bottom-0 left-0 top-14 z-30 md:hidden",children:f.jsx(Ag,{onNavigate:()=>l(!1)})})]}),f.jsx("main",{className:"flex min-h-0 flex-1 flex-col overflow-x-hidden",children:f.jsx(Tx,{})})]})]})}function G2(){const{t:n}=Te();return f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center py-20 text-center",children:[f.jsx("h1",{className:"font-mono text-4xl font-bold uppercase tracking-wide text-c4a-text-primary md:text-5xl",children:n("home.hero.title")}),f.jsx("p",{className:"mt-6 max-w-lg text-base text-c4a-text-secondary",children:n("home.hero.description")}),f.jsxs("div",{className:"mt-10 flex items-center gap-4",children:[f.jsxs(va,{to:"/studio",className:"flex items-center gap-2 rounded bg-c4a-accent px-5 py-2.5 font-mono text-xs font-semibold uppercase tracking-tight text-white transition-colors duration-150 hover:bg-c4a-accent-hover",children:[n("home.hero.cta.studio"),f.jsx(Lx,{size:14})]}),f.jsx("a",{href:"https://github.com/context4ai/c4a",target:"_blank",rel:"noopener noreferrer",className:"rounded border border-c4a-border-default px-5 py-2.5 font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary transition-colors duration-150 hover:border-c4a-border-strong hover:text-c4a-text-primary",children:n("home.hero.cta.github")})]})]})}function Fa({title:n,version:l,description:s}){const{t:i}=Te();return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsxs("div",{className:"max-w-md text-center",children:[f.jsx("h2",{className:"font-mono text-2xl font-bold uppercase text-c4a-text-primary",children:n}),l&&f.jsx("span",{className:"mt-3 inline-block rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-1 font-mono text-xs uppercase text-c4a-accent",children:i("placeholder.coming",{version:l})}),f.jsx("p",{className:"mt-4 text-sm text-c4a-text-secondary",children:s})]})})}function V2(){const{t:n}=Te();return f.jsx(Fa,{title:n("page.login.title"),version:"0.5.0",description:n("page.login.description")})}function K2(){const{t:n}=Te();return f.jsx(Fa,{title:n("page.docs.title"),version:"0.4.13",description:n("page.docs.description")})}function X2(){const{t:n}=Te();return f.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-c4a-bg-base p-8 text-center",children:[f.jsx("h1",{className:"font-mono text-6xl font-bold text-c4a-accent",children:n("notfound.title")}),f.jsx("p",{className:"mt-4 text-base text-c4a-text-secondary",children:n("notfound.description")}),f.jsx(va,{to:"/",className:"mt-8 rounded border border-c4a-border-default px-5 py-2.5 font-mono text-xs uppercase tracking-tight text-c4a-text-secondary transition-colors duration-150 hover:border-c4a-border-strong hover:text-c4a-text-primary",children:n("notfound.back")})]})}function Lg(){const{t:n}=Te(),l=Cx();let s="500",i=n("error.description");return Dr(l)?(s=String(l.status),l.status===404?i=n("notfound.description"):l.statusText&&(i=l.statusText)):l instanceof Error&&(i=l.message),console.error(`[ErrorPage] ${s}:`,l),f.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-c4a-bg-base p-8 text-center",children:[f.jsx("h1",{className:"font-mono text-6xl font-bold text-c4a-accent",children:s}),f.jsx("p",{className:"mt-4 max-w-md text-base text-c4a-text-secondary",children:i}),f.jsxs("div",{className:"mt-8 flex items-center gap-3",children:[f.jsxs("button",{onClick:()=>window.location.reload(),className:"flex items-center gap-2 rounded bg-c4a-accent px-5 py-2.5 font-mono text-xs uppercase tracking-tight text-white transition-colors duration-150 hover:bg-c4a-accent-hover",children:[f.jsx(f2,{size:14}),n("error.reload")]}),f.jsx(va,{to:"/",className:"rounded border border-c4a-border-default px-5 py-2.5 font-mono text-xs uppercase tracking-tight text-c4a-text-secondary transition-colors duration-150 hover:border-c4a-border-strong hover:text-c4a-text-primary",children:n("notfound.back")})]})]})}function Q2(){const{t:n}=Te();return f.jsx(Fa,{title:n("page.modeling.title"),version:"0.4.16",description:n("page.modeling.description")})}function Z2(){const{t:n}=Te();return f.jsx(Fa,{title:n("page.brain.title"),version:"0.4.18",description:n("page.brain.description")})}function F2(){const{t:n}=Te();return f.jsx(Fa,{title:n("page.discovery.title"),version:"0.6.x",description:n("page.discovery.description")})}function J2(){const{t:n}=Te();return f.jsx(Fa,{title:n("page.sharing.title"),version:"0.4.39",description:n("page.sharing.description")})}function P2(){const{t:n}=Te();return f.jsx(Fa,{title:n("page.collaboration.title"),version:"0.5.x",description:n("page.collaboration.description")})}function I2(){const{t:n}=Te();return f.jsx(Fa,{title:n("page.settings.title"),version:"0.5.x",description:n("page.settings.description")})}function W2(){const{t:n}=Te();return f.jsx(Fa,{title:n("page.code_setup.title"),version:"0.4.13",description:n("page.code_setup.description")})}function e_(){const{t:n}=Te();return f.jsx(Fa,{title:n("page.code_compile.title"),version:"0.4.13",description:n("page.code_compile.description")})}function t_(){const{t:n}=Te();return f.jsx(Fa,{title:n("page.code_review.title"),version:"0.4.14",description:n("page.code_review.description")})}function a_(){const{t:n}=Te();return f.jsx(Fa,{title:n("page.code_result.title"),version:"0.4.14",description:n("page.code_result.description")})}const Ro=(n,l)=>{for(const s of n){if(s.path===l)return s;if(s.children){const i=Ro(s.children,l);if(i)return i}}return null},n_=(n,l)=>l===""?n:Ro(n,l)?.children??[],Os=(n,l)=>{if(!l)return[];const s=l.split("/"),i=[];let o="";for(const u of s){o=o?`${o}/${u}`:u;const m=Ro(n,o);m&&i.push(m)}return i},To=Eo(n=>({rootSources:[],currentRoot:null,loading:!1,error:null,total:0,limit:100,offset:0,filter:"all",fetchRootSources:async({library_id:l,limit:s,offset:i})=>{n({loading:!0,error:null});try{const o={library_id:l};s!==void 0&&(o.limit=String(s)),i!==void 0&&(o.offset=String(i));const u=await _t.get("/sources",o);n({rootSources:u.items,total:u.total,limit:u.limit,offset:u.offset,loading:!1})}catch(o){n({error:o instanceof Error?o.message:"Failed to load sources",loading:!1})}},fetchRootSource:async l=>{const s=await _t.get(`/sources/${l}`);return n({currentRoot:s}),s},createSource:async l=>await _t.post("/sources",l),addTreeNode:async(l,s)=>{const i=await _t.post(`/sources/${l}/tree`,s);return n(o=>({rootSources:o.rootSources.map(u=>u.id===l?i:u),currentRoot:o.currentRoot?.id===l?i:o.currentRoot})),i},updateSource:async(l,s)=>{const i=await _t.put(`/sources/${l}`,s);n(o=>({rootSources:o.rootSources.map(u=>u.id===l?i:u),currentRoot:o.currentRoot?.id===l?i:o.currentRoot}))},deleteSource:async l=>{await _t.delete(`/sources/${l}`),n(s=>({rootSources:s.rootSources.filter(i=>i.id!==l),currentRoot:s.currentRoot?.id===l?null:s.currentRoot}))},deleteTreeNode:async(l,s)=>{const i=await _t.delete(`/sources/${l}/tree?path=${encodeURIComponent(s)}`);return n(o=>({rootSources:o.rootSources.map(u=>u.id===l?i:u),currentRoot:o.currentRoot?.id===l?i:o.currentRoot})),i},uploadDoc:async l=>await _t.post("/sources/upload",l),setFilter:l=>n({filter:l}),clearSources:()=>n({rootSources:[],currentRoot:null,total:0,offset:0})}));function Ar({segments:n}){const{t:l}=Te(),s=b.useRef(null),i=b.useRef(null),[o,u]=b.useState(0),m=[{label:l("sources.breadcrumb.sources")},...n],p=Math.max(0,m.length-3);b.useEffect(()=>{const h=s.current,v=i.current;if(!h||!v)return;const y=()=>{const j=h.clientWidth,N=Array.from(v.children);if(N.length===0)return;const T=N.map(F=>F.offsetWidth),O=4;if(T.reduce((F,E)=>F+E,0)+O*(T.length-1)<=j){u(0);return}const Z=20,$=(T[0]??0)+(T[1]??0)+O,V=T[T.length-1]??0,X=$+O+Z+O+V;let W=p;for(let F=1;F<=p;F++){let E=0;for(let q=2+F;q<T.length-1;q++)E+=T[q]+O;if(X+E<=j){W=F;break}}u(W)};y();const _=new ResizeObserver(y);return _.observe(h),()=>_.disconnect()},[p,n,l]);const g=(()=>{if(o===0||m.length<=3)return m;const h=m.slice(0,2),v=m[m.length-1],y=m.slice(2+o,m.length-1);return[...h,{label:"…"},...y,v]})();return f.jsxs("div",{ref:s,className:"relative min-w-0 overflow-hidden",children:[f.jsx("nav",{className:"flex min-h-8 items-center gap-1 font-mono text-xs tracking-tight text-c4a-text-muted",children:g.map((h,v)=>{const y=v===g.length-1;return f.jsxs("span",{className:`flex shrink-0 items-center gap-1 ${v===0?"uppercase":""}`,children:[v>0&&f.jsx(da,{size:12,className:"shrink-0 text-c4a-text-muted"}),h.to&&!y?f.jsx(va,{to:h.to,className:"cursor-pointer whitespace-nowrap transition-colors hover:text-c4a-text-primary",children:h.label}):f.jsx("span",{className:`whitespace-nowrap ${y?"text-c4a-text-primary":""}`,children:h.label})]},v)})}),f.jsx("div",{ref:i,"aria-hidden":!0,className:"pointer-events-none invisible absolute left-0 top-0 flex h-0 items-center gap-1 overflow-visible whitespace-nowrap font-mono text-xs tracking-tight",children:m.map((h,v)=>f.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[v>0&&f.jsx(da,{size:12}),f.jsx("span",{className:"whitespace-nowrap",children:h.label})]},v))})]})}const l_=["all","indexed","not_indexed"];function r_({value:n,onChange:l}){const{t:s}=Te(),[i,o]=b.useState(!1),u=b.useRef(null),m=b.useRef(null),p={all:s("sources.filter.all"),indexed:s("sources.filter.indexed"),not_indexed:s("sources.filter.not_indexed")},g=b.useCallback(y=>{u.current&&!u.current.contains(y.target)&&o(!1)},[]);b.useEffect(()=>{if(i)return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[i,g]);const h=b.useCallback(()=>{m.current&&(clearTimeout(m.current),m.current=null),o(!0)},[]),v=b.useCallback(()=>{m.current=setTimeout(()=>o(!1),150)},[]);return f.jsxs("div",{ref:u,className:"relative",onMouseEnter:h,onMouseLeave:v,children:[f.jsxs("button",{className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary sm:px-2 sm:py-1",children:[f.jsx(JS,{size:12}),f.jsx("span",{className:"hidden sm:inline",children:p[n]}),f.jsx(da,{size:12,className:`hidden transition-transform duration-200 sm:block ${i?"rotate-90":""}`})]}),i&&f.jsx("div",{className:"absolute right-0 top-full z-20 mt-1 min-w-[120px] rounded border border-c4a-border-default bg-c4a-bg-elevated py-1 shadow-c4a-lg",children:l_.map(y=>f.jsxs("button",{onClick:()=>{l(y),o(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left font-mono text-xs transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary ${y===n?"text-c4a-accent":"text-c4a-text-secondary"}`,children:[f.jsx(Al,{size:12,className:y===n?"opacity-100":"opacity-0"}),p[y]]},y))})]})}function Qx({currentName:n,onConfirm:l,onCancel:s,error:i}){const[o,u]=b.useState(n),m=b.useRef(null);b.useEffect(()=>{m.current?.select()},[]);const p=b.useCallback(()=>{const h=o.trim();h&&h!==n?l(h):s()},[o,n,l,s]),g=b.useCallback(h=>{h.key==="Enter"?(h.preventDefault(),p()):h.key==="Escape"&&s()},[p,s]);return f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("input",{ref:m,value:o,onChange:h=>u(h.target.value),onKeyDown:g,onBlur:p,className:"min-w-0 flex-1 rounded border border-c4a-accent bg-c4a-bg-surface px-2 py-1 text-sm text-c4a-text-primary outline-none",autoFocus:!0}),f.jsx("button",{onClick:h=>{h.stopPropagation(),p()},className:"rounded p-0.5 text-c4a-success hover:bg-c4a-bg-hover",children:f.jsx(Al,{size:14})}),f.jsx("button",{onClick:h=>{h.stopPropagation(),s()},className:"rounded p-0.5 text-c4a-error hover:bg-c4a-bg-hover",children:f.jsx(Ul,{size:14})}),i&&f.jsx("span",{className:"ml-1 text-xs text-c4a-error",children:i})]})}const s_=new Set(["package.json","pyproject.toml","setup.py","go.mod","cargo.toml","pom.xml","build.gradle"]),i_=new Set([".ts",".tsx",".md"]),o_=new Set([".md",".doc",".docx",".pdf",".ppt",".pptx",".txt"]),c_=new Set([".md",".txt"]),u_=5*1024*1024,d_=10;function vd(n){const l=n.lastIndexOf(".");return l>=0?n.slice(l).toLowerCase():""}function f_(n){const l=n.includes("/")?n.split("/").pop():n;if(s_.has(l.toLowerCase()))return!0;const s=vd(l);return i_.has(s)}const m_=n=>{const l=new Date(n);if(Number.isNaN(l.getTime()))return"";const s=o=>String(o).padStart(2,"0"),i=`${s(l.getMonth()+1)}-${s(l.getDate())} ${s(l.getHours())}:${s(l.getMinutes())}`;return l.getFullYear()===new Date().getFullYear()?i:`${l.getFullYear()}-${i}`},Ug={none:"bg-c4a-text-muted/40",indexed:"bg-c4a-success",stale:"bg-c4a-warning"};function h_({source:n,isDaemonLibrary:l,isRepoRoot:s}){const{t:i}=Te(),o=n.kind==="source",u=o&&(n.source_type==="code"||f_(n.name)),m=u?"text-c4a-accent":"text-c4a-text-secondary group-hover:text-c4a-accent",p=n.metadata?.origin==="remote";let g;if(n.kind==="folder"?g=s||p?f.jsx(Co,{size:16,className:`shrink-0 ${m}`}):l?f.jsx(LS,{size:16,className:`shrink-0 ${m}`}):f.jsx(Xa,{size:16,className:`shrink-0 ${m}`}):n.source_type==="code"?g=f.jsx(Or,{size:16,className:`shrink-0 ${m}`}):g=f.jsx(cl,{size:16,className:`shrink-0 ${m}`}),!o||!u)return f.jsx(f.Fragment,{children:g});const h=Ug[n.index_status]??Ug.none,v=i(`sources.status.${n.index_status}`);return f.jsxs("span",{className:"group/dot relative shrink-0",children:[g,f.jsx("span",{className:`absolute -right-[2px] -top-[2px] block h-[5px] w-[5px] rounded-full ${h}`}),f.jsx("span",{className:"pointer-events-none absolute bottom-full left-1/2 z-50 mb-1.5 -translate-x-1/2 whitespace-nowrap rounded bg-c4a-bg-elevated px-2 py-1 font-mono text-[10px] text-c4a-text-secondary opacity-0 shadow-lg transition-opacity group-hover/dot:opacity-100",children:v})]})}function Hg({source:n,displayName:l,childCount:s,isDaemonLibrary:i,isRepoRoot:o,hasUpdate:u,onClick:m,onRename:p,onDelete:g}){const{t:h}=Te(),[v,y]=b.useState(!1),[_,j]=b.useState(null),N=b.useCallback(async $=>{if(!p)return;const V=await p($);V?j(V):(y(!1),j(null))},[p]),T=b.useCallback(()=>{y(!1),j(null)},[]),O=!o&&p,G=g,Z=n.updated_at||n.created_at;return f.jsxs("div",{className:"group flex cursor-pointer items-center gap-3 rounded py-2 pl-3 pr-5 transition-colors hover:bg-c4a-accent/10 hover:text-c4a-accent",onClick:v?void 0:m,children:[f.jsx(h_,{source:n,isDaemonLibrary:i??!1,isRepoRoot:o??!1}),v?f.jsx("div",{className:"min-w-0 flex-1",onClick:$=>$.stopPropagation(),children:f.jsx(Qx,{currentName:n.name,onConfirm:N,onCancel:T,error:_})}):f.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-c4a-text-secondary group-hover:text-c4a-accent",children:l??n.name}),f.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[u&&f.jsxs("span",{className:"inline-flex items-center gap-1 rounded-sm bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-tight text-c4a-accent/60",children:[f.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-c4a-accent"}),h("sources.change_detection.has_updates")]}),n.kind==="folder"&&s!==void 0&&f.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:h("common.items",{count:s})}),Z&&f.jsx("span",{className:"hidden font-mono text-[11px] text-c4a-text-muted lg:inline",children:m_(Z)})]}),(O||G)&&f.jsxs("div",{className:"flex items-center gap-1 md:opacity-0 md:transition-opacity md:group-hover:opacity-100",children:[O?f.jsx("button",{title:h("sources.actions.rename"),onClick:$=>{$.stopPropagation(),y(!0)},className:"rounded p-1 text-c4a-text-muted transition-colors hover:text-c4a-accent",children:f.jsx(gd,{size:14})}):G?f.jsx("span",{className:"p-1",children:f.jsx("span",{className:"inline-block h-[14px] w-[14px]"})}):null,G&&f.jsx("button",{title:h("sources.actions.delete"),onClick:$=>{$.stopPropagation(),g()},className:"rounded p-1 text-c4a-text-muted transition-colors hover:text-c4a-accent",children:f.jsx(qx,{size:14})})]})]})}function Bl({children:n,onClose:l,className:s="",overlayClass:i="bg-black/50",closeOnOverlay:o=!0,closeOnEsc:u=!0,disableClose:m=!1}){const p=b.useRef(null);b.useEffect(()=>{if(!u)return;const h=v=>{v.key==="Escape"&&!m&&l()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[l,u,m]);const g=b.useCallback(h=>{o&&!m&&p.current&&!p.current.contains(h.target)&&l()},[l,o,m]);return f.jsx("div",{className:`fixed inset-0 z-50 flex items-center justify-center ${i}`,onClick:g,children:f.jsx("div",{ref:p,className:s,children:n})})}function Bg({target:n,onConfirm:l,onCancel:s}){const{t:i}=Te();return f.jsxs(Bl,{onClose:s,className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:i("sources.delete.confirm_title")}),f.jsxs("div",{className:"mt-4 space-y-3 text-sm text-c4a-text-secondary",children:[n.type==="resource"&&f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.resource",{name:n.name})}),f.jsx("p",{children:i("sources.delete.resource_impact")}),f.jsx("p",{className:"text-c4a-warning",children:i("sources.delete.session_warning")}),f.jsx("p",{children:i("sources.delete.entity_safe")})]}),n.type==="folder"&&f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.folder",{name:n.name})}),n.folderCount!==void 0&&n.sourceCount!==void 0?f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.folder_contents",{folders:n.folderCount,sources:n.sourceCount})}),n.indexedCount!==void 0&&n.indexedCount>0&&f.jsx("p",{children:i("sources.delete.indexed_hint",{indexed:n.indexedCount,total:n.sourceCount})})]}):f.jsx("p",{children:i("sources.delete.folder_impact_generic")}),f.jsx("p",{className:"text-c4a-warning",children:i("sources.delete.irreversible")})]}),n.type==="repo"&&f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.repo",{name:n.name,library:n.libraryName})}),n.packageCount!==void 0&&n.docCount!==void 0?f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.repo_contents",{packages:n.packageCount,docs:n.docCount})}),n.indexedCount!==void 0&&n.indexedCount>0&&f.jsx("p",{children:i("sources.delete.indexed_hint",{indexed:n.indexedCount,total:n.packageCount+n.docCount})})]}):f.jsx("p",{children:i("sources.delete.repo_impact_generic")}),f.jsx("p",{children:i("sources.delete.local_safe")}),f.jsx("p",{children:i("sources.delete.entity_safe")})]}),n.type==="client"&&f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.client",{name:n.name})}),f.jsx("p",{children:i("sources.delete.client_impact")}),f.jsx("p",{children:i("sources.delete.local_safe")}),f.jsx("p",{children:i("sources.delete.entity_safe")}),f.jsx("p",{className:"text-c4a-warning",children:i("sources.delete.irreversible")}),f.jsx("p",{className:"text-c4a-text-muted",children:i("sources.delete.client_reregister")})]})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[f.jsx("button",{onClick:s,className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:i("common.cancel")}),f.jsx("button",{onClick:l,className:"rounded bg-c4a-error px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-error/80",children:i("common.confirm")})]})]})}function p_({onConfirm:n,onCancel:l,error:s}){const{t:i}=Te(),[o,u]=b.useState(""),m=b.useRef(null);b.useEffect(()=>{m.current?.focus()},[]);const p=b.useCallback(()=>{const h=o.trim();h&&n(h)},[o,n]),g=b.useCallback(h=>{h.key==="Enter"&&(h.preventDefault(),p())},[p]);return f.jsxs(Bl,{onClose:l,className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Bx,{size:16,className:"shrink-0 text-c4a-accent"}),f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:i("sources.actions.new_folder")})]}),f.jsxs("div",{className:"mt-4",children:[f.jsx("input",{ref:m,value:o,onChange:h=>u(h.target.value),onKeyDown:g,placeholder:i("sources.folder.name_placeholder"),className:"w-full rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-2 text-sm text-c4a-text-primary outline-none transition-colors focus:border-c4a-accent",autoFocus:!0}),s&&f.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:s})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[f.jsx("button",{onClick:l,className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:i("common.cancel")}),f.jsx("button",{onClick:p,disabled:!o.trim(),className:"rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:i("common.confirm")})]})]})}function ed({label:n,icon:l,items:s,alignRight:i}){const[o,u]=b.useState(!1),m=b.useRef(null),p=b.useRef(null),g=b.useCallback(y=>{m.current&&!m.current.contains(y.target)&&u(!1)},[]);b.useEffect(()=>{if(o)return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[o,g]);const h=b.useCallback(()=>{p.current&&(clearTimeout(p.current),p.current=null),u(!0)},[]),v=b.useCallback(()=>{p.current=setTimeout(()=>u(!1),150)},[]);return f.jsxs("div",{ref:m,className:"relative",onMouseEnter:h,onMouseLeave:v,children:[f.jsxs("button",{className:`flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary ${n?"p-1 sm:px-2 sm:py-1":"p-1"}`,children:[l,n&&f.jsx("span",{className:"hidden sm:inline",children:n}),n&&f.jsx(da,{size:12,className:`hidden transition-transform duration-200 sm:block ${o?"rotate-90":""}`})]}),o&&f.jsx("div",{className:`absolute top-full z-20 mt-1 min-w-[160px] rounded border border-c4a-border-default bg-c4a-bg-elevated py-1 shadow-c4a-lg ${i?"right-0":"left-0"}`,children:s.map(y=>f.jsxs("button",{onClick:()=>{y.onClick(),u(!1)},className:"flex w-full items-center gap-2 px-3 py-1.5 text-left font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:[y.icon,y.label]},y.label))})]})}function g_({onClose:n}){const{t:l}=Te();return f.jsxs(Bl,{onClose:n,closeOnEsc:!1,className:"w-full max-w-sm rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(b2,{size:18,className:"text-c4a-accent"}),f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:l("sources.upgrade.title")})]}),f.jsx("p",{className:"mt-3 text-sm text-c4a-text-secondary",children:l("sources.upgrade.description")}),f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsx("button",{onClick:n,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:l("common.confirm")})})]})}function x_(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function y_({onConfirm:n,onCancel:l,error:s,uploading:i}){const{t:o}=Te(),[u,m]=b.useState([]),[p,g]=b.useState(null),[h,v]=b.useState(!1),y=b.useRef(null),_=b.useCallback(V=>{g(null);for(const X of V){const W=vd(X.name);if(!o_.has(W)){g(o("sources.upload.unsupported_type",{name:X.name}));return}if(X.size>u_){g(o("sources.upload.file_too_large",{name:X.name}));return}}m(X=>{const W=new Map(X.map(E=>[E.name,E]));for(const E of V)W.set(E.name,{name:E.name,size:E.size,file:E});const F=Array.from(W.values());return F.length>d_?(g(o("sources.upload.too_many_files")),X):F})},[o]),j=b.useCallback(V=>{const X=V.target.files;!X||X.length===0||(_(Array.from(X)),V.target.value="")},[_]),N=b.useCallback(V=>{m(X=>X.filter((W,F)=>F!==V)),g(null)},[]),T=b.useCallback(V=>{V.preventDefault(),v(!1);const X=V.dataTransfer?.files;!X||X.length===0||_(Array.from(X))},[_]),O=b.useCallback(V=>{V.preventDefault(),v(!0)},[]),G=b.useCallback(V=>{V.preventDefault(),v(!1)},[]),Z=b.useCallback(async()=>{if(u.length===0)return;const V=await Promise.all(u.map(X=>new Promise((W,F)=>{const E=vd(X.name),q=c_.has(E),ee=new FileReader;ee.onerror=()=>F(ee.error),q?(ee.onload=()=>W({name:X.name,content:ee.result,encoding:"utf-8"}),ee.readAsText(X.file)):(ee.onload=()=>{const de=ee.result,oe=de.slice(de.indexOf(",")+1);W({name:X.name,content:oe,encoding:"base64"})},ee.readAsDataURL(X.file))})));n(V)},[u,n]),$=s||p;return f.jsxs(Bl,{onClose:l,disableClose:i??!1,className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(yd,{size:16,className:"shrink-0 text-c4a-accent"}),f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:o("sources.upload.title")})]}),f.jsxs("div",{className:"mt-4",children:[f.jsx("input",{ref:y,type:"file",accept:".md,.doc,.docx,.pdf,.ppt,.pptx,.txt",multiple:!0,onChange:j,className:"hidden"}),f.jsxs("button",{type:"button",onClick:()=>y.current?.click(),onDrop:T,onDragOver:O,onDragLeave:G,disabled:i,className:`flex w-full flex-col items-center justify-center rounded border-2 border-dashed px-4 py-8 transition-colors ${h?"border-c4a-accent bg-c4a-accent/5":"border-c4a-border-default hover:border-c4a-accent/50"} ${i?"cursor-not-allowed opacity-40":"cursor-pointer"}`,children:[f.jsx(yd,{size:24,className:"text-c4a-text-muted"}),f.jsx("p",{className:"mt-2 text-sm text-c4a-text-secondary",children:o("sources.upload.drop_hint")}),f.jsx("p",{className:"mt-1 text-[10px] text-c4a-text-muted",children:o("sources.upload.supported_formats")})]})]}),u.length>0&&f.jsxs("div",{className:"mt-3",children:[f.jsx("p",{className:"text-xs text-c4a-text-muted",children:o("sources.upload.selected",{count:u.length})}),f.jsx("div",{className:"mt-1 max-h-40 space-y-1 overflow-y-auto c4a-scrollbar",children:u.map((V,X)=>f.jsxs("div",{className:"flex items-center gap-2 rounded bg-c4a-bg-surface px-2 py-1",children:[f.jsx(cl,{size:12,className:"shrink-0 text-c4a-text-muted"}),f.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-c4a-text-primary",children:V.name}),f.jsx("span",{className:"shrink-0 text-[10px] text-c4a-text-muted",children:x_(V.size)}),!i&&f.jsx("button",{type:"button",onClick:()=>N(X),className:"shrink-0 text-c4a-text-muted transition-colors hover:text-c4a-text-primary",title:o("sources.upload.remove"),children:f.jsx(Ul,{size:12})})]},`${V.name}-${X}`))})]}),$&&f.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:$}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[f.jsx("button",{onClick:l,disabled:i,className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:opacity-40",children:o("common.cancel")}),f.jsxs("button",{onClick:Z,disabled:u.length===0||i,className:"flex items-center gap-1.5 rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:[i&&f.jsx(Da,{size:12,className:"animate-spin"}),o(i?"sources.upload.uploading":"common.confirm")]})]})]})}function b_({pathLabel:n,loading:l,badge:s,onNavigateUp:i,children:o}){return f.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1",children:[f.jsx("p",{className:"min-w-0 shrink truncate font-mono text-xs text-c4a-text-muted",children:n}),s]}),f.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),f.jsx("div",{className:"c4a-scrollbar flex min-h-0 flex-1 flex-col overflow-y-auto",children:l?f.jsx("div",{className:"flex flex-1 items-center justify-center py-8",children:f.jsx(Da,{size:14,className:"animate-spin text-c4a-text-muted"})}):f.jsxs(f.Fragment,{children:[i&&f.jsxs("button",{onClick:i,className:"flex w-full cursor-pointer items-center gap-3 rounded pl-3 pr-5 py-2 text-left text-sm text-c4a-text-primary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(Xa,{size:16,className:"shrink-0 text-c4a-text-muted"}),f.jsx("span",{children:".."})]}),o]})})]})}function v_(n){const l=n.match(/^[\w.-]+@([\w.-]+):([\w./-]+?)(?:\.git)?$/);if(l){const s=l[1],i=l[2];return{slug:i,repoUrl:`https://${s}/${i}`,host:s}}try{const s=new URL(n),i=s.hostname,o=s.pathname.replace(/^\//,"").replace(/\.git$/,"");return o?{slug:o,repoUrl:`https://${i}/${o}`,host:i}:null}catch{return null}}function S_(n,l){return`${n}/tree/${encodeURIComponent(l)}`}function __(n,l){return`${n}/commit/${l}`}function Zx({remoteUrl:n,fallbackName:l,branch:s,commit:i}){const o=n?v_(n):null,u=i.slice(0,7);return f.jsxs("div",{className:"flex min-w-0 shrink flex-wrap items-center gap-1.5 font-mono text-xs leading-none text-c4a-accent",children:[o?f.jsxs("a",{href:o.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 truncate hover:underline",title:o.repoUrl,children:[f.jsx(Rg,{size:12,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:o.slug})]}):f.jsxs("span",{className:"flex items-center gap-1 truncate",children:[f.jsx(Rg,{size:12,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:l||"repo"})]}),f.jsx("span",{className:"text-c4a-text-muted",children:"/"}),o?f.jsxs("a",{href:S_(o.repoUrl,s),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 hover:underline",children:[f.jsx(pd,{size:10,className:"shrink-0"}),f.jsx("span",{children:s})]}):f.jsxs("span",{className:"flex items-center gap-1",children:[f.jsx(pd,{size:10,className:"shrink-0"}),f.jsx("span",{children:s})]}),f.jsx("span",{className:"text-c4a-text-muted",children:"/"}),o?f.jsx("a",{href:__(o.repoUrl,i),target:"_blank",rel:"noopener noreferrer",className:"hover:underline",children:u}):f.jsx("span",{children:u})]})}function j_(n,l,s){const[i,o]=b.useState({}),u=b.useRef(new Set);return b.useEffect(()=>{if(!n||!l||s.length===0)return;const m=s.filter(p=>{const g=p.metadata;return g?.origin==="remote"&&g?.remote_url&&g?.remote_commit&&!u.current.has(p.id)});if(m.length!==0){m.forEach(p=>u.current.add(p.id));for(const p of m){const g=p.metadata;_t.post("/import/remote/refs",{library_id:n,url:g.remote_url}).then(h=>{const v=g.remote_ref||"",y=h.branches?.find(_=>_.name===v)??h.tags?.find(_=>_.name===v);y&&y.commit!==g.remote_commit&&o(_=>({..._,[p.id]:!0}))}).catch(()=>{})}}},[n,l,s]),i}function N_({library:n,onNewFolder:l,onImportRepo:s,onImportDir:i,onUpgrade:o}){const{t:u}=Te(),m=n.type==="daemon";return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsxs("div",{className:"max-w-2xl text-center",children:[f.jsx("h3",{className:"font-mono text-lg font-bold uppercase text-c4a-text-primary",children:u(m?"sources.empty.daemon.title":"sources.empty.cloud.title")}),f.jsx("p",{className:"mt-3 text-sm text-c4a-text-secondary",children:u(m?"sources.empty.daemon.description":"sources.empty.cloud.description")}),f.jsx("div",{className:"mt-6 flex justify-center gap-3",children:m?f.jsxs(f.Fragment,{children:[i&&f.jsx("button",{onClick:i,disabled:!n.is_online,className:"rounded border border-c4a-border-default bg-c4a-bg-surface px-4 py-2 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:opacity-40",children:u("sources.actions.import_dir")}),s&&f.jsx("button",{onClick:s,disabled:!n.is_online,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:u("sources.actions.import_repo")})]}):f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:l,className:"rounded border border-c4a-border-default bg-c4a-bg-surface px-4 py-2 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:u("sources.actions.new_folder")}),o&&f.jsx("button",{onClick:o,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent-hover",children:u("sources.actions.import_repo_url")})]})})]})})}function w_(){const{t:n}=Te();return f.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6 text-center",children:[f.jsx("h4",{className:"font-mono text-sm font-bold text-c4a-text-primary",children:n("sources.empty.indexed.title")}),f.jsx("p",{className:"mt-2 text-xs text-c4a-text-secondary",children:n("sources.empty.indexed.description")})]})}const td=n=>{let l=0,s=0,i=0,o=0,u=0;const m=p=>{for(const g of p.children??[])g.kind==="folder"?(l++,m(g)):g.kind==="source"&&(s++,g.source_type==="code"?i++:o++,(g.index_status==="indexed"||g.index_status==="stale")&&u++)};return m(n),{folders:l,sources:s,codeSources:i,docSources:o,indexedSources:u}};function E_(){const{t:n}=Te(),l=kn(),{libId:s}=Vs(),[i,o]=wo(),u=i.get("rootId")||null,m=i.get("path")||"",g=It(Hl(kr)).find(K=>K.id===s),h=It(K=>K.updateLibraryName),v=It(K=>K.deleteLibrary),{rootSources:y,currentRoot:_,loading:j,filter:N,fetchRootSources:T,fetchRootSource:O,createSource:G,addTreeNode:Z,updateSource:$,deleteSource:V,deleteTreeNode:X,uploadDoc:W,setFilter:F}=To(),[E,q]=b.useState(!1),[ee,de]=b.useState(null),[oe,re]=b.useState(null),[ue,ge]=b.useState(null),[k,P]=b.useState(null),[fe,me]=b.useState(!1),[le,w]=b.useState(!1),[B,te]=b.useState(null),[ae,xe]=b.useState(!1),[ve,ze]=b.useState(!1),[Pe,Xe]=b.useState(null),[Wt,ma]=b.useState(!1);b.useEffect(()=>{s&&T({library_id:s})},[s,T]),b.useEffect(()=>{u&&O(u)},[u,O]);const Qe=u!==null,tt=b.useMemo(()=>Qe?_?[...n_(_.tree,m)].sort((De,$e)=>De.kind!==$e.kind?De.kind==="folder"?-1:1:De.name.localeCompare($e.name)).map(De=>({type:"node",root:_,node:De})):[]:[...y].sort(($e,Ue)=>$e.kind!==Ue.kind?$e.kind==="folder"?-1:1:new Date(Ue.created_at).getTime()-new Date($e.created_at).getTime()).map($e=>({type:"root",root:$e,node:null})),[Qe,y,_,m]),dt=b.useMemo(()=>N==="all"?tt:tt.filter(K=>K.type==="root"||!K.node||K.node.kind==="folder"?!0:N==="indexed"?K.node.index_status==="indexed":K.node.index_status==="none"||!K.node.index_status),[tt,N]),$t=g?.type==="daemon",Gt=g?.type==="cloud",ea=$t&&!Qe,ta=j_(s,Gt,y),Sa=b.useMemo(()=>{if(!g)return[];const K=[{label:g.id===ul?n("sources.library.default_cloud_name"):g.name,to:`/studio/sources/${g.id}`}];return Qe&&_&&(K.push({label:_.name,to:`/studio/sources/${g.id}?rootId=${_.id}`}),m&&Os(_.tree,m).forEach(De=>{K.push({label:De.name,to:`/studio/sources/${g.id}?rootId=${_.id}&path=${encodeURIComponent(De.path)}`})})),K},[g,Qe,_,m,n]),_a=b.useCallback(async K=>{if(s)try{Qe&&u?await Z(u,{parent_path:m,kind:"folder",name:K}):(await G({library_id:s,kind:"folder",name:K}),T({library_id:s})),q(!1),de(null)}catch(se){se instanceof Dl&&se.status===409&&de(n("sources.error.name_conflict",{name:K}))}},[s,Qe,u,m,G,Z,T,n]),ka=b.useCallback(K=>{s&&(K.type==="root"?K.root.kind==="source"?l(`/studio/source/${K.root.id}`):o({rootId:K.root.id}):K.node&&(K.node.kind==="folder"?o({rootId:K.root.id,path:K.node.path}):l(`/studio/source/${K.root.id}?path=${encodeURIComponent(K.node.path)}`)))},[s,l,o]),ra=b.useCallback(()=>{if(!(!u||!s))if(m){const K=m.split("/");K.pop();const se=K.join("/");o(se?{rootId:u,path:se}:{rootId:u})}else o({})},[u,s,m,o]),sa=b.useCallback(async(K,se)=>{try{return await $(K,{name:se}),T({library_id:s}),null}catch(De){return De instanceof Dl&&De.status===409?n("sources.error.name_conflict",{name:se}):null}},[s,$,T,n]),ht=b.useCallback(K=>{if(K.type==="root"){ge(K.root.id),P(null);const se=K.root.tree.length>0?td({children:K.root.tree}):void 0;re($t?{type:"repo",name:K.root.name,libraryName:g.name,...se?{packageCount:se.codeSources,docCount:se.docSources,indexedCount:se.indexedSources}:{}}:{type:K.root.kind==="folder"?"folder":"resource",name:K.root.name,...K.root.kind==="folder"&&se?{folderCount:se.folders,sourceCount:se.sources,indexedCount:se.indexedSources}:{}})}else if(K.node)if(ge(K.root.id),P(K.node.path),K.node.kind==="folder"){const se=td(K.node);re({type:"folder",name:K.node.name,folderCount:se.folders,sourceCount:se.sources,indexedCount:se.indexedSources})}else re({type:"resource",name:K.node.name})},[$t,g]),ia=b.useCallback(async()=>{if(!(!ue||!s)){try{k?await X(ue,k):(await V(ue),T({library_id:s}))}catch{}re(null),ge(null),P(null)}},[ue,k,s,V,X,T]),Se=b.useCallback(()=>{if(!s)return;const K=new URLSearchParams;u&&(K.set("parentId",u),_&&K.set("parentName",_.name)),m&&K.set("parentPath",m);const se=K.toString();l(`/studio/sources/import/${s}${se?`?${se}`:""}`)},[s,l,u,m,_]),ke=b.useCallback(()=>{s&&l(`/studio/sources/import-dir/${s}`)},[s,l]),Ze=b.useCallback(async K=>{if(s){xe(!0),te(null);try{const se={library_id:s,files:K.map(De=>{const $e={file_name:De.name,content:De.content};return De.encoding&&($e.encoding=De.encoding),$e})};Qe&&u&&(se.root_source_id=u,se.parent_path=m),await W(se),Qe&&u?O(u):T({library_id:s}),w(!1)}catch(se){se instanceof Dl&&se.status===409?te(n("sources.error.name_conflict",{name:K[0]?.name??""})):se instanceof Dl&&te(se.message)}finally{xe(!1)}}},[s,Qe,u,m,W,T,O,n]),pt=g?.id===ul,Nt=b.useCallback(async K=>{if(s)try{await h(s,K),ze(!1),Xe(null)}catch(se){const De=se instanceof Error?se.message:String(se);Xe(De)}},[s,h]),Xt=b.useCallback(()=>{ze(!1),Xe(null)},[]),Ja=b.useCallback(async()=>{if(s){try{await v(s),l("/studio/sources/add-client")}catch{}ma(!1)}},[s,v,l]),Qt=b.useCallback(()=>{ma(!1)},[]);if(!g)return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})});const Tt=y.length===0&&N==="all"&&!j&&!Qe,gt=dt.filter(K=>K.type==="node"&&K.node?.kind==="source").length===0&&N==="indexed"&&!j,Mt=!Qe||!_?!1:_.metadata?.origin==="remote"?!0:m?Os(_.tree,m).some(se=>se.metadata?.origin==="remote"):!1,Ce=!ea,Ae=Gt&&!Mt,Ie=ea;return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx("div",{className:"min-w-0 flex-1",children:ve?f.jsx(Qx,{currentName:g.name,onConfirm:Nt,onCancel:Xt,error:Pe}):f.jsx(Ar,{segments:Sa})}),f.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[Ae&&f.jsxs(f.Fragment,{children:[f.jsx(ed,{label:n("sources.actions.upload"),icon:f.jsx(yd,{size:14}),items:[{label:n("sources.actions.upload_doc"),icon:f.jsx(cl,{size:14}),onClick:()=>w(!0)}]}),f.jsx(ed,{label:n("sources.actions.add"),icon:f.jsx($x,{size:14}),items:[{label:n("sources.actions.add_folder"),icon:f.jsx(Bx,{size:14}),onClick:()=>q(!0)},{label:n("sources.actions.add_web"),icon:f.jsx(VS,{size:14}),onClick:()=>me(!0)},{label:n("sources.actions.add_feishu"),icon:f.jsx(CS,{size:14}),onClick:()=>me(!0)}]}),f.jsxs("button",{onClick:()=>{const K=new URLSearchParams;u&&(K.set("parentId",u),_&&K.set("parentName",_.name)),m&&K.set("parentPath",m);const se=K.toString();l(`/studio/sources/import-remote/${s}${se?`?${se}`:""}`)},className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary sm:px-2 sm:py-1",children:[f.jsx(Cg,{size:14}),f.jsx("span",{className:"hidden sm:inline",children:n("sources.actions.import_repo_url")})]})]}),Ie&&f.jsxs(f.Fragment,{children:[f.jsxs("button",{onClick:ke,disabled:!g.is_online,title:g.is_online?void 0:n("sources.import.daemon_offline",{name:g.name}),className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:cursor-not-allowed disabled:opacity-40 sm:px-2 sm:py-1",children:[f.jsx(kS,{size:14}),f.jsx("span",{className:"hidden sm:inline",children:n("sources.actions.import_dir")})]}),f.jsxs("button",{onClick:Se,disabled:!g.is_online,title:g.is_online?void 0:n("sources.import.daemon_offline",{name:g.name}),className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:cursor-not-allowed disabled:opacity-40 sm:px-2 sm:py-1",children:[f.jsx(Cg,{size:14}),f.jsx("span",{className:"hidden sm:inline",children:n("sources.actions.import_repo")})]}),f.jsx(ed,{label:"",icon:f.jsx(gd,{size:14}),alignRight:!0,items:[{label:n("sources.library.rename"),icon:f.jsx(gd,{size:14}),onClick:()=>ze(!0)},...pt?[]:[{label:n("sources.actions.delete"),icon:f.jsx(qx,{size:14}),onClick:()=>ma(!0)}]]})]}),Ce&&f.jsx(r_,{value:N,onChange:F})]})]}),Tt?f.jsx(N_,{library:g,onNewFolder:()=>q(!0),...$t?{onImportRepo:Se,onImportDir:ke}:{},...Gt?{onUpgrade:()=>{const K=new URLSearchParams;u&&(K.set("parentId",u),_&&K.set("parentName",_.name)),m&&K.set("parentPath",m);const se=K.toString();l(`/studio/sources/import-remote/${s}${se?`?${se}`:""}`)}}:{}}):f.jsx(b_,{pathLabel:(()=>{if(!Qe||!_)return"/";const K=_.metadata,se=$t?typeof K?.local_path=="string"?K.local_path:_.name:"/"+_.name;if(!m)return se;const De=Os(_.tree,m);return se+"/"+De.map($e=>$e.name).join("/")})(),loading:j,badge:(()=>{if(!Qe||!_)return;let K=_.metadata,se=_.name;if(!K?.origin&&m){const Ue=Os(_.tree,m);for(const kt of Ue){const oa=kt.metadata;if(oa?.origin==="remote"){K=oa,se=kt.name;break}}}const De=K?.pinned_branch??K?.remote_ref,$e=K?.pinned_hash??K?.remote_commit;if(!(!De||!$e))return f.jsx(Zx,{remoteUrl:K?.remote_url,fallbackName:se,branch:De,commit:$e})})(),onNavigateUp:Qe?ra:void 0,children:dt.length===0?gt?f.jsx(w_,{}):Qe?null:f.jsx("p",{className:"py-8 text-center text-xs text-c4a-text-muted",children:n("common.items",{count:0})}):f.jsx("div",{className:"flex flex-col gap-0.5",children:dt.map(K=>{if(K.type==="root"){const Ue=K.root,kt=$t,oa=kt?Ue.metadata?.local_path:void 0,ca=Ue.tree.length>0?td({children:Ue.tree}):void 0,Aa=ca?ca.folders+ca.sources:0,ja=Ue.metadata,dl=ja?.origin==="remote",$l=ja?.import_type==="directory",ql=dl||kt&&!$l;return f.jsx(Hg,{source:{id:Ue.id,library_id:Ue.library_id,owner_id:Ue.owner_id,path:"",kind:Ue.kind,source_type:Ue.source_type,name:Ue.name,content_hash:Ue.content_hash,metadata:Ue.metadata,index_status:Ue.index_status,created_at:Ue.created_at,updated_at:Ue.updated_at},...typeof oa=="string"?{displayName:oa}:{},...Ue.kind==="folder"?{childCount:Aa}:{},isDaemonLibrary:$t??!1,isRepoRoot:ql,...ta[Ue.id]?{hasUpdate:!0}:{},onClick:()=>ka(K),...dl?{}:{onRename:C=>sa(Ue.id,C)},onDelete:()=>ht(K)},Ue.id)}const se=K.node,De=`${K.root.id}:${se.path}`,$e=se.kind==="folder"?se.children?.length??0:void 0;return f.jsx(Hg,{source:{id:K.root.id,library_id:K.root.library_id,owner_id:K.root.owner_id,path:se.path,kind:se.kind,source_type:se.source_type??null,name:se.name,content_hash:null,metadata:se.metadata??null,index_status:se.index_status??"none",created_at:K.root.created_at,updated_at:K.root.updated_at},...$e!==void 0?{childCount:$e}:{},isDaemonLibrary:$t??!1,onClick:()=>ka(K),...Gt&&K.root.metadata?.origin!=="remote"?{onDelete:()=>ht(K)}:{}},De)})})}),E&&f.jsx(p_,{onConfirm:_a,onCancel:()=>{q(!1),de(null)},error:ee}),le&&f.jsx(y_,{onConfirm:Ze,onCancel:()=>{w(!1),te(null)},error:B,uploading:ae}),fe&&f.jsx(g_,{onClose:()=>me(!1)}),oe&&f.jsx(Bg,{target:oe,onConfirm:ia,onCancel:()=>{re(null),ge(null),P(null)}}),Wt&&g&&f.jsx(Bg,{target:{type:"client",name:g.name},onConfirm:Ja,onCancel:Qt})]})}function fn({active:n,current:l}){return f.jsx("span",{className:`inline-block h-2.5 w-2.5 rounded-full border-2 ${l?"border-c4a-accent bg-c4a-accent":n?"border-c4a-accent bg-transparent":"border-c4a-border-default bg-transparent"}`})}function Ml(){return f.jsx("span",{className:"h-px flex-1 bg-c4a-border-default"})}function Fx({libraryName:n}){const{t:l}=Te();return f.jsxs("div",{className:"rounded border border-c4a-warning/30 bg-c4a-bg-surface p-6 text-center",children:[f.jsx("p",{className:"text-sm text-c4a-warning",children:l("sources.import.daemon_offline",{name:n})}),f.jsx(va,{to:"/studio/sources/add-client",className:"mt-4 inline-block rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:l("sources.import.view_guide")})]})}function Dd({step:n,totalSteps:l,importing:s,stepBusy:i,canProceed:o,safetyNoticeKey:u,confirmLabelKey:m,onPrev:p,onNext:g,onImport:h}){const{t:v}=Te();return f.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-4 sm:mt-6",children:[f.jsx("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-c4a-text-muted line-clamp-1 sm:line-clamp-none",title:v(u),onClick:y=>y.currentTarget.classList.toggle("line-clamp-1"),children:v(u)}),f.jsxs("div",{className:"flex shrink-0 gap-2",children:[n>1&&f.jsx("button",{onClick:p,disabled:s||i,className:"rounded border border-c4a-border-default px-4 py-2 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover disabled:opacity-40",children:v("common.previous")}),n<l?f.jsx("button",{onClick:g,disabled:!o||i,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:v("common.next")}):f.jsxs("button",{onClick:h,disabled:s||i||!o,className:"flex items-center gap-1.5 rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:[s&&f.jsx(Da,{size:12,className:"animate-spin"}),v(s?"sources.import.importing":m)]})]})]})}function Jx(n,l){const s=b.useCallback(async(m,p)=>{if(!n)throw new Error("No library");const g=await _t.post(`/libraries/${n}/rpc`,{method:m,params:p});if(g.error){const h=g.error;throw new Error(h.message??JSON.stringify(g.error))}return g.result??g},[n]),[i,o]=b.useState([]);b.useEffect(()=>{if(!n)return;let m=!1;return(async()=>{try{const p=await _t.get("/sources",{library_id:n,limit:"500"});if(m)return;const g=p.items.map(h=>{const v=h.metadata;return typeof v?.local_path=="string"?v.local_path:null}).filter(h=>h!==null);o(g)}catch{}})(),()=>{m=!0}},[n]);const u=b.useMemo(()=>{const m=l?.config;return!m||!Array.isArray(m.allowed_paths)?[]:m.allowed_paths},[l]);return{rpc:s,importedPaths:i,allowedPaths:u}}function C_(n,l){const s=n.toLowerCase();try{if(s.endsWith("package.json")){const i=JSON.parse(l);if(typeof i.name=="string"&&i.name.trim())return i.name.trim()}if(s.endsWith("pyproject.toml"))return l.match(/^\s*name\s*=\s*["']([^"']+)["']/m)?.[1]??null;if(s.endsWith("go.mod"))return l.match(/^\s*module\s+([^\s]+)\s*$/m)?.[1]??null;if(s.endsWith("cargo.toml"))return l.match(/^\s*name\s*=\s*["']([^"']+)["']/m)?.[1]??null;if(s.endsWith("pom.xml"))return l.match(/<artifactId>([^<]+)<\/artifactId>/)?.[1]?.trim()??null;if(s.endsWith("build.gradle"))return l.match(/rootProject\.name\s*=\s*["']([^"']+)["']/)?.[1]??null}catch{return null}return null}function Px(n,l,s="repo"){const i=[];for(const u of n){const m=u.path.split("/"),p=m.slice(0,-1).join("/")||".",g=m.length===1||u.path==="package.json",h=p==="."?s:m[m.length-2]||p,v=C_(u.path,u.content);i.push({name:v||h,path:p,isRoot:g})}const o=l.filter(u=>/\.md$/i.test(u.path)).map(u=>u.path);return{packages:i,mdFiles:o}}const $g=new Set(["tree","blob","commit","commits","raw","src"]),R_=new Set(["commit","commits"]);function T_(n){let l;try{l=new URL(n.trim())}catch{return{repoUrl:n.trim()}}const s=l.pathname.split("/").filter(Boolean);let i=-1;for(let h=2;h<s.length;h++){const v=s[h];if(v==="-"&&h+1<s.length&&$g.has(s[h+1])){i=h;break}if($g.has(v)){i=h;break}}if(i===-1)return{repoUrl:`${l.protocol}//${l.host}${l.pathname}`.replace(/\/+$/,"")};const o=s.slice(0,i).join("/"),u=`${l.protocol}//${l.host}/${o}`;let m,p;if(s[i]==="-"?(m=s[i+1],p=i+2):(m=s[i],p=i+1),p>=s.length)return{repoUrl:u};const g=s[p];return R_.has(m)?{repoUrl:u,commit:g}:{repoUrl:u,ref:g}}function il(n){try{return(new URL(n).pathname.split("/").pop()??"repo").replace(/\.git$/i,"")||"repo"}catch{return n.split("/").pop()||n}}function Sd(){const n=new Date;return`${String(n.getHours()).padStart(2,"0")}:${String(n.getMinutes()).padStart(2,"0")}:${String(n.getSeconds()).padStart(2,"0")}`}const z_=1500;async function Ix(n){const l=z_-(Date.now()-n);l>0&&await new Promise(s=>setTimeout(s,l))}function Wx(){const{t:n}=Te(),[l,s]=b.useState(!1),[i,o]=b.useState(null),u=b.useRef(),m=b.useRef(),p=window.location.host,g=`c4a-daemon --server ${p} --allow <dir1> <dir2>`,h=`c4a-daemon --server ${p}`,v=b.useCallback((j,N)=>{navigator.clipboard.writeText(j),o(N),clearTimeout(u.current),u.current=setTimeout(()=>o(null),1500)},[]),y=b.useCallback(()=>{clearTimeout(m.current),s(!0)},[]),_=b.useCallback(()=>{m.current=setTimeout(()=>s(!1),150)},[]);return f.jsxs("span",{className:"relative",onMouseEnter:y,onMouseLeave:_,children:[f.jsx(Ux,{size:12,className:"text-c4a-warning"}),l&&f.jsxs("span",{className:"absolute left-full top-1/2 z-10 ml-2 -translate-y-1/2 rounded border border-c4a-border-default bg-c4a-bg-elevated px-2.5 py-2 shadow-lg",onMouseEnter:y,onMouseLeave:_,children:[f.jsx("span",{className:"block whitespace-nowrap font-mono text-xs text-c4a-text-secondary",children:n("sources.import.allowed_dirs_tooltip_restrict")}),f.jsxs("span",{className:"mt-1 flex items-center gap-1.5 whitespace-nowrap",children:[f.jsx("span",{className:"font-mono text-xs text-c4a-accent",children:g}),f.jsx("button",{onClick:()=>v(g,0),className:"shrink-0 rounded p-0.5 text-c4a-accent transition-colors hover:bg-c4a-bg-hover",title:"Copy",children:i===0?f.jsx(Al,{size:10}):f.jsx(hd,{size:10})})]}),f.jsx("span",{className:"mt-2 block whitespace-nowrap font-mono text-xs text-c4a-text-secondary",children:n("sources.import.allowed_dirs_tooltip_all")}),f.jsxs("span",{className:"mt-1 flex items-center gap-1.5 whitespace-nowrap",children:[f.jsx("span",{className:"font-mono text-xs text-c4a-accent",children:h}),f.jsx("button",{onClick:()=>v(h,1),className:"shrink-0 rounded p-0.5 text-c4a-accent transition-colors hover:bg-c4a-bg-hover",title:"Copy",children:i===1?f.jsx(Al,{size:10}):f.jsx(hd,{size:10})})]})]})]})}function ey({open:n,onClose:l,rpc:s,onNavigate:i,defaultPath:o}){const{t:u}=Te(),[m,p]=b.useState(o??""),[g,h]=b.useState(null),[v,y]=b.useState(!1),_=b.useRef(null);b.useEffect(()=>{o&&!m&&p(o)},[o]);const j=b.useCallback(async()=>{const T=m.trim();if(T){y(!0),h(null);try{(await s("fs/exists",{path:T})).exists?(i(T),p(o??""),h(null),l()):h(u("sources.import.wildcard_path_not_found"))}catch(O){h(O instanceof Error?O.message:String(O))}finally{y(!1)}}},[m,s,u,i,l]),N=b.useCallback(()=>{p(o??""),h(null),l()},[l,o]);return n?f.jsxs(Bl,{onClose:N,closeOnOverlay:!1,closeOnEsc:!1,overlayClass:"bg-black/40",className:"w-full max-w-md rounded-lg border border-c4a-border-default bg-c4a-bg-surface p-5 shadow-xl",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("h3",{className:"font-mono text-sm font-medium text-c4a-text-primary",children:u("sources.import.wildcard_go_title")}),f.jsx("button",{onClick:N,className:"rounded p-1 text-c4a-text-muted transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-secondary",children:f.jsx(Ul,{size:14})})]}),f.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[f.jsx("input",{ref:_,type:"text",value:m,onChange:T=>{p(T.target.value),h(null)},onKeyDown:T=>{T.key==="Enter"&&j()},placeholder:u("sources.import.wildcard_path_placeholder"),autoFocus:!0,className:"flex-1 rounded border border-c4a-border-default bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-text-primary outline-none transition-colors focus:border-c4a-accent"}),f.jsxs("button",{onClick:j,disabled:v||!m.trim(),className:"flex shrink-0 items-center gap-1.5 rounded bg-c4a-accent px-3 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:[v?f.jsx(Da,{size:12,className:"animate-spin"}):f.jsx(Lx,{size:12}),u("sources.import.wildcard_go")]})]}),g&&f.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:g})]}):null}function ty({rpc:n,allowedPaths:l,importedPaths:s,onNavigateUpExtra:i}){const o=!!l&&l.length>0,u=o&&l.length===1&&l[0]==="*",[m,p]=b.useState(o),[g,h]=b.useState(o&&!u?"":"/"),[v,y]=b.useState([]),[_,j]=b.useState(!1),[N,T]=b.useState(null),[O,G]=b.useState(null);b.useEffect(()=>{if(o&&!u)return;let q=!1;return(async()=>{try{const ee=await n("fs/homeDir",{});q||G(ee.home_dir)}catch{q||G("/")}})(),()=>{q=!0}},[o,u,n]);const[Z,$]=b.useState(!1),V=b.useCallback(async q=>{j(!0),T(null);try{const ee=await n("fs/listTree",{path:q,depth:1});y(ee.entries||[]),h(q),p(!1)}catch(ee){const de=ee instanceof Error?ee.message:String(ee);T(de)}finally{j(!1)}},[n]);b.useEffect(()=>{o&&!u||O!==null&&V(O)},[O,o,u,V]);const X=b.useMemo(()=>new Set(s??[]),[s]),W=b.useCallback(()=>{if(o&&!u&&l.some(de=>de===g)){p(!0),h(""),y([]),T(null),i?.();return}const q=g.split("/").slice(0,-1).join("/")||"/";i?.(),V(q)},[o,u,l,g,V,i]),F=b.useMemo(()=>v.filter(q=>q.type==="directory"),[v]),E=b.useMemo(()=>v.filter(q=>q.type==="file"),[v]);return{atRoot:m,currentPath:g,entries:v,loading:_,error:N,homeDir:O,goToOpen:Z,hasAllowedPaths:o,isWildcard:u,importedSet:X,dirs:F,files:E,loadTree:V,handleNavigateUp:W,setGoToOpen:$}}function O_({rpc:n,selectedPath:l,onSelect:s,allowedPaths:i,importedPaths:o}){const{t:u}=Te(),[m,p]=b.useState(null),{atRoot:g,currentPath:h,entries:v,loading:y,error:_,homeDir:j,goToOpen:N,isWildcard:T,importedSet:O,dirs:G,files:Z,loadTree:$,handleNavigateUp:V,setGoToOpen:X}=ty({rpc:n,allowedPaths:i??[],importedPaths:o??[],onNavigateUpExtra:()=>p(null)}),[W,F]=b.useState(null),[E,q]=b.useState(!1);b.useEffect(()=>{if(!l){F(null),q(!1);return}F(null),q(!0);let re=!1;return(async()=>{try{const ue=await n("fs/repoStatus",{path:l});re||(F({branch:ue.branch,hash:ue.head_hash,remoteUrl:ue.remote_url}),q(!1))}catch{re||(F(null),q(!1))}})(),()=>{re=!0}},[l,n]);const ee=b.useCallback(re=>{if(re.type==="directory")if(re.is_git_repo){if(O.has(re.path))return;p(null),s(re.path,re.name)}else p(re.path),$(re.path)},[s,$,O]),de=b.useMemo(()=>G.sort((re,ue)=>re.is_git_repo&&!ue.is_git_repo?-1:!re.is_git_repo&&ue.is_git_repo?1:re.name.localeCompare(ue.name)),[G]),oe=b.useMemo(()=>Z.sort((re,ue)=>re.name.localeCompare(ue.name)),[Z]);return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1",children:[g?f.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[f.jsx("span",{children:u("sources.import.allowed_dirs")}),f.jsx(Wx,{})]}):f.jsx("p",{className:"min-w-0 shrink truncate font-mono text-xs text-c4a-text-muted",children:h}),l&&E?f.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 font-mono text-xs text-c4a-accent",children:[f.jsx(Da,{size:12,className:"animate-spin"}),f.jsx("span",{children:u("common.loading")})]}):l&&W?f.jsx(Zx,{remoteUrl:W.remoteUrl,fallbackName:l.split("/").pop()||l,branch:W.branch,commit:W.hash}):!l&&T&&g?f.jsx("button",{onClick:()=>X(!0),className:"flex shrink-0 items-center gap-1.5 rounded border border-c4a-accent/40 bg-c4a-accent/10 px-2.5 py-1 text-xs text-c4a-accent transition-colors hover:bg-c4a-accent/20",children:u("sources.import.wildcard_goto")}):null]}),f.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),g?T?f.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:j&&f.jsxs("button",{onClick:()=>$(j),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(Xa,{size:14,className:"shrink-0"}),f.jsxs("span",{className:"truncate",children:[j,f.jsxs("span",{className:"ml-1.5 text-c4a-text-muted",children:["(",u("sources.import.wildcard_home"),")"]})]}),f.jsx(da,{size:12,className:"shrink-0 text-c4a-text-muted"})]})}):f.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:i.map(re=>f.jsxs("button",{onClick:()=>$(re),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(Xa,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:re}),f.jsx(da,{size:12,className:"shrink-0 text-c4a-text-muted"})]},re))}):_&&!y?f.jsx("p",{className:"py-4 text-xs text-c4a-error",children:_}):f.jsxs("div",{className:"relative min-h-[5rem] min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:[y&&f.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-c4a-bg-surface/60",children:f.jsx(Da,{size:14,className:"animate-spin text-c4a-text-muted"})}),h!=="/"&&f.jsxs("button",{onClick:V,disabled:y,className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary hover:bg-c4a-bg-hover disabled:pointer-events-none",children:[f.jsx(Xa,{size:14}),f.jsx("span",{children:".."})]}),de.map(re=>{const ue=re.is_git_repo&&O.has(re.path),ge=re.is_git_repo?Co:Xa;return f.jsxs("div",{className:`flex w-full items-center rounded pl-2 pr-4 text-left text-sm transition-colors ${ue?"cursor-not-allowed text-c4a-accent/60":l===re.path?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-accent/10 hover:text-c4a-accent"}`,children:[f.jsxs("button",{onClick:()=>ee(re),disabled:ue||y,className:"flex flex-1 items-center gap-2 px-2 py-1.5",children:[f.jsx(ge,{size:14,className:"shrink-0"}),f.jsx("span",{className:"flex-1 truncate text-left",children:re.name}),ue&&f.jsx("span",{className:"rounded bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] text-c4a-accent/60",children:u("sources.import.already_imported")})]}),!ue&&f.jsx("button",{onClick:k=>{k.stopPropagation(),$(re.path)},disabled:y,className:"shrink-0 rounded p-1.5 text-c4a-text-muted transition-colors hover:bg-c4a-accent/10 hover:text-c4a-accent disabled:pointer-events-none",title:re.path,children:f.jsx(da,{size:12})})]},re.path)}),oe.map(re=>f.jsxs("div",{className:"flex w-full items-center gap-2 pl-2 pr-4 py-1.5 text-sm text-c4a-text-muted",children:[f.jsx(Hx,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:re.name})]},re.path)),v.length===0&&!y&&f.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:u("sources.import.no_entries")})]}),m&&!l&&f.jsx("p",{className:"mt-3 text-xs text-c4a-warning",children:u("sources.import.not_git")}),f.jsx(ey,{open:N,onClose:()=>X(!1),rpc:n,onNavigate:$,defaultPath:j??void 0})]})}const Er=50,ad=["main","master"];function D_(n){const l=[],s=[];for(const i of n)ad.includes(i.name)?l.push(i):s.push(i);return l.sort((i,o)=>ad.indexOf(i.name)-ad.indexOf(o.name)),[...l,...s]}function qg(n,l,s){b.useEffect(()=>{if(!s)return;const i=o=>{n.current&&!n.current.contains(o.target)&&l()};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n,l,s])}function ay({refs:n,loading:l,error:s,selectedRef:i,commit:o,onRefChange:u,onCommitChange:m,onValidChange:p,onBranchSwitch:g}){const{t:h}=Te(),[v,y]=b.useState(!1),[_,j]=b.useState(""),[N,T]=b.useState(!0),[O,G]=b.useState(!0),Z=b.useRef(null),$=b.useRef(null),[V,X]=b.useState(!1),[W,F]=b.useState(""),E=b.useRef(null),q=b.useRef(null);qg(Z,()=>{y(!1),j("")},v),qg(E,()=>{X(!1),F("")},V),b.useEffect(()=>{v&&setTimeout(()=>$.current?.focus(),0)},[v]),b.useEffect(()=>{V&&setTimeout(()=>q.current?.focus(),0)},[V]),b.useEffect(()=>{p(!!i)},[i,p]);const ee=b.useCallback(le=>{u(le.name),m(le.commit),y(!1),j(""),g?.(le.name)},[u,m,g]),de=b.useCallback((le,w)=>{m(le),u(w),X(!1),F("")},[m,u]),oe=b.useMemo(()=>n?D_(n.branches):[],[n]),re=b.useMemo(()=>{const le=_.toLowerCase();return(le?oe.filter(B=>B.name.toLowerCase().includes(le)):oe).slice(0,Er)},[oe,_]),ue=b.useMemo(()=>{if(!n)return[];const le=_.toLowerCase();return(le?n.tags.filter(B=>B.name.toLowerCase().includes(le)):n.tags).slice(0,Er)},[n,_]),ge=b.useMemo(()=>{if(!n)return[];if(n.commits&&n.commits.length>0){const ae=W.toLowerCase(),xe=n.commits.map(ve=>({hash:ve.hash,refName:i||"",label:`${ve.hash.slice(0,8)} ${ve.message?`— ${ve.message.slice(0,50)}`:""}`.trim()}));return ae?xe.filter(ve=>ve.hash.toLowerCase().includes(ae)||ve.label.toLowerCase().includes(ae)).slice(0,Er):xe.slice(0,Er)}const le=new Set,w=[],B=[...n.branches??[],...n.tags??[]];for(const ae of B){const xe=ae.commit.slice(0,8);le.has(ae.commit)||(le.add(ae.commit),w.push({hash:ae.commit,refName:ae.name,label:`${xe} (${ae.name})`}))}if(!W)return w.slice(0,Er);const te=W.toLowerCase();return w.filter(ae=>ae.hash.toLowerCase().includes(te)||ae.label.toLowerCase().includes(te)).slice(0,Er)},[n,W,i]),[k,P]=b.useState(!1);if(b.useEffect(()=>{if(!l){P(!1);return}const le=setTimeout(()=>P(!0),8e3);return()=>clearTimeout(le)},[l]),l)return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsx(Da,{size:20,className:"animate-spin text-c4a-accent"}),f.jsx("span",{className:"mt-2 text-sm text-c4a-accent",children:h("sources.import_remote.loading_refs")}),k&&f.jsx("span",{className:"mt-1.5 text-xs text-c4a-text-muted",children:h("sources.import_remote.loading_refs_slow")})]});if(s)return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-sm font-medium text-red-400",children:[f.jsx(Ul,{size:14,className:"shrink-0"}),h("sources.import.error_title")]}),f.jsx("p",{className:"mt-2 max-h-40 overflow-y-auto break-all font-mono text-xs leading-relaxed text-red-400/70",children:s})]});if(!n)return null;const fe=n.branches.find(le=>le.name===i)?.name??n.tags.find(le=>le.name===i)?.name??i,me=o?o.slice(0,8):"";return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col space-y-4 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsxs("div",{children:[f.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:h("sources.import_remote.ref_label")}),f.jsxs("div",{ref:Z,className:"relative mt-2",children:[f.jsxs("button",{onClick:()=>y(!v),className:"flex w-full items-center justify-between rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-2 font-mono text-sm font-semibold text-c4a-accent transition-colors hover:bg-c4a-bg-hover",children:[f.jsx("span",{children:fe||"—"}),f.jsx(da,{size:14,className:`text-c4a-text-muted transition-transform duration-200 ${v?"rotate-90":""}`})]}),v&&f.jsxs("div",{className:"absolute z-20 mt-1 w-full rounded border border-c4a-border-default bg-c4a-bg-elevated shadow-lg",children:[f.jsx("div",{className:"border-b border-c4a-border-default px-3 py-2.5",children:f.jsxs("div",{className:"flex items-center gap-2 rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-1.5",children:[f.jsx(xd,{size:14,className:"shrink-0 text-c4a-text-muted"}),f.jsx("input",{ref:$,type:"text",value:_,onChange:le=>j(le.target.value),placeholder:h("sources.import_remote.ref_search"),className:"w-full bg-transparent font-mono text-sm text-c4a-text-primary placeholder:text-c4a-text-muted focus:outline-none"})]})}),f.jsxs("div",{className:"flex max-h-80 flex-col md:flex-row",children:[re.length>0&&f.jsxs("div",{className:"c4a-scrollbar min-w-0 flex-1 overflow-y-auto md:border-r md:border-c4a-border-default",children:[f.jsxs("button",{onClick:()=>T(!N),className:"flex w-full items-center gap-1.5 px-3 py-2 font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:[f.jsx(da,{size:12,className:`transition-transform duration-200 ${N?"rotate-90":""}`}),h("sources.import_remote.ref_branches")," (",n.branches.length,")"]}),N&&re.map(le=>f.jsxs("button",{onClick:()=>ee(le),className:`flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm transition-colors hover:bg-c4a-bg-hover ${le.name===i?"font-semibold text-c4a-accent":"text-c4a-text-secondary"}`,children:[f.jsx("span",{className:"truncate",children:le.name}),le.name===i&&f.jsx("span",{children:"✓"})]},`b-${le.name}`))]}),ue.length>0&&f.jsxs("div",{className:"c4a-scrollbar min-w-0 flex-1 overflow-y-auto border-t border-c4a-border-default md:border-t-0",children:[f.jsxs("button",{onClick:()=>G(!O),className:"flex w-full items-center gap-1.5 px-3 py-2 font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:[f.jsx(da,{size:12,className:`transition-transform duration-200 ${O?"rotate-90":""}`}),h("sources.import_remote.ref_tags")," (",n.tags.length,")"]}),O&&ue.map(le=>f.jsxs("button",{onClick:()=>ee(le),className:`flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm transition-colors hover:bg-c4a-bg-hover ${le.name===i?"font-semibold text-c4a-accent":"text-c4a-text-secondary"}`,children:[f.jsx("span",{className:"truncate",children:le.name}),le.name===i&&f.jsx("span",{children:"✓"})]},`t-${le.name}`))]})]}),re.length===0&&ue.length===0&&f.jsx("div",{className:"px-3 py-4 text-center font-mono text-sm text-c4a-text-muted",children:"No matches"})]})]})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:h("sources.import_remote.commit_label")}),f.jsxs("div",{ref:E,className:"relative mt-2",children:[f.jsxs("button",{onClick:()=>X(!V),className:"flex w-full items-center justify-between rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-2 font-mono text-sm font-semibold text-c4a-accent transition-colors hover:bg-c4a-bg-hover",children:[f.jsx("span",{className:o?"":"font-normal text-c4a-text-muted",children:me||"—"}),f.jsx(da,{size:14,className:`text-c4a-text-muted transition-transform duration-200 ${V?"rotate-90":""}`})]}),V&&f.jsxs("div",{className:"c4a-scrollbar absolute z-20 mt-1 max-h-64 w-full overflow-y-auto rounded border border-c4a-border-default bg-c4a-bg-elevated shadow-lg",children:[f.jsx("div",{className:"sticky top-0 z-10 border-b border-c4a-border-default bg-c4a-bg-elevated px-3 py-2",children:f.jsxs("div",{className:"flex items-center gap-2 rounded border border-c4a-border-default bg-c4a-bg-surface px-2 py-1",children:[f.jsx(xd,{size:12,className:"shrink-0 text-c4a-text-muted"}),f.jsx("input",{ref:q,type:"text",value:W,onChange:le=>F(le.target.value),placeholder:h("sources.import_remote.commit_search"),className:"w-full bg-transparent font-mono text-xs text-c4a-text-primary placeholder:text-c4a-text-muted focus:outline-none"})]})}),ge.map(le=>f.jsxs("button",{onClick:()=>de(le.hash,le.refName),className:"flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx("span",{className:"truncate",children:le.label}),le.hash===o&&f.jsx("span",{className:"text-c4a-accent",children:"✓"})]},le.hash)),ge.length===0&&f.jsx("div",{className:"px-3 py-4 text-center font-mono text-xs text-c4a-text-muted",children:"No matches"})]})]}),f.jsxs("p",{className:"mt-3 flex items-center gap-1.5 text-xs text-c4a-text-muted",children:[f.jsx(XS,{size:12,className:"shrink-0"}),h("sources.import_remote.commit_hint")]})]})]})}const M_="_progressTrack_x6nor_1",k_="_progressFill_x6nor_9",A_="_progressFillFailed_x6nor_43",L_="_indeterminate_x6nor_51",oo={progressTrack:M_,progressFill:k_,progressFillFailed:A_,indeterminate:L_};function U_(n){const l={},s=100/n.length;return n.forEach((i,o)=>{l[i.key]=Math.round(s*(o+1))}),l}function H_(n,l,s,i,o,u){const m=v=>v>0?l[n[v-1].key]??0:0;if(o){const v=n.findIndex(j=>j.key===o),y=m(v),_=l[o]??100;return y+u/100*(_-y)}if(!s)return i.length===n.length?100:0;const p=n.findIndex(v=>v.key===s);if(p<0)return 0;const g=m(p),h=l[s]??100;return u>=0?g+u/100*(h-g):g}function B_({stages:n,currentStage:l,completedStages:s,failedStage:i,progress:o,breakpoints:u,easeRate:m=1}){const p=u??U_(n),g=o?.percent??-1,h=b.useRef(0),[v,y]=b.useState(0),_=b.useRef(null),j=H_(n,p,l,s,i,g>=0?g:-1);h.current=j,b.useEffect(()=>{j>v&&y(j)},[j]),b.useEffect(()=>{if(!l||i){_.current&&(clearInterval(_.current),_.current=null);return}const $=n.findIndex(W=>W.key===l),V=p[l]??100,X=$===n.length-1?V-1:V-2;return _.current=setInterval(()=>{y(W=>{const F=h.current;return W>=F&&W<X?Math.min(W+m,X):W})},1e3),()=>{_.current&&(clearInterval(_.current),_.current=null)}},[l,i,n,p,m]);const N=b.useRef(null);b.useEffect(()=>{if(s.length===n.length&&!i)return _.current&&(clearInterval(_.current),_.current=null),N.current=setInterval(()=>{y($=>$>=100?(N.current&&clearInterval(N.current),N.current=null,100):Math.min(100,$+4))},32),()=>{N.current&&(clearInterval(N.current),N.current=null)}},[s.length,n.length,i]);const T=Math.min(100,Math.max(0,v)),O=!!l&&!i,G=!!i,Z=s.length===n.length&&!i;return f.jsxs("div",{className:"space-y-3",children:[f.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:n.map($=>{const V=s.includes($.key),X=i===$.key,W=l===$.key;let F="inline-flex items-center gap-1.5 rounded-sm px-2 py-0.5 font-mono text-[11px] uppercase tracking-tight transition-colors";return X?F+=" bg-red-500/10 text-red-400":V?F+=" bg-c4a-accent/10 text-c4a-accent":W?F+=" bg-c4a-accent/15 text-c4a-accent":F+=" bg-c4a-bg-elevated text-c4a-text-muted",f.jsxs("span",{className:F,children:[X?f.jsx(Ul,{size:10,className:"shrink-0"}):V?f.jsx(Al,{size:10,className:"shrink-0"}):W?f.jsx("span",{className:"block h-1.5 w-1.5 shrink-0 rounded-full bg-c4a-accent animate-pulse"}):null,$.label]},$.key)})}),f.jsx("div",{className:oo.progressTrack,children:T>0?f.jsx("div",{className:`${oo.progressFill} ${G?oo.progressFillFailed:""}`,style:{width:`${T}%`}},"fill"):O?f.jsx("div",{className:oo.indeterminate,style:{width:"100%",height:"100%"}},"pulse"):null}),f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsx("span",{className:"font-mono text-[11px] text-c4a-text-muted tabular-nums",children:Z?"100%":O||G?`${Math.round(T)}%`:""}),o?.label&&O&&f.jsx("span",{className:"max-w-[320px] truncate font-mono text-[11px] text-c4a-text-muted",children:o.label})]})]})}function ny({stages:n,currentStage:l,completedStages:s,failedStage:i,progress:o,breakpoints:u,failedError:m,logs:p}){const g=b.useRef(null);return b.useEffect(()=>{g.current?.scrollIntoView({behavior:"smooth"})},[p.length]),f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsx(B_,{stages:n,currentStage:l,completedStages:s,failedStage:i,progress:o,...u?{breakpoints:u}:{}}),f.jsxs("div",{className:"mt-4 min-h-0 flex-1 rounded bg-c4a-bg-base p-3 c4a-scrollbar overflow-y-auto",children:[p.map((h,v)=>f.jsx("p",{className:"font-mono text-xs text-c4a-text-muted leading-relaxed",children:h},v)),f.jsx("div",{ref:g})]}),i&&m&&f.jsx("div",{className:"mt-3 max-h-32 overflow-y-auto rounded-sm bg-red-500/5 px-4 py-3",children:f.jsx("p",{className:"break-all font-mono text-xs leading-relaxed text-red-400/80",children:m})})]})}function Dn({icon:n,label:l,value:s,tooltip:i,size:o="sm"}){const u=o==="sm";return f.jsxs("div",{className:"group/stat relative rounded border border-c4a-border-subtle bg-c4a-bg-base p-3",children:[f.jsxs("div",{className:"flex items-center gap-1.5 text-c4a-text-muted [&>svg]:size-4",children:[n,f.jsx("span",{className:"font-mono text-xs uppercase",children:l})]}),f.jsx("p",{className:`mt-1 font-mono font-bold text-c4a-text-secondary ${u?"text-sm truncate":"text-lg"}`,title:u?String(s):void 0,children:s}),i&&f.jsx("div",{className:"pointer-events-none absolute bottom-full left-0 z-30 mb-1.5 hidden w-max max-w-[260px] rounded border border-c4a-border-default bg-c4a-bg-elevated px-2.5 py-1.5 text-[11px] leading-relaxed text-c4a-text-secondary shadow-c4a-lg group-hover/stat:block",children:i})]})}const nd=100;function ly({repoName:n,repoIdentifier:l,branch:s,commit:i,packages:o,mdFiles:u,importing:m,completed:p}){const{t:g}=Te(),h=i?i.slice(0,7):"",[v,y]=b.useState("packages"),[_,j]=b.useState(nd),N=b.useRef(null),T=b.useRef(null);b.useEffect(()=>{j(nd),T.current?.scrollTo(0,0)},[v]),b.useEffect(()=>{const V=N.current;if(!V)return;const X=v==="packages"?o.length:u.length;if(_>=X)return;const W=new IntersectionObserver(F=>{F[0]?.isIntersecting&&j(E=>Math.min(E+nd,X))},{root:T.current,threshold:.1});return W.observe(V),()=>W.disconnect()},[v,_,o.length,u.length]);const O=v==="packages"?o:u,G=O.slice(0,_),Z=_<O.length,$=b.useMemo(()=>p?g("sources.import_remote.complete"):m?g("sources.import.importing"):g("sources.import.confirm_heading",{name:n}),[p,m,n,g]);return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6",children:[f.jsx("p",{className:"text-sm text-c4a-text-secondary",children:$}),f.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-3 gap-y-1",children:[f.jsx("span",{className:"font-mono text-sm font-bold text-c4a-accent",children:n}),f.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:l})]}),f.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-3 sm:grid-cols-4",children:[f.jsx(Dn,{icon:f.jsx(pd,{size:14}),label:g("sources.import.branch"),value:s}),f.jsx(Dn,{icon:f.jsx(qS,{size:14}),label:g("sources.import.commit"),value:h}),f.jsx(Dn,{icon:f.jsx(Or,{size:14}),label:g("sources.import.packages"),value:String(o.length),tooltip:g("sources.import.dir_code_packages_tip")}),f.jsx(Dn,{icon:f.jsx(cl,{size:14}),label:g("sources.import.documents"),value:String(u.length),tooltip:g("sources.import.dir_doc_files_tip")})]}),m&&f.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-3",children:[f.jsx(Da,{size:14,className:"animate-spin text-c4a-accent"}),f.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:g("sources.import.importing")})]}),(o.length>0||u.length>0)&&f.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-base",children:[f.jsxs("div",{className:"flex shrink-0 items-center justify-between px-4 py-3",children:[f.jsx("p",{className:"hidden font-mono text-xs text-c4a-text-secondary sm:block",children:g("sources.import.recognized",{packages:o.length,docs:u.length})}),f.jsxs("div",{className:"flex rounded border border-c4a-border-subtle",children:[f.jsxs("button",{onClick:()=>y("packages"),className:`flex items-center gap-1 px-2.5 py-1 text-xs transition-colors ${v==="packages"?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:[f.jsx(Or,{size:13}),f.jsx("span",{className:"font-mono",children:o.length})]}),f.jsxs("button",{onClick:()=>y("docs"),className:`flex items-center gap-1 border-l border-c4a-border-subtle px-2.5 py-1 text-xs transition-colors ${v==="docs"?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:[f.jsx(cl,{size:13}),f.jsx("span",{className:"font-mono",children:u.length})]})]})]}),f.jsx("hr",{className:"border-c4a-border-subtle"}),f.jsx("div",{ref:T,className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto px-2 py-1",children:O.length===0?f.jsx("p",{className:"py-8 text-center text-xs text-c4a-text-muted",children:v==="packages"?g("sources.import.no_packages"):"—"}):f.jsxs(f.Fragment,{children:[v==="packages"?G.map(V=>f.jsxs("div",{className:"flex items-center gap-2 rounded pl-2 pr-4 py-1 text-xs",children:[f.jsx(Or,{size:14,className:"shrink-0 text-c4a-accent"}),f.jsx("span",{className:"text-c4a-text-secondary",children:V.name}),f.jsx("span",{className:"hidden truncate text-c4a-text-muted sm:inline",children:V.path}),V.isRoot&&f.jsx("span",{className:"rounded bg-c4a-bg-active px-1 py-0.5 font-mono text-[10px] text-c4a-text-muted",children:"root"})]},V.path)):G.map(V=>f.jsxs("div",{className:"flex items-center gap-2 rounded pl-2 pr-4 py-1 text-xs",children:[f.jsx(cl,{size:14,className:"shrink-0 text-c4a-text-secondary"}),f.jsx("span",{className:"truncate text-c4a-text-secondary",children:V})]},V)),Z&&f.jsx("div",{ref:N,className:"h-4"})]})})]})]})}const $_=["scan","save"],co={scan:"sources.import.stage.scan",save:"sources.import.stage.save"};function q_(){const{t:n}=Te(),l=kn(),{libId:s}=Vs(),[i]=wo(),u=It(Hl(kr)).find(Se=>Se.id===s),m=To(Se=>Se.createSource),p=i.get("parentId")||"",g=i.get("parentName")||"",h=i.get("parentPath")||"",[v,y]=b.useState(1),[_,j]=b.useState(null),[N,T]=b.useState({repoPath:"",repoName:"",branch:"",branches:[],commit:"",commits:[],isDirty:!1,repoFiles:[],packages:[],mdFiles:[],repoFileContents:[]}),[O,G]=b.useState(null),[Z,$]=b.useState(!1),[V,X]=b.useState(null),[W,F]=b.useState(""),[E,q]=b.useState(""),[ee,de]=b.useState(!1),[oe,re]=b.useState(!1),[ue,ge]=b.useState(!1),[k,P]=b.useState(null),[fe,me]=b.useState([]),[le,w]=b.useState(null),[B,te]=b.useState(null),[ae,xe]=b.useState([]),ve=b.useRef(null),ze=u?.is_online??!1,{rpc:Pe,importedPaths:Xe,allowedPaths:Wt}=Jx(s,u),ma=b.useMemo(()=>$_.map(Se=>({key:Se,label:co[Se]?n(co[Se]):Se})),[n]),Qe=b.useCallback(Se=>{xe(ke=>[...ke,`[${Sd()}] ${Se}`])},[]),tt=b.useRef(null),dt=b.useCallback(Se=>{const ke=tt.current;ke&&ke!==Se&&(me(Ze=>Ze.includes(ke)?Ze:[...Ze,ke]),Qe(`${n(co[ke]??ke)} ${n("sources.import.stage.done_suffix")}`)),Qe(`${n(co[Se]??Se)}...`),tt.current=Se,P(Se),te(null)},[Qe,n]),$t=b.useCallback((Se,ke)=>{T(Ze=>({...Ze,repoPath:Se,repoName:ke}))},[]),Gt=b.useCallback(async()=>{$(!0),X(null);try{const Se=await Pe("fs/repoStatus",{path:N.repoPath}),ke={branches:Se.branches??[{name:Se.branch,commit:Se.head_hash}],tags:Se.tags??[],default:Se.branch,commits:Se.commits??[{hash:Se.head_hash,message:"HEAD"}]};G(ke),T(Ze=>({...Ze,isDirty:Se.is_dirty})),F(Ze=>{if(Ze)return Ze;const pt=ke.branches.find(Ja=>Ja.name===ke.default),Nt=ke.branches[0],Xt=pt??Nt;return Xt?(q(Xt.commit),Xt.name):Ze})}catch(Se){const ke=Se instanceof Error?Se.message:"Failed to load repository info";X(ke)}finally{$(!1)}},[Pe,N.repoPath]);b.useEffect(()=>{v===2&&N.repoPath&&!O&&Gt()},[v,N.repoPath,O,Gt]);const ea=b.useCallback(async Se=>{try{const ke=await Pe("fs/repoStatus",{path:N.repoPath,branch:Se});G(Ze=>Ze&&{...Ze,commits:ke.commits??[]})}catch{}},[Pe,N.repoPath]),ta=b.useCallback(async()=>{if(!s)return;const Se=Date.now();re(!0),ge(!1),j(null),w(null),me([]),tt.current=null,P(null),te(null),xe([]),y(3);try{dt("scan");const ke=await Pe("fs/repoScan",{path:N.repoPath,hash:E}),Ze=ke.files||[],pt=ke.manifests||[],Nt=il(N.repoPath),{packages:Xt,mdFiles:Ja}=Px(pt,Ze,Nt);T(gt=>({...gt,branch:W,commit:E,repoFiles:Ze,packages:Xt,mdFiles:Ja,repoFileContents:pt})),dt("save");const Qt=await m({library_id:s,repo_name:N.repoName||Nt,repo_root_path:N.repoPath,repo_branch:W,repo_commit:E,repo_files:Ze.map(gt=>gt.path),repo_file_contents:pt,...p?{parent_source_id:p,parent_path:h}:{}});me(["scan","save"]),tt.current=null,P(null),Qe(`${n("sources.import.stage.save")} ${n("sources.import.stage.done_suffix")}`),Qe(n("sources.import.stage.complete"));const Tt=Array.isArray(Qt)?Qt[0]:Qt;ve.current=Tt?.id??null,await Ix(Se),ge(!0),re(!1),y(4)}catch(ke){const Ze=tt.current??"scan";w(Ze),tt.current=null,P(null);const pt=ke instanceof Error?ke.message:String(ke);Qe(`ERROR: ${pt}`),j(pt),re(!1)}},[s,N,W,E,p,h,Pe,m,dt,Qe]),Sa=b.useCallback(()=>{w(null),j(null),ta()},[ta]),_a=b.useCallback(()=>{if(s)if(p){const Se=N.repoName||il(N.repoPath),ke=h?`${h}/${Se}`:Se;l(`/studio/sources/${s}?rootId=${p}&path=${encodeURIComponent(ke)}`)}else ve.current?l(`/studio/sources/${s}?rootId=${ve.current}`):l(`/studio/sources/${s}`)},[s,l,p,h,N.repoPath,N.repoName]),ka=b.useMemo(()=>v===1?!!N.repoPath:v===2?ee:v===3?ue:!1,[v,N.repoPath,ee,ue]),ra=b.useMemo(()=>{if(!u)return[];const Se=[{label:u.id===ul?n("sources.library.default_cloud_name"):u.name,to:`/studio/sources/${u.id}`}];if(p&&(Se.push({label:g||p,to:`/studio/sources/${u.id}?rootId=${p}`}),h)){const ke=h.split("/").filter(Boolean);for(const[Ze,pt]of ke.entries()){const Nt=ke.slice(0,Ze+1).join("/");Se.push({label:pt,to:`/studio/sources/${u.id}?rootId=${p}&path=${encodeURIComponent(Nt)}`})}}return Se.push({label:n("sources.import.title")}),Se},[u,p,g,h,n]);if(!u)return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})});const sa=v===4,ht=v===3&&!!le&&!oe,ia=v<=2;return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[f.jsx("div",{className:"shrink-0",children:f.jsx(Ar,{segments:ra})}),f.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[f.jsx(fn,{active:v>=1,current:v===1}),f.jsx("span",{className:v===1?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.select")}),f.jsx(Ml,{}),f.jsx(fn,{active:v>=2,current:v===2}),f.jsx("span",{className:v===2?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.version")}),f.jsx(Ml,{}),f.jsx(fn,{active:v>=3,current:v===3}),f.jsx("span",{className:v===3?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.loading")}),f.jsx(Ml,{}),f.jsx(fn,{active:v>=4,current:v===4}),f.jsx("span",{className:v===4?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.confirm")})]}),f.jsx("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:ze?f.jsxs(f.Fragment,{children:[v===1&&f.jsx(O_,{rpc:Pe,selectedPath:N.repoPath,onSelect:$t,allowedPaths:Wt,importedPaths:Xe}),v===2&&f.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:f.jsx(ay,{refs:O,loading:Z,error:V,selectedRef:W,commit:E,onRefChange:F,onCommitChange:q,onValidChange:de,onRetry:Gt,onBranchSwitch:ea})}),v===3&&f.jsx(ny,{stages:ma,currentStage:k,completedStages:fe,failedStage:le,progress:B,failedError:_,logs:ae}),v===4&&f.jsx(ly,{repoName:N.repoName||il(N.repoPath),repoIdentifier:N.repoPath,branch:W,commit:E,packages:N.packages,mdFiles:N.mdFiles,importing:!1,completed:ue})]}):f.jsx(Fx,{libraryName:u.name})}),ze&&f.jsx(f.Fragment,{children:sa?f.jsx("div",{className:"mt-3 flex shrink-0 justify-end sm:mt-6",children:f.jsx("button",{onClick:_a,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("sources.import.done")})}):ht?f.jsxs("div",{className:"mt-3 flex shrink-0 justify-end gap-2 sm:mt-6",children:[f.jsx("button",{onClick:()=>{y(2),w(null),j(null),me([]),tt.current=null,P(null),xe([])},className:"rounded border border-c4a-border-default px-4 py-2 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:n("sources.import.back")}),f.jsx("button",{onClick:Sa,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("sources.import.retry")})]}):ia?f.jsx(Dd,{step:v,totalSteps:4,importing:oe,stepBusy:Z||v===3&&oe,canProceed:ka,safetyNoticeKey:"sources.safety.notice.repo",confirmLabelKey:"sources.import.step.confirm",onPrev:()=>y(Se=>Se-1),onNext:()=>{v===2?ta():y(Se=>Se+1)},onImport:ta}):null}),_&&v!==3&&f.jsxs(Bl,{onClose:()=>j(null),className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-error",children:n("sources.import.error_title")}),f.jsx("p",{className:"mt-3 whitespace-pre-wrap break-all text-sm text-c4a-text-secondary",children:_}),f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsx("button",{onClick:()=>j(null),className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("common.confirm")})})]})]})}const Yg=(n,l)=>{let s=0,i=0,o=0;const u=[],m=p=>{for(const g of p)if(g.type==="directory")i++,g.is_git_repo&&o++,g.children&&m(g.children);else if(s++,/\.md$/i.test(g.name)){const h=g.path.startsWith(l)?g.path.slice(l.length).replace(/^\//,""):g.name;u.push(h)}};return m(n),{files:s,dirs:i,gitRepos:o,mdFiles:u}};function Y_({rpc:n,selectedPath:l,onSelect:s,allowedPaths:i,importedPaths:o}){const{t:u}=Te(),{atRoot:m,currentPath:p,entries:g,loading:h,error:v,homeDir:y,goToOpen:_,isWildcard:j,importedSet:N,dirs:T,files:O,loadTree:G,handleNavigateUp:Z,setGoToOpen:$}=ty({rpc:n,allowedPaths:i??[],importedPaths:o??[]}),V=b.useCallback(E=>{if(E.type!=="directory"||N.has(E.path))return;const q=Yg(E.children||[],E.path);s(E.path,E.name,q),G(E.path)},[s,G,N]);b.useEffect(()=>{if(p&&!m&&g.length>=0&&!h){const E=p.split("/").pop()||p,q=Yg(g,p);s(p,E,q)}},[p,m,g,h,s]);const X=b.useMemo(()=>l?l.split("/").pop()||l:"",[l]),W=b.useMemo(()=>T.sort((E,q)=>E.is_git_repo&&!q.is_git_repo?-1:!E.is_git_repo&&q.is_git_repo?1:E.name.localeCompare(q.name)),[T]),F=b.useMemo(()=>O.sort((E,q)=>E.name.localeCompare(q.name)),[O]);return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[m?f.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[f.jsx("span",{children:u("sources.import.allowed_dirs")}),f.jsx(Wx,{})]}):f.jsx("p",{className:"min-w-0 truncate font-mono text-xs text-c4a-text-muted",children:p}),l?f.jsxs("p",{className:"flex shrink-0 items-center gap-2 font-mono text-xs text-c4a-accent",children:[f.jsx(Xa,{size:12}),f.jsx("span",{children:X})]}):j&&m?f.jsx("button",{onClick:()=>$(!0),className:"flex shrink-0 items-center gap-1.5 rounded border border-c4a-accent/40 bg-c4a-accent/10 px-2.5 py-1 text-xs text-c4a-accent transition-colors hover:bg-c4a-accent/20",children:u("sources.import.wildcard_goto")}):null]}),f.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),m?j?f.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:y&&f.jsxs("button",{onClick:()=>G(y),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(Xa,{size:14,className:"shrink-0"}),f.jsxs("span",{className:"truncate",children:[y,f.jsxs("span",{className:"ml-1.5 text-c4a-text-muted",children:["(",u("sources.import.wildcard_home"),")"]})]}),f.jsx(da,{size:12,className:"shrink-0 text-c4a-text-muted"})]})}):f.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:i.map(E=>f.jsxs("button",{onClick:()=>G(E),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(Xa,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:E}),f.jsx(da,{size:12,className:"shrink-0 text-c4a-text-muted"})]},E))}):v&&!h?f.jsx("p",{className:"py-4 text-xs text-c4a-error",children:v}):f.jsxs("div",{className:"relative min-h-[5rem] min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:[h&&f.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-c4a-bg-surface/60",children:f.jsx(Da,{size:14,className:"animate-spin text-c4a-text-muted"})}),p!=="/"&&f.jsxs("button",{onClick:Z,disabled:h,className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary hover:bg-c4a-bg-hover disabled:pointer-events-none",children:[f.jsx(Xa,{size:14}),f.jsx("span",{children:".."})]}),W.map(E=>{const q=N.has(E.path),ee=E.is_git_repo?Co:Xa;return f.jsxs("button",{onClick:()=>V(E),disabled:q||h,className:`flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm transition-colors ${q?"cursor-not-allowed text-c4a-accent/60":l===E.path?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:[f.jsx(ee,{size:14,className:"shrink-0"}),f.jsx("span",{className:"flex-1 truncate",children:E.name}),q&&f.jsx("span",{className:"rounded bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] text-c4a-accent/60",children:u("sources.import.already_imported")}),f.jsx(da,{size:12,className:"shrink-0 text-c4a-text-muted"})]},E.path)}),F.map(E=>f.jsxs("div",{className:"flex w-full items-center gap-2 pl-2 pr-4 py-1.5 text-sm text-c4a-text-muted",children:[f.jsx(Hx,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:E.name})]},E.path)),g.length===0&&!h&&f.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:u("sources.import.no_entries")})]}),f.jsx(ey,{open:_,onClose:()=>$(!1),rpc:n,onNavigate:G,defaultPath:y??void 0})]})}const G_=new Set(["package.json","pyproject.toml","setup.py","go.mod","cargo.toml","pom.xml","build.gradle"]),V_=n=>{let l=0,s=0,i=0,o=0,u=0;const m=new Set;for(const p of n)if(p.type==="directory")s++,p.is_git_repo&&u++;else{l++,p.path.toLowerCase().endsWith(".md")&&o++;const h=p.path.split("/").pop();if(h&&G_.has(h.toLowerCase())){const v=p.path.split("/").slice(0,-1).join("/");n.some(_=>_.type==="directory"&&_.is_git_repo&&(v===_.path||v.startsWith(`${_.path}/`)))||m.add(v)}}return i=m.size,{totalFiles:l,totalDirs:s,codePackages:i,docFiles:o,gitRepos:u}};function K_({dirPath:n,rpc:l,importing:s,onScanComplete:i,onBusyChange:o}){const{t:u}=Te(),[m,p]=b.useState(!1),[g,h]=b.useState(null),[v,y]=b.useState(null),_=b.useCallback(async()=>{p(!0),o?.(!0),h(null),y(null);try{const j=await l("fs/dirScan",{path:n}),N=j.entries||[],T=j.manifests||[],O=V_(N);y(O),i(N,O,T)}catch(j){const N=j instanceof Error?j.message:String(j);h(N)}finally{p(!1),o?.(!1)}},[n,l,i,o]);return b.useEffect(()=>{_()},[_]),f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6",children:[f.jsx("p",{className:"shrink-0 font-mono text-xs text-c4a-text-muted",children:n}),f.jsx("div",{className:"mt-3 shrink-0 border-t border-c4a-border-subtle"}),f.jsxs("div",{className:"c4a-scrollbar min-h-0 flex-1 overflow-y-auto",children:[m&&f.jsxs("div",{className:"mt-6 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-4",children:[f.jsx(Da,{size:14,className:"animate-spin text-c4a-accent"}),f.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:u("sources.import.dir_scanning")})]}),g&&f.jsxs("div",{className:"mt-6",children:[f.jsxs("p",{className:"flex items-start gap-2 text-xs text-c4a-error",children:[f.jsx(Ux,{size:14,className:"mt-0.5 shrink-0"}),u("sources.import.dir_scan_error")]}),f.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:g}),f.jsxs("button",{onClick:_,className:"mt-3 flex items-center gap-1.5 rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(u2,{size:12}),u("sources.import.dir_scan_retry")]})]}),v&&!m&&!g&&f.jsxs("div",{className:"mt-6 space-y-3",children:[f.jsxs("p",{className:"font-mono text-sm uppercase text-c4a-accent",children:[u("sources.import.dir_scan_complete"),"!"]}),f.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3 lg:grid-cols-5",children:[f.jsx(Dn,{icon:f.jsx(cl,{size:14}),label:u("sources.import.dir_doc_files"),value:v.docFiles,tooltip:u("sources.import.dir_doc_files_tip"),size:"lg"}),f.jsx(Dn,{icon:f.jsx(Or,{size:14}),label:u("sources.import.dir_code_packages"),value:v.codePackages,tooltip:u("sources.import.dir_code_packages_tip"),size:"lg"}),v.gitRepos>0&&f.jsx(Dn,{icon:f.jsx(Co,{size:14}),label:u("sources.import.dir_git_repos"),value:v.gitRepos,size:"lg"}),f.jsx(Dn,{icon:f.jsx(Xa,{size:14}),label:u("sources.import.dir_total_dirs"),value:v.totalDirs,size:"lg"}),f.jsx(Dn,{icon:f.jsx(OS,{size:14}),label:u("sources.import.dir_total_files"),value:v.totalFiles,size:"lg"})]}),v.gitRepos>0&&f.jsx("p",{className:"text-xs text-c4a-warning",children:u("sources.import.dir_git_skip_hint",{count:v.gitRepos})})]}),s&&f.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-3",children:[f.jsx(Da,{size:14,className:"animate-spin text-c4a-accent"}),f.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:u("sources.import.importing")})]})]})]})}function X_(){const{t:n}=Te(),l=kn(),{libId:s}=Vs(),o=It(Hl(kr)).find(q=>q.id===s),u=To(q=>q.createSource),[m,p]=b.useState(1),[g,h]=b.useState(!1),[v,y]=b.useState(null),[_,j]=b.useState(!1),[N,T]=b.useState({dirPath:"",dirName:"",fileCount:0,subDirCount:0,gitRepoCount:0,mdFiles:[],scanEntries:[],scanStats:null,manifests:[]}),O=o?.is_online??!1,{rpc:G,importedPaths:Z,allowedPaths:$}=Jx(s,o),V=b.useCallback((q,ee,de)=>{T(oe=>({...oe,dirPath:q,dirName:ee,fileCount:de.files,subDirCount:de.dirs,gitRepoCount:de.gitRepos,mdFiles:de.mdFiles}))},[]),X=b.useCallback((q,ee,de)=>{T(oe=>({...oe,scanEntries:q,scanStats:ee,manifests:de}))},[]),W=b.useCallback(async()=>{if(s){h(!0);try{const q=await u({library_id:s,dir_files:N.scanEntries,dir_name:N.dirName,dir_path:N.dirPath,dir_file_contents:N.manifests}),ee=Array.isArray(q)?q[0]:q;ee?.id?l(`/studio/sources/${s}?rootId=${ee.id}`):l(`/studio/sources/${s}`)}catch(q){const ee=q instanceof Error?q.message:String(q);y(ee),h(!1)}}},[s,N,u,l]),F=b.useMemo(()=>m===1?!!N.dirPath:m===2?N.scanEntries.length>0:!0,[m,N]),E=b.useMemo(()=>o?[{label:o.id===ul?n("sources.library.default_cloud_name"):o.name,to:`/studio/sources/${o.id}`},{label:n("sources.import.dir_title")}]:[],[o,n]);return o?f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[f.jsx("div",{className:"shrink-0",children:f.jsx(Ar,{segments:E})}),f.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[f.jsx(fn,{active:m>=1,current:m===1}),f.jsx("span",{className:m===1?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.dir_step.select")}),f.jsx(Ml,{}),f.jsx(fn,{active:m>=2,current:m===2}),f.jsx("span",{className:m===2?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.dir_step.confirm")})]}),f.jsx("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:O?f.jsxs(f.Fragment,{children:[m===1&&f.jsx(Y_,{rpc:G,selectedPath:N.dirPath,onSelect:V,allowedPaths:$,importedPaths:Z}),m===2&&f.jsx(K_,{dirPath:N.dirPath,rpc:G,importing:g,onScanComplete:X,onBusyChange:j})]}):f.jsx(Fx,{libraryName:o.name})}),O&&f.jsx(Dd,{step:m,totalSteps:2,importing:g,stepBusy:_,canProceed:F,safetyNoticeKey:"sources.safety.notice.dir",confirmLabelKey:"sources.import.dir_step.confirm",onPrev:()=>p(q=>q-1),onNext:()=>p(q=>q+1),onImport:W}),v&&f.jsxs(Bl,{onClose:()=>y(null),className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-error",children:n("sources.import.error_title")}),f.jsx("p",{className:"mt-3 whitespace-pre-wrap break-all text-sm text-c4a-text-secondary",children:v}),f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsx("button",{onClick:()=>y(null),className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("common.confirm")})})]})]}):f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})})}const Q_=/^https:\/\/[^/]+\/.+/;function Z_({url:n,onUrlChange:l,onValidChange:s,onRefHint:i}){const{t:o}=Te(),[u,m]=b.useState(null),[p,g]=b.useState([]),h=b.useRef(null);b.useEffect(()=>{_t.get("/import/remote/git-hosts").then(j=>g(j.hosts),()=>{})},[]);const v=b.useCallback(j=>{if(!j){m(null),s(!1);return}const N=T_(j),T=N.repoUrl!==j.trim(),O=T?N.repoUrl:j;T&&(l(O),i?.(N.ref,N.commit)),Q_.test(O)?(m(null),s(!0)):(m(o("sources.import_remote.url_invalid")),s(!1))},[l,s,i,o]),y=b.useCallback(j=>{const N=j.target.value;l(N),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>v(N),500)},[l,v]),_=b.useCallback(j=>{j.preventDefault();const N=j.clipboardData.getData("text").trim();l(N),h.current&&clearTimeout(h.current),v(N)},[l,v]);return b.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]),b.useEffect(()=>{n&&v(n)},[]),f.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center rounded border border-c4a-border-subtle bg-c4a-bg-surface px-6 py-10",children:f.jsxs("div",{className:"w-full max-w-xl space-y-5",children:[f.jsx("input",{type:"text",value:n,onChange:y,onPaste:_,placeholder:o("sources.import_remote.url_placeholder"),className:"w-full rounded-md border border-c4a-border-default bg-c4a-bg-surface px-4 py-3 text-center font-mono text-base font-semibold text-c4a-accent placeholder:font-normal placeholder:text-c4a-text-muted focus:border-c4a-accent focus:outline-none",autoFocus:!0}),f.jsx("div",{className:"h-14 text-center text-sm leading-relaxed text-c4a-text-muted",children:u?f.jsxs("p",{className:"flex items-center justify-center gap-1.5 text-red-400",children:[f.jsx(Ul,{size:14,className:"shrink-0"}),u]}):f.jsxs(f.Fragment,{children:[f.jsx("p",{children:p.length>0?f.jsxs(f.Fragment,{children:[o("sources.import_remote.url_hint_public"),p.map((j,N)=>f.jsxs("span",{children:[N>0&&"、",f.jsx("span",{className:"font-mono font-medium text-c4a-accent",children:j})]},j))]}):o("sources.import_remote.url_hint_no_auth")}),f.jsx("p",{className:"mt-1 text-c4a-text-muted/60",children:o("sources.import_remote.url_hint_format")})]})})]})})}const Gg=["prepare","clone","scan","save"],uo={prepare:"sources.import.stage.prepare",clone:"sources.import.stage.clone",scan:"sources.import.stage.scan",save:"sources.import.stage.save"},F_={prepare:15,clone:80,scan:95,save:100};function J_(n,l,s){if(n instanceof Dl){const i=n.message.toLowerCase();if(n.status===503)return s("sources.import_remote.error.capacity");if(i.includes("connect")||i.includes("connectionrefused")||i.includes("unavailable")||i.includes("econnrefused"))return s("sources.import_remote.error.network");if(i.includes("authentication")||i.includes("token")||i.includes("credential")||i.includes("401")||i.includes("403"))try{const o=new URL(l).hostname;return s("sources.import_remote.error.auth_required",{host:o})}catch{return s("sources.import_remote.error.auth_required",{host:l})}return i.includes("not found")||i.includes("404")||i.includes("does not exist")?s("sources.import_remote.error.not_found"):n.message||s("sources.import_remote.error.network")}return n instanceof TypeError&&n.message.includes("fetch")?s("sources.import_remote.error.network"):n instanceof Error?n.message:s("sources.import_remote.error.network")}function P_(n){return n==="cloning"?"clone":n==="detecting"||n==="extracting"?"scan":n==="saving"?"save":n}function I_(){const{t:n}=Te(),l=kn(),{libId:s}=Vs(),[i]=wo(),o=i.get("url")||"",u=i.get("ref")||"",m=i.get("sourceUuid")||"",p=i.get("parentId")||"",g=i.get("parentName")||"",h=i.get("parentPath")||"",y=It(Hl(kr)).find(Ce=>Ce.id===s),[_,j]=b.useState(new Set),N=b.useCallback(async()=>{if(s)try{const Ce=new Set;if(p){const Ie=(await _t.get(`/sources/${p}`)).tree??[];let K=h===""?Ie:[];if(h){const se=(De,$e)=>{for(const Ue of De){if(Ue.path===$e)return Ue.children??[];if(Ue.children){const kt=se(Ue.children,$e);if(kt.length>0)return kt}}return[]};K=se(Ie,h)}for(const se of K)Ce.add(se.name.toLowerCase())}else{const Ae=await _t.get("/sources",{library_id:s});for(const Ie of Ae.items)Ce.add(Ie.name.toLowerCase())}j(Ce)}catch{}},[s,p,h]);b.useEffect(()=>{N()},[N]);const[T,O]=b.useState(o?2:1),[G,Z]=b.useState(o),[$,V]=b.useState(!!o),[X,W]=b.useState(u),[F,E]=b.useState(""),[q,ee]=b.useState(!!u),[de,oe]=b.useState(""),re=b.useRef(void 0),ue=b.useRef(void 0),[ge,k]=b.useState(null),[P,fe]=b.useState(!1),[me,le]=b.useState(null),[w,B]=b.useState(!1),[te,ae]=b.useState(!1),[xe,ve]=b.useState(null),[ze,Pe]=b.useState(null),[Xe,Wt]=b.useState(null),[ma,Qe]=b.useState(null),[tt,dt]=b.useState([]),[$t,Gt]=b.useState(null),[ea,ta]=b.useState([]),Sa=b.useRef(null),_a=b.useRef(""),ka=b.useMemo(()=>Gg.map(Ce=>({key:Ce,label:uo[Ce]?n(uo[Ce]):Ce})),[n]),ra=b.useCallback(Ce=>{ta(Ae=>[...Ae,`[${Sd()}] ${Ce}`])},[]),sa=b.useRef(null),ht=b.useCallback(Ce=>{const Ae=sa.current;Ae&&Ae!==Ce&&(dt(Ie=>Ie.includes(Ae)?Ie:[...Ie,Ae]),ra(`${n(uo[Ae]??Ae)} ${n("sources.import.stage.done_suffix")}`)),ra(`${n(uo[Ce]??Ce)}...`),sa.current=Ce,Qe(Ce),Gt(null)},[ra,n]),ia=b.useCallback((Ce,Ae)=>{re.current=Ce,ue.current=Ae},[]),Se=b.useCallback(async Ce=>{if(s){fe(!0),le(null);try{const Ae=await _t.post("/import/remote/refs",{library_id:s,url:G},Ce?{signal:Ce}:void 0);k(Ae);const Ie=Ae.branches??[],K=Ae.tags??[],se=[...Ie,...K];se.length>0&&W(De=>{if(De)return De;const $e=re.current,Ue=ue.current;if($e){const ca=se.find(Aa=>Aa.name===$e);if(ca)return E(ca.commit),ca.name}Ue&&E(Ue);const oa=Ie.find(ca=>ca.name===Ae.default)??Ie[0];return oa?(Ue||E(oa.commit),oa.name):De})}catch(Ae){if(Ce?.aborted)return;le(J_(Ae,G,n))}finally{Ce?.aborted||fe(!1)}}},[s,G,n]);b.useEffect(()=>{if(T!==2||!s)return;const Ce=new AbortController;return Se(Ce.signal),()=>Ce.abort()},[T,s,Se]),b.useEffect(()=>w?an.on("task/progress",Ae=>{const Ie=Ae,K=P_(Ie.stage??"");K&&Gg.includes(K)&&(Gt({percent:Ie.percent??-1,label:Ie.detail??Ie.label??""}),Ie.detail&&ta(se=>[...se,`[${Sd()}] ${Ie.detail}`]))}):void 0,[w]);const ke=b.useCallback(async()=>{if(!s)return;const Ce=Date.now();B(!0),ae(!1),Pe(null),Wt(null),dt([]),sa.current=null,Qe(null),Gt(null),ta([]),O(3);try{ht("prepare"),await new Promise(oa=>setTimeout(oa,300)),ht("clone");const Ae=il(G),Ie=de||Ae,K=h?`${h}/${Ie}`:Ie,se=await _t.post("/import/remote/clone",{library_id:s,url:G,ref:X,...F?{commit:F}:{},repo_name:K});_a.current=se.commit_hash,ht("scan");const De=await _t.post("/import/remote/scan",{library_id:s,path:se.path,hash:se.commit_hash});ht("save");const $e=await _t.post("/import/remote/import",{library_id:s,url:G,ref:X,commit:se.commit_hash,repo_name:K,dir_name:Ie,repo_files:De.files,repo_file_contents:De.manifests,...m?{source_uuid:m}:{},...p?{parent_source_id:p,parent_path:h}:{}});dt(["prepare","clone","scan","save"]),sa.current=null,Qe(null),ra(`${n("sources.import.stage.save")} ${n("sources.import.stage.done_suffix")}`),ra(n("sources.import.stage.complete"));const{packages:Ue,mdFiles:kt}=Px(De.manifests,De.files,Ae);ve({packages:Ue,mdFiles:kt}),Sa.current=$e.id,await Ix(Ce),ae(!0),B(!1),O(4)}catch(Ae){const Ie=sa.current??"prepare";Wt(Ie),sa.current=null,Qe(null);let K;Ae instanceof Dl||Ae instanceof Error?K=Ae.message:K=String(Ae),ra(`ERROR: ${K}`),Pe(K),B(!1)}},[s,G,X,F,de,m,p,h,ht,ra]),Ze=b.useCallback(()=>{Wt(null),Pe(null),ke()},[ke]),pt=b.useCallback(()=>{if(s)if(p){const Ce=il(G),Ae=de||Ce,Ie=h?`${h}/${Ae}`:Ae;l(`/studio/sources/${s}?rootId=${p}&path=${encodeURIComponent(Ie)}`)}else Sa.current?l(`/studio/sources/${s}?rootId=${Sa.current}`):l(`/studio/sources/${s}`)},[s,l,p,h,de,G]),Nt=(de||il(G)).toLowerCase(),Xt=_.has(Nt),Ja=b.useMemo(()=>T===1?$:T===2?q&&!Xt:!1,[T,$,q,Xt]),Qt=b.useMemo(()=>{if(!y)return[];const Ce=[{label:y.id===ul?n("sources.library.default_cloud_name"):y.name,to:`/studio/sources/${y.id}`}];if(p&&(Ce.push({label:g||p,to:`/studio/sources/${y.id}?rootId=${p}`}),h)){const Ae=h.split("/").filter(Boolean);for(const[Ie,K]of Ae.entries()){const se=Ae.slice(0,Ie+1).join("/");Ce.push({label:K,to:`/studio/sources/${y.id}?rootId=${p}&path=${encodeURIComponent(se)}`})}}return Ce.push({label:n("sources.import_remote.title")}),Ce},[y,p,g,h,n]);if(!y)return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})});const Tt=T===4&&te,gt=T===3&&!!Xe&&!w,Mt=T<=2;return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[f.jsx("div",{className:"shrink-0",children:f.jsx(Ar,{segments:Qt})}),f.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[f.jsx(fn,{active:T>=1,current:T===1}),f.jsx("span",{className:T===1?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.select")}),f.jsx(Ml,{}),f.jsx(fn,{active:T>=2,current:T===2}),f.jsx("span",{className:T===2?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.version")}),f.jsx(Ml,{}),f.jsx(fn,{active:T>=3,current:T===3}),f.jsx("span",{className:T===3?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.loading")}),f.jsx(Ml,{}),f.jsx(fn,{active:T>=4,current:T===4}),f.jsx("span",{className:T===4?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.confirm")})]}),f.jsxs("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:[T===1&&f.jsx(Z_,{url:G,onUrlChange:Z,onValidChange:V,onRefHint:ia}),T===2&&s&&f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[f.jsx(ay,{refs:ge,loading:P,error:me,selectedRef:X,commit:F,onRefChange:W,onCommitChange:E,onValidChange:ee,onRetry:()=>Se()}),!P&&ge&&f.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:n("sources.import.dir_name")}),f.jsx("input",{type:"text",value:de,onChange:Ce=>oe(Ce.target.value),placeholder:il(G),className:`mt-2 w-full rounded border bg-c4a-bg-surface px-3 py-2 font-mono text-sm text-c4a-accent placeholder:text-c4a-text-muted focus:outline-none ${Xt?"border-red-400 focus:border-red-400":"border-c4a-border-default focus:border-c4a-accent"}`}),Xt?f.jsx("p",{className:"mt-1.5 text-xs text-red-400",children:n("sources.import.dir_name_duplicate")}):f.jsx("p",{className:"mt-1.5 text-xs text-c4a-text-muted",children:n("sources.import.dir_name_hint")})]})]}),T===3&&f.jsx(ny,{stages:ka,currentStage:ma,completedStages:tt,failedStage:Xe,progress:$t,breakpoints:F_,failedError:ze,logs:ea}),T===4&&f.jsx(ly,{repoName:il(G),repoIdentifier:G,branch:X,commit:_a.current,packages:xe?.packages??[],mdFiles:xe?.mdFiles??[],importing:!1,completed:te})]}),Tt?f.jsx("div",{className:"mt-3 flex shrink-0 justify-end sm:mt-6",children:f.jsx("button",{onClick:pt,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("sources.import.done")})}):gt?f.jsxs("div",{className:"mt-3 flex shrink-0 justify-end gap-2 sm:mt-6",children:[f.jsx("button",{onClick:()=>{O(2),Wt(null),Pe(null),dt([]),sa.current=null,Qe(null),ta([])},className:"rounded border border-c4a-border-default px-4 py-2 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:n("sources.import.back")}),f.jsx("button",{onClick:Ze,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("sources.import.retry")})]}):Mt?f.jsx(Dd,{step:T,totalSteps:2,importing:!1,stepBusy:P,canProceed:Ja,safetyNoticeKey:"sources.safety.notice.remote",confirmLabelKey:"common.next",onPrev:()=>O(Ce=>Ce-1),onNext:()=>O(Ce=>Ce+1),onImport:ke}):null]})}function W_(){const{t:n}=Te(),l=kn(),s=It(_=>_.createLibrary),[i,o]=b.useState("waiting"),[u,m]=b.useState(null),[p,g]=b.useState(""),[h,v]=b.useState(!1);b.useEffect(()=>an.on("ws:daemon:connected",j=>{const N=j;m(N),g(N.machine_id),o(N.needs_registration?"new_client":"reconnected")}),[]),b.useEffect(()=>{let _=!1;return(async()=>{try{const j=await _t.get("/daemons/pending");if(_||j.pending.length===0)return;const N=j.pending[0];m({machine_id:N.machine_id,needs_registration:!0}),g(N.machine_id),o("new_client")}catch{}})(),()=>{_=!0}},[]);const y=b.useCallback(async()=>{if(u){v(!0);try{const _=await s({type:"daemon",name:p||u.machine_id,config:{machine_id:u.machine_id,os:u.os||"",daemon_version:u.daemon_version||""}});l(`/studio/sources/${_.id}`)}catch{v(!1)}}},[u,p,s,l]);return f.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[f.jsx(Ar,{segments:[{label:n("sources.add_client.title")}]}),f.jsx("p",{className:"mt-4 text-sm text-c4a-text-secondary",children:n("sources.add_client.description")}),f.jsx("div",{className:"mt-6 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-5",children:f.jsxs("ol",{className:"space-y-4 text-sm text-c4a-text-secondary",children:[f.jsxs("li",{children:[f.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["1. ",n("sources.add_client.step1")]}),f.jsxs("pre",{className:"mt-1 flex items-center gap-1.5 rounded bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-accent",children:["npm install -g @c4a/daemon ",f.jsx(ld,{text:"npm install -g @c4a/daemon"})]})]}),f.jsxs("li",{children:[f.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["2. ",n("sources.add_client.step2")]}),f.jsxs("pre",{className:"mt-1 flex items-center gap-1.5 rounded bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-accent",children:[`c4a-daemon --server ${window.location.host}`," ",f.jsx(ld,{text:`c4a-daemon --server ${window.location.host}`})]}),f.jsx("p",{className:"mt-2 text-xs text-c4a-text-muted",children:n("sources.add_client.step2_allow")}),f.jsxs("pre",{className:"mt-1 flex items-center gap-1.5 rounded bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-accent",children:[`c4a-daemon --server ${window.location.host} --allow ~/dir1,~/dir2`," ",f.jsx(ld,{text:`c4a-daemon --server ${window.location.host} --allow ~/dir1,~/dir2`})]})]}),f.jsxs("li",{children:[f.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["3. ",n("sources.add_client.step3")]}),f.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:n("sources.add_client.step3_desc")})]})]})}),f.jsxs("div",{className:"mt-6 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-5",children:[i==="waiting"&&f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(Da,{size:16,className:"animate-spin text-c4a-warning"}),f.jsx("span",{className:"text-sm text-c4a-warning",children:n("sources.add_client.waiting")})]}),i==="new_client"&&u&&f.jsxs("div",{className:"space-y-4",children:[f.jsx("h3",{className:"font-mono text-sm font-bold text-c4a-accent",children:n("sources.add_client.detected")}),f.jsxs("div",{className:"space-y-2 text-sm",children:[f.jsx(rd,{label:n("sources.add_client.machine_name"),value:u.machine_id}),u.os&&f.jsx(rd,{label:n("sources.add_client.os"),value:u.os}),u.daemon_version&&f.jsx(rd,{label:n("sources.add_client.daemon_version"),value:u.daemon_version})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"w-32 font-mono text-xs text-c4a-text-muted",children:n("sources.add_client.client_name")}),f.jsx("input",{value:p,onChange:_=>g(_.target.value),className:"min-w-0 flex-1 rounded border border-c4a-border-default bg-c4a-bg-base px-2 py-1 font-mono text-xs text-c4a-text-primary outline-none focus:border-c4a-accent"})]}),f.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[f.jsx("button",{onClick:()=>l("/studio/sources"),className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:n("common.cancel")}),f.jsxs("button",{onClick:y,disabled:h||!p.trim(),className:"flex items-center gap-1.5 rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-50",children:[h&&f.jsx(Da,{size:12,className:"animate-spin"}),n("sources.add_client.confirm")]})]})]}),i==="reconnected"&&u&&f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Al,{size:16,className:"text-c4a-success"}),f.jsx("span",{className:"text-sm text-c4a-text-primary",children:n("sources.add_client.reconnected",{name:u.machine_id})})]}),u.lib_id&&f.jsx(va,{to:`/studio/sources/${u.lib_id}`,className:"inline-block rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("sources.add_client.go_to",{name:u.machine_id})})]})]})]})}function ld({text:n}){const[l,s]=b.useState(!1),i=b.useCallback(()=>{navigator.clipboard.writeText(n).then(()=>{s(!0),setTimeout(()=>s(!1),1500)})},[n]);return f.jsx("button",{type:"button",onClick:i,className:"shrink-0 rounded p-0.5 text-c4a-accent opacity-60 transition-opacity hover:opacity-100",title:"Copy",children:l?f.jsx(Al,{size:13}):f.jsx(hd,{size:13})})}function rd({label:n,value:l}){return f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"w-32 font-mono text-xs text-c4a-text-muted",children:n}),f.jsx("span",{className:"font-mono text-xs text-c4a-text-primary",children:l})]})}function ej(){const{t:n}=Te(),{sourceUuid:l}=Vs(),[s]=wo(),i=s.get("path")||"",{currentRoot:o,loading:u,fetchRootSource:m}=To(),p=It(Hl(kr)),[g,h]=b.useState("original");b.useEffect(()=>{l&&m(l)},[l,m]);const v=b.useMemo(()=>o?i?Ro(o.tree,i):o.kind==="source"?{path:"",kind:o.kind,source_type:o.source_type,name:o.name,metadata:o.metadata,index_status:o.index_status}:null:null,[o,i]),y=p.find($=>$.id===o?.library_id),_=v?.metadata,j=_?Object.fromEntries(Object.entries(_).map(([$,V])=>[$,String(V??"")])):null,N=v?.source_type==="code",T=v?.name??o?.name??"",O=v?.source_type??null,G=b.useMemo(()=>{if(!o||!y)return[];const $=o.kind==="source"&&!i,V=[{label:y.id===ul?n("sources.library.default_cloud_name"):y.name,to:`/studio/sources/${y.id}`},{label:o.name,...$?{}:{to:`/studio/sources/${y.id}?rootId=${o.id}`}}];if(i){const X=Os(o.tree,i);for(let W=0;W<X.length-1;W++){const F=X[W];V.push({label:F.name,to:`/studio/sources/${y.id}?rootId=${o.id}&path=${encodeURIComponent(F.path)}`})}X.length>0&&V.push({label:X[X.length-1].name})}return V},[o,y,i,n]),Z=[{key:"original",label:n(N?"sources.detail.tab.overview":"sources.detail.tab.original")},{key:"digest",label:n("sources.detail.tab.digest")},{key:"modeling",label:n("sources.detail.tab.modeling")}];return u||!o||!v?f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})}):f.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[f.jsx(Ar,{segments:G}),f.jsxs("div",{className:"mt-4 flex flex-wrap items-baseline gap-x-6 gap-y-2",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[N?f.jsx(Or,{size:20,className:"shrink-0 text-c4a-accent"}):f.jsx(cl,{size:20,className:"shrink-0 text-c4a-accent"}),f.jsx("h1",{className:"min-w-0 break-all font-mono text-xl font-bold leading-none text-c4a-text-primary",children:T})]}),f.jsxs("div",{className:"flex flex-wrap items-baseline gap-4 text-xs text-c4a-text-muted",children:[f.jsxs("span",{children:[n("sources.detail.type"),":"," ",f.jsx("span",{className:"text-c4a-text-secondary",children:n(O==="code"?"sources.type.code":"sources.type.doc")})]}),N&&j?.relative_path&&f.jsxs("span",{children:[n("sources.detail.path"),":"," ",f.jsx("span",{className:"font-mono text-c4a-text-secondary",children:j.relative_path})]}),!N&&f.jsxs("span",{children:[n("sources.detail.origin"),":"," ",f.jsx("span",{className:"text-c4a-text-secondary",children:y?.type==="daemon"?n("sources.detail.origin.local"):n("sources.detail.origin.upload")})]}),f.jsxs("span",{children:[n("sources.detail.status"),":"," ",f.jsx("span",{className:"text-c4a-text-secondary",children:n(`sources.status.${v.index_status??"none"}`)})]})]})]}),N&&j&&f.jsx("div",{className:"mt-4 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:f.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2 text-xs md:grid-cols-4",children:[j.repo_name&&f.jsx(fo,{label:n("sources.detail.repo"),value:j.repo_name}),j.pinned_branch&&f.jsx(fo,{label:n("sources.detail.branch"),value:j.pinned_branch}),j.pinned_hash&&f.jsx(fo,{label:n("sources.detail.commit"),value:j.pinned_hash.slice(0,7)}),j.tech_stack&&f.jsx(fo,{label:n("sources.detail.tech_stack"),value:j.tech_stack})]})}),f.jsx("div",{className:"mt-3 flex border-b border-c4a-border-subtle",children:Z.map($=>f.jsx("button",{onClick:()=>h($.key),className:`border-b-2 px-4 py-2 font-mono text-xs uppercase transition-colors ${g===$.key?"border-c4a-accent text-c4a-accent":"border-transparent text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:$.label},$.key))}),f.jsxs("div",{className:"mt-4 flex-1",children:[g==="original"&&f.jsx(tj,{node:v,isCode:N}),g==="digest"&&f.jsx(Vg,{message:n("sources.detail.digest_placeholder")}),g==="modeling"&&f.jsx(Vg,{message:n("sources.detail.modeling_placeholder")})]})]})}function fo({label:n,value:l}){return f.jsxs("div",{children:[f.jsx("span",{className:"text-c4a-text-muted",children:n}),f.jsx("p",{className:"mt-0.5 font-mono text-c4a-text-primary",children:l})]})}function tj({node:n,isCode:l}){const{t:s}=Te(),i=n.metadata;return l?f.jsxs("div",{className:"space-y-4 text-sm text-c4a-text-secondary",children:[!!i?.description&&f.jsx("p",{children:String(i.description)}),!!i?.dependencies&&f.jsxs("div",{children:[f.jsx("h4",{className:"font-mono text-xs font-bold uppercase text-c4a-text-primary",children:s("sources.detail.dependencies")}),f.jsx("div",{className:"mt-2 rounded bg-c4a-bg-surface p-3 font-mono text-xs",children:Object.entries(i.dependencies).map(([o,u])=>f.jsxs("div",{className:"flex justify-between py-0.5",children:[f.jsx("span",{className:"text-c4a-text-primary",children:o}),f.jsx("span",{className:"text-c4a-text-muted",children:u})]},o))})]}),!i?.description&&!i?.dependencies&&f.jsx("p",{className:"text-c4a-text-muted",children:s("sources.detail.original_code_placeholder")})]}):f.jsx("div",{className:"prose prose-invert max-w-none text-sm text-c4a-text-secondary",children:f.jsx("p",{className:"text-c4a-text-muted",children:s("sources.detail.original_doc_placeholder")})})}function Vg({message:n}){return f.jsx("div",{className:"flex items-center justify-center rounded border border-dashed border-c4a-border-subtle p-12",children:f.jsx("p",{className:"text-center text-sm text-c4a-text-muted",children:n})})}const aj=q4([{element:f.jsx(U2,{}),errorElement:f.jsx(Lg,{}),children:[{path:"/",element:f.jsx(G2,{})},{path:"/login",element:f.jsx(V2,{})},{path:"/docs",element:f.jsx(K2,{})}]},{path:"/studio",element:f.jsx(Y2,{}),errorElement:f.jsx(Lg,{}),children:[{index:!0,element:f.jsx(_g,{to:"/studio/sources",replace:!0})},{path:"sources",element:f.jsx(_g,{to:`/studio/sources/${ul}`,replace:!0})},{path:"sources/add-client",element:f.jsx(W_,{})},{path:"sources/import/:libId",element:f.jsx(q_,{})},{path:"sources/import-dir/:libId",element:f.jsx(X_,{})},{path:"sources/import-remote/:libId",element:f.jsx(I_,{})},{path:"sources/:libId",element:f.jsx(E_,{})},{path:"source/:sourceUuid",element:f.jsx(ej,{})},{path:"modeling",element:f.jsx(Q2,{})},{path:"modeling/code/setup",element:f.jsx(W2,{})},{path:"modeling/code/compile",element:f.jsx(e_,{})},{path:"modeling/code/review",element:f.jsx(t_,{})},{path:"modeling/code/result",element:f.jsx(a_,{})},{path:"brain",element:f.jsx(Z2,{})},{path:"discovery",element:f.jsx(F2,{})},{path:"sharing",element:f.jsx(J2,{})},{path:"collaboration",element:f.jsx(P2,{})},{path:"settings",element:f.jsx(I2,{})}]},{path:"*",element:f.jsx(X2,{})}]);function nj(){return b.useEffect(()=>{const l=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;return an.connect(l),()=>{an.disconnect()}},[]),f.jsx(m4,{router:aj})}Rv.createRoot(document.getElementById("root")).render(f.jsx(b.StrictMode,{children:f.jsx(nj,{})}));