@c4a/server-cli 0.4.12-alpha.3 → 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 (176) hide show
  1. package/index.js +4021 -1105
  2. package/package.json +2 -1
  3. package/serve.js +8449 -2018
  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-B1KeXpYL.css +1 -0
  66. package/web/assets/index-B1zrTc3w.js +12 -0
  67. package/web/assets/index-B6uGMtfP.css +1 -0
  68. package/web/assets/index-BCzQnf3x.css +1 -0
  69. package/web/assets/index-BLskFmu3.js +193 -0
  70. package/web/assets/index-BMVKFQ7h.js +238 -0
  71. package/web/assets/index-BRwgHwhm.js +12 -0
  72. package/web/assets/index-BU6YkKWq.css +1 -0
  73. package/web/assets/index-BXaK4HKi.js +12 -0
  74. package/web/assets/index-BaBWjAP7.css +1 -0
  75. package/web/assets/index-Be3yvSxB.js +12 -0
  76. package/web/assets/index-Bh0nrxkS.css +1 -0
  77. package/web/assets/index-BjM7CFih.js +12 -0
  78. package/web/assets/index-BoqItESG.js +13 -0
  79. package/web/assets/index-Bxkj7nBM.css +1 -0
  80. package/web/assets/index-ByCT34eF.css +1 -0
  81. package/web/assets/index-C1tbhKrB.css +1 -0
  82. package/web/assets/index-C6uqUNjs.js +238 -0
  83. package/web/assets/index-CU-x3HVJ.js +12 -0
  84. package/web/assets/index-CVcqJsfJ.js +12 -0
  85. package/web/assets/index-Cs1wjzzB.css +1 -0
  86. package/web/assets/index-D0FYwi5D.css +1 -0
  87. package/web/assets/index-D9pKIRoL.js +12 -0
  88. package/web/assets/index-DHMM5gmZ.js +12 -0
  89. package/web/assets/index-DMIK6qP9.js +12 -0
  90. package/web/assets/index-DW-afpe4.js +12 -0
  91. package/web/assets/index-DaUMALOp.css +1 -0
  92. package/web/assets/index-DfXQnmId.js +12 -0
  93. package/web/assets/index-DisDw0E0.css +1 -0
  94. package/web/assets/index-Dm-_KwmC.css +1 -0
  95. package/web/assets/index-DmRvWfJA.js +12 -0
  96. package/web/assets/index-Drfhm6bu.js +12 -0
  97. package/web/assets/index-DvnO8hAI.js +12 -0
  98. package/web/assets/index-JdgClnFG.css +1 -0
  99. package/web/assets/index-P648JtKx.js +12 -0
  100. package/web/assets/index-PGORoGGx.js +13 -0
  101. package/web/assets/index-ZtrM6iGG.js +12 -0
  102. package/web/assets/java-CylS5w8V.js +1 -0
  103. package/web/assets/javascript-wDzz0qaB.js +1 -0
  104. package/web/assets/jinja-f2NsQr07.js +1 -0
  105. package/web/assets/jison-wvAkD_A8.js +1 -0
  106. package/web/assets/json-Cp-IABpG.js +1 -0
  107. package/web/assets/json5-C9tS-k6U.js +1 -0
  108. package/web/assets/jsonc-Des-eS-w.js +1 -0
  109. package/web/assets/jsonl-DcaNXYhu.js +1 -0
  110. package/web/assets/jsx-g9-lgVsj.js +1 -0
  111. package/web/assets/julia-CxzCAyBv.js +1 -0
  112. package/web/assets/kanagawa-dragon-CkXjmgJE.js +1 -0
  113. package/web/assets/kanagawa-lotus-CfQXZHmo.js +1 -0
  114. package/web/assets/kanagawa-wave-DWedfzmr.js +1 -0
  115. package/web/assets/laserwave-DUszq2jm.js +1 -0
  116. package/web/assets/less-B1dDrJ26.js +1 -0
  117. package/web/assets/light-plus-B7mTdjB0.js +1 -0
  118. package/web/assets/markdown-Cvjx9yec.js +1 -0
  119. package/web/assets/marko-DjSrsDqO.js +1 -0
  120. package/web/assets/material-theme-D5KoaKCx.js +1 -0
  121. package/web/assets/material-theme-darker-BfHTSMKl.js +1 -0
  122. package/web/assets/material-theme-lighter-B0m2ddpp.js +1 -0
  123. package/web/assets/material-theme-ocean-CyktbL80.js +1 -0
  124. package/web/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
  125. package/web/assets/mdc-DTYItulj.js +1 -0
  126. package/web/assets/mdx-Cmh6b_Ma.js +1 -0
  127. package/web/assets/min-dark-CafNBF8u.js +1 -0
  128. package/web/assets/min-light-CTRr51gU.js +1 -0
  129. package/web/assets/monokai-D4h5O-jR.js +1 -0
  130. package/web/assets/night-owl-C39BiMTA.js +1 -0
  131. package/web/assets/night-owl-light-CMTm3GFP.js +1 -0
  132. package/web/assets/nord-Ddv68eIx.js +1 -0
  133. package/web/assets/one-dark-pro-DVMEJ2y_.js +1 -0
  134. package/web/assets/one-light-C3Wv6jpd.js +1 -0
  135. package/web/assets/php-R6g_5hLQ.js +1 -0
  136. package/web/assets/plastic-3e1v2bzS.js +1 -0
  137. package/web/assets/poimandres-CS3Unz2-.js +1 -0
  138. package/web/assets/postcss-CXtECtnM.js +1 -0
  139. package/web/assets/pug-DKIMFp6K.js +1 -0
  140. package/web/assets/python-B6aJPvgy.js +1 -0
  141. package/web/assets/r-Dspwwk_N.js +1 -0
  142. package/web/assets/red-bN70gL4F.js +1 -0
  143. package/web/assets/regexp-CDVJQ6XC.js +1 -0
  144. package/web/assets/rose-pine-dawn-DHQR4-dF.js +1 -0
  145. package/web/assets/rose-pine-moon-D4_iv3hh.js +1 -0
  146. package/web/assets/rose-pine-qdsjHGoJ.js +1 -0
  147. package/web/assets/sass-Cj5Yp3dK.js +1 -0
  148. package/web/assets/scss-D5BDwBP9.js +1 -0
  149. package/web/assets/shellscript-Yzrsuije.js +1 -0
  150. package/web/assets/slack-dark-BthQWCQV.js +1 -0
  151. package/web/assets/slack-ochin-DqwNpetd.js +1 -0
  152. package/web/assets/snazzy-light-Bw305WKR.js +1 -0
  153. package/web/assets/solarized-dark-DXbdFlpD.js +1 -0
  154. package/web/assets/solarized-light-L9t79GZl.js +1 -0
  155. package/web/assets/sql-BLtJtn59.js +1 -0
  156. package/web/assets/stylus-BEDo0Tqx.js +1 -0
  157. package/web/assets/svelte-Cy7k_4gC.js +1 -0
  158. package/web/assets/synthwave-84-CbfX1IO0.js +1 -0
  159. package/web/assets/tokyo-night-hegEt444.js +1 -0
  160. package/web/assets/ts-tags-DQrlYJgV.js +1 -0
  161. package/web/assets/tsx-COt5Ahok.js +1 -0
  162. package/web/assets/typescript-BPQ3VLAy.js +1 -0
  163. package/web/assets/vesper-DU1UobuO.js +1 -0
  164. package/web/assets/vitesse-black-Bkuqu6BP.js +1 -0
  165. package/web/assets/vitesse-dark-D0r3Knsf.js +1 -0
  166. package/web/assets/vitesse-light-CVO1_9PV.js +1 -0
  167. package/web/assets/vue-D2xRrEX4.js +1 -0
  168. package/web/assets/vue-html-AaS7Mt5G.js +1 -0
  169. package/web/assets/vue-vine-BoDAl6tE.js +1 -0
  170. package/web/assets/wasm-CG6Dc4jp.js +1 -0
  171. package/web/assets/wasm-MzD3tlZU.js +1 -0
  172. package/web/assets/wgsl-Dx-B1_4e.js +1 -0
  173. package/web/assets/wit-5i3qLPDT.js +1 -0
  174. package/web/assets/xml-sdJ4AIDG.js +1 -0
  175. package/web/assets/yaml-Buea-lGh.js +1 -0
  176. package/web/index.html +2 -2
@@ -0,0 +1,13 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ContentDetail-BlCJjlr2.js","assets/JsonTree-BRUca2ED.js","assets/EntityDetail-BBLfJ9LL.js","assets/ContentCard-D0mL7yOO.js","assets/RelationDetail-BoTv8wr4.js"])))=>i.map(i=>d[i]);
2
+ function kv(n,r){for(var s=0;s<r.length;s++){const i=r[s];if(typeof i!="string"&&!Array.isArray(i)){for(const o in i)if(o!=="default"&&!(o in n)){const d=Object.getOwnPropertyDescriptor(i,o);d&&Object.defineProperty(n,o,d.get?d:{enumerable:!0,get:()=>i[o]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const d of o)if(d.type==="childList")for(const m of d.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&i(m)}).observe(document,{childList:!0,subtree:!0});function s(o){const d={};return o.integrity&&(d.integrity=o.integrity),o.referrerPolicy&&(d.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?d.credentials="include":o.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function i(o){if(o.ep)return;o.ep=!0;const d=s(o);fetch(o.href,d)}})();function Ov(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Hu={exports:{}},js={};var Np;function zv(){if(Np)return js;Np=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function s(i,o,d){var m=null;if(d!==void 0&&(m=""+d),o.key!==void 0&&(m=""+o.key),"key"in o){d={};for(var p in o)p!=="key"&&(d[p]=o[p])}else d=o;return o=d.ref,{$$typeof:n,type:i,key:m,ref:o!==void 0?o:null,props:d}}return js.Fragment=r,js.jsx=s,js.jsxs=s,js}var wp;function Dv(){return wp||(wp=1,Hu.exports=zv()),Hu.exports}var u=Dv();const De=n=>typeof n=="string",Ns=()=>{let n,r;const s=new Promise((i,o)=>{n=i,r=o});return s.resolve=n,s.reject=r,s},Ep=n=>n==null?"":""+n,Av=(n,r,s)=>{n.forEach(i=>{r[i]&&(s[i]=r[i])})},Mv=/###/g,Cp=n=>n&&n.indexOf("###")>-1?n.replace(Mv,"."):n,Rp=n=>!n||De(n),Ds=(n,r,s)=>{const i=De(r)?r.split("."):r;let o=0;for(;o<i.length-1;){if(Rp(n))return{};const d=Cp(i[o]);!n[d]&&s&&(n[d]=new s),Object.prototype.hasOwnProperty.call(n,d)?n=n[d]:n={},++o}return Rp(n)?{}:{obj:n,k:Cp(i[o])}},Tp=(n,r,s)=>{const{obj:i,k:o}=Ds(n,r,Object);if(i!==void 0||r.length===1){i[o]=s;return}let d=r[r.length-1],m=r.slice(0,r.length-1),p=Ds(n,m,Object);for(;p.obj===void 0&&m.length;)d=`${m[m.length-1]}.${d}`,m=m.slice(0,m.length-1),p=Ds(n,m,Object),p?.obj&&typeof p.obj[`${p.k}.${d}`]<"u"&&(p.obj=void 0);p.obj[`${p.k}.${d}`]=s},Lv=(n,r,s,i)=>{const{obj:o,k:d}=Ds(n,r,Object);o[d]=o[d]||[],o[d].push(s)},bo=(n,r)=>{const{obj:s,k:i}=Ds(n,r);if(s&&Object.prototype.hasOwnProperty.call(s,i))return s[i]},Uv=(n,r,s)=>{const i=bo(n,s);return i!==void 0?i:bo(r,s)},rx=(n,r,s)=>{for(const i in r)i!=="__proto__"&&i!=="constructor"&&(i in n?De(n[i])||n[i]instanceof String||De(r[i])||r[i]instanceof String?s&&(n[i]=r[i]):rx(n[i],r[i],s):n[i]=r[i]);return n},Or=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Hv={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Bv=n=>De(n)?n.replace(/[&<>"'\/]/g,r=>Hv[r]):n;class $v{constructor(r){this.capacity=r,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(r){const s=this.regExpMap.get(r);if(s!==void 0)return s;const i=new RegExp(r);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(r,i),this.regExpQueue.push(r),i}}const qv=[" ",",","?","!",";"],Yv=new $v(20),Gv=(n,r,s)=>{r=r||"",s=s||"";const i=qv.filter(m=>r.indexOf(m)<0&&s.indexOf(m)<0);if(i.length===0)return!0;const o=Yv.getRegExp(`(${i.map(m=>m==="?"?"\\?":m).join("|")})`);let d=!o.test(n);if(!d){const m=n.indexOf(s);m>0&&!o.test(n.substring(0,m))&&(d=!0)}return d},od=(n,r,s=".")=>{if(!n)return;if(n[r])return Object.prototype.hasOwnProperty.call(n,r)?n[r]:void 0;const i=r.split(s);let o=n;for(let d=0;d<i.length;){if(!o||typeof o!="object")return;let m,p="";for(let g=d;g<i.length;++g)if(g!==d&&(p+=s),p+=i[g],m=o[p],m!==void 0){if(["string","number","boolean"].indexOf(typeof m)>-1&&g<i.length-1)continue;d+=g-d+1;break}o=m}return o},Us=n=>n?.replace("_","-"),Vv={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,r){console?.[n]?.apply?.(console,r)}};class vo{constructor(r,s={}){this.init(r,s)}init(r,s={}){this.prefix=s.prefix||"i18next:",this.logger=r||Vv,this.options=s,this.debug=s.debug}log(...r){return this.forward(r,"log","",!0)}warn(...r){return this.forward(r,"warn","",!0)}error(...r){return this.forward(r,"error","")}deprecate(...r){return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}forward(r,s,i,o){return o&&!this.debug?null:(De(r[0])&&(r[0]=`${i}${this.prefix} ${r[0]}`),this.logger[s](r))}create(r){return new vo(this.logger,{prefix:`${this.prefix}:${r}:`,...this.options})}clone(r){return r=r||this.options,r.prefix=r.prefix||this.prefix,new vo(this.logger,r)}}var mn=new vo;class jo{constructor(){this.observers={}}on(r,s){return r.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(r,s){if(this.observers[r]){if(!s){delete this.observers[r];return}this.observers[r].delete(s)}}emit(r,...s){this.observers[r]&&Array.from(this.observers[r].entries()).forEach(([o,d])=>{for(let m=0;m<d;m++)o(...s)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([o,d])=>{for(let m=0;m<d;m++)o.apply(o,[r,...s])})}}class kp extends jo{constructor(r,s={ns:["translation"],defaultNS:"translation"}){super(),this.data=r||{},this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(r){this.options.ns.indexOf(r)<0&&this.options.ns.push(r)}removeNamespaces(r){const s=this.options.ns.indexOf(r);s>-1&&this.options.ns.splice(s,1)}getResource(r,s,i,o={}){const d=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,m=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let p;r.indexOf(".")>-1?p=r.split("."):(p=[r,s],i&&(Array.isArray(i)?p.push(...i):De(i)&&d?p.push(...i.split(d)):p.push(i)));const g=bo(this.data,p);return!g&&!s&&!i&&r.indexOf(".")>-1&&(r=p[0],s=p[1],i=p.slice(2).join(".")),g||!m||!De(i)?g:od(this.data?.[r]?.[s],i,d)}addResource(r,s,i,o,d={silent:!1}){const m=d.keySeparator!==void 0?d.keySeparator:this.options.keySeparator;let p=[r,s];i&&(p=p.concat(m?i.split(m):i)),r.indexOf(".")>-1&&(p=r.split("."),o=s,s=p[1]),this.addNamespaces(s),Tp(this.data,p,o),d.silent||this.emit("added",r,s,i,o)}addResources(r,s,i,o={silent:!1}){for(const d in i)(De(i[d])||Array.isArray(i[d]))&&this.addResource(r,s,d,i[d],{silent:!0});o.silent||this.emit("added",r,s,i)}addResourceBundle(r,s,i,o,d,m={silent:!1,skipCopy:!1}){let p=[r,s];r.indexOf(".")>-1&&(p=r.split("."),o=i,i=s,s=p[1]),this.addNamespaces(s);let g=bo(this.data,p)||{};m.skipCopy||(i=JSON.parse(JSON.stringify(i))),o?rx(g,i,d):g={...g,...i},Tp(this.data,p,g),m.silent||this.emit("added",r,s,i)}removeResourceBundle(r,s){this.hasResourceBundle(r,s)&&delete this.data[r][s],this.removeNamespaces(s),this.emit("removed",r,s)}hasResourceBundle(r,s){return this.getResource(r,s)!==void 0}getResourceBundle(r,s){return s||(s=this.options.defaultNS),this.getResource(r,s)}getDataByLanguage(r){return this.data[r]}hasLanguageSomeTranslations(r){const s=this.getDataByLanguage(r);return!!(s&&Object.keys(s)||[]).find(o=>s[o]&&Object.keys(s[o]).length>0)}toJSON(){return this.data}}var lx={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,r,s,i,o){return n.forEach(d=>{r=this.processors[d]?.process(r,s,i,o)??r}),r}};const sx=Symbol("i18next/PATH_KEY");function Kv(){const n=[],r=Object.create(null);let s;return r.get=(i,o)=>(s?.revoke?.(),o===sx?n:(n.push(o),s=Proxy.revocable(i,r),s.proxy)),Proxy.revocable(Object.create(null),r).proxy}function cd(n,r){const{[sx]:s}=n(Kv());return s.join(r?.keySeparator??".")}const Op={},Bu=n=>!De(n)&&typeof n!="boolean"&&typeof n!="number";class _o extends jo{constructor(r,s={}){super(),Av(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,this),this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=mn.create("translator")}changeLanguage(r){r&&(this.language=r)}exists(r,s={interpolation:{}}){const i={...s};if(r==null)return!1;const o=this.resolve(r,i);if(o?.res===void 0)return!1;const d=Bu(o.res);return!(i.returnObjects===!1&&d)}extractFromKey(r,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 d=s.ns||this.options.defaultNS||[];const m=i&&r.indexOf(i)>-1,p=!this.options.userDefinedKeySeparator&&!s.keySeparator&&!this.options.userDefinedNsSeparator&&!s.nsSeparator&&!Gv(r,i,o);if(m&&!p){const g=r.match(this.interpolator.nestingRegexp);if(g&&g.length>0)return{key:r,namespaces:De(d)?[d]:d};const h=r.split(i);(i!==o||i===o&&this.options.ns.indexOf(h[0])>-1)&&(d=h.shift()),r=h.join(o)}return{key:r,namespaces:De(d)?[d]:d}}translate(r,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={}),r==null)return"";typeof r=="function"&&(r=cd(r,{...this.options,...o})),Array.isArray(r)||(r=[String(r)]);const d=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(r[r.length-1],o),h=g[g.length-1];let v=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;v===void 0&&(v=":");const b=o.lng||this.language,S=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(b?.toLowerCase()==="cimode")return S?d?{res:`${h}${v}${p}`,usedKey:p,exactUsedKey:p,usedLng:b,usedNS:h,usedParams:this.getUsedParamsDetails(o)}:`${h}${v}${p}`:d?{res:p,usedKey:p,exactUsedKey:p,usedLng:b,usedNS:h,usedParams:this.getUsedParamsDetails(o)}:p;const j=this.resolve(r,o);let N=j?.res;const T=j?.usedKey||p,O=j?.exactUsedKey||p,q=["[object Number]","[object Function]","[object RegExp]"],X=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,G=!this.i18nFormat||this.i18nFormat.handleAsObject,M=o.count!==void 0&&!De(o.count),Q=_o.hasDefaultValue(o),te=M?this.pluralResolver.getSuffix(b,o.count,o):"",Z=o.ordinal&&M?this.pluralResolver.getSuffix(b,o.count,{ordinal:!1}):"",E=M&&!o.ordinal&&o.count===0,Y=E&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${te}`]||o[`defaultValue${Z}`]||o.defaultValue;let W=N;G&&!N&&Q&&(W=Y);const de=Bu(W),oe=Object.prototype.toString.apply(W);if(G&&W&&de&&q.indexOf(oe)<0&&!(De(X)&&Array.isArray(W))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const le=this.options.returnedObjectHandler?this.options.returnedObjectHandler(T,W,{...o,ns:g}):`key '${p} (${this.language})' returned an object instead of string.`;return d?(j.res=le,j.usedParams=this.getUsedParamsDetails(o),j):le}if(m){const le=Array.isArray(W),ue=le?[]:{},ge=le?O:T;for(const A in W)if(Object.prototype.hasOwnProperty.call(W,A)){const P=`${ge}${m}${A}`;Q&&!N?ue[A]=this.translate(P,{...o,defaultValue:Bu(Y)?Y[A]:void 0,joinArrays:!1,ns:g}):ue[A]=this.translate(P,{...o,joinArrays:!1,ns:g}),ue[A]===P&&(ue[A]=W[A])}N=ue}}else if(G&&De(X)&&Array.isArray(N))N=N.join(X),N&&(N=this.extendTranslation(N,r,o,i));else{let le=!1,ue=!1;!this.isValidLookup(N)&&Q&&(le=!0,N=Y),this.isValidLookup(N)||(ue=!0,N=p);const A=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ue?void 0:N,P=Q&&Y!==N&&this.options.updateMissing;if(ue||le||P){if(this.logger.log(P?"updateKey":"missingKey",b,h,p,P?Y: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 re=(w,$,ee)=>{const ae=Q&&ee!==N?ee:A;this.options.missingKeyHandler?this.options.missingKeyHandler(w,h,$,ae,P,o):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(w,h,$,ae,P,o),this.emit("missingKey",w,h,$,N)};this.options.saveMissing&&(this.options.saveMissingPlurals&&M?fe.forEach(w=>{const $=this.pluralResolver.getSuffixes(w,o);E&&o[`defaultValue${this.options.pluralSeparator}zero`]&&$.indexOf(`${this.options.pluralSeparator}zero`)<0&&$.push(`${this.options.pluralSeparator}zero`),$.forEach(ee=>{re([w],p+ee,o[`defaultValue${ee}`]||Y)})}):re(fe,p,Y))}N=this.extendTranslation(N,r,o,j,i),ue&&N===p&&this.options.appendNamespaceToMissingKey&&(N=`${h}${v}${p}`),(ue||le)&&this.options.parseMissingKeyHandler&&(N=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${v}${p}`:p,le?N:void 0,o))}return d?(j.res=N,j.usedParams=this.getUsedParamsDetails(o),j):N}extendTranslation(r,s,i,o,d){if(this.i18nFormat?.parse)r=this.i18nFormat.parse(r,{...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=De(r)&&(i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(g){const b=r.match(this.interpolator.nestingRegexp);h=b&&b.length}let v=i.replace&&!De(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(v={...this.options.interpolation.defaultVariables,...v}),r=this.interpolator.interpolate(r,v,i.lng||this.language||o.usedLng,i),g){const b=r.match(this.interpolator.nestingRegexp),S=b&&b.length;h<S&&(i.nest=!1)}!i.lng&&o&&o.res&&(i.lng=this.language||o.usedLng),i.nest!==!1&&(r=this.interpolator.nest(r,(...b)=>d?.[0]===b[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${b[0]} in key: ${s[0]}`),null):this.translate(...b,s),i)),i.interpolation&&this.interpolator.reset()}const m=i.postProcess||this.options.postProcess,p=De(m)?[m]:m;return r!=null&&p?.length&&i.applyPostProcessor!==!1&&(r=lx.handle(p,r,s,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),r}resolve(r,s={}){let i,o,d,m,p;return De(r)&&(r=[r]),r.forEach(g=>{if(this.isValidLookup(i))return;const h=this.extractFromKey(g,s),v=h.key;o=v;let b=h.namespaces;this.options.fallbackNS&&(b=b.concat(this.options.fallbackNS));const S=s.count!==void 0&&!De(s.count),j=S&&!s.ordinal&&s.count===0,N=s.context!==void 0&&(De(s.context)||typeof s.context=="number")&&s.context!=="",T=s.lngs?s.lngs:this.languageUtils.toResolveHierarchy(s.lng||this.language,s.fallbackLng);b.forEach(O=>{this.isValidLookup(i)||(p=O,!Op[`${T[0]}-${O}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(p)&&(Op[`${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(q=>{if(this.isValidLookup(i))return;m=q;const X=[v];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(X,v,q,O,s);else{let M;S&&(M=this.pluralResolver.getSuffix(q,s.count,s));const Q=`${this.options.pluralSeparator}zero`,te=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(S&&(s.ordinal&&M.indexOf(te)===0&&X.push(v+M.replace(te,this.options.pluralSeparator)),X.push(v+M),j&&X.push(v+Q)),N){const Z=`${v}${this.options.contextSeparator||"_"}${s.context}`;X.push(Z),S&&(s.ordinal&&M.indexOf(te)===0&&X.push(Z+M.replace(te,this.options.pluralSeparator)),X.push(Z+M),j&&X.push(Z+Q))}}let G;for(;G=X.pop();)this.isValidLookup(i)||(d=G,i=this.getResource(q,O,G,s))}))})}),{res:i,usedKey:o,exactUsedKey:d,usedLng:m,usedNS:p}}isValidLookup(r){return r!==void 0&&!(!this.options.returnNull&&r===null)&&!(!this.options.returnEmptyString&&r==="")}getResource(r,s,i,o={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(r,s,i,o):this.resourceStore.getResource(r,s,i,o)}getUsedParamsDetails(r={}){const s=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=r.replace&&!De(r.replace);let o=i?r.replace:r;if(i&&typeof r.count<"u"&&(o.count=r.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!i){o={...o};for(const d of s)delete o[d]}return o}static hasDefaultValue(r){const s="defaultValue";for(const i in r)if(Object.prototype.hasOwnProperty.call(r,i)&&s===i.substring(0,s.length)&&r[i]!==void 0)return!0;return!1}}class zp{constructor(r){this.options=r,this.supportedLngs=this.options.supportedLngs||!1,this.logger=mn.create("languageUtils")}getScriptPartFromCode(r){if(r=Us(r),!r||r.indexOf("-")<0)return null;const s=r.split("-");return s.length===2||(s.pop(),s[s.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(s.join("-"))}getLanguagePartFromCode(r){if(r=Us(r),!r||r.indexOf("-")<0)return r;const s=r.split("-");return this.formatLanguageCode(s[0])}formatLanguageCode(r){if(De(r)&&r.indexOf("-")>-1){let s;try{s=Intl.getCanonicalLocales(r)[0]}catch{}return s&&this.options.lowerCaseLng&&(s=s.toLowerCase()),s||(this.options.lowerCaseLng?r.toLowerCase():r)}return this.options.cleanCode||this.options.lowerCaseLng?r.toLowerCase():r}isSupportedCode(r){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(r=this.getLanguagePartFromCode(r)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(r)>-1}getBestMatchFromCodes(r){if(!r)return null;let s;return r.forEach(i=>{if(s)return;const o=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(o))&&(s=o)}),!s&&this.options.supportedLngs&&r.forEach(i=>{if(s)return;const o=this.getScriptPartFromCode(i);if(this.isSupportedCode(o))return s=o;const d=this.getLanguagePartFromCode(i);if(this.isSupportedCode(d))return s=d;s=this.options.supportedLngs.find(m=>{if(m===d)return m;if(!(m.indexOf("-")<0&&d.indexOf("-")<0)&&(m.indexOf("-")>0&&d.indexOf("-")<0&&m.substring(0,m.indexOf("-"))===d||m.indexOf(d)===0&&d.length>1))return m})}),s||(s=this.getFallbackCodes(this.options.fallbackLng)[0]),s}getFallbackCodes(r,s){if(!r)return[];if(typeof r=="function"&&(r=r(s)),De(r)&&(r=[r]),Array.isArray(r))return r;if(!s)return r.default||[];let i=r[s];return i||(i=r[this.getScriptPartFromCode(s)]),i||(i=r[this.formatLanguageCode(s)]),i||(i=r[this.getLanguagePartFromCode(s)]),i||(i=r.default),i||[]}toResolveHierarchy(r,s){const i=this.getFallbackCodes((s===!1?[]:s)||this.options.fallbackLng||[],r),o=[],d=m=>{m&&(this.isSupportedCode(m)?o.push(m):this.logger.warn(`rejecting language code not found in supportedLngs: ${m}`))};return De(r)&&(r.indexOf("-")>-1||r.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&d(this.formatLanguageCode(r)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&d(this.getScriptPartFromCode(r)),this.options.load!=="currentOnly"&&d(this.getLanguagePartFromCode(r))):De(r)&&d(this.formatLanguageCode(r)),i.forEach(m=>{o.indexOf(m)<0&&d(this.formatLanguageCode(m))}),o}}const Dp={zero:0,one:1,two:2,few:3,many:4,other:5},Ap={select:n=>n===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Xv{constructor(r,s={}){this.languageUtils=r,this.options=s,this.logger=mn.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(r,s={}){const i=Us(r==="dev"?"en":r),o=s.ordinal?"ordinal":"cardinal",d=JSON.stringify({cleanedCode:i,type:o});if(d in this.pluralRulesCache)return this.pluralRulesCache[d];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!"),Ap;if(!r.match(/-|_/))return Ap;const g=this.languageUtils.getLanguagePartFromCode(r);m=this.getRule(g,s)}return this.pluralRulesCache[d]=m,m}needsPlural(r,s={}){let i=this.getRule(r,s);return i||(i=this.getRule("dev",s)),i?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(r,s,i={}){return this.getSuffixes(r,i).map(o=>`${s}${o}`)}getSuffixes(r,s={}){let i=this.getRule(r,s);return i||(i=this.getRule("dev",s)),i?i.resolvedOptions().pluralCategories.sort((o,d)=>Dp[o]-Dp[d]).map(o=>`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(r,s,i={}){const o=this.getRule(r,i);return o?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${o.select(s)}`:(this.logger.warn(`no plural rule found for: ${r}`),this.getSuffix("dev",s,i))}}const Mp=(n,r,s,i=".",o=!0)=>{let d=Uv(n,r,s);return!d&&o&&De(s)&&(d=od(n,s,i),d===void 0&&(d=od(r,s,i))),d},$u=n=>n.replace(/\$/g,"$$$$");class Lp{constructor(r={}){this.logger=mn.create("interpolator"),this.options=r,this.format=r?.interpolation?.format||(s=>s),this.init(r)}init(r={}){r.interpolation||(r.interpolation={escapeValue:!0});const{escape:s,escapeValue:i,useRawValueToEscape:o,prefix:d,prefixEscaped:m,suffix:p,suffixEscaped:g,formatSeparator:h,unescapeSuffix:v,unescapePrefix:b,nestingPrefix:S,nestingPrefixEscaped:j,nestingSuffix:N,nestingSuffixEscaped:T,nestingOptionsSeparator:O,maxReplaces:q,alwaysFormat:X}=r.interpolation;this.escape=s!==void 0?s:Bv,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=d?Or(d):m||"{{",this.suffix=p?Or(p):g||"}}",this.formatSeparator=h||",",this.unescapePrefix=v?"":b||"-",this.unescapeSuffix=this.unescapePrefix?"":v||"",this.nestingPrefix=S?Or(S):j||Or("$t("),this.nestingSuffix=N?Or(N):T||Or(")"),this.nestingOptionsSeparator=O||",",this.maxReplaces=q||1e3,this.alwaysFormat=X!==void 0?X:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const r=(s,i)=>s?.source===i?(s.lastIndex=0,s):new RegExp(i,"g");this.regexp=r(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=r(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=r(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(r,s,i,o){let d,m,p;const g=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=j=>{if(j.indexOf(this.formatSeparator)<0){const q=Mp(s,g,j,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(q,void 0,i,{...o,...s,interpolationkey:j}):q}const N=j.split(this.formatSeparator),T=N.shift().trim(),O=N.join(this.formatSeparator).trim();return this.format(Mp(s,g,T,this.options.keySeparator,this.options.ignoreJSONStructure),O,i,{...o,...s,interpolationkey:T})};this.resetRegExp();const v=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,b=o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:j=>$u(j)},{regex:this.regexp,safeValue:j=>this.escapeValue?$u(this.escape(j)):$u(j)}].forEach(j=>{for(p=0;d=j.regex.exec(r);){const N=d[1].trim();if(m=h(N),m===void 0)if(typeof v=="function"){const O=v(r,d,o);m=De(O)?O:""}else if(o&&Object.prototype.hasOwnProperty.call(o,N))m="";else if(b){m=d[0];continue}else this.logger.warn(`missed to pass in variable ${N} for interpolating ${r}`),m="";else!De(m)&&!this.useRawValueToEscape&&(m=Ep(m));const T=j.safeValue(m);if(r=r.replace(d[0],T),b?(j.regex.lastIndex+=m.length,j.regex.lastIndex-=d[0].length):j.regex.lastIndex=0,p++,p>=this.maxReplaces)break}}),r}nest(r,s,i={}){let o,d,m;const p=(g,h)=>{const v=this.nestingOptionsSeparator;if(g.indexOf(v)<0)return g;const b=g.split(new RegExp(`${Or(v)}[ ]*{`));let S=`{${b[1]}`;g=b[0],S=this.interpolate(S,m);const j=S.match(/'/g),N=S.match(/"/g);((j?.length??0)%2===0&&!N||(N?.length??0)%2!==0)&&(S=S.replace(/'/g,'"'));try{m=JSON.parse(S),h&&(m={...h,...m})}catch(T){return this.logger.warn(`failed parsing options string in nesting for key ${g}`,T),`${g}${v}${S}`}return m.defaultValue&&m.defaultValue.indexOf(this.prefix)>-1&&delete m.defaultValue,g};for(;o=this.nestingRegexp.exec(r);){let g=[];m={...i},m=m.replace&&!De(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)),d=s(p.call(this,o[1].trim(),m),m),d&&o[0]===r&&!De(d))return d;De(d)||(d=Ep(d)),d||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${r}`),d=""),g.length&&(d=g.reduce((v,b)=>this.format(v,b,i.lng,{...i,interpolationkey:o[1].trim()}),d.trim())),r=r.replace(o[0],d),this.regexp.lastIndex=0}return r}}const Qv=n=>{let r=n.toLowerCase().trim();const s={};if(n.indexOf("(")>-1){const i=n.split("(");r=i[0].toLowerCase().trim();const o=i[1].substring(0,i[1].length-1);r==="currency"&&o.indexOf(":")<0?s.currency||(s.currency=o.trim()):r==="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:r,formatOptions:s}},Up=n=>{const r={};return(s,i,o)=>{let d=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(d={...d,[o.interpolationkey]:void 0});const m=i+JSON.stringify(d);let p=r[m];return p||(p=n(Us(i),o),r[m]=p),p(s)}},Fv=n=>(r,s,i)=>n(Us(s),i)(r);class Zv{constructor(r={}){this.logger=mn.create("formatter"),this.options=r,this.init(r)}init(r,s={interpolation:{}}){this.formatSeparator=s.interpolation.formatSeparator||",";const i=s.cacheInBuiltFormats?Up:Fv;this.formats={number:i((o,d)=>{const m=new Intl.NumberFormat(o,{...d});return p=>m.format(p)}),currency:i((o,d)=>{const m=new Intl.NumberFormat(o,{...d,style:"currency"});return p=>m.format(p)}),datetime:i((o,d)=>{const m=new Intl.DateTimeFormat(o,{...d});return p=>m.format(p)}),relativetime:i((o,d)=>{const m=new Intl.RelativeTimeFormat(o,{...d});return p=>m.format(p,d.range||"day")}),list:i((o,d)=>{const m=new Intl.ListFormat(o,{...d});return p=>m.format(p)})}}add(r,s){this.formats[r.toLowerCase().trim()]=s}addCached(r,s){this.formats[r.toLowerCase().trim()]=Up(s)}format(r,s,i,o={}){const d=s.split(this.formatSeparator);if(d.length>1&&d[0].indexOf("(")>1&&d[0].indexOf(")")<0&&d.find(p=>p.indexOf(")")>-1)){const p=d.findIndex(g=>g.indexOf(")")>-1);d[0]=[d[0],...d.splice(1,p)].join(this.formatSeparator)}return d.reduce((p,g)=>{const{formatName:h,formatOptions:v}=Qv(g);if(this.formats[h]){let b=p;try{const S=o?.formatParams?.[o.interpolationkey]||{},j=S.locale||S.lng||o.locale||o.lng||i;b=this.formats[h](p,j,{...v,...o,...S})}catch(S){this.logger.warn(S)}return b}else this.logger.warn(`there was no format function for ${h}`);return p},r)}}const Jv=(n,r)=>{n.pending[r]!==void 0&&(delete n.pending[r],n.pendingCount--)};class Pv extends jo{constructor(r,s,i,o={}){super(),this.backend=r,this.store=s,this.services=i,this.languageUtils=i.languageUtils,this.options=o,this.logger=mn.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(r,s,i,o){const d={},m={},p={},g={};return r.forEach(h=>{let v=!0;s.forEach(b=>{const S=`${h}|${b}`;!i.reload&&this.store.hasResourceBundle(h,b)?this.state[S]=2:this.state[S]<0||(this.state[S]===1?m[S]===void 0&&(m[S]=!0):(this.state[S]=1,v=!1,m[S]===void 0&&(m[S]=!0),d[S]===void 0&&(d[S]=!0),g[b]===void 0&&(g[b]=!0)))}),v||(p[h]=!0)}),(Object.keys(d).length||Object.keys(m).length)&&this.queue.push({pending:m,pendingCount:Object.keys(m).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(d),pending:Object.keys(m),toLoadLanguages:Object.keys(p),toLoadNamespaces:Object.keys(g)}}loaded(r,s,i){const o=r.split("|"),d=o[0],m=o[1];s&&this.emit("failedLoading",d,m,s),!s&&i&&this.store.addResourceBundle(d,m,i,void 0,void 0,{skipCopy:!0}),this.state[r]=s?-1:2,s&&i&&(this.state[r]=0);const p={};this.queue.forEach(g=>{Lv(g.loaded,[d],m),Jv(g,r),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(b=>{p[h][b]===void 0&&(p[h][b]=!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(r,s,i,o=0,d=this.retryTimeout,m){if(!r.length)return m(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:r,ns:s,fcName:i,tried:o,wait:d,callback:m});return}this.readingCalls++;const p=(h,v)=>{if(this.readingCalls--,this.waitingReads.length>0){const b=this.waitingReads.shift();this.read(b.lng,b.ns,b.fcName,b.tried,b.wait,b.callback)}if(h&&v&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,r,s,i,o+1,d*2,m)},d);return}m(h,v)},g=this.backend[i].bind(this.backend);if(g.length===2){try{const h=g(r,s);h&&typeof h.then=="function"?h.then(v=>p(null,v)).catch(p):p(null,h)}catch(h){p(h)}return}return g(r,s,p)}prepareLoading(r,s,i={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();De(r)&&(r=this.languageUtils.toResolveHierarchy(r)),De(s)&&(s=[s]);const d=this.queueLoad(r,s,i,o);if(!d.toLoad.length)return d.pending.length||o(),null;d.toLoad.forEach(m=>{this.loadOne(m)})}load(r,s,i){this.prepareLoading(r,s,{},i)}reload(r,s,i){this.prepareLoading(r,s,{reload:!0},i)}loadOne(r,s=""){const i=r.split("|"),o=i[0],d=i[1];this.read(o,d,"read",void 0,void 0,(m,p)=>{m&&this.logger.warn(`${s}loading namespace ${d} for language ${o} failed`,m),!m&&p&&this.logger.log(`${s}loaded namespace ${d} for language ${o}`,p),this.loaded(r,m,p)})}saveMissing(r,s,i,o,d,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:d},h=this.backend.create.bind(this.backend);if(h.length<6)try{let v;h.length===5?v=h(r,s,i,o,g):v=h(r,s,i,o),v&&typeof v.then=="function"?v.then(b=>p(null,b)).catch(p):p(null,v)}catch(v){p(v)}else h(r,s,i,o,p,g)}!r||!r[0]||this.store.addResource(r[0],s,i,o)}}}const qu=()=>({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 r={};if(typeof n[1]=="object"&&(r=n[1]),De(n[1])&&(r.defaultValue=n[1]),De(n[2])&&(r.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const s=n[3]||n[2];Object.keys(s).forEach(i=>{r[i]=s[i]})}return r},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Hp=n=>(De(n.ns)&&(n.ns=[n.ns]),De(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),De(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),so=()=>{},Iv=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(s=>{typeof n[s]=="function"&&(n[s]=n[s].bind(n))})},ix="__i18next_supportNoticeShown",Wv=()=>typeof globalThis<"u"&&!!globalThis[ix],e0=()=>{typeof globalThis<"u"&&(globalThis[ix]=!0)},t0=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(r=>r?.name?.indexOf("Locize")>0||r?.constructor?.name?.indexOf("Locize")>0)||n?.options?.backend?.projectId||n?.options?.backend?.backendOptions&&n.options.backend.backendOptions.some(r=>r?.projectId));class As extends jo{constructor(r={},s){if(super(),this.options=Hp(r),this.services={},this.logger=mn,this.modules={external:[]},Iv(this),s&&!this.isInitialized&&!r.isClone){if(!this.options.initAsync)return this.init(r,s),this;setTimeout(()=>{this.init(r,s)},0)}}init(r={},s){this.isInitializing=!0,typeof r=="function"&&(s=r,r={}),r.defaultNS==null&&r.ns&&(De(r.ns)?r.defaultNS=r.ns:r.ns.indexOf("translation")<0&&(r.defaultNS=r.ns[0]));const i=qu();this.options={...i,...this.options,...Hp(r)},this.options.interpolation={...i.interpolation,...this.options.interpolation},r.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=r.keySeparator),r.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=r.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!t0(this)&&!Wv()&&(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 💙"),e0());const o=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?mn.init(o(this.modules.logger),this.options):mn.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:h=Zv;const v=new zp(this.options);this.store=new kp(this.options.resources,this.options);const b=this.services;b.logger=mn,b.resourceStore=this.store,b.languageUtils=v,b.pluralResolver=new Xv(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)&&(b.formatter=o(h),b.formatter.init&&b.formatter.init(b,this.options),this.options.interpolation.format=b.formatter.format.bind(b.formatter)),b.interpolator=new Lp(this.options),b.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},b.backendConnector=new Pv(o(this.modules.backend),b.resourceStore,b,this.options),b.backendConnector.on("*",(j,...N)=>{this.emit(j,...N)}),this.modules.languageDetector&&(b.languageDetector=o(this.modules.languageDetector),b.languageDetector.init&&b.languageDetector.init(b,this.options.detection,this.options)),this.modules.i18nFormat&&(b.i18nFormat=o(this.modules.i18nFormat),b.i18nFormat.init&&b.i18nFormat.init(this)),this.translator=new _o(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=so),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,b)=>{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(b),s(v,b)};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(r,s=so){let i=s;const o=De(r)?r:this.language;if(typeof r=="function"&&(i=r),!this.options.resources||this.options.partialBundledLanguages){if(o?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const d=[],m=p=>{if(!p||p==="cimode")return;this.services.languageUtils.toResolveHierarchy(p).forEach(h=>{h!=="cimode"&&d.indexOf(h)<0&&d.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(d,this.options.ns,p=>{!p&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(p)})}else i(null)}reloadResources(r,s,i){const o=Ns();return typeof r=="function"&&(i=r,r=void 0),typeof s=="function"&&(i=s,s=void 0),r||(r=this.languages),s||(s=this.options.ns),i||(i=so),this.services.backendConnector.reload(r,s,d=>{o.resolve(),i(d)}),o}use(r){if(!r)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!r.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return r.type==="backend"&&(this.modules.backend=r),(r.type==="logger"||r.log&&r.warn&&r.error)&&(this.modules.logger=r),r.type==="languageDetector"&&(this.modules.languageDetector=r),r.type==="i18nFormat"&&(this.modules.i18nFormat=r),r.type==="postProcessor"&&lx.addPostProcessor(r),r.type==="formatter"&&(this.modules.formatter=r),r.type==="3rdParty"&&this.modules.external.push(r),this}setResolvedLanguage(r){if(!(!r||!this.languages)&&!(["cimode","dev"].indexOf(r)>-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(r)<0&&this.store.hasLanguageSomeTranslations(r)&&(this.resolvedLanguage=r,this.languages.unshift(r))}}changeLanguage(r,s){this.isLanguageChangingTo=r;const i=Ns();this.emit("languageChanging",r);const o=p=>{this.language=p,this.languages=this.services.languageUtils.toResolveHierarchy(p),this.resolvedLanguage=void 0,this.setResolvedLanguage(p)},d=(p,g)=>{g?this.isLanguageChangingTo===r&&(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=>{!r&&!p&&this.services.languageDetector&&(p=[]);const g=De(p)?p:p&&p[0],h=this.store.hasLanguageSomeTranslations(g)?g:this.services.languageUtils.getBestMatchFromCodes(De(p)?[p]:p);h&&(this.language||o(h),this.translator.language||this.translator.changeLanguage(h),this.services.languageDetector?.cacheUserLanguage?.(h)),this.loadResources(h,v=>{d(v,h)})};return!r&&this.services.languageDetector&&!this.services.languageDetector.async?m(this.services.languageDetector.detect()):!r&&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(r),i}getFixedT(r,s,i){const o=(d,m,...p)=>{let g;typeof m!="object"?g=this.options.overloadTranslationOptionHandler([d,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(d)?v=d.map(b=>(typeof b=="function"&&(b=cd(b,{...this.options,...m})),`${g.keyPrefix}${h}${b}`)):(typeof d=="function"&&(d=cd(d,{...this.options,...m})),v=g.keyPrefix?`${g.keyPrefix}${h}${d}`:d),this.t(v,g)};return De(r)?o.lng=r:o.lngs=r,o.ns=s,o.keyPrefix=i,o}t(...r){return this.translator?.translate(...r)}exists(...r){return this.translator?.exists(...r)}setDefaultNamespace(r){this.options.defaultNS=r}hasLoadedNamespace(r,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,d=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,r)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||m(i,r)&&(!o||m(d,r)))}loadNamespaces(r,s){const i=Ns();return this.options.ns?(De(r)&&(r=[r]),r.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(r,s){const i=Ns();De(r)&&(r=[r]);const o=this.options.preload||[],d=r.filter(m=>o.indexOf(m)<0&&this.services.languageUtils.isSupportedCode(m));return d.length?(this.options.preload=o.concat(d),this.loadResources(m=>{i.resolve(),s&&s(m)}),i):(s&&s(),Promise.resolve())}dir(r){if(r||(r=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!r)return"rtl";try{const o=new Intl.Locale(r);if(o&&o.getTextInfo){const d=o.getTextInfo();if(d&&d.direction)return d.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 zp(qu());return r.toLowerCase().indexOf("-latn")>1?"ltr":s.indexOf(i.getLanguagePartFromCode(r))>-1||r.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(r={},s){const i=new As(r,s);return i.createInstance=As.createInstance,i}cloneInstance(r={},s=so){const i=r.forkResourceStore;i&&delete r.forkResourceStore;const o={...this.options,...r,isClone:!0},d=new As(o);if((r.debug!==void 0||r.prefix!==void 0)&&(d.logger=d.logger.clone(r)),["store","services","language"].forEach(p=>{d[p]=this[p]}),d.services={...this.services},d.services.utils={hasLoadedNamespace:d.hasLoadedNamespace.bind(d)},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,b)=>(v[b]={...g[h][b]},v),g[h]),g),{});d.store=new kp(p,o),d.services.resourceStore=d.store}if(r.interpolation){const g={...qu().interpolation,...this.options.interpolation,...r.interpolation},h={...o,interpolation:g};d.services.interpolator=new Lp(h)}return d.translator=new _o(d.services,o),d.translator.on("*",(p,...g)=>{d.emit(p,...g)}),d.init(o,s),d.translator.options=o,d.translator.backendConnector.services.utils={hasLoadedNamespace:d.hasLoadedNamespace.bind(d)},d}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const fa=As.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 Yu={exports:{}},Me={};var Bp;function a0(){if(Bp)return Me;Bp=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),d=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"),b=Symbol.for("react.activity"),S=Symbol.iterator;function j(w){return w===null||typeof w!="object"?null:(w=S&&w[S]||w["@@iterator"],typeof w=="function"?w:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,O={};function q(w,$,ee){this.props=w,this.context=$,this.refs=O,this.updater=ee||N}q.prototype.isReactComponent={},q.prototype.setState=function(w,$){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,$,"setState")},q.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function X(){}X.prototype=q.prototype;function G(w,$,ee){this.props=w,this.context=$,this.refs=O,this.updater=ee||N}var M=G.prototype=new X;M.constructor=G,T(M,q.prototype),M.isPureReactComponent=!0;var Q=Array.isArray;function te(){}var Z={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function Y(w,$,ee){var ae=ee.ref;return{$$typeof:n,type:w,key:$,ref:ae!==void 0?ae:null,props:ee}}function W(w,$){return Y(w.type,$,w.props)}function de(w){return typeof w=="object"&&w!==null&&w.$$typeof===n}function oe(w){var $={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(ee){return $[ee]})}var le=/\/+/g;function ue(w,$){return typeof w=="object"&&w!==null&&w.key!=null?oe(""+w.key):$.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(te,te):(w.status="pending",w.then(function($){w.status==="pending"&&(w.status="fulfilled",w.value=$)},function($){w.status==="pending"&&(w.status="rejected",w.reason=$)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function A(w,$,ee,ae,xe){var ve=typeof w;(ve==="undefined"||ve==="boolean")&&(w=null);var ke=!1;if(w===null)ke=!0;else switch(ve){case"bigint":case"string":case"number":ke=!0;break;case"object":switch(w.$$typeof){case n:case r:ke=!0;break;case v:return ke=w._init,A(ke(w._payload),$,ee,ae,xe)}}if(ke)return xe=xe(w),ke=ae===""?"."+ue(w,0):ae,Q(xe)?(ee="",ke!=null&&(ee=ke.replace(le,"$&/")+"/"),A(xe,$,ee,"",function(Wt){return Wt})):xe!=null&&(de(xe)&&(xe=W(xe,ee+(xe.key==null||w&&w.key===xe.key?"":(""+xe.key).replace(le,"$&/")+"/")+ke)),$.push(xe)),1;ke=0;var Pe=ae===""?".":ae+":";if(Q(w))for(var Xe=0;Xe<w.length;Xe++)ae=w[Xe],ve=Pe+ue(ae,Xe),ke+=A(ae,$,ee,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++),ke+=A(ae,$,ee,ve,xe);else if(ve==="object"){if(typeof w.then=="function")return A(ge(w),$,ee,ae,xe);throw $=String(w),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return ke}function P(w,$,ee){if(w==null)return w;var ae=[],xe=0;return A(w,ae,"","",function(ve){return $.call(ee,ve,xe++)}),ae}function fe(w){if(w._status===-1){var $=w._result;$=$(),$.then(function(ee){(w._status===0||w._status===-1)&&(w._status=1,w._result=ee)},function(ee){(w._status===0||w._status===-1)&&(w._status=2,w._result=ee)}),w._status===-1&&(w._status=0,w._result=$)}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 $=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($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)},re={map:P,forEach:function(w,$,ee){P(w,function(){$.apply(this,arguments)},ee)},count:function(w){var $=0;return P(w,function(){$++}),$},toArray:function(w){return P(w,function($){return $})||[]},only:function(w){if(!de(w))throw Error("React.Children.only expected to receive a single React element child.");return w}};return Me.Activity=b,Me.Children=re,Me.Component=q,Me.Fragment=s,Me.Profiler=o,Me.PureComponent=G,Me.StrictMode=i,Me.Suspense=g,Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Z,Me.__COMPILER_RUNTIME={__proto__:null,c:function(w){return Z.H.useMemoCache(w)}},Me.cache=function(w){return function(){return w.apply(null,arguments)}},Me.cacheSignal=function(){return null},Me.cloneElement=function(w,$,ee){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($!=null)for(ve in $.key!==void 0&&(xe=""+$.key),$)!E.call($,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&$.ref===void 0||(ae[ve]=$[ve]);var ve=arguments.length-2;if(ve===1)ae.children=ee;else if(1<ve){for(var ke=Array(ve),Pe=0;Pe<ve;Pe++)ke[Pe]=arguments[Pe+2];ae.children=ke}return Y(w.type,xe,ae)},Me.createContext=function(w){return w={$$typeof:m,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:d,_context:w},w},Me.createElement=function(w,$,ee){var ae,xe={},ve=null;if($!=null)for(ae in $.key!==void 0&&(ve=""+$.key),$)E.call($,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(xe[ae]=$[ae]);var ke=arguments.length-2;if(ke===1)xe.children=ee;else if(1<ke){for(var Pe=Array(ke),Xe=0;Xe<ke;Xe++)Pe[Xe]=arguments[Xe+2];xe.children=Pe}if(w&&w.defaultProps)for(ae in ke=w.defaultProps,ke)xe[ae]===void 0&&(xe[ae]=ke[ae]);return Y(w,ve,xe)},Me.createRef=function(){return{current:null}},Me.forwardRef=function(w){return{$$typeof:p,render:w}},Me.isValidElement=de,Me.lazy=function(w){return{$$typeof:v,_payload:{_status:-1,_result:w},_init:fe}},Me.memo=function(w,$){return{$$typeof:h,type:w,compare:$===void 0?null:$}},Me.startTransition=function(w){var $=Z.T,ee={};Z.T=ee;try{var ae=w(),xe=Z.S;xe!==null&&xe(ee,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(te,me)}catch(ve){me(ve)}finally{$!==null&&ee.types!==null&&($.types=ee.types),Z.T=$}},Me.unstable_useCacheRefresh=function(){return Z.H.useCacheRefresh()},Me.use=function(w){return Z.H.use(w)},Me.useActionState=function(w,$,ee){return Z.H.useActionState(w,$,ee)},Me.useCallback=function(w,$){return Z.H.useCallback(w,$)},Me.useContext=function(w){return Z.H.useContext(w)},Me.useDebugValue=function(){},Me.useDeferredValue=function(w,$){return Z.H.useDeferredValue(w,$)},Me.useEffect=function(w,$){return Z.H.useEffect(w,$)},Me.useEffectEvent=function(w){return Z.H.useEffectEvent(w)},Me.useId=function(){return Z.H.useId()},Me.useImperativeHandle=function(w,$,ee){return Z.H.useImperativeHandle(w,$,ee)},Me.useInsertionEffect=function(w,$){return Z.H.useInsertionEffect(w,$)},Me.useLayoutEffect=function(w,$){return Z.H.useLayoutEffect(w,$)},Me.useMemo=function(w,$){return Z.H.useMemo(w,$)},Me.useOptimistic=function(w,$){return Z.H.useOptimistic(w,$)},Me.useReducer=function(w,$,ee){return Z.H.useReducer(w,$,ee)},Me.useRef=function(w){return Z.H.useRef(w)},Me.useState=function(w){return Z.H.useState(w)},Me.useSyncExternalStore=function(w,$,ee){return Z.H.useSyncExternalStore(w,$,ee)},Me.useTransition=function(){return Z.H.useTransition()},Me.version="19.2.4",Me}var $p;function No(){return $p||($p=1,Yu.exports=a0()),Yu.exports}var y=No();const Rl=Ov(y),n0=kv({__proto__:null,default:Rl},[y]),r0=(n,r,s,i)=>{const o=[s,{code:r,...i||{}}];if(n?.services?.logger?.forward)return n.services.logger.forward(o,"warn","react-i18next::",!0);Mr(o[0])&&(o[0]=`react-i18next:: ${o[0]}`),n?.services?.logger?.warn?n.services.logger.warn(...o):console?.warn&&console.warn(...o)},qp={},ox=(n,r,s,i)=>{Mr(s)&&qp[s]||(Mr(s)&&(qp[s]=new Date),r0(n,r,s,i))},cx=(n,r)=>()=>{if(n.isInitialized)r();else{const s=()=>{setTimeout(()=>{n.off("initialized",s)},0),r()};n.on("initialized",s)}},ud=(n,r,s)=>{n.loadNamespaces(r,cx(n,s))},Yp=(n,r,s,i)=>{if(Mr(s)&&(s=[s]),n.options.preload&&n.options.preload.indexOf(r)>-1)return ud(n,s,i);s.forEach(o=>{n.options.ns.indexOf(o)<0&&n.options.ns.push(o)}),n.loadLanguages(r,cx(n,i))},l0=(n,r,s={})=>!r.languages||!r.languages.length?(ox(r,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:r.languages}),!0):r.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}}),Mr=n=>typeof n=="string",s0=n=>typeof n=="object"&&n!==null,i0=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,o0={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},c0=n=>o0[n],u0=n=>n.replace(i0,c0);let dd={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:u0,transDefaultProps:void 0};const d0=(n={})=>{dd={...dd,...n}},f0=()=>dd;let ux;const m0=n=>{ux=n},h0=()=>ux,p0={type:"3rdParty",init(n){d0(n.options.react),m0(n)}},g0=y.createContext();class x0{constructor(){this.usedNamespaces={}}addUsedNamespaces(r){r.forEach(s=>{this.usedNamespaces[s]||(this.usedNamespaces[s]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var Gu={exports:{}},Vu={};var Gp;function y0(){if(Gp)return Vu;Gp=1;var n=No();function r(b,S){return b===S&&(b!==0||1/b===1/S)||b!==b&&S!==S}var s=typeof Object.is=="function"?Object.is:r,i=n.useState,o=n.useEffect,d=n.useLayoutEffect,m=n.useDebugValue;function p(b,S){var j=S(),N=i({inst:{value:j,getSnapshot:S}}),T=N[0].inst,O=N[1];return d(function(){T.value=j,T.getSnapshot=S,g(T)&&O({inst:T})},[b,j,S]),o(function(){return g(T)&&O({inst:T}),b(function(){g(T)&&O({inst:T})})},[b]),m(j),j}function g(b){var S=b.getSnapshot;b=b.value;try{var j=S();return!s(b,j)}catch{return!0}}function h(b,S){return S()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:p;return Vu.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:v,Vu}var Vp;function b0(){return Vp||(Vp=1,Gu.exports=y0()),Gu.exports}var v0=b0();const _0=(n,r)=>Mr(r)?r:s0(r)&&Mr(r.defaultValue)?r.defaultValue:Array.isArray(n)?n[n.length-1]:n,S0={t:_0,ready:!1},j0=()=>()=>{},je=(n,r={})=>{const{i18n:s}=r,{i18n:i,defaultNS:o}=y.useContext(g0)||{},d=s||i||h0();d&&!d.reportNamespaces&&(d.reportNamespaces=new x0),d||ox(d,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const m=y.useMemo(()=>({...f0(),...d?.options?.react,...r}),[d,r]),{useSuspense:p,keyPrefix:g}=m,h=o||d?.options?.defaultNS,v=Mr(h)?[h]:h||["translation"],b=y.useMemo(()=>v,v);d?.reportNamespaces?.addUsedNamespaces?.(b);const S=y.useRef(0),j=y.useCallback(Y=>{if(!d)return j0;const{bindI18n:W,bindI18nStore:de}=m,oe=()=>{S.current+=1,Y()};return W&&d.on(W,oe),de&&d.store.on(de,oe),()=>{W&&W.split(" ").forEach(le=>d.off(le,oe)),de&&de.split(" ").forEach(le=>d.store.off(le,oe))}},[d,m]),N=y.useRef(),T=y.useCallback(()=>{if(!d)return S0;const Y=!!(d.isInitialized||d.initializedStoreOnce)&&b.every(ge=>l0(ge,d,m)),W=r.lng||d.language,de=S.current,oe=N.current;if(oe&&oe.ready===Y&&oe.lng===W&&oe.keyPrefix===g&&oe.revision===de)return oe;const ue={t:d.getFixedT(W,m.nsMode==="fallback"?b:b[0],g),ready:Y,lng:W,keyPrefix:g,revision:de};return N.current=ue,ue},[d,b,g,m,r.lng]),[O,q]=y.useState(0),{t:X,ready:G}=v0.useSyncExternalStore(j,T,T);y.useEffect(()=>{if(d&&!G&&!p){const Y=()=>q(W=>W+1);r.lng?Yp(d,r.lng,b,Y):ud(d,b,Y)}},[d,r.lng,b,G,p,O]);const M=d||{},Q=y.useRef(null),te=y.useRef(),Z=Y=>{const W=Object.getOwnPropertyDescriptors(Y);W.__original&&delete W.__original;const de=Object.create(Object.getPrototypeOf(Y),W);if(!Object.prototype.hasOwnProperty.call(de,"__original"))try{Object.defineProperty(de,"__original",{value:Y,writable:!1,enumerable:!1,configurable:!1})}catch{}return de},E=y.useMemo(()=>{const Y=M,W=Y?.language;let de=Y;Y&&(Q.current&&Q.current.__original===Y?te.current!==W?(de=Z(Y),Q.current=de,te.current=W):de=Q.current:(de=Z(Y),Q.current=de,te.current=W));const oe=[X,de,G];return oe.t=X,oe.i18n=de,oe.ready=G,oe},[X,M,G,M.resolvedLanguage,M.language,M.languages]);if(d&&p&&!G)throw new Promise(Y=>{const W=()=>Y();r.lng?Yp(d,r.lng,b,W):ud(d,b,W)});return E},{slice:N0,forEach:w0}=[];function E0(n){return w0.call(N0.call(arguments,1),r=>{if(r)for(const s in r)n[s]===void 0&&(n[s]=r[s])}),n}function C0(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 Kp=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,R0=function(n,r){const i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},o=encodeURIComponent(r);let d=`${n}=${o}`;if(i.maxAge>0){const m=i.maxAge-0;if(Number.isNaN(m))throw new Error("maxAge should be a Number");d+=`; Max-Age=${Math.floor(m)}`}if(i.domain){if(!Kp.test(i.domain))throw new TypeError("option domain is invalid");d+=`; Domain=${i.domain}`}if(i.path){if(!Kp.test(i.path))throw new TypeError("option path is invalid");d+=`; Path=${i.path}`}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");d+=`; Expires=${i.expires.toUTCString()}`}if(i.httpOnly&&(d+="; HttpOnly"),i.secure&&(d+="; Secure"),i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:d+="; SameSite=Strict";break;case"lax":d+="; SameSite=Lax";break;case"strict":d+="; SameSite=Strict";break;case"none":d+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i.partitioned&&(d+="; Partitioned"),d},Xp={create(n,r,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=R0(n,r,o)},read(n){const r=`${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(r)===0)return o.substring(r.length,o.length)}return null},remove(n,r){this.create(n,"",-1,r)}};var T0={name:"cookie",lookup(n){let{lookupCookie:r}=n;if(r&&typeof document<"u")return Xp.read(r)||void 0},cacheUserLanguage(n,r){let{lookupCookie:s,cookieMinutes:i,cookieDomain:o,cookieOptions:d}=r;s&&typeof document<"u"&&Xp.create(s,n,i,o,d)}},k0={name:"querystring",lookup(n){let{lookupQuerystring:r}=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 d=i.substring(1).split("&");for(let m=0;m<d.length;m++){const p=d[m].indexOf("=");p>0&&d[m].substring(0,p)===r&&(s=d[m].substring(p+1))}}return s}},O0={name:"hash",lookup(n){let{lookupHash:r,lookupFromHashIndex:s}=n,i;if(typeof window<"u"){const{hash:o}=window.location;if(o&&o.length>2){const d=o.substring(1);if(r){const m=d.split("&");for(let p=0;p<m.length;p++){const g=m[p].indexOf("=");g>0&&m[p].substring(0,g)===r&&(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 Nl=null;const Qp=()=>{if(Nl!==null)return Nl;try{if(Nl=typeof window<"u"&&window.localStorage!==null,!Nl)return!1;const n="i18next.translate.boo";window.localStorage.setItem(n,"foo"),window.localStorage.removeItem(n)}catch{Nl=!1}return Nl};var z0={name:"localStorage",lookup(n){let{lookupLocalStorage:r}=n;if(r&&Qp())return window.localStorage.getItem(r)||void 0},cacheUserLanguage(n,r){let{lookupLocalStorage:s}=r;s&&Qp()&&window.localStorage.setItem(s,n)}};let wl=null;const Fp=()=>{if(wl!==null)return wl;try{if(wl=typeof window<"u"&&window.sessionStorage!==null,!wl)return!1;const n="i18next.translate.boo";window.sessionStorage.setItem(n,"foo"),window.sessionStorage.removeItem(n)}catch{wl=!1}return wl};var D0={name:"sessionStorage",lookup(n){let{lookupSessionStorage:r}=n;if(r&&Fp())return window.sessionStorage.getItem(r)||void 0},cacheUserLanguage(n,r){let{lookupSessionStorage:s}=r;s&&Fp()&&window.sessionStorage.setItem(s,n)}},A0={name:"navigator",lookup(n){const r=[];if(typeof navigator<"u"){const{languages:s,userLanguage:i,language:o}=navigator;if(s)for(let d=0;d<s.length;d++)r.push(s[d]);i&&r.push(i),o&&r.push(o)}return r.length>0?r:void 0}},M0={name:"htmlTag",lookup(n){let{htmlTag:r}=n,s;const i=r||(typeof document<"u"?document.documentElement:null);return i&&typeof i.getAttribute=="function"&&(s=i.getAttribute("lang")),s}},L0={name:"path",lookup(n){let{lookupFromPathIndex:r}=n;if(typeof window>"u")return;const s=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(s)?s[typeof r=="number"?r:0]?.replace("/",""):void 0}},U0={name:"subdomain",lookup(n){let{lookupFromSubdomainIndex:r}=n;const s=typeof r=="number"?r+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 dx=!1;try{document.cookie,dx=!0}catch{}const fx=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];dx||fx.splice(1,1);const H0=()=>({order:fx,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:n=>n});class mx{constructor(r){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(r,s)}init(){let r=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=r,this.options=E0(s,this.options||{},H0()),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(T0),this.addDetector(k0),this.addDetector(z0),this.addDetector(D0),this.addDetector(A0),this.addDetector(M0),this.addDetector(L0),this.addDetector(U0),this.addDetector(O0)}addDetector(r){return this.detectors[r.name]=r,this}detect(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,s=[];return r.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&&!C0(i)).map(i=>this.options.convertDetectedLanguage(i)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?s:s.length>0?s[0]:null}cacheUserLanguage(r){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;s&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(r)>-1||s.forEach(i=>{this.detectors[i]&&this.detectors[i].cacheUserLanguage(r,this.options)}))}}mx.type="languageDetector";const B0={"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.","login.title":"SIGN IN","login.provider_cta":"Sign in with {{name}}","login.loading":"LOADING...","login.authenticating":"AUTHENTICATING...","login.or":"OR","login.test_account":"Test Account","login.error":"Failed to load login options","login.retry":"Retry","user.menu.sign_out":"SIGN OUT","api_keys.title":"API Keys","api_keys.description":"API Keys for programmatic access to C4A API (AI Agent, CLI, CI/CD).","api_keys.create":"Create API Key","api_keys.created":"API Key Created","api_keys.copy_warning":"Copy now, this key won't be shown again.","api_keys.copy":"Copy","api_keys.copied":"Copied!","api_keys.done":"Done","api_keys.empty.title":"No API Keys","api_keys.empty.description":"API Keys for programmatic access to C4A API.","api_keys.created_at":"Created {{date}}","api_keys.never_used":"Never used","api_keys.expires.never":"Never expires","api_keys.expires.30d":"30 days","api_keys.expires.90d":"90 days","api_keys.expires.1y":"1 year","api_keys.form.name":"Name","api_keys.form.name_placeholder":"My CLI key","api_keys.form.expiry":"Expiration (optional)","api_keys.delete.confirm":"Delete this API key? This action cannot be undone.","workspace.default_name":"My Brain","settings.tab.general":"General","settings.tab.api_keys":"API Keys","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":"My Drive","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.","content.detail.tab.raw":"Raw Content","content.detail.tab.digest":"Digest","content.detail.tab.extraction":"LLM Extraction","content.detail.tab.entities":"Entities","content.detail.size":"Size","content.detail.created_at":"Created","content.detail.sources":"Sources","content.detail.language":"Language","content.detail.model":"Model","entity.detail.tab.overview":"Overview","entity.detail.tab.relations":"Relations","entity.detail.tab.contents":"Contents","entity.detail.tab.referrers":"Referrers","entity.detail.tab.neighbors":"Neighbors","entity.detail.type":"Type","entity.detail.kind":"Kind","entity.detail.perspective":"Perspective","entity.detail.scope":"Scope","relation.detail.tab.overview":"Overview","relation.detail.weight":"Weight","relation.detail.confidence":"Confidence","relation.detail.from":"From","relation.detail.to":"To","relation.detail.description":"Description","relation.detail.data":"Additional Data","relation.detail.source_refs":"Content Sources","relation.detail.meta":"Metadata","relation.detail.source_label":"Source","relation.detail.source_field_sync":"System-derived","relation.detail.source_explicit":"Explicitly declared","relation.filter.direction.all":"All Directions","relation.filter.direction.outgoing":"Outgoing →","relation.filter.direction.incoming":"← Incoming","relation.filter.type.all":"All Types","ref.stale":"Stale ref","ref.unknown":"Unknown entity","ref.retry":"Resolve failed, click to retry","confidence.high":"High confidence","confidence.ai":"AI suggestion","confidence.low":"Low confidence","source.field_sync":"System-derived","source.explicit":"Explicitly declared","common.empty.content_raw.title":"Content unavailable","common.empty.content_raw.description":"This content was imported by a local Daemon; the raw text was not uploaded to the server.","common.empty.content_digest.title":"Not yet indexed","common.empty.content_digest.description":"This content has not been through structured indexing yet.","common.empty.content_extraction.title":"Not yet extracted","common.empty.content_extraction.description":"AI has not yet performed entity extraction and analysis on this content.","common.empty.content_entities.title":"No associated entities","common.empty.content_entities.description":"No entities have been extracted from this content yet.","common.empty.entity_relations.title":"No relations","common.empty.entity_relations.description":"This entity is currently an island with no connections to other entities.","common.empty.entity_contents.title":"No content sources","common.empty.entity_contents.description":"This entity is not linked to any source code or document content.","common.empty.entity_referrers.title":"No referrers","common.empty.entity_referrers.description":"No other entities currently reference this entity in their data fields.","common.empty.entity_neighbors.title":"No neighbors","common.empty.entity_neighbors.description":"This entity has no directly connected neighbor nodes in the graph.","common.error.not_found":"Resource not found","common.error.not_found_description":"The requested resource does not exist or has been removed.","common.error.load_failed":"Failed to load","common.error.load_failed_description":"An error occurred while loading data. Please try again."},$0={"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":"身份验证与用户管理。","login.title":"登录","login.provider_cta":"使用 {{name}} 登录","login.loading":"加载中...","login.authenticating":"认证中...","login.or":"或","login.test_account":"测试账户","login.error":"加载登录选项失败","login.retry":"重试","user.menu.sign_out":"退出登录","api_keys.title":"API 密钥","api_keys.description":"API Key 用于程序化访问 C4A API(AI Agent、CLI、CI/CD)。","api_keys.create":"创建 API Key","api_keys.created":"API Key 已创建","api_keys.copy_warning":"请立即复制,此 Key 不会再次显示。","api_keys.copy":"复制","api_keys.copied":"已复制!","api_keys.done":"完成","api_keys.empty.title":"尚无 API Key","api_keys.empty.description":"API Key 用于程序化访问 C4A API。","api_keys.created_at":"创建于 {{date}}","api_keys.never_used":"从未使用","api_keys.expires.never":"永不过期","api_keys.expires.30d":"30 天","api_keys.expires.90d":"90 天","api_keys.expires.1y":"1 年","api_keys.form.name":"名称","api_keys.form.name_placeholder":"My CLI key","api_keys.form.expiry":"过期时间(可选)","api_keys.delete.confirm":"删除此 API Key?此操作不可撤销。","workspace.default_name":"我的大脑","settings.tab.general":"常规","settings.tab.api_keys":"API 密钥","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":"远程仓库将被克隆到服务器本地进行分析,代码不会上传到任何第三方服务。","content.detail.tab.raw":"原始内容","content.detail.tab.digest":"索引摘要","content.detail.tab.extraction":"LLM 提取","content.detail.tab.entities":"关联实体","content.detail.size":"大小","content.detail.created_at":"创建时间","content.detail.sources":"来源","content.detail.language":"语言","content.detail.model":"模型","entity.detail.tab.overview":"概览","entity.detail.tab.relations":"关系","entity.detail.tab.contents":"内容来源","entity.detail.tab.referrers":"被引用","entity.detail.tab.neighbors":"邻居","entity.detail.type":"类型","entity.detail.kind":"种类","entity.detail.perspective":"视角","entity.detail.scope":"作用域","relation.detail.tab.overview":"概览","relation.detail.weight":"权重","relation.detail.confidence":"置信度","relation.detail.from":"起点","relation.detail.to":"终点","relation.detail.description":"描述","relation.detail.data":"附加数据","relation.detail.source_refs":"内容来源","relation.detail.meta":"元信息","relation.detail.source_label":"生成方式","relation.detail.source_field_sync":"系统推导","relation.detail.source_explicit":"显式声明","relation.filter.direction.all":"全部方向","relation.filter.direction.outgoing":"出边 →","relation.filter.direction.incoming":"← 入边","relation.filter.type.all":"全部类型","ref.stale":"已失效引用","ref.unknown":"未知实体","ref.retry":"解析失败,点击重试","confidence.high":"高确信","confidence.ai":"AI 建议","confidence.low":"低确信","source.field_sync":"系统推导","source.explicit":"显式声明","common.empty.content_raw.title":"内容不可用","common.empty.content_raw.description":"此内容由本地 Daemon 导入,原始文本未上传到服务端。","common.empty.content_digest.title":"尚未索引","common.empty.content_digest.description":"此内容尚未经过结构化索引处理。","common.empty.content_extraction.title":"尚未提取","common.empty.content_extraction.description":"AI 尚未对此内容进行实体提取和分析。","common.empty.content_entities.title":"暂无关联实体","common.empty.content_entities.description":"尚未从此内容中提取出任何实体。","common.empty.entity_relations.title":"暂无关系","common.empty.entity_relations.description":"该实体目前是一个孤岛,尚未与其他实体建立关联。","common.empty.entity_contents.title":"暂无内容来源","common.empty.entity_contents.description":"该实体未关联任何源代码或文档内容。","common.empty.entity_referrers.title":"暂无被引用","common.empty.entity_referrers.description":"目前没有其他实体在 data 字段中引用此实体。","common.empty.entity_neighbors.title":"暂无邻居","common.empty.entity_neighbors.description":"该实体在图谱中没有直接关联的邻居节点。","common.error.not_found":"资源不存在","common.error.not_found_description":"请求的资源不存在或已被移除。","common.error.load_failed":"加载失败","common.error.load_failed_description":"加载数据时发生错误,请重试。"};fa.use(mx).use(p0).init({resources:{en:{translation:B0},zh:{translation:$0}},fallbackLng:"en",interpolation:{escapeValue:!1},detection:{order:["localStorage"],caches:["localStorage"],lookupLocalStorage:"lang"}});var Ku={exports:{}},ws={},Xu={exports:{}},Qu={};var Zp;function q0(){return Zp||(Zp=1,(function(n){function r(A,P){var fe=A.length;A.push(P);e:for(;0<fe;){var me=fe-1>>>1,re=A[me];if(0<o(re,P))A[me]=P,A[fe]=re,fe=me;else break e}}function s(A){return A.length===0?null:A[0]}function i(A){if(A.length===0)return null;var P=A[0],fe=A.pop();if(fe!==P){A[0]=fe;e:for(var me=0,re=A.length,w=re>>>1;me<w;){var $=2*(me+1)-1,ee=A[$],ae=$+1,xe=A[ae];if(0>o(ee,fe))ae<re&&0>o(xe,ee)?(A[me]=xe,A[ae]=fe,me=ae):(A[me]=ee,A[$]=fe,me=$);else if(ae<re&&0>o(xe,fe))A[me]=xe,A[ae]=fe,me=ae;else break e}}return P}function o(A,P){var fe=A.sortIndex-P.sortIndex;return fe!==0?fe:A.id-P.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var m=Date,p=m.now();n.unstable_now=function(){return m.now()-p}}var g=[],h=[],v=1,b=null,S=3,j=!1,N=!1,T=!1,O=!1,q=typeof setTimeout=="function"?setTimeout:null,X=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function M(A){for(var P=s(h);P!==null;){if(P.callback===null)i(h);else if(P.startTime<=A)i(h),P.sortIndex=P.expirationTime,r(g,P);else break;P=s(h)}}function Q(A){if(T=!1,M(A),!N)if(s(g)!==null)N=!0,te||(te=!0,oe());else{var P=s(h);P!==null&&ge(Q,P.startTime-A)}}var te=!1,Z=-1,E=5,Y=-1;function W(){return O?!0:!(n.unstable_now()-Y<E)}function de(){if(O=!1,te){var A=n.unstable_now();Y=A;var P=!0;try{e:{N=!1,T&&(T=!1,X(Z),Z=-1),j=!0;var fe=S;try{t:{for(M(A),b=s(g);b!==null&&!(b.expirationTime>A&&W());){var me=b.callback;if(typeof me=="function"){b.callback=null,S=b.priorityLevel;var re=me(b.expirationTime<=A);if(A=n.unstable_now(),typeof re=="function"){b.callback=re,M(A),P=!0;break t}b===s(g)&&i(g),M(A)}else i(g);b=s(g)}if(b!==null)P=!0;else{var w=s(h);w!==null&&ge(Q,w.startTime-A),P=!1}}break e}finally{b=null,S=fe,j=!1}P=void 0}}finally{P?oe():te=!1}}}var oe;if(typeof G=="function")oe=function(){G(de)};else if(typeof MessageChannel<"u"){var le=new MessageChannel,ue=le.port2;le.port1.onmessage=de,oe=function(){ue.postMessage(null)}}else oe=function(){q(de,0)};function ge(A,P){Z=q(function(){A(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(A){A.callback=null},n.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<A?Math.floor(1e3/A):5},n.unstable_getCurrentPriorityLevel=function(){return S},n.unstable_next=function(A){switch(S){case 1:case 2:case 3:var P=3;break;default:P=S}var fe=S;S=P;try{return A()}finally{S=fe}},n.unstable_requestPaint=function(){O=!0},n.unstable_runWithPriority=function(A,P){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var fe=S;S=A;try{return P()}finally{S=fe}},n.unstable_scheduleCallback=function(A,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,A){case 1:var re=-1;break;case 2:re=250;break;case 5:re=1073741823;break;case 4:re=1e4;break;default:re=5e3}return re=fe+re,A={id:v++,callback:P,priorityLevel:A,startTime:fe,expirationTime:re,sortIndex:-1},fe>me?(A.sortIndex=fe,r(h,A),s(g)===null&&A===s(h)&&(T?(X(Z),Z=-1):T=!0,ge(Q,fe-me))):(A.sortIndex=re,r(g,A),N||j||(N=!0,te||(te=!0,oe()))),A},n.unstable_shouldYield=W,n.unstable_wrapCallback=function(A){var P=S;return function(){var fe=S;S=P;try{return A.apply(this,arguments)}finally{S=fe}}}})(Qu)),Qu}var Jp;function Y0(){return Jp||(Jp=1,Xu.exports=q0()),Xu.exports}var Fu={exports:{}},na={};var Pp;function G0(){if(Pp)return na;Pp=1;var n=No();function r(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(r(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 d(g,h,v){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:b==null?null:""+b,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(r(299));return d(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,b=p(v,h.crossOrigin),S=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:b,integrity:S,fetchPriority:j}):v==="script"&&i.d.X(g,{crossOrigin:b,integrity:S,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,b=p(v,h.crossOrigin);i.d.L(g,v,{crossOrigin:b,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 Ip;function V0(){if(Ip)return Fu.exports;Ip=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(r){console.error(r)}}return n(),Fu.exports=G0(),Fu.exports}var Wp;function K0(){if(Wp)return ws;Wp=1;var n=Y0(),r=No(),s=V0();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 d(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(d(e)!==e)throw Error(i(188))}function h(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(i(188));return t!==e?null:e}for(var a=e,l=t;;){var c=a.return;if(c===null)break;var f=c.alternate;if(f===null){if(l=c.return,l!==null){a=l;continue}break}if(c.child===f.child){for(f=c.child;f;){if(f===a)return g(c),e;if(f===l)return g(c),t;f=f.sibling}throw Error(i(188))}if(a.return!==l.return)a=c,l=f;else{for(var x=!1,_=c.child;_;){if(_===a){x=!0,a=c,l=f;break}if(_===l){x=!0,l=c,a=f;break}_=_.sibling}if(!x){for(_=f.child;_;){if(_===a){x=!0,a=f,l=c;break}if(_===l){x=!0,l=f,a=c;break}_=_.sibling}if(!x)throw Error(i(189))}}if(a.alternate!==l)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 b=Object.assign,S=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"),q=Symbol.for("react.profiler"),X=Symbol.for("react.consumer"),G=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),Q=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),W=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 le=Symbol.for("react.client.reference");function ue(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===le?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case q:return"Profiler";case O:return"StrictMode";case Q:return"Suspense";case te:return"SuspenseList";case Y:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case G:return e.displayName||"Context";case X:return(e._context.displayName||"Context")+".Consumer";case M:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Z: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,A=r.__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=[],re=-1;function w(e){return{current:e}}function $(e){0>re||(e.current=me[re],me[re]=null,re--)}function ee(e,t){re++,me[re]=e.current,e.current=t}var ae=w(null),xe=w(null),ve=w(null),ke=w(null);function Pe(e,t){switch(ee(ve,t),ee(xe,e),ee(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Qh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Qh(t),e=Fh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$(ae),ee(ae,e)}function Xe(){$(ae),$(xe),$(ve)}function Wt(e){e.memoizedState!==null&&ee(ke,e);var t=ae.current,a=Fh(t,e.type);t!==a&&(ee(xe,e),ee(ae,a))}function ma(e){xe.current===e&&($(ae),$(xe)),ke.current===e&&($(ke),bs._currentValue=fe)}var Qe,et;function ft(e){if(Qe===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Qe=t&&t[1]||"",et=-1<a.stack.indexOf(`
3
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
4
+ `+Qe+e+et}var qt=!1;function Vt(e,t){if(!e||qt)return"";qt=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={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(V){var H=V}Reflect.construct(e,[],I)}else{try{I.call()}catch(V){H=V}e.call(I.prototype)}}else{try{throw Error()}catch(V){H=V}(I=e())&&typeof I.catch=="function"&&I.catch(function(){})}}catch(V){if(V&&H&&typeof V.stack=="string")return[V.stack,H.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=l.DetermineComponentFrameRoot(),x=f[0],_=f[1];if(x&&_){var R=x.split(`
5
+ `),U=_.split(`
6
+ `);for(c=l=0;l<R.length&&!R[l].includes("DetermineComponentFrameRoot");)l++;for(;c<U.length&&!U[c].includes("DetermineComponentFrameRoot");)c++;if(l===R.length||c===U.length)for(l=R.length-1,c=U.length-1;1<=l&&0<=c&&R[l]!==U[c];)c--;for(;1<=l&&0<=c;l--,c--)if(R[l]!==U[c]){if(l!==1||c!==1)do if(l--,c--,0>c||R[l]!==U[c]){var F=`
7
+ `+R[l].replace(" at new "," at ");return e.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",e.displayName)),F}while(1<=l&&0<=c);break}}}finally{qt=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?ft(a):""}function ea(e,t){switch(e.tag){case 26:case 27:case 5:return ft(e.type);case 16:return ft("Lazy");case 13:return e.child!==t&&t!==null?ft("Suspense Fallback"):ft("Suspense");case 19:return ft("SuspenseList");case 0:case 15:return Vt(e.type,!1);case 11:return Vt(e.type.render,!1);case 1:return Vt(e.type,!0);case 31:return ft("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(l){return`
8
+ Error generating stack: `+l.message+`
9
+ `+l.stack}}var Sa=Object.prototype.hasOwnProperty,ja=n.unstable_scheduleCallback,Aa=n.unstable_cancelCallback,la=n.unstable_shouldYield,sa=n.unstable_requestPaint,pt=n.unstable_now,ia=n.unstable_getCurrentPriorityLevel,_e=n.unstable_ImmediatePriority,Ae=n.unstable_UserBlockingPriority,Fe=n.unstable_NormalPriority,gt=n.unstable_LowPriority,Nt=n.unstable_IdlePriority,Qt=n.log,Pa=n.unstable_setDisableYieldValue,Ft=null,Tt=null;function xt(e){if(typeof Qt=="function"&&Pa(e),Tt&&typeof Tt.setStrictMode=="function")try{Tt.setStrictMode(Ft,e)}catch{}}var Dt=Math.clz32?Math.clz32:lt,Ce=Math.log,Le=Math.LN2;function lt(e){return e>>>=0,e===0?32:31-(Ce(e)/Le|0)|0}var K=256,se=262144,Oe=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 l=e.pendingLanes;if(l===0)return 0;var c=0,f=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var _=l&134217727;return _!==0?(l=_&~f,l!==0?c=$e(l):(x&=_,x!==0?c=$e(x):a||(a=_&~e,a!==0&&(c=$e(a))))):(_=l&~f,_!==0?c=$e(_):x!==0?c=$e(x):a||(a=l&~e,a!==0&&(c=$e(a)))),c===0?0:t!==0&&t!==c&&(t&f)===0&&(f=c&-c,a=t&-t,f>=a||f===32&&(a&4194048)!==0)?t:c}function At(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=Oe;return Oe<<=1,(Oe&62914560)===0&&(Oe=4194304),e}function Ma(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Na(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function fr(e,t,a,l,c,f){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 _=e.entanglements,R=e.expirationTimes,U=e.hiddenUpdates;for(a=x&~a;0<a;){var F=31-Dt(a),I=1<<F;_[F]=0,R[F]=-1;var H=U[F];if(H!==null)for(U[F]=null,F=0;F<H.length;F++){var V=H[F];V!==null&&(V.lane&=-536870913)}a&=~I}l!==0&&$r(e,l,0),f!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=f&~(x&~t))}function $r(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-Dt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|a&261930}function qr(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var l=31-Dt(a),c=1<<l;c&t|e[l]&t&&(e[l]|=t),a&=~c}}function C(e,t){var a=t&-t;return a=(a&42)!==0?1:z(a),(a&(e.suspendedLanes|t))!==0?0:a}function z(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 B(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:xp(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,we="__reactEvents$"+ye,Re="__reactListeners$"+ye,Ne="__reactHandles$"+ye,tt="__reactResources$"+ye,Ye="__reactMarker$"+ye;function mt(e){delete e[ce],delete e[he],delete e[we],delete e[Re],delete e[Ne]}function bt(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=tp(e);e!==null;){if(a=e[ce])return a;e=tp(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 We(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Yt(e){var t=e[tt];return t||(t=e[tt]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function yt(e){e[Ye]=!0}var Un=new Set,Ia={};function Kt(e,t){sn(e,t),sn(e+"Capture",t)}function sn(e,t){for(Ia[e]=t,e=0;e<t.length;e++)Un.add(t[e])}var mr=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]*$"),on={},hr={};function Yr(e){return Sa.call(hr,e)?!0:Sa.call(on,e)?!1:mr.test(e)?hr[e]=!0:(on[e]=!0,!1)}function Ge(e,t,a){if(Yr(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function kt(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,l){if(l===null)e.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+l)}}function Mt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function vt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Gr(e,t,a){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var c=l.get,f=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(x){a=""+x,f.call(this,x)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return a},setValue:function(x){a=""+x},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Vr(e){if(!e._valueTracker){var t=vt(e)?"checked":"value";e._valueTracker=Gr(e,t,""+e[t])}}function Zs(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),l="";return e&&(l=vt(e)?e.checked?"true":"false":e.value),e=l,e!==a?(t.setValue(e),!0):!1}function Js(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 Ny=/[\n"\\]/g;function La(e){return e.replace(Ny,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function zo(e,t,a,l,c,f,x,_){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=""+Mt(t)):e.value!==""+Mt(t)&&(e.value=""+Mt(t)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),t!=null?Do(e,x,Mt(t)):a!=null?Do(e,x,Mt(a)):l!=null&&e.removeAttribute("value"),c==null&&f!=null&&(e.defaultChecked=!!f),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.name=""+Mt(_):e.removeAttribute("name")}function $d(e,t,a,l,c,f,x,_){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||a!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){Vr(e);return}a=a!=null?""+Mt(a):"",t=t!=null?""+Mt(t):a,_||t===e.value||(e.value=t),e.defaultValue=t}l=l??c,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=_?e.checked:!!l,e.defaultChecked=!!l,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),Vr(e)}function Do(e,t,a){t==="number"&&Js(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Kr(e,t,a,l){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&&l&&(e[a].defaultSelected=!0)}else{for(a=""+Mt(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,l&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function qd(e,t,a){if(t!=null&&(t=""+Mt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Mt(a):""}function Yd(e,t,a,l){if(t==null){if(l!=null){if(a!=null)throw Error(i(92));if(ge(l)){if(1<l.length)throw Error(i(93));l=l[0]}a=l}a==null&&(a=""),t=a}a=Mt(t),e.defaultValue=a,l=e.textContent,l===a&&l!==""&&l!==null&&(e.value=l),Vr(e)}function Xr(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var wy=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 Gd(e,t,a){var l=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,a):typeof a!="number"||a===0||wy.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Vd(e,t,a){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var c in t)l=t[c],t.hasOwnProperty(c)&&a[c]!==l&&Gd(e,c,l)}else for(var f in t)t.hasOwnProperty(f)&&Gd(e,f,t[f])}function Ao(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 Ey=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"]]),Cy=/^[\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 Ps(e){return Cy.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function gn(){}var Mo=null;function Lo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qr=null,Fr=null;function Kd(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 l=a[t];if(l!==e&&l.form===e.form){var c=l[he]||null;if(!c)throw Error(i(90));zo(l,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<a.length;t++)l=a[t],l.form===e.form&&Zs(l)}break e;case"textarea":qd(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Kr(e,!!a.multiple,t,!1)}}}var Uo=!1;function Xd(e,t,a){if(Uo)return e(t,a);Uo=!0;try{var l=e(t);return l}finally{if(Uo=!1,(Qr!==null||Fr!==null)&&(Hi(),Qr&&(t=Qr,e=Fr,Fr=Qr=null,Kd(t),e)))for(t=0;t<e.length;t++)Kd(e[t])}}function Ll(e,t){var a=e.stateNode;if(a===null)return null;var l=a[he]||null;if(l===null)return null;a=l[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":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(i(231,t,typeof a));return a}var xn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ho=!1;if(xn)try{var Ul={};Object.defineProperty(Ul,"passive",{get:function(){Ho=!0}}),window.addEventListener("test",Ul,Ul),window.removeEventListener("test",Ul,Ul)}catch{Ho=!1}var Hn=null,Bo=null,Is=null;function Qd(){if(Is)return Is;var e,t=Bo,a=t.length,l,c="value"in Hn?Hn.value:Hn.textContent,f=c.length;for(e=0;e<a&&t[e]===c[e];e++);var x=a-e;for(l=1;l<=x&&t[a-l]===c[f-l];l++);return Is=c.slice(e,1<l?1-l:void 0)}function Ws(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 ei(){return!0}function Fd(){return!1}function ha(e){function t(a,l,c,f,x){this._reactName=a,this._targetInst=c,this.type=l,this.nativeEvent=f,this.target=x,this.currentTarget=null;for(var _ in e)e.hasOwnProperty(_)&&(a=e[_],this[_]=a?a(f):f[_]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?ei:Fd,this.isPropagationStopped=Fd,this}return b(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=ei)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=ei)},persist:function(){},isPersistent:ei}),t}var pr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ti=ha(pr),Hl=b({},pr,{view:0,detail:0}),Ry=ha(Hl),$o,qo,Bl,ai=b({},Hl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Go,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!==Bl&&(Bl&&e.type==="mousemove"?($o=e.screenX-Bl.screenX,qo=e.screenY-Bl.screenY):qo=$o=0,Bl=e),$o)},movementY:function(e){return"movementY"in e?e.movementY:qo}}),Zd=ha(ai),Ty=b({},ai,{dataTransfer:0}),ky=ha(Ty),Oy=b({},Hl,{relatedTarget:0}),Yo=ha(Oy),zy=b({},pr,{animationName:0,elapsedTime:0,pseudoElement:0}),Dy=ha(zy),Ay=b({},pr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),My=ha(Ay),Ly=b({},pr,{data:0}),Jd=ha(Ly),Uy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Hy={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"},By={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $y(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=By[e])?!!t[e]:!1}function Go(){return $y}var qy=b({},Hl,{key:function(e){if(e.key){var t=Uy[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ws(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Hy[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Go,charCode:function(e){return e.type==="keypress"?Ws(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ws(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Yy=ha(qy),Gy=b({},ai,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Pd=ha(Gy),Vy=b({},Hl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Go}),Ky=ha(Vy),Xy=b({},pr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Qy=ha(Xy),Fy=b({},ai,{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(Fy),Jy=b({},pr,{newState:0,oldState:0}),Py=ha(Jy),Iy=[9,13,27,32],Vo=xn&&"CompositionEvent"in window,$l=null;xn&&"documentMode"in document&&($l=document.documentMode);var Wy=xn&&"TextEvent"in window&&!$l,Id=xn&&(!Vo||$l&&8<$l&&11>=$l),Wd=" ",ef=!1;function tf(e,t){switch(e){case"keyup":return Iy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function af(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zr=!1;function eb(e,t){switch(e){case"compositionend":return af(t);case"keypress":return t.which!==32?null:(ef=!0,Wd);case"textInput":return e=t.data,e===Wd&&ef?null:e;default:return null}}function tb(e,t){if(Zr)return e==="compositionend"||!Vo&&tf(e,t)?(e=Qd(),Is=Bo=Hn=null,Zr=!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 Id&&t.locale!=="ko"?null:t.data;default:return null}}var ab={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 nf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ab[e.type]:t==="textarea"}function rf(e,t,a,l){Qr?Fr?Fr.push(l):Fr=[l]:Qr=l,t=Ki(t,"onChange"),0<t.length&&(a=new ti("onChange","change",null,a,l),e.push({event:a,listeners:t}))}var ql=null,Yl=null;function nb(e){qh(e,0)}function ni(e){var t=We(e);if(Zs(t))return e}function lf(e,t){if(e==="change")return t}var sf=!1;if(xn){var Ko;if(xn){var Xo="oninput"in document;if(!Xo){var of=document.createElement("div");of.setAttribute("oninput","return;"),Xo=typeof of.oninput=="function"}Ko=Xo}else Ko=!1;sf=Ko&&(!document.documentMode||9<document.documentMode)}function cf(){ql&&(ql.detachEvent("onpropertychange",uf),Yl=ql=null)}function uf(e){if(e.propertyName==="value"&&ni(Yl)){var t=[];rf(t,Yl,e,Lo(e)),Xd(nb,t)}}function rb(e,t,a){e==="focusin"?(cf(),ql=t,Yl=a,ql.attachEvent("onpropertychange",uf)):e==="focusout"&&cf()}function lb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ni(Yl)}function sb(e,t){if(e==="click")return ni(t)}function ib(e,t){if(e==="input"||e==="change")return ni(t)}function ob(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var wa=typeof Object.is=="function"?Object.is:ob;function Gl(e,t){if(wa(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var c=a[l];if(!Sa.call(t,c)||!wa(e[c],t[c]))return!1}return!0}function df(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ff(e,t){var a=df(e);e=0;for(var l;a;){if(a.nodeType===3){if(l=e+a.textContent.length,e<=t&&l>=t)return{node:a,offset:t-e};e=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=df(a)}}function mf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?mf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function hf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Js(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=Js(e.document)}return t}function Qo(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 cb=xn&&"documentMode"in document&&11>=document.documentMode,Jr=null,Fo=null,Vl=null,Zo=!1;function pf(e,t,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Zo||Jr==null||Jr!==Js(l)||(l=Jr,"selectionStart"in l&&Qo(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Vl&&Gl(Vl,l)||(Vl=l,l=Ki(Fo,"onSelect"),0<l.length&&(t=new ti("onSelect","select",null,t,a),e.push({event:t,listeners:l}),t.target=Jr)))}function gr(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Pr={animationend:gr("Animation","AnimationEnd"),animationiteration:gr("Animation","AnimationIteration"),animationstart:gr("Animation","AnimationStart"),transitionrun:gr("Transition","TransitionRun"),transitionstart:gr("Transition","TransitionStart"),transitioncancel:gr("Transition","TransitionCancel"),transitionend:gr("Transition","TransitionEnd")},Jo={},gf={};xn&&(gf=document.createElement("div").style,"AnimationEvent"in window||(delete Pr.animationend.animation,delete Pr.animationiteration.animation,delete Pr.animationstart.animation),"TransitionEvent"in window||delete Pr.transitionend.transition);function xr(e){if(Jo[e])return Jo[e];if(!Pr[e])return e;var t=Pr[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in gf)return Jo[e]=t[a];return e}var xf=xr("animationend"),yf=xr("animationiteration"),bf=xr("animationstart"),ub=xr("transitionrun"),db=xr("transitionstart"),fb=xr("transitioncancel"),vf=xr("transitionend"),_f=new Map,Po="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(" ");Po.push("scrollEnd");function Wa(e,t){_f.set(e,t),Kt(t,[e])}var ri=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=[],Ir=0,Io=0;function li(){for(var e=Ir,t=Io=Ir=0;t<e;){var a=Ua[t];Ua[t++]=null;var l=Ua[t];Ua[t++]=null;var c=Ua[t];Ua[t++]=null;var f=Ua[t];if(Ua[t++]=null,l!==null&&c!==null){var x=l.pending;x===null?c.next=c:(c.next=x.next,x.next=c),l.pending=c}f!==0&&Sf(a,c,f)}}function si(e,t,a,l){Ua[Ir++]=e,Ua[Ir++]=t,Ua[Ir++]=a,Ua[Ir++]=l,Io|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Wo(e,t,a,l){return si(e,t,a,l),ii(e)}function yr(e,t){return si(e,null,null,t),ii(e)}function Sf(e,t,a){e.lanes|=a;var l=e.alternate;l!==null&&(l.lanes|=a);for(var c=!1,f=e.return;f!==null;)f.childLanes|=a,l=f.alternate,l!==null&&(l.childLanes|=a),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(c=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,c&&t!==null&&(c=31-Dt(a),e=f.hiddenUpdates,l=e[c],l===null?e[c]=[t]:l.push(t),t.lane=a|536870912),f):null}function ii(e){if(50<fs)throw fs=0,ou=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Wr={};function mb(e,t,a,l){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=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ea(e,t,a,l){return new mb(e,t,a,l)}function ec(e){return e=e.prototype,!(!e||!e.isReactComponent)}function yn(e,t){var a=e.alternate;return a===null?(a=Ea(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 jf(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 oi(e,t,a,l,c,f){var x=0;if(l=e,typeof e=="function")ec(e)&&(x=1);else if(typeof e=="string")x=yv(e,a,ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Y:return e=Ea(31,a,t,c),e.elementType=Y,e.lanes=f,e;case T:return br(a.children,c,f,t);case O:x=8,c|=24;break;case q:return e=Ea(12,a,t,c|2),e.elementType=q,e.lanes=f,e;case Q:return e=Ea(13,a,t,c),e.elementType=Q,e.lanes=f,e;case te:return e=Ea(19,a,t,c),e.elementType=te,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case G:x=10;break e;case X:x=9;break e;case M:x=11;break e;case Z:x=14;break e;case E:x=16,l=null;break e}x=29,a=Error(i(130,e===null?"null":typeof e,"")),l=null}return t=Ea(x,a,t,c),t.elementType=e,t.type=l,t.lanes=f,t}function br(e,t,a,l){return e=Ea(7,e,l,t),e.lanes=a,e}function tc(e,t,a){return e=Ea(6,e,null,t),e.lanes=a,e}function Nf(e){var t=Ea(18,null,null,0);return t.stateNode=e,t}function ac(e,t,a){return t=Ea(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var wf=new WeakMap;function Ha(e,t){if(typeof e=="object"&&e!==null){var a=wf.get(e);return a!==void 0?a:(t={value:e,source:t,stack:ta(t)},wf.set(e,t),t)}return{value:e,source:t,stack:ta(t)}}var el=[],tl=0,ci=null,Kl=0,Ba=[],$a=0,Bn=null,cn=1,un="";function bn(e,t){el[tl++]=Kl,el[tl++]=ci,ci=e,Kl=t}function Ef(e,t,a){Ba[$a++]=cn,Ba[$a++]=un,Ba[$a++]=Bn,Bn=e;var l=cn;e=un;var c=32-Dt(l)-1;l&=~(1<<c),a+=1;var f=32-Dt(t)+c;if(30<f){var x=c-c%5;f=(l&(1<<x)-1).toString(32),l>>=x,c-=x,cn=1<<32-Dt(t)+c|a<<c|l,un=f+e}else cn=1<<f|a<<c|l,un=e}function nc(e){e.return!==null&&(bn(e,1),Ef(e,1,0))}function rc(e){for(;e===ci;)ci=el[--tl],el[tl]=null,Kl=el[--tl],el[tl]=null;for(;e===Bn;)Bn=Ba[--$a],Ba[$a]=null,un=Ba[--$a],Ba[$a]=null,cn=Ba[--$a],Ba[$a]=null}function Cf(e,t){Ba[$a++]=cn,Ba[$a++]=un,Ba[$a++]=Bn,cn=t.id,un=t.overflow,Bn=e}var Zt=null,_t=null,Ie=!1,$n=null,qa=!1,lc=Error(i(519));function qn(e){var t=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Xl(Ha(t,e)),lc}function Rf(e){var t=e.stateNode,a=e.type,l=e.memoizedProps;switch(t[ce]=e,t[he]=l,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),$d(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ke("invalid",t);break;case"textarea":Ke("invalid",t),Yd(t,l.value,l.defaultValue,l.children)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||l.suppressHydrationWarning===!0||Kh(t.textContent,a)?(l.popover!=null&&(Ke("beforetoggle",t),Ke("toggle",t)),l.onScroll!=null&&Ke("scroll",t),l.onScrollEnd!=null&&Ke("scrollend",t),l.onClick!=null&&(t.onclick=gn),t=!0):t=!1,t||qn(e,!0)}function Tf(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 al(e){if(e!==Zt)return!1;if(!Ie)return Tf(e),Ie=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||ju(e.type,e.memoizedProps)),a=!a),a&&_t&&qn(e),Tf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));_t=ep(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));_t=ep(e)}else t===27?(t=_t,tr(e.type)?(e=Ru,Ru=null,_t=e):_t=t):_t=Zt?Ga(e.stateNode.nextSibling):null;return!0}function vr(){_t=Zt=null,Ie=!1}function sc(){var e=$n;return e!==null&&(ya===null?ya=e:ya.push.apply(ya,e),$n=null),e}function Xl(e){$n===null?$n=[e]:$n.push(e)}var ic=w(null),_r=null,vn=null;function Yn(e,t,a){ee(ic,t._currentValue),t._currentValue=a}function _n(e){e._currentValue=ic.current,$(ic)}function oc(e,t,a){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===a)break;e=e.return}}function cc(e,t,a,l){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var f=c.dependencies;if(f!==null){var x=c.child;f=f.firstContext;e:for(;f!==null;){var _=f;f=c;for(var R=0;R<t.length;R++)if(_.context===t[R]){f.lanes|=a,_=f.alternate,_!==null&&(_.lanes|=a),oc(f.return,a,e),l||(x=null);break e}f=_.next}}else if(c.tag===18){if(x=c.return,x===null)throw Error(i(341));x.lanes|=a,f=x.alternate,f!==null&&(f.lanes|=a),oc(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 nl(e,t,a,l){e=null;for(var c=t,f=!1;c!==null;){if(!f){if((c.flags&524288)!==0)f=!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 _=c.type;wa(c.pendingProps.value,x.value)||(e!==null?e.push(_):e=[_])}}else if(c===ke.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&&cc(t,e,a,l),t.flags|=262144}function ui(e){for(e=e.firstContext;e!==null;){if(!wa(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Sr(e){_r=e,vn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Jt(e){return kf(_r,e)}function di(e,t){return _r===null&&Sr(e),kf(e,t)}function kf(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},vn===null){if(e===null)throw Error(i(308));vn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else vn=vn.next=t;return a}var hb=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},pb=n.unstable_scheduleCallback,gb=n.unstable_NormalPriority,Lt={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function uc(){return{controller:new hb,data:new Map,refCount:0}}function Ql(e){e.refCount--,e.refCount===0&&pb(gb,function(){e.controller.abort()})}var Fl=null,dc=0,rl=0,ll=null;function xb(e,t){if(Fl===null){var a=Fl=[];dc=0,rl=hu(),ll={status:"pending",value:void 0,then:function(l){a.push(l)}}}return dc++,t.then(Of,Of),t}function Of(){if(--dc===0&&Fl!==null){ll!==null&&(ll.status="fulfilled");var e=Fl;Fl=null,rl=0,ll=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function yb(e,t){var a=[],l={status:"pending",value:null,reason:null,then:function(c){a.push(c)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var c=0;c<a.length;c++)(0,a[c])(t)},function(c){for(l.status="rejected",l.reason=c,c=0;c<a.length;c++)(0,a[c])(void 0)}),l}var zf=A.S;A.S=function(e,t){ph=pt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&xb(e,t),zf!==null&&zf(e,t)};var jr=w(null);function fc(){var e=jr.current;return e!==null?e:ht.pooledCache}function fi(e,t){t===null?ee(jr,jr.current):ee(jr,t.pool)}function Df(){var e=fc();return e===null?null:{parent:Lt._currentValue,pool:e}}var sl=Error(i(460)),mc=Error(i(474)),mi=Error(i(542)),hi={then:function(){}};function Af(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Mf(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(gn,gn),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Uf(e),e;default:if(typeof t.status=="string")t.then(gn,gn);else{if(e=ht,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=l}},function(l){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Uf(e),e}throw wr=t,sl}}function Nr(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(wr=a,sl):a}}var wr=null;function Lf(){if(wr===null)throw Error(i(459));var e=wr;return wr=null,e}function Uf(e){if(e===sl||e===mi)throw Error(i(483))}var il=null,Zl=0;function pi(e){var t=Zl;return Zl+=1,il===null&&(il=[]),Mf(il,e,t)}function Jl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function gi(e,t){throw t.$$typeof===S?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Hf(e){function t(D,k){if(e){var L=D.deletions;L===null?(D.deletions=[k],D.flags|=16):L.push(k)}}function a(D,k){if(!e)return null;for(;k!==null;)t(D,k),k=k.sibling;return null}function l(D){for(var k=new Map;D!==null;)D.key!==null?k.set(D.key,D):k.set(D.index,D),D=D.sibling;return k}function c(D,k){return D=yn(D,k),D.index=0,D.sibling=null,D}function f(D,k,L){return D.index=L,e?(L=D.alternate,L!==null?(L=L.index,L<k?(D.flags|=67108866,k):L):(D.flags|=67108866,k)):(D.flags|=1048576,k)}function x(D){return e&&D.alternate===null&&(D.flags|=67108866),D}function _(D,k,L,J){return k===null||k.tag!==6?(k=tc(L,D.mode,J),k.return=D,k):(k=c(k,L),k.return=D,k)}function R(D,k,L,J){var Ee=L.type;return Ee===T?F(D,k,L.props.children,J,L.key):k!==null&&(k.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===E&&Nr(Ee)===k.type)?(k=c(k,L.props),Jl(k,L),k.return=D,k):(k=oi(L.type,L.key,L.props,null,D.mode,J),Jl(k,L),k.return=D,k)}function U(D,k,L,J){return k===null||k.tag!==4||k.stateNode.containerInfo!==L.containerInfo||k.stateNode.implementation!==L.implementation?(k=ac(L,D.mode,J),k.return=D,k):(k=c(k,L.children||[]),k.return=D,k)}function F(D,k,L,J,Ee){return k===null||k.tag!==7?(k=br(L,D.mode,J,Ee),k.return=D,k):(k=c(k,L),k.return=D,k)}function I(D,k,L){if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return k=tc(""+k,D.mode,L),k.return=D,k;if(typeof k=="object"&&k!==null){switch(k.$$typeof){case j:return L=oi(k.type,k.key,k.props,null,D.mode,L),Jl(L,k),L.return=D,L;case N:return k=ac(k,D.mode,L),k.return=D,k;case E:return k=Nr(k),I(D,k,L)}if(ge(k)||oe(k))return k=br(k,D.mode,L,null),k.return=D,k;if(typeof k.then=="function")return I(D,pi(k),L);if(k.$$typeof===G)return I(D,di(D,k),L);gi(D,k)}return null}function H(D,k,L,J){var Ee=k!==null?k.key:null;if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return Ee!==null?null:_(D,k,""+L,J);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case j:return L.key===Ee?R(D,k,L,J):null;case N:return L.key===Ee?U(D,k,L,J):null;case E:return L=Nr(L),H(D,k,L,J)}if(ge(L)||oe(L))return Ee!==null?null:F(D,k,L,J,null);if(typeof L.then=="function")return H(D,k,pi(L),J);if(L.$$typeof===G)return H(D,k,di(D,L),J);gi(D,L)}return null}function V(D,k,L,J,Ee){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return D=D.get(L)||null,_(k,D,""+J,Ee);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case j:return D=D.get(J.key===null?L:J.key)||null,R(k,D,J,Ee);case N:return D=D.get(J.key===null?L:J.key)||null,U(k,D,J,Ee);case E:return J=Nr(J),V(D,k,L,J,Ee)}if(ge(J)||oe(J))return D=D.get(L)||null,F(k,D,J,Ee,null);if(typeof J.then=="function")return V(D,k,L,pi(J),Ee);if(J.$$typeof===G)return V(D,k,L,di(k,J),Ee);gi(k,J)}return null}function be(D,k,L,J){for(var Ee=null,at=null,Se=k,Be=k=0,Je=null;Se!==null&&Be<L.length;Be++){Se.index>Be?(Je=Se,Se=null):Je=Se.sibling;var nt=H(D,Se,L[Be],J);if(nt===null){Se===null&&(Se=Je);break}e&&Se&&nt.alternate===null&&t(D,Se),k=f(nt,k,Be),at===null?Ee=nt:at.sibling=nt,at=nt,Se=Je}if(Be===L.length)return a(D,Se),Ie&&bn(D,Be),Ee;if(Se===null){for(;Be<L.length;Be++)Se=I(D,L[Be],J),Se!==null&&(k=f(Se,k,Be),at===null?Ee=Se:at.sibling=Se,at=Se);return Ie&&bn(D,Be),Ee}for(Se=l(Se);Be<L.length;Be++)Je=V(Se,D,Be,L[Be],J),Je!==null&&(e&&Je.alternate!==null&&Se.delete(Je.key===null?Be:Je.key),k=f(Je,k,Be),at===null?Ee=Je:at.sibling=Je,at=Je);return e&&Se.forEach(function(sr){return t(D,sr)}),Ie&&bn(D,Be),Ee}function Te(D,k,L,J){if(L==null)throw Error(i(151));for(var Ee=null,at=null,Se=k,Be=k=0,Je=null,nt=L.next();Se!==null&&!nt.done;Be++,nt=L.next()){Se.index>Be?(Je=Se,Se=null):Je=Se.sibling;var sr=H(D,Se,nt.value,J);if(sr===null){Se===null&&(Se=Je);break}e&&Se&&sr.alternate===null&&t(D,Se),k=f(sr,k,Be),at===null?Ee=sr:at.sibling=sr,at=sr,Se=Je}if(nt.done)return a(D,Se),Ie&&bn(D,Be),Ee;if(Se===null){for(;!nt.done;Be++,nt=L.next())nt=I(D,nt.value,J),nt!==null&&(k=f(nt,k,Be),at===null?Ee=nt:at.sibling=nt,at=nt);return Ie&&bn(D,Be),Ee}for(Se=l(Se);!nt.done;Be++,nt=L.next())nt=V(Se,D,Be,nt.value,J),nt!==null&&(e&&nt.alternate!==null&&Se.delete(nt.key===null?Be:nt.key),k=f(nt,k,Be),at===null?Ee=nt:at.sibling=nt,at=nt);return e&&Se.forEach(function(Tv){return t(D,Tv)}),Ie&&bn(D,Be),Ee}function dt(D,k,L,J){if(typeof L=="object"&&L!==null&&L.type===T&&L.key===null&&(L=L.props.children),typeof L=="object"&&L!==null){switch(L.$$typeof){case j:e:{for(var Ee=L.key;k!==null;){if(k.key===Ee){if(Ee=L.type,Ee===T){if(k.tag===7){a(D,k.sibling),J=c(k,L.props.children),J.return=D,D=J;break e}}else if(k.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===E&&Nr(Ee)===k.type){a(D,k.sibling),J=c(k,L.props),Jl(J,L),J.return=D,D=J;break e}a(D,k);break}else t(D,k);k=k.sibling}L.type===T?(J=br(L.props.children,D.mode,J,L.key),J.return=D,D=J):(J=oi(L.type,L.key,L.props,null,D.mode,J),Jl(J,L),J.return=D,D=J)}return x(D);case N:e:{for(Ee=L.key;k!==null;){if(k.key===Ee)if(k.tag===4&&k.stateNode.containerInfo===L.containerInfo&&k.stateNode.implementation===L.implementation){a(D,k.sibling),J=c(k,L.children||[]),J.return=D,D=J;break e}else{a(D,k);break}else t(D,k);k=k.sibling}J=ac(L,D.mode,J),J.return=D,D=J}return x(D);case E:return L=Nr(L),dt(D,k,L,J)}if(ge(L))return be(D,k,L,J);if(oe(L)){if(Ee=oe(L),typeof Ee!="function")throw Error(i(150));return L=Ee.call(L),Te(D,k,L,J)}if(typeof L.then=="function")return dt(D,k,pi(L),J);if(L.$$typeof===G)return dt(D,k,di(D,L),J);gi(D,L)}return typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint"?(L=""+L,k!==null&&k.tag===6?(a(D,k.sibling),J=c(k,L),J.return=D,D=J):(a(D,k),J=tc(L,D.mode,J),J.return=D,D=J),x(D)):a(D,k)}return function(D,k,L,J){try{Zl=0;var Ee=dt(D,k,L,J);return il=null,Ee}catch(Se){if(Se===sl||Se===mi)throw Se;var at=Ea(29,Se,null,D.mode);return at.lanes=J,at.return=D,at}}}var Er=Hf(!0),Bf=Hf(!1),Gn=!1;function hc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function pc(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 Vn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Kn(e,t,a){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(rt&2)!==0){var c=l.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),l.pending=t,t=ii(e),Sf(e,null,a),t}return si(e,l,t,a),ii(e)}function Pl(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,qr(e,a)}}function gc(e,t){var a=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var c=null,f=null;if(a=a.firstBaseUpdate,a!==null){do{var x={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};f===null?c=f=x:f=f.next=x,a=a.next}while(a!==null);f===null?c=f=t:f=f.next=t}else c=f=t;a={baseState:l.baseState,firstBaseUpdate:c,lastBaseUpdate:f,shared:l.shared,callbacks:l.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var xc=!1;function Il(){if(xc){var e=ll;if(e!==null)throw e}}function Wl(e,t,a,l){xc=!1;var c=e.updateQueue;Gn=!1;var f=c.firstBaseUpdate,x=c.lastBaseUpdate,_=c.shared.pending;if(_!==null){c.shared.pending=null;var R=_,U=R.next;R.next=null,x===null?f=U:x.next=U,x=R;var F=e.alternate;F!==null&&(F=F.updateQueue,_=F.lastBaseUpdate,_!==x&&(_===null?F.firstBaseUpdate=U:_.next=U,F.lastBaseUpdate=R))}if(f!==null){var I=c.baseState;x=0,F=U=R=null,_=f;do{var H=_.lane&-536870913,V=H!==_.lane;if(V?(Ze&H)===H:(l&H)===H){H!==0&&H===rl&&(xc=!0),F!==null&&(F=F.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var be=e,Te=_;H=t;var dt=a;switch(Te.tag){case 1:if(be=Te.payload,typeof be=="function"){I=be.call(dt,I,H);break e}I=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=Te.payload,H=typeof be=="function"?be.call(dt,I,H):be,H==null)break e;I=b({},I,H);break e;case 2:Gn=!0}}H=_.callback,H!==null&&(e.flags|=64,V&&(e.flags|=8192),V=c.callbacks,V===null?c.callbacks=[H]:V.push(H))}else V={lane:H,tag:_.tag,payload:_.payload,callback:_.callback,next:null},F===null?(U=F=V,R=I):F=F.next=V,x|=H;if(_=_.next,_===null){if(_=c.shared.pending,_===null)break;V=_,_=V.next,V.next=null,c.lastBaseUpdate=V,c.shared.pending=null}}while(!0);F===null&&(R=I),c.baseState=R,c.firstBaseUpdate=U,c.lastBaseUpdate=F,f===null&&(c.shared.lanes=0),Jn|=x,e.lanes=x,e.memoizedState=I}}function $f(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function qf(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)$f(a[e],t)}var ol=w(null),xi=w(0);function Yf(e,t){e=kn,ee(xi,e),ee(ol,t),kn=e|t.baseLanes}function yc(){ee(xi,kn),ee(ol,ol.current)}function bc(){kn=xi.current,$(ol),$(xi)}var Ca=w(null),Ya=null;function Xn(e){var t=e.alternate;ee(Ot,Ot.current&1),ee(Ca,e),Ya===null&&(t===null||ol.current!==null||t.memoizedState!==null)&&(Ya=e)}function vc(e){ee(Ot,Ot.current),ee(Ca,e),Ya===null&&(Ya=e)}function Gf(e){e.tag===22?(ee(Ot,Ot.current),ee(Ca,e),Ya===null&&(Ya=e)):Qn()}function Qn(){ee(Ot,Ot.current),ee(Ca,Ca.current)}function Ra(e){$(Ca),Ya===e&&(Ya=null),$(Ot)}var Ot=w(0);function yi(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Eu(a)||Cu(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 Sn=0,He=null,ct=null,Ut=null,bi=!1,cl=!1,Cr=!1,vi=0,es=0,ul=null,bb=0;function Et(){throw Error(i(321))}function _c(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!wa(e[a],t[a]))return!1;return!0}function Sc(e,t,a,l,c,f){return Sn=f,He=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?Em:Uc,Cr=!1,f=a(l,c),Cr=!1,cl&&(f=Kf(t,a,l,c)),Vf(e),f}function Vf(e){A.H=ns;var t=ct!==null&&ct.next!==null;if(Sn=0,Ut=ct=He=null,bi=!1,es=0,ul=null,t)throw Error(i(300));e===null||Ht||(e=e.dependencies,e!==null&&ui(e)&&(Ht=!0))}function Kf(e,t,a,l){He=e;var c=0;do{if(cl&&(ul=null),es=0,cl=!1,25<=c)throw Error(i(301));if(c+=1,Ut=ct=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}A.H=Cm,f=t(a,l)}while(cl);return f}function vb(){var e=A.H,t=e.useState()[0];return t=typeof t.then=="function"?ts(t):t,e=e.useState()[0],(ct!==null?ct.memoizedState:null)!==e&&(He.flags|=1024),t}function jc(){var e=vi!==0;return vi=0,e}function Nc(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function wc(e){if(bi){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}bi=!1}Sn=0,Ut=ct=He=null,cl=!1,es=vi=0,ul=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 zt(){if(ct===null){var e=He.alternate;e=e!==null?e.memoizedState:null}else e=ct.next;var t=Ut===null?He.memoizedState:Ut.next;if(t!==null)Ut=t,ct=e;else{if(e===null)throw He.alternate===null?Error(i(467)):Error(i(310));ct=e,e={memoizedState:ct.memoizedState,baseState:ct.baseState,baseQueue:ct.baseQueue,queue:ct.queue,next:null},Ut===null?He.memoizedState=Ut=e:Ut=Ut.next=e}return Ut}function _i(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ts(e){var t=es;return es+=1,ul===null&&(ul=[]),e=Mf(ul,e,t),t=He,(Ut===null?t.memoizedState:Ut.next)===null&&(t=t.alternate,A.H=t===null||t.memoizedState===null?Em:Uc),e}function Si(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ts(e);if(e.$$typeof===G)return Jt(e)}throw Error(i(438,String(e)))}function Ec(e){var t=null,a=He.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var l=He.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=_i(),He.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),l=0;l<e;l++)a[l]=W;return t.index++,a}function jn(e,t){return typeof t=="function"?t(e):t}function ji(e){var t=zt();return Cc(t,ct,e)}function Cc(e,t,a){var l=e.queue;if(l===null)throw Error(i(311));l.lastRenderedReducer=a;var c=e.baseQueue,f=l.pending;if(f!==null){if(c!==null){var x=c.next;c.next=f.next,f.next=x}t.baseQueue=c=f,l.pending=null}if(f=e.baseState,c===null)e.memoizedState=f;else{t=c.next;var _=x=null,R=null,U=t,F=!1;do{var I=U.lane&-536870913;if(I!==U.lane?(Ze&I)===I:(Sn&I)===I){var H=U.revertLane;if(H===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null}),I===rl&&(F=!0);else if((Sn&H)===H){U=U.next,H===rl&&(F=!0);continue}else I={lane:0,revertLane:U.revertLane,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},R===null?(_=R=I,x=f):R=R.next=I,He.lanes|=H,Jn|=H;I=U.action,Cr&&a(f,I),f=U.hasEagerState?U.eagerState:a(f,I)}else H={lane:I,revertLane:U.revertLane,gesture:U.gesture,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},R===null?(_=R=H,x=f):R=R.next=H,He.lanes|=I,Jn|=I;U=U.next}while(U!==null&&U!==t);if(R===null?x=f:R.next=_,!wa(f,e.memoizedState)&&(Ht=!0,F&&(a=ll,a!==null)))throw a;e.memoizedState=f,e.baseState=x,e.baseQueue=R,l.lastRenderedState=f}return c===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Rc(e){var t=zt(),a=t.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=e;var l=a.dispatch,c=a.pending,f=t.memoizedState;if(c!==null){a.pending=null;var x=c=c.next;do f=e(f,x.action),x=x.next;while(x!==c);wa(f,t.memoizedState)||(Ht=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),a.lastRenderedState=f}return[f,l]}function Xf(e,t,a){var l=He,c=zt(),f=Ie;if(f){if(a===void 0)throw Error(i(407));a=a()}else a=t();var x=!wa((ct||c).memoizedState,a);if(x&&(c.memoizedState=a,Ht=!0),c=c.queue,Oc(Zf.bind(null,l,c,e),[e]),c.getSnapshot!==t||x||Ut!==null&&Ut.memoizedState.tag&1){if(l.flags|=2048,dl(9,{destroy:void 0},Ff.bind(null,l,c,a,t),null),ht===null)throw Error(i(349));f||(Sn&127)!==0||Qf(l,t,a)}return a}function Qf(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=He.updateQueue,t===null?(t=_i(),He.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Ff(e,t,a,l){t.value=a,t.getSnapshot=l,Jf(t)&&Pf(e)}function Zf(e,t,a){return a(function(){Jf(t)&&Pf(e)})}function Jf(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!wa(e,a)}catch{return!0}}function Pf(e){var t=yr(e,2);t!==null&&ba(t,e,2)}function Tc(e){var t=ua();if(typeof e=="function"){var a=e;if(e=a(),Cr){xt(!0);try{a()}finally{xt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jn,lastRenderedState:e},t}function If(e,t,a,l){return e.baseState=a,Cc(e,ct,typeof l=="function"?l:jn)}function _b(e,t,a,l,c){if(Ei(e))throw Error(i(485));if(e=t.action,e!==null){var f={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){f.listeners.push(x)}};A.T!==null?a(!0):f.isTransition=!1,l(f),a=t.pending,a===null?(f.next=t.pending=f,Wf(t,f)):(f.next=a.next,t.pending=a.next=f)}}function Wf(e,t){var a=t.action,l=t.payload,c=e.state;if(t.isTransition){var f=A.T,x={};A.T=x;try{var _=a(c,l),R=A.S;R!==null&&R(x,_),em(e,t,_)}catch(U){kc(e,t,U)}finally{f!==null&&x.types!==null&&(f.types=x.types),A.T=f}}else try{f=a(c,l),em(e,t,f)}catch(U){kc(e,t,U)}}function em(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){tm(e,t,l)},function(l){return kc(e,t,l)}):tm(e,t,a)}function tm(e,t,a){t.status="fulfilled",t.value=a,am(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Wf(e,a)))}function kc(e,t,a){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=a,am(t),t=t.next;while(t!==l)}e.action=null}function am(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function nm(e,t){return t}function rm(e,t){if(Ie){var a=ht.formState;if(a!==null){e:{var l=He;if(Ie){if(_t){t:{for(var c=_t,f=qa;c.nodeType!==8;){if(!f){c=null;break t}if(c=Ga(c.nextSibling),c===null){c=null;break t}}f=c.data,c=f==="F!"||f==="F"?c:null}if(c){_t=Ga(c.nextSibling),l=c.data==="F!";break e}}qn(l)}l=!1}l&&(t=a[0])}}return a=ua(),a.memoizedState=a.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:nm,lastRenderedState:t},a.queue=l,a=jm.bind(null,He,l),l.dispatch=a,l=Tc(!1),f=Lc.bind(null,He,!1,l.queue),l=ua(),c={state:t,dispatch:null,action:e,pending:null},l.queue=c,a=_b.bind(null,He,c,f,a),c.dispatch=a,l.memoizedState=e,[t,a,!1]}function lm(e){var t=zt();return sm(t,ct,e)}function sm(e,t,a){if(t=Cc(e,t,nm)[0],e=ji(jn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=ts(t)}catch(x){throw x===sl?mi:x}else l=t;t=zt();var c=t.queue,f=c.dispatch;return a!==t.memoizedState&&(He.flags|=2048,dl(9,{destroy:void 0},Sb.bind(null,c,a),null)),[l,f,e]}function Sb(e,t){e.action=t}function im(e){var t=zt(),a=ct;if(a!==null)return sm(t,a,e);zt(),t=t.memoizedState,a=zt();var l=a.queue.dispatch;return a.memoizedState=e,[t,l,!1]}function dl(e,t,a,l){return e={tag:e,create:a,deps:l,inst:t,next:null},t=He.updateQueue,t===null&&(t=_i(),He.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(l=a.next,a.next=e,e.next=l,t.lastEffect=e),e}function om(){return zt().memoizedState}function Ni(e,t,a,l){var c=ua();He.flags|=e,c.memoizedState=dl(1|t,{destroy:void 0},a,l===void 0?null:l)}function wi(e,t,a,l){var c=zt();l=l===void 0?null:l;var f=c.memoizedState.inst;ct!==null&&l!==null&&_c(l,ct.memoizedState.deps)?c.memoizedState=dl(t,f,a,l):(He.flags|=e,c.memoizedState=dl(1|t,f,a,l))}function cm(e,t){Ni(8390656,8,e,t)}function Oc(e,t){wi(2048,8,e,t)}function jb(e){He.flags|=4;var t=He.updateQueue;if(t===null)t=_i(),He.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function um(e){var t=zt().memoizedState;return jb({ref:t,nextImpl:e}),function(){if((rt&2)!==0)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function dm(e,t){return wi(4,2,e,t)}function fm(e,t){return wi(4,4,e,t)}function mm(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 hm(e,t,a){a=a!=null?a.concat([e]):null,wi(4,4,mm.bind(null,t,e),a)}function zc(){}function pm(e,t){var a=zt();t=t===void 0?null:t;var l=a.memoizedState;return t!==null&&_c(t,l[1])?l[0]:(a.memoizedState=[e,t],e)}function gm(e,t){var a=zt();t=t===void 0?null:t;var l=a.memoizedState;if(t!==null&&_c(t,l[1]))return l[0];if(l=e(),Cr){xt(!0);try{e()}finally{xt(!1)}}return a.memoizedState=[l,t],l}function Dc(e,t,a){return a===void 0||(Sn&1073741824)!==0&&(Ze&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=xh(),He.lanes|=e,Jn|=e,a)}function xm(e,t,a,l){return wa(a,t)?a:ol.current!==null?(e=Dc(e,a,l),wa(e,t)||(Ht=!0),e):(Sn&42)===0||(Sn&1073741824)!==0&&(Ze&261930)===0?(Ht=!0,e.memoizedState=a):(e=xh(),He.lanes|=e,Jn|=e,t)}function ym(e,t,a,l,c){var f=P.p;P.p=f!==0&&8>f?f:8;var x=A.T,_={};A.T=_,Lc(e,!1,t,a);try{var R=c(),U=A.S;if(U!==null&&U(_,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var F=yb(R,l);as(e,t,F,Oa(e))}else as(e,t,l,Oa(e))}catch(I){as(e,t,{then:function(){},status:"rejected",reason:I},Oa())}finally{P.p=f,x!==null&&_.types!==null&&(x.types=_.types),A.T=x}}function Nb(){}function Ac(e,t,a,l){if(e.tag!==5)throw Error(i(476));var c=bm(e).queue;ym(e,c,t,fe,a===null?Nb:function(){return vm(e),a(l)})}function bm(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:jn,lastRenderedState:fe},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function vm(e){var t=bm(e);t.next===null&&(t=e.alternate.memoizedState),as(e,t.next.queue,{},Oa())}function Mc(){return Jt(bs)}function _m(){return zt().memoizedState}function Sm(){return zt().memoizedState}function wb(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Oa();e=Vn(a);var l=Kn(t,e,a);l!==null&&(ba(l,t,a),Pl(l,t,a)),t={cache:uc()},e.payload=t;return}t=t.return}}function Eb(e,t,a){var l=Oa();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Ei(e)?Nm(t,a):(a=Wo(e,t,a,l),a!==null&&(ba(a,e,l),wm(a,t,l)))}function jm(e,t,a){var l=Oa();as(e,t,a,l)}function as(e,t,a,l){var c={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Ei(e))Nm(t,c);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var x=t.lastRenderedState,_=f(x,a);if(c.hasEagerState=!0,c.eagerState=_,wa(_,x))return si(e,t,c,0),ht===null&&li(),!1}catch{}if(a=Wo(e,t,c,l),a!==null)return ba(a,e,l),wm(a,t,l),!0}return!1}function Lc(e,t,a,l){if(l={lane:2,revertLane:hu(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Ei(e)){if(t)throw Error(i(479))}else t=Wo(e,a,l,2),t!==null&&ba(t,e,2)}function Ei(e){var t=e.alternate;return e===He||t!==null&&t===He}function Nm(e,t){cl=bi=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function wm(e,t,a){if((a&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,qr(e,a)}}var ns={readContext:Jt,use:Si,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 Em={readContext:Jt,use:Si,useCallback:function(e,t){return ua().memoizedState=[e,t===void 0?null:t],e},useContext:Jt,useEffect:cm,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Ni(4194308,4,mm.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Ni(4194308,4,e,t)},useInsertionEffect:function(e,t){Ni(4,2,e,t)},useMemo:function(e,t){var a=ua();t=t===void 0?null:t;var l=e();if(Cr){xt(!0);try{e()}finally{xt(!1)}}return a.memoizedState=[l,t],l},useReducer:function(e,t,a){var l=ua();if(a!==void 0){var c=a(t);if(Cr){xt(!0);try{a(t)}finally{xt(!1)}}}else c=t;return l.memoizedState=l.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},l.queue=e,e=e.dispatch=Eb.bind(null,He,e),[l.memoizedState,e]},useRef:function(e){var t=ua();return e={current:e},t.memoizedState=e},useState:function(e){e=Tc(e);var t=e.queue,a=jm.bind(null,He,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:zc,useDeferredValue:function(e,t){var a=ua();return Dc(a,e,t)},useTransition:function(){var e=Tc(!1);return e=ym.bind(null,He,e.queue,!0,!1),ua().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var l=He,c=ua();if(Ie){if(a===void 0)throw Error(i(407));a=a()}else{if(a=t(),ht===null)throw Error(i(349));(Ze&127)!==0||Qf(l,t,a)}c.memoizedState=a;var f={value:a,getSnapshot:t};return c.queue=f,cm(Zf.bind(null,l,f,e),[e]),l.flags|=2048,dl(9,{destroy:void 0},Ff.bind(null,l,f,a,t),null),a},useId:function(){var e=ua(),t=ht.identifierPrefix;if(Ie){var a=un,l=cn;a=(l&~(1<<32-Dt(l)-1)).toString(32)+a,t="_"+t+"R_"+a,a=vi++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=bb++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Mc,useFormState:rm,useActionState:rm,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=Lc.bind(null,He,!0,a),a.dispatch=t,[e,t]},useMemoCache:Ec,useCacheRefresh:function(){return ua().memoizedState=wb.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)}}},Uc={readContext:Jt,use:Si,useCallback:pm,useContext:Jt,useEffect:Oc,useImperativeHandle:hm,useInsertionEffect:dm,useLayoutEffect:fm,useMemo:gm,useReducer:ji,useRef:om,useState:function(){return ji(jn)},useDebugValue:zc,useDeferredValue:function(e,t){var a=zt();return xm(a,ct.memoizedState,e,t)},useTransition:function(){var e=ji(jn)[0],t=zt().memoizedState;return[typeof e=="boolean"?e:ts(e),t]},useSyncExternalStore:Xf,useId:_m,useHostTransitionStatus:Mc,useFormState:lm,useActionState:lm,useOptimistic:function(e,t){var a=zt();return If(a,ct,e,t)},useMemoCache:Ec,useCacheRefresh:Sm};Uc.useEffectEvent=um;var Cm={readContext:Jt,use:Si,useCallback:pm,useContext:Jt,useEffect:Oc,useImperativeHandle:hm,useInsertionEffect:dm,useLayoutEffect:fm,useMemo:gm,useReducer:Rc,useRef:om,useState:function(){return Rc(jn)},useDebugValue:zc,useDeferredValue:function(e,t){var a=zt();return ct===null?Dc(a,e,t):xm(a,ct.memoizedState,e,t)},useTransition:function(){var e=Rc(jn)[0],t=zt().memoizedState;return[typeof e=="boolean"?e:ts(e),t]},useSyncExternalStore:Xf,useId:_m,useHostTransitionStatus:Mc,useFormState:im,useActionState:im,useOptimistic:function(e,t){var a=zt();return ct!==null?If(a,ct,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Ec,useCacheRefresh:Sm};Cm.useEffectEvent=um;function Hc(e,t,a,l){t=e.memoizedState,a=a(l,t),a=a==null?t:b({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Bc={enqueueSetState:function(e,t,a){e=e._reactInternals;var l=Oa(),c=Vn(l);c.payload=t,a!=null&&(c.callback=a),t=Kn(e,c,l),t!==null&&(ba(t,e,l),Pl(t,e,l))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var l=Oa(),c=Vn(l);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=Kn(e,c,l),t!==null&&(ba(t,e,l),Pl(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Oa(),l=Vn(a);l.tag=2,t!=null&&(l.callback=t),t=Kn(e,l,a),t!==null&&(ba(t,e,a),Pl(t,e,a))}};function Rm(e,t,a,l,c,f,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,f,x):t.prototype&&t.prototype.isPureReactComponent?!Gl(a,l)||!Gl(c,f):!0}function Tm(e,t,a,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,l),t.state!==e&&Bc.enqueueReplaceState(t,t.state,null)}function Rr(e,t){var a=t;if("ref"in t){a={};for(var l in t)l!=="ref"&&(a[l]=t[l])}if(e=e.defaultProps){a===t&&(a=b({},a));for(var c in e)a[c]===void 0&&(a[c]=e[c])}return a}function km(e){ri(e)}function Om(e){console.error(e)}function zm(e){ri(e)}function Ci(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function Dm(e,t,a){try{var l=e.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function $c(e,t,a){return a=Vn(a),a.tag=3,a.payload={element:null},a.callback=function(){Ci(e,t)},a}function Am(e){return e=Vn(e),e.tag=3,e}function Mm(e,t,a,l){var c=a.type.getDerivedStateFromError;if(typeof c=="function"){var f=l.value;e.payload=function(){return c(f)},e.callback=function(){Dm(t,a,l)}}var x=a.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){Dm(t,a,l),typeof c!="function"&&(Pn===null?Pn=new Set([this]):Pn.add(this));var _=l.stack;this.componentDidCatch(l.value,{componentStack:_!==null?_:""})})}function Cb(e,t,a,l,c){if(a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=a.alternate,t!==null&&nl(t,a,c,!0),a=Ca.current,a!==null){switch(a.tag){case 31:case 13:return Ya===null?Bi():a.alternate===null&&Ct===0&&(Ct=3),a.flags&=-257,a.flags|=65536,a.lanes=c,l===hi?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([l]):t.add(l),du(e,l,c)),!1;case 22:return a.flags|=65536,l===hi?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([l]):a.add(l)),du(e,l,c)),!1}throw Error(i(435,a.tag))}return du(e,l,c),Bi(),!1}if(Ie)return t=Ca.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,l!==lc&&(e=Error(i(422),{cause:l}),Xl(Ha(e,a)))):(l!==lc&&(t=Error(i(423),{cause:l}),Xl(Ha(t,a))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,l=Ha(l,a),c=$c(e.stateNode,l,c),gc(e,c),Ct!==4&&(Ct=2)),!1;var f=Error(i(520),{cause:l});if(f=Ha(f,a),ds===null?ds=[f]:ds.push(f),Ct!==4&&(Ct=2),t===null)return!0;l=Ha(l,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=c&-c,a.lanes|=e,e=$c(a.stateNode,l,e),gc(a,e),!1;case 1:if(t=a.type,f=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Pn===null||!Pn.has(f))))return a.flags|=65536,c&=-c,a.lanes|=c,c=Am(c),Mm(c,e,a,l),gc(a,c),!1}a=a.return}while(a!==null);return!1}var qc=Error(i(461)),Ht=!1;function Pt(e,t,a,l){t.child=e===null?Bf(t,null,a,l):Er(t,e.child,a,l)}function Lm(e,t,a,l,c){a=a.render;var f=t.ref;if("ref"in l){var x={};for(var _ in l)_!=="ref"&&(x[_]=l[_])}else x=l;return Sr(t),l=Sc(e,t,a,x,f,c),_=jc(),e!==null&&!Ht?(Nc(e,t,c),Nn(e,t,c)):(Ie&&_&&nc(t),t.flags|=1,Pt(e,t,l,c),t.child)}function Um(e,t,a,l,c){if(e===null){var f=a.type;return typeof f=="function"&&!ec(f)&&f.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=f,Hm(e,t,f,l,c)):(e=oi(a.type,null,l,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!Zc(e,c)){var x=f.memoizedProps;if(a=a.compare,a=a!==null?a:Gl,a(x,l)&&e.ref===t.ref)return Nn(e,t,c)}return t.flags|=1,e=yn(f,l),e.ref=t.ref,e.return=t,t.child=e}function Hm(e,t,a,l,c){if(e!==null){var f=e.memoizedProps;if(Gl(f,l)&&e.ref===t.ref)if(Ht=!1,t.pendingProps=l=f,Zc(e,c))(e.flags&131072)!==0&&(Ht=!0);else return t.lanes=e.lanes,Nn(e,t,c)}return Yc(e,t,a,l,c)}function Bm(e,t,a,l){var c=l.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|a:a,e!==null){for(l=t.child=e.child,c=0;l!==null;)c=c|l.lanes|l.childLanes,l=l.sibling;l=c&~f}else l=0,t.child=null;return $m(e,t,f,a,l)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&fi(t,f!==null?f.cachePool:null),f!==null?Yf(t,f):yc(),Gf(t);else return l=t.lanes=536870912,$m(e,t,f!==null?f.baseLanes|a:a,a,l)}else f!==null?(fi(t,f.cachePool),Yf(t,f),Qn(),t.memoizedState=null):(e!==null&&fi(t,null),yc(),Qn());return Pt(e,t,c,a),t.child}function rs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function $m(e,t,a,l,c){var f=fc();return f=f===null?null:{parent:Lt._currentValue,pool:f},t.memoizedState={baseLanes:a,cachePool:f},e!==null&&fi(t,null),yc(),Gf(t),e!==null&&nl(e,t,l,!0),t.childLanes=c,null}function Ri(e,t){return t=ki({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function qm(e,t,a){return Er(t,e.child,null,a),e=Ri(t,t.pendingProps),e.flags|=2,Ra(t),t.memoizedState=null,e}function Rb(e,t,a){var l=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ie){if(l.mode==="hidden")return e=Ri(t,l),t.lanes=536870912,rs(null,e);if(vc(t),(e=_t)?(e=Wh(e,qa),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Bn!==null?{id:cn,overflow:un}:null,retryLane:536870912,hydrationErrors:null},a=Nf(e),a.return=t,t.child=a,Zt=t,_t=null)):e=null,e===null)throw qn(t);return t.lanes=536870912,null}return Ri(t,l)}var f=e.memoizedState;if(f!==null){var x=f.dehydrated;if(vc(t),c)if(t.flags&256)t.flags&=-257,t=qm(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||nl(e,t,a,!1),c=(a&e.childLanes)!==0,Ht||c){if(l=ht,l!==null&&(x=C(l,a),x!==0&&x!==f.retryLane))throw f.retryLane=x,yr(e,x),ba(l,e,x),qc;Bi(),t=qm(e,t,a)}else e=f.treeContext,_t=Ga(x.nextSibling),Zt=t,Ie=!0,$n=null,qa=!1,e!==null&&Cf(t,e),t=Ri(t,l),t.flags|=4096;return t}return e=yn(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ti(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 Yc(e,t,a,l,c){return Sr(t),a=Sc(e,t,a,l,void 0,c),l=jc(),e!==null&&!Ht?(Nc(e,t,c),Nn(e,t,c)):(Ie&&l&&nc(t),t.flags|=1,Pt(e,t,a,c),t.child)}function Ym(e,t,a,l,c,f){return Sr(t),t.updateQueue=null,a=Kf(t,l,a,c),Vf(e),l=jc(),e!==null&&!Ht?(Nc(e,t,f),Nn(e,t,f)):(Ie&&l&&nc(t),t.flags|=1,Pt(e,t,a,f),t.child)}function Gm(e,t,a,l,c){if(Sr(t),t.stateNode===null){var f=Wr,x=a.contextType;typeof x=="object"&&x!==null&&(f=Jt(x)),f=new a(l,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Bc,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=l,f.state=t.memoizedState,f.refs={},hc(t),x=a.contextType,f.context=typeof x=="object"&&x!==null?Jt(x):Wr,f.state=t.memoizedState,x=a.getDerivedStateFromProps,typeof x=="function"&&(Hc(t,a,x,l),f.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(x=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),x!==f.state&&Bc.enqueueReplaceState(f,f.state,null),Wl(t,l,f,c),Il(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){f=t.stateNode;var _=t.memoizedProps,R=Rr(a,_);f.props=R;var U=f.context,F=a.contextType;x=Wr,typeof F=="object"&&F!==null&&(x=Jt(F));var I=a.getDerivedStateFromProps;F=typeof I=="function"||typeof f.getSnapshotBeforeUpdate=="function",_=t.pendingProps!==_,F||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(_||U!==x)&&Tm(t,f,l,x),Gn=!1;var H=t.memoizedState;f.state=H,Wl(t,l,f,c),Il(),U=t.memoizedState,_||H!==U||Gn?(typeof I=="function"&&(Hc(t,a,I,l),U=t.memoizedState),(R=Gn||Rm(t,a,R,l,H,U,x))?(F||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=U),f.props=l,f.state=U,f.context=x,l=R):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{f=t.stateNode,pc(e,t),x=t.memoizedProps,F=Rr(a,x),f.props=F,I=t.pendingProps,H=f.context,U=a.contextType,R=Wr,typeof U=="object"&&U!==null&&(R=Jt(U)),_=a.getDerivedStateFromProps,(U=typeof _=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(x!==I||H!==R)&&Tm(t,f,l,R),Gn=!1,H=t.memoizedState,f.state=H,Wl(t,l,f,c),Il();var V=t.memoizedState;x!==I||H!==V||Gn||e!==null&&e.dependencies!==null&&ui(e.dependencies)?(typeof _=="function"&&(Hc(t,a,_,l),V=t.memoizedState),(F=Gn||Rm(t,a,F,l,H,V,R)||e!==null&&e.dependencies!==null&&ui(e.dependencies))?(U||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(l,V,R),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(l,V,R)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||x===e.memoizedProps&&H===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&H===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=V),f.props=l,f.state=V,f.context=R,l=F):(typeof f.componentDidUpdate!="function"||x===e.memoizedProps&&H===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&H===e.memoizedState||(t.flags|=1024),l=!1)}return f=l,Ti(e,t),l=(t.flags&128)!==0,f||l?(f=t.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&l?(t.child=Er(t,e.child,null,c),t.child=Er(t,null,a,c)):Pt(e,t,a,c),t.memoizedState=f.state,e=t.child):e=Nn(e,t,c),e}function Vm(e,t,a,l){return vr(),t.flags|=256,Pt(e,t,a,l),t.child}var Gc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Vc(e){return{baseLanes:e,cachePool:Df()}}function Kc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=ka),e}function Km(e,t,a){var l=t.pendingProps,c=!1,f=(t.flags&128)!==0,x;if((x=f)||(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(Ie){if(c?Xn(t):Qn(),(e=_t)?(e=Wh(e,qa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Bn!==null?{id:cn,overflow:un}:null,retryLane:536870912,hydrationErrors:null},a=Nf(e),a.return=t,t.child=a,Zt=t,_t=null)):e=null,e===null)throw qn(t);return Cu(e)?t.lanes=32:t.lanes=536870912,null}var _=l.children;return l=l.fallback,c?(Qn(),c=t.mode,_=ki({mode:"hidden",children:_},c),l=br(l,c,a,null),_.return=t,l.return=t,_.sibling=l,t.child=_,l=t.child,l.memoizedState=Vc(a),l.childLanes=Kc(e,x,a),t.memoizedState=Gc,rs(null,l)):(Xn(t),Xc(t,_))}var R=e.memoizedState;if(R!==null&&(_=R.dehydrated,_!==null)){if(f)t.flags&256?(Xn(t),t.flags&=-257,t=Qc(e,t,a)):t.memoizedState!==null?(Qn(),t.child=e.child,t.flags|=128,t=null):(Qn(),_=l.fallback,c=t.mode,l=ki({mode:"visible",children:l.children},c),_=br(_,c,a,null),_.flags|=2,l.return=t,_.return=t,l.sibling=_,t.child=l,Er(t,e.child,null,a),l=t.child,l.memoizedState=Vc(a),l.childLanes=Kc(e,x,a),t.memoizedState=Gc,t=rs(null,l));else if(Xn(t),Cu(_)){if(x=_.nextSibling&&_.nextSibling.dataset,x)var U=x.dgst;x=U,l=Error(i(419)),l.stack="",l.digest=x,Xl({value:l,source:null,stack:null}),t=Qc(e,t,a)}else if(Ht||nl(e,t,a,!1),x=(a&e.childLanes)!==0,Ht||x){if(x=ht,x!==null&&(l=C(x,a),l!==0&&l!==R.retryLane))throw R.retryLane=l,yr(e,l),ba(x,e,l),qc;Eu(_)||Bi(),t=Qc(e,t,a)}else Eu(_)?(t.flags|=192,t.child=e.child,t=null):(e=R.treeContext,_t=Ga(_.nextSibling),Zt=t,Ie=!0,$n=null,qa=!1,e!==null&&Cf(t,e),t=Xc(t,l.children),t.flags|=4096);return t}return c?(Qn(),_=l.fallback,c=t.mode,R=e.child,U=R.sibling,l=yn(R,{mode:"hidden",children:l.children}),l.subtreeFlags=R.subtreeFlags&65011712,U!==null?_=yn(U,_):(_=br(_,c,a,null),_.flags|=2),_.return=t,l.return=t,l.sibling=_,t.child=l,rs(null,l),l=t.child,_=e.child.memoizedState,_===null?_=Vc(a):(c=_.cachePool,c!==null?(R=Lt._currentValue,c=c.parent!==R?{parent:R,pool:R}:c):c=Df(),_={baseLanes:_.baseLanes|a,cachePool:c}),l.memoizedState=_,l.childLanes=Kc(e,x,a),t.memoizedState=Gc,rs(e.child,l)):(Xn(t),a=e.child,e=a.sibling,a=yn(a,{mode:"visible",children:l.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 Xc(e,t){return t=ki({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ki(e,t){return e=Ea(22,e,null,t),e.lanes=0,e}function Qc(e,t,a){return Er(t,e.child,null,a),e=Xc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Xm(e,t,a){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),oc(e.return,t,a)}function Fc(e,t,a,l,c,f){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:c,treeForkCount:f}:(x.isBackwards=t,x.rendering=null,x.renderingStartTime=0,x.last=l,x.tail=a,x.tailMode=c,x.treeForkCount=f)}function Qm(e,t,a){var l=t.pendingProps,c=l.revealOrder,f=l.tail;l=l.children;var x=Ot.current,_=(x&2)!==0;if(_?(x=x&1|2,t.flags|=128):x&=1,ee(Ot,x),Pt(e,t,l,a),l=Ie?Kl:0,!_&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xm(e,a,t);else if(e.tag===19)Xm(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&&yi(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),Fc(t,!1,c,a,f,l);break;case"backwards":case"unstable_legacy-backwards":for(a=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&yi(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}Fc(t,!0,a,null,f,l);break;case"together":Fc(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function Nn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Jn|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(nl(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=yn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=yn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Zc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ui(e)))}function Tb(e,t,a){switch(t.tag){case 3:Pe(t,t.stateNode.containerInfo),Yn(t,Lt,e.memoizedState.cache),vr();break;case 27:case 5:Wt(t);break;case 4:Pe(t,t.stateNode.containerInfo);break;case 10:Yn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,vc(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Xn(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Km(e,t,a):(Xn(t),e=Nn(e,t,a),e!==null?e.sibling:null);Xn(t);break;case 19:var c=(e.flags&128)!==0;if(l=(a&t.childLanes)!==0,l||(nl(e,t,a,!1),l=(a&t.childLanes)!==0),c){if(l)return Qm(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),ee(Ot,Ot.current),l)break;return null;case 22:return t.lanes=0,Bm(e,t,a,t.pendingProps);case 24:Yn(t,Lt,e.memoizedState.cache)}return Nn(e,t,a)}function Fm(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ht=!0;else{if(!Zc(e,a)&&(t.flags&128)===0)return Ht=!1,Tb(e,t,a);Ht=(e.flags&131072)!==0}else Ht=!1,Ie&&(t.flags&1048576)!==0&&Ef(t,Kl,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Nr(t.elementType),t.type=e,typeof e=="function")ec(e)?(l=Rr(e,l),t.tag=1,t=Gm(null,t,e,l,a)):(t.tag=0,t=Yc(null,t,e,l,a));else{if(e!=null){var c=e.$$typeof;if(c===M){t.tag=11,t=Lm(null,t,e,l,a);break e}else if(c===Z){t.tag=14,t=Um(null,t,e,l,a);break e}}throw t=ue(e)||e,Error(i(306,t,""))}}return t;case 0:return Yc(e,t,t.type,t.pendingProps,a);case 1:return l=t.type,c=Rr(l,t.pendingProps),Gm(e,t,l,c,a);case 3:e:{if(Pe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));l=t.pendingProps;var f=t.memoizedState;c=f.element,pc(e,t),Wl(t,l,null,a);var x=t.memoizedState;if(l=x.cache,Yn(t,Lt,l),l!==f.cache&&cc(t,[Lt],a,!0),Il(),l=x.element,f.isDehydrated)if(f={element:l,isDehydrated:!1,cache:x.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=Vm(e,t,l,a);break e}else if(l!==c){c=Ha(Error(i(424)),t),Xl(c),t=Vm(e,t,l,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,_t=Ga(e.firstChild),Zt=t,Ie=!0,$n=null,qa=!0,a=Bf(t,null,l,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(vr(),l===c){t=Nn(e,t,a);break e}Pt(e,t,l,a)}t=t.child}return t;case 26:return Ti(e,t),e===null?(a=lp(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ie||(a=t.type,e=t.pendingProps,l=Xi(ve.current).createElement(a),l[ce]=t,l[he]=e,It(l,a,e),yt(l),t.stateNode=l):t.memoizedState=lp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Wt(t),e===null&&Ie&&(l=t.stateNode=ap(t.type,t.pendingProps,ve.current),Zt=t,qa=!0,c=_t,tr(t.type)?(Ru=c,_t=Ga(l.firstChild)):_t=c),Pt(e,t,t.pendingProps.children,a),Ti(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ie&&((c=l=_t)&&(l=lv(l,t.type,t.pendingProps,qa),l!==null?(t.stateNode=l,Zt=t,_t=Ga(l.firstChild),qa=!1,c=!0):c=!1),c||qn(t)),Wt(t),c=t.type,f=t.pendingProps,x=e!==null?e.memoizedProps:null,l=f.children,ju(c,f)?l=null:x!==null&&ju(c,x)&&(t.flags|=32),t.memoizedState!==null&&(c=Sc(e,t,vb,null,null,a),bs._currentValue=c),Ti(e,t),Pt(e,t,l,a),t.child;case 6:return e===null&&Ie&&((e=a=_t)&&(a=sv(a,t.pendingProps,qa),a!==null?(t.stateNode=a,Zt=t,_t=null,e=!0):e=!1),e||qn(t)),null;case 13:return Km(e,t,a);case 4:return Pe(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Er(t,null,l,a):Pt(e,t,l,a),t.child;case 11:return Lm(e,t,t.type,t.pendingProps,a);case 7:return Pt(e,t,t.pendingProps,a),t.child;case 8:return Pt(e,t,t.pendingProps.children,a),t.child;case 12:return Pt(e,t,t.pendingProps.children,a),t.child;case 10:return l=t.pendingProps,Yn(t,t.type,l.value),Pt(e,t,l.children,a),t.child;case 9:return c=t.type._context,l=t.pendingProps.children,Sr(t),c=Jt(c),l=l(c),t.flags|=1,Pt(e,t,l,a),t.child;case 14:return Um(e,t,t.type,t.pendingProps,a);case 15:return Hm(e,t,t.type,t.pendingProps,a);case 19:return Qm(e,t,a);case 31:return Rb(e,t,a);case 22:return Bm(e,t,a,t.pendingProps);case 24:return Sr(t),l=Jt(Lt),e===null?(c=fc(),c===null&&(c=ht,f=uc(),c.pooledCache=f,f.refCount++,f!==null&&(c.pooledCacheLanes|=a),c=f),t.memoizedState={parent:l,cache:c},hc(t),Yn(t,Lt,c)):((e.lanes&a)!==0&&(pc(e,t),Wl(t,null,null,a),Il()),c=e.memoizedState,f=t.memoizedState,c.parent!==l?(c={parent:l,cache:l},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),Yn(t,Lt,l)):(l=f.cache,Yn(t,Lt,l),l!==c.cache&&cc(t,[Lt],a,!0))),Pt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function wn(e){e.flags|=4}function Jc(e,t,a,l,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(_h())e.flags|=8192;else throw wr=hi,mc}else e.flags&=-16777217}function Zm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!up(t))if(_h())e.flags|=8192;else throw wr=hi,mc}function Oi(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?ca():536870912,e.lanes|=t,pl|=t)}function ls(e,t){if(!Ie)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 l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function St(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,l=0;if(t)for(var c=e.child;c!==null;)a|=c.lanes|c.childLanes,l|=c.subtreeFlags&65011712,l|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)a|=c.lanes|c.childLanes,l|=c.subtreeFlags,l|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=l,e.childLanes=a,t}function kb(e,t,a){var l=t.pendingProps;switch(rc(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,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),_n(Lt),Xe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(al(t)?wn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,sc())),St(t),null;case 26:var c=t.type,f=t.memoizedState;return e===null?(wn(t),f!==null?(St(t),Zm(t,f)):(St(t),Jc(t,c,null,l,a))):f?f!==e.memoizedState?(wn(t),St(t),Zm(t,f)):(St(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&wn(t),St(t),Jc(t,c,e,l,a)),null;case 27:if(ma(t),a=ve.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&wn(t);else{if(!l){if(t.stateNode===null)throw Error(i(166));return St(t),null}e=ae.current,al(t)?Rf(t):(e=ap(c,l,a),t.stateNode=e,wn(t))}return St(t),null;case 5:if(ma(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&wn(t);else{if(!l){if(t.stateNode===null)throw Error(i(166));return St(t),null}if(f=ae.current,al(t))Rf(t);else{var x=Xi(ve.current);switch(f){case 1:f=x.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:f=x.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":f=x.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":f=x.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":f=x.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof l.is=="string"?x.createElement("select",{is:l.is}):x.createElement("select"),l.multiple?f.multiple=!0:l.size&&(f.size=l.size);break;default:f=typeof l.is=="string"?x.createElement(c,{is:l.is}):x.createElement(c)}}f[ce]=t,f[he]=l;e:for(x=t.child;x!==null;){if(x.tag===5||x.tag===6)f.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=f;e:switch(It(f,c,l),c){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&wn(t)}}return St(t),Jc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&wn(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(i(166));if(e=ve.current,al(t)){if(e=t.stateNode,a=t.memoizedProps,l=null,c=Zt,c!==null)switch(c.tag){case 27:case 5:l=c.memoizedProps}e[ce]=t,e=!!(e.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||Kh(e.nodeValue,a)),e||qn(t,!0)}else e=Xi(e).createTextNode(l),e[ce]=t,t.stateNode=e}return St(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(l=al(t),a!==null){if(e===null){if(!l)throw Error(i(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[ce]=t}else vr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;St(t),e=!1}else a=sc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Ra(t),t):(Ra(t),null);if((t.flags&128)!==0)throw Error(i(558))}return St(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=al(t),l!==null&&l.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 vr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;St(t),c=!1}else c=sc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Ra(t),t):(Ra(t),null)}return Ra(t),(t.flags&128)!==0?(t.lanes=a,t):(a=l!==null,e=e!==null&&e.memoizedState!==null,a&&(l=t.child,c=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(c=l.alternate.memoizedState.cachePool.pool),f=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(f=l.memoizedState.cachePool.pool),f!==c&&(l.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Oi(t,t.updateQueue),St(t),null);case 4:return Xe(),e===null&&yu(t.stateNode.containerInfo),St(t),null;case 10:return _n(t.type),St(t),null;case 19:if($(Ot),l=t.memoizedState,l===null)return St(t),null;if(c=(t.flags&128)!==0,f=l.rendering,f===null)if(c)ls(l,!1);else{if(Ct!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=yi(e),f!==null){for(t.flags|=128,ls(l,!1),e=f.updateQueue,t.updateQueue=e,Oi(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)jf(a,e),a=a.sibling;return ee(Ot,Ot.current&1|2),Ie&&bn(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&pt()>Li&&(t.flags|=128,c=!0,ls(l,!1),t.lanes=4194304)}else{if(!c)if(e=yi(f),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,Oi(t,e),ls(l,!0),l.tail===null&&l.tailMode==="hidden"&&!f.alternate&&!Ie)return St(t),null}else 2*pt()-l.renderingStartTime>Li&&a!==536870912&&(t.flags|=128,c=!0,ls(l,!1),t.lanes=4194304);l.isBackwards?(f.sibling=t.child,t.child=f):(e=l.last,e!==null?e.sibling=f:t.child=f,l.last=f)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=pt(),e.sibling=null,a=Ot.current,ee(Ot,c?a&1|2:a&1),Ie&&bn(t,l.treeForkCount),e):(St(t),null);case 22:case 23:return Ra(t),bc(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(a&536870912)!==0&&(t.flags&128)===0&&(St(t),t.subtreeFlags&6&&(t.flags|=8192)):St(t),a=t.updateQueue,a!==null&&Oi(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==a&&(t.flags|=2048),e!==null&&$(jr),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),_n(Lt),St(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Ob(e,t){switch(rc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return _n(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(Ra(t),t.alternate===null)throw Error(i(340));vr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ra(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));vr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $(Ot),null;case 4:return Xe(),null;case 10:return _n(t.type),null;case 22:case 23:return Ra(t),bc(),e!==null&&$(jr),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return _n(Lt),null;case 25:return null;default:return null}}function Jm(e,t){switch(rc(t),t.tag){case 3:_n(Lt),Xe();break;case 26:case 27:case 5:ma(t);break;case 4:Xe();break;case 31:t.memoizedState!==null&&Ra(t);break;case 13:Ra(t);break;case 19:$(Ot);break;case 10:_n(t.type);break;case 22:case 23:Ra(t),bc(),e!==null&&$(jr);break;case 24:_n(Lt)}}function ss(e,t){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var c=l.next;a=c;do{if((a.tag&e)===e){l=void 0;var f=a.create,x=a.inst;l=f(),x.destroy=l}a=a.next}while(a!==c)}}catch(_){ot(t,t.return,_)}}function Fn(e,t,a){try{var l=t.updateQueue,c=l!==null?l.lastEffect:null;if(c!==null){var f=c.next;l=f;do{if((l.tag&e)===e){var x=l.inst,_=x.destroy;if(_!==void 0){x.destroy=void 0,c=t;var R=a,U=_;try{U()}catch(F){ot(c,R,F)}}}l=l.next}while(l!==f)}}catch(F){ot(t,t.return,F)}}function Pm(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{qf(t,a)}catch(l){ot(e,e.return,l)}}}function Im(e,t,a){a.props=Rr(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(l){ot(e,t,l)}}function is(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof a=="function"?e.refCleanup=a(l):a.current=l}}catch(c){ot(e,t,c)}}function dn(e,t){var a=e.ref,l=e.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(c){ot(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){ot(e,t,c)}else a.current=null}function Wm(e){var t=e.type,a=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(c){ot(e,e.return,c)}}function Pc(e,t,a){try{var l=e.stateNode;Wb(l,e.type,a,t),l[he]=t}catch(c){ot(e,e.return,c)}}function eh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&tr(e.type)||e.tag===4}function Ic(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||eh(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&&tr(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 Wc(e,t,a){var l=e.tag;if(l===5||l===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=gn));else if(l!==4&&(l===27&&tr(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Wc(e,t,a),e=e.sibling;e!==null;)Wc(e,t,a),e=e.sibling}function zi(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(l!==4&&(l===27&&tr(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(zi(e,t,a),e=e.sibling;e!==null;)zi(e,t,a),e=e.sibling}function th(e){var t=e.stateNode,a=e.memoizedProps;try{for(var l=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);It(t,l,a),t[ce]=e,t[he]=a}catch(f){ot(e,e.return,f)}}var En=!1,Bt=!1,eu=!1,ah=typeof WeakSet=="function"?WeakSet:Set,Xt=null;function zb(e,t){if(e=e.containerInfo,_u=Wi,e=hf(e),Qo(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var c=l.anchorOffset,f=l.focusNode;l=l.focusOffset;try{a.nodeType,f.nodeType}catch{a=null;break e}var x=0,_=-1,R=-1,U=0,F=0,I=e,H=null;t:for(;;){for(var V;I!==a||c!==0&&I.nodeType!==3||(_=x+c),I!==f||l!==0&&I.nodeType!==3||(R=x+l),I.nodeType===3&&(x+=I.nodeValue.length),(V=I.firstChild)!==null;)H=I,I=V;for(;;){if(I===e)break t;if(H===a&&++U===c&&(_=x),H===f&&++F===l&&(R=x),(V=I.nextSibling)!==null)break;I=H,H=I.parentNode}I=V}a=_===-1||R===-1?null:{start:_,end:R}}else a=null}a=a||{start:0,end:0}}else a=null;for(Su={focusedElem:e,selectionRange:a},Wi=!1,Xt=t;Xt!==null;)if(t=Xt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Xt=e;else for(;Xt!==null;){switch(t=Xt,f=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&&f!==null){e=void 0,a=t,c=f.memoizedProps,f=f.memoizedState,l=a.stateNode;try{var be=Rr(a.type,c);e=l.getSnapshotBeforeUpdate(be,f),l.__reactInternalSnapshotBeforeUpdate=e}catch(Te){ot(a,a.return,Te)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)wu(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":wu(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,Xt=e;break}Xt=t.return}}function nh(e,t,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:Rn(e,a),l&4&&ss(5,a);break;case 1:if(Rn(e,a),l&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(x){ot(a,a.return,x)}else{var c=Rr(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(x){ot(a,a.return,x)}}l&64&&Pm(a),l&512&&is(a,a.return);break;case 3:if(Rn(e,a),l&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{qf(e,t)}catch(x){ot(a,a.return,x)}}break;case 27:t===null&&l&4&&th(a);case 26:case 5:Rn(e,a),t===null&&l&4&&Wm(a),l&512&&is(a,a.return);break;case 12:Rn(e,a);break;case 31:Rn(e,a),l&4&&sh(e,a);break;case 13:Rn(e,a),l&4&&ih(e,a),l&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=qb.bind(null,a),iv(e,a))));break;case 22:if(l=a.memoizedState!==null||En,!l){t=t!==null&&t.memoizedState!==null||Bt,c=En;var f=Bt;En=l,(Bt=t)&&!f?Tn(e,a,(a.subtreeFlags&8772)!==0):Rn(e,a),En=c,Bt=f}break;case 30:break;default:Rn(e,a)}}function rh(e){var t=e.alternate;t!==null&&(e.alternate=null,rh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&mt(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 Cn(e,t,a){for(a=a.child;a!==null;)lh(e,t,a),a=a.sibling}function lh(e,t,a){if(Tt&&typeof Tt.onCommitFiberUnmount=="function")try{Tt.onCommitFiberUnmount(Ft,a)}catch{}switch(a.tag){case 26:Bt||dn(a,t),Cn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Bt||dn(a,t);var l=jt,c=pa;tr(a.type)&&(jt=a.stateNode,pa=!1),Cn(e,t,a),gs(a.stateNode),jt=l,pa=c;break;case 5:Bt||dn(a,t);case 6:if(l=jt,c=pa,jt=null,Cn(e,t,a),jt=l,pa=c,jt!==null)if(pa)try{(jt.nodeType===9?jt.body:jt.nodeName==="HTML"?jt.ownerDocument.body:jt).removeChild(a.stateNode)}catch(f){ot(a,t,f)}else try{jt.removeChild(a.stateNode)}catch(f){ot(a,t,f)}break;case 18:jt!==null&&(pa?(e=jt,Ph(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),jl(e)):Ph(jt,a.stateNode));break;case 4:l=jt,c=pa,jt=a.stateNode.containerInfo,pa=!0,Cn(e,t,a),jt=l,pa=c;break;case 0:case 11:case 14:case 15:Fn(2,a,t),Bt||Fn(4,a,t),Cn(e,t,a);break;case 1:Bt||(dn(a,t),l=a.stateNode,typeof l.componentWillUnmount=="function"&&Im(a,t,l)),Cn(e,t,a);break;case 21:Cn(e,t,a);break;case 22:Bt=(l=Bt)||a.memoizedState!==null,Cn(e,t,a),Bt=l;break;default:Cn(e,t,a)}}function sh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{jl(e)}catch(a){ot(t,t.return,a)}}}function ih(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{jl(e)}catch(a){ot(t,t.return,a)}}function Db(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ah),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ah),t;default:throw Error(i(435,e.tag))}}function Di(e,t){var a=Db(e);t.forEach(function(l){if(!a.has(l)){a.add(l);var c=Yb.bind(null,e,l);l.then(c,c)}})}function ga(e,t){var a=t.deletions;if(a!==null)for(var l=0;l<a.length;l++){var c=a[l],f=e,x=t,_=x;e:for(;_!==null;){switch(_.tag){case 27:if(tr(_.type)){jt=_.stateNode,pa=!1;break e}break;case 5:jt=_.stateNode,pa=!1;break e;case 3:case 4:jt=_.stateNode.containerInfo,pa=!0;break e}_=_.return}if(jt===null)throw Error(i(160));lh(f,x,c),jt=null,pa=!1,f=c.alternate,f!==null&&(f.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)oh(t,e),t=t.sibling}var en=null;function oh(e,t){var a=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ga(t,e),xa(e),l&4&&(Fn(3,e,e.return),ss(3,e),Fn(5,e,e.return));break;case 1:ga(t,e),xa(e),l&512&&(Bt||a===null||dn(a,a.return)),l&64&&En&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?l:a.concat(l))));break;case 26:var c=en;if(ga(t,e),xa(e),l&512&&(Bt||a===null||dn(a,a.return)),l&4){var f=a!==null?a.memoizedState:null;if(l=e.memoizedState,a===null)if(l===null)if(e.stateNode===null){e:{l=e.type,a=e.memoizedProps,c=c.ownerDocument||c;t:switch(l){case"title":f=c.getElementsByTagName("title")[0],(!f||f[Ye]||f[ce]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=c.createElement(l),c.head.insertBefore(f,c.querySelector("head > title"))),It(f,l,a),f[ce]=e,yt(f),l=f;break e;case"link":var x=op("link","href",c).get(l+(a.href||""));if(x){for(var _=0;_<x.length;_++)if(f=x[_],f.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&f.getAttribute("rel")===(a.rel==null?null:a.rel)&&f.getAttribute("title")===(a.title==null?null:a.title)&&f.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){x.splice(_,1);break t}}f=c.createElement(l),It(f,l,a),c.head.appendChild(f);break;case"meta":if(x=op("meta","content",c).get(l+(a.content||""))){for(_=0;_<x.length;_++)if(f=x[_],f.getAttribute("content")===(a.content==null?null:""+a.content)&&f.getAttribute("name")===(a.name==null?null:a.name)&&f.getAttribute("property")===(a.property==null?null:a.property)&&f.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&f.getAttribute("charset")===(a.charSet==null?null:a.charSet)){x.splice(_,1);break t}}f=c.createElement(l),It(f,l,a),c.head.appendChild(f);break;default:throw Error(i(468,l))}f[ce]=e,yt(f),l=f}e.stateNode=l}else cp(c,e.type,e.stateNode);else e.stateNode=ip(c,l,e.memoizedProps);else f!==l?(f===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):f.count--,l===null?cp(c,e.type,e.stateNode):ip(c,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Pc(e,e.memoizedProps,a.memoizedProps)}break;case 27:ga(t,e),xa(e),l&512&&(Bt||a===null||dn(a,a.return)),a!==null&&l&4&&Pc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(ga(t,e),xa(e),l&512&&(Bt||a===null||dn(a,a.return)),e.flags&32){c=e.stateNode;try{Xr(c,"")}catch(be){ot(e,e.return,be)}}l&4&&e.stateNode!=null&&(c=e.memoizedProps,Pc(e,c,a!==null?a.memoizedProps:c)),l&1024&&(eu=!0);break;case 6:if(ga(t,e),xa(e),l&4){if(e.stateNode===null)throw Error(i(162));l=e.memoizedProps,a=e.stateNode;try{a.nodeValue=l}catch(be){ot(e,e.return,be)}}break;case 3:if(Zi=null,c=en,en=Qi(t.containerInfo),ga(t,e),en=c,xa(e),l&4&&a!==null&&a.memoizedState.isDehydrated)try{jl(t.containerInfo)}catch(be){ot(e,e.return,be)}eu&&(eu=!1,ch(e));break;case 4:l=en,en=Qi(e.stateNode.containerInfo),ga(t,e),xa(e),en=l;break;case 12:ga(t,e),xa(e);break;case 31:ga(t,e),xa(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Di(e,l)));break;case 13:ga(t,e),xa(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Mi=pt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Di(e,l)));break;case 22:c=e.memoizedState!==null;var R=a!==null&&a.memoizedState!==null,U=En,F=Bt;if(En=U||c,Bt=F||R,ga(t,e),Bt=F,En=U,xa(e),l&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(a===null||R||En||Bt||Tr(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){R=a=t;try{if(f=R.stateNode,c)x=f.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{_=R.stateNode;var I=R.memoizedProps.style,H=I!=null&&I.hasOwnProperty("display")?I.display:null;_.style.display=H==null||typeof H=="boolean"?"":(""+H).trim()}}catch(be){ot(R,R.return,be)}}}else if(t.tag===6){if(a===null){R=t;try{R.stateNode.nodeValue=c?"":R.memoizedProps}catch(be){ot(R,R.return,be)}}}else if(t.tag===18){if(a===null){R=t;try{var V=R.stateNode;c?Ih(V,!0):Ih(R.stateNode,!1)}catch(be){ot(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}l&4&&(l=e.updateQueue,l!==null&&(a=l.retryQueue,a!==null&&(l.retryQueue=null,Di(e,a))));break;case 19:ga(t,e),xa(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Di(e,l)));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,l=e.return;l!==null;){if(eh(l)){a=l;break}l=l.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var c=a.stateNode,f=Ic(e);zi(e,f,c);break;case 5:var x=a.stateNode;a.flags&32&&(Xr(x,""),a.flags&=-33);var _=Ic(e);zi(e,_,x);break;case 3:case 4:var R=a.stateNode.containerInfo,U=Ic(e);Wc(e,U,R);break;default:throw Error(i(161))}}catch(F){ot(e,e.return,F)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ch(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ch(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Rn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)nh(e,t.alternate,t),t=t.sibling}function Tr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Fn(4,t,t.return),Tr(t);break;case 1:dn(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Im(t,t.return,a),Tr(t);break;case 27:gs(t.stateNode);case 26:case 5:dn(t,t.return),Tr(t);break;case 22:t.memoizedState===null&&Tr(t);break;case 30:Tr(t);break;default:Tr(t)}e=e.sibling}}function Tn(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,c=e,f=t,x=f.flags;switch(f.tag){case 0:case 11:case 15:Tn(c,f,a),ss(4,f);break;case 1:if(Tn(c,f,a),l=f,c=l.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(U){ot(l,l.return,U)}if(l=f,c=l.updateQueue,c!==null){var _=l.stateNode;try{var R=c.shared.hiddenCallbacks;if(R!==null)for(c.shared.hiddenCallbacks=null,c=0;c<R.length;c++)$f(R[c],_)}catch(U){ot(l,l.return,U)}}a&&x&64&&Pm(f),is(f,f.return);break;case 27:th(f);case 26:case 5:Tn(c,f,a),a&&l===null&&x&4&&Wm(f),is(f,f.return);break;case 12:Tn(c,f,a);break;case 31:Tn(c,f,a),a&&x&4&&sh(c,f);break;case 13:Tn(c,f,a),a&&x&4&&ih(c,f);break;case 22:f.memoizedState===null&&Tn(c,f,a),is(f,f.return);break;case 30:break;default:Tn(c,f,a)}t=t.sibling}}function tu(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&&Ql(a))}function au(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ql(e))}function tn(e,t,a,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)uh(e,t,a,l),t=t.sibling}function uh(e,t,a,l){var c=t.flags;switch(t.tag){case 0:case 11:case 15:tn(e,t,a,l),c&2048&&ss(9,t);break;case 1:tn(e,t,a,l);break;case 3:tn(e,t,a,l),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ql(e)));break;case 12:if(c&2048){tn(e,t,a,l),e=t.stateNode;try{var f=t.memoizedProps,x=f.id,_=f.onPostCommit;typeof _=="function"&&_(x,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(R){ot(t,t.return,R)}}else tn(e,t,a,l);break;case 31:tn(e,t,a,l);break;case 13:tn(e,t,a,l);break;case 23:break;case 22:f=t.stateNode,x=t.alternate,t.memoizedState!==null?f._visibility&2?tn(e,t,a,l):os(e,t):f._visibility&2?tn(e,t,a,l):(f._visibility|=2,fl(e,t,a,l,(t.subtreeFlags&10256)!==0||!1)),c&2048&&tu(x,t);break;case 24:tn(e,t,a,l),c&2048&&au(t.alternate,t);break;default:tn(e,t,a,l)}}function fl(e,t,a,l,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,x=t,_=a,R=l,U=x.flags;switch(x.tag){case 0:case 11:case 15:fl(f,x,_,R,c),ss(8,x);break;case 23:break;case 22:var F=x.stateNode;x.memoizedState!==null?F._visibility&2?fl(f,x,_,R,c):os(f,x):(F._visibility|=2,fl(f,x,_,R,c)),c&&U&2048&&tu(x.alternate,x);break;case 24:fl(f,x,_,R,c),c&&U&2048&&au(x.alternate,x);break;default:fl(f,x,_,R,c)}t=t.sibling}}function os(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,l=t,c=l.flags;switch(l.tag){case 22:os(a,l),c&2048&&tu(l.alternate,l);break;case 24:os(a,l),c&2048&&au(l.alternate,l);break;default:os(a,l)}t=t.sibling}}var cs=8192;function ml(e,t,a){if(e.subtreeFlags&cs)for(e=e.child;e!==null;)dh(e,t,a),e=e.sibling}function dh(e,t,a){switch(e.tag){case 26:ml(e,t,a),e.flags&cs&&e.memoizedState!==null&&bv(a,en,e.memoizedState,e.memoizedProps);break;case 5:ml(e,t,a);break;case 3:case 4:var l=en;en=Qi(e.stateNode.containerInfo),ml(e,t,a),en=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=cs,cs=16777216,ml(e,t,a),cs=l):ml(e,t,a));break;default:ml(e,t,a)}}function fh(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 l=t[a];Xt=l,hh(l,e)}fh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)mh(e),e=e.sibling}function mh(e){switch(e.tag){case 0:case 11:case 15:us(e),e.flags&2048&&Fn(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,Ai(e)):us(e);break;default:us(e)}}function Ai(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];Xt=l,hh(l,e)}fh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Fn(8,t,t.return),Ai(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Ai(t));break;default:Ai(t)}e=e.sibling}}function hh(e,t){for(;Xt!==null;){var a=Xt;switch(a.tag){case 0:case 11:case 15:Fn(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Ql(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,Xt=l;else e:for(a=e;Xt!==null;){l=Xt;var c=l.sibling,f=l.return;if(rh(l),l===a){Xt=null;break e}if(c!==null){c.return=f,Xt=c;break e}Xt=f}}}var Ab={getCacheForType:function(e){var t=Jt(Lt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Jt(Lt).controller.signal}},Mb=typeof WeakMap=="function"?WeakMap:Map,rt=0,ht=null,Ve=null,Ze=0,it=0,Ta=null,Zn=!1,hl=!1,nu=!1,kn=0,Ct=0,Jn=0,kr=0,ru=0,ka=0,pl=0,ds=null,ya=null,lu=!1,Mi=0,ph=0,Li=1/0,Ui=null,Pn=null,Gt=0,In=null,gl=null,On=0,su=0,iu=null,gh=null,fs=0,ou=null;function Oa(){return(rt&2)!==0&&Ze!==0?Ze&-Ze:A.T!==null?hu():ne()}function xh(){if(ka===0)if((Ze&536870912)===0||Ie){var e=se;se<<=1,(se&3932160)===0&&(se=262144),ka=e}else ka=536870912;return e=Ca.current,e!==null&&(e.flags|=32),ka}function ba(e,t,a){(e===ht&&(it===2||it===9)||e.cancelPendingCommit!==null)&&(xl(e,0),Wn(e,Ze,ka,!1)),Na(e,a),((rt&2)===0||e!==ht)&&(e===ht&&((rt&2)===0&&(kr|=a),Ct===4&&Wn(e,Ze,ka,!1)),fn(e))}function yh(e,t,a){if((rt&6)!==0)throw Error(i(327));var l=!a&&(t&127)===0&&(t&e.expiredLanes)===0||At(e,t),c=l?Hb(e,t):uu(e,t,!0),f=l;do{if(c===0){hl&&!l&&Wn(e,t,0,!1);break}else{if(a=e.current.alternate,f&&!Lb(a)){c=uu(e,t,!1),f=!1;continue}if(c===2){if(f=t,e.errorRecoveryDisabledLanes&f)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){t=x;e:{var _=e;c=ds;var R=_.current.memoizedState.isDehydrated;if(R&&(xl(_,x).flags|=256),x=uu(_,x,!1),x!==2){if(nu&&!R){_.errorRecoveryDisabledLanes|=f,kr|=f,c=4;break e}f=ya,ya=c,f!==null&&(ya===null?ya=f:ya.push.apply(ya,f))}c=x}if(f=!1,c!==2)continue}}if(c===1){xl(e,0),Wn(e,t,0,!0);break}e:{switch(l=e,f=c,f){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Wn(l,t,ka,!Zn);break e;case 2:ya=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=Mi+300-pt(),10<c)){if(Wn(l,t,ka,!Zn),Ue(l,0,!0)!==0)break e;On=t,l.timeoutHandle=Zh(bh.bind(null,l,a,ya,Ui,lu,t,ka,kr,pl,Zn,f,"Throttled",-0,0),c);break e}bh(l,a,ya,Ui,lu,t,ka,kr,pl,Zn,f,null,-0,0)}}break}while(!0);fn(e)}function bh(e,t,a,l,c,f,x,_,R,U,F,I,H,V){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:gn},dh(t,f,I);var be=(f&62914560)===f?Mi-pt():(f&4194048)===f?ph-pt():0;if(be=vv(I,be),be!==null){On=f,e.cancelPendingCommit=be(Ch.bind(null,e,t,f,a,l,c,x,_,R,F,I,null,H,V)),Wn(e,f,x,!U);return}}Ch(e,t,f,a,l,c,x,_,R)}function Lb(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 l=0;l<a.length;l++){var c=a[l],f=c.getSnapshot;c=c.value;try{if(!wa(f(),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 Wn(e,t,a,l){t&=~ru,t&=~kr,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var c=t;0<c;){var f=31-Dt(c),x=1<<f;l[f]=-1,c&=~x}a!==0&&$r(e,a,t)}function Hi(){return(rt&6)===0?(ms(0),!1):!0}function cu(){if(Ve!==null){if(it===0)var e=Ve.return;else e=Ve,vn=_r=null,wc(e),il=null,Zl=0,e=Ve;for(;e!==null;)Jm(e.alternate,e),e=e.return;Ve=null}}function xl(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,av(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),On=0,cu(),ht=e,Ve=a=yn(e.current,null),Ze=t,it=0,Ta=null,Zn=!1,hl=At(e,t),nu=!1,pl=ka=ru=kr=Jn=Ct=0,ya=ds=null,lu=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var c=31-Dt(l),f=1<<c;t|=e[c],l&=~f}return kn=t,li(),a}function vh(e,t){He=null,A.H=ns,t===sl||t===mi?(t=Lf(),it=3):t===mc?(t=Lf(),it=4):it=t===qc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ta=t,Ve===null&&(Ct=1,Ci(e,Ha(t,e.current)))}function _h(){var e=Ca.current;return e===null?!0:(Ze&4194048)===Ze?Ya===null:(Ze&62914560)===Ze||(Ze&536870912)!==0?e===Ya:!1}function Sh(){var e=A.H;return A.H=ns,e===null?ns:e}function jh(){var e=A.A;return A.A=Ab,e}function Bi(){Ct=4,Zn||(Ze&4194048)!==Ze&&Ca.current!==null||(hl=!0),(Jn&134217727)===0&&(kr&134217727)===0||ht===null||Wn(ht,Ze,ka,!1)}function uu(e,t,a){var l=rt;rt|=2;var c=Sh(),f=jh();(ht!==e||Ze!==t)&&(Ui=null,xl(e,t)),t=!1;var x=Ct;e:do try{if(it!==0&&Ve!==null){var _=Ve,R=Ta;switch(it){case 8:cu(),x=6;break e;case 3:case 2:case 9:case 6:Ca.current===null&&(t=!0);var U=it;if(it=0,Ta=null,yl(e,_,R,U),a&&hl){x=0;break e}break;default:U=it,it=0,Ta=null,yl(e,_,R,U)}}Ub(),x=Ct;break}catch(F){vh(e,F)}while(!0);return t&&e.shellSuspendCounter++,vn=_r=null,rt=l,A.H=c,A.A=f,Ve===null&&(ht=null,Ze=0,li()),x}function Ub(){for(;Ve!==null;)Nh(Ve)}function Hb(e,t){var a=rt;rt|=2;var l=Sh(),c=jh();ht!==e||Ze!==t?(Ui=null,Li=pt()+500,xl(e,t)):hl=At(e,t);e:do try{if(it!==0&&Ve!==null){t=Ve;var f=Ta;t:switch(it){case 1:it=0,Ta=null,yl(e,t,f,1);break;case 2:case 9:if(Af(f)){it=0,Ta=null,wh(t);break}t=function(){it!==2&&it!==9||ht!==e||(it=7),fn(e)},f.then(t,t);break e;case 3:it=7;break e;case 4:it=5;break e;case 7:Af(f)?(it=0,Ta=null,wh(t)):(it=0,Ta=null,yl(e,t,f,7));break;case 5:var x=null;switch(Ve.tag){case 26:x=Ve.memoizedState;case 5:case 27:var _=Ve;if(x?up(x):_.stateNode.complete){it=0,Ta=null;var R=_.sibling;if(R!==null)Ve=R;else{var U=_.return;U!==null?(Ve=U,$i(U)):Ve=null}break t}}it=0,Ta=null,yl(e,t,f,5);break;case 6:it=0,Ta=null,yl(e,t,f,6);break;case 8:cu(),Ct=6;break e;default:throw Error(i(462))}}Bb();break}catch(F){vh(e,F)}while(!0);return vn=_r=null,A.H=l,A.A=c,rt=a,Ve!==null?0:(ht=null,Ze=0,li(),Ct)}function Bb(){for(;Ve!==null&&!la();)Nh(Ve)}function Nh(e){var t=Fm(e.alternate,e,kn);e.memoizedProps=e.pendingProps,t===null?$i(e):Ve=t}function wh(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Ym(a,t,t.pendingProps,t.type,void 0,Ze);break;case 11:t=Ym(a,t,t.pendingProps,t.type.render,t.ref,Ze);break;case 5:wc(t);default:Jm(a,t),t=Ve=jf(t,kn),t=Fm(a,t,kn)}e.memoizedProps=e.pendingProps,t===null?$i(e):Ve=t}function yl(e,t,a,l){vn=_r=null,wc(t),il=null,Zl=0;var c=t.return;try{if(Cb(e,c,t,a,Ze)){Ct=1,Ci(e,Ha(a,e.current)),Ve=null;return}}catch(f){if(c!==null)throw Ve=c,f;Ct=1,Ci(e,Ha(a,e.current)),Ve=null;return}t.flags&32768?(Ie||l===1?e=!0:hl||(Ze&536870912)!==0?e=!1:(Zn=e=!0,(l===2||l===9||l===3||l===6)&&(l=Ca.current,l!==null&&l.tag===13&&(l.flags|=16384))),Eh(t,e)):$i(t)}function $i(e){var t=e;do{if((t.flags&32768)!==0){Eh(t,Zn);return}e=t.return;var a=kb(t.alternate,t,kn);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 Eh(e,t){do{var a=Ob(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 Ch(e,t,a,l,c,f,x,_,R){e.cancelPendingCommit=null;do qi();while(Gt!==0);if((rt&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(f=t.lanes|t.childLanes,f|=Io,fr(e,a,f,x,_,R),e===ht&&(Ve=ht=null,Ze=0),gl=t,In=e,On=a,su=f,iu=c,gh=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Gb(Fe,function(){return zh(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=A.T,A.T=null,c=P.p,P.p=2,x=rt,rt|=4;try{zb(e,t,a)}finally{rt=x,P.p=c,A.T=l}}Gt=1,Rh(),Th(),kh()}}function Rh(){if(Gt===1){Gt=0;var e=In,t=gl,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=A.T,A.T=null;var l=P.p;P.p=2;var c=rt;rt|=4;try{oh(t,e);var f=Su,x=hf(e.containerInfo),_=f.focusedElem,R=f.selectionRange;if(x!==_&&_&&_.ownerDocument&&mf(_.ownerDocument.documentElement,_)){if(R!==null&&Qo(_)){var U=R.start,F=R.end;if(F===void 0&&(F=U),"selectionStart"in _)_.selectionStart=U,_.selectionEnd=Math.min(F,_.value.length);else{var I=_.ownerDocument||document,H=I&&I.defaultView||window;if(H.getSelection){var V=H.getSelection(),be=_.textContent.length,Te=Math.min(R.start,be),dt=R.end===void 0?Te:Math.min(R.end,be);!V.extend&&Te>dt&&(x=dt,dt=Te,Te=x);var D=ff(_,Te),k=ff(_,dt);if(D&&k&&(V.rangeCount!==1||V.anchorNode!==D.node||V.anchorOffset!==D.offset||V.focusNode!==k.node||V.focusOffset!==k.offset)){var L=I.createRange();L.setStart(D.node,D.offset),V.removeAllRanges(),Te>dt?(V.addRange(L),V.extend(k.node,k.offset)):(L.setEnd(k.node,k.offset),V.addRange(L))}}}}for(I=[],V=_;V=V.parentNode;)V.nodeType===1&&I.push({element:V,left:V.scrollLeft,top:V.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<I.length;_++){var J=I[_];J.element.scrollLeft=J.left,J.element.scrollTop=J.top}}Wi=!!_u,Su=_u=null}finally{rt=c,P.p=l,A.T=a}}e.current=t,Gt=2}}function Th(){if(Gt===2){Gt=0;var e=In,t=gl,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=A.T,A.T=null;var l=P.p;P.p=2;var c=rt;rt|=4;try{nh(e,t.alternate,t)}finally{rt=c,P.p=l,A.T=a}}Gt=3}}function kh(){if(Gt===4||Gt===3){Gt=0,sa();var e=In,t=gl,a=On,l=gh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Gt=5:(Gt=0,gl=In=null,Oh(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(Pn=null),B(a),t=t.stateNode,Tt&&typeof Tt.onCommitFiberRoot=="function")try{Tt.onCommitFiberRoot(Ft,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=A.T,c=P.p,P.p=2,A.T=null;try{for(var f=e.onRecoverableError,x=0;x<l.length;x++){var _=l[x];f(_.value,{componentStack:_.stack})}}finally{A.T=t,P.p=c}}(On&3)!==0&&qi(),fn(e),c=e.pendingLanes,(a&261930)!==0&&(c&42)!==0?e===ou?fs++:(fs=0,ou=e):fs=0,ms(0)}}function Oh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ql(t)))}function qi(){return Rh(),Th(),kh(),zh()}function zh(){if(Gt!==5)return!1;var e=In,t=su;su=0;var a=B(On),l=A.T,c=P.p;try{P.p=32>a?32:a,A.T=null,a=iu,iu=null;var f=In,x=On;if(Gt=0,gl=In=null,On=0,(rt&6)!==0)throw Error(i(331));var _=rt;if(rt|=4,mh(f.current),uh(f,f.current,x,a),rt=_,ms(0,!1),Tt&&typeof Tt.onPostCommitFiberRoot=="function")try{Tt.onPostCommitFiberRoot(Ft,f)}catch{}return!0}finally{P.p=c,A.T=l,Oh(e,t)}}function Dh(e,t,a){t=Ha(a,t),t=$c(e.stateNode,t,2),e=Kn(e,t,2),e!==null&&(Na(e,2),fn(e))}function ot(e,t,a){if(e.tag===3)Dh(e,e,a);else for(;t!==null;){if(t.tag===3){Dh(t,e,a);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Pn===null||!Pn.has(l))){e=Ha(a,e),a=Am(2),l=Kn(t,a,2),l!==null&&(Mm(a,l,t,e),Na(l,2),fn(l));break}}t=t.return}}function du(e,t,a){var l=e.pingCache;if(l===null){l=e.pingCache=new Mb;var c=new Set;l.set(t,c)}else c=l.get(t),c===void 0&&(c=new Set,l.set(t,c));c.has(a)||(nu=!0,c.add(a),e=$b.bind(null,e,t,a),t.then(e,e))}function $b(e,t,a){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,ht===e&&(Ze&a)===a&&(Ct===4||Ct===3&&(Ze&62914560)===Ze&&300>pt()-Mi?(rt&2)===0&&xl(e,0):ru|=a,pl===Ze&&(pl=0)),fn(e)}function Ah(e,t){t===0&&(t=ca()),e=yr(e,t),e!==null&&(Na(e,t),fn(e))}function qb(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Ah(e,a)}function Yb(e,t){var a=0;switch(e.tag){case 31:case 13:var l=e.stateNode,c=e.memoizedState;c!==null&&(a=c.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(i(314))}l!==null&&l.delete(t),Ah(e,a)}function Gb(e,t){return ja(e,t)}var Yi=null,bl=null,fu=!1,Gi=!1,mu=!1,er=0;function fn(e){e!==bl&&e.next===null&&(bl===null?Yi=bl=e:bl=bl.next=e),Gi=!0,fu||(fu=!0,Kb())}function ms(e,t){if(!mu&&Gi){mu=!0;do for(var a=!1,l=Yi;l!==null;){if(e!==0){var c=l.pendingLanes;if(c===0)var f=0;else{var x=l.suspendedLanes,_=l.pingedLanes;f=(1<<31-Dt(42|e)+1)-1,f&=c&~(x&~_),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(a=!0,Hh(l,f))}else f=Ze,f=Ue(l,l===ht?f:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(f&3)===0||At(l,f)||(a=!0,Hh(l,f));l=l.next}while(a);mu=!1}}function Vb(){Mh()}function Mh(){Gi=fu=!1;var e=0;er!==0&&tv()&&(e=er);for(var t=pt(),a=null,l=Yi;l!==null;){var c=l.next,f=Lh(l,t);f===0?(l.next=null,a===null?Yi=c:a.next=c,c===null&&(bl=a)):(a=l,(e!==0||(f&3)!==0)&&(Gi=!0)),l=c}Gt!==0&&Gt!==5||ms(e),er!==0&&(er=0)}function Lh(e,t){for(var a=e.suspendedLanes,l=e.pingedLanes,c=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var x=31-Dt(f),_=1<<x,R=c[x];R===-1?((_&a)===0||(_&l)!==0)&&(c[x]=oa(_,t)):R<=t&&(e.expiredLanes|=_),f&=~_}if(t=ht,a=Ze,a=Ue(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,a===0||e===t&&(it===2||it===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Aa(l),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||At(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(l!==null&&Aa(l),B(a)){case 2:case 8:a=Ae;break;case 32:a=Fe;break;case 268435456:a=Nt;break;default:a=Fe}return l=Uh.bind(null,e),a=ja(a,l),e.callbackPriority=t,e.callbackNode=a,t}return l!==null&&l!==null&&Aa(l),e.callbackPriority=2,e.callbackNode=null,2}function Uh(e,t){if(Gt!==0&&Gt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(qi()&&e.callbackNode!==a)return null;var l=Ze;return l=Ue(e,e===ht?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(yh(e,l,t),Lh(e,pt()),e.callbackNode!=null&&e.callbackNode===a?Uh.bind(null,e):null)}function Hh(e,t){if(qi())return null;yh(e,t,!0)}function Kb(){nv(function(){(rt&6)!==0?ja(_e,Vb):Mh()})}function hu(){if(er===0){var e=rl;e===0&&(e=K,K<<=1,(K&261888)===0&&(K=256)),er=e}return er}function Bh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ps(""+e)}function $h(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 Xb(e,t,a,l,c){if(t==="submit"&&a&&a.stateNode===c){var f=Bh((c[he]||null).action),x=l.submitter;x&&(t=(t=x[he]||null)?Bh(t.formAction):x.getAttribute("formAction"),t!==null&&(f=t,x=null));var _=new ti("action","action",null,l,c);e.push({event:_,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(er!==0){var R=x?$h(c,x):new FormData(c);Ac(a,{pending:!0,data:R,method:c.method,action:f},null,R)}}else typeof f=="function"&&(_.preventDefault(),R=x?$h(c,x):new FormData(c),Ac(a,{pending:!0,data:R,method:c.method,action:f},f,R))},currentTarget:c}]})}}for(var pu=0;pu<Po.length;pu++){var gu=Po[pu],Qb=gu.toLowerCase(),Fb=gu[0].toUpperCase()+gu.slice(1);Wa(Qb,"on"+Fb)}Wa(xf,"onAnimationEnd"),Wa(yf,"onAnimationIteration"),Wa(bf,"onAnimationStart"),Wa("dblclick","onDoubleClick"),Wa("focusin","onFocus"),Wa("focusout","onBlur"),Wa(ub,"onTransitionRun"),Wa(db,"onTransitionStart"),Wa(fb,"onTransitionCancel"),Wa(vf,"onTransitionEnd"),sn("onMouseEnter",["mouseout","mouseover"]),sn("onMouseLeave",["mouseout","mouseover"]),sn("onPointerEnter",["pointerout","pointerover"]),sn("onPointerLeave",["pointerout","pointerover"]),Kt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Kt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Kt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Kt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Kt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Kt("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(" "),Zb=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(hs));function qh(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var l=e[a],c=l.event;l=l.listeners;e:{var f=void 0;if(t)for(var x=l.length-1;0<=x;x--){var _=l[x],R=_.instance,U=_.currentTarget;if(_=_.listener,R!==f&&c.isPropagationStopped())break e;f=_,c.currentTarget=U;try{f(c)}catch(F){ri(F)}c.currentTarget=null,f=R}else for(x=0;x<l.length;x++){if(_=l[x],R=_.instance,U=_.currentTarget,_=_.listener,R!==f&&c.isPropagationStopped())break e;f=_,c.currentTarget=U;try{f(c)}catch(F){ri(F)}c.currentTarget=null,f=R}}}}function Ke(e,t){var a=t[we];a===void 0&&(a=t[we]=new Set);var l=e+"__bubble";a.has(l)||(Yh(t,e,2,!1),a.add(l))}function xu(e,t,a){var l=0;t&&(l|=4),Yh(a,e,l,t)}var Vi="_reactListening"+Math.random().toString(36).slice(2);function yu(e){if(!e[Vi]){e[Vi]=!0,Un.forEach(function(a){a!=="selectionchange"&&(Zb.has(a)||xu(a,!1,e),xu(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Vi]||(t[Vi]=!0,xu("selectionchange",!1,t))}}function Yh(e,t,a,l){switch(xp(t)){case 2:var c=jv;break;case 8:c=Nv;break;default:c=Du}a=c.bind(null,t,a,e),c=void 0,!Ho||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),l?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 bu(e,t,a,l,c){var f=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var x=l.tag;if(x===3||x===4){var _=l.stateNode.containerInfo;if(_===c)break;if(x===4)for(x=l.return;x!==null;){var R=x.tag;if((R===3||R===4)&&x.stateNode.containerInfo===c)return;x=x.return}for(;_!==null;){if(x=bt(_),x===null)return;if(R=x.tag,R===5||R===6||R===26||R===27){l=f=x;continue e}_=_.parentNode}}l=l.return}Xd(function(){var U=f,F=Lo(a),I=[];e:{var H=_f.get(e);if(H!==void 0){var V=ti,be=e;switch(e){case"keypress":if(Ws(a)===0)break e;case"keydown":case"keyup":V=Yy;break;case"focusin":be="focus",V=Yo;break;case"focusout":be="blur",V=Yo;break;case"beforeblur":case"afterblur":V=Yo;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":V=Zd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":V=ky;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":V=Ky;break;case xf:case yf:case bf:V=Dy;break;case vf:V=Qy;break;case"scroll":case"scrollend":V=Ry;break;case"wheel":V=Zy;break;case"copy":case"cut":case"paste":V=My;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":V=Pd;break;case"toggle":case"beforetoggle":V=Py}var Te=(t&4)!==0,dt=!Te&&(e==="scroll"||e==="scrollend"),D=Te?H!==null?H+"Capture":null:H;Te=[];for(var k=U,L;k!==null;){var J=k;if(L=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||L===null||D===null||(J=Ll(k,D),J!=null&&Te.push(ps(k,J,L))),dt)break;k=k.return}0<Te.length&&(H=new V(H,be,null,a,F),I.push({event:H,listeners:Te}))}}if((t&7)===0){e:{if(H=e==="mouseover"||e==="pointerover",V=e==="mouseout"||e==="pointerout",H&&a!==Mo&&(be=a.relatedTarget||a.fromElement)&&(bt(be)||be[pe]))break e;if((V||H)&&(H=F.window===F?F:(H=F.ownerDocument)?H.defaultView||H.parentWindow:window,V?(be=a.relatedTarget||a.toElement,V=U,be=be?bt(be):null,be!==null&&(dt=d(be),Te=be.tag,be!==dt||Te!==5&&Te!==27&&Te!==6)&&(be=null)):(V=null,be=U),V!==be)){if(Te=Zd,J="onMouseLeave",D="onMouseEnter",k="mouse",(e==="pointerout"||e==="pointerover")&&(Te=Pd,J="onPointerLeave",D="onPointerEnter",k="pointer"),dt=V==null?H:We(V),L=be==null?H:We(be),H=new Te(J,k+"leave",V,a,F),H.target=dt,H.relatedTarget=L,J=null,bt(F)===U&&(Te=new Te(D,k+"enter",be,a,F),Te.target=L,Te.relatedTarget=dt,J=Te),dt=J,V&&be)t:{for(Te=Jb,D=V,k=be,L=0,J=D;J;J=Te(J))L++;J=0;for(var Ee=k;Ee;Ee=Te(Ee))J++;for(;0<L-J;)D=Te(D),L--;for(;0<J-L;)k=Te(k),J--;for(;L--;){if(D===k||k!==null&&D===k.alternate){Te=D;break t}D=Te(D),k=Te(k)}Te=null}else Te=null;V!==null&&Gh(I,H,V,Te,!1),be!==null&&dt!==null&&Gh(I,dt,be,Te,!0)}}e:{if(H=U?We(U):window,V=H.nodeName&&H.nodeName.toLowerCase(),V==="select"||V==="input"&&H.type==="file")var at=lf;else if(nf(H))if(sf)at=ib;else{at=lb;var Se=rb}else V=H.nodeName,!V||V.toLowerCase()!=="input"||H.type!=="checkbox"&&H.type!=="radio"?U&&Ao(U.elementType)&&(at=lf):at=sb;if(at&&(at=at(e,U))){rf(I,at,a,F);break e}Se&&Se(e,H,U),e==="focusout"&&U&&H.type==="number"&&U.memoizedProps.value!=null&&Do(H,"number",H.value)}switch(Se=U?We(U):window,e){case"focusin":(nf(Se)||Se.contentEditable==="true")&&(Jr=Se,Fo=U,Vl=null);break;case"focusout":Vl=Fo=Jr=null;break;case"mousedown":Zo=!0;break;case"contextmenu":case"mouseup":case"dragend":Zo=!1,pf(I,a,F);break;case"selectionchange":if(cb)break;case"keydown":case"keyup":pf(I,a,F)}var Be;if(Vo)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 Zr?tf(e,a)&&(Je="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Je="onCompositionStart");Je&&(Id&&a.locale!=="ko"&&(Zr||Je!=="onCompositionStart"?Je==="onCompositionEnd"&&Zr&&(Be=Qd()):(Hn=F,Bo="value"in Hn?Hn.value:Hn.textContent,Zr=!0)),Se=Ki(U,Je),0<Se.length&&(Je=new Jd(Je,e,null,a,F),I.push({event:Je,listeners:Se}),Be?Je.data=Be:(Be=af(a),Be!==null&&(Je.data=Be)))),(Be=Wy?eb(e,a):tb(e,a))&&(Je=Ki(U,"onBeforeInput"),0<Je.length&&(Se=new Jd("onBeforeInput","beforeinput",null,a,F),I.push({event:Se,listeners:Je}),Se.data=Be)),Xb(I,e,U,a,F)}qh(I,t)})}function ps(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Ki(e,t){for(var a=t+"Capture",l=[];e!==null;){var c=e,f=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||f===null||(c=Ll(e,a),c!=null&&l.unshift(ps(e,c,f)),c=Ll(e,t),c!=null&&l.push(ps(e,c,f))),e.tag===3)return l;e=e.return}return[]}function Jb(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Gh(e,t,a,l,c){for(var f=t._reactName,x=[];a!==null&&a!==l;){var _=a,R=_.alternate,U=_.stateNode;if(_=_.tag,R!==null&&R===l)break;_!==5&&_!==26&&_!==27||U===null||(R=U,c?(U=Ll(a,f),U!=null&&x.unshift(ps(a,U,R))):c||(U=Ll(a,f),U!=null&&x.push(ps(a,U,R)))),a=a.return}x.length!==0&&e.push({event:t,listeners:x})}var Pb=/\r\n?/g,Ib=/\u0000|\uFFFD/g;function Vh(e){return(typeof e=="string"?e:""+e).replace(Pb,`
10
+ `).replace(Ib,"")}function Kh(e,t){return t=Vh(t),Vh(e)===t}function ut(e,t,a,l,c,f){switch(a){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||Xr(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&Xr(e,""+l);break;case"className":kt(e,"class",l);break;case"tabIndex":kt(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":kt(e,a,l);break;case"style":Vd(e,l,f);break;case"data":if(t!=="object"){kt(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=Ps(""+l),e.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="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 f=="function"&&(a==="formAction"?(t!=="input"&&ut(e,t,"name",c.name,c,null),ut(e,t,"formEncType",c.formEncType,c,null),ut(e,t,"formMethod",c.formMethod,c,null),ut(e,t,"formTarget",c.formTarget,c,null)):(ut(e,t,"encType",c.encType,c,null),ut(e,t,"method",c.method,c,null),ut(e,t,"target",c.target,c,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=Ps(""+l),e.setAttribute(a,l);break;case"onClick":l!=null&&(e.onclick=gn);break;case"onScroll":l!=null&&Ke("scroll",e);break;case"onScrollEnd":l!=null&&Ke("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(i(61));if(a=l.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}a=Ps(""+l),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":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""+l):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":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":l===!0?e.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,l):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(a,l):e.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(a):e.setAttribute(a,l);break;case"popover":Ke("beforetoggle",e),Ke("toggle",e),Ge(e,"popover",l);break;case"xlinkActuate":aa(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":aa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":aa(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":aa(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":aa(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":aa(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":aa(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":aa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":aa(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Ge(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Ey.get(a)||a,Ge(e,a,l))}}function vu(e,t,a,l,c,f){switch(a){case"style":Vd(e,l,f);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(i(61));if(a=l.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"children":typeof l=="string"?Xr(e,l):(typeof l=="number"||typeof l=="bigint")&&Xr(e,""+l);break;case"onScroll":l!=null&&Ke("scroll",e);break;case"onScrollEnd":l!=null&&Ke("scrollend",e);break;case"onClick":l!=null&&(e.onclick=gn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ia.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(c=a.endsWith("Capture"),t=a.slice(2,c?a.length-7:void 0),f=e[he]||null,f=f!=null?f[a]:null,typeof f=="function"&&e.removeEventListener(t,f,c),typeof l=="function")){typeof f!="function"&&f!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,l,c);break e}a in e?e[a]=l:l===!0?e.setAttribute(a,""):Ge(e,a,l)}}}function It(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 l=!1,c=!1,f;for(f in a)if(a.hasOwnProperty(f)){var x=a[f];if(x!=null)switch(f){case"src":l=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:ut(e,t,f,x,a,null)}}c&&ut(e,t,"srcSet",a.srcSet,a,null),l&&ut(e,t,"src",a.src,a,null);return;case"input":Ke("invalid",e);var _=f=x=c=null,R=null,U=null;for(l in a)if(a.hasOwnProperty(l)){var F=a[l];if(F!=null)switch(l){case"name":c=F;break;case"type":x=F;break;case"checked":R=F;break;case"defaultChecked":U=F;break;case"value":f=F;break;case"defaultValue":_=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(i(137,t));break;default:ut(e,t,l,F,a,null)}}$d(e,f,_,R,U,x,c,!1);return;case"select":Ke("invalid",e),l=x=f=null;for(c in a)if(a.hasOwnProperty(c)&&(_=a[c],_!=null))switch(c){case"value":f=_;break;case"defaultValue":x=_;break;case"multiple":l=_;default:ut(e,t,c,_,a,null)}t=f,a=x,e.multiple=!!l,t!=null?Kr(e,!!l,t,!1):a!=null&&Kr(e,!!l,a,!0);return;case"textarea":Ke("invalid",e),f=c=l=null;for(x in a)if(a.hasOwnProperty(x)&&(_=a[x],_!=null))switch(x){case"value":l=_;break;case"defaultValue":c=_;break;case"children":f=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(i(91));break;default:ut(e,t,x,_,a,null)}Yd(e,l,c,f);return;case"option":for(R in a)a.hasOwnProperty(R)&&(l=a[R],l!=null)&&(R==="selected"?e.selected=l&&typeof l!="function"&&typeof l!="symbol":ut(e,t,R,l,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(l=0;l<hs.length;l++)Ke(hs[l],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(U in a)if(a.hasOwnProperty(U)&&(l=a[U],l!=null))switch(U){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:ut(e,t,U,l,a,null)}return;default:if(Ao(t)){for(F in a)a.hasOwnProperty(F)&&(l=a[F],l!==void 0&&vu(e,t,F,l,a,void 0));return}}for(_ in a)a.hasOwnProperty(_)&&(l=a[_],l!=null&&ut(e,t,_,l,a,null))}function Wb(e,t,a,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,f=null,x=null,_=null,R=null,U=null,F=null;for(V in a){var I=a[V];if(a.hasOwnProperty(V)&&I!=null)switch(V){case"checked":break;case"value":break;case"defaultValue":R=I;default:l.hasOwnProperty(V)||ut(e,t,V,null,l,I)}}for(var H in l){var V=l[H];if(I=a[H],l.hasOwnProperty(H)&&(V!=null||I!=null))switch(H){case"type":f=V;break;case"name":c=V;break;case"checked":U=V;break;case"defaultChecked":F=V;break;case"value":x=V;break;case"defaultValue":_=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(i(137,t));break;default:V!==I&&ut(e,t,H,V,l,I)}}zo(e,x,_,R,U,F,f,c);return;case"select":V=x=_=H=null;for(f in a)if(R=a[f],a.hasOwnProperty(f)&&R!=null)switch(f){case"value":break;case"multiple":V=R;default:l.hasOwnProperty(f)||ut(e,t,f,null,l,R)}for(c in l)if(f=l[c],R=a[c],l.hasOwnProperty(c)&&(f!=null||R!=null))switch(c){case"value":H=f;break;case"defaultValue":_=f;break;case"multiple":x=f;default:f!==R&&ut(e,t,c,f,l,R)}t=_,a=x,l=V,H!=null?Kr(e,!!a,H,!1):!!l!=!!a&&(t!=null?Kr(e,!!a,t,!0):Kr(e,!!a,a?[]:"",!1));return;case"textarea":V=H=null;for(_ in a)if(c=a[_],a.hasOwnProperty(_)&&c!=null&&!l.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:ut(e,t,_,null,l,c)}for(x in l)if(c=l[x],f=a[x],l.hasOwnProperty(x)&&(c!=null||f!=null))switch(x){case"value":H=c;break;case"defaultValue":V=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==f&&ut(e,t,x,c,l,f)}qd(e,H,V);return;case"option":for(var be in a)H=a[be],a.hasOwnProperty(be)&&H!=null&&!l.hasOwnProperty(be)&&(be==="selected"?e.selected=!1:ut(e,t,be,null,l,H));for(R in l)H=l[R],V=a[R],l.hasOwnProperty(R)&&H!==V&&(H!=null||V!=null)&&(R==="selected"?e.selected=H&&typeof H!="function"&&typeof H!="symbol":ut(e,t,R,H,l,V));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 Te in a)H=a[Te],a.hasOwnProperty(Te)&&H!=null&&!l.hasOwnProperty(Te)&&ut(e,t,Te,null,l,H);for(U in l)if(H=l[U],V=a[U],l.hasOwnProperty(U)&&H!==V&&(H!=null||V!=null))switch(U){case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(i(137,t));break;default:ut(e,t,U,H,l,V)}return;default:if(Ao(t)){for(var dt in a)H=a[dt],a.hasOwnProperty(dt)&&H!==void 0&&!l.hasOwnProperty(dt)&&vu(e,t,dt,void 0,l,H);for(F in l)H=l[F],V=a[F],!l.hasOwnProperty(F)||H===V||H===void 0&&V===void 0||vu(e,t,F,H,l,V);return}}for(var D in a)H=a[D],a.hasOwnProperty(D)&&H!=null&&!l.hasOwnProperty(D)&&ut(e,t,D,null,l,H);for(I in l)H=l[I],V=a[I],!l.hasOwnProperty(I)||H===V||H==null&&V==null||ut(e,t,I,H,l,V)}function Xh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ev(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),l=0;l<a.length;l++){var c=a[l],f=c.transferSize,x=c.initiatorType,_=c.duration;if(f&&_&&Xh(x)){for(x=0,_=c.responseEnd,l+=1;l<a.length;l++){var R=a[l],U=R.startTime;if(U>_)break;var F=R.transferSize,I=R.initiatorType;F&&Xh(I)&&(R=R.responseEnd,x+=F*(R<_?1:(_-U)/(R-U)))}if(--l,t+=8*(f+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 _u=null,Su=null;function Xi(e){return e.nodeType===9?e:e.ownerDocument}function Qh(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 Fh(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 ju(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 Nu=null;function tv(){var e=window.event;return e&&e.type==="popstate"?e===Nu?!1:(Nu=e,!0):(Nu=null,!1)}var Zh=typeof setTimeout=="function"?setTimeout:void 0,av=typeof clearTimeout=="function"?clearTimeout:void 0,Jh=typeof Promise=="function"?Promise:void 0,nv=typeof queueMicrotask=="function"?queueMicrotask:typeof Jh<"u"?function(e){return Jh.resolve(null).then(e).catch(rv)}:Zh;function rv(e){setTimeout(function(){throw e})}function tr(e){return e==="head"}function Ph(e,t){var a=t,l=0;do{var c=a.nextSibling;if(e.removeChild(a),c&&c.nodeType===8)if(a=c.data,a==="/$"||a==="/&"){if(l===0){e.removeChild(c),jl(t);return}l--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")l++;else if(a==="html")gs(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,gs(a);for(var f=a.firstChild;f;){var x=f.nextSibling,_=f.nodeName;f[Ye]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&f.rel.toLowerCase()==="stylesheet"||a.removeChild(f),f=x}}else a==="body"&&gs(e.ownerDocument.body);a=c}while(a);jl(t)}function Ih(e,t){var a=e;e=0;do{var l=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||""),l&&l.nodeType===8)if(a=l.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=l}while(a)}function wu(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":wu(a),mt(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function lv(e,t,a,l){for(;e.nodeType===1;){var c=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Ye])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==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(f=e.getAttribute("src"),(f!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var f=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=Ga(e.nextSibling),e===null)break}return null}function sv(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 Wh(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 Eu(e){return e.data==="$?"||e.data==="$~"}function Cu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function iv(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var l=function(){t(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}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 Ru=null;function ep(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 tp(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 ap(e,t,a){switch(t=Xi(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]);mt(e)}var Va=new Map,np=new Set;function Qi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var zn=P.d;P.d={f:ov,r:cv,D:uv,C:dv,L:fv,m:mv,X:pv,S:hv,M:gv};function ov(){var e=zn.f(),t=Hi();return e||t}function cv(e){var t=wt(e);t!==null&&t.tag===5&&t.type==="form"?vm(t):zn.r(e)}var vl=typeof document>"u"?null:document;function rp(e,t,a){var l=vl;if(l&&typeof t=="string"&&t){var c=La(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),np.has(c)||(np.add(c),e={rel:e,crossOrigin:a,href:t},l.querySelector(c)===null&&(t=l.createElement("link"),It(t,"link",e),yt(t),l.head.appendChild(t)))}}function uv(e){zn.D(e),rp("dns-prefetch",e,null)}function dv(e,t){zn.C(e,t),rp("preconnect",e,t)}function fv(e,t,a){zn.L(e,t,a);var l=vl;if(l&&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 f=c;switch(t){case"style":f=_l(e);break;case"script":f=Sl(e)}Va.has(f)||(e=b({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Va.set(f,e),l.querySelector(c)!==null||t==="style"&&l.querySelector(xs(f))||t==="script"&&l.querySelector(ys(f))||(t=l.createElement("link"),It(t,"link",e),yt(t),l.head.appendChild(t)))}}function mv(e,t){zn.m(e,t);var a=vl;if(a&&e){var l=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+La(l)+'"][href="'+La(e)+'"]',f=c;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Sl(e)}if(!Va.has(f)&&(e=b({rel:"modulepreload",href:e},t),Va.set(f,e),a.querySelector(c)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(ys(f)))return}l=a.createElement("link"),It(l,"link",e),yt(l),a.head.appendChild(l)}}}function hv(e,t,a){zn.S(e,t,a);var l=vl;if(l&&e){var c=Yt(l).hoistableStyles,f=_l(e);t=t||"default";var x=c.get(f);if(!x){var _={loading:0,preload:null};if(x=l.querySelector(xs(f)))_.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Va.get(f))&&Tu(e,a);var R=x=l.createElement("link");yt(R),It(R,"link",e),R._p=new Promise(function(U,F){R.onload=U,R.onerror=F}),R.addEventListener("load",function(){_.loading|=1}),R.addEventListener("error",function(){_.loading|=2}),_.loading|=4,Fi(x,t,l)}x={type:"stylesheet",instance:x,count:1,state:_},c.set(f,x)}}}function pv(e,t){zn.X(e,t);var a=vl;if(a&&e){var l=Yt(a).hoistableScripts,c=Sl(e),f=l.get(c);f||(f=a.querySelector(ys(c)),f||(e=b({src:e,async:!0},t),(t=Va.get(c))&&ku(e,t),f=a.createElement("script"),yt(f),It(f,"link",e),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},l.set(c,f))}}function gv(e,t){zn.M(e,t);var a=vl;if(a&&e){var l=Yt(a).hoistableScripts,c=Sl(e),f=l.get(c);f||(f=a.querySelector(ys(c)),f||(e=b({src:e,async:!0,type:"module"},t),(t=Va.get(c))&&ku(e,t),f=a.createElement("script"),yt(f),It(f,"link",e),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},l.set(c,f))}}function lp(e,t,a,l){var c=(c=ve.current)?Qi(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=_l(a.href),a=Yt(c).hoistableStyles,l=a.get(t),l||(l={type:"style",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=_l(a.href);var f=Yt(c).hoistableStyles,x=f.get(e);if(x||(c=c.ownerDocument||c,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,x),(f=c.querySelector(xs(e)))&&!f._p&&(x.instance=f,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),f||xv(c,e,a,x.state))),t&&l===null)throw Error(i(528,""));return x}if(t&&l!==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=Sl(a),a=Yt(c).hoistableScripts,l=a.get(t),l||(l={type:"script",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function _l(e){return'href="'+La(e)+'"'}function xs(e){return'link[rel="stylesheet"]['+e+"]"}function sp(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function xv(e,t,a,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),It(t,"link",a),yt(t),e.head.appendChild(t))}function Sl(e){return'[src="'+La(e)+'"]'}function ys(e){return"script[async]"+e}function ip(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+La(a.href)+'"]');if(l)return t.instance=l,yt(l),l;var c=b({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),yt(l),It(l,"style",c),Fi(l,a.precedence,e),t.instance=l;case"stylesheet":c=_l(a.href);var f=e.querySelector(xs(c));if(f)return t.state.loading|=4,t.instance=f,yt(f),f;l=sp(a),(c=Va.get(c))&&Tu(l,c),f=(e.ownerDocument||e).createElement("link"),yt(f);var x=f;return x._p=new Promise(function(_,R){x.onload=_,x.onerror=R}),It(f,"link",l),t.state.loading|=4,Fi(f,a.precedence,e),t.instance=f;case"script":return f=Sl(a.src),(c=e.querySelector(ys(f)))?(t.instance=c,yt(c),c):(l=a,(c=Va.get(f))&&(l=b({},a),ku(l,c)),e=e.ownerDocument||e,c=e.createElement("script"),yt(c),It(c,"link",l),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&&(l=t.instance,t.state.loading|=4,Fi(l,a.precedence,e));return t.instance}function Fi(e,t,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=l.length?l[l.length-1]:null,f=c,x=0;x<l.length;x++){var _=l[x];if(_.dataset.precedence===t)f=_;else if(f!==c)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Tu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function ku(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Zi=null;function op(e,t,a){if(Zi===null){var l=new Map,c=Zi=new Map;c.set(a,l)}else c=Zi,l=c.get(a),l||(l=new Map,c.set(a,l));if(l.has(e))return l;for(l.set(e,null),a=a.getElementsByTagName(e),c=0;c<a.length;c++){var f=a[c];if(!(f[Ye]||f[ce]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var x=f.getAttribute(t)||"";x=e+x;var _=l.get(x);_?_.push(f):l.set(x,[f])}}return l}function cp(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function yv(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 up(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function bv(e,t,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var c=_l(l.href),f=t.querySelector(xs(c));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ji.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=f,yt(f);return}f=t.ownerDocument||t,l=sp(l),(c=Va.get(c))&&Tu(l,c),f=f.createElement("link"),yt(f);var x=f;x._p=new Promise(function(_,R){x.onload=_,x.onerror=R}),It(f,"link",l),a.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Ji.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Ou=0;function vv(e,t){return e.stylesheets&&e.count===0&&Ii(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var l=setTimeout(function(){if(e.stylesheets&&Ii(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&Ou===0&&(Ou=62500*ev());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ii(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>Ou?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(c)}}:null}function Ji(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ii(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Pi=null;function Ii(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Pi=new Map,t.forEach(_v,e),Pi=null,Ji.call(e))}function _v(e,t){if(!(t.state.loading&4)){var a=Pi.get(e);if(a)var l=a.get(null);else{a=new Map,Pi.set(e,a);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<c.length;f++){var x=c[f];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(a.set(x.dataset.precedence,x),l=x)}l&&a.set(null,l)}c=t.instance,x=c.getAttribute("data-precedence"),f=a.get(x)||l,f===l&&a.set(null,c),a.set(x,c),this.count++,l=Ji.bind(this),c.addEventListener("load",l),c.addEventListener("error",l),f?f.parentNode.insertBefore(c,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var bs={$$typeof:G,Provider:null,Consumer:null,_currentValue:fe,_currentValue2:fe,_threadCount:0};function Sv(e,t,a,l,c,f,x,_,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=Ma(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ma(0),this.hiddenUpdates=Ma(null),this.identifierPrefix=l,this.onUncaughtError=c,this.onCaughtError=f,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function dp(e,t,a,l,c,f,x,_,R,U,F,I){return e=new Sv(e,t,a,x,R,U,F,I,_),t=1,f===!0&&(t|=24),f=Ea(3,null,null,t),e.current=f,f.stateNode=e,t=uc(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:l,isDehydrated:a,cache:t},hc(f),e}function fp(e){return e?(e=Wr,e):Wr}function mp(e,t,a,l,c,f){c=fp(c),l.context===null?l.context=c:l.pendingContext=c,l=Vn(t),l.payload={element:a},f=f===void 0?null:f,f!==null&&(l.callback=f),a=Kn(e,l,t),a!==null&&(ba(a,e,t),Pl(a,e,t))}function hp(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){hp(e,t),(e=e.alternate)&&hp(e,t)}function pp(e){if(e.tag===13||e.tag===31){var t=yr(e,67108864);t!==null&&ba(t,e,67108864),zu(e,67108864)}}function gp(e){if(e.tag===13||e.tag===31){var t=Oa();t=z(t);var a=yr(e,t);a!==null&&ba(a,e,t),zu(e,t)}}var Wi=!0;function jv(e,t,a,l){var c=A.T;A.T=null;var f=P.p;try{P.p=2,Du(e,t,a,l)}finally{P.p=f,A.T=c}}function Nv(e,t,a,l){var c=A.T;A.T=null;var f=P.p;try{P.p=8,Du(e,t,a,l)}finally{P.p=f,A.T=c}}function Du(e,t,a,l){if(Wi){var c=Au(l);if(c===null)bu(e,t,l,eo,a),yp(e,l);else if(Ev(c,e,t,a,l))l.stopPropagation();else if(yp(e,l),t&4&&-1<wv.indexOf(e)){for(;c!==null;){var f=wt(c);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var x=$e(f.pendingLanes);if(x!==0){var _=f;for(_.pendingLanes|=2,_.entangledLanes|=2;x;){var R=1<<31-Dt(x);_.entanglements[1]|=R,x&=~R}fn(f),(rt&6)===0&&(Li=pt()+500,ms(0))}}break;case 31:case 13:_=yr(f,2),_!==null&&ba(_,f,2),Hi(),zu(f,2)}if(f=Au(l),f===null&&bu(e,t,l,eo,a),f===c)break;c=f}c!==null&&l.stopPropagation()}else bu(e,t,l,null,a)}}function Au(e){return e=Lo(e),Mu(e)}var eo=null;function Mu(e){if(eo=null,e=bt(e),e!==null){var t=d(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 eo=e,null}function xp(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 _e:return 2;case Ae:return 8;case Fe:case gt:return 32;case Nt:return 268435456;default:return 32}default:return 32}}var Lu=!1,ar=null,nr=null,rr=null,vs=new Map,_s=new Map,lr=[],wv="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 yp(e,t){switch(e){case"focusin":case"focusout":ar=null;break;case"dragenter":case"dragleave":nr=null;break;case"mouseover":case"mouseout":rr=null;break;case"pointerover":case"pointerout":vs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":_s.delete(t.pointerId)}}function Ss(e,t,a,l,c,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:a,eventSystemFlags:l,nativeEvent:f,targetContainers:[c]},t!==null&&(t=wt(t),t!==null&&pp(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function Ev(e,t,a,l,c){switch(t){case"focusin":return ar=Ss(ar,e,t,a,l,c),!0;case"dragenter":return nr=Ss(nr,e,t,a,l,c),!0;case"mouseover":return rr=Ss(rr,e,t,a,l,c),!0;case"pointerover":var f=c.pointerId;return vs.set(f,Ss(vs.get(f)||null,e,t,a,l,c)),!0;case"gotpointercapture":return f=c.pointerId,_s.set(f,Ss(_s.get(f)||null,e,t,a,l,c)),!0}return!1}function bp(e){var t=bt(e.target);if(t!==null){var a=d(t);if(a!==null){if(t=a.tag,t===13){if(t=m(a),t!==null){e.blockedOn=t,ie(e.priority,function(){gp(a)});return}}else if(t===31){if(t=p(a),t!==null){e.blockedOn=t,ie(e.priority,function(){gp(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 to(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Au(e.nativeEvent);if(a===null){a=e.nativeEvent;var l=new a.constructor(a.type,a);Mo=l,a.target.dispatchEvent(l),Mo=null}else return t=wt(a),t!==null&&pp(t),e.blockedOn=a,!1;t.shift()}return!0}function vp(e,t,a){to(e)&&a.delete(t)}function Cv(){Lu=!1,ar!==null&&to(ar)&&(ar=null),nr!==null&&to(nr)&&(nr=null),rr!==null&&to(rr)&&(rr=null),vs.forEach(vp),_s.forEach(vp)}function ao(e,t){e.blockedOn===t&&(e.blockedOn=null,Lu||(Lu=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Cv)))}var no=null;function _p(e){no!==e&&(no=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){no===e&&(no=null);for(var t=0;t<e.length;t+=3){var a=e[t],l=e[t+1],c=e[t+2];if(typeof l!="function"){if(Mu(l||a)===null)continue;break}var f=wt(a);f!==null&&(e.splice(t,3),t-=3,Ac(f,{pending:!0,data:c,method:a.method,action:l},l,c))}}))}function jl(e){function t(R){return ao(R,e)}ar!==null&&ao(ar,e),nr!==null&&ao(nr,e),rr!==null&&ao(rr,e),vs.forEach(t),_s.forEach(t);for(var a=0;a<lr.length;a++){var l=lr[a];l.blockedOn===e&&(l.blockedOn=null)}for(;0<lr.length&&(a=lr[0],a.blockedOn===null);)bp(a),a.blockedOn===null&&lr.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var c=a[l],f=a[l+1],x=c[he]||null;if(typeof f=="function")x||_p(a);else if(x){var _=null;if(f&&f.hasAttribute("formAction")){if(c=f,x=f[he]||null)_=x.formAction;else if(Mu(c)!==null)continue}else _=x.action;typeof _=="function"?a[l+1]=_:(a.splice(l,3),l-=3),_p(a)}}}function Sp(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(x){return c=x})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),l||setTimeout(a,20)}function a(){if(!l&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function Uu(e){this._internalRoot=e}ro.prototype.render=Uu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var a=t.current,l=Oa();mp(a,l,e,t,null,null)},ro.prototype.unmount=Uu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;mp(e.current,2,null,e,null,null),Hi(),t[pe]=null}};function ro(e){this._internalRoot=e}ro.prototype.unstable_scheduleHydration=function(e){if(e){var t=ne();e={blockedOn:null,target:e,priority:t};for(var a=0;a<lr.length&&t!==0&&t<lr[a].priority;a++);lr.splice(a,0,e),a===0&&bp(e)}};var jp=r.version;if(jp!=="19.2.4")throw Error(i(527,jp,"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 Rv={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:A,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var lo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!lo.isDisabled&&lo.supportsFiber)try{Ft=lo.inject(Rv),Tt=lo}catch{}}return ws.createRoot=function(e,t){if(!o(e))throw Error(i(299));var a=!1,l="",c=km,f=Om,x=zm;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(x=t.onRecoverableError)),t=dp(e,1,!1,null,null,a,l,null,c,f,x,Sp),e[pe]=t.current,yu(e),new Uu(t)},ws.hydrateRoot=function(e,t,a){if(!o(e))throw Error(i(299));var l=!1,c="",f=km,x=Om,_=zm,R=null;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(f=a.onUncaughtError),a.onCaughtError!==void 0&&(x=a.onCaughtError),a.onRecoverableError!==void 0&&(_=a.onRecoverableError),a.formState!==void 0&&(R=a.formState)),t=dp(e,1,!0,t,a??null,l,c,R,f,x,_,Sp),t.context=fp(null),a=t.current,l=Oa(),l=z(l),c=Vn(l),c.callback=null,Kn(a,c,l),a=l,t.current.lanes=a,Na(t,a),fn(t),e[pe]=t.current,yu(e),new ro(t)},ws.version="19.2.4",ws}var eg;function X0(){if(eg)return Ku.exports;eg=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(r){console.error(r)}}return n(),Ku.exports=K0(),Ku.exports}var Q0=X0();var hx=n=>{throw TypeError(n)},F0=(n,r,s)=>r.has(n)||hx("Cannot "+s),Zu=(n,r,s)=>(F0(n,r,"read from private field"),s?s.call(n):r.get(n)),Z0=(n,r,s)=>r.has(n)?hx("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,s),tg="popstate";function ag(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function J0(n={}){function r(i,o){let d=o.state?.masked,{pathname:m,search:p,hash:g}=d||i.location;return Hs("",{pathname:m,search:p,hash:g},o.state&&o.state.usr||null,o.state&&o.state.key||"default",d?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function s(i,o){return typeof o=="string"?o:pn(o)}return I0(r,s,null,n)}function qe(n,r){if(n===!1||n===null||typeof n>"u")throw new Error(r)}function Rt(n,r){if(!n){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function P0(){return Math.random().toString(36).substring(2,10)}function ng(n,r){return{usr:n.state,key:n.key,idx:r,masked:n.unstable_mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function Hs(n,r,s=null,i,o){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof r=="string"?Mn(r):r,state:s,key:r&&r.key||i||P0(),unstable_mask:o}}function pn({pathname:n="/",search:r="",hash:s=""}){return r&&r!=="?"&&(n+=r.charAt(0)==="?"?r:"?"+r),s&&s!=="#"&&(n+=s.charAt(0)==="#"?s:"#"+s),n}function Mn(n){let r={};if(n){let s=n.indexOf("#");s>=0&&(r.hash=n.substring(s),n=n.substring(0,s));let i=n.indexOf("?");i>=0&&(r.search=n.substring(i),n=n.substring(0,i)),n&&(r.pathname=n)}return r}function I0(n,r,s,i={}){let{window:o=document.defaultView,v5Compat:d=!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 b(){p="POP";let O=v(),q=O==null?null:O-h;h=O,g&&g({action:p,location:T.location,delta:q})}function S(O,q){p="PUSH";let X=ag(O)?O:Hs(T.location,O,q);h=v()+1;let G=ng(X,h),M=T.createHref(X.unstable_mask||X);try{m.pushState(G,"",M)}catch(Q){if(Q instanceof DOMException&&Q.name==="DataCloneError")throw Q;o.location.assign(M)}d&&g&&g({action:p,location:T.location,delta:1})}function j(O,q){p="REPLACE";let X=ag(O)?O:Hs(T.location,O,q);h=v();let G=ng(X,h),M=T.createHref(X.unstable_mask||X);m.replaceState(G,"",M),d&&g&&g({action:p,location:T.location,delta:0})}function N(O){return px(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(tg,b),g=O,()=>{o.removeEventListener(tg,b),g=null}},createHref(O){return r(o,O)},createURL:N,encodeLocation(O){let q=N(O);return{pathname:q.pathname,search:q.search,hash:q.hash}},push:S,replace:j,go(O){return m.go(O)}};return T}function px(n,r=!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:pn(n);return i=i.replace(/ $/,"%20"),!r&&i.startsWith("//")&&(i=s+i),new URL(i,s)}var ks,rg=class{constructor(n){if(Z0(this,ks,new Map),n)for(let[r,s]of n)this.set(r,s)}get(n){if(Zu(this,ks).has(n))return Zu(this,ks).get(n);if(n.defaultValue!==void 0)return n.defaultValue;throw new Error("No value found for context")}set(n,r){Zu(this,ks).set(n,r)}};ks=new WeakMap;var W0=new Set(["lazy","caseSensitive","path","id","index","children"]);function e1(n){return W0.has(n)}var t1=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function a1(n){return t1.has(n)}function n1(n){return n.index===!0}function Bs(n,r,s=[],i={},o=!1){return n.map((d,m)=>{let p=[...s,String(m)],g=typeof d.id=="string"?d.id:p.join("-");if(qe(d.index!==!0||!d.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`),n1(d)){let h={...d,id:g};return i[g]=lg(h,r(h)),h}else{let h={...d,id:g,children:void 0};return i[g]=lg(h,r(h)),d.children&&(h.children=Bs(d.children,r,p,i,o)),h}})}function lg(n,r){return Object.assign(n,{...r,...typeof r.lazy=="object"&&r.lazy!=null?{lazy:{...n.lazy,...r.lazy}}:{}})}function ir(n,r,s="/"){return Os(n,r,s,!1)}function Os(n,r,s,i){let o=typeof r=="string"?Mn(r):r,d=Qa(o.pathname||"/",s);if(d==null)return null;let m=gx(n);l1(m);let p=null;for(let g=0;p==null&&g<m.length;++g){let h=g1(d);p=h1(m[g],h,i)}return p}function r1(n,r){let{route:s,pathname:i,params:o}=n;return{id:s.id,pathname:i,params:o,data:r[s.id],loaderData:r[s.id],handle:s.handle}}function gx(n,r=[],s=[],i="",o=!1){let d=(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 b=an([i,v.relativePath]),S=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 "${b}".`),gx(m.children,r,S,b,g)),!(m.path==null&&!m.index)&&r.push({path:b,score:f1(b,m.index),routesMeta:S})};return n.forEach((m,p)=>{if(m.path===""||!m.path?.includes("?"))d(m,p);else for(let g of xx(m.path))d(m,p,!0,g)}),r}function xx(n){let r=n.split("/");if(r.length===0)return[];let[s,...i]=r,o=s.endsWith("?"),d=s.replace(/\?$/,"");if(i.length===0)return o?[d,""]:[d];let m=xx(i.join("/")),p=[];return p.push(...m.map(g=>g===""?d:[d,g].join("/"))),o&&p.push(...m),p.map(g=>n.startsWith("/")&&g===""?"/":g)}function l1(n){n.sort((r,s)=>r.score!==s.score?s.score-r.score:m1(r.routesMeta.map(i=>i.childrenIndex),s.routesMeta.map(i=>i.childrenIndex)))}var s1=/^:[\w-]+$/,i1=3,o1=2,c1=1,u1=10,d1=-2,sg=n=>n==="*";function f1(n,r){let s=n.split("/"),i=s.length;return s.some(sg)&&(i+=d1),r&&(i+=o1),s.filter(o=>!sg(o)).reduce((o,d)=>o+(s1.test(d)?i1:d===""?c1:u1),i)}function m1(n,r){return n.length===r.length&&n.slice(0,-1).every((i,o)=>i===r[o])?n[n.length-1]-r[r.length-1]:0}function h1(n,r,s=!1){let{routesMeta:i}=n,o={},d="/",m=[];for(let p=0;p<i.length;++p){let g=i[p],h=p===i.length-1,v=d==="/"?r:r.slice(d.length)||"/",b=So({path:g.relativePath,caseSensitive:g.caseSensitive,end:h},v),S=g.route;if(!b&&h&&s&&!i[i.length-1].route.index&&(b=So({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},v)),!b)return null;Object.assign(o,b.params),m.push({params:o,pathname:an([d,b.pathname]),pathnameBase:b1(an([d,b.pathnameBase])),route:S}),b.pathnameBase!=="/"&&(d=an([d,b.pathnameBase]))}return m}function So(n,r){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[s,i]=p1(n.path,n.caseSensitive,n.end),o=r.match(s);if(!o)return null;let d=o[0],m=d.replace(/(.)\/+$/,"$1"),p=o.slice(1);return{params:i.reduce((h,{paramName:v,isOptional:b},S)=>{if(v==="*"){let N=p[S]||"";m=d.slice(0,d.length-N.length).replace(/(.)\/+$/,"$1")}const j=p[S];return b&&!j?h[v]=void 0:h[v]=(j||"").replace(/%2F/g,"/"),h},{}),pathname:d,pathnameBase:m,pattern:n}}function p1(n,r=!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 b=v.charAt(h+m.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(i.push({paramName:"*"}),o+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?o+="\\/*$":n!==""&&n!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,r?void 0:"i"),i]}function g1(n){try{return n.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){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 (${r}).`),n}}function Qa(n,r){if(r==="/")return n;if(!n.toLowerCase().startsWith(r.toLowerCase()))return null;let s=r.endsWith("/")?r.length-1:r.length,i=n.charAt(s);return i&&i!=="/"?null:n.slice(s)||"/"}function x1({basename:n,pathname:r}){return r==="/"?n:an([n,r])}var yx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ed=n=>yx.test(n);function y1(n,r="/"){let{pathname:s,search:i="",hash:o=""}=typeof n=="string"?Mn(n):n,d;return s?(s=s.replace(/\/\/+/g,"/"),s.startsWith("/")?d=ig(s.substring(1),"/"):d=ig(s,r)):d=r,{pathname:d,search:v1(i),hash:_1(o)}}function ig(n,r){let s=r.replace(/\/+$/,"").split("/");return n.split("/").forEach(o=>{o===".."?s.length>1&&s.pop():o!=="."&&s.push(o)}),s.length>1?s.join("/"):"/"}function Ju(n,r,s,i){return`Cannot include a '${n}' character in a manually specified \`to.${r}\` 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 bx(n){return n.filter((r,s)=>s===0||r.route.path&&r.route.path.length>0)}function wo(n){let r=bx(n);return r.map((s,i)=>i===r.length-1?s.pathname:s.pathnameBase)}function Ys(n,r,s,i=!1){let o;typeof n=="string"?o=Mn(n):(o={...n},qe(!o.pathname||!o.pathname.includes("?"),Ju("?","pathname","search",o)),qe(!o.pathname||!o.pathname.includes("#"),Ju("#","pathname","hash",o)),qe(!o.search||!o.search.includes("#"),Ju("#","search","hash",o)));let d=n===""||o.pathname==="",m=d?"/":o.pathname,p;if(m==null)p=s;else{let b=r.length-1;if(!i&&m.startsWith("..")){let S=m.split("/");for(;S[0]==="..";)S.shift(),b-=1;o.pathname=S.join("/")}p=b>=0?r[b]:"/"}let g=y1(o,p),h=m&&m!=="/"&&m.endsWith("/"),v=(d||m===".")&&s.endsWith("/");return!g.pathname.endsWith("/")&&(h||v)&&(g.pathname+="/"),g}var an=n=>n.join("/").replace(/\/\/+/g,"/"),b1=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),v1=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,_1=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,Gs=class{constructor(n,r,s,i=!1){this.status=n,this.statusText=r||"",this.internal=i,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function zl(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function Vs(n){return n.map(r=>r.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var vx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function _x(n,r){let s=n;if(typeof s!="string"||!yx.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let i=s,o=!1;if(vx)try{let d=new URL(window.location.href),m=s.startsWith("//")?new URL(d.protocol+s):new URL(s),p=Qa(m.pathname,r);m.origin===d.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 ur=Symbol("Uninstrumented");function S1(n,r){let s={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};n.forEach(o=>o({id:r.id,index:r.index,path:r.path,instrument(d){let m=Object.keys(s);for(let p of m)d[p]&&s[p].push(d[p])}}));let i={};if(typeof r.lazy=="function"&&s.lazy.length>0){let o=Tl(s.lazy,r.lazy,()=>{});o&&(i.lazy=o)}if(typeof r.lazy=="object"){let o=r.lazy;["middleware","loader","action"].forEach(d=>{let m=o[d],p=s[`lazy.${d}`];if(typeof m=="function"&&p.length>0){let g=Tl(p,m,()=>{});g&&(i.lazy=Object.assign(i.lazy||{},{[d]:g}))}})}return["loader","action"].forEach(o=>{let d=r[o];if(typeof d=="function"&&s[o].length>0){let m=d[ur]??d,p=Tl(s[o],m,(...g)=>og(g[0]));p&&(o==="loader"&&m.hydrate===!0&&(p.hydrate=!0),p[ur]=m,i[o]=p)}}),r.middleware&&r.middleware.length>0&&s.middleware.length>0&&(i.middleware=r.middleware.map(o=>{let d=o[ur]??o,m=Tl(s.middleware,d,(...p)=>og(p[0]));return m?(m[ur]=d,m):o})),i}function j1(n,r){let s={navigate:[],fetch:[]};if(r.forEach(i=>i({instrument(o){let d=Object.keys(o);for(let m of d)o[m]&&s[m].push(o[m])}})),s.navigate.length>0){let i=n.navigate[ur]??n.navigate,o=Tl(s.navigate,i,(...d)=>{let[m,p]=d;return{to:typeof m=="number"||typeof m=="string"?m:m?pn(m):".",...cg(n,p??{})}});o&&(o[ur]=i,n.navigate=o)}if(s.fetch.length>0){let i=n.fetch[ur]??n.fetch,o=Tl(s.fetch,i,(...d)=>{let[m,,p,g]=d;return{href:p??".",fetcherKey:m,...cg(n,g??{})}});o&&(o[ur]=i,n.fetch=o)}return n}function Tl(n,r,s){return n.length===0?null:async(...i)=>{let o=await Sx(n,s(...i),()=>r(...i),n.length-1);if(o.type==="error")throw o.value;return o.value}}async function Sx(n,r,s,i){let o=n[i],d;if(o){let m,p=async()=>(m?console.error("You cannot call instrumented handlers more than once"):m=Sx(n,r,s,i-1),d=await m,qe(d,"Expected a result"),d.type==="error"&&d.value instanceof Error?{status:"error",error:d.value}:{status:"success",error:void 0});try{await o(p,r)}catch(g){console.error("An instrumentation function threw an error:",g)}m||await p(),await m}else try{d={type:"success",value:await s()}}catch(m){d={type:"error",value:m}}return d||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function og(n){let{request:r,context:s,params:i,unstable_pattern:o}=n;return{request:N1(r),params:{...i},unstable_pattern:o,context:w1(s)}}function cg(n,r){return{currentUrl:pn(n.state.location),..."formMethod"in r?{formMethod:r.formMethod}:{},..."formEncType"in r?{formEncType:r.formEncType}:{},..."formData"in r?{formData:r.formData}:{},..."body"in r?{body:r.body}:{}}}function N1(n){return{method:n.method,url:n.url,headers:{get:(...r)=>n.headers.get(...r)}}}function w1(n){if(C1(n)){let r={...n};return Object.freeze(r),r}else return{get:r=>n.get(r)}}var E1=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function C1(n){if(n===null||typeof n!="object")return!1;const r=Object.getPrototypeOf(n);return r===Object.prototype||r===null||Object.getOwnPropertyNames(r).sort().join("\0")===E1}var jx=["POST","PUT","PATCH","DELETE"],R1=new Set(jx),T1=["GET",...jx],k1=new Set(T1),Nx=new Set([301,302,303,307,308]),O1=new Set([307,308]),Pu={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},z1={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},D1=n=>({hasErrorBoundary:!!n.hasErrorBoundary}),wx="remix-router-transitions",Ex=Symbol("ResetLoaderData");function A1(n){const r=n.window?n.window:typeof window<"u"?window:void 0,s=typeof r<"u"&&typeof r.document<"u"&&typeof r.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||D1,d=o;if(n.unstable_instrumentations){let C=n.unstable_instrumentations;d=z=>({...o(z),...S1(C.map(B=>B.route).filter(Boolean),z)})}let m={},p=Bs(n.routes,d,void 0,m),g,h=n.basename||"/";h.startsWith("/")||(h=`/${h}`);let v=n.dataStrategy||B1,b={...n.future},S=null,j=new Set,N=null,T=null,O=null,q=n.hydrationData!=null,X=ir(p,n.history.location,h),G=!1,M=null,Q,te;if(X==null&&!n.patchRoutesOnNavigation){let C=Ka(404,{pathname:n.history.location.pathname}),{matches:z,route:B}=io(p);Q=!0,te=!Q,X=z,M={[B.id]:C}}else if(X&&!n.hydrationData&&Ma(X,p,n.history.location.pathname).active&&(X=null),X)if(X.some(C=>C.route.lazy))Q=!1,te=!Q;else if(!X.some(C=>Cd(C.route)))Q=!0,te=!Q;else{let C=n.hydrationData?n.hydrationData.loaderData:null,z=n.hydrationData?n.hydrationData.errors:null,B=X;if(z){let ne=X.findIndex(ie=>z[ie.route.id]!==void 0);B=B.slice(0,ne+1)}te=!1,Q=B.every(ne=>{let ie=Cx(ne.route,C,z);return te=te||ie.renderFallback,!ie.shouldLoad})}else{Q=!1,te=!Q,X=[];let C=Ma(null,p,n.history.location.pathname);C.active&&C.matches&&(G=!0,X=C.matches)}let Z,E={historyAction:n.history.action,location:n.history.location,matches:X,initialized:Q,renderFallback:te,navigation:Pu,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||M,fetchers:new Map,blockers:new Map},Y="POP",W=null,de=!1,oe,le=!1,ue=new Map,ge=null,A=!1,P=!1,fe=new Set,me=new Map,re=0,w=-1,$=new Map,ee=new Set,ae=new Map,xe=new Map,ve=new Set,ke=new Map,Pe,Xe=null;function Wt(){if(S=n.history.listen(({action:C,location:z,delta:B})=>{if(Pe){Pe(),Pe=void 0;return}Rt(ke.size===0||B!=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=Oe({currentLocation:E.location,nextLocation:z,historyAction:C});if(ne&&B!=null){let ie=new Promise(ye=>{Pe=ye});n.history.go(B*-1),se(ne,{state:"blocked",location:z,proceed(){se(ne,{state:"proceeding",proceed:void 0,reset:void 0,location:z}),ie.then(()=>n.history.go(B))},reset(){let ye=new Map(E.blockers);ye.set(ne,Es),et({blockers:ye})}}),W?.resolve(),W=null;return}return ea(C,z)}),s){n4(r,ue);let C=()=>r4(r,ue);r.addEventListener("pagehide",C),ge=()=>r.removeEventListener("pagehide",C)}return E.initialized||ea("POP",E.location,{initialHydration:!0}),Z}function ma(){S&&S(),ge&&ge(),j.clear(),oe&&oe.abort(),E.fetchers.forEach((C,z)=>Ft(z)),E.blockers.forEach((C,z)=>K(z))}function Qe(C){return j.add(C),()=>j.delete(C)}function et(C,z={}){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 B=[],ne=[];E.fetchers.forEach((ie,ye)=>{ie.state==="idle"&&(ve.has(ye)?B.push(ye):ne.push(ye))}),ve.forEach(ie=>{!E.fetchers.has(ie)&&!me.has(ie)&&B.push(ie)}),[...j].forEach(ie=>ie(E,{deletedFetchers:B,newErrors:C.errors??null,viewTransitionOpts:z.viewTransitionOpts,flushSync:z.flushSync===!0})),B.forEach(ie=>Ft(ie)),ne.forEach(ie=>E.fetchers.delete(ie))}function ft(C,z,{flushSync:B}={}){let ne=E.actionData!=null&&E.navigation.formMethod!=null&&ra(E.navigation.formMethod)&&E.navigation.state==="loading"&&C.state?._isRedirect!==!0,ie;z.actionData?Object.keys(z.actionData).length>0?ie=z.actionData:ie=null:ne?ie=E.actionData:ie=null;let ye=z.loaderData?bg(E.loaderData,z.loaderData,z.matches||[],z.errors):E.loaderData,ce=E.blockers;ce.size>0&&(ce=new Map(ce),ce.forEach((Re,Ne)=>ce.set(Ne,Es)));let he=A?!1:ca(C,z.matches||E.matches),pe=de===!0||E.navigation.formMethod!=null&&ra(E.navigation.formMethod)&&C.state?._isRedirect!==!0;g&&(p=g,g=void 0),A||Y==="POP"||(Y==="PUSH"?n.history.push(C,C.state):Y==="REPLACE"&&n.history.replace(C,C.state));let we;if(Y==="POP"){let Re=ue.get(E.location.pathname);Re&&Re.has(C.pathname)?we={currentLocation:E.location,nextLocation:C}:ue.has(C.pathname)&&(we={currentLocation:C,nextLocation:E.location})}else if(le){let Re=ue.get(E.location.pathname);Re?Re.add(C.pathname):(Re=new Set([C.pathname]),ue.set(E.location.pathname,Re)),we={currentLocation:E.location,nextLocation:C}}et({...z,actionData:ie,loaderData:ye,historyAction:Y,location:C,initialized:!0,renderFallback:!1,navigation:Pu,revalidation:"idle",restoreScrollPosition:he,preventScrollReset:pe,blockers:ce},{viewTransitionOpts:we,flushSync:B===!0}),Y="POP",de=!1,le=!1,A=!1,P=!1,W?.resolve(),W=null,Xe?.resolve(),Xe=null}async function qt(C,z){if(W?.resolve(),W=null,typeof C=="number"){W||(W=jg());let mt=W.promise;return n.history.go(C),mt}let B=fd(E.location,E.matches,h,C,z?.fromRouteId,z?.relative),{path:ne,submission:ie,error:ye}=ug(!1,B,z),ce;z?.unstable_mask&&(ce={pathname:"",search:"",hash:"",...typeof z.unstable_mask=="string"?Mn(z.unstable_mask):{...E.location.unstable_mask,...z.unstable_mask}});let he=E.location,pe=Hs(he,ne,z&&z.state,void 0,ce);pe={...pe,...n.history.encodeLocation(pe)};let we=z&&z.replace!=null?z.replace:void 0,Re="PUSH";we===!0?Re="REPLACE":we===!1||ie!=null&&ra(ie.formMethod)&&ie.formAction===E.location.pathname+E.location.search&&(Re="REPLACE");let Ne=z&&"preventScrollReset"in z?z.preventScrollReset===!0:void 0,tt=(z&&z.flushSync)===!0,Ye=Oe({currentLocation:he,nextLocation:pe,historyAction:Re});if(Ye){se(Ye,{state:"blocked",location:pe,proceed(){se(Ye,{state:"proceeding",proceed:void 0,reset:void 0,location:pe}),qt(C,z)},reset(){let mt=new Map(E.blockers);mt.set(Ye,Es),et({blockers:mt})}});return}await ea(Re,pe,{submission:ie,pendingError:ye,preventScrollReset:Ne,replace:z&&z.replace,enableViewTransition:z&&z.viewTransition,flushSync:tt,callSiteDefaultShouldRevalidate:z&&z.unstable_defaultShouldRevalidate})}function Vt(){Xe||(Xe=jg()),Fe(),et({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(Y||E.historyAction,E.navigation.location,{overrideNavigation:E.navigation,enableViewTransition:le===!0}),C)}async function ea(C,z,B){oe&&oe.abort(),oe=null,Y=C,A=(B&&B.startUninterruptedRevalidation)===!0,oa(E.location,E.matches),de=(B&&B.preventScrollReset)===!0,le=(B&&B.enableViewTransition)===!0;let ne=g||p,ie=B&&B.overrideNavigation,ye=B?.initialHydration&&E.matches&&E.matches.length>0&&!G?E.matches:ir(ne,z,h),ce=(B&&B.flushSync)===!0;if(ye&&E.initialized&&!P&&Q1(E.location,z)&&!(B&&B.submission&&ra(B.submission.formMethod))){ft(z,{matches:ye},{flushSync:ce});return}let he=Ma(ye,ne,z.pathname);if(he.active&&he.matches&&(ye=he.matches),!ye){let{error:bt,notFoundMatches:wt,route:We}=$e(z.pathname);ft(z,{matches:wt,loaderData:{},errors:{[We.id]:bt}},{flushSync:ce});return}oe=new AbortController;let pe=Cl(n.history,z,oe.signal,B&&B.submission),we=n.getContext?await n.getContext():new rg,Re;if(B&&B.pendingError)Re=[or(ye).route.id,{type:"error",error:B.pendingError}];else if(B&&B.submission&&ra(B.submission.formMethod)){let bt=await ta(pe,z,B.submission,ye,we,he.active,B&&B.initialHydration===!0,{replace:B.replace,flushSync:ce});if(bt.shortCircuited)return;if(bt.pendingActionResult){let[wt,We]=bt.pendingActionResult;if(za(We)&&zl(We.error)&&We.error.status===404){oe=null,ft(z,{matches:bt.matches,loaderData:{},errors:{[wt]:We.error}});return}}ye=bt.matches||ye,Re=bt.pendingActionResult,ie=Iu(z,B.submission),ce=!1,he.active=!1,pe=Cl(n.history,pe.url,pe.signal)}let{shortCircuited:Ne,matches:tt,loaderData:Ye,errors:mt}=await Sa(pe,z,ye,we,he.active,ie,B&&B.submission,B&&B.fetcherSubmission,B&&B.replace,B&&B.initialHydration===!0,ce,Re,B&&B.callSiteDefaultShouldRevalidate);Ne||(oe=null,ft(z,{matches:tt||ye,...vg(Re),loaderData:Ye,errors:mt}))}async function ta(C,z,B,ne,ie,ye,ce,he={}){Fe();let pe=t4(z,B);if(et({navigation:pe},{flushSync:he.flushSync===!0}),ye){let Ne=await Na(ne,z.pathname,C.signal);if(Ne.type==="aborted")return{shortCircuited:!0};if(Ne.type==="error"){if(Ne.partialMatches.length===0){let{matches:Ye,route:mt}=io(p);return{matches:Ye,pendingActionResult:[mt.id,{type:"error",error:Ne.error}]}}let tt=or(Ne.partialMatches).route.id;return{matches:Ne.partialMatches,pendingActionResult:[tt,{type:"error",error:Ne.error}]}}else if(Ne.matches)ne=Ne.matches;else{let{notFoundMatches:tt,error:Ye,route:mt}=$e(z.pathname);return{matches:tt,pendingActionResult:[mt.id,{type:"error",error:Ye}]}}}let we,Re=go(ne,z);if(!Re.route.action&&!Re.route.lazy)we={type:"error",error:Ka(405,{method:C.method,pathname:z.pathname,routeId:Re.route.id})};else{let Ne=kl(d,m,C,ne,Re,ce?[]:i,ie),tt=await _e(C,Ne,ie,null);if(we=tt[Re.route.id],!we){for(let Ye of ne)if(tt[Ye.route.id]){we=tt[Ye.route.id];break}}if(C.signal.aborted)return{shortCircuited:!0}}if(zr(we)){let Ne;return he&&he.replace!=null?Ne=he.replace:Ne=gg(we.response.headers.get("Location"),new URL(C.url),h,n.history)===E.location.pathname+E.location.search,await ia(C,we,!0,{submission:B,replace:Ne}),{shortCircuited:!0}}if(za(we)){let Ne=or(ne,Re.route.id);return(he&&he.replace)!==!0&&(Y="PUSH"),{matches:ne,pendingActionResult:[Ne.route.id,we,Re.route.id]}}return{matches:ne,pendingActionResult:[Re.route.id,we]}}async function Sa(C,z,B,ne,ie,ye,ce,he,pe,we,Re,Ne,tt){let Ye=ye||Iu(z,ce),mt=ce||he||Sg(Ye),bt=!A&&!we;if(ie){if(bt){let kt=ja(Ne);et({navigation:Ye,...kt!==void 0?{actionData:kt}:{}},{flushSync:Re})}let Ge=await Na(B,z.pathname,C.signal);if(Ge.type==="aborted")return{shortCircuited:!0};if(Ge.type==="error"){if(Ge.partialMatches.length===0){let{matches:aa,route:Mt}=io(p);return{matches:aa,loaderData:{},errors:{[Mt.id]:Ge.error}}}let kt=or(Ge.partialMatches).route.id;return{matches:Ge.partialMatches,loaderData:{},errors:{[kt]:Ge.error}}}else if(Ge.matches)B=Ge.matches;else{let{error:kt,notFoundMatches:aa,route:Mt}=$e(z.pathname);return{matches:aa,loaderData:{},errors:{[Mt.id]:kt}}}}let wt=g||p,{dsMatches:We,revalidatingFetchers:Yt}=dg(C,ne,d,m,n.history,E,B,mt,z,we?[]:i,we===!0,P,fe,ve,ae,ee,wt,h,n.patchRoutesOnNavigation!=null,Ne,tt);if(w=++re,!n.dataStrategy&&!We.some(Ge=>Ge.shouldLoad)&&!We.some(Ge=>Ge.route.middleware&&Ge.route.middleware.length>0)&&Yt.length===0){let Ge=Ce();return ft(z,{matches:B,loaderData:{},errors:Ne&&za(Ne[1])?{[Ne[0]]:Ne[1].error}:null,...vg(Ne),...Ge?{fetchers:new Map(E.fetchers)}:{}},{flushSync:Re}),{shortCircuited:!0}}if(bt){let Ge={};if(!ie){Ge.navigation=Ye;let kt=ja(Ne);kt!==void 0&&(Ge.actionData=kt)}Yt.length>0&&(Ge.fetchers=Aa(Yt)),et(Ge,{flushSync:Re})}Yt.forEach(Ge=>{xt(Ge.key),Ge.controller&&me.set(Ge.key,Ge.controller)});let yt=()=>Yt.forEach(Ge=>xt(Ge.key));oe&&oe.signal.addEventListener("abort",yt);let{loaderResults:Un,fetcherResults:Ia}=await Ae(We,Yt,C,ne);if(C.signal.aborted)return{shortCircuited:!0};oe&&oe.signal.removeEventListener("abort",yt),Yt.forEach(Ge=>me.delete(Ge.key));let Kt=oo(Un);if(Kt)return await ia(C,Kt.result,!0,{replace:pe}),{shortCircuited:!0};if(Kt=oo(Ia),Kt)return ee.add(Kt.key),await ia(C,Kt.result,!0,{replace:pe}),{shortCircuited:!0};let{loaderData:sn,errors:mr}=yg(E,B,Un,Ne,Yt,Ia);we&&E.errors&&(mr={...E.errors,...mr});let on=Ce(),hr=Le(w),Yr=on||hr||Yt.length>0;return{matches:B,loaderData:sn,errors:mr,...Yr?{fetchers:new Map(E.fetchers)}:{}}}function ja(C){if(C&&!za(C[1]))return{[C[0]]:C[1].data};if(E.actionData)return Object.keys(E.actionData).length===0?null:E.actionData}function Aa(C){return C.forEach(z=>{let B=E.fetchers.get(z.key),ne=Cs(void 0,B?B.data:void 0);E.fetchers.set(z.key,ne)}),new Map(E.fetchers)}async function la(C,z,B,ne){xt(C);let ie=(ne&&ne.flushSync)===!0,ye=g||p,ce=fd(E.location,E.matches,h,B,z,ne?.relative),he=ir(ye,ce,h),pe=Ma(he,ye,ce);if(pe.active&&pe.matches&&(he=pe.matches),!he){Nt(C,z,Ka(404,{pathname:ce}),{flushSync:ie});return}let{path:we,submission:Re,error:Ne}=ug(!0,ce,ne);if(Ne){Nt(C,z,Ne,{flushSync:ie});return}let tt=n.getContext?await n.getContext():new rg,Ye=(ne&&ne.preventScrollReset)===!0;if(Re&&ra(Re.formMethod)){await sa(C,z,we,he,tt,pe.active,ie,Ye,Re,ne&&ne.unstable_defaultShouldRevalidate);return}ae.set(C,{routeId:z,path:we}),await pt(C,z,we,he,tt,pe.active,ie,Ye,Re)}async function sa(C,z,B,ne,ie,ye,ce,he,pe,we){Fe(),ae.delete(C);let Re=E.fetchers.get(C);gt(C,a4(pe,Re),{flushSync:ce});let Ne=new AbortController,tt=Cl(n.history,B,Ne.signal,pe);if(ye){let vt=await Na(ne,new URL(tt.url).pathname,tt.signal,C);if(vt.type==="aborted")return;if(vt.type==="error"){Nt(C,z,vt.error,{flushSync:ce});return}else if(vt.matches)ne=vt.matches;else{Nt(C,z,Ka(404,{pathname:B}),{flushSync:ce});return}}let Ye=go(ne,B);if(!Ye.route.action&&!Ye.route.lazy){let vt=Ka(405,{method:pe.formMethod,pathname:B,routeId:z});Nt(C,z,vt,{flushSync:ce});return}me.set(C,Ne);let mt=re,bt=kl(d,m,tt,ne,Ye,i,ie),wt=await _e(tt,bt,ie,C),We=wt[Ye.route.id];if(!We){for(let vt of bt)if(wt[vt.route.id]){We=wt[vt.route.id];break}}if(tt.signal.aborted){me.get(C)===Ne&&me.delete(C);return}if(ve.has(C)){if(zr(We)||za(We)){gt(C,Dn(void 0));return}}else{if(zr(We))if(me.delete(C),w>mt){gt(C,Dn(void 0));return}else return ee.add(C),gt(C,Cs(pe)),ia(tt,We,!1,{fetcherSubmission:pe,preventScrollReset:he});if(za(We)){Nt(C,z,We.error);return}}let Yt=E.navigation.location||E.location,yt=Cl(n.history,Yt,Ne.signal),Un=g||p,Ia=E.navigation.state!=="idle"?ir(Un,E.navigation.location,h):E.matches;qe(Ia,"Didn't find any matches after fetcher action");let Kt=++re;$.set(C,Kt);let sn=Cs(pe,We.data);E.fetchers.set(C,sn);let{dsMatches:mr,revalidatingFetchers:on}=dg(yt,ie,d,m,n.history,E,Ia,pe,Yt,i,!1,P,fe,ve,ae,ee,Un,h,n.patchRoutesOnNavigation!=null,[Ye.route.id,We],we);on.filter(vt=>vt.key!==C).forEach(vt=>{let Gr=vt.key,Vr=E.fetchers.get(Gr),Zs=Cs(void 0,Vr?Vr.data:void 0);E.fetchers.set(Gr,Zs),xt(Gr),vt.controller&&me.set(Gr,vt.controller)}),et({fetchers:new Map(E.fetchers)});let hr=()=>on.forEach(vt=>xt(vt.key));Ne.signal.addEventListener("abort",hr);let{loaderResults:Yr,fetcherResults:Ge}=await Ae(mr,on,yt,ie);if(Ne.signal.aborted)return;if(Ne.signal.removeEventListener("abort",hr),$.delete(C),me.delete(C),on.forEach(vt=>me.delete(vt.key)),E.fetchers.has(C)){let vt=Dn(We.data);E.fetchers.set(C,vt)}let kt=oo(Yr);if(kt)return ia(yt,kt.result,!1,{preventScrollReset:he});if(kt=oo(Ge),kt)return ee.add(kt.key),ia(yt,kt.result,!1,{preventScrollReset:he});let{loaderData:aa,errors:Mt}=yg(E,Ia,Yr,void 0,on,Ge);Le(Kt),E.navigation.state==="loading"&&Kt>w?(qe(Y,"Expected pending action"),oe&&oe.abort(),ft(E.navigation.location,{matches:Ia,loaderData:aa,errors:Mt,fetchers:new Map(E.fetchers)})):(et({errors:Mt,loaderData:bg(E.loaderData,aa,Ia,Mt),fetchers:new Map(E.fetchers)}),P=!1)}async function pt(C,z,B,ne,ie,ye,ce,he,pe){let we=E.fetchers.get(C);gt(C,Cs(pe,we?we.data:void 0),{flushSync:ce});let Re=new AbortController,Ne=Cl(n.history,B,Re.signal);if(ye){let We=await Na(ne,new URL(Ne.url).pathname,Ne.signal,C);if(We.type==="aborted")return;if(We.type==="error"){Nt(C,z,We.error,{flushSync:ce});return}else if(We.matches)ne=We.matches;else{Nt(C,z,Ka(404,{pathname:B}),{flushSync:ce});return}}let tt=go(ne,B);me.set(C,Re);let Ye=re,mt=kl(d,m,Ne,ne,tt,i,ie),wt=(await _e(Ne,mt,ie,C))[tt.route.id];if(me.get(C)===Re&&me.delete(C),!Ne.signal.aborted){if(ve.has(C)){gt(C,Dn(void 0));return}if(zr(wt))if(w>Ye){gt(C,Dn(void 0));return}else{ee.add(C),await ia(Ne,wt,!1,{preventScrollReset:he});return}if(za(wt)){Nt(C,z,wt.error);return}gt(C,Dn(wt.data))}}async function ia(C,z,B,{submission:ne,fetcherSubmission:ie,preventScrollReset:ye,replace:ce}={}){B||(W?.resolve(),W=null),z.response.headers.has("X-Remix-Revalidate")&&(P=!0);let he=z.response.headers.get("Location");qe(he,"Expected a Location header on the redirect Response"),he=gg(he,new URL(C.url),h,n.history);let pe=Hs(E.location,he,{_isRedirect:!0});if(s){let mt=!1;if(z.response.headers.has("X-Remix-Reload-Document"))mt=!0;else if(Ed(he)){const bt=px(he,!0);mt=bt.origin!==r.location.origin||Qa(bt.pathname,h)==null}if(mt){ce?r.location.replace(he):r.location.assign(he);return}}oe=null;let we=ce===!0||z.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Re,formAction:Ne,formEncType:tt}=E.navigation;!ne&&!ie&&Re&&Ne&&tt&&(ne=Sg(E.navigation));let Ye=ne||ie;if(O1.has(z.response.status)&&Ye&&ra(Ye.formMethod))await ea(we,pe,{submission:{...Ye,formAction:he},preventScrollReset:ye||de,enableViewTransition:B?le:void 0});else{let mt=Iu(pe,ne);await ea(we,pe,{overrideNavigation:mt,fetcherSubmission:ie,preventScrollReset:ye||de,enableViewTransition:B?le:void 0})}}async function _e(C,z,B,ne){let ie,ye={};try{ie=await q1(v,C,z,ne,B,!1)}catch(ce){return z.filter(he=>he.shouldLoad).forEach(he=>{ye[he.route.id]={type:"error",error:ce}}),ye}if(C.signal.aborted)return ye;if(!ra(C.method))for(let ce of z){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(P1(he)){let pe=he.result;ye[ce]={type:"redirect",response:K1(pe,C,ce,z,h)}}else ye[ce]=await V1(he);return ye}async function Ae(C,z,B,ne){let ie=_e(B,C,ne,null),ye=Promise.all(z.map(async pe=>{if(pe.matches&&pe.match&&pe.request&&pe.controller){let Re=(await _e(pe.request,pe.matches,ne,pe.key))[pe.match.route.id];return{[pe.key]:Re}}else return Promise.resolve({[pe.key]:{type:"error",error:Ka(404,{pathname:pe.path})}})})),ce=await ie,he=(await ye).reduce((pe,we)=>Object.assign(pe,we),{});return{loaderResults:ce,fetcherResults:he}}function Fe(){P=!0,ae.forEach((C,z)=>{me.has(z)&&fe.add(z),xt(z)})}function gt(C,z,B={}){E.fetchers.set(C,z),et({fetchers:new Map(E.fetchers)},{flushSync:(B&&B.flushSync)===!0})}function Nt(C,z,B,ne={}){let ie=or(E.matches,z);Ft(C),et({errors:{[ie.route.id]:B},fetchers:new Map(E.fetchers)},{flushSync:(ne&&ne.flushSync)===!0})}function Qt(C){return xe.set(C,(xe.get(C)||0)+1),ve.has(C)&&ve.delete(C),E.fetchers.get(C)||z1}function Pa(C,z){xt(C,z?.reason),gt(C,Dn(null))}function Ft(C){let z=E.fetchers.get(C);me.has(C)&&!(z&&z.state==="loading"&&$.has(C))&&xt(C),ae.delete(C),$.delete(C),ee.delete(C),ve.delete(C),fe.delete(C),E.fetchers.delete(C)}function Tt(C){let z=(xe.get(C)||0)-1;z<=0?(xe.delete(C),ve.add(C)):xe.set(C,z),et({fetchers:new Map(E.fetchers)})}function xt(C,z){let B=me.get(C);B&&(B.abort(z),me.delete(C))}function Dt(C){for(let z of C){let B=Qt(z),ne=Dn(B.data);E.fetchers.set(z,ne)}}function Ce(){let C=[],z=!1;for(let B of ee){let ne=E.fetchers.get(B);qe(ne,`Expected fetcher: ${B}`),ne.state==="loading"&&(ee.delete(B),C.push(B),z=!0)}return Dt(C),z}function Le(C){let z=[];for(let[B,ne]of $)if(ne<C){let ie=E.fetchers.get(B);qe(ie,`Expected fetcher: ${B}`),ie.state==="loading"&&(xt(B),$.delete(B),z.push(B))}return Dt(z),z.length>0}function lt(C,z){let B=E.blockers.get(C)||Es;return ke.get(C)!==z&&ke.set(C,z),B}function K(C){E.blockers.delete(C),ke.delete(C)}function se(C,z){let B=E.blockers.get(C)||Es;qe(B.state==="unblocked"&&z.state==="blocked"||B.state==="blocked"&&z.state==="blocked"||B.state==="blocked"&&z.state==="proceeding"||B.state==="blocked"&&z.state==="unblocked"||B.state==="proceeding"&&z.state==="unblocked",`Invalid blocker state transition: ${B.state} -> ${z.state}`);let ne=new Map(E.blockers);ne.set(C,z),et({blockers:ne})}function Oe({currentLocation:C,nextLocation:z,historyAction:B}){if(ke.size===0)return;ke.size>1&&Rt(!1,"A router only supports one blocker at a time");let ne=Array.from(ke.entries()),[ie,ye]=ne[ne.length-1],ce=E.blockers.get(ie);if(!(ce&&ce.state==="proceeding")&&ye({currentLocation:C,nextLocation:z,historyAction:B}))return ie}function $e(C){let z=Ka(404,{pathname:C}),B=g||p,{matches:ne,route:ie}=io(B);return{notFoundMatches:ne,route:ie,error:z}}function Ue(C,z,B){if(N=C,O=z,T=B||null,!q&&E.navigation===Pu){q=!0;let ne=ca(E.location,E.matches);ne!=null&&et({restoreScrollPosition:ne})}return()=>{N=null,O=null,T=null}}function At(C,z){return T&&T(C,z.map(ne=>r1(ne,E.loaderData)))||C.key}function oa(C,z){if(N&&O){let B=At(C,z);N[B]=O()}}function ca(C,z){if(N){let B=At(C,z),ne=N[B];if(typeof ne=="number")return ne}return null}function Ma(C,z,B){if(n.patchRoutesOnNavigation)if(C){if(Object.keys(C[0].params).length>0)return{active:!0,matches:Os(z,B,h,!0)}}else return{active:!0,matches:Os(z,B,h,!0)||[]};return{active:!1,matches:null}}async function Na(C,z,B,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:B,path:z,matches:ie,fetcherKey:ne,patch:(Re,Ne)=>{B.aborted||fg(Re,Ne,ce,he,d,!1)}})}catch(Re){return{type:"error",error:Re,partialMatches:ie}}finally{ye&&!B.aborted&&(p=[...p])}if(B.aborted)return{type:"aborted"};let pe=ir(ce,z,h),we=null;if(pe){if(Object.keys(pe[0].params).length===0)return{type:"success",matches:pe};if(we=Os(ce,z,h,!0),!(we&&ie.length<we.length&&fr(ie,we.slice(0,ie.length))))return{type:"success",matches:pe}}if(we||(we=Os(ce,z,h,!0)),!we||fr(ie,we))return{type:"success",matches:null};ie=we}}function fr(C,z){return C.length===z.length&&C.every((B,ne)=>B.route.id===z[ne].route.id)}function $r(C){m={},g=Bs(C,d,void 0,m)}function qr(C,z,B=!1){let ne=g==null;fg(C,z,g||p,m,d,B),ne&&(p=[...p],et({}))}return Z={get basename(){return h},get future(){return b},get state(){return E},get routes(){return p},get window(){return r},initialize:Wt,subscribe:Qe,enableScrollRestoration:Ue,navigate:qt,fetch:la,revalidate:Vt,createHref:C=>n.history.createHref(C),encodeLocation:C=>n.history.encodeLocation(C),getFetcher:Qt,resetFetcher:Pa,deleteFetcher:Tt,dispose:ma,getBlocker:lt,deleteBlocker:K,patchRoutes:qr,_internalFetchControllers:me,_internalSetRoutes:$r,_internalSetStateDoNotUseOrYouWillBreakYourApp(C){et(C)}},n.unstable_instrumentations&&(Z=j1(Z,n.unstable_instrumentations.map(C=>C.router).filter(Boolean))),Z}function M1(n){return n!=null&&("formData"in n&&n.formData!=null||"body"in n&&n.body!==void 0)}function fd(n,r,s,i,o,d){let m,p;if(o){m=[];for(let h of r)if(m.push(h),h.route.id===o){p=h;break}}else m=r,p=r[r.length-1];let g=Ys(i||".",wo(m),Qa(n.pathname,s)||n.pathname,d==="path");if(i==null&&(g.search=n.search,g.hash=n.hash),(i==null||i===""||i===".")&&p){let h=Td(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),b=v.getAll("index");v.delete("index"),b.filter(j=>j).forEach(j=>v.append("index",j));let S=v.toString();g.search=S?`?${S}`:""}}return s!=="/"&&(g.pathname=x1({basename:s,pathname:g.pathname})),pn(g)}function ug(n,r,s){if(!s||!M1(s))return{path:r};if(s.formMethod&&!e4(s.formMethod))return{path:r,error:Ka(405,{method:s.formMethod})};let i=()=>({path:r,error:Ka(400,{type:"invalid-body"})}),d=(s.formMethod||"get").toUpperCase(),m=Dx(r);if(s.body!==void 0){if(s.formEncType==="text/plain"){if(!ra(d))return i();let b=typeof s.body=="string"?s.body:s.body instanceof FormData||s.body instanceof URLSearchParams?Array.from(s.body.entries()).reduce((S,[j,N])=>`${S}${j}=${N}
11
+ `,""):String(s.body);return{path:r,submission:{formMethod:d,formAction:m,formEncType:s.formEncType,formData:void 0,json:void 0,text:b}}}else if(s.formEncType==="application/json"){if(!ra(d))return i();try{let b=typeof s.body=="string"?JSON.parse(s.body):s.body;return{path:r,submission:{formMethod:d,formAction:m,formEncType:s.formEncType,formData:void 0,json:b,text:void 0}}}catch{return i()}}}qe(typeof FormData=="function","FormData is not available in this environment");let p,g;if(s.formData)p=hd(s.formData),g=s.formData;else if(s.body instanceof FormData)p=hd(s.body),g=s.body;else if(s.body instanceof URLSearchParams)p=s.body,g=xg(p);else if(s.body==null)p=new URLSearchParams,g=new FormData;else try{p=new URLSearchParams(s.body),g=xg(p)}catch{return i()}let h={formMethod:d,formAction:m,formEncType:s&&s.formEncType||"application/x-www-form-urlencoded",formData:g,json:void 0,text:void 0};if(ra(h.formMethod))return{path:r,submission:h};let v=Mn(r);return n&&v.search&&Td(v.search)&&p.append("index",""),v.search=`?${p}`,{path:pn(v),submission:h}}function dg(n,r,s,i,o,d,m,p,g,h,v,b,S,j,N,T,O,q,X,G,M){let Q=G?za(G[1])?G[1].error:G[1].data:void 0,te=o.createURL(d.location),Z=o.createURL(g),E;if(v&&d.errors){let ge=Object.keys(d.errors)[0];E=m.findIndex(A=>A.route.id===ge)}else if(G&&za(G[1])){let ge=G[0];E=m.findIndex(A=>A.route.id===ge)-1}let Y=G?G[1].statusCode:void 0,W=Y&&Y>=400,de={currentUrl:te,currentParams:d.matches[0]?.params||{},nextUrl:Z,nextParams:m[0].params,...p,actionResult:Q,actionStatus:Y},oe=Vs(m),le=m.map((ge,A)=>{let{route:P}=ge,fe=null;if(E!=null&&A>E)fe=!1;else if(P.lazy)fe=!0;else if(!Cd(P))fe=!1;else if(v){let{shouldLoad:$}=Cx(P,d.loaderData,d.errors);fe=$}else L1(d.loaderData,d.matches[A],ge)&&(fe=!0);if(fe!==null)return md(s,i,n,oe,ge,h,r,fe);let me=!1;typeof M=="boolean"?me=M:W?me=!1:(b||te.pathname+te.search===Z.pathname+Z.search||te.search!==Z.search||U1(d.matches[A],ge))&&(me=!0);let re={...de,defaultShouldRevalidate:me},w=Ms(ge,re);return md(s,i,n,oe,ge,h,r,w,re,M)}),ue=[];return N.forEach((ge,A)=>{if(v||!m.some(ae=>ae.route.id===ge.routeId)||j.has(A))return;let P=d.fetchers.get(A),fe=P&&P.state!=="idle"&&P.data===void 0,me=ir(O,ge.path,q);if(!me){if(X&&fe)return;ue.push({key:A,routeId:ge.routeId,path:ge.path,matches:null,match:null,request:null,controller:null});return}if(T.has(A))return;let re=go(me,ge.path),w=new AbortController,$=Cl(o,ge.path,w.signal),ee=null;if(S.has(A))S.delete(A),ee=kl(s,i,$,me,re,h,r);else if(fe)b&&(ee=kl(s,i,$,me,re,h,r));else{let ae;typeof M=="boolean"?ae=M:W?ae=!1:ae=b;let xe={...de,defaultShouldRevalidate:ae};Ms(re,xe)&&(ee=kl(s,i,$,me,re,h,r,xe))}ee&&ue.push({key:A,routeId:ge.routeId,path:ge.path,matches:ee,match:re,request:$,controller:w})}),{dsMatches:le,revalidatingFetchers:ue}}function Cd(n){return n.loader!=null||n.middleware!=null&&n.middleware.length>0}function Cx(n,r,s){if(n.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Cd(n))return{shouldLoad:!1,renderFallback:!1};let i=r!=null&&n.id in r,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 d=!i&&!o;return{shouldLoad:d,renderFallback:d}}function L1(n,r,s){let i=!r||s.route.id!==r.route.id,o=!n.hasOwnProperty(s.route.id);return i||o}function U1(n,r){let s=n.route.path;return n.pathname!==r.pathname||s!=null&&s.endsWith("*")&&n.params["*"]!==r.params["*"]}function Ms(n,r){if(n.route.shouldRevalidate){let s=n.route.shouldRevalidate(r);if(typeof s=="boolean")return s}return r.defaultShouldRevalidate}function fg(n,r,s,i,o,d){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(r.forEach(h=>{let v=m.find(b=>Rx(h,b));v?g.push({existingRoute:v,newRoute:h}):p.push(h)}),p.length>0){let h=Bs(p,o,[n||"_","patch",String(m?.length||"0")],i);m.push(...h)}if(d&&g.length>0)for(let h=0;h<g.length;h++){let{existingRoute:v,newRoute:b}=g[h],S=v,[j]=Bs([b],o,[],{},!0);Object.assign(S,{element:j.element?j.element:S.element,errorElement:j.errorElement?j.errorElement:S.errorElement,hydrateFallbackElement:j.hydrateFallbackElement?j.hydrateFallbackElement:S.hydrateFallbackElement})}}function Rx(n,r){return"id"in n&&"id"in r&&n.id===r.id?!0:n.index===r.index&&n.path===r.path&&n.caseSensitive===r.caseSensitive?(!n.children||n.children.length===0)&&(!r.children||r.children.length===0)?!0:n.children?.every((s,i)=>r.children?.some(o=>Rx(s,o)))??!1:!1}var mg=new WeakMap,Tx=({key:n,route:r,manifest:s,mapRouteProperties:i})=>{let o=s[r.id];if(qe(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let d=o.lazy[n];if(!d)return;let m=mg.get(o);m||(m={},mg.set(o,m));let p=m[n];if(p)return p;let g=(async()=>{let h=e1(n),b=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(b)Rt(!1,`Route "${o.id}" has a static property "${n}" defined. The lazy property will be ignored.`);else{let S=await d();S!=null&&(Object.assign(o,{[n]:S}),Object.assign(o,i(o)))}typeof o.lazy=="object"&&(o.lazy[n]=void 0,Object.values(o.lazy).every(S=>S===void 0)&&(o.lazy=void 0))})();return m[n]=g,g},hg=new WeakMap;function H1(n,r,s,i,o){let d=s[n.id];if(qe(d,"No route found in manifest"),!n.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof n.lazy=="function"){let v=hg.get(d);if(v)return{lazyRoutePromise:v,lazyHandlerPromise:v};let b=(async()=>{qe(typeof n.lazy=="function","No lazy route function found");let S=await n.lazy(),j={};for(let N in S){let T=S[N];if(T===void 0)continue;let O=a1(N),X=d[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."):X?Rt(!X,`Route "${d.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(d,j),Object.assign(d,{...i(d),lazy:void 0})})();return hg.set(d,b),b.catch(()=>{}),{lazyRoutePromise:b,lazyHandlerPromise:b}}let m=Object.keys(n.lazy),p=[],g;for(let v of m){if(o&&o.includes(v))continue;let b=Tx({key:v,route:n,manifest:s,mapRouteProperties:i});b&&(p.push(b),v===r&&(g=b))}let h=p.length>0?Promise.all(p).then(()=>{}):void 0;return h?.catch(()=>{}),g?.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:g}}async function pg(n){let r=n.matches.filter(o=>o.shouldLoad),s={};return(await Promise.all(r.map(o=>o.resolve()))).forEach((o,d)=>{s[r[d].route.id]=o}),s}async function B1(n){return n.matches.some(r=>r.route.middleware)?kx(n,()=>pg(n)):pg(n)}function kx(n,r){return $1(n,r,i=>{if(W1(i))throw i;return i},Z1,s);function s(i,o,d){if(d)return Promise.resolve(Object.assign(d.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=or(m,m[p].route.id).route.id;return Promise.resolve({[g]:{type:"error",result:i}})}}}async function $1(n,r,s,i,o){let{matches:d,request:m,params:p,context:g,unstable_pattern:h}=n,v=d.flatMap(S=>S.route.middleware?S.route.middleware.map(j=>[S.route.id,j]):[]);return await Ox({request:m,params:p,context:g,unstable_pattern:h},v,r,s,i,o)}async function Ox(n,r,s,i,o,d,m=0){let{request:p}=n;if(p.signal.aborted)throw p.signal.reason??new Error(`Request aborted: ${p.method} ${p.url}`);let g=r[m];if(!g)return await s();let[h,v]=g,b,S=async()=>{if(b)throw new Error("You may only call `next()` once per middleware");try{return b={value:await Ox(n,r,s,i,o,d,m+1)},b.value}catch(j){return b={value:await d(j,h,b)},b.value}};try{let j=await v(n,S),N=j!=null?i(j):void 0;return o(N)?N:b?N??b.value:(b={value:await S()},b.value)}catch(j){return await d(j,h,b)}}function zx(n,r,s,i,o){let d=Tx({key:"middleware",route:i.route,manifest:r,mapRouteProperties:n}),m=H1(i.route,ra(s.method)?"action":"loader",r,n,o);return{middleware:d,route:m.lazyRoutePromise,handler:m.lazyHandlerPromise}}function md(n,r,s,i,o,d,m,p,g=null,h){let v=!1,b=zx(n,r,s,o,d);return{...o,_lazyPromises:b,shouldLoad:p,shouldRevalidateArgs:g,shouldCallHandler(S){return v=!0,g?typeof h=="boolean"?Ms(o,{...g,defaultShouldRevalidate:h}):typeof S=="boolean"?Ms(o,{...g,defaultShouldRevalidate:S}):Ms(o,g):p},resolve(S){let{lazy:j,loader:N,middleware:T}=o.route,O=v||p||S&&!ra(s.method)&&(j||N),q=T&&T.length>0&&!N&&!j;return O&&(ra(s.method)||!q)?Y1({request:s,unstable_pattern:i,match:o,lazyHandlerPromise:b?.handler,lazyRoutePromise:b?.route,handlerOverride:S,scopedContext:m}):Promise.resolve({type:"data",result:void 0})}}}function kl(n,r,s,i,o,d,m,p=null){return i.map(g=>g.route.id!==o.route.id?{...g,shouldLoad:!1,shouldRevalidateArgs:p,shouldCallHandler:()=>!1,_lazyPromises:zx(n,r,s,g,d),resolve:()=>Promise.resolve({type:"data",result:void 0})}:md(n,r,s,Vs(i),g,d,m,!0,p))}async function q1(n,r,s,i,o,d){s.some(h=>h._lazyPromises?.middleware)&&await Promise.all(s.map(h=>h._lazyPromises?.middleware));let m={request:r,unstable_pattern:Vs(s),params:s[0].params,context:o,matches:s},g=await n({...m,fetcherKey:i,runClientMiddleware:h=>{let v=m;return kx(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 Y1({request:n,unstable_pattern:r,match:s,lazyHandlerPromise:i,lazyRoutePromise:o,handlerOverride:d,scopedContext:m}){let p,g,h=ra(n.method),v=h?"action":"loader",b=S=>{let j,N=new Promise((q,X)=>j=X);g=()=>j(),n.signal.addEventListener("abort",g);let T=q=>typeof S!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${v}" [routeId: ${s.route.id}]`)):S({request:n,unstable_pattern:r,params:s.params,context:m},...q!==void 0?[q]:[]),O=(async()=>{try{return{type:"data",result:await(d?d(X=>T(X)):T())}}catch(q){return{type:"error",result:q}}})();return Promise.race([O,N])};try{let S=h?s.route.action:s.route.loader;if(i||o)if(S){let j,[N]=await Promise.all([b(S).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([b(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(S)p=await b(S);else{let j=new URL(n.url),N=j.pathname+j.search;throw Ka(404,{pathname:N})}}catch(S){return{type:"error",result:S}}finally{g&&n.signal.removeEventListener("abort",g)}return p}async function G1(n){let r=n.headers.get("Content-Type");return r&&/\bapplication\/json\b/.test(r)?n.body==null?null:n.json():n.text()}async function V1(n){let{result:r,type:s}=n;if(Rd(r)){let i;try{i=await G1(r)}catch(o){return{type:"error",error:o}}return s==="error"?{type:"error",error:new Gs(r.status,r.statusText,i),statusCode:r.status,headers:r.headers}:{type:"data",data:i,statusCode:r.status,headers:r.headers}}return s==="error"?_g(r)?r.data instanceof Error?{type:"error",error:r.data,statusCode:r.init?.status,headers:r.init?.headers?new Headers(r.init.headers):void 0}:{type:"error",error:F1(r),statusCode:zl(r)?r.status:void 0,headers:r.init?.headers?new Headers(r.init.headers):void 0}:{type:"error",error:r,statusCode:zl(r)?r.status:void 0}:_g(r)?{type:"data",data:r.data,statusCode:r.init?.status,headers:r.init?.headers?new Headers(r.init.headers):void 0}:{type:"data",data:r}}function K1(n,r,s,i,o){let d=n.headers.get("Location");if(qe(d,"Redirects returned/thrown from loaders/actions must have a Location header"),!Ed(d)){let m=i.slice(0,i.findIndex(p=>p.route.id===s)+1);d=fd(new URL(r.url),m,o,d),n.headers.set("Location",d)}return n}function gg(n,r,s,i){let o=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Ed(n)){let d=n,m=d.startsWith("//")?new URL(r.protocol+d):new URL(d);if(o.includes(m.protocol))throw new Error("Invalid redirect location");let p=Qa(m.pathname,s)!=null;if(m.origin===r.origin&&p)return m.pathname+m.search+m.hash}try{let d=i.createURL(n);if(o.includes(d.protocol))throw new Error("Invalid redirect location")}catch{}return n}function Cl(n,r,s,i){let o=n.createURL(Dx(r)).toString(),d={signal:s};if(i&&ra(i.formMethod)){let{formMethod:m,formEncType:p}=i;d.method=m.toUpperCase(),p==="application/json"?(d.headers=new Headers({"Content-Type":p}),d.body=JSON.stringify(i.json)):p==="text/plain"?d.body=i.text:p==="application/x-www-form-urlencoded"&&i.formData?d.body=hd(i.formData):d.body=i.formData}return new Request(o,d)}function hd(n){let r=new URLSearchParams;for(let[s,i]of n.entries())r.append(s,typeof i=="string"?i:i.name);return r}function xg(n){let r=new FormData;for(let[s,i]of n.entries())r.append(s,i);return r}function X1(n,r,s,i=!1,o=!1){let d={},m=null,p,g=!1,h={},v=s&&za(s[1])?s[1].error:void 0;return n.forEach(b=>{if(!(b.route.id in r))return;let S=b.route.id,j=r[S];if(qe(!zr(j),"Cannot handle redirect results in processLoaderData"),za(j)){let N=j.error;if(v!==void 0&&(N=v,v=void 0),m=m||{},o)m[S]=N;else{let T=or(n,S);m[T.route.id]==null&&(m[T.route.id]=N)}i||(d[S]=Ex),g||(g=!0,p=zl(j.error)?j.error.status:500),j.headers&&(h[S]=j.headers)}else d[S]=j.data,j.statusCode&&j.statusCode!==200&&!g&&(p=j.statusCode),j.headers&&(h[S]=j.headers)}),v!==void 0&&s&&(m={[s[0]]:v},s[2]&&(d[s[2]]=void 0)),{loaderData:d,errors:m,statusCode:p||200,loaderHeaders:h}}function yg(n,r,s,i,o,d){let{loaderData:m,errors:p}=X1(r,s,i);return o.filter(g=>!g.matches||g.matches.some(h=>h.shouldLoad)).forEach(g=>{let{key:h,match:v,controller:b}=g;if(b&&b.signal.aborted)return;let S=d[h];if(qe(S,"Did not find corresponding fetcher result"),za(S)){let j=or(n.matches,v?.route.id);p&&p[j.route.id]||(p={...p,[j.route.id]:S.error}),n.fetchers.delete(h)}else if(zr(S))qe(!1,"Unhandled fetcher revalidation redirect");else{let j=Dn(S.data);n.fetchers.set(h,j)}}),{loaderData:m,errors:p}}function bg(n,r,s,i){let o=Object.entries(r).filter(([,d])=>d!==Ex).reduce((d,[m,p])=>(d[m]=p,d),{});for(let d of s){let m=d.route.id;if(!r.hasOwnProperty(m)&&n.hasOwnProperty(m)&&d.route.loader&&(o[m]=n[m]),i&&i.hasOwnProperty(m))break}return o}function vg(n){return n?za(n[1])?{actionData:{}}:{actionData:{[n[0]]:n[1].data}}:{}}function or(n,r){return(r?n.slice(0,n.findIndex(i=>i.route.id===r)+1):[...n]).reverse().find(i=>i.route.hasErrorBoundary===!0)||n[0]}function io(n){let r=n.length===1?n[0]:n.find(s=>s.index||!s.path||s.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:r}],route:r}}function Ka(n,{pathname:r,routeId:s,method:i,type:o,message:d}={}){let m="Unknown Server Error",p="Unknown @remix-run/router error";return n===400?(m="Bad Request",i&&r&&s?p=`You made a ${i} request to "${r}" 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 "${r}"`):n===404?(m="Not Found",p=`No route matches URL "${r}"`):n===405&&(m="Method Not Allowed",i&&r&&s?p=`You made a ${i.toUpperCase()} request to "${r}" 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 Gs(n||500,m,new Error(p),!0)}function oo(n){let r=Object.entries(n);for(let s=r.length-1;s>=0;s--){let[i,o]=r[s];if(zr(o))return{key:i,result:o}}}function Dx(n){let r=typeof n=="string"?Mn(n):n;return pn({...r,hash:""})}function Q1(n,r){return n.pathname!==r.pathname||n.search!==r.search?!1:n.hash===""?r.hash!=="":n.hash===r.hash?!0:r.hash!==""}function F1(n){return new Gs(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(([r,s])=>typeof r=="string"&&J1(s))}function J1(n){return n!=null&&typeof n=="object"&&"type"in n&&"result"in n&&(n.type==="data"||n.type==="error")}function P1(n){return Rd(n.result)&&Nx.has(n.result.status)}function za(n){return n.type==="error"}function zr(n){return(n&&n.type)==="redirect"}function _g(n){return typeof n=="object"&&n!=null&&"type"in n&&"data"in n&&"init"in n&&n.type==="DataWithResponseInit"}function Rd(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.headers=="object"&&typeof n.body<"u"}function I1(n){return Nx.has(n)}function W1(n){return Rd(n)&&I1(n.status)&&n.headers.has("Location")}function e4(n){return k1.has(n.toUpperCase())}function ra(n){return R1.has(n.toUpperCase())}function Td(n){return new URLSearchParams(n).getAll("index").some(r=>r==="")}function go(n,r){let s=typeof r=="string"?Mn(r).search:r.search;if(n[n.length-1].route.index&&Td(s||""))return n[n.length-1];let i=bx(n);return i[i.length-1]}function Sg(n){let{formMethod:r,formAction:s,formEncType:i,text:o,formData:d,json:m}=n;if(!(!r||!s||!i)){if(o!=null)return{formMethod:r,formAction:s,formEncType:i,formData:void 0,json:void 0,text:o};if(d!=null)return{formMethod:r,formAction:s,formEncType:i,formData:d,json:void 0,text:void 0};if(m!==void 0)return{formMethod:r,formAction:s,formEncType:i,formData:void 0,json:m,text:void 0}}}function Iu(n,r){return r?{state:"loading",location:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:"loading",location:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function t4(n,r){return{state:"submitting",location:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function Cs(n,r){return n?{state:"loading",formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text,data:r}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:r}}function a4(n,r){return{state:"submitting",formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text,data:r?r.data:void 0}}function Dn(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 n4(n,r){try{let s=n.sessionStorage.getItem(wx);if(s){let i=JSON.parse(s);for(let[o,d]of Object.entries(i||{}))d&&Array.isArray(d)&&r.set(o,new Set(d||[]))}}catch{}}function r4(n,r){if(r.size>0){let s={};for(let[i,o]of r)s[i]=[...o];try{n.sessionStorage.setItem(wx,JSON.stringify(s))}catch(i){Rt(!1,`Failed to save applied view transitions in sessionStorage (${i}).`)}}}function jg(){let n,r,s=new Promise((i,o)=>{n=async d=>{i(d);try{await s}catch{}},r=async d=>{o(d);try{await s}catch{}}});return{promise:s,resolve:n,reject:r}}var Ur=y.createContext(null);Ur.displayName="DataRouter";var Ks=y.createContext(null);Ks.displayName="DataRouterState";var Ax=y.createContext(!1);function l4(){return y.useContext(Ax)}var kd=y.createContext({isTransitioning:!1});kd.displayName="ViewTransition";var Mx=y.createContext(new Map);Mx.displayName="Fetchers";var s4=y.createContext(null);s4.displayName="Await";var Da=y.createContext(null);Da.displayName="Navigation";var Eo=y.createContext(null);Eo.displayName="Location";var Ja=y.createContext({outlet:null,matches:[],isDataRoute:!1});Ja.displayName="Route";var Od=y.createContext(null);Od.displayName="RouteError";var Lx="REACT_ROUTER_ERROR",i4="REDIRECT",o4="ROUTE_ERROR_RESPONSE";function c4(n){if(n.startsWith(`${Lx}:${i4}:{`))try{let r=JSON.parse(n.slice(28));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.location=="string"&&typeof r.reloadDocument=="boolean"&&typeof r.replace=="boolean")return r}catch{}}function u4(n){if(n.startsWith(`${Lx}:${o4}:{`))try{let r=JSON.parse(n.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new Gs(r.status,r.statusText,r.data)}catch{}}function d4(n,{relative:r}={}){qe(Dl(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:i}=y.useContext(Da),{hash:o,pathname:d,search:m}=Qs(n,{relative:r}),p=d;return s!=="/"&&(p=d==="/"?s:an([s,d])),i.createHref({pathname:p,search:m,hash:o})}function Dl(){return y.useContext(Eo)!=null}function rn(){return qe(Dl(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(Eo).location}var Ux="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Hx(n){y.useContext(Da).static||y.useLayoutEffect(n)}function _a(){let{isDataRoute:n}=y.useContext(Ja);return n?w4():f4()}function f4(){qe(Dl(),"useNavigate() may be used only in the context of a <Router> component.");let n=y.useContext(Ur),{basename:r,navigator:s}=y.useContext(Da),{matches:i}=y.useContext(Ja),{pathname:o}=rn(),d=JSON.stringify(wo(i)),m=y.useRef(!1);return Hx(()=>{m.current=!0}),y.useCallback((g,h={})=>{if(Rt(m.current,Ux),!m.current)return;if(typeof g=="number"){s.go(g);return}let v=Ys(g,JSON.parse(d),o,h.relative==="path");n==null&&r!=="/"&&(v.pathname=v.pathname==="/"?r:an([r,v.pathname])),(h.replace?s.replace:s.push)(v,h.state,h)},[r,s,d,o,n])}var m4=y.createContext(null);function h4(n){let r=y.useContext(Ja).outlet;return y.useMemo(()=>r&&y.createElement(m4.Provider,{value:n},r),[r,n])}function Xs(){let{matches:n}=y.useContext(Ja),r=n[n.length-1];return r?r.params:{}}function Qs(n,{relative:r}={}){let{matches:s}=y.useContext(Ja),{pathname:i}=rn(),o=JSON.stringify(wo(s));return y.useMemo(()=>Ys(n,JSON.parse(o),i,r==="path"),[n,o,i,r])}function p4(n,r,s){qe(Dl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=y.useContext(Da),{matches:o}=y.useContext(Ja),d=o[o.length-1],m=d?d.params:{},p=d?d.pathname:"/",g=d?d.pathnameBase:"/",h=d&&d.route;{let O=h&&h.path||"";qx(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.
12
+
13
+ Please change the parent <Route path="${O}"> to <Route path="${O==="/"?"*":`${O}/*`}">.`)}let v=rn(),b;b=v;let S=b.pathname||"/",j=S;if(g!=="/"){let O=g.replace(/^\//,"").split("/");j="/"+S.replace(/^\//,"").split("/").slice(O.length).join("/")}let N=ir(n,{pathname:j});return Rt(h||N!=null,`No routes matched location "${b.pathname}${b.search}${b.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 "${b.pathname}${b.search}${b.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.`),v4(N&&N.map(O=>Object.assign({},O,{params:Object.assign({},m,O.params),pathname:an([g,i.encodeLocation?i.encodeLocation(O.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:O.pathname]),pathnameBase:O.pathnameBase==="/"?g:an([g,i.encodeLocation?i.encodeLocation(O.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:O.pathnameBase])})),o,s)}function g4(){let n=$x(),r=zl(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},d={padding:"2px 4px",backgroundColor:i},m=null;return console.error("Error handled by React Router default ErrorBoundary:",n),m=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:d},"ErrorBoundary")," or"," ",y.createElement("code",{style:d},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},r),s?y.createElement("pre",{style:o},s):null,m)}var x4=y.createElement(g4,null),Bx=class extends y.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,r){return r.location!==n.location||r.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:r.error,location:r.location,revalidation:n.revalidation||r.revalidation}}componentDidCatch(n,r){this.props.onError?this.props.onError(n,r):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=u4(n.digest);s&&(n=s)}let r=n!==void 0?y.createElement(Ja.Provider,{value:this.props.routeContext},y.createElement(Od.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?y.createElement(y4,{error:n},r):r}};Bx.contextType=Ax;var Wu=new WeakMap;function y4({children:n,error:r}){let{basename:s}=y.useContext(Da);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let i=c4(r.digest);if(i){let o=Wu.get(r);if(o)throw o;let d=_x(i.location,s);if(vx&&!Wu.get(r))if(d.isExternal||i.reloadDocument)window.location.href=d.absoluteURL||d.to;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(d.to,{replace:i.replace}));throw Wu.set(r,m),m}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d.absoluteURL||d.to}`})}}return n}function b4({routeContext:n,match:r,children:s}){let i=y.useContext(Ur);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),y.createElement(Ja.Provider,{value:n},s)}function v4(n,r=[],s){let i=s?.state;if(n==null){if(!i)return null;if(i.errors)n=i.matches;else if(r.length===0&&!i.initialized&&i.matches.length>0)n=i.matches;else return null}let o=n,d=i?.errors;if(d!=null){let v=o.findIndex(b=>b.route.id&&d?.[b.route.id]!==void 0);qe(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).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 b=o[v];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(p=v),b.route.id){let{loaderData:S,errors:j}=i,N=b.route.loader&&!S.hasOwnProperty(b.route.id)&&(!j||j[b.route.id]===void 0);if(b.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,b)=>{g(v,{location:i.location,params:i.matches?.[0]?.params??{},unstable_pattern:Vs(i.matches),errorInfo:b})}:void 0;return o.reduceRight((v,b,S)=>{let j,N=!1,T=null,O=null;i&&(j=d&&b.route.id?d[b.route.id]:void 0,T=b.route.errorElement||x4,m&&(p<0&&S===0?(qx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),N=!0,O=null):p===S&&(N=!0,O=b.route.hydrateFallbackElement||null)));let q=r.concat(o.slice(0,S+1)),X=()=>{let G;return j?G=T:N?G=O:b.route.Component?G=y.createElement(b.route.Component,null):b.route.element?G=b.route.element:G=v,y.createElement(b4,{match:b,routeContext:{outlet:v,matches:q,isDataRoute:i!=null},children:G})};return i&&(b.route.ErrorBoundary||b.route.errorElement||S===0)?y.createElement(Bx,{location:i.location,revalidation:i.revalidation,component:T,error:j,children:X(),routeContext:{outlet:null,matches:q,isDataRoute:!0},onError:h}):X()},null)}function zd(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _4(n){let r=y.useContext(Ur);return qe(r,zd(n)),r}function S4(n){let r=y.useContext(Ks);return qe(r,zd(n)),r}function j4(n){let r=y.useContext(Ja);return qe(r,zd(n)),r}function Dd(n){let r=j4(n),s=r.matches[r.matches.length-1];return qe(s.route.id,`${n} can only be used on routes that contain a unique "id"`),s.route.id}function N4(){return Dd("useRouteId")}function $x(){let n=y.useContext(Od),r=S4("useRouteError"),s=Dd("useRouteError");return n!==void 0?n:r.errors?.[s]}function w4(){let{router:n}=_4("useNavigate"),r=Dd("useNavigate"),s=y.useRef(!1);return Hx(()=>{s.current=!0}),y.useCallback(async(o,d={})=>{Rt(s.current,Ux),s.current&&(typeof o=="number"?await n.navigate(o):await n.navigate(o,{fromRouteId:r,...d}))},[n,r])}var Ng={};function qx(n,r,s){!r&&!Ng[n]&&(Ng[n]=!0,Rt(!1,s))}var wg={};function Eg(n,r){!n&&!wg[r]&&(wg[r]=!0,console.warn(r))}var E4="useOptimistic",Cg=n0[E4],C4=()=>{};function R4(n){return Cg?Cg(n):[n,C4]}function T4(n){let r={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(r,{element:y.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(r,{hydrateFallbackElement:y.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(r,{errorElement:y.createElement(n.ErrorBoundary),ErrorBoundary:void 0})),r}var k4=["HydrateFallback","hydrateFallbackElement"],O4=class{constructor(){this.status="pending",this.promise=new Promise((n,r)=>{this.resolve=s=>{this.status==="pending"&&(this.status="resolved",n(s))},this.reject=s=>{this.status==="pending"&&(this.status="rejected",r(s))}})}};function z4({router:n,flushSync:r,onError:s,unstable_useTransitions:i}){i=l4()||i;let[d,m]=y.useState(n.state),[p,g]=R4(d),[h,v]=y.useState(),[b,S]=y.useState({isTransitioning:!1}),[j,N]=y.useState(),[T,O]=y.useState(),[q,X]=y.useState(),G=y.useRef(new Map),M=y.useCallback((E,{deletedFetchers:Y,newErrors:W,flushSync:de,viewTransitionOpts:oe})=>{W&&s&&Object.values(W).forEach(ue=>s(ue,{location:E.location,params:E.matches[0]?.params??{},unstable_pattern:Vs(E.matches)})),E.fetchers.forEach((ue,ge)=>{ue.data!==void 0&&G.current.set(ge,ue.data)}),Y.forEach(ue=>G.current.delete(ue)),Eg(de===!1||r!=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 le=n.window!=null&&n.window.document!=null&&typeof n.window.document.startViewTransition=="function";if(Eg(oe==null||le,"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||!le){r&&de?r(()=>m(E)):i===!1?m(E):y.startTransition(()=>{i===!0&&g(ue=>Rg(ue,E)),m(E)});return}if(r&&de){r(()=>{T&&(j?.resolve(),T.skipTransition()),S({isTransitioning:!0,flushSync:!0,currentLocation:oe.currentLocation,nextLocation:oe.nextLocation})});let ue=n.window.document.startViewTransition(()=>{r(()=>m(E))});ue.finished.finally(()=>{r(()=>{N(void 0),O(void 0),v(void 0),S({isTransitioning:!1})})}),r(()=>O(ue));return}T?(j?.resolve(),T.skipTransition(),X({state:E,currentLocation:oe.currentLocation,nextLocation:oe.nextLocation})):(v(E),S({isTransitioning:!0,flushSync:!1,currentLocation:oe.currentLocation,nextLocation:oe.nextLocation}))},[n.window,r,T,j,i,g,s]);y.useLayoutEffect(()=>n.subscribe(M),[n,M]),y.useEffect(()=>{b.isTransitioning&&!b.flushSync&&N(new O4)},[b]),y.useEffect(()=>{if(j&&h&&n.window){let E=h,Y=j.promise,W=n.window.document.startViewTransition(async()=>{i===!1?m(E):y.startTransition(()=>{i===!0&&g(de=>Rg(de,E)),m(E)}),await Y});W.finished.finally(()=>{N(void 0),O(void 0),v(void 0),S({isTransitioning:!1})}),O(W)}},[h,j,n.window,i,g]),y.useEffect(()=>{j&&h&&p.location.key===h.location.key&&j.resolve()},[j,T,p.location,h]),y.useEffect(()=>{!b.isTransitioning&&q&&(v(q.state),S({isTransitioning:!0,flushSync:!1,currentLocation:q.currentLocation,nextLocation:q.nextLocation}),X(void 0))},[b.isTransitioning,q]);let Q=y.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:E=>n.navigate(E),push:(E,Y,W)=>n.navigate(E,{state:Y,preventScrollReset:W?.preventScrollReset}),replace:(E,Y,W)=>n.navigate(E,{replace:!0,state:Y,preventScrollReset:W?.preventScrollReset})}),[n]),te=n.basename||"/",Z=y.useMemo(()=>({router:n,navigator:Q,static:!1,basename:te,onError:s}),[n,Q,te,s]);return y.createElement(y.Fragment,null,y.createElement(Ur.Provider,{value:Z},y.createElement(Ks.Provider,{value:p},y.createElement(Mx.Provider,{value:G.current},y.createElement(kd.Provider,{value:b},y.createElement(L4,{basename:te,location:p.location,navigationType:p.historyAction,navigator:Q,unstable_useTransitions:i},y.createElement(D4,{routes:n.routes,future:n.future,state:p,isStatic:!1,onError:s})))))),null)}function Rg(n,r){return{...n,navigation:r.navigation.state!=="idle"?r.navigation:n.navigation,revalidation:r.revalidation!=="idle"?r.revalidation:n.revalidation,actionData:r.navigation.state!=="submitting"?r.actionData:n.actionData,fetchers:r.fetchers}}var D4=y.memo(A4);function A4({routes:n,future:r,state:s,isStatic:i,onError:o}){return p4(n,void 0,{state:s,isStatic:i,onError:o})}function M4({to:n,replace:r,state:s,relative:i}){qe(Dl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=y.useContext(Da);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:d}=y.useContext(Ja),{pathname:m}=rn(),p=_a(),g=Ys(n,wo(d),m,i==="path"),h=JSON.stringify(g);return y.useEffect(()=>{p(JSON.parse(h),{replace:r,state:s,relative:i})},[p,h,i,r,s]),null}function Yx(n){return h4(n.context)}function L4({basename:n="/",children:r=null,location:s,navigationType:i="POP",navigator:o,static:d=!1,unstable_useTransitions:m}){qe(!Dl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=n.replace(/^\/*/,"/"),g=y.useMemo(()=>({basename:p,navigator:o,static:d,unstable_useTransitions:m,future:{}}),[p,o,d,m]);typeof s=="string"&&(s=Mn(s));let{pathname:h="/",search:v="",hash:b="",state:S=null,key:j="default",unstable_mask:N}=s,T=y.useMemo(()=>{let O=Qa(h,p);return O==null?null:{location:{pathname:O,search:v,hash:b,state:S,key:j,unstable_mask:N},navigationType:i}},[p,h,v,b,S,j,i,N]);return Rt(T!=null,`<Router basename="${p}"> is not able to match the URL "${h}${v}${b}" because it does not start with the basename, so the <Router> won't render anything.`),T==null?null:y.createElement(Da.Provider,{value:g},y.createElement(Eo.Provider,{children:r,value:T}))}var xo="get",yo="application/x-www-form-urlencoded";function Co(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function U4(n){return Co(n)&&n.tagName.toLowerCase()==="button"}function H4(n){return Co(n)&&n.tagName.toLowerCase()==="form"}function B4(n){return Co(n)&&n.tagName.toLowerCase()==="input"}function $4(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function q4(n,r){return n.button===0&&(!r||r==="_self")&&!$4(n)}function pd(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((r,s)=>{let i=n[s];return r.concat(Array.isArray(i)?i.map(o=>[s,o]):[[s,i]])},[]))}function Y4(n,r){let s=pd(n);return r&&r.forEach((i,o)=>{s.has(o)||r.getAll(o).forEach(d=>{s.append(o,d)})}),s}var co=null;function G4(){if(co===null)try{new FormData(document.createElement("form"),0),co=!1}catch{co=!0}return co}var V4=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ed(n){return n!=null&&!V4.has(n)?(Rt(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${yo}"`),null):n}function K4(n,r){let s,i,o,d,m;if(H4(n)){let p=n.getAttribute("action");i=p?Qa(p,r):null,s=n.getAttribute("method")||xo,o=ed(n.getAttribute("enctype"))||yo,d=new FormData(n)}else if(U4(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,r):null,s=n.getAttribute("formmethod")||p.getAttribute("method")||xo,o=ed(n.getAttribute("formenctype"))||ed(p.getAttribute("enctype"))||yo,d=new FormData(p,n),!G4()){let{name:h,type:v,value:b}=n;if(v==="image"){let S=h?`${h}.`:"";d.append(`${S}x`,"0"),d.append(`${S}y`,"0")}else h&&d.append(h,b)}}else{if(Co(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=xo,i=null,o=yo,m=n}return d&&o==="text/plain"&&(m=d,d=void 0),{action:i,method:s.toLowerCase(),encType:o,formData:d,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ad(n,r){if(n===!1||n===null||typeof n>"u")throw new Error(r)}function X4(n,r,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}`:r&&Qa(o.pathname,r)==="/"?o.pathname=`${r.replace(/\/$/,"")}/_root.${i}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${i}`,o}async function Q4(n,r){if(n.id in r)return r[n.id];try{let s=await import(n.module);return r[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 F4(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 Z4(n,r,s){let i=await Promise.all(n.map(async o=>{let d=r.routes[o.route.id];if(d){let m=await Q4(d,s);return m.links?m.links():[]}return[]}));return W4(i.flat(1).filter(F4).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function Tg(n,r,s,i,o,d){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 d==="assets"?r.filter((g,h)=>m(g,h)||p(g,h)):d==="data"?r.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 b=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 b=="boolean")return b}return!0}):[]}function J4(n,r,{includeHydrateFallback:s}={}){return P4(n.map(i=>{let o=r.routes[i.route.id];if(!o)return[];let d=[o.module];return o.clientActionModule&&(d=d.concat(o.clientActionModule)),o.clientLoaderModule&&(d=d.concat(o.clientLoaderModule)),s&&o.hydrateFallbackModule&&(d=d.concat(o.hydrateFallbackModule)),o.imports&&(d=d.concat(o.imports)),d}).flat(1))}function P4(n){return[...new Set(n)]}function I4(n){let r={},s=Object.keys(n).sort();for(let i of s)r[i]=n[i];return r}function W4(n,r){let s=new Set;return new Set(r),n.reduce((i,o)=>{let d=JSON.stringify(I4(o));return s.has(d)||(s.add(d),i.push({key:d,link:o})),i},[])}function Gx(){let n=y.useContext(Ur);return Ad(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function e_(){let n=y.useContext(Ks);return Ad(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Md=y.createContext(void 0);Md.displayName="FrameworkContext";function Vx(){let n=y.useContext(Md);return Ad(n,"You must render this element inside a <HydratedRouter> element"),n}function t_(n,r){let s=y.useContext(Md),[i,o]=y.useState(!1),[d,m]=y.useState(!1),{onFocus:p,onBlur:g,onMouseEnter:h,onMouseLeave:v,onTouchStart:b}=r,S=y.useRef(null);y.useEffect(()=>{if(n==="render"&&m(!0),n==="viewport"){let T=q=>{q.forEach(X=>{m(X.isIntersecting)})},O=new IntersectionObserver(T,{threshold:.5});return S.current&&O.observe(S.current),()=>{O.disconnect()}}},[n]),y.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"?[d,S,{}]:[d,S,{onFocus:Rs(p,j),onBlur:Rs(g,N),onMouseEnter:Rs(h,j),onMouseLeave:Rs(v,N),onTouchStart:Rs(b,j)}]:[!1,S,{}]}function Rs(n,r){return s=>{n&&n(s),s.defaultPrevented||r(s)}}function a_({page:n,...r}){let{router:s}=Gx(),i=y.useMemo(()=>ir(s.routes,n,s.basename),[s.routes,n,s.basename]);return i?y.createElement(r_,{page:n,matches:i,...r}):null}function n_(n){let{manifest:r,routeModules:s}=Vx(),[i,o]=y.useState([]);return y.useEffect(()=>{let d=!1;return Z4(n,r,s).then(m=>{d||o(m)}),()=>{d=!0}},[n,r,s]),i}function r_({page:n,matches:r,...s}){let i=rn(),{future:o,manifest:d,routeModules:m}=Vx(),{basename:p}=Gx(),{loaderData:g,matches:h}=e_(),v=y.useMemo(()=>Tg(n,r,h,d,i,"data"),[n,r,h,d,i]),b=y.useMemo(()=>Tg(n,r,h,d,i,"assets"),[n,r,h,d,i]),S=y.useMemo(()=>{if(n===i.pathname+i.search+i.hash)return[];let T=new Set,O=!1;if(r.forEach(X=>{let G=d.routes[X.route.id];!G||!G.hasLoader||(!v.some(M=>M.route.id===X.route.id)&&X.route.id in g&&m[X.route.id]?.shouldRevalidate||G.hasClientLoader?O=!0:T.add(X.route.id))}),T.size===0)return[];let q=X4(n,p,o.unstable_trailingSlashAwareDataRequests,"data");return O&&T.size>0&&q.searchParams.set("_routes",r.filter(X=>T.has(X.route.id)).map(X=>X.route.id).join(",")),[q.pathname+q.search]},[p,o.unstable_trailingSlashAwareDataRequests,g,i,d,v,r,n,m]),j=y.useMemo(()=>J4(b,d),[b,d]),N=n_(b);return y.createElement(y.Fragment,null,S.map(T=>y.createElement("link",{key:T,rel:"prefetch",as:"fetch",href:T,...s})),j.map(T=>y.createElement("link",{key:T,rel:"modulepreload",href:T,...s})),N.map(({key:T,link:O})=>y.createElement("link",{key:T,nonce:s.nonce,...O,crossOrigin:O.crossOrigin??s.crossOrigin})))}function l_(...n){return r=>{n.forEach(s=>{typeof s=="function"?s(r):s!=null&&(s.current=r)})}}var s_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{s_&&(window.__reactRouterVersion="7.13.1")}catch{}function i_(n,r){return A1({basename:r?.basename,getContext:r?.getContext,future:r?.future,history:J0({window:r?.window}),hydrationData:o_(),routes:n,mapRouteProperties:T4,hydrationRouteProperties:k4,dataStrategy:r?.dataStrategy,patchRoutesOnNavigation:r?.patchRoutesOnNavigation,window:r?.window,unstable_instrumentations:r?.unstable_instrumentations}).initialize()}function o_(){let n=window?.__staticRouterHydrationData;return n&&n.errors&&(n={...n,errors:c_(n.errors)}),n}function c_(n){if(!n)return null;let r=Object.entries(n),s={};for(let[i,o]of r)if(o&&o.__type==="RouteErrorResponse")s[i]=new Gs(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let d=window[o.__subType];if(typeof d=="function")try{let m=new d(o.message);m.stack="",s[i]=m}catch{}}if(s[i]==null){let d=new Error(o.message);d.stack="",s[i]=d}}else s[i]=o;return s}var Kx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Fa=y.forwardRef(function({onClick:r,discover:s="render",prefetch:i="none",relative:o,reloadDocument:d,replace:m,unstable_mask:p,state:g,target:h,to:v,preventScrollReset:b,viewTransition:S,unstable_defaultShouldRevalidate:j,...N},T){let{basename:O,navigator:q,unstable_useTransitions:X}=y.useContext(Da),G=typeof v=="string"&&Kx.test(v),M=_x(v,O);v=M.to;let Q=d4(v,{relative:o}),te=rn(),Z=null;if(p){let ge=Ys(p,[],te.unstable_mask?te.unstable_mask.pathname:"/",!0);O!=="/"&&(ge.pathname=ge.pathname==="/"?O:an([O,ge.pathname])),Z=q.createHref(ge)}let[E,Y,W]=t_(i,N),de=f_(v,{replace:m,unstable_mask:p,state:g,target:h,preventScrollReset:b,relative:o,viewTransition:S,unstable_defaultShouldRevalidate:j,unstable_useTransitions:X});function oe(ge){r&&r(ge),ge.defaultPrevented||de(ge)}let le=!(M.isExternal||d),ue=y.createElement("a",{...N,...W,href:(le?Z:void 0)||M.absoluteURL||Q,onClick:le?oe:r,ref:l_(T,Y),target:h,"data-discover":!G&&s==="render"?"true":void 0});return E&&!G?y.createElement(y.Fragment,null,ue,y.createElement(a_,{page:Q})):ue});Fa.displayName="Link";var $s=y.forwardRef(function({"aria-current":r="page",caseSensitive:s=!1,className:i="",end:o=!1,style:d,to:m,viewTransition:p,children:g,...h},v){let b=Qs(m,{relative:h.relative}),S=rn(),j=y.useContext(Ks),{navigator:N,basename:T}=y.useContext(Da),O=j!=null&&x_(b)&&p===!0,q=N.encodeLocation?N.encodeLocation(b).pathname:b.pathname,X=S.pathname,G=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;s||(X=X.toLowerCase(),G=G?G.toLowerCase():null,q=q.toLowerCase()),G&&T&&(G=Qa(G,T)||G);const M=q!=="/"&&q.endsWith("/")?q.length-1:q.length;let Q=X===q||!o&&X.startsWith(q)&&X.charAt(M)==="/",te=G!=null&&(G===q||!o&&G.startsWith(q)&&G.charAt(q.length)==="/"),Z={isActive:Q,isPending:te,isTransitioning:O},E=Q?r:void 0,Y;typeof i=="function"?Y=i(Z):Y=[i,Q?"active":null,te?"pending":null,O?"transitioning":null].filter(Boolean).join(" ");let W=typeof d=="function"?d(Z):d;return y.createElement(Fa,{...h,"aria-current":E,className:Y,ref:v,style:W,to:m,viewTransition:p},typeof g=="function"?g(Z):g)});$s.displayName="NavLink";var u_=y.forwardRef(({discover:n="render",fetcherKey:r,navigate:s,reloadDocument:i,replace:o,state:d,method:m=xo,action:p,onSubmit:g,relative:h,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:S,...j},N)=>{let{unstable_useTransitions:T}=y.useContext(Da),O=p_(),q=g_(p,{relative:h}),X=m.toLowerCase()==="get"?"get":"post",G=typeof p=="string"&&Kx.test(p),M=Q=>{if(g&&g(Q),Q.defaultPrevented)return;Q.preventDefault();let te=Q.nativeEvent.submitter,Z=te?.getAttribute("formmethod")||m,E=()=>O(te||Q.currentTarget,{fetcherKey:r,method:Z,navigate:s,replace:o,state:d,relative:h,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:S});T&&s!==!1?y.startTransition(()=>E()):E()};return y.createElement("form",{ref:N,method:X,action:q,onSubmit:i?g:M,...j,"data-discover":!G&&n==="render"?"true":void 0})});u_.displayName="Form";function d_(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Xx(n){let r=y.useContext(Ur);return qe(r,d_(n)),r}function f_(n,{target:r,replace:s,unstable_mask:i,state:o,preventScrollReset:d,relative:m,viewTransition:p,unstable_defaultShouldRevalidate:g,unstable_useTransitions:h}={}){let v=_a(),b=rn(),S=Qs(n,{relative:m});return y.useCallback(j=>{if(q4(j,r)){j.preventDefault();let N=s!==void 0?s:pn(b)===pn(S),T=()=>v(n,{replace:N,unstable_mask:i,state:o,preventScrollReset:d,relative:m,viewTransition:p,unstable_defaultShouldRevalidate:g});h?y.startTransition(()=>T()):T()}},[b,v,S,s,i,o,r,n,d,m,p,g,h])}function Ro(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 r=y.useRef(pd(n)),s=y.useRef(!1),i=rn(),o=y.useMemo(()=>Y4(i.search,s.current?null:r.current),[i.search]),d=_a(),m=y.useCallback((p,g)=>{const h=pd(typeof p=="function"?p(new URLSearchParams(o)):p);s.current=!0,d("?"+h,g)},[d,o]);return[o,m]}var m_=0,h_=()=>`__${String(++m_)}__`;function p_(){let{router:n}=Xx("useSubmit"),{basename:r}=y.useContext(Da),s=N4(),i=n.fetch,o=n.navigate;return y.useCallback(async(d,m={})=>{let{action:p,method:g,encType:h,formData:v,body:b}=K4(d,r);if(m.navigate===!1){let S=m.fetcherKey||h_();await i(S,s,m.action||p,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:v,body:b,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:b,formMethod:m.method||g,formEncType:m.encType||h,replace:m.replace,state:m.state,fromRouteId:s,flushSync:m.flushSync,viewTransition:m.viewTransition})},[i,o,r,s])}function g_(n,{relative:r}={}){let{basename:s}=y.useContext(Da),i=y.useContext(Ja);qe(i,"useFormAction must be used inside a RouteContext");let[o]=i.matches.slice(-1),d={...Qs(n||".",{relative:r})},m=rn();if(n==null){d.search=m.search;let p=new URLSearchParams(d.search),g=p.getAll("index");if(g.some(v=>v==="")){p.delete("index"),g.filter(b=>b).forEach(b=>p.append("index",b));let v=p.toString();d.search=v?`?${v}`:""}}return(!n||n===".")&&o.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(d.pathname=d.pathname==="/"?s:an([s,d.pathname])),pn(d)}function x_(n,{relative:r}={}){let s=y.useContext(kd);qe(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Xx("useViewTransitionState"),o=Qs(n,{relative:r});if(!s.isTransitioning)return!1;let d=Qa(s.currentLocation.pathname,i)||s.currentLocation.pathname,m=Qa(s.nextLocation.pathname,i)||s.nextLocation.pathname;return So(o.pathname,m)!=null||So(o.pathname,d)!=null}const y_="modulepreload",b_=function(n){return"/"+n},kg={},Ld=function(r,s,i){let o=Promise.resolve();if(s&&s.length>0){let g=function(h){return Promise.all(h.map(v=>Promise.resolve(v).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const m=document.querySelector("meta[property=csp-nonce]"),p=m?.nonce||m?.getAttribute("nonce");o=g(s.map(h=>{if(h=b_(h),h in kg)return;kg[h]=!0;const v=h.endsWith(".css"),b=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${b}`))return;const S=document.createElement("link");if(S.rel=v?"stylesheet":y_,v||(S.as="script"),S.crossOrigin="",S.href=h,p&&S.setAttribute("nonce",p),document.head.appendChild(S),v)return new Promise((j,N)=>{S.addEventListener("load",j),S.addEventListener("error",()=>N(new Error(`Unable to preload CSS for ${h}`)))})}))}function d(m){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=m,window.dispatchEvent(p),!p.defaultPrevented)throw m}return o.then(m=>{for(const p of m||[])p.status==="rejected"&&d(p.reason);return r().catch(d)})};const Qx=(...n)=>n.filter((r,s,i)=>!!r&&r.trim()!==""&&i.indexOf(r)===s).join(" ").trim();const v_=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const __=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,s,i)=>i?i.toUpperCase():s.toLowerCase());const Og=n=>{const r=__(n);return r.charAt(0).toUpperCase()+r.slice(1)};var S_={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 j_=n=>{for(const r in n)if(r.startsWith("aria-")||r==="role"||r==="title")return!0;return!1};const N_=y.forwardRef(({color:n="currentColor",size:r=24,strokeWidth:s=2,absoluteStrokeWidth:i,className:o="",children:d,iconNode:m,...p},g)=>y.createElement("svg",{ref:g,...S_,width:r,height:r,stroke:n,strokeWidth:i?Number(s)*24/Number(r):s,className:Qx("lucide",o),...!d&&!j_(p)&&{"aria-hidden":"true"},...p},[...m.map(([h,v])=>y.createElement(h,v)),...Array.isArray(d)?d:[d]]));const ze=(n,r)=>{const s=y.forwardRef(({className:i,...o},d)=>y.createElement(N_,{ref:d,iconNode:r,className:Qx(`lucide-${v_(Og(n))}`,`lucide-${n}`,i),...o}));return s.displayName=Og(n),s};const w_=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Fx=ze("arrow-right",w_);const E_=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],zg=ze("arrow-up-right",E_);const C_=[["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"}]],R_=ze("boxes",C_);const T_=[["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"}]],k_=ze("brain",T_);const O_=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Lr=ze("check",O_);const z_=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],da=ze("chevron-right",z_);const D_=[["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"}]],Zx=ze("circle-alert",D_);const A_=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],M_=ze("circle",A_);const L_=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],U_=ze("cloud",L_);const H_=[["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"}]],gd=ze("copy",H_);const B_=[["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"}]],Jx=ze("database",B_);const $_=[["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"}]],q_=ze("file-spreadsheet",$_);const Y_=[["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"}]],dr=ze("file-text",Y_);const G_=[["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"}]],Px=ze("file",G_);const V_=[["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"}]],K_=ze("files",V_);const X_=[["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"}]],To=ze("folder-git-2",X_);const Q_=[["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"}]],F_=ze("folder-input",Q_);const Z_=[["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"}]],J_=ze("folder-open",Z_);const P_=[["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"}]],Ix=ze("folder-plus",P_);const I_=[["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=ze("folder",I_);const W_=[["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"}]],xd=ze("git-branch",W_);const eS=[["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"}]],tS=ze("git-commit-horizontal",eS);const aS=[["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"}]],Dg=ze("github",aS);const nS=[["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"}]],rS=ze("globe",nS);const lS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],sS=ze("info",lS);const iS=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],oS=ze("key",iS);const cS=[["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"}]],uS=ze("laptop",cS);const dS=[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]],fS=ze("list-filter",dS);const mS=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],va=ze("loader-circle",mS);const hS=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],pS=ze("menu",hS);const gS=[["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"}]],xS=ze("monitor",gS);const yS=[["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"}]],bS=ze("moon",yS);const vS=[["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"}]],Ol=ze("package",vS);const _S=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],SS=ze("panel-left",_S);const jS=[["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"}]],yd=ze("pencil",jS);const NS=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Wx=ze("plus",NS);const wS=[["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"}]],ES=ze("refresh-cw",wS);const CS=[["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"}]],RS=ze("rotate-cw",CS);const TS=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],bd=ze("search",TS);const kS=[["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"}]],ey=ze("settings",kS);const OS=[["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"}]],zS=ze("share-2",OS);const DS=[["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"}]],AS=ze("sparkles",DS);const MS=[["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"}]],LS=ze("sun",MS);const US=[["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"}]],Ud=ze("trash-2",US);const HS=[["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"}]],vd=ze("upload",HS);const BS=[["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"}]],$S=ze("users",BS);const qS=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Hr=ze("x",qS),Ag=n=>{let r;const s=new Set,i=(h,v)=>{const b=typeof h=="function"?h(r):h;if(!Object.is(b,r)){const S=r;r=v??(typeof b!="object"||b===null)?b:Object.assign({},r,b),s.forEach(j=>j(r,S))}},o=()=>r,p={setState:i,getState:o,getInitialState:()=>g,subscribe:h=>(s.add(h),()=>s.delete(h))},g=r=n(i,o,p);return p},YS=(n=>n?Ag(n):Ag),GS=n=>n;function VS(n,r=GS){const s=Rl.useSyncExternalStore(n.subscribe,Rl.useCallback(()=>r(n.getState()),[n,r]),Rl.useCallback(()=>r(n.getInitialState()),[n,r]));return Rl.useDebugValue(s),s}const Mg=n=>{const r=YS(n),s=i=>VS(r,i);return Object.assign(s,r),s},Fs=(n=>n?Mg(n):Mg),Ts="c4a_token";function Lg(n){try{const r=n.split(".");if(r.length!==3)return null;const s=r[1].replace(/-/g,"+").replace(/_/g,"/");return JSON.parse(atob(s))}catch{return null}}function Ug(n){const r=n.userId,s=n.name,i=n.email,o=n.avatar_url,d=n.workspaceId;if(!r||!i||!d)return null;const m={id:r,name:s??i,email:i,personal_workspace_id:d};return o&&(m.avatar_url=o),m}function Hg(n){const r=n.exp;return r?Date.now()>=r*1e3:!1}const Za=Fs(n=>({token:null,user:null,isAuthenticated:!1,init:()=>{const r=localStorage.getItem(Ts);if(!r){n({token:null,user:null,isAuthenticated:!1});return}const s=Lg(r);if(!s||Hg(s)){localStorage.removeItem(Ts),n({token:null,user:null,isAuthenticated:!1});return}const i=Ug(s);if(!i){localStorage.removeItem(Ts),n({token:null,user:null,isAuthenticated:!1});return}n({token:r,user:i,isAuthenticated:!0})},login:r=>{const s=Lg(r);if(!s||Hg(s))return;const i=Ug(s);i&&(localStorage.setItem(Ts,r),n({token:r,user:i,isAuthenticated:!0}))},logout:()=>{localStorage.removeItem(Ts),n({token:null,user:null,isAuthenticated:!1})}})),ty="/api/v1";class Dr extends Error{constructor(r,s,i){super(i),this.status=r,this.code=s,this.name="ApiError"}}async function uo(n,r,s,i,o){let d=`${ty}${r}`;if(i){const v=new URLSearchParams(i).toString();v&&(d+=`?${v}`)}const m={"Content-Type":"application/json"},p=Za.getState().token;p&&(m.Authorization=`Bearer ${p}`);const g={method:n,headers:m};s!==void 0&&(g.body=JSON.stringify(s)),o?.signal&&(g.signal=o.signal);const h=await fetch(d,g);if(!h.ok){let v="UNKNOWN",b=h.statusText;try{const S=await h.json();S.code&&(v=S.code),S.message&&(b=S.message)}catch{}throw h.status===401&&Za.getState().logout(),new Dr(h.status,v,b)}return h.json()}const td=new Map;function KS(n,r){let s=`${ty}${n}`;if(r){const i=new URLSearchParams(r).toString();i&&(s+=`?${i}`)}return s}const st={get(n,r,s){const i=KS(n,r),o=td.get(i);if(o)return o;const d=uo("GET",n,void 0,r,s).finally(()=>{td.delete(i)});return td.set(i,d),d},post(n,r,s){return uo("POST",n,r,void 0,s)},put(n,r){return uo("PUT",n,r)},delete(n){return uo("DELETE",n)}},XS=3e4,QS=1e3,FS=3e4;class ZS{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(r){this._status=r;for(const s of this.statusHandlers)s(r)}onStatusChange(r){return this.statusHandlers.add(r),()=>{this.statusHandlers.delete(r)}}connect(r){this.url=r,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(r,s){let i=this.handlers.get(r);return i||(i=new Set,this.handlers.set(r,i)),i.add(s),()=>{i.delete(s),i.size===0&&this.handlers.delete(r)}}send(r,s){if(this.ws?.readyState!==WebSocket.OPEN)return;const i={event:r,payload:s,timestamp:Date.now()};this.ws.send(JSON.stringify(i))}open(){this.setStatus("connecting");const r=new WebSocket(this.url);r.onopen=()=>{this.reconnectAttempt=0,this.setStatus("connected"),this.startHeartbeat()},r.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 d of o)d(i.payload)}catch{}},r.onclose=()=>{this.stopHeartbeat(),this.intentionalClose||(this.setStatus("reconnecting"),this.scheduleReconnect())},r.onerror=()=>{},this.ws=r}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({event:"ping",payload:null,timestamp:Date.now()}))},XS)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}scheduleReconnect(){if(this.reconnectTimer)return;const r=Math.min(QS*2**this.reconnectAttempt,FS);this.reconnectAttempt++,this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.open()},r)}clearTimers(){this.stopHeartbeat(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}const nn=new ZS,$t=Fs((n,r)=>({libraries:[],loading:!1,error:null,fetchLibraries:async()=>{n({loading:!0,error:null});try{const s=await st.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 st.post("/libraries",s);return n(o=>({libraries:[...o.libraries,i]})),i},deleteLibrary:async s=>{await st.delete(`/libraries/${s}`),n(i=>({libraries:i.libraries.filter(o=>o.id!==s)}))},updateLibraryName:async(s,i)=>{const o=await st.put(`/libraries/${s}`,{name:i});n(d=>({libraries:d.libraries.map(m=>m.id===s?o:m)}))},_updateLibraryOnline:(s,i)=>{n(o=>({libraries:o.libraries.map(d=>d.id===s?{...d,is_online:i}:d)}))},_refreshLibrary:async s=>{try{const i=await st.get(`/libraries/${s}`);n(o=>({libraries:o.libraries.map(d=>d.id===s?i:d)}))}catch{r().fetchLibraries()}}})),Al=n=>{const r=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[...r,...s]},JS=n=>n.libraries.filter(r=>r.type==="daemon");nn.on("ws:daemon:status",n=>{const r=n;r.lib_id&&$t.getState()._updateLibraryOnline(r.lib_id,r.is_online),$t.getState().fetchLibraries()});nn.on("ws:daemon:connected",n=>{const r=n;r.lib_id&&$t.getState()._updateLibraryOnline(r.lib_id,!0),$t.getState().fetchLibraries()});nn.on("ws:library:updated",n=>{const r=n;$t.getState()._refreshLibrary(r.library_id)});const Bg=n=>Symbol.iterator in n,$g=n=>"entries"in n,qg=(n,r)=>{const s=n instanceof Map?n:new Map(n.entries()),i=r instanceof Map?r:new Map(r.entries());if(s.size!==i.size)return!1;for(const[o,d]of s)if(!i.has(o)||!Object.is(d,i.get(o)))return!1;return!0},PS=(n,r)=>{const s=n[Symbol.iterator](),i=r[Symbol.iterator]();let o=s.next(),d=i.next();for(;!o.done&&!d.done;){if(!Object.is(o.value,d.value))return!1;o=s.next(),d=i.next()}return!!o.done&&!!d.done};function IS(n,r){return Object.is(n,r)?!0:typeof n!="object"||n===null||typeof r!="object"||r===null||Object.getPrototypeOf(n)!==Object.getPrototypeOf(r)?!1:Bg(n)&&Bg(r)?$g(n)&&$g(r)?qg(n,r):PS(n,r):qg({entries:()=>Object.entries(n)},{entries:()=>Object.entries(r)})}function Br(n){const r=Rl.useRef(void 0);return s=>{const i=n(s);return IS(r.current,i)?r.current:r.current=i}}function _d(){const{t:n}=je(),r=$t(Br(JS));if(r.length===0)return null;const s=r.filter(m=>m.is_online).length,i=r.length,o=s>0,d=o?n("sources.header.daemon_status",{online:s,total:i}):n("sources.header.all_offline");return u.jsxs("div",{className:"group relative flex items-center",title:d,children:[u.jsx("span",{className:`inline-block h-[7px] w-[7px] rounded-full ${o?"bg-c4a-success":"bg-c4a-error"}`}),u.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:d})]})}const Yg=["#6366f1","#8b5cf6","#a855f7","#d946ef","#ec4899","#f43f5e","#ef4444","#f97316","#eab308","#22c55e","#14b8a6","#06b6d4","#3b82f6","#2563eb"];function WS(n){let r=0;for(let s=0;s<n.length;s++)r=(r<<5)-r+n.charCodeAt(s)|0;return Math.abs(r)}function e2({name:n,avatarUrl:r,size:s=24}){const[i,o]=y.useState(!1),d=n.charAt(0).toUpperCase(),m=Yg[WS(n)%Yg.length];return r&&!i?u.jsx("img",{src:r,alt:"",className:"rounded-full object-cover",style:{width:s,height:s},onError:()=>o(!0)}):u.jsx("span",{className:"inline-flex items-center justify-center rounded-full font-mono text-xs font-bold text-white",style:{width:s,height:s,backgroundColor:m,fontSize:s*.4},children:d})}function t2(){const{t:n}=je(),r=_a(),s=Za(g=>g.user),i=Za(g=>g.logout),[o,d]=y.useState(!1),m=y.useRef(null),p=y.useCallback(()=>{i(),d(!1),r("/login",{replace:!0})},[i,r]);return y.useEffect(()=>{if(!o)return;const g=h=>{m.current&&!m.current.contains(h.target)&&d(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[o]),s?u.jsxs("div",{ref:m,className:"relative",children:[u.jsx("button",{onClick:()=>d(g=>!g),className:"flex cursor-pointer items-center gap-1",children:u.jsx(e2,{name:s.name,avatarUrl:s.avatar_url,size:24})}),o&&u.jsxs("div",{className:"absolute right-0 top-full z-50 mt-2 min-w-[180px] rounded border border-c4a-border-default bg-c4a-bg-elevated shadow-c4a-md",children:[u.jsxs("div",{className:"px-4 py-3",children:[u.jsx("p",{className:"text-sm text-c4a-text-primary",children:s.name}),u.jsx("p",{className:"text-xs text-c4a-text-muted",children:s.email}),u.jsx("p",{className:"mt-1 font-mono text-[10px] uppercase tracking-tight text-c4a-text-muted",children:n("workspace.default_name")})]}),u.jsx("div",{className:"border-t border-c4a-border-subtle",children:u.jsx("button",{onClick:p,className:"w-full cursor-pointer px-4 py-2.5 text-left font-mono text-xs uppercase tracking-tight text-c4a-error transition-colors hover:bg-c4a-bg-hover",children:n("user.menu.sign_out")})})]})]}):null}function Sd({onLoginClick:n}){const{t:r}=je();return Za(i=>i.isAuthenticated)?u.jsx(t2,{}):u.jsx(Fa,{to:"/login",onClick:n,className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-primary",children:r("nav.login")})}const Gg=[{to:"/",labelKey:"nav.home"},{to:"/studio",labelKey:"nav.studio"},{to:"/docs",labelKey:"nav.docs"}];function a2(){const{t:n}=je(),[r,s]=y.useState(!1);return u.jsxs("header",{className:"sticky top-0 z-40 border-b border-c4a-border-subtle bg-c4a-bg-base/95 backdrop-blur-sm",children:[u.jsxs("div",{className:"flex h-14 items-center justify-between px-4",children:[u.jsxs(Fa,{to:"/",className:"flex items-center gap-2 text-c4a-text-primary",children:[u.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"}),u.jsx("span",{className:"hidden font-mono text-sm font-semibold uppercase tracking-tight md:inline",children:"Context4AI"})]}),u.jsxs("div",{className:"hidden items-center gap-6 md:flex",children:[u.jsx("nav",{className:"flex items-center gap-4",children:Gg.map(({to:i,labelKey:o})=>u.jsx($s,{to:i,end:i==="/",className:({isActive:d})=>`font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${d?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:n(o)},i))}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(_d,{}),u.jsx(Sd,{})]})]}),u.jsx("button",{onClick:()=>s(!r),className:"text-c4a-text-secondary md:hidden",children:r?u.jsx(Hr,{size:20}):u.jsx(pS,{size:20})})]}),r&&u.jsxs("div",{className:"border-t border-c4a-border-subtle bg-c4a-bg-surface px-4 pb-4 pt-2 md:hidden",children:[u.jsx("nav",{className:"flex flex-col gap-2",children:Gg.map(({to:i,labelKey:o})=>u.jsx($s,{to:i,end:i==="/",onClick:()=>s(!1),className:({isActive:d})=>`block py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${d?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:n(o)},i))}),u.jsx("div",{className:"mt-2 border-t border-c4a-border-subtle pt-2",children:u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(_d,{}),u.jsx(Sd,{onLoginClick:()=>s(!1)})]})})]})]})}function n2(n){return n==="system"&&typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":n==="system"?"dark":n}function ay(n){if(typeof window>"u")return;const r=n2(n);document.documentElement.setAttribute("data-theme",r),localStorage.setItem("theme",n)}function r2(){try{return localStorage.getItem("theme")||"system"}catch{return"system"}}const ny=Fs(n=>({theme:r2(),setTheme:r=>{ay(r),n({theme:r})}}));let Vg=!1;function l2(){if(Vg||typeof window>"u")return;Vg=!0;const n=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>{const{theme:s}=ny.getState();s==="system"&&ay("system")};n.addEventListener("change",r)}l2();const s2=[{mode:"light",icon:LS,labelKey:"footer.theme.light"},{mode:"dark",icon:bS,labelKey:"footer.theme.dark"},{mode:"system",icon:xS,labelKey:"footer.theme.system"}];function ry(){const{t:n}=je(),{theme:r,setTheme:s}=ny();return u.jsx("div",{className:"flex items-center gap-1",children:s2.map(({mode:i,icon:o,labelKey:d})=>u.jsx("button",{onClick:()=>s(i),title:n(d),className:`cursor-pointer rounded p-1.5 transition-colors duration-150 ${r===i?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:u.jsx(o,{size:14})},i))})}function ly(){const{i18n:n}=je(),r=()=>{const s=n.language==="en"?"zh":"en";n.changeLanguage(s)};return u.jsx("button",{onClick:r,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 sy({compact:n}){const{t:r}=je(),s=new Date().getFullYear(),i=n?"footer.copyright_compact":"footer.copyright";return u.jsx("p",{className:"font-mono text-[11px] text-c4a-text-muted",children:r(i,{year:s})})}const i2="_brandIcon_1c7st_1",o2="_iconPulse_1c7st_35",Kg={brandIcon:i2,iconPulse:o2};function c2({variant:n}){const{t:r}=je(),s=n==="studio"?"bg-c4a-bg-surface":"bg-c4a-bg-base";return u.jsx("footer",{className:`border-t border-c4a-border-subtle ${s} px-4 py-4`,children:u.jsxs("div",{className:"flex items-end justify-between gap-4",children:[u.jsxs("div",{className:"hidden items-center gap-3 md:flex",children:[u.jsx("div",{className:Kg.brandIcon,children:u.jsx("span",{className:Kg.iconPulse,children:"C4A"})}),u.jsxs("div",{className:"flex flex-col",children:[u.jsx("span",{className:"font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-primary",children:"Context4AI"}),u.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wider text-c4a-text-muted",children:r("footer.tagline")})]})]}),u.jsxs("div",{className:"ml-auto flex flex-col items-end gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(ry,{}),u.jsx(ly,{})]}),u.jsx(sy,{})]})]})})}function u2(){return u.jsxs("div",{className:"flex min-h-screen flex-col",children:[u.jsx(a2,{}),u.jsx("main",{className:"mx-auto flex w-full max-w-[1200px] flex-1 flex-col px-4",children:u.jsx(Yx,{})}),u.jsx(c2,{})]})}function d2({onToggleSidebar:n}){return u.jsx("header",{className:"sticky top-0 z-40 border-b border-c4a-border-subtle bg-c4a-bg-surface/95 backdrop-blur-sm",children:u.jsxs("div",{className:"relative flex h-14 items-center justify-between px-4",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[n&&u.jsx("button",{onClick:n,className:"text-c4a-text-secondary transition-colors duration-150 hover:text-c4a-text-primary md:hidden",children:u.jsx(SS,{size:20})}),u.jsxs(Fa,{to:"/",className:"hidden items-center gap-2 text-c4a-text-primary md:flex",children:[u.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"}),u.jsx("span",{className:"font-mono text-sm font-semibold uppercase tracking-tight",children:"Context4AI"})]})]}),u.jsx(Fa,{to:"/",className:"absolute left-1/2 flex -translate-x-1/2 items-center gap-2 text-c4a-text-primary md:hidden",children:u.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"})}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(_d,{}),u.jsx(Sd,{})]})]})})}const f2=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"}`,m2=[{to:"/studio/modeling",icon:R_,i18nKey:"studio.sidebar.modeling"},{to:"/studio/brain",icon:k_,i18nKey:"studio.sidebar.brain"},{to:"/studio/discovery",icon:bd,i18nKey:"studio.sidebar.discovery"},{to:"/studio/sharing",icon:zS,i18nKey:"studio.sidebar.sharing"},{to:"/studio/collaboration",icon:$S,i18nKey:"studio.sidebar.collaboration"},{to:"/studio/settings",icon:ey,i18nKey:"studio.sidebar.settings"}],h2=["My Drive","个人云","我的云盘"];function Xg({onNavigate:n}){const{t:r}=je(),s=rn(),i=_a(),o=$t(Br(Al)),d=s.pathname.startsWith("/studio/sources")||s.pathname.startsWith("/studio/source/"),[m,p]=y.useState(d);y.useEffect(()=>{d&&p(!0)},[d]);const g=h=>h.is_default&&h2.includes(h.name)?r("sources.library.default_cloud_name"):h.name;return u.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:[u.jsxs("nav",{className:"flex flex-col gap-1",children:[u.jsxs("div",{className:"group/sources",children:[u.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 ${d?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[u.jsx(Jx,{size:14}),r("studio.sidebar.sources"),u.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:r("sources.menu.add_client"),children:u.jsx(Wx,{size:12})}),u.jsx(da,{size:12,className:`ml-auto shrink-0 transition-transform duration-200 ${m?"rotate-90":""}`})]}),m&&u.jsx("div",{className:"mt-0.5 flex flex-col gap-0.5",children:o.map(h=>{const v=g(h);return u.jsxs($s,{to:`/studio/sources/${h.id}`,onClick:n,className:({isActive:b})=>`flex items-center gap-2 rounded py-1.5 pl-8 pr-3 font-mono text-xs tracking-tight transition-colors duration-150 ${b?"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"?u.jsx(U_,{size:13,className:"shrink-0 opacity-60"}):u.jsx(uS,{size:13,className:"shrink-0 opacity-60"}),u.jsx("span",{className:"truncate",children:v}),h.type==="daemon"&&(()=>{const b=h.config?.machine_id;return u.jsxs("span",{role:"button",tabIndex:0,onClick:S=>{S.preventDefault(),S.stopPropagation(),i("/studio/sources/add-client"),n?.()},onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),S.stopPropagation(),i("/studio/sources/add-client"),n?.())},className:"group/dot relative ml-auto shrink-0 cursor-pointer rounded-full p-1",children:[u.jsx("span",{className:`block h-[7px] w-[7px] rounded-full ${h.is_online?"bg-c4a-success":"bg-c4a-error"}`}),u.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?r("sources.menu.status_online",{machine:b??""}):r("sources.menu.status_offline",{machine:b??""})})]})})()]},h.id)})})]}),m2.map(({to:h,icon:v,i18nKey:b})=>u.jsxs($s,{to:h,onClick:n,className:({isActive:S})=>f2(S),children:[u.jsx(v,{size:14}),r(b)]},h))]}),u.jsxs("div",{className:"mt-auto flex flex-col gap-2 pt-3",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx(ry,{}),u.jsx(ly,{})]}),u.jsx(sy,{compact:!0})]})]})}const qs=Fs(n=>({status:"disconnected",onlineCount:0,connections:[],setStatus:r=>n({status:r}),fetchDaemonStatus:async()=>{try{const r=await st.get("/daemons/status");n({onlineCount:r.online_count,connections:r.connections})}catch{}}})),p2=n=>n==="connecting"?"disconnected":n;nn.onStatusChange(n=>{qs.getState().setStatus(p2(n))});nn.on("ws:daemon:connected",n=>{const r=n;qs.setState(s=>{if(s.connections.some(m=>m.machine_id===r.machine_id))return s;const o={machine_id:r.machine_id};r.lib_id&&(o.lib_id=r.lib_id);const d=[...s.connections,o];return{connections:d,onlineCount:d.length}})});nn.on("ws:daemon:status",n=>{const r=n;qs.setState(s=>{if(r.is_online){if(s.connections.some(p=>p.machine_id===r.machine_id))return s;const d={machine_id:r.machine_id};r.lib_id&&(d.lib_id=r.lib_id);const m=[...s.connections,d];return{connections:m,onlineCount:m.length}}const i=s.connections.filter(o=>o.machine_id!==r.machine_id);return{connections:i,onlineCount:i.length}})});function g2(){const n=_a(),[r,s]=y.useState(!1),i=Za(m=>m.isAuthenticated),[o,d]=y.useState(!1);return y.useEffect(()=>{const m=Za.getState();m.isAuthenticated||m.init(),d(!0)},[]),y.useEffect(()=>{o&&!i&&n("/login",{replace:!0})},[o,i,n]),y.useEffect(()=>{!o||!i||($t.getState().fetchLibraries(),qs.getState().fetchDaemonStatus())},[o,i]),y.useEffect(()=>{if(!(!o||!i))return nn.onStatusChange(m=>{m==="connected"&&($t.getState().fetchLibraries(),qs.getState().fetchDaemonStatus())})},[o,i]),!o||!i?null:u.jsxs("div",{className:"flex h-screen flex-col overflow-hidden",children:[u.jsx(d2,{onToggleSidebar:()=>s(!r)}),u.jsxs("div",{className:"flex min-h-0 flex-1",children:[u.jsx("div",{className:"hidden md:block",children:u.jsx(Xg,{})}),r&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"fixed inset-0 top-14 z-30 bg-black/40 md:hidden",onClick:()=>s(!1)}),u.jsx("div",{className:"fixed bottom-0 left-0 top-14 z-30 md:hidden",children:u.jsx(Xg,{onNavigate:()=>s(!1)})})]}),u.jsx("main",{className:"flex min-h-0 flex-1 flex-col overflow-x-hidden",children:u.jsx(Yx,{})})]})]})}function x2(){const{t:n}=je();return u.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center py-20 text-center",children:[u.jsx("h1",{className:"font-mono text-4xl font-bold uppercase tracking-wide text-c4a-text-primary md:text-5xl",children:n("home.hero.title")}),u.jsx("p",{className:"mt-6 max-w-lg text-base text-c4a-text-secondary",children:n("home.hero.description")}),u.jsxs("div",{className:"mt-10 flex items-center gap-4",children:[u.jsxs(Fa,{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"),u.jsx(Fx,{size:14})]}),u.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")})]})]})}const y2=new Set(["github","google","feishu"]),b2=new Set(["oidc","oauth2"]);function v2(){const{t:n}=je(),r=_a(),s=Za(M=>M.login),i=Za(M=>M.isAuthenticated),[o,d]=y.useState([]),[m,p]=y.useState(!0),[g,h]=y.useState(null),[v,b]=y.useState(!1);y.useEffect(()=>{i&&r("/studio",{replace:!0})},[i,r]);const S=y.useCallback(async()=>{p(!0),h(null);try{const M=await st.get("/auth/providers");d(M)}catch{h(n("login.error"))}finally{p(!1)}},[n]);y.useEffect(()=>{S()},[S]);const j=M=>{window.location.href=`/api/v1/auth/${M}/login`},N=async()=>{b(!0);try{const M=await st.post("/auth/test-account/login");s(M.token),r("/studio",{replace:!0})}catch{b(!1),h(n("login.error"))}},T=o.filter(M=>y2.has(M.type)),O=o.filter(M=>b2.has(M.type)),q=o.find(M=>M.type==="test_account"),X=T.length>0||O.length>0,G=(T.length>0?1:0)+(O.length>0?1:0)+(q?1:0)>1;return u.jsx("div",{className:"flex flex-1 items-center justify-center px-4 py-12",children:u.jsxs("div",{className:"w-full max-w-sm rounded border border-c4a-border-subtle bg-c4a-bg-surface px-8 py-8",children:[(m||v)&&u.jsxs("div",{className:"flex flex-col items-center gap-6",children:[u.jsx("h2",{className:"font-mono text-sm uppercase tracking-tight text-c4a-text-primary",children:n(v?"login.authenticating":"login.loading")}),u.jsx("div",{className:"h-0.5 w-16 animate-pulse rounded bg-c4a-accent/40"})]}),!m&&!v&&g&&u.jsxs("div",{className:"flex flex-col items-center gap-4",children:[u.jsx("p",{className:"text-xs text-c4a-error",children:g}),u.jsx("button",{onClick:S,className:"cursor-pointer rounded border border-c4a-border-default px-4 py-2 font-mono text-xs uppercase tracking-tight text-c4a-text-secondary transition-colors hover:border-c4a-border-strong hover:text-c4a-text-primary",children:n("login.retry")})]}),!m&&!v&&!g&&u.jsxs("div",{className:"flex flex-col gap-6",children:[u.jsx("h2",{className:"text-center font-mono text-sm uppercase tracking-tight text-c4a-text-primary",children:n("login.title")}),u.jsxs("div",{className:"flex flex-col gap-2",children:[T.map(M=>u.jsx(Qg,{provider:M,onClick:()=>j(M.id),label:n("login.provider_cta",{name:M.display_name})},M.id)),T.length>0&&O.length>0&&u.jsx(Fg,{label:n("login.or")}),O.map(M=>u.jsx(Qg,{provider:M,onClick:()=>j(M.id),label:n("login.provider_cta",{name:M.display_name})},M.id)),X&&q&&G&&u.jsx(Fg,{label:n("login.or")}),q&&u.jsxs("button",{onClick:N,className:"flex h-11 w-full cursor-pointer items-center justify-center gap-3 rounded border border-c4a-accent/40 bg-transparent font-mono text-xs uppercase tracking-tight text-c4a-accent transition-colors hover:border-c4a-accent hover:bg-c4a-accent/10",children:[q.icon&&u.jsx("img",{src:q.icon,alt:"",className:"h-5 w-5"}),n("login.provider_cta",{name:q.display_name})]})]})]})]})})}function Qg({provider:n,onClick:r,label:s}){return u.jsxs("button",{onClick:r,className:"flex h-11 w-full cursor-pointer items-center justify-center gap-3 rounded border border-c4a-border-default bg-transparent font-mono text-xs uppercase tracking-tight text-c4a-text-secondary transition-colors hover:border-c4a-border-strong hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:[n.icon&&u.jsx("img",{src:n.icon,alt:"",className:"h-5 w-5"}),s]})}function Fg({label:n}){return u.jsxs("div",{className:"flex items-center gap-3 py-1",children:[u.jsx("div",{className:"h-px flex-1 bg-c4a-border-subtle"}),u.jsx("span",{className:"font-mono text-[10px] uppercase text-c4a-text-muted",children:n}),u.jsx("div",{className:"h-px flex-1 bg-c4a-border-subtle"})]})}const _2="animate-pulse font-mono text-xs uppercase tracking-tight text-c4a-text-muted";function Hd({labelKey:n="login.loading",className:r}){const{t:s}=je();return u.jsx("span",{className:r??_2,children:s(n)})}function S2(){const n=_a(),r=Za(s=>s.login);return y.useEffect(()=>{const i=new URLSearchParams(window.location.search).get("token");if(i){r(i);const o=Za.getState().isAuthenticated;n(o?"/studio":"/login",{replace:!0})}else n("/login",{replace:!0})},[r,n]),u.jsx("div",{className:"flex flex-1 items-center justify-center",children:u.jsx(Hd,{labelKey:"login.authenticating",className:"animate-pulse font-mono text-sm uppercase tracking-tight text-c4a-text-muted"})})}function ln({title:n,version:r,description:s}){const{t:i}=je();return u.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:u.jsxs("div",{className:"max-w-md text-center",children:[u.jsx("h2",{className:"font-mono text-2xl font-bold uppercase text-c4a-text-primary",children:n}),r&&u.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:r})}),u.jsx("p",{className:"mt-4 text-sm text-c4a-text-secondary",children:s})]})})}function j2(){const{t:n}=je();return u.jsx(ln,{title:n("page.docs.title"),version:"0.4.13",description:n("page.docs.description")})}function N2(){const{t:n}=je();return u.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-c4a-bg-base p-8 text-center",children:[u.jsx("h1",{className:"font-mono text-6xl font-bold text-c4a-accent",children:n("notfound.title")}),u.jsx("p",{className:"mt-4 text-base text-c4a-text-secondary",children:n("notfound.description")}),u.jsx(Fa,{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 Zg(){const{t:n}=je(),r=$x();let s="500",i=n("error.description");return zl(r)?(s=String(r.status),r.status===404?i=n("notfound.description"):r.statusText&&(i=r.statusText)):r instanceof Error&&(i=r.message),console.error(`[ErrorPage] ${s}:`,r),u.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-c4a-bg-base p-8 text-center",children:[u.jsx("h1",{className:"font-mono text-6xl font-bold text-c4a-accent",children:s}),u.jsx("p",{className:"mt-4 max-w-md text-base text-c4a-text-secondary",children:i}),u.jsxs("div",{className:"mt-8 flex items-center gap-3",children:[u.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:[u.jsx(RS,{size:14}),n("error.reload")]}),u.jsx(Fa,{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 w2(){const{t:n}=je();return u.jsx(ln,{title:n("page.modeling.title"),version:"0.4.16",description:n("page.modeling.description")})}function E2(){const{t:n}=je();return u.jsx(ln,{title:n("page.brain.title"),version:"0.4.18",description:n("page.brain.description")})}function C2(){const{t:n}=je();return u.jsx(ln,{title:n("page.discovery.title"),version:"0.6.x",description:n("page.discovery.description")})}function R2(){const{t:n}=je();return u.jsx(ln,{title:n("page.sharing.title"),version:"0.4.39",description:n("page.sharing.description")})}function T2(){const{t:n}=je();return u.jsx(ln,{title:n("page.collaboration.title"),version:"0.5.x",description:n("page.collaboration.description")})}const iy=y.createContext(null);function oy(){const n=y.useContext(iy);if(!n)throw new Error("Tabs compound components must be used within <Tabs>");return n}function cy({value:n,onChange:r,children:s}){return u.jsx(iy.Provider,{value:{value:n,onChange:r},children:s})}function uy({children:n}){return u.jsx("div",{className:"flex border-b border-c4a-border-subtle",children:n})}function jd({value:n,children:r}){const{value:s,onChange:i}=oy(),o=s===n;return u.jsx("button",{onClick:()=>i(n),className:`border-b-2 px-4 py-2 font-mono text-xs uppercase transition-colors ${o?"border-c4a-accent text-c4a-accent":"border-transparent text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:r})}function Ls({value:n,children:r}){const{value:s}=oy();return s!==n?null:u.jsx(u.Fragment,{children:r})}function dy({icon:n,title:r,description:s,action:i}){return u.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[n&&u.jsx("div",{className:"mb-3 text-c4a-text-muted",children:n}),u.jsx("p",{className:"font-mono text-sm text-c4a-text-secondary",children:r}),u.jsx("p",{className:"text-xs text-c4a-text-muted mt-2 max-w-md text-center",children:s}),i&&u.jsx("div",{className:"mt-4",children:i})]})}function Ln({children:n,onClose:r,className:s="",overlayClass:i="bg-black/50",closeOnOverlay:o=!0,closeOnEsc:d=!0,disableClose:m=!1}){const p=y.useRef(null);y.useEffect(()=>{if(!d)return;const h=v=>{v.key==="Escape"&&!m&&r()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[r,d,m]);const g=y.useCallback(h=>{o&&!m&&p.current&&!p.current.contains(h.target)&&r()},[r,o,m]);return u.jsx("div",{className:`fixed inset-0 z-50 flex items-center justify-center ${i}`,onClick:g,children:u.jsx("div",{ref:p,className:s,children:n})})}function k2(){const{t:n}=je(),[r,s]=y.useState("general");return u.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[u.jsx(ey,{size:20,className:"text-c4a-text-muted"}),u.jsx("h1",{className:"font-mono text-xl font-bold text-c4a-text-primary",children:n("page.settings.title")})]}),u.jsxs(cy,{value:r,onChange:s,children:[u.jsxs(uy,{children:[u.jsx(jd,{value:"general",children:n("settings.tab.general")}),u.jsx(jd,{value:"api_keys",children:n("settings.tab.api_keys")})]}),u.jsx(Ls,{value:"general",children:u.jsx("div",{className:"mt-6",children:u.jsx(ln,{title:n("page.settings.title"),version:"0.5.x",description:n("page.settings.description")})})}),u.jsx(Ls,{value:"api_keys",children:u.jsx(O2,{})})]})]})}function O2(){const{t:n}=je(),[r,s]=y.useState([]),[i,o]=y.useState(!0),[d,m]=y.useState(!1),[p,g]=y.useState(null),h=y.useCallback(async()=>{o(!0);try{const S=await st.get("/auth/api-keys");s(S)}catch{}finally{o(!1)}},[]);y.useEffect(()=>{h()},[h]);const v=S=>{m(!1),g(S),h()},b=async S=>{if(confirm(n("api_keys.delete.confirm")))try{await st.delete(`/auth/api-keys/${S}`),h()}catch{}};return u.jsxs("div",{className:"mt-6",children:[u.jsx("p",{className:"mb-4 text-xs text-c4a-text-muted",children:n("api_keys.description")}),u.jsxs("button",{onClick:()=>m(!0),className:"mb-6 cursor-pointer rounded border border-c4a-accent bg-c4a-accent/10 px-4 py-2 font-mono text-xs uppercase tracking-tight text-c4a-accent transition-colors hover:bg-c4a-accent/20",children:["+ ",n("api_keys.create")]}),i&&u.jsx("div",{className:"flex justify-center py-12",children:u.jsx(Hd,{})}),!i&&r.length===0&&u.jsx(dy,{icon:u.jsx(oS,{size:32}),title:n("api_keys.empty.title"),description:n("api_keys.empty.description")}),!i&&r.length>0&&u.jsx("div",{className:"flex flex-col gap-3",children:r.map(S=>u.jsx(z2,{apiKey:S,onDelete:()=>b(S.id)},S.id))}),d&&u.jsx(D2,{onClose:()=>m(!1),onCreated:v}),p&&u.jsx(A2,{apiKey:p,onClose:()=>g(null)})]})}function z2({apiKey:n,onDelete:r}){const{t:s}=je(),i=n.last_used_at?new Date(n.last_used_at).toLocaleDateString():s("api_keys.never_used"),o=new Date(n.created_at).toLocaleDateString();return u.jsx("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:u.jsxs("div",{className:"flex items-start justify-between",children:[u.jsxs("div",{children:[u.jsx("p",{className:"font-mono text-sm text-c4a-text-primary",children:n.name}),u.jsxs("p",{className:"mt-1 text-xs text-c4a-text-muted",children:[u.jsxs("span",{className:"font-mono",children:[n.key_prefix,"****"]}),u.jsx("span",{className:"mx-2",children:"·"}),i]}),u.jsx("p",{className:"mt-0.5 text-xs text-c4a-text-muted",children:s("api_keys.created_at",{date:o})})]}),u.jsx("button",{onClick:r,className:"cursor-pointer p-1 text-c4a-text-muted transition-colors hover:text-c4a-error",title:"Delete",children:u.jsx(Ud,{size:14})})]})})}function D2({onClose:n,onCreated:r}){const{t:s}=je(),[i,o]=y.useState(""),[d,m]=y.useState("never"),[p,g]=y.useState(!1),h=async()=>{if(i.trim()){g(!0);try{const v=M2(d),b=await st.post("/auth/api-keys",{name:i.trim(),scope:["read"],expires_at:v});r(b)}catch{g(!1)}}};return u.jsxs(Ln,{onClose:n,className:"w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-8 shadow-c4a-lg",children:[u.jsx("h2",{className:"mb-6 font-mono text-sm uppercase tracking-tight text-c4a-text-primary",children:s("api_keys.create")}),u.jsx("label",{className:"mb-1 block text-sm text-c4a-text-secondary",children:s("api_keys.form.name")}),u.jsx("input",{value:i,onChange:v=>o(v.target.value),placeholder:s("api_keys.form.name_placeholder"),className:"mb-4 w-full rounded border border-c4a-border-default bg-c4a-bg-base px-3 py-2 text-sm text-c4a-text-primary placeholder:text-c4a-text-muted focus:border-c4a-accent focus:outline-none"}),u.jsx("label",{className:"mb-1 block text-sm text-c4a-text-secondary",children:s("api_keys.form.expiry")}),u.jsxs("select",{value:d,onChange:v=>m(v.target.value),className:"mb-6 w-full rounded border border-c4a-border-default bg-c4a-bg-base px-3 py-2 text-sm text-c4a-text-primary focus:border-c4a-accent focus:outline-none",children:[u.jsx("option",{value:"never",children:s("api_keys.expires.never")}),u.jsx("option",{value:"30d",children:s("api_keys.expires.30d")}),u.jsx("option",{value:"90d",children:s("api_keys.expires.90d")}),u.jsx("option",{value:"1y",children:s("api_keys.expires.1y")})]}),u.jsxs("div",{className:"flex justify-end gap-3",children:[u.jsx("button",{onClick:n,disabled:p,className:"cursor-pointer rounded border border-c4a-border-default px-4 py-2 font-mono text-xs uppercase tracking-tight text-c4a-text-secondary transition-colors hover:border-c4a-border-strong hover:text-c4a-text-primary",children:s("common.cancel")}),u.jsx("button",{onClick:h,disabled:!i.trim()||p,className:"cursor-pointer rounded border border-c4a-accent bg-c4a-accent/10 px-4 py-2 font-mono text-xs uppercase tracking-tight text-c4a-accent transition-colors hover:bg-c4a-accent/20 disabled:opacity-50",children:s("api_keys.create")})]})]})}function A2({apiKey:n,onClose:r}){const{t:s}=je(),[i,o]=y.useState(!1),d=async()=>{try{await navigator.clipboard.writeText(n.key),o(!0),setTimeout(()=>o(!1),2e3)}catch{const m=document.querySelector("[data-api-key-value]");if(m){const p=document.createRange();p.selectNodeContents(m);const g=window.getSelection();g?.removeAllRanges(),g?.addRange(p)}}};return u.jsxs(Ln,{onClose:r,className:"w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-8 shadow-c4a-lg",closeOnOverlay:!1,closeOnEsc:!1,children:[u.jsx("h2",{className:"mb-4 font-mono text-sm uppercase tracking-tight text-c4a-success",children:s("api_keys.created")}),u.jsx("p",{className:"mb-4 text-sm text-c4a-text-secondary",children:s("api_keys.copy_warning")}),u.jsxs("div",{className:"mb-6 flex items-center gap-2 rounded border border-c4a-accent/30 bg-c4a-bg-base px-3 py-2",children:[u.jsx("code",{"data-api-key-value":!0,className:"flex-1 truncate font-mono text-xs text-c4a-text-primary",children:n.key}),u.jsx("button",{onClick:d,className:"cursor-pointer shrink-0 font-mono text-xs uppercase text-c4a-accent transition-colors hover:text-c4a-accent/80",children:s(i?"api_keys.copied":"api_keys.copy")})]}),u.jsx("div",{className:"flex justify-end",children:u.jsx("button",{onClick:r,className:"cursor-pointer rounded border border-c4a-accent bg-c4a-accent/10 px-4 py-2 font-mono text-xs uppercase tracking-tight text-c4a-accent transition-colors hover:bg-c4a-accent/20",children:s("api_keys.done")})})]})}function M2(n){if(n==="never")return null;const r=new Date;switch(n){case"30d":r.setDate(r.getDate()+30);break;case"90d":r.setDate(r.getDate()+90);break;case"1y":r.setFullYear(r.getFullYear()+1);break;default:return null}return r.toISOString()}function L2(){const{t:n}=je();return u.jsx(ln,{title:n("page.code_setup.title"),version:"0.4.13",description:n("page.code_setup.description")})}function U2(){const{t:n}=je();return u.jsx(ln,{title:n("page.code_compile.title"),version:"0.4.13",description:n("page.code_compile.description")})}function H2(){const{t:n}=je();return u.jsx(ln,{title:n("page.code_review.title"),version:"0.4.14",description:n("page.code_review.description")})}function B2(){const{t:n}=je();return u.jsx(ln,{title:n("page.code_result.title"),version:"0.4.14",description:n("page.code_result.description")})}const ko=(n,r)=>{for(const s of n){if(s.path===r)return s;if(s.children){const i=ko(s.children,r);if(i)return i}}return null},$2=(n,r)=>r===""?n:ko(n,r)?.children??[],zs=(n,r)=>{if(!r)return[];const s=r.split("/"),i=[];let o="";for(const d of s){o=o?`${o}/${d}`:d;const m=ko(n,o);m&&i.push(m)}return i},Oo=Fs(n=>({rootSources:[],currentRoot:null,loading:!1,error:null,total:0,limit:100,offset:0,filter:"all",fetchRootSources:async({library_id:r,limit:s,offset:i})=>{n({loading:!0,error:null});try{const o={library_id:r};s!==void 0&&(o.limit=String(s)),i!==void 0&&(o.offset=String(i));const d=await st.get("/sources",o);n({rootSources:d.items,total:d.total,limit:d.limit,offset:d.offset,loading:!1})}catch(o){n({error:o instanceof Error?o.message:"Failed to load sources",loading:!1})}},fetchRootSource:async r=>{const s=await st.get(`/sources/${r}`);return n({currentRoot:s}),s},createSource:async r=>await st.post("/sources",r),addTreeNode:async(r,s)=>{const i=await st.post(`/sources/${r}/tree`,s);return n(o=>({rootSources:o.rootSources.map(d=>d.id===r?i:d),currentRoot:o.currentRoot?.id===r?i:o.currentRoot})),i},updateSource:async(r,s)=>{const i=await st.put(`/sources/${r}`,s);n(o=>({rootSources:o.rootSources.map(d=>d.id===r?i:d),currentRoot:o.currentRoot?.id===r?i:o.currentRoot}))},deleteSource:async r=>{await st.delete(`/sources/${r}`),n(s=>({rootSources:s.rootSources.filter(i=>i.id!==r),currentRoot:s.currentRoot?.id===r?null:s.currentRoot}))},deleteTreeNode:async(r,s)=>{const i=await st.delete(`/sources/${r}/tree?path=${encodeURIComponent(s)}`);return n(o=>({rootSources:o.rootSources.map(d=>d.id===r?i:d),currentRoot:o.currentRoot?.id===r?i:o.currentRoot})),i},uploadDoc:async r=>await st.post("/sources/upload",r),setFilter:r=>n({filter:r}),clearSources:()=>n({rootSources:[],currentRoot:null,total:0,offset:0})}));function Ml({segments:n}){const{t:r}=je(),s=y.useRef(null),i=y.useRef(null),[o,d]=y.useState(0),m=[{label:r("sources.breadcrumb.sources")},...n],p=Math.max(0,m.length-3);y.useEffect(()=>{const h=s.current,v=i.current;if(!h||!v)return;const b=()=>{const j=h.clientWidth,N=Array.from(v.children);if(N.length===0)return;const T=N.map(Z=>Z.offsetWidth),O=4;if(T.reduce((Z,E)=>Z+E,0)+O*(T.length-1)<=j){d(0);return}const X=20,G=(T[0]??0)+(T[1]??0)+O,M=T[T.length-1]??0,Q=G+O+X+O+M;let te=p;for(let Z=1;Z<=p;Z++){let E=0;for(let Y=2+Z;Y<T.length-1;Y++)E+=T[Y]+O;if(Q+E<=j){te=Z;break}}d(te)};b();const S=new ResizeObserver(b);return S.observe(h),()=>S.disconnect()},[p,n,r]);const g=(()=>{if(o===0||m.length<=3)return m;const h=m.slice(0,2),v=m[m.length-1],b=m.slice(2+o,m.length-1);return[...h,{label:"…"},...b,v]})();return u.jsxs("div",{ref:s,className:"relative min-w-0 overflow-hidden",children:[u.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 b=v===g.length-1;return u.jsxs("span",{className:`flex shrink-0 items-center gap-1 ${v===0?"uppercase":""}`,children:[v>0&&u.jsx(da,{size:12,className:"shrink-0 text-c4a-text-muted"}),h.to&&!b?u.jsx(Fa,{to:h.to,className:"cursor-pointer whitespace-nowrap transition-colors hover:text-c4a-text-primary",children:h.label}):u.jsx("span",{className:`whitespace-nowrap ${b?"text-c4a-text-primary":""}`,children:h.label})]},v)})}),u.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)=>u.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[v>0&&u.jsx(da,{size:12}),u.jsx("span",{className:"whitespace-nowrap",children:h.label})]},v))})]})}const q2=["all","indexed","not_indexed"];function Y2({value:n,onChange:r}){const{t:s}=je(),[i,o]=y.useState(!1),d=y.useRef(null),m=y.useRef(null),p={all:s("sources.filter.all"),indexed:s("sources.filter.indexed"),not_indexed:s("sources.filter.not_indexed")},g=y.useCallback(b=>{d.current&&!d.current.contains(b.target)&&o(!1)},[]);y.useEffect(()=>{if(i)return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[i,g]);const h=y.useCallback(()=>{m.current&&(clearTimeout(m.current),m.current=null),o(!0)},[]),v=y.useCallback(()=>{m.current=setTimeout(()=>o(!1),150)},[]);return u.jsxs("div",{ref:d,className:"relative",onMouseEnter:h,onMouseLeave:v,children:[u.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:[u.jsx(fS,{size:12}),u.jsx("span",{className:"hidden sm:inline",children:p[n]}),u.jsx(da,{size:12,className:`hidden transition-transform duration-200 sm:block ${i?"rotate-90":""}`})]}),i&&u.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:q2.map(b=>u.jsxs("button",{onClick:()=>{r(b),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 ${b===n?"text-c4a-accent":"text-c4a-text-secondary"}`,children:[u.jsx(Lr,{size:12,className:b===n?"opacity-100":"opacity-0"}),p[b]]},b))})]})}function fy({currentName:n,onConfirm:r,onCancel:s,error:i}){const[o,d]=y.useState(n),m=y.useRef(null);y.useEffect(()=>{m.current?.select()},[]);const p=y.useCallback(()=>{const h=o.trim();h&&h!==n?r(h):s()},[o,n,r,s]),g=y.useCallback(h=>{h.key==="Enter"?(h.preventDefault(),p()):h.key==="Escape"&&s()},[p,s]);return u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("input",{ref:m,value:o,onChange:h=>d(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}),u.jsx("button",{onClick:h=>{h.stopPropagation(),p()},className:"rounded p-0.5 text-c4a-success hover:bg-c4a-bg-hover",children:u.jsx(Lr,{size:14})}),u.jsx("button",{onClick:h=>{h.stopPropagation(),s()},className:"rounded p-0.5 text-c4a-error hover:bg-c4a-bg-hover",children:u.jsx(Hr,{size:14})}),i&&u.jsx("span",{className:"ml-1 text-xs text-c4a-error",children:i})]})}const G2=new Set(["package.json","pyproject.toml","setup.py","go.mod","cargo.toml","pom.xml","build.gradle"]),V2=new Set([".ts",".tsx",".md"]),K2=new Set([".md",".doc",".docx",".pdf",".ppt",".pptx",".txt"]),X2=new Set([".md",".txt"]),Q2=5*1024*1024,F2=10;function Nd(n){const r=n.lastIndexOf(".");return r>=0?n.slice(r).toLowerCase():""}function Z2(n){const r=n.includes("/")?n.split("/").pop():n;if(G2.has(r.toLowerCase()))return!0;const s=Nd(r);return V2.has(s)}const J2=n=>{const r=new Date(n);if(Number.isNaN(r.getTime()))return"";const s=o=>String(o).padStart(2,"0"),i=`${s(r.getMonth()+1)}-${s(r.getDate())} ${s(r.getHours())}:${s(r.getMinutes())}`;return r.getFullYear()===new Date().getFullYear()?i:`${r.getFullYear()}-${i}`},Jg={none:"bg-c4a-text-muted/40",indexed:"bg-c4a-success",stale:"bg-c4a-warning"};function P2({source:n,isDaemonLibrary:r,isRepoRoot:s}){const{t:i}=je(),o=n.kind==="source",d=o&&(n.source_type==="code"||Z2(n.name)),m=d?"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?u.jsx(To,{size:16,className:`shrink-0 ${m}`}):r?u.jsx(J_,{size:16,className:`shrink-0 ${m}`}):u.jsx(Xa,{size:16,className:`shrink-0 ${m}`}):n.source_type==="code"?g=u.jsx(Ol,{size:16,className:`shrink-0 ${m}`}):g=u.jsx(dr,{size:16,className:`shrink-0 ${m}`}),!o||!d)return u.jsx(u.Fragment,{children:g});const h=Jg[n.index_status]??Jg.none,v=i(`sources.status.${n.index_status}`);return u.jsxs("span",{className:"group/dot relative shrink-0",children:[g,u.jsx("span",{className:`absolute -right-[2px] -top-[2px] block h-[5px] w-[5px] rounded-full ${h}`}),u.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 Pg({source:n,displayName:r,childCount:s,isDaemonLibrary:i,isRepoRoot:o,hasUpdate:d,onClick:m,onRename:p,onDelete:g}){const{t:h}=je(),[v,b]=y.useState(!1),[S,j]=y.useState(null),N=y.useCallback(async G=>{if(!p)return;const M=await p(G);M?j(M):(b(!1),j(null))},[p]),T=y.useCallback(()=>{b(!1),j(null)},[]),O=!o&&p,q=g,X=n.updated_at||n.created_at;return u.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:[u.jsx(P2,{source:n,isDaemonLibrary:i??!1,isRepoRoot:o??!1}),v?u.jsx("div",{className:"min-w-0 flex-1",onClick:G=>G.stopPropagation(),children:u.jsx(fy,{currentName:n.name,onConfirm:N,onCancel:T,error:S})}):u.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-c4a-text-secondary group-hover:text-c4a-accent",children:r??n.name}),u.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[d&&u.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:[u.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&&u.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:h("common.items",{count:s})}),X&&u.jsx("span",{className:"hidden font-mono text-[11px] text-c4a-text-muted lg:inline",children:J2(X)})]}),(O||q)&&u.jsxs("div",{className:"flex items-center gap-1 md:opacity-0 md:transition-opacity md:group-hover:opacity-100",children:[O?u.jsx("button",{title:h("sources.actions.rename"),onClick:G=>{G.stopPropagation(),b(!0)},className:"rounded p-1 text-c4a-text-muted transition-colors hover:text-c4a-accent",children:u.jsx(yd,{size:14})}):q?u.jsx("span",{className:"p-1",children:u.jsx("span",{className:"inline-block h-[14px] w-[14px]"})}):null,q&&u.jsx("button",{title:h("sources.actions.delete"),onClick:G=>{G.stopPropagation(),g()},className:"rounded p-1 text-c4a-text-muted transition-colors hover:text-c4a-accent",children:u.jsx(Ud,{size:14})})]})]})}function Ig({target:n,onConfirm:r,onCancel:s}){const{t:i}=je();return u.jsxs(Ln,{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:[u.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:i("sources.delete.confirm_title")}),u.jsxs("div",{className:"mt-4 space-y-3 text-sm text-c4a-text-secondary",children:[n.type==="resource"&&u.jsxs(u.Fragment,{children:[u.jsx("p",{children:i("sources.delete.resource",{name:n.name})}),u.jsx("p",{children:i("sources.delete.resource_impact")}),u.jsx("p",{className:"text-c4a-warning",children:i("sources.delete.session_warning")}),u.jsx("p",{children:i("sources.delete.entity_safe")})]}),n.type==="folder"&&u.jsxs(u.Fragment,{children:[u.jsx("p",{children:i("sources.delete.folder",{name:n.name})}),n.folderCount!==void 0&&n.sourceCount!==void 0?u.jsxs(u.Fragment,{children:[u.jsx("p",{children:i("sources.delete.folder_contents",{folders:n.folderCount,sources:n.sourceCount})}),n.indexedCount!==void 0&&n.indexedCount>0&&u.jsx("p",{children:i("sources.delete.indexed_hint",{indexed:n.indexedCount,total:n.sourceCount})})]}):u.jsx("p",{children:i("sources.delete.folder_impact_generic")}),u.jsx("p",{className:"text-c4a-warning",children:i("sources.delete.irreversible")})]}),n.type==="repo"&&u.jsxs(u.Fragment,{children:[u.jsx("p",{children:i("sources.delete.repo",{name:n.name,library:n.libraryName})}),n.packageCount!==void 0&&n.docCount!==void 0?u.jsxs(u.Fragment,{children:[u.jsx("p",{children:i("sources.delete.repo_contents",{packages:n.packageCount,docs:n.docCount})}),n.indexedCount!==void 0&&n.indexedCount>0&&u.jsx("p",{children:i("sources.delete.indexed_hint",{indexed:n.indexedCount,total:n.packageCount+n.docCount})})]}):u.jsx("p",{children:i("sources.delete.repo_impact_generic")}),u.jsx("p",{children:i("sources.delete.local_safe")}),u.jsx("p",{children:i("sources.delete.entity_safe")})]}),n.type==="client"&&u.jsxs(u.Fragment,{children:[u.jsx("p",{children:i("sources.delete.client",{name:n.name})}),u.jsx("p",{children:i("sources.delete.client_impact")}),u.jsx("p",{children:i("sources.delete.local_safe")}),u.jsx("p",{children:i("sources.delete.entity_safe")}),u.jsx("p",{className:"text-c4a-warning",children:i("sources.delete.irreversible")}),u.jsx("p",{className:"text-c4a-text-muted",children:i("sources.delete.client_reregister")})]})]}),u.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[u.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")}),u.jsx("button",{onClick:r,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 I2({onConfirm:n,onCancel:r,error:s}){const{t:i}=je(),[o,d]=y.useState(""),m=y.useRef(null);y.useEffect(()=>{m.current?.focus()},[]);const p=y.useCallback(()=>{const h=o.trim();h&&n(h)},[o,n]),g=y.useCallback(h=>{h.key==="Enter"&&(h.preventDefault(),p())},[p]);return u.jsxs(Ln,{onClose:r,className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Ix,{size:16,className:"shrink-0 text-c4a-accent"}),u.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:i("sources.actions.new_folder")})]}),u.jsxs("div",{className:"mt-4",children:[u.jsx("input",{ref:m,value:o,onChange:h=>d(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&&u.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:s})]}),u.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[u.jsx("button",{onClick:r,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")}),u.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 ad({label:n,icon:r,items:s,alignRight:i}){const[o,d]=y.useState(!1),m=y.useRef(null),p=y.useRef(null),g=y.useCallback(b=>{m.current&&!m.current.contains(b.target)&&d(!1)},[]);y.useEffect(()=>{if(o)return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[o,g]);const h=y.useCallback(()=>{p.current&&(clearTimeout(p.current),p.current=null),d(!0)},[]),v=y.useCallback(()=>{p.current=setTimeout(()=>d(!1),150)},[]);return u.jsxs("div",{ref:m,className:"relative",onMouseEnter:h,onMouseLeave:v,children:[u.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:[r,n&&u.jsx("span",{className:"hidden sm:inline",children:n}),n&&u.jsx(da,{size:12,className:`hidden transition-transform duration-200 sm:block ${o?"rotate-90":""}`})]}),o&&u.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(b=>u.jsxs("button",{onClick:()=>{b.onClick(),d(!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:[b.icon,b.label]},b.label))})]})}function W2({onClose:n}){const{t:r}=je();return u.jsxs(Ln,{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:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(AS,{size:18,className:"text-c4a-accent"}),u.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:r("sources.upgrade.title")})]}),u.jsx("p",{className:"mt-3 text-sm text-c4a-text-secondary",children:r("sources.upgrade.description")}),u.jsx("div",{className:"mt-6 flex justify-end",children:u.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:r("common.confirm")})})]})}function ej(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function tj({onConfirm:n,onCancel:r,error:s,uploading:i}){const{t:o}=je(),[d,m]=y.useState([]),[p,g]=y.useState(null),[h,v]=y.useState(!1),b=y.useRef(null),S=y.useCallback(M=>{g(null);for(const Q of M){const te=Nd(Q.name);if(!K2.has(te)){g(o("sources.upload.unsupported_type",{name:Q.name}));return}if(Q.size>Q2){g(o("sources.upload.file_too_large",{name:Q.name}));return}}m(Q=>{const te=new Map(Q.map(E=>[E.name,E]));for(const E of M)te.set(E.name,{name:E.name,size:E.size,file:E});const Z=Array.from(te.values());return Z.length>F2?(g(o("sources.upload.too_many_files")),Q):Z})},[o]),j=y.useCallback(M=>{const Q=M.target.files;!Q||Q.length===0||(S(Array.from(Q)),M.target.value="")},[S]),N=y.useCallback(M=>{m(Q=>Q.filter((te,Z)=>Z!==M)),g(null)},[]),T=y.useCallback(M=>{M.preventDefault(),v(!1);const Q=M.dataTransfer?.files;!Q||Q.length===0||S(Array.from(Q))},[S]),O=y.useCallback(M=>{M.preventDefault(),v(!0)},[]),q=y.useCallback(M=>{M.preventDefault(),v(!1)},[]),X=y.useCallback(async()=>{if(d.length===0)return;const M=await Promise.all(d.map(Q=>new Promise((te,Z)=>{const E=Nd(Q.name),Y=X2.has(E),W=new FileReader;W.onerror=()=>Z(W.error),Y?(W.onload=()=>te({name:Q.name,content:W.result,encoding:"utf-8"}),W.readAsText(Q.file)):(W.onload=()=>{const de=W.result,oe=de.slice(de.indexOf(",")+1);te({name:Q.name,content:oe,encoding:"base64"})},W.readAsDataURL(Q.file))})));n(M)},[d,n]),G=s||p;return u.jsxs(Ln,{onClose:r,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:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(vd,{size:16,className:"shrink-0 text-c4a-accent"}),u.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:o("sources.upload.title")})]}),u.jsxs("div",{className:"mt-4",children:[u.jsx("input",{ref:b,type:"file",accept:".md,.doc,.docx,.pdf,.ppt,.pptx,.txt",multiple:!0,onChange:j,className:"hidden"}),u.jsxs("button",{type:"button",onClick:()=>b.current?.click(),onDrop:T,onDragOver:O,onDragLeave:q,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:[u.jsx(vd,{size:24,className:"text-c4a-text-muted"}),u.jsx("p",{className:"mt-2 text-sm text-c4a-text-secondary",children:o("sources.upload.drop_hint")}),u.jsx("p",{className:"mt-1 text-[10px] text-c4a-text-muted",children:o("sources.upload.supported_formats")})]})]}),d.length>0&&u.jsxs("div",{className:"mt-3",children:[u.jsx("p",{className:"text-xs text-c4a-text-muted",children:o("sources.upload.selected",{count:d.length})}),u.jsx("div",{className:"mt-1 max-h-40 space-y-1 overflow-y-auto c4a-scrollbar",children:d.map((M,Q)=>u.jsxs("div",{className:"flex items-center gap-2 rounded bg-c4a-bg-surface px-2 py-1",children:[u.jsx(dr,{size:12,className:"shrink-0 text-c4a-text-muted"}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-c4a-text-primary",children:M.name}),u.jsx("span",{className:"shrink-0 text-[10px] text-c4a-text-muted",children:ej(M.size)}),!i&&u.jsx("button",{type:"button",onClick:()=>N(Q),className:"shrink-0 text-c4a-text-muted transition-colors hover:text-c4a-text-primary",title:o("sources.upload.remove"),children:u.jsx(Hr,{size:12})})]},`${M.name}-${Q}`))})]}),G&&u.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:G}),u.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[u.jsx("button",{onClick:r,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")}),u.jsxs("button",{onClick:X,disabled:d.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&&u.jsx(va,{size:12,className:"animate-spin"}),o(i?"sources.upload.uploading":"common.confirm")]})]})]})}function aj({pathLabel:n,loading:r,badge:s,onNavigateUp:i,children:o}){return u.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:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1",children:[u.jsx("p",{className:"min-w-0 shrink truncate font-mono text-xs text-c4a-text-muted",children:n}),s]}),u.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),u.jsx("div",{className:"c4a-scrollbar flex min-h-0 flex-1 flex-col overflow-y-auto",children:r?u.jsx("div",{className:"flex flex-1 items-center justify-center py-8",children:u.jsx(va,{size:14,className:"animate-spin text-c4a-text-muted"})}):u.jsxs(u.Fragment,{children:[i&&u.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:[u.jsx(Xa,{size:16,className:"shrink-0 text-c4a-text-muted"}),u.jsx("span",{children:".."})]}),o]})})]})}function nj(n){const r=n.match(/^[\w.-]+@([\w.-]+):([\w./-]+?)(?:\.git)?$/);if(r){const s=r[1],i=r[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 rj(n,r){return`${n}/tree/${encodeURIComponent(r)}`}function lj(n,r){return`${n}/commit/${r}`}function my({remoteUrl:n,fallbackName:r,branch:s,commit:i}){const o=n?nj(n):null,d=i.slice(0,7);return u.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?u.jsxs("a",{href:o.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 truncate hover:underline",title:o.repoUrl,children:[u.jsx(Dg,{size:12,className:"shrink-0"}),u.jsx("span",{className:"truncate",children:o.slug})]}):u.jsxs("span",{className:"flex items-center gap-1 truncate",children:[u.jsx(Dg,{size:12,className:"shrink-0"}),u.jsx("span",{className:"truncate",children:r||"repo"})]}),u.jsx("span",{className:"text-c4a-text-muted",children:"/"}),o?u.jsxs("a",{href:rj(o.repoUrl,s),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 hover:underline",children:[u.jsx(xd,{size:10,className:"shrink-0"}),u.jsx("span",{children:s})]}):u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(xd,{size:10,className:"shrink-0"}),u.jsx("span",{children:s})]}),u.jsx("span",{className:"text-c4a-text-muted",children:"/"}),o?u.jsx("a",{href:lj(o.repoUrl,i),target:"_blank",rel:"noopener noreferrer",className:"hover:underline",children:d}):u.jsx("span",{children:d})]})}function sj(n,r,s){const[i,o]=y.useState({}),d=y.useRef(new Set);return y.useEffect(()=>{if(!n||!r||s.length===0)return;const m=s.filter(p=>{const g=p.metadata;return g?.origin==="remote"&&g?.remote_url&&g?.remote_commit&&!d.current.has(p.id)});if(m.length!==0){m.forEach(p=>d.current.add(p.id));for(const p of m){const g=p.metadata;st.post("/import/remote/refs",{library_id:n,url:g.remote_url}).then(h=>{const v=g.remote_ref||"",b=h.branches?.find(S=>S.name===v)??h.tags?.find(S=>S.name===v);b&&b.commit!==g.remote_commit&&o(S=>({...S,[p.id]:!0}))}).catch(()=>{})}}},[n,r,s]),i}function ij({library:n,onNewFolder:r,onImportRepo:s,onImportDir:i,onUpgrade:o}){const{t:d}=je(),m=n.type==="daemon";return u.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:u.jsxs("div",{className:"max-w-2xl text-center",children:[u.jsx("h3",{className:"font-mono text-lg font-bold uppercase text-c4a-text-primary",children:d(m?"sources.empty.daemon.title":"sources.empty.cloud.title")}),u.jsx("p",{className:"mt-3 text-sm text-c4a-text-secondary",children:d(m?"sources.empty.daemon.description":"sources.empty.cloud.description")}),u.jsx("div",{className:"mt-6 flex justify-center gap-3",children:m?u.jsxs(u.Fragment,{children:[i&&u.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:d("sources.actions.import_dir")}),s&&u.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:d("sources.actions.import_repo")})]}):u.jsxs(u.Fragment,{children:[u.jsx("button",{onClick:r,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:d("sources.actions.new_folder")}),o&&u.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:d("sources.actions.import_repo_url")})]})})]})})}function oj(){const{t:n}=je();return u.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6 text-center",children:[u.jsx("h4",{className:"font-mono text-sm font-bold text-c4a-text-primary",children:n("sources.empty.indexed.title")}),u.jsx("p",{className:"mt-2 text-xs text-c4a-text-secondary",children:n("sources.empty.indexed.description")})]})}const nd=n=>{let r=0,s=0,i=0,o=0,d=0;const m=p=>{for(const g of p.children??[])g.kind==="folder"?(r++,m(g)):g.kind==="source"&&(s++,g.source_type==="code"?i++:o++,(g.index_status==="indexed"||g.index_status==="stale")&&d++)};return m(n),{folders:r,sources:s,codeSources:i,docSources:o,indexedSources:d}};function cj(){const{t:n}=je(),r=_a(),{libId:s}=Xs(),[i,o]=Ro(),d=i.get("rootId")||null,m=i.get("path")||"",g=$t(Br(Al)).find(K=>K.id===s),h=$t(K=>K.updateLibraryName),v=$t(K=>K.deleteLibrary),{rootSources:b,currentRoot:S,loading:j,filter:N,fetchRootSources:T,fetchRootSource:O,createSource:q,addTreeNode:X,updateSource:G,deleteSource:M,deleteTreeNode:Q,uploadDoc:te,setFilter:Z}=Oo(),[E,Y]=y.useState(!1),[W,de]=y.useState(null),[oe,le]=y.useState(null),[ue,ge]=y.useState(null),[A,P]=y.useState(null),[fe,me]=y.useState(!1),[re,w]=y.useState(!1),[$,ee]=y.useState(null),[ae,xe]=y.useState(!1),[ve,ke]=y.useState(!1),[Pe,Xe]=y.useState(null),[Wt,ma]=y.useState(!1);y.useEffect(()=>{s&&T({library_id:s})},[s,T]),y.useEffect(()=>{d&&O(d)},[d,O]);const Qe=d!==null,et=y.useMemo(()=>Qe?S?[...$2(S.tree,m)].sort((Oe,$e)=>Oe.kind!==$e.kind?Oe.kind==="folder"?-1:1:Oe.name.localeCompare($e.name)).map(Oe=>({type:"node",root:S,node:Oe})):[]:[...b].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,b,S,m]),ft=y.useMemo(()=>N==="all"?et:et.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),[et,N]),qt=g?.type==="daemon",Vt=g?.type==="cloud",ea=qt&&!Qe,ta=sj(s,Vt,b),Sa=y.useMemo(()=>{if(!g)return[];const K=[{label:g.is_default?n("sources.library.default_cloud_name"):g.name,to:`/studio/sources/${g.id}`}];return Qe&&S&&(K.push({label:S.name,to:`/studio/sources/${g.id}?rootId=${S.id}`}),m&&zs(S.tree,m).forEach(Oe=>{K.push({label:Oe.name,to:`/studio/sources/${g.id}?rootId=${S.id}&path=${encodeURIComponent(Oe.path)}`})})),K},[g,Qe,S,m,n]),ja=y.useCallback(async K=>{if(s)try{Qe&&d?await X(d,{parent_path:m,kind:"folder",name:K}):(await q({library_id:s,kind:"folder",name:K}),T({library_id:s})),Y(!1),de(null)}catch(se){se instanceof Dr&&se.status===409&&de(n("sources.error.name_conflict",{name:K}))}},[s,Qe,d,m,q,X,T,n]),Aa=y.useCallback(K=>{s&&(K.type==="root"?K.root.kind==="source"?r(`/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}):r(`/studio/source/${K.root.id}?path=${encodeURIComponent(K.node.path)}`)))},[s,r,o]),la=y.useCallback(()=>{if(!(!d||!s))if(m){const K=m.split("/");K.pop();const se=K.join("/");o(se?{rootId:d,path:se}:{rootId:d})}else o({})},[d,s,m,o]),sa=y.useCallback(async(K,se)=>{try{return await G(K,{name:se}),T({library_id:s}),null}catch(Oe){return Oe instanceof Dr&&Oe.status===409?n("sources.error.name_conflict",{name:se}):null}},[s,G,T,n]),pt=y.useCallback(K=>{if(K.type==="root"){ge(K.root.id),P(null);const se=K.root.tree.length>0?nd({children:K.root.tree}):void 0;le(qt?{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=nd(K.node);le({type:"folder",name:K.node.name,folderCount:se.folders,sourceCount:se.sources,indexedCount:se.indexedSources})}else le({type:"resource",name:K.node.name})},[qt,g]),ia=y.useCallback(async()=>{if(!(!ue||!s)){try{A?await Q(ue,A):(await M(ue),T({library_id:s}))}catch{}le(null),ge(null),P(null)}},[ue,A,s,M,Q,T]),_e=y.useCallback(()=>{if(!s)return;const K=new URLSearchParams;d&&(K.set("parentId",d),S&&K.set("parentName",S.name)),m&&K.set("parentPath",m);const se=K.toString();r(`/studio/sources/import/${s}${se?`?${se}`:""}`)},[s,r,d,m,S]),Ae=y.useCallback(()=>{s&&r(`/studio/sources/import-dir/${s}`)},[s,r]),Fe=y.useCallback(async K=>{if(s){xe(!0),ee(null);try{const se={library_id:s,files:K.map(Oe=>{const $e={file_name:Oe.name,content:Oe.content};return Oe.encoding&&($e.encoding=Oe.encoding),$e})};Qe&&d&&(se.root_source_id=d,se.parent_path=m),await te(se),Qe&&d?O(d):T({library_id:s}),w(!1)}catch(se){se instanceof Dr&&se.status===409?ee(n("sources.error.name_conflict",{name:K[0]?.name??""})):se instanceof Dr&&ee(se.message)}finally{xe(!1)}}},[s,Qe,d,m,te,T,O,n]),gt=g?.is_default===!0,Nt=y.useCallback(async K=>{if(s)try{await h(s,K),ke(!1),Xe(null)}catch(se){const Oe=se instanceof Error?se.message:String(se);Xe(Oe)}},[s,h]),Qt=y.useCallback(()=>{ke(!1),Xe(null)},[]),Pa=y.useCallback(async()=>{if(s){try{await v(s),r("/studio/sources/add-client")}catch{}ma(!1)}},[s,v,r]),Ft=y.useCallback(()=>{ma(!1)},[]);if(!g)return u.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:u.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})});const Tt=b.length===0&&N==="all"&&!j&&!Qe,xt=ft.filter(K=>K.type==="node"&&K.node?.kind==="source").length===0&&N==="indexed"&&!j,Dt=!Qe||!S?!1:S.metadata?.origin==="remote"?!0:m?zs(S.tree,m).some(se=>se.metadata?.origin==="remote"):!1,Ce=!ea,Le=Vt&&!Dt,lt=ea;return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx("div",{className:"min-w-0 flex-1",children:ve?u.jsx(fy,{currentName:g.name,onConfirm:Nt,onCancel:Qt,error:Pe}):u.jsx(Ml,{segments:Sa})}),u.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[Le&&u.jsxs(u.Fragment,{children:[u.jsx(ad,{label:n("sources.actions.upload"),icon:u.jsx(vd,{size:14}),items:[{label:n("sources.actions.upload_doc"),icon:u.jsx(dr,{size:14}),onClick:()=>w(!0)}]}),u.jsx(ad,{label:n("sources.actions.add"),icon:u.jsx(Wx,{size:14}),items:[{label:n("sources.actions.add_folder"),icon:u.jsx(Ix,{size:14}),onClick:()=>Y(!0)},{label:n("sources.actions.add_web"),icon:u.jsx(rS,{size:14}),onClick:()=>me(!0)},{label:n("sources.actions.add_feishu"),icon:u.jsx(q_,{size:14}),onClick:()=>me(!0)}]}),u.jsxs("button",{onClick:()=>{const K=new URLSearchParams;d&&(K.set("parentId",d),S&&K.set("parentName",S.name)),m&&K.set("parentPath",m);const se=K.toString();r(`/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:[u.jsx(zg,{size:14}),u.jsx("span",{className:"hidden sm:inline",children:n("sources.actions.import_repo_url")})]})]}),lt&&u.jsxs(u.Fragment,{children:[u.jsxs("button",{onClick:Ae,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:[u.jsx(F_,{size:14}),u.jsx("span",{className:"hidden sm:inline",children:n("sources.actions.import_dir")})]}),u.jsxs("button",{onClick:_e,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:[u.jsx(zg,{size:14}),u.jsx("span",{className:"hidden sm:inline",children:n("sources.actions.import_repo")})]}),u.jsx(ad,{label:"",icon:u.jsx(yd,{size:14}),alignRight:!0,items:[{label:n("sources.library.rename"),icon:u.jsx(yd,{size:14}),onClick:()=>ke(!0)},...gt?[]:[{label:n("sources.actions.delete"),icon:u.jsx(Ud,{size:14}),onClick:()=>ma(!0)}]]})]}),Ce&&u.jsx(Y2,{value:N,onChange:Z})]})]}),Tt?u.jsx(ij,{library:g,onNewFolder:()=>Y(!0),...qt?{onImportRepo:_e,onImportDir:Ae}:{},...Vt?{onUpgrade:()=>{const K=new URLSearchParams;d&&(K.set("parentId",d),S&&K.set("parentName",S.name)),m&&K.set("parentPath",m);const se=K.toString();r(`/studio/sources/import-remote/${s}${se?`?${se}`:""}`)}}:{}}):u.jsx(aj,{pathLabel:(()=>{if(!Qe||!S)return"/";const K=S.metadata,se=qt?typeof K?.local_path=="string"?K.local_path:S.name:"/"+S.name;if(!m)return se;const Oe=zs(S.tree,m);return se+"/"+Oe.map($e=>$e.name).join("/")})(),loading:j,badge:(()=>{if(!Qe||!S)return;let K=S.metadata,se=S.name;if(!K?.origin&&m){const Ue=zs(S.tree,m);for(const At of Ue){const oa=At.metadata;if(oa?.origin==="remote"){K=oa,se=At.name;break}}}const Oe=K?.pinned_branch??K?.remote_ref,$e=K?.pinned_hash??K?.remote_commit;if(!(!Oe||!$e))return u.jsx(my,{remoteUrl:K?.remote_url,fallbackName:se,branch:Oe,commit:$e})})(),onNavigateUp:Qe?la:void 0,children:ft.length===0?xt?u.jsx(oj,{}):Qe?null:u.jsx("p",{className:"py-8 text-center text-xs text-c4a-text-muted",children:n("common.items",{count:0})}):u.jsx("div",{className:"flex flex-col gap-0.5",children:ft.map(K=>{if(K.type==="root"){const Ue=K.root,At=qt,oa=At?Ue.metadata?.local_path:void 0,ca=Ue.tree.length>0?nd({children:Ue.tree}):void 0,Ma=ca?ca.folders+ca.sources:0,Na=Ue.metadata,fr=Na?.origin==="remote",$r=Na?.import_type==="directory",qr=fr||At&&!$r;return u.jsx(Pg,{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:Ma}:{},isDaemonLibrary:qt??!1,isRepoRoot:qr,...ta[Ue.id]?{hasUpdate:!0}:{},onClick:()=>Aa(K),...fr?{}:{onRename:C=>sa(Ue.id,C)},onDelete:()=>pt(K)},Ue.id)}const se=K.node,Oe=`${K.root.id}:${se.path}`,$e=se.kind==="folder"?se.children?.length??0:void 0;return u.jsx(Pg,{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:qt??!1,onClick:()=>Aa(K),...Vt&&K.root.metadata?.origin!=="remote"?{onDelete:()=>pt(K)}:{}},Oe)})})}),E&&u.jsx(I2,{onConfirm:ja,onCancel:()=>{Y(!1),de(null)},error:W}),re&&u.jsx(tj,{onConfirm:Fe,onCancel:()=>{w(!1),ee(null)},error:$,uploading:ae}),fe&&u.jsx(W2,{onClose:()=>me(!1)}),oe&&u.jsx(Ig,{target:oe,onConfirm:ia,onCancel:()=>{le(null),ge(null),P(null)}}),Wt&&g&&u.jsx(Ig,{target:{type:"client",name:g.name},onConfirm:Pa,onCancel:Ft})]})}function uj(){const{t:n}=je(),r=_a(),s=$t(m=>m.libraries),i=$t(m=>m.loading),[o,d]=y.useState(!1);return y.useEffect(()=>{if(i)return;if(s.length===0&&!o){d(!0),$t.getState().fetchLibraries();return}const m=s.find(p=>p.is_default);m?r(`/studio/sources/${m.id}`,{replace:!0}):s.length>0&&r(`/studio/sources/${s[0].id}`,{replace:!0})},[s,i,r,o]),o&&!i&&s.length===0?u.jsx("div",{className:"flex flex-1 items-center justify-center",children:u.jsx(dy,{icon:u.jsx(Jx,{size:32}),title:n("sources.empty.cloud.title"),description:n("sources.empty.cloud.description")})}):u.jsx("div",{className:"flex flex-1 items-center justify-center",children:u.jsx(Hd,{})})}function hn({active:n,current:r}){return u.jsx("span",{className:`inline-block h-2.5 w-2.5 rounded-full border-2 ${r?"border-c4a-accent bg-c4a-accent":n?"border-c4a-accent bg-transparent":"border-c4a-border-default bg-transparent"}`})}function Ar(){return u.jsx("span",{className:"h-px flex-1 bg-c4a-border-default"})}function hy({libraryName:n}){const{t:r}=je();return u.jsxs("div",{className:"rounded border border-c4a-warning/30 bg-c4a-bg-surface p-6 text-center",children:[u.jsx("p",{className:"text-sm text-c4a-warning",children:r("sources.import.daemon_offline",{name:n})}),u.jsx(Fa,{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:r("sources.import.view_guide")})]})}function Bd({step:n,totalSteps:r,importing:s,stepBusy:i,canProceed:o,safetyNoticeKey:d,confirmLabelKey:m,onPrev:p,onNext:g,onImport:h}){const{t:v}=je();return u.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-4 sm:mt-6",children:[u.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(d),onClick:b=>b.currentTarget.classList.toggle("line-clamp-1"),children:v(d)}),u.jsxs("div",{className:"flex shrink-0 gap-2",children:[n>1&&u.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<r?u.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")}):u.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&&u.jsx(va,{size:12,className:"animate-spin"}),v(s?"sources.import.importing":m)]})]})]})}function py(n,r){const s=y.useCallback(async(m,p)=>{if(!n)throw new Error("No library");const g=await st.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]=y.useState([]);y.useEffect(()=>{if(!n)return;let m=!1;return(async()=>{try{const p=await st.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 d=y.useMemo(()=>{const m=r?.config;return!m||!Array.isArray(m.allowed_paths)?[]:m.allowed_paths},[r]);return{rpc:s,importedPaths:i,allowedPaths:d}}function dj(n,r){const s=n.toLowerCase();try{if(s.endsWith("package.json")){const i=JSON.parse(r);if(typeof i.name=="string"&&i.name.trim())return i.name.trim()}if(s.endsWith("pyproject.toml"))return r.match(/^\s*name\s*=\s*["']([^"']+)["']/m)?.[1]??null;if(s.endsWith("go.mod"))return r.match(/^\s*module\s+([^\s]+)\s*$/m)?.[1]??null;if(s.endsWith("cargo.toml"))return r.match(/^\s*name\s*=\s*["']([^"']+)["']/m)?.[1]??null;if(s.endsWith("pom.xml"))return r.match(/<artifactId>([^<]+)<\/artifactId>/)?.[1]?.trim()??null;if(s.endsWith("build.gradle"))return r.match(/rootProject\.name\s*=\s*["']([^"']+)["']/)?.[1]??null}catch{return null}return null}function gy(n,r,s="repo"){const i=[];for(const d of n){const m=d.path.split("/"),p=m.slice(0,-1).join("/")||".",g=m.length===1||d.path==="package.json",h=p==="."?s:m[m.length-2]||p,v=dj(d.path,d.content);i.push({name:v||h,path:p,isRoot:g})}const o=r.filter(d=>/\.md$/i.test(d.path)).map(d=>d.path);return{packages:i,mdFiles:o}}const Wg=new Set(["tree","blob","commit","commits","raw","src"]),fj=new Set(["commit","commits"]);function mj(n){let r;try{r=new URL(n.trim())}catch{return{repoUrl:n.trim()}}const s=r.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&&Wg.has(s[h+1])){i=h;break}if(Wg.has(v)){i=h;break}}if(i===-1)return{repoUrl:`${r.protocol}//${r.host}${r.pathname}`.replace(/\/+$/,"")};const o=s.slice(0,i).join("/"),d=`${r.protocol}//${r.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:d};const g=s[p];return fj.has(m)?{repoUrl:d,commit:g}:{repoUrl:d,ref:g}}function cr(n){try{return(new URL(n).pathname.split("/").pop()??"repo").replace(/\.git$/i,"")||"repo"}catch{return n.split("/").pop()||n}}function wd(){const n=new Date;return`${String(n.getHours()).padStart(2,"0")}:${String(n.getMinutes()).padStart(2,"0")}:${String(n.getSeconds()).padStart(2,"0")}`}const hj=1500;async function xy(n){const r=hj-(Date.now()-n);r>0&&await new Promise(s=>setTimeout(s,r))}function yy(){const{t:n}=je(),[r,s]=y.useState(!1),[i,o]=y.useState(null),d=y.useRef(),m=y.useRef(),p=window.location.host,g=`c4a-daemon --server ${p} --allow <dir1> <dir2>`,h=`c4a-daemon --server ${p}`,v=y.useCallback((j,N)=>{navigator.clipboard.writeText(j),o(N),clearTimeout(d.current),d.current=setTimeout(()=>o(null),1500)},[]),b=y.useCallback(()=>{clearTimeout(m.current),s(!0)},[]),S=y.useCallback(()=>{m.current=setTimeout(()=>s(!1),150)},[]);return u.jsxs("span",{className:"relative",onMouseEnter:b,onMouseLeave:S,children:[u.jsx(Zx,{size:12,className:"text-c4a-warning"}),r&&u.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:b,onMouseLeave:S,children:[u.jsx("span",{className:"block whitespace-nowrap font-mono text-xs text-c4a-text-secondary",children:n("sources.import.allowed_dirs_tooltip_restrict")}),u.jsxs("span",{className:"mt-1 flex items-center gap-1.5 whitespace-nowrap",children:[u.jsx("span",{className:"font-mono text-xs text-c4a-accent",children:g}),u.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?u.jsx(Lr,{size:10}):u.jsx(gd,{size:10})})]}),u.jsx("span",{className:"mt-2 block whitespace-nowrap font-mono text-xs text-c4a-text-secondary",children:n("sources.import.allowed_dirs_tooltip_all")}),u.jsxs("span",{className:"mt-1 flex items-center gap-1.5 whitespace-nowrap",children:[u.jsx("span",{className:"font-mono text-xs text-c4a-accent",children:h}),u.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?u.jsx(Lr,{size:10}):u.jsx(gd,{size:10})})]})]})]})}function by({open:n,onClose:r,rpc:s,onNavigate:i,defaultPath:o}){const{t:d}=je(),[m,p]=y.useState(o??""),[g,h]=y.useState(null),[v,b]=y.useState(!1),S=y.useRef(null);y.useEffect(()=>{o&&!m&&p(o)},[o]);const j=y.useCallback(async()=>{const T=m.trim();if(T){b(!0),h(null);try{(await s("fs/exists",{path:T})).exists?(i(T),p(o??""),h(null),r()):h(d("sources.import.wildcard_path_not_found"))}catch(O){h(O instanceof Error?O.message:String(O))}finally{b(!1)}}},[m,s,d,i,r]),N=y.useCallback(()=>{p(o??""),h(null),r()},[r,o]);return n?u.jsxs(Ln,{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:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("h3",{className:"font-mono text-sm font-medium text-c4a-text-primary",children:d("sources.import.wildcard_go_title")}),u.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:u.jsx(Hr,{size:14})})]}),u.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[u.jsx("input",{ref:S,type:"text",value:m,onChange:T=>{p(T.target.value),h(null)},onKeyDown:T=>{T.key==="Enter"&&j()},placeholder:d("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"}),u.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?u.jsx(va,{size:12,className:"animate-spin"}):u.jsx(Fx,{size:12}),d("sources.import.wildcard_go")]})]}),g&&u.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:g})]}):null}function vy({rpc:n,allowedPaths:r,importedPaths:s,onNavigateUpExtra:i}){const o=!!r&&r.length>0,d=o&&r.length===1&&r[0]==="*",[m,p]=y.useState(o),[g,h]=y.useState(o&&!d?"":"/"),[v,b]=y.useState([]),[S,j]=y.useState(!1),[N,T]=y.useState(null),[O,q]=y.useState(null);y.useEffect(()=>{if(o&&!d)return;let Y=!1;return(async()=>{try{const W=await n("fs/homeDir",{});Y||q(W.home_dir)}catch{Y||q("/")}})(),()=>{Y=!0}},[o,d,n]);const[X,G]=y.useState(!1),M=y.useCallback(async Y=>{j(!0),T(null);try{const W=await n("fs/listTree",{path:Y,depth:1});b(W.entries||[]),h(Y),p(!1)}catch(W){const de=W instanceof Error?W.message:String(W);T(de)}finally{j(!1)}},[n]);y.useEffect(()=>{o&&!d||O!==null&&M(O)},[O,o,d,M]);const Q=y.useMemo(()=>new Set(s??[]),[s]),te=y.useCallback(()=>{if(o&&!d&&r.some(de=>de===g)){p(!0),h(""),b([]),T(null),i?.();return}const Y=g.split("/").slice(0,-1).join("/")||"/";i?.(),M(Y)},[o,d,r,g,M,i]),Z=y.useMemo(()=>v.filter(Y=>Y.type==="directory"),[v]),E=y.useMemo(()=>v.filter(Y=>Y.type==="file"),[v]);return{atRoot:m,currentPath:g,entries:v,loading:S,error:N,homeDir:O,goToOpen:X,hasAllowedPaths:o,isWildcard:d,importedSet:Q,dirs:Z,files:E,loadTree:M,handleNavigateUp:te,setGoToOpen:G}}function pj({rpc:n,selectedPath:r,onSelect:s,allowedPaths:i,importedPaths:o}){const{t:d}=je(),[m,p]=y.useState(null),{atRoot:g,currentPath:h,entries:v,loading:b,error:S,homeDir:j,goToOpen:N,isWildcard:T,importedSet:O,dirs:q,files:X,loadTree:G,handleNavigateUp:M,setGoToOpen:Q}=vy({rpc:n,allowedPaths:i??[],importedPaths:o??[],onNavigateUpExtra:()=>p(null)}),[te,Z]=y.useState(null),[E,Y]=y.useState(!1);y.useEffect(()=>{if(!r){Z(null),Y(!1);return}Z(null),Y(!0);let le=!1;return(async()=>{try{const ue=await n("fs/repoStatus",{path:r});le||(Z({branch:ue.branch,hash:ue.head_hash,remoteUrl:ue.remote_url}),Y(!1))}catch{le||(Z(null),Y(!1))}})(),()=>{le=!0}},[r,n]);const W=y.useCallback(le=>{if(le.type==="directory")if(le.is_git_repo){if(O.has(le.path))return;p(null),s(le.path,le.name)}else p(le.path),G(le.path)},[s,G,O]),de=y.useMemo(()=>q.sort((le,ue)=>le.is_git_repo&&!ue.is_git_repo?-1:!le.is_git_repo&&ue.is_git_repo?1:le.name.localeCompare(ue.name)),[q]),oe=y.useMemo(()=>X.sort((le,ue)=>le.name.localeCompare(ue.name)),[X]);return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1",children:[g?u.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[u.jsx("span",{children:d("sources.import.allowed_dirs")}),u.jsx(yy,{})]}):u.jsx("p",{className:"min-w-0 shrink truncate font-mono text-xs text-c4a-text-muted",children:h}),r&&E?u.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 font-mono text-xs text-c4a-accent",children:[u.jsx(va,{size:12,className:"animate-spin"}),u.jsx("span",{children:d("common.loading")})]}):r&&te?u.jsx(my,{remoteUrl:te.remoteUrl,fallbackName:r.split("/").pop()||r,branch:te.branch,commit:te.hash}):!r&&T&&g?u.jsx("button",{onClick:()=>Q(!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:d("sources.import.wildcard_goto")}):null]}),u.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),g?T?u.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:j&&u.jsxs("button",{onClick:()=>G(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:[u.jsx(Xa,{size:14,className:"shrink-0"}),u.jsxs("span",{className:"truncate",children:[j,u.jsxs("span",{className:"ml-1.5 text-c4a-text-muted",children:["(",d("sources.import.wildcard_home"),")"]})]}),u.jsx(da,{size:12,className:"shrink-0 text-c4a-text-muted"})]})}):u.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:i.map(le=>u.jsxs("button",{onClick:()=>G(le),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:[u.jsx(Xa,{size:14,className:"shrink-0"}),u.jsx("span",{className:"truncate",children:le}),u.jsx(da,{size:12,className:"shrink-0 text-c4a-text-muted"})]},le))}):S&&!b?u.jsx("p",{className:"py-4 text-xs text-c4a-error",children:S}):u.jsxs("div",{className:"relative min-h-[5rem] min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:[b&&u.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-c4a-bg-surface/60",children:u.jsx(va,{size:14,className:"animate-spin text-c4a-text-muted"})}),h!=="/"&&u.jsxs("button",{onClick:M,disabled:b,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:[u.jsx(Xa,{size:14}),u.jsx("span",{children:".."})]}),de.map(le=>{const ue=le.is_git_repo&&O.has(le.path),ge=le.is_git_repo?To:Xa;return u.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":r===le.path?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-accent/10 hover:text-c4a-accent"}`,children:[u.jsxs("button",{onClick:()=>W(le),disabled:ue||b,className:"flex flex-1 items-center gap-2 px-2 py-1.5",children:[u.jsx(ge,{size:14,className:"shrink-0"}),u.jsx("span",{className:"flex-1 truncate text-left",children:le.name}),ue&&u.jsx("span",{className:"rounded bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] text-c4a-accent/60",children:d("sources.import.already_imported")})]}),!ue&&u.jsx("button",{onClick:A=>{A.stopPropagation(),G(le.path)},disabled:b,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:le.path,children:u.jsx(da,{size:12})})]},le.path)}),oe.map(le=>u.jsxs("div",{className:"flex w-full items-center gap-2 pl-2 pr-4 py-1.5 text-sm text-c4a-text-muted",children:[u.jsx(Px,{size:14,className:"shrink-0"}),u.jsx("span",{className:"truncate",children:le.name})]},le.path)),v.length===0&&!b&&u.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:d("sources.import.no_entries")})]}),m&&!r&&u.jsx("p",{className:"mt-3 text-xs text-c4a-warning",children:d("sources.import.not_git")}),u.jsx(by,{open:N,onClose:()=>Q(!1),rpc:n,onNavigate:G,defaultPath:j??void 0})]})}const El=50,rd=["main","master"];function gj(n){const r=[],s=[];for(const i of n)rd.includes(i.name)?r.push(i):s.push(i);return r.sort((i,o)=>rd.indexOf(i.name)-rd.indexOf(o.name)),[...r,...s]}function ex(n,r,s){y.useEffect(()=>{if(!s)return;const i=o=>{n.current&&!n.current.contains(o.target)&&r()};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n,r,s])}function _y({refs:n,loading:r,error:s,selectedRef:i,commit:o,onRefChange:d,onCommitChange:m,onValidChange:p,onBranchSwitch:g}){const{t:h}=je(),[v,b]=y.useState(!1),[S,j]=y.useState(""),[N,T]=y.useState(!0),[O,q]=y.useState(!0),X=y.useRef(null),G=y.useRef(null),[M,Q]=y.useState(!1),[te,Z]=y.useState(""),E=y.useRef(null),Y=y.useRef(null);ex(X,()=>{b(!1),j("")},v),ex(E,()=>{Q(!1),Z("")},M),y.useEffect(()=>{v&&setTimeout(()=>G.current?.focus(),0)},[v]),y.useEffect(()=>{M&&setTimeout(()=>Y.current?.focus(),0)},[M]),y.useEffect(()=>{p(!!i)},[i,p]);const W=y.useCallback(re=>{d(re.name),m(re.commit),b(!1),j(""),g?.(re.name)},[d,m,g]),de=y.useCallback((re,w)=>{m(re),d(w),Q(!1),Z("")},[m,d]),oe=y.useMemo(()=>n?gj(n.branches):[],[n]),le=y.useMemo(()=>{const re=S.toLowerCase();return(re?oe.filter($=>$.name.toLowerCase().includes(re)):oe).slice(0,El)},[oe,S]),ue=y.useMemo(()=>{if(!n)return[];const re=S.toLowerCase();return(re?n.tags.filter($=>$.name.toLowerCase().includes(re)):n.tags).slice(0,El)},[n,S]),ge=y.useMemo(()=>{if(!n)return[];if(n.commits&&n.commits.length>0){const ae=te.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,El):xe.slice(0,El)}const re=new Set,w=[],$=[...n.branches??[],...n.tags??[]];for(const ae of $){const xe=ae.commit.slice(0,8);re.has(ae.commit)||(re.add(ae.commit),w.push({hash:ae.commit,refName:ae.name,label:`${xe} (${ae.name})`}))}if(!te)return w.slice(0,El);const ee=te.toLowerCase();return w.filter(ae=>ae.hash.toLowerCase().includes(ee)||ae.label.toLowerCase().includes(ee)).slice(0,El)},[n,te,i]),[A,P]=y.useState(!1);if(y.useEffect(()=>{if(!r){P(!1);return}const re=setTimeout(()=>P(!0),5e3);return()=>clearTimeout(re)},[r]),r)return u.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:[u.jsx(va,{size:20,className:"animate-spin text-c4a-accent"}),u.jsx("span",{className:"mt-2 text-sm text-c4a-accent",children:h("sources.import_remote.loading_refs")}),A&&u.jsx("span",{className:"mt-1.5 text-xs text-c4a-text-muted",children:h("sources.import_remote.loading_refs_slow")})]});if(s)return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[u.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-sm font-medium text-red-400",children:[u.jsx(Hr,{size:14,className:"shrink-0"}),h("sources.import.error_title")]}),u.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(re=>re.name===i)?.name??n.tags.find(re=>re.name===i)?.name??i,me=o?o.slice(0,8):"";return u.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:[u.jsxs("div",{children:[u.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:h("sources.import_remote.ref_label")}),u.jsxs("div",{ref:X,className:"relative mt-2",children:[u.jsxs("button",{onClick:()=>b(!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:[u.jsx("span",{children:fe||"—"}),u.jsx(da,{size:14,className:`text-c4a-text-muted transition-transform duration-200 ${v?"rotate-90":""}`})]}),v&&u.jsxs("div",{className:"absolute z-20 mt-1 w-full rounded border border-c4a-border-default bg-c4a-bg-elevated shadow-lg",children:[u.jsx("div",{className:"border-b border-c4a-border-default px-3 py-2.5",children:u.jsxs("div",{className:"flex items-center gap-2 rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-1.5",children:[u.jsx(bd,{size:14,className:"shrink-0 text-c4a-text-muted"}),u.jsx("input",{ref:G,type:"text",value:S,onChange:re=>j(re.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"})]})}),u.jsxs("div",{className:"flex max-h-80 flex-col md:flex-row",children:[le.length>0&&u.jsxs("div",{className:"c4a-scrollbar min-w-0 flex-1 overflow-y-auto md:border-r md:border-c4a-border-default",children:[u.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:[u.jsx(da,{size:12,className:`transition-transform duration-200 ${N?"rotate-90":""}`}),h("sources.import_remote.ref_branches")," (",n.branches.length,")"]}),N&&le.map(re=>u.jsxs("button",{onClick:()=>W(re),className:`flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm transition-colors hover:bg-c4a-bg-hover ${re.name===i?"font-semibold text-c4a-accent":"text-c4a-text-secondary"}`,children:[u.jsx("span",{className:"truncate",children:re.name}),re.name===i&&u.jsx("span",{children:"✓"})]},`b-${re.name}`))]}),ue.length>0&&u.jsxs("div",{className:"c4a-scrollbar min-w-0 flex-1 overflow-y-auto border-t border-c4a-border-default md:border-t-0",children:[u.jsxs("button",{onClick:()=>q(!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:[u.jsx(da,{size:12,className:`transition-transform duration-200 ${O?"rotate-90":""}`}),h("sources.import_remote.ref_tags")," (",n.tags.length,")"]}),O&&ue.map(re=>u.jsxs("button",{onClick:()=>W(re),className:`flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm transition-colors hover:bg-c4a-bg-hover ${re.name===i?"font-semibold text-c4a-accent":"text-c4a-text-secondary"}`,children:[u.jsx("span",{className:"truncate",children:re.name}),re.name===i&&u.jsx("span",{children:"✓"})]},`t-${re.name}`))]})]}),le.length===0&&ue.length===0&&u.jsx("div",{className:"px-3 py-4 text-center font-mono text-sm text-c4a-text-muted",children:"No matches"})]})]})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:h("sources.import_remote.commit_label")}),u.jsxs("div",{ref:E,className:"relative mt-2",children:[u.jsxs("button",{onClick:()=>Q(!M),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:[u.jsx("span",{className:o?"":"font-normal text-c4a-text-muted",children:me||"—"}),u.jsx(da,{size:14,className:`text-c4a-text-muted transition-transform duration-200 ${M?"rotate-90":""}`})]}),M&&u.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:[u.jsx("div",{className:"sticky top-0 z-10 border-b border-c4a-border-default bg-c4a-bg-elevated px-3 py-2",children:u.jsxs("div",{className:"flex items-center gap-2 rounded border border-c4a-border-default bg-c4a-bg-surface px-2 py-1",children:[u.jsx(bd,{size:12,className:"shrink-0 text-c4a-text-muted"}),u.jsx("input",{ref:Y,type:"text",value:te,onChange:re=>Z(re.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(re=>u.jsxs("button",{onClick:()=>de(re.hash,re.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:[u.jsx("span",{className:"truncate",children:re.label}),re.hash===o&&u.jsx("span",{className:"text-c4a-accent",children:"✓"})]},re.hash)),ge.length===0&&u.jsx("div",{className:"px-3 py-4 text-center font-mono text-xs text-c4a-text-muted",children:"No matches"})]})]}),u.jsxs("p",{className:"mt-3 flex items-center gap-1.5 text-xs text-c4a-text-muted",children:[u.jsx(sS,{size:12,className:"shrink-0"}),h("sources.import_remote.commit_hint")]})]})]})}const xj="_progressTrack_4p57j_1",yj="_progressFill_4p57j_9",bj="_progressFillFailed_4p57j_45",vj="_indeterminate_4p57j_53",fo={progressTrack:xj,progressFill:yj,progressFillFailed:bj,indeterminate:vj};function _j(n){const r={},s=100/n.length;return n.forEach((i,o)=>{r[i.key]=Math.round(s*(o+1))}),r}function Sj(n,r,s,i,o,d){const m=v=>v>0?r[n[v-1].key]??0:0;if(o){const v=n.findIndex(j=>j.key===o),b=m(v),S=r[o]??100;return b+d/100*(S-b)}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=r[s]??100;return d>=0?g+d/100*(h-g):g}function jj({stages:n,currentStage:r,completedStages:s,failedStage:i,progress:o,breakpoints:d}){const m=d??_j(n),p=o?.percent??-1,g=y.useRef(0),[h,v]=y.useState(0),b=y.useRef(null),S=Sj(n,m,r,s,i,p>=0?p:-1);g.current=S,y.useEffect(()=>{S>h&&v(S)},[S]),y.useEffect(()=>{if(!r||i){b.current&&(clearInterval(b.current),b.current=null);return}const X=n.findIndex(Z=>Z.key===r),G=m[r]??100,M=X===n.length-1?G-1:G-2,Q=500,te=.025;return b.current=setInterval(()=>{v(Z=>{const E=g.current;if(Z>=E&&Z<M){const Y=Math.max(.1,(M-Z)*te);return Math.min(Z+Y,M)}return Z})},Q),()=>{b.current&&(clearInterval(b.current),b.current=null)}},[r,i,n,m]);const j=y.useRef(null);y.useEffect(()=>{if(s.length===n.length&&!i)return b.current&&(clearInterval(b.current),b.current=null),j.current=setInterval(()=>{v(X=>X>=100?(j.current&&clearInterval(j.current),j.current=null,100):Math.min(100,X+4))},32),()=>{j.current&&(clearInterval(j.current),j.current=null)}},[s.length,n.length,i]);const N=Math.min(100,Math.max(0,h)),T=!!r&&!i,O=!!i,q=s.length===n.length&&!i;return u.jsxs("div",{className:"space-y-3",children:[u.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:n.map(X=>{const G=s.includes(X.key),M=i===X.key,Q=r===X.key;let te="inline-flex items-center gap-1.5 rounded-sm px-2 py-0.5 font-mono text-[11px] uppercase tracking-tight transition-colors";return M?te+=" bg-red-500/10 text-red-400":G?te+=" bg-c4a-accent/10 text-c4a-accent":Q?te+=" bg-c4a-accent/15 text-c4a-accent":te+=" bg-c4a-bg-elevated text-c4a-text-muted",u.jsxs("span",{className:te,children:[M?u.jsx(Hr,{size:10,className:"shrink-0"}):G?u.jsx(Lr,{size:10,className:"shrink-0"}):Q?u.jsx(va,{size:10,className:"shrink-0 animate-spin"}):u.jsx(M_,{size:8,className:"shrink-0 opacity-40"}),X.label]},X.key)})}),u.jsx("div",{className:fo.progressTrack,children:N>0?u.jsx("div",{className:`${fo.progressFill} ${O?fo.progressFillFailed:""}`,style:{width:`${N}%`}},"fill"):T?u.jsx("div",{className:fo.indeterminate,style:{width:"100%",height:"100%"}},"pulse"):null}),u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"font-mono text-[11px] text-c4a-text-muted tabular-nums",children:q?"100%":T||O?`${Math.round(N)}%`:""}),o?.label&&T&&u.jsx("span",{className:"max-w-[320px] truncate font-mono text-[11px] text-c4a-text-muted",children:o.label})]})]})}function Sy({stages:n,currentStage:r,completedStages:s,failedStage:i,progress:o,breakpoints:d,failedError:m,logs:p}){const g=y.useRef(null);return y.useEffect(()=>{g.current?.scrollIntoView({behavior:"smooth"})},[p.length]),u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[u.jsx(jj,{stages:n,currentStage:r,completedStages:s,failedStage:i,progress:o,...d?{breakpoints:d}:{}}),u.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)=>u.jsx("p",{className:"font-mono text-xs text-c4a-text-muted leading-relaxed",children:h},v)),u.jsx("div",{ref:g})]}),i&&m&&u.jsx("div",{className:"mt-3 max-h-32 overflow-y-auto rounded-sm bg-red-500/5 px-4 py-3",children:u.jsx("p",{className:"break-all font-mono text-xs leading-relaxed text-red-400/80",children:m})})]})}function An({icon:n,label:r,value:s,tooltip:i,size:o="sm"}){const d=o==="sm";return u.jsxs("div",{className:"group/stat relative rounded border border-c4a-border-subtle bg-c4a-bg-base p-3",children:[u.jsxs("div",{className:"flex items-center gap-1.5 text-c4a-text-muted [&>svg]:size-4",children:[n,u.jsx("span",{className:"font-mono text-xs uppercase",children:r})]}),u.jsx("p",{className:`mt-1 font-mono font-bold text-c4a-text-secondary ${d?"text-sm truncate":"text-lg"}`,title:d?String(s):void 0,children:s}),i&&u.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 ld=100;function jy({repoName:n,repoIdentifier:r,branch:s,commit:i,packages:o,mdFiles:d,importing:m,completed:p}){const{t:g}=je(),h=i?i.slice(0,7):"",[v,b]=y.useState("packages"),[S,j]=y.useState(ld),N=y.useRef(null),T=y.useRef(null);y.useEffect(()=>{j(ld),T.current?.scrollTo(0,0)},[v]),y.useEffect(()=>{const M=N.current;if(!M)return;const Q=v==="packages"?o.length:d.length;if(S>=Q)return;const te=new IntersectionObserver(Z=>{Z[0]?.isIntersecting&&j(E=>Math.min(E+ld,Q))},{root:T.current,threshold:.1});return te.observe(M),()=>te.disconnect()},[v,S,o.length,d.length]);const O=v==="packages"?o:d,q=O.slice(0,S),X=S<O.length,G=y.useMemo(()=>p?g("sources.import_remote.complete"):m?g("sources.import.importing"):g("sources.import.confirm_heading",{name:n}),[p,m,n,g]);return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6",children:[u.jsx("p",{className:"text-sm text-c4a-text-secondary",children:G}),u.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-3 gap-y-1",children:[u.jsx("span",{className:"font-mono text-sm font-bold text-c4a-accent",children:n}),u.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:r})]}),u.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-3 sm:grid-cols-4",children:[u.jsx(An,{icon:u.jsx(xd,{size:14}),label:g("sources.import.branch"),value:s}),u.jsx(An,{icon:u.jsx(tS,{size:14}),label:g("sources.import.commit"),value:h}),u.jsx(An,{icon:u.jsx(Ol,{size:14}),label:g("sources.import.packages"),value:String(o.length),tooltip:g("sources.import.dir_code_packages_tip")}),u.jsx(An,{icon:u.jsx(dr,{size:14}),label:g("sources.import.documents"),value:String(d.length),tooltip:g("sources.import.dir_doc_files_tip")})]}),m&&u.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-3",children:[u.jsx(va,{size:14,className:"animate-spin text-c4a-accent"}),u.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:g("sources.import.importing")})]}),(o.length>0||d.length>0)&&u.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-base",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between px-4 py-3",children:[u.jsx("p",{className:"hidden font-mono text-xs text-c4a-text-secondary sm:block",children:g("sources.import.recognized",{packages:o.length,docs:d.length})}),u.jsxs("div",{className:"flex rounded border border-c4a-border-subtle",children:[u.jsxs("button",{onClick:()=>b("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:[u.jsx(Ol,{size:13}),u.jsx("span",{className:"font-mono",children:o.length})]}),u.jsxs("button",{onClick:()=>b("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:[u.jsx(dr,{size:13}),u.jsx("span",{className:"font-mono",children:d.length})]})]})]}),u.jsx("hr",{className:"border-c4a-border-subtle"}),u.jsx("div",{ref:T,className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto px-2 py-1",children:O.length===0?u.jsx("p",{className:"py-8 text-center text-xs text-c4a-text-muted",children:v==="packages"?g("sources.import.no_packages"):"—"}):u.jsxs(u.Fragment,{children:[v==="packages"?q.map(M=>u.jsxs("div",{className:"flex items-center gap-2 rounded pl-2 pr-4 py-1 text-xs",children:[u.jsx(Ol,{size:14,className:"shrink-0 text-c4a-accent"}),u.jsx("span",{className:"text-c4a-text-secondary",children:M.name}),u.jsx("span",{className:"hidden truncate text-c4a-text-muted sm:inline",children:M.path}),M.isRoot&&u.jsx("span",{className:"rounded bg-c4a-bg-active px-1 py-0.5 font-mono text-[10px] text-c4a-text-muted",children:"root"})]},M.path)):q.map(M=>u.jsxs("div",{className:"flex items-center gap-2 rounded pl-2 pr-4 py-1 text-xs",children:[u.jsx(dr,{size:14,className:"shrink-0 text-c4a-text-secondary"}),u.jsx("span",{className:"truncate text-c4a-text-secondary",children:M})]},M)),X&&u.jsx("div",{ref:N,className:"h-4"})]})})]})]})}const Nj=["scan","save"],mo={scan:"sources.import.stage.scan",save:"sources.import.stage.save"},wj={scan:20,save:90};function Ej(){const{t:n}=je(),r=_a(),{libId:s}=Xs(),[i]=Ro(),d=$t(Br(Al)).find(_e=>_e.id===s),m=Oo(_e=>_e.createSource),p=i.get("parentId")||"",g=i.get("parentName")||"",h=i.get("parentPath")||"",[v,b]=y.useState(1),[S,j]=y.useState(null),[N,T]=y.useState({repoPath:"",repoName:"",branch:"",branches:[],commit:"",commits:[],isDirty:!1,repoFiles:[],packages:[],mdFiles:[],repoFileContents:[]}),[O,q]=y.useState(null),[X,G]=y.useState(!1),[M,Q]=y.useState(null),[te,Z]=y.useState(""),[E,Y]=y.useState(""),[W,de]=y.useState(!1),[oe,le]=y.useState(!1),[ue,ge]=y.useState(!1),[A,P]=y.useState(null),[fe,me]=y.useState([]),[re,w]=y.useState(null),[$,ee]=y.useState(null),[ae,xe]=y.useState([]),ve=y.useRef(null),ke=d?.is_online??!1,{rpc:Pe,importedPaths:Xe,allowedPaths:Wt}=py(s,d),ma=y.useMemo(()=>Nj.map(_e=>({key:_e,label:mo[_e]?n(mo[_e]):_e})),[n]),Qe=y.useCallback(_e=>{xe(Ae=>[...Ae,`[${wd()}] ${_e}`])},[]),et=y.useRef(null),ft=y.useCallback(_e=>{const Ae=et.current;Ae&&Ae!==_e&&(me(Fe=>Fe.includes(Ae)?Fe:[...Fe,Ae]),Qe(`${n(mo[Ae]??Ae)} ${n("sources.import.stage.done_suffix")}`)),Qe(`${n(mo[_e]??_e)}...`),et.current=_e,P(_e),ee(null)},[Qe,n]),qt=y.useCallback((_e,Ae)=>{T(Fe=>({...Fe,repoPath:_e,repoName:Ae}))},[]),Vt=y.useCallback(async()=>{G(!0),Q(null);try{const _e=await Pe("fs/repoStatus",{path:N.repoPath}),Ae={branches:_e.branches??[{name:_e.branch,commit:_e.head_hash}],tags:_e.tags??[],default:_e.branch,commits:_e.commits??[{hash:_e.head_hash,message:"HEAD"}]};q(Ae),T(Fe=>({...Fe,isDirty:_e.is_dirty})),Z(Fe=>{if(Fe)return Fe;const gt=Ae.branches.find(Pa=>Pa.name===Ae.default),Nt=Ae.branches[0],Qt=gt??Nt;return Qt?(Y(Qt.commit),Qt.name):Fe})}catch(_e){const Ae=_e instanceof Error?_e.message:"Failed to load repository info";Q(Ae)}finally{G(!1)}},[Pe,N.repoPath]);y.useEffect(()=>{v===2&&N.repoPath&&!O&&Vt()},[v,N.repoPath,O,Vt]);const ea=y.useCallback(async _e=>{try{const Ae=await Pe("fs/repoStatus",{path:N.repoPath,branch:_e});q(Fe=>Fe&&{...Fe,commits:Ae.commits??[]})}catch{}},[Pe,N.repoPath]),ta=y.useCallback(async()=>{if(!s)return;const _e=Date.now();le(!0),ge(!1),j(null),w(null),me([]),et.current=null,P(null),ee(null),xe([]),b(3);try{ft("scan");const Ae=await Pe("fs/repoScan",{path:N.repoPath,hash:E}),Fe=Ae.files||[],gt=Ae.manifests||[],Nt=cr(N.repoPath),{packages:Qt,mdFiles:Pa}=gy(gt,Fe,Nt);T(xt=>({...xt,branch:te,commit:E,repoFiles:Fe,packages:Qt,mdFiles:Pa,repoFileContents:gt})),ft("save");const Ft=await m({library_id:s,repo_name:N.repoName||Nt,repo_root_path:N.repoPath,repo_branch:te,repo_commit:E,repo_files:Fe.map(xt=>xt.path),repo_file_contents:gt,...p?{parent_source_id:p,parent_path:h}:{}});me(["scan","save"]),et.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(Ft)?Ft[0]:Ft;ve.current=Tt?.id??null,await xy(_e),ge(!0),le(!1),b(4)}catch(Ae){const Fe=et.current??"scan";w(Fe),et.current=null,P(null);const gt=Ae instanceof Error?Ae.message:String(Ae);Qe(`ERROR: ${gt}`),j(gt),le(!1)}},[s,N,te,E,p,h,Pe,m,ft,Qe]),Sa=y.useCallback(()=>{w(null),j(null),ta()},[ta]),ja=y.useCallback(()=>{if(s)if(p){const _e=N.repoName||cr(N.repoPath),Ae=h?`${h}/${_e}`:_e;r(`/studio/sources/${s}?rootId=${p}&path=${encodeURIComponent(Ae)}`)}else ve.current?r(`/studio/sources/${s}?rootId=${ve.current}`):r(`/studio/sources/${s}`)},[s,r,p,h,N.repoPath,N.repoName]),Aa=y.useMemo(()=>v===1?!!N.repoPath:v===2?W:v===3?ue:!1,[v,N.repoPath,W,ue]),la=y.useMemo(()=>{if(!d)return[];const _e=[{label:d.is_default?n("sources.library.default_cloud_name"):d.name,to:`/studio/sources/${d.id}`}];if(p&&(_e.push({label:g||p,to:`/studio/sources/${d.id}?rootId=${p}`}),h)){const Ae=h.split("/").filter(Boolean);for(const[Fe,gt]of Ae.entries()){const Nt=Ae.slice(0,Fe+1).join("/");_e.push({label:gt,to:`/studio/sources/${d.id}?rootId=${p}&path=${encodeURIComponent(Nt)}`})}}return _e.push({label:n("sources.import.title")}),_e},[d,p,g,h,n]);if(!d)return u.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:u.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})});const sa=v===4,pt=v===3&&!!re&&!oe,ia=v<=2;return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[u.jsx("div",{className:"shrink-0",children:u.jsx(Ml,{segments:la})}),u.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[u.jsx(hn,{active:v>=1,current:v===1}),u.jsx("span",{className:v===1?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.select")}),u.jsx(Ar,{}),u.jsx(hn,{active:v>=2,current:v===2}),u.jsx("span",{className:v===2?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.version")}),u.jsx(Ar,{}),u.jsx(hn,{active:v>=3,current:v===3}),u.jsx("span",{className:v===3?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.loading")}),u.jsx(Ar,{}),u.jsx(hn,{active:v>=4,current:v===4}),u.jsx("span",{className:v===4?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.confirm")})]}),u.jsx("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:ke?u.jsxs(u.Fragment,{children:[v===1&&u.jsx(pj,{rpc:Pe,selectedPath:N.repoPath,onSelect:qt,allowedPaths:Wt,importedPaths:Xe}),v===2&&u.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:u.jsx(_y,{refs:O,loading:X,error:M,selectedRef:te,commit:E,onRefChange:Z,onCommitChange:Y,onValidChange:de,onRetry:Vt,onBranchSwitch:ea})}),v===3&&u.jsx(Sy,{stages:ma,currentStage:A,completedStages:fe,failedStage:re,progress:$,breakpoints:wj,failedError:S,logs:ae}),v===4&&u.jsx(jy,{repoName:N.repoName||cr(N.repoPath),repoIdentifier:N.repoPath,branch:te,commit:E,packages:N.packages,mdFiles:N.mdFiles,importing:!1,completed:ue})]}):u.jsx(hy,{libraryName:d.name})}),ke&&u.jsx(u.Fragment,{children:sa?u.jsx("div",{className:"mt-3 flex shrink-0 justify-end sm:mt-6",children:u.jsx("button",{onClick:ja,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")})}):pt?u.jsxs("div",{className:"mt-3 flex shrink-0 justify-end gap-2 sm:mt-6",children:[u.jsx("button",{onClick:()=>{b(2),w(null),j(null),me([]),et.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")}),u.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?u.jsx(Bd,{step:v,totalSteps:4,importing:oe,stepBusy:X||v===3&&oe,canProceed:Aa,safetyNoticeKey:"sources.safety.notice.repo",confirmLabelKey:"sources.import.step.confirm",onPrev:()=>b(_e=>_e-1),onNext:()=>{v===2?ta():b(_e=>_e+1)},onImport:ta}):null}),S&&v!==3&&u.jsxs(Ln,{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:[u.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-error",children:n("sources.import.error_title")}),u.jsx("p",{className:"mt-3 whitespace-pre-wrap break-all text-sm text-c4a-text-secondary",children:S}),u.jsx("div",{className:"mt-6 flex justify-end",children:u.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 tx=(n,r)=>{let s=0,i=0,o=0;const d=[],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(r)?g.path.slice(r.length).replace(/^\//,""):g.name;d.push(h)}};return m(n),{files:s,dirs:i,gitRepos:o,mdFiles:d}};function Cj({rpc:n,selectedPath:r,onSelect:s,allowedPaths:i,importedPaths:o}){const{t:d}=je(),{atRoot:m,currentPath:p,entries:g,loading:h,error:v,homeDir:b,goToOpen:S,isWildcard:j,importedSet:N,dirs:T,files:O,loadTree:q,handleNavigateUp:X,setGoToOpen:G}=vy({rpc:n,allowedPaths:i??[],importedPaths:o??[]}),M=y.useCallback(E=>{if(E.type!=="directory"||N.has(E.path))return;const Y=tx(E.children||[],E.path);s(E.path,E.name,Y),q(E.path)},[s,q,N]);y.useEffect(()=>{if(p&&!m&&g.length>=0&&!h){const E=p.split("/").pop()||p,Y=tx(g,p);s(p,E,Y)}},[p,m,g,h,s]);const Q=y.useMemo(()=>r?r.split("/").pop()||r:"",[r]),te=y.useMemo(()=>T.sort((E,Y)=>E.is_git_repo&&!Y.is_git_repo?-1:!E.is_git_repo&&Y.is_git_repo?1:E.name.localeCompare(Y.name)),[T]),Z=y.useMemo(()=>O.sort((E,Y)=>E.name.localeCompare(Y.name)),[O]);return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[u.jsxs("div",{className:"flex items-center justify-between gap-4",children:[m?u.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[u.jsx("span",{children:d("sources.import.allowed_dirs")}),u.jsx(yy,{})]}):u.jsx("p",{className:"min-w-0 truncate font-mono text-xs text-c4a-text-muted",children:p}),r?u.jsxs("p",{className:"flex shrink-0 items-center gap-2 font-mono text-xs text-c4a-accent",children:[u.jsx(Xa,{size:12}),u.jsx("span",{children:Q})]}):j&&m?u.jsx("button",{onClick:()=>G(!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:d("sources.import.wildcard_goto")}):null]}),u.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),m?j?u.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:b&&u.jsxs("button",{onClick:()=>q(b),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:[u.jsx(Xa,{size:14,className:"shrink-0"}),u.jsxs("span",{className:"truncate",children:[b,u.jsxs("span",{className:"ml-1.5 text-c4a-text-muted",children:["(",d("sources.import.wildcard_home"),")"]})]}),u.jsx(da,{size:12,className:"shrink-0 text-c4a-text-muted"})]})}):u.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:i.map(E=>u.jsxs("button",{onClick:()=>q(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:[u.jsx(Xa,{size:14,className:"shrink-0"}),u.jsx("span",{className:"truncate",children:E}),u.jsx(da,{size:12,className:"shrink-0 text-c4a-text-muted"})]},E))}):v&&!h?u.jsx("p",{className:"py-4 text-xs text-c4a-error",children:v}):u.jsxs("div",{className:"relative min-h-[5rem] min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:[h&&u.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-c4a-bg-surface/60",children:u.jsx(va,{size:14,className:"animate-spin text-c4a-text-muted"})}),p!=="/"&&u.jsxs("button",{onClick:X,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:[u.jsx(Xa,{size:14}),u.jsx("span",{children:".."})]}),te.map(E=>{const Y=N.has(E.path),W=E.is_git_repo?To:Xa;return u.jsxs("button",{onClick:()=>M(E),disabled:Y||h,className:`flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm transition-colors ${Y?"cursor-not-allowed text-c4a-accent/60":r===E.path?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:[u.jsx(W,{size:14,className:"shrink-0"}),u.jsx("span",{className:"flex-1 truncate",children:E.name}),Y&&u.jsx("span",{className:"rounded bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] text-c4a-accent/60",children:d("sources.import.already_imported")}),u.jsx(da,{size:12,className:"shrink-0 text-c4a-text-muted"})]},E.path)}),Z.map(E=>u.jsxs("div",{className:"flex w-full items-center gap-2 pl-2 pr-4 py-1.5 text-sm text-c4a-text-muted",children:[u.jsx(Px,{size:14,className:"shrink-0"}),u.jsx("span",{className:"truncate",children:E.name})]},E.path)),g.length===0&&!h&&u.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:d("sources.import.no_entries")})]}),u.jsx(by,{open:S,onClose:()=>G(!1),rpc:n,onNavigate:q,defaultPath:b??void 0})]})}const Rj=new Set(["package.json","pyproject.toml","setup.py","go.mod","cargo.toml","pom.xml","build.gradle"]),Tj=n=>{let r=0,s=0,i=0,o=0,d=0;const m=new Set;for(const p of n)if(p.type==="directory")s++,p.is_git_repo&&d++;else{r++,p.path.toLowerCase().endsWith(".md")&&o++;const h=p.path.split("/").pop();if(h&&Rj.has(h.toLowerCase())){const v=p.path.split("/").slice(0,-1).join("/");n.some(S=>S.type==="directory"&&S.is_git_repo&&(v===S.path||v.startsWith(`${S.path}/`)))||m.add(v)}}return i=m.size,{totalFiles:r,totalDirs:s,codePackages:i,docFiles:o,gitRepos:d}};function kj({dirPath:n,rpc:r,importing:s,onScanComplete:i,onBusyChange:o}){const{t:d}=je(),[m,p]=y.useState(!1),[g,h]=y.useState(null),[v,b]=y.useState(null),S=y.useCallback(async()=>{p(!0),o?.(!0),h(null),b(null);try{const j=await r("fs/dirScan",{path:n}),N=j.entries||[],T=j.manifests||[],O=Tj(N);b(O),i(N,O,T)}catch(j){const N=j instanceof Error?j.message:String(j);h(N)}finally{p(!1),o?.(!1)}},[n,r,i,o]);return y.useEffect(()=>{S()},[S]),u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6",children:[u.jsx("p",{className:"shrink-0 font-mono text-xs text-c4a-text-muted",children:n}),u.jsx("div",{className:"mt-3 shrink-0 border-t border-c4a-border-subtle"}),u.jsxs("div",{className:"c4a-scrollbar min-h-0 flex-1 overflow-y-auto",children:[m&&u.jsxs("div",{className:"mt-6 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-4",children:[u.jsx(va,{size:14,className:"animate-spin text-c4a-accent"}),u.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:d("sources.import.dir_scanning")})]}),g&&u.jsxs("div",{className:"mt-6",children:[u.jsxs("p",{className:"flex items-start gap-2 text-xs text-c4a-error",children:[u.jsx(Zx,{size:14,className:"mt-0.5 shrink-0"}),d("sources.import.dir_scan_error")]}),u.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:g}),u.jsxs("button",{onClick:S,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:[u.jsx(ES,{size:12}),d("sources.import.dir_scan_retry")]})]}),v&&!m&&!g&&u.jsxs("div",{className:"mt-6 space-y-3",children:[u.jsxs("p",{className:"font-mono text-sm uppercase text-c4a-accent",children:[d("sources.import.dir_scan_complete"),"!"]}),u.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3 lg:grid-cols-5",children:[u.jsx(An,{icon:u.jsx(dr,{size:14}),label:d("sources.import.dir_doc_files"),value:v.docFiles,tooltip:d("sources.import.dir_doc_files_tip"),size:"lg"}),u.jsx(An,{icon:u.jsx(Ol,{size:14}),label:d("sources.import.dir_code_packages"),value:v.codePackages,tooltip:d("sources.import.dir_code_packages_tip"),size:"lg"}),v.gitRepos>0&&u.jsx(An,{icon:u.jsx(To,{size:14}),label:d("sources.import.dir_git_repos"),value:v.gitRepos,size:"lg"}),u.jsx(An,{icon:u.jsx(Xa,{size:14}),label:d("sources.import.dir_total_dirs"),value:v.totalDirs,size:"lg"}),u.jsx(An,{icon:u.jsx(K_,{size:14}),label:d("sources.import.dir_total_files"),value:v.totalFiles,size:"lg"})]}),v.gitRepos>0&&u.jsx("p",{className:"text-xs text-c4a-warning",children:d("sources.import.dir_git_skip_hint",{count:v.gitRepos})})]}),s&&u.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-3",children:[u.jsx(va,{size:14,className:"animate-spin text-c4a-accent"}),u.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:d("sources.import.importing")})]})]})]})}function Oj(){const{t:n}=je(),r=_a(),{libId:s}=Xs(),o=$t(Br(Al)).find(Y=>Y.id===s),d=Oo(Y=>Y.createSource),[m,p]=y.useState(1),[g,h]=y.useState(!1),[v,b]=y.useState(null),[S,j]=y.useState(!1),[N,T]=y.useState({dirPath:"",dirName:"",fileCount:0,subDirCount:0,gitRepoCount:0,mdFiles:[],scanEntries:[],scanStats:null,manifests:[]}),O=o?.is_online??!1,{rpc:q,importedPaths:X,allowedPaths:G}=py(s,o),M=y.useCallback((Y,W,de)=>{T(oe=>({...oe,dirPath:Y,dirName:W,fileCount:de.files,subDirCount:de.dirs,gitRepoCount:de.gitRepos,mdFiles:de.mdFiles}))},[]),Q=y.useCallback((Y,W,de)=>{T(oe=>({...oe,scanEntries:Y,scanStats:W,manifests:de}))},[]),te=y.useCallback(async()=>{if(s){h(!0);try{const Y=await d({library_id:s,dir_files:N.scanEntries,dir_name:N.dirName,dir_path:N.dirPath,dir_file_contents:N.manifests}),W=Array.isArray(Y)?Y[0]:Y;W?.id?r(`/studio/sources/${s}?rootId=${W.id}`):r(`/studio/sources/${s}`)}catch(Y){const W=Y instanceof Error?Y.message:String(Y);b(W),h(!1)}}},[s,N,d,r]),Z=y.useMemo(()=>m===1?!!N.dirPath:m===2?N.scanEntries.length>0:!0,[m,N]),E=y.useMemo(()=>o?[{label:o.is_default?n("sources.library.default_cloud_name"):o.name,to:`/studio/sources/${o.id}`},{label:n("sources.import.dir_title")}]:[],[o,n]);return o?u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[u.jsx("div",{className:"shrink-0",children:u.jsx(Ml,{segments:E})}),u.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[u.jsx(hn,{active:m>=1,current:m===1}),u.jsx("span",{className:m===1?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.dir_step.select")}),u.jsx(Ar,{}),u.jsx(hn,{active:m>=2,current:m===2}),u.jsx("span",{className:m===2?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.dir_step.confirm")})]}),u.jsx("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:O?u.jsxs(u.Fragment,{children:[m===1&&u.jsx(Cj,{rpc:q,selectedPath:N.dirPath,onSelect:M,allowedPaths:G,importedPaths:X}),m===2&&u.jsx(kj,{dirPath:N.dirPath,rpc:q,importing:g,onScanComplete:Q,onBusyChange:j})]}):u.jsx(hy,{libraryName:o.name})}),O&&u.jsx(Bd,{step:m,totalSteps:2,importing:g,stepBusy:S,canProceed:Z,safetyNoticeKey:"sources.safety.notice.dir",confirmLabelKey:"sources.import.dir_step.confirm",onPrev:()=>p(Y=>Y-1),onNext:()=>p(Y=>Y+1),onImport:te}),v&&u.jsxs(Ln,{onClose:()=>b(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:[u.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-error",children:n("sources.import.error_title")}),u.jsx("p",{className:"mt-3 whitespace-pre-wrap break-all text-sm text-c4a-text-secondary",children:v}),u.jsx("div",{className:"mt-6 flex justify-end",children:u.jsx("button",{onClick:()=>b(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")})})]})]}):u.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:u.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})})}const zj=/^https:\/\/[^/]+\/.+/;function Dj({url:n,onUrlChange:r,onValidChange:s,onRefHint:i}){const{t:o}=je(),[d,m]=y.useState(null),[p,g]=y.useState([]),h=y.useRef(null);y.useEffect(()=>{st.get("/import/remote/git-hosts").then(j=>g(j.hosts),()=>{})},[]);const v=y.useCallback(j=>{if(!j){m(null),s(!1);return}const N=mj(j),T=N.repoUrl!==j.trim(),O=T?N.repoUrl:j;T&&(r(O),i?.(N.ref,N.commit)),zj.test(O)?(m(null),s(!0)):(m(o("sources.import_remote.url_invalid")),s(!1))},[r,s,i,o]),b=y.useCallback(j=>{const N=j.target.value;r(N),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>v(N),500)},[r,v]),S=y.useCallback(j=>{j.preventDefault();const N=j.clipboardData.getData("text").trim();r(N),h.current&&clearTimeout(h.current),v(N)},[r,v]);return y.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]),y.useEffect(()=>{n&&v(n)},[]),u.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:u.jsxs("div",{className:"w-full max-w-xl space-y-5",children:[u.jsx("input",{type:"text",value:n,onChange:b,onPaste:S,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}),u.jsx("div",{className:"h-14 text-center text-sm leading-relaxed text-c4a-text-muted",children:d?u.jsxs("p",{className:"flex items-center justify-center gap-1.5 text-red-400",children:[u.jsx(Hr,{size:14,className:"shrink-0"}),d]}):u.jsxs(u.Fragment,{children:[u.jsx("p",{children:p.length>0?u.jsxs(u.Fragment,{children:[o("sources.import_remote.url_hint_public"),p.map((j,N)=>u.jsxs("span",{children:[N>0&&"、",u.jsx("span",{className:"font-mono font-medium text-c4a-accent",children:j})]},j))]}):o("sources.import_remote.url_hint_no_auth")}),u.jsx("p",{className:"mt-1 text-c4a-text-muted/60",children:o("sources.import_remote.url_hint_format")})]})})]})})}const ax=["prepare","clone","scan","save"],ho={prepare:"sources.import.stage.prepare",clone:"sources.import.stage.clone",scan:"sources.import.stage.scan",save:"sources.import.stage.save"},Aj={prepare:5,clone:90,scan:95,save:100};function Mj(n,r,s){if(n instanceof Dr){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(r).hostname;return s("sources.import_remote.error.auth_required",{host:o})}catch{return s("sources.import_remote.error.auth_required",{host:r})}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 Lj(n){return n==="cloning"?"clone":n==="detecting"||n==="extracting"?"scan":n==="saving"?"save":n}function Uj(){const{t:n}=je(),r=_a(),{libId:s}=Xs(),[i]=Ro(),o=i.get("url")||"",d=i.get("ref")||"",m=i.get("sourceUuid")||"",p=i.get("parentId")||"",g=i.get("parentName")||"",h=i.get("parentPath")||"",b=$t(Br(Al)).find(Ce=>Ce.id===s),[S,j]=y.useState(new Set),N=y.useCallback(async()=>{if(s)try{const Ce=new Set;if(p){const lt=(await st.get(`/sources/${p}`)).tree??[];let K=h===""?lt:[];if(h){const se=(Oe,$e)=>{for(const Ue of Oe){if(Ue.path===$e)return Ue.children??[];if(Ue.children){const At=se(Ue.children,$e);if(At.length>0)return At}}return[]};K=se(lt,h)}for(const se of K)Ce.add(se.name.toLowerCase())}else{const Le=await st.get("/sources",{library_id:s});for(const lt of Le.items)Ce.add(lt.name.toLowerCase())}j(Ce)}catch{}},[s,p,h]);y.useEffect(()=>{N()},[N]);const[T,O]=y.useState(o?2:1),[q,X]=y.useState(o),[G,M]=y.useState(!!o),[Q,te]=y.useState(d),[Z,E]=y.useState(""),[Y,W]=y.useState(!!d),[de,oe]=y.useState(""),le=y.useRef(void 0),ue=y.useRef(void 0),[ge,A]=y.useState(null),[P,fe]=y.useState(!1),[me,re]=y.useState(null),[w,$]=y.useState(!1),[ee,ae]=y.useState(!1),[xe,ve]=y.useState(null),[ke,Pe]=y.useState(null),[Xe,Wt]=y.useState(null),[ma,Qe]=y.useState(null),[et,ft]=y.useState([]),[qt,Vt]=y.useState(null),[ea,ta]=y.useState([]),Sa=y.useRef(null),ja=y.useRef(""),Aa=y.useMemo(()=>ax.map(Ce=>({key:Ce,label:ho[Ce]?n(ho[Ce]):Ce})),[n]),la=y.useCallback(Ce=>{ta(Le=>[...Le,`[${wd()}] ${Ce}`])},[]),sa=y.useRef(null),pt=y.useCallback(Ce=>{const Le=sa.current;Le&&Le!==Ce&&(ft(lt=>lt.includes(Le)?lt:[...lt,Le]),la(`${n(ho[Le]??Le)} ${n("sources.import.stage.done_suffix")}`)),la(`${n(ho[Ce]??Ce)}...`),sa.current=Ce,Qe(Ce),Vt(null)},[la,n]),ia=y.useCallback((Ce,Le)=>{le.current=Ce,ue.current=Le},[]),_e=y.useCallback(async Ce=>{if(s){fe(!0),re(null);try{const Le=await st.post("/import/remote/refs",{library_id:s,url:q},Ce?{signal:Ce}:void 0);A(Le);const lt=Le.branches??[],K=Le.tags??[],se=[...lt,...K];se.length>0&&te(Oe=>{if(Oe)return Oe;const $e=le.current,Ue=ue.current;if($e){const ca=se.find(Ma=>Ma.name===$e);if(ca)return E(ca.commit),ca.name}Ue&&E(Ue);const oa=lt.find(ca=>ca.name===Le.default)??lt[0];return oa?(Ue||E(oa.commit),oa.name):Oe})}catch(Le){if(Ce?.aborted)return;re(Mj(Le,q,n))}finally{Ce?.aborted||fe(!1)}}},[s,q,n]);y.useEffect(()=>{if(T!==2||!s)return;const Ce=new AbortController;return _e(Ce.signal),()=>Ce.abort()},[T,s,_e]),y.useEffect(()=>{if(!w)return;let Ce="";return nn.on("task/progress",lt=>{const K=lt,se=Lj(K.stage??"");se&&ax.includes(se)&&(Vt({percent:K.percent??-1,label:K.detail??K.label??""}),K.detail&&K.detail!==Ce&&(Ce=K.detail,ta(Oe=>[...Oe,`[${wd()}] ${K.detail}`])))})},[w]);const Ae=y.useCallback(async()=>{if(!s)return;const Ce=Date.now();$(!0),ae(!1),Pe(null),Wt(null),ft([]),sa.current=null,Qe(null),Vt(null),ta([]),O(3);try{pt("prepare"),await new Promise(oa=>setTimeout(oa,300)),pt("clone");const Le=cr(q),lt=de||Le,K=h?`${h}/${lt}`:lt,se=await st.post("/import/remote/clone",{library_id:s,url:q,ref:Q,...Z?{commit:Z}:{},repo_name:K});ja.current=se.commit_hash,pt("scan");const Oe=await st.post("/import/remote/scan",{library_id:s,path:se.path,hash:se.commit_hash});pt("save");const $e=await st.post("/import/remote/import",{library_id:s,url:q,ref:Q,commit:se.commit_hash,repo_name:K,dir_name:lt,repo_files:Oe.files,repo_file_contents:Oe.manifests,...m?{source_uuid:m}:{},...p?{parent_source_id:p,parent_path:h}:{}});ft(["prepare","clone","scan","save"]),sa.current=null,Qe(null),la(`${n("sources.import.stage.save")} ${n("sources.import.stage.done_suffix")}`),la(n("sources.import.stage.complete"));const{packages:Ue,mdFiles:At}=gy(Oe.manifests,Oe.files,Le);ve({packages:Ue,mdFiles:At}),Sa.current=$e.id,await xy(Ce),ae(!0),$(!1),O(4)}catch(Le){const lt=sa.current??"prepare";Wt(lt),sa.current=null,Qe(null);let K;Le instanceof Dr||Le instanceof Error?K=Le.message:K=String(Le),la(`ERROR: ${K}`),Pe(K),$(!1)}},[s,q,Q,Z,de,m,p,h,pt,la]),Fe=y.useCallback(()=>{Wt(null),Pe(null),Ae()},[Ae]),gt=y.useCallback(()=>{if(s)if(p){const Ce=cr(q),Le=de||Ce,lt=h?`${h}/${Le}`:Le;r(`/studio/sources/${s}?rootId=${p}&path=${encodeURIComponent(lt)}`)}else Sa.current?r(`/studio/sources/${s}?rootId=${Sa.current}`):r(`/studio/sources/${s}`)},[s,r,p,h,de,q]),Nt=(de||cr(q)).toLowerCase(),Qt=S.has(Nt),Pa=y.useMemo(()=>T===1?G:T===2?Y&&!Qt:!1,[T,G,Y,Qt]),Ft=y.useMemo(()=>{if(!b)return[];const Ce=[{label:b.is_default?n("sources.library.default_cloud_name"):b.name,to:`/studio/sources/${b.id}`}];if(p&&(Ce.push({label:g||p,to:`/studio/sources/${b.id}?rootId=${p}`}),h)){const Le=h.split("/").filter(Boolean);for(const[lt,K]of Le.entries()){const se=Le.slice(0,lt+1).join("/");Ce.push({label:K,to:`/studio/sources/${b.id}?rootId=${p}&path=${encodeURIComponent(se)}`})}}return Ce.push({label:n("sources.import_remote.title")}),Ce},[b,p,g,h,n]);if(!b)return u.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:u.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})});const Tt=T===4&&ee,xt=T===3&&!!Xe&&!w,Dt=T<=2;return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[u.jsx("div",{className:"shrink-0",children:u.jsx(Ml,{segments:Ft})}),u.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[u.jsx(hn,{active:T>=1,current:T===1}),u.jsx("span",{className:T===1?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.select")}),u.jsx(Ar,{}),u.jsx(hn,{active:T>=2,current:T===2}),u.jsx("span",{className:T===2?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.version")}),u.jsx(Ar,{}),u.jsx(hn,{active:T>=3,current:T===3}),u.jsx("span",{className:T===3?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.loading")}),u.jsx(Ar,{}),u.jsx(hn,{active:T>=4,current:T===4}),u.jsx("span",{className:T===4?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.confirm")})]}),u.jsxs("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:[T===1&&u.jsx(Dj,{url:q,onUrlChange:X,onValidChange:M,onRefHint:ia}),T===2&&s&&u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[u.jsx(_y,{refs:ge,loading:P,error:me,selectedRef:Q,commit:Z,onRefChange:te,onCommitChange:E,onValidChange:W,onRetry:()=>_e()}),!P&&ge&&u.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[u.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:n("sources.import.dir_name")}),u.jsx("input",{type:"text",value:de,onChange:Ce=>oe(Ce.target.value),placeholder:cr(q),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 ${Qt?"border-red-400 focus:border-red-400":"border-c4a-border-default focus:border-c4a-accent"}`}),Qt?u.jsx("p",{className:"mt-1.5 text-xs text-red-400",children:n("sources.import.dir_name_duplicate")}):u.jsx("p",{className:"mt-1.5 text-xs text-c4a-text-muted",children:n("sources.import.dir_name_hint")})]})]}),T===3&&u.jsx(Sy,{stages:Aa,currentStage:ma,completedStages:et,failedStage:Xe,progress:qt,breakpoints:Aj,failedError:ke,logs:ea}),T===4&&u.jsx(jy,{repoName:cr(q),repoIdentifier:q,branch:Q,commit:ja.current,packages:xe?.packages??[],mdFiles:xe?.mdFiles??[],importing:!1,completed:ee})]}),Tt?u.jsx("div",{className:"mt-3 flex shrink-0 justify-end sm:mt-6",children:u.jsx("button",{onClick:gt,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")})}):xt?u.jsxs("div",{className:"mt-3 flex shrink-0 justify-end gap-2 sm:mt-6",children:[u.jsx("button",{onClick:()=>{O(2),Wt(null),Pe(null),ft([]),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")}),u.jsx("button",{onClick:Fe,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")})]}):Dt?u.jsx(Bd,{step:T,totalSteps:2,importing:!1,stepBusy:P,canProceed:Pa,safetyNoticeKey:"sources.safety.notice.remote",confirmLabelKey:"common.next",onPrev:()=>O(Ce=>Ce-1),onNext:()=>O(Ce=>Ce+1),onImport:Ae}):null]})}function Hj(){const{t:n}=je(),r=_a(),s=$t(S=>S.createLibrary),[i,o]=y.useState("waiting"),[d,m]=y.useState(null),[p,g]=y.useState(""),[h,v]=y.useState(!1);y.useEffect(()=>nn.on("ws:daemon:connected",j=>{const N=j;m(N),g(N.machine_id),o(N.needs_registration?"new_client":"reconnected")}),[]),y.useEffect(()=>{let S=!1;return(async()=>{try{const j=await st.get("/daemons/pending");if(S||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{}})(),()=>{S=!0}},[]);const b=y.useCallback(async()=>{if(d){v(!0);try{const S=await s({type:"daemon",name:p||d.machine_id,config:{machine_id:d.machine_id,os:d.os||"",daemon_version:d.daemon_version||""}});r(`/studio/sources/${S.id}`)}catch{v(!1)}}},[d,p,s,r]);return u.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[u.jsx(Ml,{segments:[{label:n("sources.add_client.title")}]}),u.jsx("p",{className:"mt-4 text-sm text-c4a-text-secondary",children:n("sources.add_client.description")}),u.jsx("div",{className:"mt-6 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-5",children:u.jsxs("ol",{className:"space-y-4 text-sm text-c4a-text-secondary",children:[u.jsxs("li",{children:[u.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["1. ",n("sources.add_client.step1")]}),u.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 ",u.jsx(sd,{text:"npm install -g @c4a/daemon"})]})]}),u.jsxs("li",{children:[u.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["2. ",n("sources.add_client.step2")]}),u.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}`," ",u.jsx(sd,{text:`c4a-daemon --server ${window.location.host}`})]}),u.jsx("p",{className:"mt-2 text-xs text-c4a-text-muted",children:n("sources.add_client.step2_allow")}),u.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`," ",u.jsx(sd,{text:`c4a-daemon --server ${window.location.host} --allow ~/dir1,~/dir2`})]})]}),u.jsxs("li",{children:[u.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["3. ",n("sources.add_client.step3")]}),u.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:n("sources.add_client.step3_desc")})]})]})}),u.jsxs("div",{className:"mt-6 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-5",children:[i==="waiting"&&u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(va,{size:16,className:"animate-spin text-c4a-warning"}),u.jsx("span",{className:"text-sm text-c4a-warning",children:n("sources.add_client.waiting")})]}),i==="new_client"&&d&&u.jsxs("div",{className:"space-y-4",children:[u.jsx("h3",{className:"font-mono text-sm font-bold text-c4a-accent",children:n("sources.add_client.detected")}),u.jsxs("div",{className:"space-y-2 text-sm",children:[u.jsx(id,{label:n("sources.add_client.machine_name"),value:d.machine_id}),d.os&&u.jsx(id,{label:n("sources.add_client.os"),value:d.os}),d.daemon_version&&u.jsx(id,{label:n("sources.add_client.daemon_version"),value:d.daemon_version})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"w-32 font-mono text-xs text-c4a-text-muted",children:n("sources.add_client.client_name")}),u.jsx("input",{value:p,onChange:S=>g(S.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"})]}),u.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[u.jsx("button",{onClick:()=>r("/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")}),u.jsxs("button",{onClick:b,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&&u.jsx(va,{size:12,className:"animate-spin"}),n("sources.add_client.confirm")]})]})]}),i==="reconnected"&&d&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Lr,{size:16,className:"text-c4a-success"}),u.jsx("span",{className:"text-sm text-c4a-text-primary",children:n("sources.add_client.reconnected",{name:d.machine_id})})]}),d.lib_id&&u.jsx(Fa,{to:`/studio/sources/${d.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:d.machine_id})})]})]})]})}function sd({text:n}){const[r,s]=y.useState(!1),i=y.useCallback(()=>{navigator.clipboard.writeText(n).then(()=>{s(!0),setTimeout(()=>s(!1),1500)})},[n]);return u.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:r?u.jsx(Lr,{size:13}):u.jsx(gd,{size:13})})}function id({label:n,value:r}){return u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"w-32 font-mono text-xs text-c4a-text-muted",children:n}),u.jsx("span",{className:"font-mono text-xs text-c4a-text-primary",children:r})]})}function Bj(){const{t:n}=je(),{sourceUuid:r}=Xs(),[s]=Ro(),i=s.get("path")||"",{currentRoot:o,loading:d,fetchRootSource:m}=Oo(),p=$t(Br(Al)),[g,h]=y.useState("original");y.useEffect(()=>{r&&m(r)},[r,m]);const v=y.useMemo(()=>o?i?ko(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]),b=p.find(G=>G.id===o?.library_id),S=v?.metadata,j=S?Object.fromEntries(Object.entries(S).map(([G,M])=>[G,String(M??"")])):null,N=v?.source_type==="code",T=v?.name??o?.name??"",O=v?.source_type??null,q=y.useMemo(()=>{if(!o||!b)return[];const G=o.kind==="source"&&!i,M=[{label:b.is_default?n("sources.library.default_cloud_name"):b.name,to:`/studio/sources/${b.id}`},{label:o.name,...G?{}:{to:`/studio/sources/${b.id}?rootId=${o.id}`}}];if(i){const Q=zs(o.tree,i);for(let te=0;te<Q.length-1;te++){const Z=Q[te];M.push({label:Z.name,to:`/studio/sources/${b.id}?rootId=${o.id}&path=${encodeURIComponent(Z.path)}`})}Q.length>0&&M.push({label:Q[Q.length-1].name})}return M},[o,b,i,n]),X=[{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 d||!o||!v?u.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:u.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})}):u.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[u.jsx(Ml,{segments:q}),u.jsxs("div",{className:"mt-4 flex flex-wrap items-baseline gap-x-6 gap-y-2",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[N?u.jsx(Ol,{size:20,className:"shrink-0 text-c4a-accent"}):u.jsx(dr,{size:20,className:"shrink-0 text-c4a-accent"}),u.jsx("h1",{className:"min-w-0 break-all font-mono text-xl font-bold leading-none text-c4a-text-primary",children:T})]}),u.jsxs("div",{className:"flex flex-wrap items-baseline gap-4 text-xs text-c4a-text-muted",children:[u.jsxs("span",{children:[n("sources.detail.type"),":"," ",u.jsx("span",{className:"text-c4a-text-secondary",children:n(O==="code"?"sources.type.code":"sources.type.doc")})]}),N&&j?.relative_path&&u.jsxs("span",{children:[n("sources.detail.path"),":"," ",u.jsx("span",{className:"font-mono text-c4a-text-secondary",children:j.relative_path})]}),!N&&u.jsxs("span",{children:[n("sources.detail.origin"),":"," ",u.jsx("span",{className:"text-c4a-text-secondary",children:b?.type==="daemon"?n("sources.detail.origin.local"):n("sources.detail.origin.upload")})]}),u.jsxs("span",{children:[n("sources.detail.status"),":"," ",u.jsx("span",{className:"text-c4a-text-secondary",children:n(`sources.status.${v.index_status??"none"}`)})]})]})]}),N&&j&&u.jsx("div",{className:"mt-4 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:u.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2 text-xs md:grid-cols-4",children:[j.repo_name&&u.jsx(po,{label:n("sources.detail.repo"),value:j.repo_name}),j.pinned_branch&&u.jsx(po,{label:n("sources.detail.branch"),value:j.pinned_branch}),j.pinned_hash&&u.jsx(po,{label:n("sources.detail.commit"),value:j.pinned_hash.slice(0,7)}),j.tech_stack&&u.jsx(po,{label:n("sources.detail.tech_stack"),value:j.tech_stack})]})}),u.jsxs(cy,{value:g,onChange:G=>h(G),children:[u.jsx("div",{className:"mt-3",children:u.jsx(uy,{children:X.map(G=>u.jsx(jd,{value:G.key,children:G.label},G.key))})}),u.jsxs("div",{className:"mt-4 flex-1",children:[u.jsx(Ls,{value:"original",children:u.jsx($j,{node:v,isCode:N})}),u.jsx(Ls,{value:"digest",children:u.jsx(nx,{message:n("sources.detail.digest_placeholder")})}),u.jsx(Ls,{value:"modeling",children:u.jsx(nx,{message:n("sources.detail.modeling_placeholder")})})]})]})]})}function po({label:n,value:r}){return u.jsxs("div",{children:[u.jsx("span",{className:"text-c4a-text-muted",children:n}),u.jsx("p",{className:"mt-0.5 font-mono text-c4a-text-primary",children:r})]})}function $j({node:n,isCode:r}){const{t:s}=je(),i=n.metadata;return r?u.jsxs("div",{className:"space-y-4 text-sm text-c4a-text-secondary",children:[!!i?.description&&u.jsx("p",{children:String(i.description)}),!!i?.dependencies&&u.jsxs("div",{children:[u.jsx("h4",{className:"font-mono text-xs font-bold uppercase text-c4a-text-primary",children:s("sources.detail.dependencies")}),u.jsx("div",{className:"mt-2 rounded bg-c4a-bg-surface p-3 font-mono text-xs",children:Object.entries(i.dependencies).map(([o,d])=>u.jsxs("div",{className:"flex justify-between py-0.5",children:[u.jsx("span",{className:"text-c4a-text-primary",children:o}),u.jsx("span",{className:"text-c4a-text-muted",children:d})]},o))})]}),!i?.description&&!i?.dependencies&&u.jsx("p",{className:"text-c4a-text-muted",children:s("sources.detail.original_code_placeholder")})]}):u.jsx("div",{className:"prose prose-invert max-w-none text-sm text-c4a-text-secondary",children:u.jsx("p",{className:"text-c4a-text-muted",children:s("sources.detail.original_doc_placeholder")})})}function nx({message:n}){return u.jsx("div",{className:"flex items-center justify-center rounded border border-dashed border-c4a-border-subtle p-12",children:u.jsx("p",{className:"text-center text-sm text-c4a-text-muted",children:n})})}const qj=y.lazy(()=>Ld(()=>import("./ContentDetail-BlCJjlr2.js"),__vite__mapDeps([0,1])).then(n=>({default:n.ContentDetail}))),Yj=y.lazy(()=>Ld(()=>import("./EntityDetail-BBLfJ9LL.js"),__vite__mapDeps([2,1,3])).then(n=>({default:n.EntityDetail}))),Gj=y.lazy(()=>Ld(()=>import("./RelationDetail-BoTv8wr4.js"),__vite__mapDeps([4,1,3])).then(n=>({default:n.RelationDetail}))),Vj=i_([{element:u.jsx(u2,{}),errorElement:u.jsx(Zg,{}),children:[{path:"/",element:u.jsx(x2,{})},{path:"/login",element:u.jsx(v2,{})},{path:"/auth/callback",element:u.jsx(S2,{})},{path:"/docs",element:u.jsx(j2,{})}]},{path:"/studio",element:u.jsx(g2,{}),errorElement:u.jsx(Zg,{}),children:[{index:!0,element:u.jsx(M4,{to:"/studio/sources",replace:!0})},{path:"sources",element:u.jsx(uj,{})},{path:"sources/add-client",element:u.jsx(Hj,{})},{path:"sources/import/:libId",element:u.jsx(Ej,{})},{path:"sources/import-dir/:libId",element:u.jsx(Oj,{})},{path:"sources/import-remote/:libId",element:u.jsx(Uj,{})},{path:"sources/:libId",element:u.jsx(cj,{})},{path:"source/:sourceUuid",element:u.jsx(Bj,{})},{path:"contents/:hashId",element:u.jsx(y.Suspense,{fallback:null,children:u.jsx(qj,{})})},{path:"entities/:entityId",element:u.jsx(y.Suspense,{fallback:null,children:u.jsx(Yj,{})})},{path:"relations/:relationId",element:u.jsx(y.Suspense,{fallback:null,children:u.jsx(Gj,{})})},{path:"modeling",element:u.jsx(w2,{})},{path:"modeling/code/setup",element:u.jsx(L2,{})},{path:"modeling/code/compile",element:u.jsx(U2,{})},{path:"modeling/code/review",element:u.jsx(H2,{})},{path:"modeling/code/result",element:u.jsx(B2,{})},{path:"brain",element:u.jsx(E2,{})},{path:"discovery",element:u.jsx(C2,{})},{path:"sharing",element:u.jsx(R2,{})},{path:"collaboration",element:u.jsx(T2,{})},{path:"settings",element:u.jsx(k2,{})}]},{path:"*",element:u.jsx(N2,{})}]);function Kj(){return y.useEffect(()=>{Za.getState().init();const r=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;return nn.connect(r),()=>{nn.disconnect()}},[]),u.jsx(z4,{router:Vj})}Q0.createRoot(document.getElementById("root")).render(u.jsx(y.StrictMode,{children:u.jsx(Kj,{})}));export{Dr as A,dy as E,cy as T,Ld as _,_a as a,je as b,Xs as c,st as d,uy as e,jd as f,Ov as g,Ls as h,ze as i,u as j,Fs as k,y as r,ny as u};