@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,12 @@
1
+ function cv(n,l){for(var s=0;s<l.length;s++){const i=l[s];if(typeof i!="string"&&!Array.isArray(i)){for(const o in i)if(o!=="default"&&!(o in n)){const u=Object.getOwnPropertyDescriptor(i,o);u&&Object.defineProperty(n,o,u.get?u:{enumerable:!0,get:()=>i[o]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const m of u.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&i(m)}).observe(document,{childList:!0,subtree:!0});function s(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function i(o){if(o.ep)return;o.ep=!0;const u=s(o);fetch(o.href,u)}})();function uv(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Au={exports:{}},js={};var pp;function dv(){if(pp)return js;pp=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function s(i,o,u){var m=null;if(u!==void 0&&(m=""+u),o.key!==void 0&&(m=""+o.key),"key"in o){u={};for(var p in o)p!=="key"&&(u[p]=o[p])}else u=o;return o=u.ref,{$$typeof:n,type:i,key:m,ref:o!==void 0?o:null,props:u}}return js.Fragment=l,js.jsx=s,js.jsxs=s,js}var gp;function fv(){return gp||(gp=1,Au.exports=dv()),Au.exports}var f=fv();const Oe=n=>typeof n=="string",Ns=()=>{let n,l;const s=new Promise((i,o)=>{n=i,l=o});return s.resolve=n,s.reject=l,s},xp=n=>n==null?"":""+n,mv=(n,l,s)=>{n.forEach(i=>{l[i]&&(s[i]=l[i])})},hv=/###/g,yp=n=>n&&n.indexOf("###")>-1?n.replace(hv,"."):n,bp=n=>!n||Oe(n),Ds=(n,l,s)=>{const i=Oe(l)?l.split("."):l;let o=0;for(;o<i.length-1;){if(bp(n))return{};const u=yp(i[o]);!n[u]&&s&&(n[u]=new s),Object.prototype.hasOwnProperty.call(n,u)?n=n[u]:n={},++o}return bp(n)?{}:{obj:n,k:yp(i[o])}},vp=(n,l,s)=>{const{obj:i,k:o}=Ds(n,l,Object);if(i!==void 0||l.length===1){i[o]=s;return}let u=l[l.length-1],m=l.slice(0,l.length-1),p=Ds(n,m,Object);for(;p.obj===void 0&&m.length;)u=`${m[m.length-1]}.${u}`,m=m.slice(0,m.length-1),p=Ds(n,m,Object),p?.obj&&typeof p.obj[`${p.k}.${u}`]<"u"&&(p.obj=void 0);p.obj[`${p.k}.${u}`]=s},pv=(n,l,s,i)=>{const{obj:o,k:u}=Ds(n,l,Object);o[u]=o[u]||[],o[u].push(s)},po=(n,l)=>{const{obj:s,k:i}=Ds(n,l);if(s&&Object.prototype.hasOwnProperty.call(s,i))return s[i]},gv=(n,l,s)=>{const i=po(n,s);return i!==void 0?i:po(l,s)},Gg=(n,l,s)=>{for(const i in l)i!=="__proto__"&&i!=="constructor"&&(i in n?Oe(n[i])||n[i]instanceof String||Oe(l[i])||l[i]instanceof String?s&&(n[i]=l[i]):Gg(n[i],l[i],s):n[i]=l[i]);return n},zl=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var xv={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const yv=n=>Oe(n)?n.replace(/[&<>"'\/]/g,l=>xv[l]):n;class bv{constructor(l){this.capacity=l,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(l){const s=this.regExpMap.get(l);if(s!==void 0)return s;const i=new RegExp(l);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(l,i),this.regExpQueue.push(l),i}}const vv=[" ",",","?","!",";"],Sv=new bv(20),_v=(n,l,s)=>{l=l||"",s=s||"";const i=vv.filter(m=>l.indexOf(m)<0&&s.indexOf(m)<0);if(i.length===0)return!0;const o=Sv.getRegExp(`(${i.map(m=>m==="?"?"\\?":m).join("|")})`);let u=!o.test(n);if(!u){const m=n.indexOf(s);m>0&&!o.test(n.substring(0,m))&&(u=!0)}return u},rd=(n,l,s=".")=>{if(!n)return;if(n[l])return Object.prototype.hasOwnProperty.call(n,l)?n[l]:void 0;const i=l.split(s);let o=n;for(let u=0;u<i.length;){if(!o||typeof o!="object")return;let m,p="";for(let g=u;g<i.length;++g)if(g!==u&&(p+=s),p+=i[g],m=o[p],m!==void 0){if(["string","number","boolean"].indexOf(typeof m)>-1&&g<i.length-1)continue;u+=g-u+1;break}o=m}return o},As=n=>n?.replace("_","-"),jv={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,l){console?.[n]?.apply?.(console,l)}};class go{constructor(l,s={}){this.init(l,s)}init(l,s={}){this.prefix=s.prefix||"i18next:",this.logger=l||jv,this.options=s,this.debug=s.debug}log(...l){return this.forward(l,"log","",!0)}warn(...l){return this.forward(l,"warn","",!0)}error(...l){return this.forward(l,"error","")}deprecate(...l){return this.forward(l,"warn","WARNING DEPRECATED: ",!0)}forward(l,s,i,o){return o&&!this.debug?null:(Oe(l[0])&&(l[0]=`${i}${this.prefix} ${l[0]}`),this.logger[s](l))}create(l){return new go(this.logger,{prefix:`${this.prefix}:${l}:`,...this.options})}clone(l){return l=l||this.options,l.prefix=l.prefix||this.prefix,new go(this.logger,l)}}var dn=new go;class bo{constructor(){this.observers={}}on(l,s){return l.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const o=this.observers[i].get(s)||0;this.observers[i].set(s,o+1)}),this}off(l,s){if(this.observers[l]){if(!s){delete this.observers[l];return}this.observers[l].delete(s)}}emit(l,...s){this.observers[l]&&Array.from(this.observers[l].entries()).forEach(([o,u])=>{for(let m=0;m<u;m++)o(...s)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([o,u])=>{for(let m=0;m<u;m++)o.apply(o,[l,...s])})}}class Sp extends bo{constructor(l,s={ns:["translation"],defaultNS:"translation"}){super(),this.data=l||{},this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(l){this.options.ns.indexOf(l)<0&&this.options.ns.push(l)}removeNamespaces(l){const s=this.options.ns.indexOf(l);s>-1&&this.options.ns.splice(s,1)}getResource(l,s,i,o={}){const u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,m=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let p;l.indexOf(".")>-1?p=l.split("."):(p=[l,s],i&&(Array.isArray(i)?p.push(...i):Oe(i)&&u?p.push(...i.split(u)):p.push(i)));const g=po(this.data,p);return!g&&!s&&!i&&l.indexOf(".")>-1&&(l=p[0],s=p[1],i=p.slice(2).join(".")),g||!m||!Oe(i)?g:rd(this.data?.[l]?.[s],i,u)}addResource(l,s,i,o,u={silent:!1}){const m=u.keySeparator!==void 0?u.keySeparator:this.options.keySeparator;let p=[l,s];i&&(p=p.concat(m?i.split(m):i)),l.indexOf(".")>-1&&(p=l.split("."),o=s,s=p[1]),this.addNamespaces(s),vp(this.data,p,o),u.silent||this.emit("added",l,s,i,o)}addResources(l,s,i,o={silent:!1}){for(const u in i)(Oe(i[u])||Array.isArray(i[u]))&&this.addResource(l,s,u,i[u],{silent:!0});o.silent||this.emit("added",l,s,i)}addResourceBundle(l,s,i,o,u,m={silent:!1,skipCopy:!1}){let p=[l,s];l.indexOf(".")>-1&&(p=l.split("."),o=i,i=s,s=p[1]),this.addNamespaces(s);let g=po(this.data,p)||{};m.skipCopy||(i=JSON.parse(JSON.stringify(i))),o?Gg(g,i,u):g={...g,...i},vp(this.data,p,g),m.silent||this.emit("added",l,s,i)}removeResourceBundle(l,s){this.hasResourceBundle(l,s)&&delete this.data[l][s],this.removeNamespaces(s),this.emit("removed",l,s)}hasResourceBundle(l,s){return this.getResource(l,s)!==void 0}getResourceBundle(l,s){return s||(s=this.options.defaultNS),this.getResource(l,s)}getDataByLanguage(l){return this.data[l]}hasLanguageSomeTranslations(l){const s=this.getDataByLanguage(l);return!!(s&&Object.keys(s)||[]).find(o=>s[o]&&Object.keys(s[o]).length>0)}toJSON(){return this.data}}var Vg={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,l,s,i,o){return n.forEach(u=>{l=this.processors[u]?.process(l,s,i,o)??l}),l}};const Kg=Symbol("i18next/PATH_KEY");function Nv(){const n=[],l=Object.create(null);let s;return l.get=(i,o)=>(s?.revoke?.(),o===Kg?n:(n.push(o),s=Proxy.revocable(i,l),s.proxy)),Proxy.revocable(Object.create(null),l).proxy}function sd(n,l){const{[Kg]:s}=n(Nv());return s.join(l?.keySeparator??".")}const _p={},Lu=n=>!Oe(n)&&typeof n!="boolean"&&typeof n!="number";class xo extends bo{constructor(l,s={}){super(),mv(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],l,this),this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=dn.create("translator")}changeLanguage(l){l&&(this.language=l)}exists(l,s={interpolation:{}}){const i={...s};if(l==null)return!1;const o=this.resolve(l,i);if(o?.res===void 0)return!1;const u=Lu(o.res);return!(i.returnObjects===!1&&u)}extractFromKey(l,s){let i=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let u=s.ns||this.options.defaultNS||[];const m=i&&l.indexOf(i)>-1,p=!this.options.userDefinedKeySeparator&&!s.keySeparator&&!this.options.userDefinedNsSeparator&&!s.nsSeparator&&!_v(l,i,o);if(m&&!p){const g=l.match(this.interpolator.nestingRegexp);if(g&&g.length>0)return{key:l,namespaces:Oe(u)?[u]:u};const h=l.split(i);(i!==o||i===o&&this.options.ns.indexOf(h[0])>-1)&&(u=h.shift()),l=h.join(o)}return{key:l,namespaces:Oe(u)?[u]:u}}translate(l,s,i){let o=typeof s=="object"?{...s}:s;if(typeof o!="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),typeof o=="object"&&(o={...o}),o||(o={}),l==null)return"";typeof l=="function"&&(l=sd(l,{...this.options,...o})),Array.isArray(l)||(l=[String(l)]);const u=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,m=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,{key:p,namespaces:g}=this.extractFromKey(l[l.length-1],o),h=g[g.length-1];let v=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;v===void 0&&(v=":");const y=o.lng||this.language,_=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(y?.toLowerCase()==="cimode")return _?u?{res:`${h}${v}${p}`,usedKey:p,exactUsedKey:p,usedLng:y,usedNS:h,usedParams:this.getUsedParamsDetails(o)}:`${h}${v}${p}`:u?{res:p,usedKey:p,exactUsedKey:p,usedLng:y,usedNS:h,usedParams:this.getUsedParamsDetails(o)}:p;const j=this.resolve(l,o);let N=j?.res;const T=j?.usedKey||p,D=j?.exactUsedKey||p,Y=["[object Number]","[object Function]","[object RegExp]"],Z=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,G=!this.i18nFormat||this.i18nFormat.handleAsObject,V=o.count!==void 0&&!Oe(o.count),Q=xo.hasDefaultValue(o),ae=V?this.pluralResolver.getSuffix(y,o.count,o):"",W=o.ordinal&&V?this.pluralResolver.getSuffix(y,o.count,{ordinal:!1}):"",w=V&&!o.ordinal&&o.count===0,$=w&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${ae}`]||o[`defaultValue${W}`]||o.defaultValue;let te=N;G&&!N&&Q&&(te=$);const fe=Lu(te),oe=Object.prototype.toString.apply(te);if(G&&te&&fe&&Y.indexOf(oe)<0&&!(Oe(Z)&&Array.isArray(te))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const re=this.options.returnedObjectHandler?this.options.returnedObjectHandler(T,te,{...o,ns:g}):`key '${p} (${this.language})' returned an object instead of string.`;return u?(j.res=re,j.usedParams=this.getUsedParamsDetails(o),j):re}if(m){const re=Array.isArray(te),de=re?[]:{},pe=re?D:T;for(const k in te)if(Object.prototype.hasOwnProperty.call(te,k)){const P=`${pe}${m}${k}`;Q&&!N?de[k]=this.translate(P,{...o,defaultValue:Lu($)?$[k]:void 0,joinArrays:!1,ns:g}):de[k]=this.translate(P,{...o,joinArrays:!1,ns:g}),de[k]===P&&(de[k]=te[k])}N=de}}else if(G&&Oe(Z)&&Array.isArray(N))N=N.join(Z),N&&(N=this.extendTranslation(N,l,o,i));else{let re=!1,de=!1;!this.isValidLookup(N)&&Q&&(re=!0,N=$),this.isValidLookup(N)||(de=!0,N=p);const k=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&de?void 0:N,P=Q&&$!==N&&this.options.updateMissing;if(de||re||P){if(this.logger.log(P?"updateKey":"missingKey",y,h,p,P?$:N),m){const E=this.resolve(p,{...o,keySeparator:!1});E&&E.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 J=[];const ce=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ce&&ce[0])for(let E=0;E<ce.length;E++)J.push(ce[E]);else this.options.saveMissingTo==="all"?J=this.languageUtils.toResolveHierarchy(o.lng||this.language):J.push(o.lng||this.language);const Se=(E,U,ee)=>{const le=Q&&ee!==N?ee:k;this.options.missingKeyHandler?this.options.missingKeyHandler(E,h,U,le,P,o):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(E,h,U,le,P,o),this.emit("missingKey",E,h,U,N)};this.options.saveMissing&&(this.options.saveMissingPlurals&&V?J.forEach(E=>{const U=this.pluralResolver.getSuffixes(E,o);w&&o[`defaultValue${this.options.pluralSeparator}zero`]&&U.indexOf(`${this.options.pluralSeparator}zero`)<0&&U.push(`${this.options.pluralSeparator}zero`),U.forEach(ee=>{Se([E],p+ee,o[`defaultValue${ee}`]||$)})}):Se(J,p,$))}N=this.extendTranslation(N,l,o,j,i),de&&N===p&&this.options.appendNamespaceToMissingKey&&(N=`${h}${v}${p}`),(de||re)&&this.options.parseMissingKeyHandler&&(N=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${v}${p}`:p,re?N:void 0,o))}return u?(j.res=N,j.usedParams=this.getUsedParamsDetails(o),j):N}extendTranslation(l,s,i,o,u){if(this.i18nFormat?.parse)l=this.i18nFormat.parse(l,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const g=Oe(l)&&(i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(g){const y=l.match(this.interpolator.nestingRegexp);h=y&&y.length}let v=i.replace&&!Oe(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(v={...this.options.interpolation.defaultVariables,...v}),l=this.interpolator.interpolate(l,v,i.lng||this.language||o.usedLng,i),g){const y=l.match(this.interpolator.nestingRegexp),_=y&&y.length;h<_&&(i.nest=!1)}!i.lng&&o&&o.res&&(i.lng=this.language||o.usedLng),i.nest!==!1&&(l=this.interpolator.nest(l,(...y)=>u?.[0]===y[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${y[0]} in key: ${s[0]}`),null):this.translate(...y,s),i)),i.interpolation&&this.interpolator.reset()}const m=i.postProcess||this.options.postProcess,p=Oe(m)?[m]:m;return l!=null&&p?.length&&i.applyPostProcessor!==!1&&(l=Vg.handle(p,l,s,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),l}resolve(l,s={}){let i,o,u,m,p;return Oe(l)&&(l=[l]),l.forEach(g=>{if(this.isValidLookup(i))return;const h=this.extractFromKey(g,s),v=h.key;o=v;let y=h.namespaces;this.options.fallbackNS&&(y=y.concat(this.options.fallbackNS));const _=s.count!==void 0&&!Oe(s.count),j=_&&!s.ordinal&&s.count===0,N=s.context!==void 0&&(Oe(s.context)||typeof s.context=="number")&&s.context!=="",T=s.lngs?s.lngs:this.languageUtils.toResolveHierarchy(s.lng||this.language,s.fallbackLng);y.forEach(D=>{this.isValidLookup(i)||(p=D,!_p[`${T[0]}-${D}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(p)&&(_p[`${T[0]}-${D}`]=!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(Y=>{if(this.isValidLookup(i))return;m=Y;const Z=[v];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(Z,v,Y,D,s);else{let V;_&&(V=this.pluralResolver.getSuffix(Y,s.count,s));const Q=`${this.options.pluralSeparator}zero`,ae=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(_&&(s.ordinal&&V.indexOf(ae)===0&&Z.push(v+V.replace(ae,this.options.pluralSeparator)),Z.push(v+V),j&&Z.push(v+Q)),N){const W=`${v}${this.options.contextSeparator||"_"}${s.context}`;Z.push(W),_&&(s.ordinal&&V.indexOf(ae)===0&&Z.push(W+V.replace(ae,this.options.pluralSeparator)),Z.push(W+V),j&&Z.push(W+Q))}}let G;for(;G=Z.pop();)this.isValidLookup(i)||(u=G,i=this.getResource(Y,D,G,s))}))})}),{res:i,usedKey:o,exactUsedKey:u,usedLng:m,usedNS:p}}isValidLookup(l){return l!==void 0&&!(!this.options.returnNull&&l===null)&&!(!this.options.returnEmptyString&&l==="")}getResource(l,s,i,o={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(l,s,i,o):this.resourceStore.getResource(l,s,i,o)}getUsedParamsDetails(l={}){const s=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=l.replace&&!Oe(l.replace);let o=i?l.replace:l;if(i&&typeof l.count<"u"&&(o.count=l.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!i){o={...o};for(const u of s)delete o[u]}return o}static hasDefaultValue(l){const s="defaultValue";for(const i in l)if(Object.prototype.hasOwnProperty.call(l,i)&&s===i.substring(0,s.length)&&l[i]!==void 0)return!0;return!1}}class jp{constructor(l){this.options=l,this.supportedLngs=this.options.supportedLngs||!1,this.logger=dn.create("languageUtils")}getScriptPartFromCode(l){if(l=As(l),!l||l.indexOf("-")<0)return null;const s=l.split("-");return s.length===2||(s.pop(),s[s.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(s.join("-"))}getLanguagePartFromCode(l){if(l=As(l),!l||l.indexOf("-")<0)return l;const s=l.split("-");return this.formatLanguageCode(s[0])}formatLanguageCode(l){if(Oe(l)&&l.indexOf("-")>-1){let s;try{s=Intl.getCanonicalLocales(l)[0]}catch{}return s&&this.options.lowerCaseLng&&(s=s.toLowerCase()),s||(this.options.lowerCaseLng?l.toLowerCase():l)}return this.options.cleanCode||this.options.lowerCaseLng?l.toLowerCase():l}isSupportedCode(l){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(l=this.getLanguagePartFromCode(l)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(l)>-1}getBestMatchFromCodes(l){if(!l)return null;let s;return l.forEach(i=>{if(s)return;const o=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(o))&&(s=o)}),!s&&this.options.supportedLngs&&l.forEach(i=>{if(s)return;const o=this.getScriptPartFromCode(i);if(this.isSupportedCode(o))return s=o;const u=this.getLanguagePartFromCode(i);if(this.isSupportedCode(u))return s=u;s=this.options.supportedLngs.find(m=>{if(m===u)return m;if(!(m.indexOf("-")<0&&u.indexOf("-")<0)&&(m.indexOf("-")>0&&u.indexOf("-")<0&&m.substring(0,m.indexOf("-"))===u||m.indexOf(u)===0&&u.length>1))return m})}),s||(s=this.getFallbackCodes(this.options.fallbackLng)[0]),s}getFallbackCodes(l,s){if(!l)return[];if(typeof l=="function"&&(l=l(s)),Oe(l)&&(l=[l]),Array.isArray(l))return l;if(!s)return l.default||[];let i=l[s];return i||(i=l[this.getScriptPartFromCode(s)]),i||(i=l[this.formatLanguageCode(s)]),i||(i=l[this.getLanguagePartFromCode(s)]),i||(i=l.default),i||[]}toResolveHierarchy(l,s){const i=this.getFallbackCodes((s===!1?[]:s)||this.options.fallbackLng||[],l),o=[],u=m=>{m&&(this.isSupportedCode(m)?o.push(m):this.logger.warn(`rejecting language code not found in supportedLngs: ${m}`))};return Oe(l)&&(l.indexOf("-")>-1||l.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&u(this.formatLanguageCode(l)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&u(this.getScriptPartFromCode(l)),this.options.load!=="currentOnly"&&u(this.getLanguagePartFromCode(l))):Oe(l)&&u(this.formatLanguageCode(l)),i.forEach(m=>{o.indexOf(m)<0&&u(this.formatLanguageCode(m))}),o}}const Np={zero:0,one:1,two:2,few:3,many:4,other:5},wp={select:n=>n===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class wv{constructor(l,s={}){this.languageUtils=l,this.options=s,this.logger=dn.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(l,s={}){const i=As(l==="dev"?"en":l),o=s.ordinal?"ordinal":"cardinal",u=JSON.stringify({cleanedCode:i,type:o});if(u in this.pluralRulesCache)return this.pluralRulesCache[u];let m;try{m=new Intl.PluralRules(i,{type:o})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),wp;if(!l.match(/-|_/))return wp;const g=this.languageUtils.getLanguagePartFromCode(l);m=this.getRule(g,s)}return this.pluralRulesCache[u]=m,m}needsPlural(l,s={}){let i=this.getRule(l,s);return i||(i=this.getRule("dev",s)),i?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(l,s,i={}){return this.getSuffixes(l,i).map(o=>`${s}${o}`)}getSuffixes(l,s={}){let i=this.getRule(l,s);return i||(i=this.getRule("dev",s)),i?i.resolvedOptions().pluralCategories.sort((o,u)=>Np[o]-Np[u]).map(o=>`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(l,s,i={}){const o=this.getRule(l,i);return o?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${o.select(s)}`:(this.logger.warn(`no plural rule found for: ${l}`),this.getSuffix("dev",s,i))}}const Ep=(n,l,s,i=".",o=!0)=>{let u=gv(n,l,s);return!u&&o&&Oe(s)&&(u=rd(n,s,i),u===void 0&&(u=rd(l,s,i))),u},Uu=n=>n.replace(/\$/g,"$$$$");class Cp{constructor(l={}){this.logger=dn.create("interpolator"),this.options=l,this.format=l?.interpolation?.format||(s=>s),this.init(l)}init(l={}){l.interpolation||(l.interpolation={escapeValue:!0});const{escape:s,escapeValue:i,useRawValueToEscape:o,prefix:u,prefixEscaped:m,suffix:p,suffixEscaped:g,formatSeparator:h,unescapeSuffix:v,unescapePrefix:y,nestingPrefix:_,nestingPrefixEscaped:j,nestingSuffix:N,nestingSuffixEscaped:T,nestingOptionsSeparator:D,maxReplaces:Y,alwaysFormat:Z}=l.interpolation;this.escape=s!==void 0?s:yv,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=u?zl(u):m||"{{",this.suffix=p?zl(p):g||"}}",this.formatSeparator=h||",",this.unescapePrefix=v?"":y||"-",this.unescapeSuffix=this.unescapePrefix?"":v||"",this.nestingPrefix=_?zl(_):j||zl("$t("),this.nestingSuffix=N?zl(N):T||zl(")"),this.nestingOptionsSeparator=D||",",this.maxReplaces=Y||1e3,this.alwaysFormat=Z!==void 0?Z:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const l=(s,i)=>s?.source===i?(s.lastIndex=0,s):new RegExp(i,"g");this.regexp=l(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=l(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=l(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(l,s,i,o){let u,m,p;const g=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=j=>{if(j.indexOf(this.formatSeparator)<0){const Y=Ep(s,g,j,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(Y,void 0,i,{...o,...s,interpolationkey:j}):Y}const N=j.split(this.formatSeparator),T=N.shift().trim(),D=N.join(this.formatSeparator).trim();return this.format(Ep(s,g,T,this.options.keySeparator,this.options.ignoreJSONStructure),D,i,{...o,...s,interpolationkey:T})};this.resetRegExp();const v=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,y=o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:j=>Uu(j)},{regex:this.regexp,safeValue:j=>this.escapeValue?Uu(this.escape(j)):Uu(j)}].forEach(j=>{for(p=0;u=j.regex.exec(l);){const N=u[1].trim();if(m=h(N),m===void 0)if(typeof v=="function"){const D=v(l,u,o);m=Oe(D)?D:""}else if(o&&Object.prototype.hasOwnProperty.call(o,N))m="";else if(y){m=u[0];continue}else this.logger.warn(`missed to pass in variable ${N} for interpolating ${l}`),m="";else!Oe(m)&&!this.useRawValueToEscape&&(m=xp(m));const T=j.safeValue(m);if(l=l.replace(u[0],T),y?(j.regex.lastIndex+=m.length,j.regex.lastIndex-=u[0].length):j.regex.lastIndex=0,p++,p>=this.maxReplaces)break}}),l}nest(l,s,i={}){let o,u,m;const p=(g,h)=>{const v=this.nestingOptionsSeparator;if(g.indexOf(v)<0)return g;const y=g.split(new RegExp(`${zl(v)}[ ]*{`));let _=`{${y[1]}`;g=y[0],_=this.interpolate(_,m);const j=_.match(/'/g),N=_.match(/"/g);((j?.length??0)%2===0&&!N||(N?.length??0)%2!==0)&&(_=_.replace(/'/g,'"'));try{m=JSON.parse(_),h&&(m={...h,...m})}catch(T){return this.logger.warn(`failed parsing options string in nesting for key ${g}`,T),`${g}${v}${_}`}return m.defaultValue&&m.defaultValue.indexOf(this.prefix)>-1&&delete m.defaultValue,g};for(;o=this.nestingRegexp.exec(l);){let g=[];m={...i},m=m.replace&&!Oe(m.replace)?m.replace:m,m.applyPostProcessor=!1,delete m.defaultValue;const h=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(h!==-1&&(g=o[1].slice(h).split(this.formatSeparator).map(v=>v.trim()).filter(Boolean),o[1]=o[1].slice(0,h)),u=s(p.call(this,o[1].trim(),m),m),u&&o[0]===l&&!Oe(u))return u;Oe(u)||(u=xp(u)),u||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${l}`),u=""),g.length&&(u=g.reduce((v,y)=>this.format(v,y,i.lng,{...i,interpolationkey:o[1].trim()}),u.trim())),l=l.replace(o[0],u),this.regexp.lastIndex=0}return l}}const Ev=n=>{let l=n.toLowerCase().trim();const s={};if(n.indexOf("(")>-1){const i=n.split("(");l=i[0].toLowerCase().trim();const o=i[1].substring(0,i[1].length-1);l==="currency"&&o.indexOf(":")<0?s.currency||(s.currency=o.trim()):l==="relativetime"&&o.indexOf(":")<0?s.range||(s.range=o.trim()):o.split(";").forEach(m=>{if(m){const[p,...g]=m.split(":"),h=g.join(":").trim().replace(/^'+|'+$/g,""),v=p.trim();s[v]||(s[v]=h),h==="false"&&(s[v]=!1),h==="true"&&(s[v]=!0),isNaN(h)||(s[v]=parseInt(h,10))}})}return{formatName:l,formatOptions:s}},Rp=n=>{const l={};return(s,i,o)=>{let u=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(u={...u,[o.interpolationkey]:void 0});const m=i+JSON.stringify(u);let p=l[m];return p||(p=n(As(i),o),l[m]=p),p(s)}},Cv=n=>(l,s,i)=>n(As(s),i)(l);class Rv{constructor(l={}){this.logger=dn.create("formatter"),this.options=l,this.init(l)}init(l,s={interpolation:{}}){this.formatSeparator=s.interpolation.formatSeparator||",";const i=s.cacheInBuiltFormats?Rp:Cv;this.formats={number:i((o,u)=>{const m=new Intl.NumberFormat(o,{...u});return p=>m.format(p)}),currency:i((o,u)=>{const m=new Intl.NumberFormat(o,{...u,style:"currency"});return p=>m.format(p)}),datetime:i((o,u)=>{const m=new Intl.DateTimeFormat(o,{...u});return p=>m.format(p)}),relativetime:i((o,u)=>{const m=new Intl.RelativeTimeFormat(o,{...u});return p=>m.format(p,u.range||"day")}),list:i((o,u)=>{const m=new Intl.ListFormat(o,{...u});return p=>m.format(p)})}}add(l,s){this.formats[l.toLowerCase().trim()]=s}addCached(l,s){this.formats[l.toLowerCase().trim()]=Rp(s)}format(l,s,i,o={}){const u=s.split(this.formatSeparator);if(u.length>1&&u[0].indexOf("(")>1&&u[0].indexOf(")")<0&&u.find(p=>p.indexOf(")")>-1)){const p=u.findIndex(g=>g.indexOf(")")>-1);u[0]=[u[0],...u.splice(1,p)].join(this.formatSeparator)}return u.reduce((p,g)=>{const{formatName:h,formatOptions:v}=Ev(g);if(this.formats[h]){let y=p;try{const _=o?.formatParams?.[o.interpolationkey]||{},j=_.locale||_.lng||o.locale||o.lng||i;y=this.formats[h](p,j,{...v,...o,..._})}catch(_){this.logger.warn(_)}return y}else this.logger.warn(`there was no format function for ${h}`);return p},l)}}const Tv=(n,l)=>{n.pending[l]!==void 0&&(delete n.pending[l],n.pendingCount--)};class zv extends bo{constructor(l,s,i,o={}){super(),this.backend=l,this.store=s,this.services=i,this.languageUtils=i.languageUtils,this.options=o,this.logger=dn.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(i,o.backend,o)}queueLoad(l,s,i,o){const u={},m={},p={},g={};return l.forEach(h=>{let v=!0;s.forEach(y=>{const _=`${h}|${y}`;!i.reload&&this.store.hasResourceBundle(h,y)?this.state[_]=2:this.state[_]<0||(this.state[_]===1?m[_]===void 0&&(m[_]=!0):(this.state[_]=1,v=!1,m[_]===void 0&&(m[_]=!0),u[_]===void 0&&(u[_]=!0),g[y]===void 0&&(g[y]=!0)))}),v||(p[h]=!0)}),(Object.keys(u).length||Object.keys(m).length)&&this.queue.push({pending:m,pendingCount:Object.keys(m).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(u),pending:Object.keys(m),toLoadLanguages:Object.keys(p),toLoadNamespaces:Object.keys(g)}}loaded(l,s,i){const o=l.split("|"),u=o[0],m=o[1];s&&this.emit("failedLoading",u,m,s),!s&&i&&this.store.addResourceBundle(u,m,i,void 0,void 0,{skipCopy:!0}),this.state[l]=s?-1:2,s&&i&&(this.state[l]=0);const p={};this.queue.forEach(g=>{pv(g.loaded,[u],m),Tv(g,l),s&&g.errors.push(s),g.pendingCount===0&&!g.done&&(Object.keys(g.loaded).forEach(h=>{p[h]||(p[h]={});const v=g.loaded[h];v.length&&v.forEach(y=>{p[h][y]===void 0&&(p[h][y]=!0)})}),g.done=!0,g.errors.length?g.callback(g.errors):g.callback())}),this.emit("loaded",p),this.queue=this.queue.filter(g=>!g.done)}read(l,s,i,o=0,u=this.retryTimeout,m){if(!l.length)return m(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:l,ns:s,fcName:i,tried:o,wait:u,callback:m});return}this.readingCalls++;const p=(h,v)=>{if(this.readingCalls--,this.waitingReads.length>0){const y=this.waitingReads.shift();this.read(y.lng,y.ns,y.fcName,y.tried,y.wait,y.callback)}if(h&&v&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,l,s,i,o+1,u*2,m)},u);return}m(h,v)},g=this.backend[i].bind(this.backend);if(g.length===2){try{const h=g(l,s);h&&typeof h.then=="function"?h.then(v=>p(null,v)).catch(p):p(null,h)}catch(h){p(h)}return}return g(l,s,p)}prepareLoading(l,s,i={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();Oe(l)&&(l=this.languageUtils.toResolveHierarchy(l)),Oe(s)&&(s=[s]);const u=this.queueLoad(l,s,i,o);if(!u.toLoad.length)return u.pending.length||o(),null;u.toLoad.forEach(m=>{this.loadOne(m)})}load(l,s,i){this.prepareLoading(l,s,{},i)}reload(l,s,i){this.prepareLoading(l,s,{reload:!0},i)}loadOne(l,s=""){const i=l.split("|"),o=i[0],u=i[1];this.read(o,u,"read",void 0,void 0,(m,p)=>{m&&this.logger.warn(`${s}loading namespace ${u} for language ${o} failed`,m),!m&&p&&this.logger.log(`${s}loaded namespace ${u} for language ${o}`,p),this.loaded(l,m,p)})}saveMissing(l,s,i,o,u,m={},p=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(s)){this.logger.warn(`did not save key "${i}" as the namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if(this.backend?.create){const g={...m,isUpdate:u},h=this.backend.create.bind(this.backend);if(h.length<6)try{let v;h.length===5?v=h(l,s,i,o,g):v=h(l,s,i,o),v&&typeof v.then=="function"?v.then(y=>p(null,y)).catch(p):p(null,v)}catch(v){p(v)}else h(l,s,i,o,p,g)}!l||!l[0]||this.store.addResource(l[0],s,i,o)}}}const Hu=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:n=>{let l={};if(typeof n[1]=="object"&&(l=n[1]),Oe(n[1])&&(l.defaultValue=n[1]),Oe(n[2])&&(l.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const s=n[3]||n[2];Object.keys(s).forEach(i=>{l[i]=s[i]})}return l},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Tp=n=>(Oe(n.ns)&&(n.ns=[n.ns]),Oe(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),Oe(n.fallbackNS)&&(n.fallbackNS=[n.fallbackNS]),n.supportedLngs?.indexOf?.("cimode")<0&&(n.supportedLngs=n.supportedLngs.concat(["cimode"])),typeof n.initImmediate=="boolean"&&(n.initAsync=n.initImmediate),n),no=()=>{},Ov=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(s=>{typeof n[s]=="function"&&(n[s]=n[s].bind(n))})},Xg="__i18next_supportNoticeShown",Dv=()=>typeof globalThis<"u"&&!!globalThis[Xg],Mv=()=>{typeof globalThis<"u"&&(globalThis[Xg]=!0)},kv=n=>!!(n?.modules?.backend?.name?.indexOf("Locize")>0||n?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||n?.options?.backend?.backends&&n.options.backend.backends.some(l=>l?.name?.indexOf("Locize")>0||l?.constructor?.name?.indexOf("Locize")>0)||n?.options?.backend?.projectId||n?.options?.backend?.backendOptions&&n.options.backend.backendOptions.some(l=>l?.projectId));class Ms extends bo{constructor(l={},s){if(super(),this.options=Tp(l),this.services={},this.logger=dn,this.modules={external:[]},Ov(this),s&&!this.isInitialized&&!l.isClone){if(!this.options.initAsync)return this.init(l,s),this;setTimeout(()=>{this.init(l,s)},0)}}init(l={},s){this.isInitializing=!0,typeof l=="function"&&(s=l,l={}),l.defaultNS==null&&l.ns&&(Oe(l.ns)?l.defaultNS=l.ns:l.ns.indexOf("translation")<0&&(l.defaultNS=l.ns[0]));const i=Hu();this.options={...i,...this.options,...Tp(l)},this.options.interpolation={...i.interpolation,...this.options.interpolation},l.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=l.keySeparator),l.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=l.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!kv(this)&&!Dv()&&(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 💙"),Mv());const o=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?dn.init(o(this.modules.logger),this.options):dn.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:h=Rv;const v=new jp(this.options);this.store=new Sp(this.options.resources,this.options);const y=this.services;y.logger=dn,y.resourceStore=this.store,y.languageUtils=v,y.pluralResolver=new wv(v,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),h&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(y.formatter=o(h),y.formatter.init&&y.formatter.init(y,this.options),this.options.interpolation.format=y.formatter.format.bind(y.formatter)),y.interpolator=new Cp(this.options),y.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},y.backendConnector=new zv(o(this.modules.backend),y.resourceStore,y,this.options),y.backendConnector.on("*",(j,...N)=>{this.emit(j,...N)}),this.modules.languageDetector&&(y.languageDetector=o(this.modules.languageDetector),y.languageDetector.init&&y.languageDetector.init(y,this.options.detection,this.options)),this.modules.i18nFormat&&(y.i18nFormat=o(this.modules.i18nFormat),y.i18nFormat.init&&y.i18nFormat.init(this)),this.translator=new xo(this.services,this.options),this.translator.on("*",(j,...N)=>{this.emit(j,...N)}),this.modules.external.forEach(j=>{j.init&&j.init(this)})}if(this.format=this.options.interpolation.format,s||(s=no),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(h=>{this[h]=(...v)=>this.store[h](...v)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=(...v)=>(this.store[h](...v),this)});const p=Ns(),g=()=>{const h=(v,y)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),p.resolve(y),s(v,y)};if(this.languages&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initAsync?g():setTimeout(g,0),p}loadResources(l,s=no){let i=s;const o=Oe(l)?l:this.language;if(typeof l=="function"&&(i=l),!this.options.resources||this.options.partialBundledLanguages){if(o?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const u=[],m=p=>{if(!p||p==="cimode")return;this.services.languageUtils.toResolveHierarchy(p).forEach(h=>{h!=="cimode"&&u.indexOf(h)<0&&u.push(h)})};o?m(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(g=>m(g)),this.options.preload?.forEach?.(p=>m(p)),this.services.backendConnector.load(u,this.options.ns,p=>{!p&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(p)})}else i(null)}reloadResources(l,s,i){const o=Ns();return typeof l=="function"&&(i=l,l=void 0),typeof s=="function"&&(i=s,s=void 0),l||(l=this.languages),s||(s=this.options.ns),i||(i=no),this.services.backendConnector.reload(l,s,u=>{o.resolve(),i(u)}),o}use(l){if(!l)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!l.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return l.type==="backend"&&(this.modules.backend=l),(l.type==="logger"||l.log&&l.warn&&l.error)&&(this.modules.logger=l),l.type==="languageDetector"&&(this.modules.languageDetector=l),l.type==="i18nFormat"&&(this.modules.i18nFormat=l),l.type==="postProcessor"&&Vg.addPostProcessor(l),l.type==="formatter"&&(this.modules.formatter=l),l.type==="3rdParty"&&this.modules.external.push(l),this}setResolvedLanguage(l){if(!(!l||!this.languages)&&!(["cimode","dev"].indexOf(l)>-1)){for(let s=0;s<this.languages.length;s++){const i=this.languages[s];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&this.languages.indexOf(l)<0&&this.store.hasLanguageSomeTranslations(l)&&(this.resolvedLanguage=l,this.languages.unshift(l))}}changeLanguage(l,s){this.isLanguageChangingTo=l;const i=Ns();this.emit("languageChanging",l);const o=p=>{this.language=p,this.languages=this.services.languageUtils.toResolveHierarchy(p),this.resolvedLanguage=void 0,this.setResolvedLanguage(p)},u=(p,g)=>{g?this.isLanguageChangingTo===l&&(o(g),this.translator.changeLanguage(g),this.isLanguageChangingTo=void 0,this.emit("languageChanged",g),this.logger.log("languageChanged",g)):this.isLanguageChangingTo=void 0,i.resolve((...h)=>this.t(...h)),s&&s(p,(...h)=>this.t(...h))},m=p=>{!l&&!p&&this.services.languageDetector&&(p=[]);const g=Oe(p)?p:p&&p[0],h=this.store.hasLanguageSomeTranslations(g)?g:this.services.languageUtils.getBestMatchFromCodes(Oe(p)?[p]:p);h&&(this.language||o(h),this.translator.language||this.translator.changeLanguage(h),this.services.languageDetector?.cacheUserLanguage?.(h)),this.loadResources(h,v=>{u(v,h)})};return!l&&this.services.languageDetector&&!this.services.languageDetector.async?m(this.services.languageDetector.detect()):!l&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(m):this.services.languageDetector.detect(m):m(l),i}getFixedT(l,s,i){const o=(u,m,...p)=>{let g;typeof m!="object"?g=this.options.overloadTranslationOptionHandler([u,m].concat(p)):g={...m},g.lng=g.lng||o.lng,g.lngs=g.lngs||o.lngs,g.ns=g.ns||o.ns,g.keyPrefix!==""&&(g.keyPrefix=g.keyPrefix||i||o.keyPrefix);const h=this.options.keySeparator||".";let v;return g.keyPrefix&&Array.isArray(u)?v=u.map(y=>(typeof y=="function"&&(y=sd(y,{...this.options,...m})),`${g.keyPrefix}${h}${y}`)):(typeof u=="function"&&(u=sd(u,{...this.options,...m})),v=g.keyPrefix?`${g.keyPrefix}${h}${u}`:u),this.t(v,g)};return Oe(l)?o.lng=l:o.lngs=l,o.ns=s,o.keyPrefix=i,o}t(...l){return this.translator?.translate(...l)}exists(...l){return this.translator?.exists(...l)}setDefaultNamespace(l){this.options.defaultNS=l}hasLoadedNamespace(l,s={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=s.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const m=(p,g)=>{const h=this.services.backendConnector.state[`${p}|${g}`];return h===-1||h===0||h===2};if(s.precheck){const p=s.precheck(this,m);if(p!==void 0)return p}return!!(this.hasResourceBundle(i,l)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||m(i,l)&&(!o||m(u,l)))}loadNamespaces(l,s){const i=Ns();return this.options.ns?(Oe(l)&&(l=[l]),l.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{i.resolve(),s&&s(o)}),i):(s&&s(),Promise.resolve())}loadLanguages(l,s){const i=Ns();Oe(l)&&(l=[l]);const o=this.options.preload||[],u=l.filter(m=>o.indexOf(m)<0&&this.services.languageUtils.isSupportedCode(m));return u.length?(this.options.preload=o.concat(u),this.loadResources(m=>{i.resolve(),s&&s(m)}),i):(s&&s(),Promise.resolve())}dir(l){if(l||(l=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!l)return"rtl";try{const o=new Intl.Locale(l);if(o&&o.getTextInfo){const u=o.getTextInfo();if(u&&u.direction)return u.direction}}catch{}const s=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=this.services?.languageUtils||new jp(Hu());return l.toLowerCase().indexOf("-latn")>1?"ltr":s.indexOf(i.getLanguagePartFromCode(l))>-1||l.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(l={},s){const i=new Ms(l,s);return i.createInstance=Ms.createInstance,i}cloneInstance(l={},s=no){const i=l.forkResourceStore;i&&delete l.forkResourceStore;const o={...this.options,...l,isClone:!0},u=new Ms(o);if((l.debug!==void 0||l.prefix!==void 0)&&(u.logger=u.logger.clone(l)),["store","services","language"].forEach(p=>{u[p]=this[p]}),u.services={...this.services},u.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},i){const p=Object.keys(this.store.data).reduce((g,h)=>(g[h]={...this.store.data[h]},g[h]=Object.keys(g[h]).reduce((v,y)=>(v[y]={...g[h][y]},v),g[h]),g),{});u.store=new Sp(p,o),u.services.resourceStore=u.store}if(l.interpolation){const g={...Hu().interpolation,...this.options.interpolation,...l.interpolation},h={...o,interpolation:g};u.services.interpolator=new Cp(h)}return u.translator=new xo(u.services,o),u.translator.on("*",(p,...g)=>{u.emit(p,...g)}),u.init(o,s),u.translator.options=o,u.translator.backendConnector.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const da=Ms.createInstance();da.createInstance;da.dir;da.init;da.loadResources;da.reloadResources;da.use;da.changeLanguage;da.getFixedT;da.t;da.exists;da.setDefaultNamespace;da.hasLoadedNamespace;da.loadNamespaces;da.loadLanguages;var Bu={exports:{}},Me={};var zp;function Av(){if(zp)return Me;zp=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),m=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),_=Symbol.iterator;function j(E){return E===null||typeof E!="object"?null:(E=_&&E[_]||E["@@iterator"],typeof E=="function"?E:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,D={};function Y(E,U,ee){this.props=E,this.context=U,this.refs=D,this.updater=ee||N}Y.prototype.isReactComponent={},Y.prototype.setState=function(E,U){if(typeof E!="object"&&typeof E!="function"&&E!=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,E,U,"setState")},Y.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function Z(){}Z.prototype=Y.prototype;function G(E,U,ee){this.props=E,this.context=U,this.refs=D,this.updater=ee||N}var V=G.prototype=new Z;V.constructor=G,T(V,Y.prototype),V.isPureReactComponent=!0;var Q=Array.isArray;function ae(){}var W={H:null,A:null,T:null,S:null},w=Object.prototype.hasOwnProperty;function $(E,U,ee){var le=ee.ref;return{$$typeof:n,type:E,key:U,ref:le!==void 0?le:null,props:ee}}function te(E,U){return $(E.type,U,E.props)}function fe(E){return typeof E=="object"&&E!==null&&E.$$typeof===n}function oe(E){var U={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(ee){return U[ee]})}var re=/\/+/g;function de(E,U){return typeof E=="object"&&E!==null&&E.key!=null?oe(""+E.key):U.toString(36)}function pe(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(ae,ae):(E.status="pending",E.then(function(U){E.status==="pending"&&(E.status="fulfilled",E.value=U)},function(U){E.status==="pending"&&(E.status="rejected",E.reason=U)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function k(E,U,ee,le,be){var Ne=typeof E;(Ne==="undefined"||Ne==="boolean")&&(E=null);var ze=!1;if(E===null)ze=!0;else switch(Ne){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(E.$$typeof){case n:case l:ze=!0;break;case v:return ze=E._init,k(ze(E._payload),U,ee,le,be)}}if(ze)return be=be(E),ze=le===""?"."+de(E,0):le,Q(be)?(ee="",ze!=null&&(ee=ze.replace(re,"$&/")+"/"),k(be,U,ee,"",function(It){return It})):be!=null&&(fe(be)&&(be=te(be,ee+(be.key==null||E&&E.key===be.key?"":(""+be.key).replace(re,"$&/")+"/")+ze)),U.push(be)),1;ze=0;var Pe=le===""?".":le+":";if(Q(E))for(var Qe=0;Qe<E.length;Qe++)le=E[Qe],Ne=Pe+de(le,Qe),ze+=k(le,U,ee,Ne,be);else if(Qe=j(E),typeof Qe=="function")for(E=Qe.call(E),Qe=0;!(le=E.next()).done;)le=le.value,Ne=Pe+de(le,Qe++),ze+=k(le,U,ee,Ne,be);else if(Ne==="object"){if(typeof E.then=="function")return k(pe(E),U,ee,le,be);throw U=String(E),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return ze}function P(E,U,ee){if(E==null)return E;var le=[],be=0;return k(E,le,"","",function(Ne){return U.call(ee,Ne,be++)}),le}function J(E){if(E._status===-1){var U=E._result;U=U(),U.then(function(ee){(E._status===0||E._status===-1)&&(E._status=1,E._result=ee)},function(ee){(E._status===0||E._status===-1)&&(E._status=2,E._result=ee)}),E._status===-1&&(E._status=0,E._result=U)}if(E._status===1)return E._result.default;throw E._result}var ce=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=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(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)},Se={map:P,forEach:function(E,U,ee){P(E,function(){U.apply(this,arguments)},ee)},count:function(E){var U=0;return P(E,function(){U++}),U},toArray:function(E){return P(E,function(U){return U})||[]},only:function(E){if(!fe(E))throw Error("React.Children.only expected to receive a single React element child.");return E}};return Me.Activity=y,Me.Children=Se,Me.Component=Y,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=W,Me.__COMPILER_RUNTIME={__proto__:null,c:function(E){return W.H.useMemoCache(E)}},Me.cache=function(E){return function(){return E.apply(null,arguments)}},Me.cacheSignal=function(){return null},Me.cloneElement=function(E,U,ee){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var le=T({},E.props),be=E.key;if(U!=null)for(Ne in U.key!==void 0&&(be=""+U.key),U)!w.call(U,Ne)||Ne==="key"||Ne==="__self"||Ne==="__source"||Ne==="ref"&&U.ref===void 0||(le[Ne]=U[Ne]);var Ne=arguments.length-2;if(Ne===1)le.children=ee;else if(1<Ne){for(var ze=Array(Ne),Pe=0;Pe<Ne;Pe++)ze[Pe]=arguments[Pe+2];le.children=ze}return $(E.type,be,le)},Me.createContext=function(E){return E={$$typeof:m,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:u,_context:E},E},Me.createElement=function(E,U,ee){var le,be={},Ne=null;if(U!=null)for(le in U.key!==void 0&&(Ne=""+U.key),U)w.call(U,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(be[le]=U[le]);var ze=arguments.length-2;if(ze===1)be.children=ee;else if(1<ze){for(var Pe=Array(ze),Qe=0;Qe<ze;Qe++)Pe[Qe]=arguments[Qe+2];be.children=Pe}if(E&&E.defaultProps)for(le in ze=E.defaultProps,ze)be[le]===void 0&&(be[le]=ze[le]);return $(E,Ne,be)},Me.createRef=function(){return{current:null}},Me.forwardRef=function(E){return{$$typeof:p,render:E}},Me.isValidElement=fe,Me.lazy=function(E){return{$$typeof:v,_payload:{_status:-1,_result:E},_init:J}},Me.memo=function(E,U){return{$$typeof:h,type:E,compare:U===void 0?null:U}},Me.startTransition=function(E){var U=W.T,ee={};W.T=ee;try{var le=E(),be=W.S;be!==null&&be(ee,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(ae,ce)}catch(Ne){ce(Ne)}finally{U!==null&&ee.types!==null&&(U.types=ee.types),W.T=U}},Me.unstable_useCacheRefresh=function(){return W.H.useCacheRefresh()},Me.use=function(E){return W.H.use(E)},Me.useActionState=function(E,U,ee){return W.H.useActionState(E,U,ee)},Me.useCallback=function(E,U){return W.H.useCallback(E,U)},Me.useContext=function(E){return W.H.useContext(E)},Me.useDebugValue=function(){},Me.useDeferredValue=function(E,U){return W.H.useDeferredValue(E,U)},Me.useEffect=function(E,U){return W.H.useEffect(E,U)},Me.useEffectEvent=function(E){return W.H.useEffectEvent(E)},Me.useId=function(){return W.H.useId()},Me.useImperativeHandle=function(E,U,ee){return W.H.useImperativeHandle(E,U,ee)},Me.useInsertionEffect=function(E,U){return W.H.useInsertionEffect(E,U)},Me.useLayoutEffect=function(E,U){return W.H.useLayoutEffect(E,U)},Me.useMemo=function(E,U){return W.H.useMemo(E,U)},Me.useOptimistic=function(E,U){return W.H.useOptimistic(E,U)},Me.useReducer=function(E,U,ee){return W.H.useReducer(E,U,ee)},Me.useRef=function(E){return W.H.useRef(E)},Me.useState=function(E){return W.H.useState(E)},Me.useSyncExternalStore=function(E,U,ee){return W.H.useSyncExternalStore(E,U,ee)},Me.useTransition=function(){return W.H.useTransition()},Me.version="19.2.4",Me}var Op;function vo(){return Op||(Op=1,Bu.exports=Av()),Bu.exports}var b=vo();const Rr=uv(b),Lv=cv({__proto__:null,default:Rr},[b]),Uv=(n,l,s,i)=>{const o=[s,{code:l,...i||{}}];if(n?.services?.logger?.forward)return n.services.logger.forward(o,"warn","react-i18next::",!0);kl(o[0])&&(o[0]=`react-i18next:: ${o[0]}`),n?.services?.logger?.warn?n.services.logger.warn(...o):console?.warn&&console.warn(...o)},Dp={},Qg=(n,l,s,i)=>{kl(s)&&Dp[s]||(kl(s)&&(Dp[s]=new Date),Uv(n,l,s,i))},Zg=(n,l)=>()=>{if(n.isInitialized)l();else{const s=()=>{setTimeout(()=>{n.off("initialized",s)},0),l()};n.on("initialized",s)}},id=(n,l,s)=>{n.loadNamespaces(l,Zg(n,s))},Mp=(n,l,s,i)=>{if(kl(s)&&(s=[s]),n.options.preload&&n.options.preload.indexOf(l)>-1)return id(n,s,i);s.forEach(o=>{n.options.ns.indexOf(o)<0&&n.options.ns.push(o)}),n.loadLanguages(l,Zg(n,i))},Hv=(n,l,s={})=>!l.languages||!l.languages.length?(Qg(l,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:l.languages}),!0):l.hasLoadedNamespace(n,{lng:s.lng,precheck:(i,o)=>{if(s.bindI18n&&s.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!o(i.isLanguageChangingTo,n))return!1}}),kl=n=>typeof n=="string",Bv=n=>typeof n=="object"&&n!==null,$v=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,qv={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Yv=n=>qv[n],Gv=n=>n.replace($v,Yv);let od={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Gv,transDefaultProps:void 0};const Vv=(n={})=>{od={...od,...n}},Kv=()=>od;let Fg;const Xv=n=>{Fg=n},Qv=()=>Fg,Zv={type:"3rdParty",init(n){Vv(n.options.react),Xv(n)}},Fv=b.createContext();class Jv{constructor(){this.usedNamespaces={}}addUsedNamespaces(l){l.forEach(s=>{this.usedNamespaces[s]||(this.usedNamespaces[s]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var $u={exports:{}},qu={};var kp;function Pv(){if(kp)return qu;kp=1;var n=vo();function l(y,_){return y===_&&(y!==0||1/y===1/_)||y!==y&&_!==_}var s=typeof Object.is=="function"?Object.is:l,i=n.useState,o=n.useEffect,u=n.useLayoutEffect,m=n.useDebugValue;function p(y,_){var j=_(),N=i({inst:{value:j,getSnapshot:_}}),T=N[0].inst,D=N[1];return u(function(){T.value=j,T.getSnapshot=_,g(T)&&D({inst:T})},[y,j,_]),o(function(){return g(T)&&D({inst:T}),y(function(){g(T)&&D({inst:T})})},[y]),m(j),j}function g(y){var _=y.getSnapshot;y=y.value;try{var j=_();return!s(y,j)}catch{return!0}}function h(y,_){return _()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:p;return qu.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:v,qu}var Ap;function Iv(){return Ap||(Ap=1,$u.exports=Pv()),$u.exports}var Wv=Iv();const e0=(n,l)=>kl(l)?l:Bv(l)&&kl(l.defaultValue)?l.defaultValue:Array.isArray(n)?n[n.length-1]:n,t0={t:e0,ready:!1},a0=()=>()=>{},Re=(n,l={})=>{const{i18n:s}=l,{i18n:i,defaultNS:o}=b.useContext(Fv)||{},u=s||i||Qv();u&&!u.reportNamespaces&&(u.reportNamespaces=new Jv),u||Qg(u,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const m=b.useMemo(()=>({...Kv(),...u?.options?.react,...l}),[u,l]),{useSuspense:p,keyPrefix:g}=m,h=o||u?.options?.defaultNS,v=kl(h)?[h]:h||["translation"],y=b.useMemo(()=>v,v);u?.reportNamespaces?.addUsedNamespaces?.(y);const _=b.useRef(0),j=b.useCallback($=>{if(!u)return a0;const{bindI18n:te,bindI18nStore:fe}=m,oe=()=>{_.current+=1,$()};return te&&u.on(te,oe),fe&&u.store.on(fe,oe),()=>{te&&te.split(" ").forEach(re=>u.off(re,oe)),fe&&fe.split(" ").forEach(re=>u.store.off(re,oe))}},[u,m]),N=b.useRef(),T=b.useCallback(()=>{if(!u)return t0;const $=!!(u.isInitialized||u.initializedStoreOnce)&&y.every(pe=>Hv(pe,u,m)),te=l.lng||u.language,fe=_.current,oe=N.current;if(oe&&oe.ready===$&&oe.lng===te&&oe.keyPrefix===g&&oe.revision===fe)return oe;const de={t:u.getFixedT(te,m.nsMode==="fallback"?y:y[0],g),ready:$,lng:te,keyPrefix:g,revision:fe};return N.current=de,de},[u,y,g,m,l.lng]),[D,Y]=b.useState(0),{t:Z,ready:G}=Wv.useSyncExternalStore(j,T,T);b.useEffect(()=>{if(u&&!G&&!p){const $=()=>Y(te=>te+1);l.lng?Mp(u,l.lng,y,$):id(u,y,$)}},[u,l.lng,y,G,p,D]);const V=u||{},Q=b.useRef(null),ae=b.useRef(),W=$=>{const te=Object.getOwnPropertyDescriptors($);te.__original&&delete te.__original;const fe=Object.create(Object.getPrototypeOf($),te);if(!Object.prototype.hasOwnProperty.call(fe,"__original"))try{Object.defineProperty(fe,"__original",{value:$,writable:!1,enumerable:!1,configurable:!1})}catch{}return fe},w=b.useMemo(()=>{const $=V,te=$?.language;let fe=$;$&&(Q.current&&Q.current.__original===$?ae.current!==te?(fe=W($),Q.current=fe,ae.current=te):fe=Q.current:(fe=W($),Q.current=fe,ae.current=te));const oe=[Z,fe,G];return oe.t=Z,oe.i18n=fe,oe.ready=G,oe},[Z,V,G,V.resolvedLanguage,V.language,V.languages]);if(u&&p&&!G)throw new Promise($=>{const te=()=>$();l.lng?Mp(u,l.lng,y,te):id(u,y,te)});return w},{slice:n0,forEach:l0}=[];function r0(n){return l0.call(n0.call(arguments,1),l=>{if(l)for(const s in l)n[s]===void 0&&(n[s]=l[s])}),n}function s0(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 Lp=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,i0=function(n,l){const i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},o=encodeURIComponent(l);let u=`${n}=${o}`;if(i.maxAge>0){const m=i.maxAge-0;if(Number.isNaN(m))throw new Error("maxAge should be a Number");u+=`; Max-Age=${Math.floor(m)}`}if(i.domain){if(!Lp.test(i.domain))throw new TypeError("option domain is invalid");u+=`; Domain=${i.domain}`}if(i.path){if(!Lp.test(i.path))throw new TypeError("option path is invalid");u+=`; Path=${i.path}`}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");u+=`; Expires=${i.expires.toUTCString()}`}if(i.httpOnly&&(u+="; HttpOnly"),i.secure&&(u+="; Secure"),i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:u+="; SameSite=Strict";break;case"lax":u+="; SameSite=Lax";break;case"strict":u+="; SameSite=Strict";break;case"none":u+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i.partitioned&&(u+="; Partitioned"),u},Up={create(n,l,s,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};s&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+s*60*1e3)),i&&(o.domain=i),document.cookie=i0(n,l,o)},read(n){const l=`${n}=`,s=document.cookie.split(";");for(let i=0;i<s.length;i++){let o=s[i];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(l)===0)return o.substring(l.length,o.length)}return null},remove(n,l){this.create(n,"",-1,l)}};var o0={name:"cookie",lookup(n){let{lookupCookie:l}=n;if(l&&typeof document<"u")return Up.read(l)||void 0},cacheUserLanguage(n,l){let{lookupCookie:s,cookieMinutes:i,cookieDomain:o,cookieOptions:u}=l;s&&typeof document<"u"&&Up.create(s,n,i,o,u)}},c0={name:"querystring",lookup(n){let{lookupQuerystring:l}=n,s;if(typeof window<"u"){let{search:i}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));const u=i.substring(1).split("&");for(let m=0;m<u.length;m++){const p=u[m].indexOf("=");p>0&&u[m].substring(0,p)===l&&(s=u[m].substring(p+1))}}return s}},u0={name:"hash",lookup(n){let{lookupHash:l,lookupFromHashIndex:s}=n,i;if(typeof window<"u"){const{hash:o}=window.location;if(o&&o.length>2){const u=o.substring(1);if(l){const m=u.split("&");for(let p=0;p<m.length;p++){const g=m[p].indexOf("=");g>0&&m[p].substring(0,g)===l&&(i=m[p].substring(g+1))}}if(i)return i;if(!i&&s>-1){const m=o.match(/\/([a-zA-Z-]*)/g);return Array.isArray(m)?m[typeof s=="number"?s:0]?.replace("/",""):void 0}}}return i}};let Nr=null;const Hp=()=>{if(Nr!==null)return Nr;try{if(Nr=typeof window<"u"&&window.localStorage!==null,!Nr)return!1;const n="i18next.translate.boo";window.localStorage.setItem(n,"foo"),window.localStorage.removeItem(n)}catch{Nr=!1}return Nr};var d0={name:"localStorage",lookup(n){let{lookupLocalStorage:l}=n;if(l&&Hp())return window.localStorage.getItem(l)||void 0},cacheUserLanguage(n,l){let{lookupLocalStorage:s}=l;s&&Hp()&&window.localStorage.setItem(s,n)}};let wr=null;const Bp=()=>{if(wr!==null)return wr;try{if(wr=typeof window<"u"&&window.sessionStorage!==null,!wr)return!1;const n="i18next.translate.boo";window.sessionStorage.setItem(n,"foo"),window.sessionStorage.removeItem(n)}catch{wr=!1}return wr};var f0={name:"sessionStorage",lookup(n){let{lookupSessionStorage:l}=n;if(l&&Bp())return window.sessionStorage.getItem(l)||void 0},cacheUserLanguage(n,l){let{lookupSessionStorage:s}=l;s&&Bp()&&window.sessionStorage.setItem(s,n)}},m0={name:"navigator",lookup(n){const l=[];if(typeof navigator<"u"){const{languages:s,userLanguage:i,language:o}=navigator;if(s)for(let u=0;u<s.length;u++)l.push(s[u]);i&&l.push(i),o&&l.push(o)}return l.length>0?l:void 0}},h0={name:"htmlTag",lookup(n){let{htmlTag:l}=n,s;const i=l||(typeof document<"u"?document.documentElement:null);return i&&typeof i.getAttribute=="function"&&(s=i.getAttribute("lang")),s}},p0={name:"path",lookup(n){let{lookupFromPathIndex:l}=n;if(typeof window>"u")return;const s=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(s)?s[typeof l=="number"?l:0]?.replace("/",""):void 0}},g0={name:"subdomain",lookup(n){let{lookupFromSubdomainIndex:l}=n;const s=typeof l=="number"?l+1:1,i=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(i)return i[s]}};let Jg=!1;try{document.cookie,Jg=!0}catch{}const Pg=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Jg||Pg.splice(1,1);const x0=()=>({order:Pg,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:n=>n});class Ig{constructor(l){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(l,s)}init(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=l,this.options=r0(s,this.options||{},x0()),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(o0),this.addDetector(c0),this.addDetector(d0),this.addDetector(f0),this.addDetector(m0),this.addDetector(h0),this.addDetector(p0),this.addDetector(g0),this.addDetector(u0)}addDetector(l){return this.detectors[l.name]=l,this}detect(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,s=[];return l.forEach(i=>{if(this.detectors[i]){let o=this.detectors[i].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(s=s.concat(o))}}),s=s.filter(i=>i!=null&&!s0(i)).map(i=>this.options.convertDetectedLanguage(i)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?s:s.length>0?s[0]:null}cacheUserLanguage(l){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;s&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(l)>-1||s.forEach(i=>{this.detectors[i]&&this.detectors[i].cacheUserLanguage(l,this.options)}))}}Ig.type="languageDetector";const y0={"nav.home":"Home","nav.studio":"Studio","nav.docs":"Docs","nav.login":"Login","nav.logout":"Logout","header.status.connected":"Connected","header.status.disconnected":"Disconnected","header.status.reconnecting":"Reconnecting","footer.copyright":"GitHub · @Context4AI {{year}}. All rights reserved.","footer.copyright_compact":"@Context4AI {{year}}. All rights reserved.","footer.tagline":"Knowledge Factory","footer.theme.dark":"Dark","footer.theme.light":"Light","footer.theme.system":"System","studio.sidebar.sources":"Sources","studio.sidebar.modeling":"Modeling","studio.sidebar.brain":"Brain","studio.sidebar.discovery":"Discovery","studio.sidebar.sharing":"Sharing","studio.sidebar.collaboration":"Collaboration","studio.sidebar.settings":"Settings","placeholder.coming":"Coming in {{version}}","page.login.title":"Login","page.login.description":"Authentication and user management.","page.docs.title":"Docs","page.docs.description":"Public documentation portal.","page.sources.title":"Sources","page.sources.description":"Add code repositories, documents, and other input materials for your brain to index.","page.modeling.title":"Modeling","page.modeling.description":"Model indexed content with AI — only what stands up to scrutiny gets written to the knowledge graph.","page.brain.title":"Brain","page.brain.description":"All modeled knowledge lives here — browse, search, analyze, and use it anytime.","page.discovery.title":"Discovery","page.discovery.description":"Explore knowledge curated by others and add what's useful to your own brain.","page.sharing.title":"Sharing","page.sharing.description":"Package and export knowledge from your brain for others and AI to use directly.","page.collaboration.title":"Collaboration","page.collaboration.description":"Stay in sync with other brains — get notified on updates, no manual transfer needed.","page.settings.title":"Settings","page.settings.description":"Manage workspace members and configuration.","page.code_setup.title":"Code Setup","page.code_setup.description":"Repository selection and configuration for code modeling.","page.code_compile.title":"Code Compile","page.code_compile.description":"Compilation progress tracking for code modeling.","page.code_review.title":"Code Review","page.code_review.description":"Review and approve modeling results.","page.code_result.title":"Code Result","page.code_result.description":"View final modeling results and generated knowledge graph.","home.hero.title":"Context For AI","home.hero.description":"Transform code repositories and business documents into structured knowledge graphs.","home.hero.cta.studio":"Enter Studio","home.hero.cta.github":"GitHub","notfound.title":"404","notfound.description":"The page you're looking for doesn't exist.","notfound.back":"Back to Home","error.description":"Something went wrong. Please try again.","error.reload":"Reload","sources.menu.add_client":"Add Client","sources.menu.online":"online","sources.menu.offline":"offline","sources.menu.status_online":"{{machine}} connected","sources.menu.status_offline":"{{machine}} not connected, click for setup guide","sources.library.default_cloud_name":"Personal Cloud","sources.library.rename":"Rename","sources.library.rename_placeholder":"Enter library name","sources.header.daemon_status":"{{online}}/{{total}} online","sources.header.all_offline":"All offline","sources.actions.new_folder":"New Folder","sources.folder.name_placeholder":"Enter folder name","sources.actions.import_repo":"Import Repository","sources.actions.rename":"Rename","sources.actions.move_to":"Move to...","sources.actions.delete":"Delete","sources.filter.all":"All","sources.filter.indexed":"Indexed","sources.filter.not_indexed":"Not Indexed","sources.status.none":"None","sources.status.indexed":"Indexed","sources.status.stale":"Index outdated","sources.status.go_index":"Index","sources.type.code":"Code","sources.type.doc":"Document","sources.empty.cloud.title":"Your personal knowledge input zone","sources.empty.cloud.description":"Create folders to organize your documents and materials. These are visible only to you and will serve as the foundation for building your digital brain.","sources.empty.daemon.title":"Connect your local code assets","sources.empty.daemon.description":"Import local code repositories. The system will automatically extract code structures and technical documents, transforming them into structured knowledge.","sources.empty.indexed.title":"Knowledge not yet indexed","sources.empty.indexed.description":"Select sources and complete indexing. They will be transformed into structured summaries, providing material for your future speculations.","sources.empty.folder.title":"This folder is empty","sources.empty.folder.daemon_description":"You can add or edit documents locally, and they will appear here after the next sync.","sources.safety.notice.repo":"In local mode, your code has absolute privacy. Source code never leaves your computer. The system only extracts structured summaries for knowledge modeling (function signatures, dependencies, etc.).","sources.safety.notice.dir":"The system extracts document content and summaries for knowledge modeling. Although unsafe text is filtered, please ensure sensitive data is not included in indexing or modeling.","sources.import.title":"Import Repository","sources.import.step.select":"Select Repository","sources.import.step.version":"Select Version","sources.import.step.confirm":"Import Complete","sources.import.daemon_offline":"Client {{name}} is not connected. Please start the local Daemon and connect to the server before importing.","sources.import.view_guide":"View Connection Guide","sources.import.select_root":"Select repository root directory","sources.import.current_path":"Current path","sources.import.not_git":"This directory is not a Git repository. Please select a directory containing .git.","sources.import.branch":"Branch","sources.import.commit":"Commit","sources.import.branch_warning":"Currently based on {{branch}} branch HEAD","sources.import.uncommitted_warning":"Uncommitted changes will not be collected","sources.import.recognized":"Recognized {{packages}} packages and {{docs}} documents","sources.import.no_packages":"No package structure detected. Will be imported as a single-package repository.","sources.import.confirm_heading":"About to import the following repository to {{name}}:","sources.import.packages":"Packages","sources.import.documents":"Documents","sources.import.loading_repo":"Loading repository info...","sources.import.loading_repo_slow":"Large repositories (>10 GB) may take 5–10 seconds...","sources.import.importing":"Importing...","sources.import.error_title":"Import Failed","sources.import.success":"Import complete","sources.import.stage.prepare":"Preparing environment","sources.import.stage.clone":"Cloning repository","sources.import.stage.scan":"Scanning project","sources.import.stage.save":"Saving sources","sources.import.stage.done_suffix":"done","sources.import.stage.complete":"Import complete","sources.import.step.loading":"Data Import","sources.import.done":"Done","sources.import.back":"Back","sources.import.retry":"Retry","sources.add_client.title":"Connect Local Knowledge Source","sources.add_client.description":"Start a client (Daemon) on your local computer to mount local code repositories as input material into your digital brain.","sources.add_client.step1":"Install Daemon","sources.add_client.step2":"Start Daemon","sources.add_client.step2_allow":"Restrict access to specific directories (does not affect existing imports)","sources.add_client.step3":"Wait for connection","sources.add_client.step3_desc":"This page will update automatically once connected.","sources.add_client.waiting":"Waiting for new client connection...","sources.add_client.detected":"New client detected","sources.add_client.machine_name":"Machine ID","sources.add_client.os":"Operating system","sources.add_client.daemon_version":"Daemon version","sources.add_client.client_name":"Client name","sources.add_client.confirm":"Confirm Add","sources.add_client.reconnected":"Client {{name}} has reconnected","sources.add_client.go_to":"Go to {{name}}","sources.detail.tab.original":"Original","sources.detail.tab.overview":"Overview","sources.detail.tab.digest":"Digest","sources.detail.tab.modeling":"Modeling Result","sources.detail.digest_placeholder":"Structured summary will be available here after indexing is complete.","sources.detail.modeling_placeholder":"Knowledge entities derived from this source will appear here after modeling in the speculation zone.","sources.detail.type":"Type","sources.detail.origin":"Origin","sources.detail.origin.upload":"Upload","sources.detail.origin.local":"Local file","sources.detail.path":"Path","sources.detail.status":"Status","sources.detail.repo":"Repository","sources.detail.branch":"Branch","sources.detail.commit":"Commit","sources.detail.tech_stack":"Tech stack","sources.detail.original_code_placeholder":"Package overview will be available after indexing.","sources.detail.original_doc_placeholder":"Document content will be available after upload.","sources.detail.dependencies":"Dependencies","sources.delete.confirm_title":"Confirm Delete","sources.delete.resource":"Are you sure you want to delete {{name}}?","sources.delete.resource_impact":"The following data will be permanently deleted: original content, structured digest (if any).","sources.delete.session_warning":"If your personal speculation zone is using this source, related candidate speculations will be affected.","sources.delete.entity_safe":"Formal knowledge already merged into the brain will not be affected.","sources.delete.folder":"Are you sure you want to delete folder {{name}}?","sources.delete.folder_impact":"All resources inside will be recursively deleted: {{folders}} sub-folders, {{sources}} sources.","sources.delete.folder_contents":"Contains {{folders}} sub-folders, {{sources}} sources.","sources.delete.folder_impact_generic":"All sub-folders and resources inside will be recursively deleted.","sources.delete.irreversible":"This action cannot be undone.","sources.delete.repo":"Are you sure you want to remove repository {{name}} from {{library}}?","sources.delete.repo_impact":"Will delete: {{packages}} package index records, {{docs}} document index records.","sources.delete.repo_contents":"Contains {{packages}} packages, {{docs}} documents.","sources.delete.indexed_hint":"{{indexed}}/{{total}} have been indexed; their index data will be deleted.","sources.delete.repo_impact_generic":"All package and document index records will be deleted.","sources.delete.local_safe":"Local files will not be affected.","sources.delete.client":"Are you sure you want to delete client {{name}}?","sources.delete.client_impact":"All imported repository records and related index data under this client will be deleted.","sources.delete.client_reregister":"This client will need to re-register on next connection.","sources.error.name_conflict":'An item named "{{name}}" already exists in this directory.',"sources.move.current":"Current","sources.move.target":"Move to","sources.breadcrumb.sources":"Sources","common.cancel":"Cancel","common.confirm":"Confirm","common.back":"Back","common.next":"Next","common.previous":"Previous","common.items":"{{count}} items","common.loading":"Loading...","sources.import.no_entries":"No entries found","sources.import.allowed_dirs":"Client authorized directories","sources.import.allowed_dirs_tooltip_restrict":"Restrict to specific directories:","sources.import.allowed_dirs_tooltip_all":"Or allow all directories (default):","sources.import.wildcard_home":"Home","sources.import.wildcard_path_placeholder":"Enter a directory path…","sources.import.wildcard_go":"Go","sources.import.wildcard_goto":"Go to","sources.import.wildcard_go_title":"Go to Directory","sources.import.wildcard_path_not_found":"Path does not exist on the remote machine","sources.import.already_imported":"Imported","sources.import.dir_title":"Import Directory","sources.import.dir_step.select":"Select Directory","sources.import.dir_step.scan":"Scan","sources.import.dir_step.confirm":"Confirm Import","sources.import.dir_confirm_heading":"About to import the following directory to {{name}}:","sources.import.dir_name":"Directory Name","sources.import.dir_name_hint":"Display name in the source tree after import. Leave empty to use the default repository name.","sources.import.dir_name_duplicate":"This name already exists. Please use a different name.","sources.import.dir_path":"Directory Path","sources.import.dir_files":"Files","sources.import.dir_subdirs":"Subdirectories","sources.import.dir_git_repos":"Repositories (skipped)","sources.import.dir_git_hint":"Git repositories inside the directory will not be expanded for indexing. Import them separately if needed.","sources.import.dir_scanning":"Scanning directory contents...","sources.import.dir_scan_complete":"Scan complete","sources.import.dir_scan_error":"Failed to scan directory","sources.import.dir_scan_retry":"Retry","sources.import.dir_code_packages":"Code Packages","sources.import.dir_code_packages_tip":"Supported: package.json, pyproject.toml, setup.py, go.mod, Cargo.toml, pom.xml, build.gradle","sources.import.dir_doc_files":"Documents","sources.import.dir_doc_files_tip":"Supported: Markdown (.md)","sources.import.dir_total_files":"Total Files","sources.import.dir_total_dirs":"Directories","sources.import.dir_git_skip_hint":"Git repos are skipped. Use 'Import Repository' instead.","sources.actions.upload":"Upload","sources.actions.upload_md":"Markdown Document","sources.actions.upload_doc":"Document","sources.actions.add":"Add","sources.actions.add_folder":"Folder","sources.actions.add_web":"Web Page","sources.actions.add_feishu":"Feishu Document","sources.actions.import_dir":"Import Directory","sources.actions.import_repo_url":"Import Repository","sources.upgrade.title":"Feature Upgrading","sources.upgrade.description":"This feature will be available in version 0.5.x. Stay tuned.","sources.upload.title":"Upload Documents","sources.upload.drop_hint":"Click to select or drag files here","sources.upload.supported_formats":"Supported: .md, .doc, .docx, .pdf, .ppt, .pptx, .txt (max 5MB each, up to 10 files)","sources.upload.file_too_large":'"{{name}}" exceeds 5MB limit',"sources.upload.too_many_files":"Maximum 10 files allowed, please re-select","sources.upload.unsupported_type":'"{{name}}" is not a supported file type',"sources.upload.uploading":"Uploading...","sources.upload.success":"Uploaded {{count}} documents","sources.upload.selected":"{{count}} files selected","sources.upload.remove":"Remove","sources.import_remote.title":"Import Remote Repository","sources.import_remote.step.loading":"Data Import","sources.import_remote.url_label":"Repository URL","sources.import_remote.url_placeholder":"https://github.com/org/repo.git","sources.import_remote.url_hint_format":"Only HTTPS URLs are accepted. SSH support is planned for a future release","sources.import_remote.url_hint_public":"Supports public Git repositories without authentication, and Git services with OAuth configured: ","sources.import_remote.url_hint_no_auth":"Supports public Git repositories and Git services with OAuth configured","sources.import_remote.url_invalid":"Only HTTPS Git URLs are supported","sources.import_remote.ref_label":"Branch / Tag","sources.import_remote.ref_branches":"Branches","sources.import_remote.ref_tags":"Tags","sources.import_remote.ref_search":"Search branches or tags…","sources.import_remote.commit_label":"Commit","sources.import_remote.commit_hint":"Auto-filled with the latest commit of selected branch. You can also type or search","sources.import_remote.commit_search":"Search commit…","sources.import_remote.loading_refs":"Querying repository branches...","sources.import_remote.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."},b0={"nav.home":"首页","nav.studio":"工作台","nav.docs":"文档","nav.login":"登录","nav.logout":"退出登录","header.status.connected":"已连接","header.status.disconnected":"已断开","header.status.reconnecting":"重连中","footer.copyright":"GitHub · @Context4AI {{year}}. 版权所有","footer.copyright_compact":"@Context4AI {{year}}. 版权所有","footer.tagline":"知识工厂","footer.theme.dark":"暗色","footer.theme.light":"亮色","footer.theme.system":"跟随系统","studio.sidebar.sources":"知识索引","studio.sidebar.modeling":"知识建模","studio.sidebar.brain":"知识大脑","studio.sidebar.discovery":"发现知识","studio.sidebar.sharing":"分享知识","studio.sidebar.collaboration":"知识协同","studio.sidebar.settings":"设置","placeholder.coming":"计划在 {{version}} 版本实现","page.login.title":"登录","page.login.description":"身份验证与用户管理。","page.docs.title":"文档","page.docs.description":"公开文档门户。","page.sources.title":"知识索引","page.sources.description":"添加代码仓库、文档等输入材料,让大脑完成初步索引。","page.modeling.title":"知识建模","page.modeling.description":"和 AI 一起对索引内容建模,只有经得起推敲的才写入知识图谱。","page.brain.title":"知识大脑","page.brain.description":"建模完成的全部知识都在这里——浏览、搜索、分析,随时调用。","page.discovery.title":"发现知识","page.discovery.description":"看看别人整理好的知识,发现有用的一键补充到自己的大脑。","page.sharing.title":"分享知识","page.sharing.description":"把大脑中的知识打包输出,让别人和 AI 都能直接使用。","page.collaboration.title":"知识协同","page.collaboration.description":"和其他大脑保持同步,知识更新时自动通知,不用手动搬运。","page.settings.title":"设置","page.settings.description":"管理大脑的成员和配置。","page.code_setup.title":"代码设置","page.code_setup.description":"代码建模的仓库选择与配置。","page.code_compile.title":"代码编译","page.code_compile.description":"代码建模的编译进度追踪。","page.code_review.title":"代码审查","page.code_review.description":"审查并确认建模结果。","page.code_result.title":"代码结果","page.code_result.description":"查看最终建模结果与生成的知识图谱。","home.hero.title":"Context For AI","home.hero.description":"将代码仓库和业务文档转化为结构化知识图谱。","home.hero.cta.studio":"进入工作台","home.hero.cta.github":"GitHub","notfound.title":"404","notfound.description":"您访问的页面不存在。","notfound.back":"返回首页","error.description":"页面出现了问题,请重试。","error.reload":"重新加载","sources.menu.add_client":"添加客户端","sources.menu.online":"在线","sources.menu.offline":"离线","sources.menu.status_online":"{{machine}} 已连接","sources.menu.status_offline":"{{machine}} 未连接,点击前往教程","sources.library.default_cloud_name":"个人云","sources.library.rename":"重命名","sources.library.rename_placeholder":"输入名称","sources.header.daemon_status":"{{online}}/{{total}} 在线","sources.header.all_offline":"全部离线","sources.actions.new_folder":"新文件夹","sources.folder.name_placeholder":"输入文件夹名称","sources.actions.import_repo":"导入仓库","sources.actions.rename":"重命名","sources.actions.move_to":"移动到...","sources.actions.delete":"删除","sources.filter.all":"全部","sources.filter.indexed":"已索引","sources.filter.not_indexed":"未索引","sources.status.none":"未索引","sources.status.indexed":"已索引","sources.status.stale":"有新变更未更新索引","sources.status.go_index":"去索引","sources.type.code":"代码","sources.type.doc":"文档","sources.empty.cloud.title":"这里是你专属的知识输入区","sources.empty.cloud.description":"创建文件夹来整理你的文档和材料。这些内容仅你个人可见,将成为后续推演、构建数字大脑的基础。","sources.empty.daemon.title":"连接你的本地代码资产","sources.empty.daemon.description":"导入本地代码仓库,系统会自动提取代码结构与技术文档,将其转化为结构化知识。","sources.empty.indexed.title":"这些知识尚未被索引","sources.empty.indexed.description":"选择资源并完成索引后,它们将转化为结构化摘要,为你后续的推演提供素材。","sources.empty.folder.title":"当前文件夹还没有内容","sources.empty.folder.daemon_description":"你可以在本地进行文档新增、编辑后查看。","sources.safety.notice.repo":"在本地模式下,你的代码保有绝对隐私,源代码永远不会离开你的电脑,系统仅提取用于知识建模的结构化摘要(函数签名、依赖关系等)。","sources.safety.notice.dir":"系统会提取用于知识建模的文档内容及摘要,尽管会过滤不安全的文本内容,但请确保敏感数据不要参与索引及建模。","sources.import.title":"导入代码仓库","sources.import.step.select":"选择仓库","sources.import.step.version":"选择版本","sources.import.step.confirm":"导入完成","sources.import.daemon_offline":"客户端 {{name}} 未连接,请先启动本地 Daemon 并连接到服务器后再导入仓库。","sources.import.view_guide":"查看连接指引","sources.import.select_root":"选择仓库根目录","sources.import.current_path":"当前路径","sources.import.not_git":"该目录不是 Git 仓库,请选择包含 .git 的目录。","sources.import.branch":"分支","sources.import.commit":"提交","sources.import.branch_warning":"当前基于 {{branch}} 分支的 HEAD","sources.import.uncommitted_warning":"未提交的修改不会被采集","sources.import.recognized":"已识别 {{packages}} 个包和 {{docs}} 篇文档","sources.import.no_packages":"未识别到包结构,将作为单包仓库导入。","sources.import.confirm_heading":"即将导入以下仓库到 {{name}}:","sources.import.packages":"包数","sources.import.documents":"文档","sources.import.loading_repo":"正在加载仓库信息...","sources.import.loading_repo_slow":"大型仓库(>10 GB)可能需要 5~10 秒...","sources.import.importing":"导入中...","sources.import.error_title":"导入失败","sources.import.success":"导入完成","sources.import.stage.prepare":"准备执行环境","sources.import.stage.clone":"克隆仓库","sources.import.stage.scan":"扫描项目","sources.import.stage.save":"保存数据源","sources.import.stage.done_suffix":"✓","sources.import.stage.complete":"导入完成","sources.import.step.loading":"数据导入","sources.import.done":"完成","sources.import.back":"返回","sources.import.retry":"重试","sources.add_client.title":"接入本地知识源","sources.add_client.description":"在本地计算机上启动客户端 (Daemon),即可将本地代码仓库作为输入材料,挂载到你的数字大脑中。","sources.add_client.step1":"安装 Daemon","sources.add_client.step2":"启动 Daemon","sources.add_client.step2_allow":"限制访问目录(不影响已有导入)","sources.add_client.step3":"等待连接","sources.add_client.step3_desc":"连接成功后,本页面将自动更新。","sources.add_client.waiting":"等待新的客户端连接...","sources.add_client.detected":"检测到新的本地客户端","sources.add_client.machine_name":"机器标识","sources.add_client.os":"操作系统","sources.add_client.daemon_version":"Daemon 版本","sources.add_client.client_name":"客户端名称","sources.add_client.confirm":"确认添加","sources.add_client.reconnected":"客户端 {{name}} 已重新连接","sources.add_client.go_to":"前往 {{name}}","sources.detail.tab.original":"原文","sources.detail.tab.overview":"概览","sources.detail.tab.digest":"摘要","sources.detail.tab.modeling":"建模结果","sources.detail.digest_placeholder":"完成索引后,即可在此查看结构化摘要。","sources.detail.modeling_placeholder":"在推演区完成建模后,此处将展示由该源产生的知识实体。","sources.detail.type":"类型","sources.detail.origin":"来源","sources.detail.origin.upload":"直接上传","sources.detail.origin.local":"本地文件","sources.detail.path":"路径","sources.detail.status":"状态","sources.detail.repo":"仓库","sources.detail.branch":"分支","sources.detail.commit":"提交","sources.detail.tech_stack":"技术栈","sources.detail.original_code_placeholder":"完成索引后即可查看包概览。","sources.detail.original_doc_placeholder":"文档内容将在上传后展示。","sources.detail.dependencies":"依赖","sources.delete.confirm_title":"确认删除","sources.delete.resource":"确定要删除 {{name}}?","sources.delete.resource_impact":"以下数据将被永久删除:原文内容、结构化摘要(如有)。","sources.delete.session_warning":"如果你的个人推演区正在使用此知识源,相关的候选推演将受到影响。","sources.delete.entity_safe":"已汇入大脑的正式知识不受影响。","sources.delete.folder":"确定要删除文件夹 {{name}}?","sources.delete.folder_impact":"文件夹内的所有资源将被递归删除:{{folders}} 个子文件夹、{{sources}} 个知识源。","sources.delete.folder_contents":"包含 {{folders}} 个子文件夹、{{sources}} 个知识源。","sources.delete.folder_impact_generic":"文件夹内的所有子文件夹和知识源将被递归删除。","sources.delete.irreversible":"此操作不可撤销。","sources.delete.repo":"确定要从 {{library}} 中移除仓库 {{name}}?","sources.delete.repo_impact":"将删除:{{packages}} 个包的索引记录、{{docs}} 篇文档的索引记录。","sources.delete.repo_contents":"包含 {{packages}} 个包、{{docs}} 个文档。","sources.delete.indexed_hint":"其中 {{indexed}}/{{total}} 个已建立索引,索引数据将被删除。","sources.delete.repo_impact_generic":"所有包和文档的索引记录将被删除。","sources.delete.local_safe":"本地文件不受影响。","sources.delete.client":"确定要删除客户端 {{name}}?","sources.delete.client_impact":"该客户端下的所有已导入仓库记录和相关索引数据将被删除。","sources.delete.client_reregister":"该客户端下次连接时将触发重新注册。","sources.error.name_conflict":'该目录下已存在同名项"{{name}}"。',"sources.move.current":"当前位置","sources.move.target":"移动到","sources.breadcrumb.sources":"知识索引","common.cancel":"取消","common.confirm":"确认","common.back":"返回","common.next":"下一步","common.previous":"上一步","common.items":"{{count}} 项","common.loading":"加载中...","sources.import.no_entries":"未找到任何条目","sources.import.allowed_dirs":"客户端授权目录","sources.import.allowed_dirs_tooltip_restrict":"通过参数设定有权限的目录:","sources.import.allowed_dirs_tooltip_all":"或默认允许全部目录:","sources.import.wildcard_home":"主目录","sources.import.wildcard_path_placeholder":"输入目录路径…","sources.import.wildcard_go":"前往","sources.import.wildcard_goto":"前往","sources.import.wildcard_go_title":"前往目录","sources.import.wildcard_path_not_found":"该路径在远程机器上不存在","sources.import.already_imported":"已导入","sources.import.dir_title":"导入目录","sources.import.dir_step.select":"选择目录","sources.import.dir_step.scan":"扫描","sources.import.dir_step.confirm":"确认导入","sources.import.dir_confirm_heading":"即将导入以下目录到 {{name}}:","sources.import.dir_name":"目录名","sources.import.dir_name_hint":"导入后在目录树中的显示名称,留空使用默认仓库名。","sources.import.dir_name_duplicate":"该名称已存在,请使用其他名称。","sources.import.dir_path":"目录路径","sources.import.dir_files":"文件数","sources.import.dir_subdirs":"子目录数","sources.import.dir_git_repos":"仓库(已跳过)","sources.import.dir_git_hint":"目录内的 Git 仓库不会被展开索引,如需索引请单独导入仓库。","sources.import.dir_scanning":"正在扫描目录内容...","sources.import.dir_scan_complete":"扫描完成","sources.import.dir_scan_error":"目录扫描失败","sources.import.dir_scan_retry":"重试","sources.import.dir_code_packages":"代码包","sources.import.dir_code_packages_tip":"支持:package.json、pyproject.toml、setup.py、go.mod、Cargo.toml、pom.xml、build.gradle","sources.import.dir_doc_files":"文档","sources.import.dir_doc_files_tip":"支持:Markdown (.md)","sources.import.dir_total_files":"文件总数","sources.import.dir_total_dirs":"目录","sources.import.dir_git_skip_hint":"Git 仓库将被跳过,建议单独使用「导入仓库」。","sources.actions.upload":"上传","sources.actions.upload_md":"Markdown 文档","sources.actions.upload_doc":"文档","sources.actions.add":"新增","sources.actions.add_folder":"文件夹","sources.actions.add_web":"网页","sources.actions.add_feishu":"飞书文档","sources.actions.import_dir":"导入目录","sources.actions.import_repo_url":"导入仓库","sources.upgrade.title":"功能升级中","sources.upgrade.description":"此功能将在 0.5.x 版本中推出,敬请期待。","sources.upload.title":"上传文档","sources.upload.drop_hint":"点击选择文件或拖拽至此","sources.upload.supported_formats":"支持格式:.md, .doc, .docx, .pdf, .ppt, .pptx, .txt(每个最大 5MB,最多 10 个)","sources.upload.file_too_large":'"{{name}}" 超过 5MB 限制',"sources.upload.too_many_files":"最多上传 10 个文件,请重新选择","sources.upload.unsupported_type":'"{{name}}" 不是支持的文件类型',"sources.upload.uploading":"上传中...","sources.upload.success":"已上传 {{count}} 个文档","sources.upload.selected":"已选择 {{count}} 个文件","sources.upload.remove":"移除","sources.import_remote.title":"导入远程仓库","sources.import_remote.step.loading":"数据导入","sources.import_remote.url_label":"仓库地址","sources.import_remote.url_placeholder":"https://github.com/org/repo.git","sources.import_remote.url_hint_format":"仅接受 HTTPS 地址,SSH 地址未来版本支持","sources.import_remote.url_hint_public":"除了支持无需鉴权的公开 Git 仓库,也支持已配置 OAuth 的 Git 服务:","sources.import_remote.url_hint_no_auth":"除了支持无需鉴权的公开 Git 仓库,也支持已配置 OAuth 的 Git 服务","sources.import_remote.url_invalid":"仅支持 HTTPS 格式的 Git URL","sources.import_remote.ref_label":"分支 / Tag","sources.import_remote.ref_branches":"分支","sources.import_remote.ref_tags":"Tag","sources.import_remote.ref_search":"搜索分支或 Tag…","sources.import_remote.commit_label":"Commit","sources.import_remote.commit_hint":"已自动填入所选分支最新 commit,也可手动输入或搜索","sources.import_remote.commit_search":"搜索 commit…","sources.import_remote.loading_refs":"正在查询仓库分支...","sources.import_remote.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":"远程仓库将被克隆到服务器本地进行分析,代码不会上传到任何第三方服务。"};da.use(Ig).use(Zv).init({resources:{en:{translation:y0},zh:{translation:b0}},fallbackLng:"en",interpolation:{escapeValue:!1},detection:{order:["localStorage"],caches:["localStorage"],lookupLocalStorage:"lang"}});var Yu={exports:{}},ws={},Gu={exports:{}},Vu={};var $p;function v0(){return $p||($p=1,(function(n){function l(k,P){var J=k.length;k.push(P);e:for(;0<J;){var ce=J-1>>>1,Se=k[ce];if(0<o(Se,P))k[ce]=P,k[J]=Se,J=ce;else break e}}function s(k){return k.length===0?null:k[0]}function i(k){if(k.length===0)return null;var P=k[0],J=k.pop();if(J!==P){k[0]=J;e:for(var ce=0,Se=k.length,E=Se>>>1;ce<E;){var U=2*(ce+1)-1,ee=k[U],le=U+1,be=k[le];if(0>o(ee,J))le<Se&&0>o(be,ee)?(k[ce]=be,k[le]=J,ce=le):(k[ce]=ee,k[U]=J,ce=U);else if(le<Se&&0>o(be,J))k[ce]=be,k[le]=J,ce=le;else break e}}return P}function o(k,P){var J=k.sortIndex-P.sortIndex;return J!==0?J:k.id-P.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var m=Date,p=m.now();n.unstable_now=function(){return m.now()-p}}var g=[],h=[],v=1,y=null,_=3,j=!1,N=!1,T=!1,D=!1,Y=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function V(k){for(var P=s(h);P!==null;){if(P.callback===null)i(h);else if(P.startTime<=k)i(h),P.sortIndex=P.expirationTime,l(g,P);else break;P=s(h)}}function Q(k){if(T=!1,V(k),!N)if(s(g)!==null)N=!0,ae||(ae=!0,oe());else{var P=s(h);P!==null&&pe(Q,P.startTime-k)}}var ae=!1,W=-1,w=5,$=-1;function te(){return D?!0:!(n.unstable_now()-$<w)}function fe(){if(D=!1,ae){var k=n.unstable_now();$=k;var P=!0;try{e:{N=!1,T&&(T=!1,Z(W),W=-1),j=!0;var J=_;try{t:{for(V(k),y=s(g);y!==null&&!(y.expirationTime>k&&te());){var ce=y.callback;if(typeof ce=="function"){y.callback=null,_=y.priorityLevel;var Se=ce(y.expirationTime<=k);if(k=n.unstable_now(),typeof Se=="function"){y.callback=Se,V(k),P=!0;break t}y===s(g)&&i(g),V(k)}else i(g);y=s(g)}if(y!==null)P=!0;else{var E=s(h);E!==null&&pe(Q,E.startTime-k),P=!1}}break e}finally{y=null,_=J,j=!1}P=void 0}}finally{P?oe():ae=!1}}}var oe;if(typeof G=="function")oe=function(){G(fe)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,de=re.port2;re.port1.onmessage=fe,oe=function(){de.postMessage(null)}}else oe=function(){Y(fe,0)};function pe(k,P){W=Y(function(){k(n.unstable_now())},P)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(k){k.callback=null},n.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):w=0<k?Math.floor(1e3/k):5},n.unstable_getCurrentPriorityLevel=function(){return _},n.unstable_next=function(k){switch(_){case 1:case 2:case 3:var P=3;break;default:P=_}var J=_;_=P;try{return k()}finally{_=J}},n.unstable_requestPaint=function(){D=!0},n.unstable_runWithPriority=function(k,P){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var J=_;_=k;try{return P()}finally{_=J}},n.unstable_scheduleCallback=function(k,P,J){var ce=n.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?ce+J:ce):J=ce,k){case 1:var Se=-1;break;case 2:Se=250;break;case 5:Se=1073741823;break;case 4:Se=1e4;break;default:Se=5e3}return Se=J+Se,k={id:v++,callback:P,priorityLevel:k,startTime:J,expirationTime:Se,sortIndex:-1},J>ce?(k.sortIndex=J,l(h,k),s(g)===null&&k===s(h)&&(T?(Z(W),W=-1):T=!0,pe(Q,J-ce))):(k.sortIndex=Se,l(g,k),N||j||(N=!0,ae||(ae=!0,oe()))),k},n.unstable_shouldYield=te,n.unstable_wrapCallback=function(k){var P=_;return function(){var J=_;_=P;try{return k.apply(this,arguments)}finally{_=J}}}})(Vu)),Vu}var qp;function S0(){return qp||(qp=1,Gu.exports=v0()),Gu.exports}var Ku={exports:{}},ta={};var Yp;function _0(){if(Yp)return ta;Yp=1;var n=vo();function l(g){var h="https://react.dev/errors/"+g;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)h+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+g+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var i={d:{f:s,r:function(){throw Error(l(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(g,h,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:y==null?null:""+y,children:g,containerInfo:h,implementation:v}}var m=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,h){if(g==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return ta.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,ta.createPortal=function(g,h){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(l(299));return u(g,h,null,v)},ta.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()}},ta.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))},ta.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},ta.preinit=function(g,h){if(typeof g=="string"&&h&&typeof h.as=="string"){var v=h.as,y=p(v,h.crossOrigin),_=typeof h.integrity=="string"?h.integrity:void 0,j=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;v==="style"?i.d.S(g,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:y,integrity:_,fetchPriority:j}):v==="script"&&i.d.X(g,{crossOrigin:y,integrity:_,fetchPriority:j,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},ta.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)},ta.preload=function(g,h){if(typeof g=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var v=h.as,y=p(v,h.crossOrigin);i.d.L(g,v,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},ta.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)},ta.requestFormReset=function(g){i.d.r(g)},ta.unstable_batchedUpdates=function(g,h){return g(h)},ta.useFormState=function(g,h,v){return m.H.useFormState(g,h,v)},ta.useFormStatus=function(){return m.H.useHostTransitionStatus()},ta.version="19.2.4",ta}var Gp;function j0(){if(Gp)return Ku.exports;Gp=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Ku.exports=_0(),Ku.exports}var Vp;function N0(){if(Vp)return ws;Vp=1;var n=S0(),l=vo(),s=j0();function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function m(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(u(e)!==e)throw Error(i(188))}function h(e){var t=e.alternate;if(!t){if(t=u(e),t===null)throw Error(i(188));return t!==e?null:e}for(var a=e,r=t;;){var c=a.return;if(c===null)break;var d=c.alternate;if(d===null){if(r=c.return,r!==null){a=r;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===a)return g(c),e;if(d===r)return g(c),t;d=d.sibling}throw Error(i(188))}if(a.return!==r.return)a=c,r=d;else{for(var x=!1,S=c.child;S;){if(S===a){x=!0,a=c,r=d;break}if(S===r){x=!0,r=c,a=d;break}S=S.sibling}if(!x){for(S=d.child;S;){if(S===a){x=!0,a=d,r=c;break}if(S===r){x=!0,r=d,a=c;break}S=S.sibling}if(!x)throw Error(i(189))}}if(a.alternate!==r)throw Error(i(190))}if(a.tag!==3)throw Error(i(188));return a.stateNode.current===a?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,_=Symbol.for("react.element"),j=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),Y=Symbol.for("react.profiler"),Z=Symbol.for("react.consumer"),G=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),Q=Symbol.for("react.suspense"),ae=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),te=Symbol.for("react.memo_cache_sentinel"),fe=Symbol.iterator;function oe(e){return e===null||typeof e!="object"?null:(e=fe&&e[fe]||e["@@iterator"],typeof e=="function"?e:null)}var re=Symbol.for("react.client.reference");function de(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case Y:return"Profiler";case D:return"StrictMode";case Q:return"Suspense";case ae:return"SuspenseList";case $:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case G:return e.displayName||"Context";case Z:return(e._context.displayName||"Context")+".Consumer";case V:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case W:return t=e.displayName||null,t!==null?t:de(e.type)||"Memo";case w:t=e._payload,e=e._init;try{return de(e(t))}catch{}}return null}var pe=Array.isArray,k=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J={pending:!1,data:null,method:null,action:null},ce=[],Se=-1;function E(e){return{current:e}}function U(e){0>Se||(e.current=ce[Se],ce[Se]=null,Se--)}function ee(e,t){Se++,ce[Se]=e.current,e.current=t}var le=E(null),be=E(null),Ne=E(null),ze=E(null);function Pe(e,t){switch(ee(Ne,t),ee(be,e),ee(le,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Hh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Hh(t),e=Bh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(le),ee(le,e)}function Qe(){U(le),U(be),U(Ne)}function It(e){e.memoizedState!==null&&ee(ze,e);var t=le.current,a=Bh(t,e.type);t!==a&&(ee(be,e),ee(le,a))}function fa(e){be.current===e&&(U(le),U(be)),ze.current===e&&(U(ze),bs._currentValue=J)}var Ze,tt;function dt(e){if(Ze===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Ze=t&&t[1]||"",tt=-1<a.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+Ze+e+tt}var $t=!1;function Gt(e,t){if(!e||$t)return"";$t=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var I=function(){throw Error()};if(Object.defineProperty(I.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(I,[])}catch(q){var H=q}Reflect.construct(e,[],I)}else{try{I.call()}catch(q){H=q}e.call(I.prototype)}}else{try{throw Error()}catch(q){H=q}(I=e())&&typeof I.catch=="function"&&I.catch(function(){})}}catch(q){if(q&&H&&typeof q.stack=="string")return[q.stack,H.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=r.DetermineComponentFrameRoot(),x=d[0],S=d[1];if(x&&S){var R=x.split(`
4
+ `),L=S.split(`
5
+ `);for(c=r=0;r<R.length&&!R[r].includes("DetermineComponentFrameRoot");)r++;for(;c<L.length&&!L[c].includes("DetermineComponentFrameRoot");)c++;if(r===R.length||c===L.length)for(r=R.length-1,c=L.length-1;1<=r&&0<=c&&R[r]!==L[c];)c--;for(;1<=r&&0<=c;r--,c--)if(R[r]!==L[c]){if(r!==1||c!==1)do if(r--,c--,0>c||R[r]!==L[c]){var X=`
6
+ `+R[r].replace(" at new "," at ");return e.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",e.displayName)),X}while(1<=r&&0<=c);break}}}finally{$t=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?dt(a):""}function Wt(e,t){switch(e.tag){case 26:case 27:case 5:return dt(e.type);case 16:return dt("Lazy");case 13:return e.child!==t&&t!==null?dt("Suspense Fallback"):dt("Suspense");case 19:return dt("SuspenseList");case 0:case 15:return Gt(e.type,!1);case 11:return Gt(e.type.render,!1);case 1:return Gt(e.type,!0);case 31:return dt("Activity");default:return""}}function na(e){try{var t="",a=null;do t+=Wt(e,a),a=e,e=e.return;while(e);return t}catch(r){return`
7
+ Error generating stack: `+r.message+`
8
+ `+r.stack}}var va=Object.prototype.hasOwnProperty,Sa=n.unstable_scheduleCallback,Aa=n.unstable_cancelCallback,la=n.unstable_shouldYield,ra=n.unstable_requestPaint,ht=n.unstable_now,sa=n.unstable_getCurrentPriorityLevel,ge=n.unstable_ImmediatePriority,ke=n.unstable_UserBlockingPriority,Ve=n.unstable_NormalPriority,jt=n.unstable_LowPriority,Nt=n.unstable_IdlePriority,Xt=n.log,_a=n.unstable_setDisableYieldValue,ia=null,_t=null;function wt(e){if(typeof Xt=="function"&&_a(e),_t&&typeof _t.setStrictMode=="function")try{_t.setStrictMode(ia,e)}catch{}}var kt=Math.clz32?Math.clz32:Ie,_e=Math.log,He=Math.LN2;function Ie(e){return e>>>=0,e===0?32:31-(_e(e)/He|0)|0}var K=256,ie=262144,Ae=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 Le(e,t,a){var r=e.pendingLanes;if(r===0)return 0;var c=0,d=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var S=r&134217727;return S!==0?(r=S&~d,r!==0?c=$e(r):(x&=S,x!==0?c=$e(x):a||(a=S&~e,a!==0&&(c=$e(a))))):(S=r&~d,S!==0?c=$e(S):x!==0?c=$e(x):a||(a=r&~e,a!==0&&(c=$e(a)))),c===0?0:t!==0&&t!==c&&(t&d)===0&&(d=c&-c,a=t&-t,d>=a||d===32&&(a&4194048)!==0)?t:c}function Et(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ja(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 oa(){var e=Ae;return Ae<<=1,(Ae&62914560)===0&&(Ae=4194304),e}function La(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 dl(e,t,a,r,c,d){var x=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var S=e.entanglements,R=e.expirationTimes,L=e.hiddenUpdates;for(a=x&~a;0<a;){var X=31-kt(a),I=1<<X;S[X]=0,R[X]=-1;var H=L[X];if(H!==null)for(L[X]=null,X=0;X<H.length;X++){var q=H[X];q!==null&&(q.lane&=-536870913)}a&=~I}r!==0&&$l(e,r,0),d!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=d&~(x&~t))}function $l(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-kt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|a&261930}function ql(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-kt(a),c=1<<r;c&t|e[r]&t&&(e[r]|=t),a&=~c}}function C(e,t){var a=t&-t;return a=(a&42)!==0?1:O(a),(a&(e.suspendedLanes|t))!==0?0:a}function O(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:op(e.type))}function se(e,t){var a=P.p;try{return P.p=e,t()}finally{P.p=a}}var xe=Math.random().toString(36).slice(2),ue="__reactFiber$"+xe,me="__reactProps$"+xe,he="__reactContainer$"+xe,we="__reactEvents$"+xe,Ce="__reactListeners$"+xe,je="__reactHandles$"+xe,at="__reactResources$"+xe,Ye="__reactMarker$"+xe;function ft(e){delete e[ue],delete e[me],delete e[we],delete e[Ce],delete e[je]}function gt(e){var t=e[ue];if(t)return t;for(var a=e.parentNode;a;){if(t=a[he]||a[ue]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Xh(e);e!==null;){if(a=e[ue])return a;e=Xh(e)}return t}e=a,a=e.parentNode}return null}function Ct(e){if(e=e[ue]||e[he]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function et(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function qt(e){var t=e[at];return t||(t=e[at]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function pt(e){e[Ye]=!0}var An=new Set,Pa={};function Vt(e,t){ln(e,t),ln(e+"Capture",t)}function ln(e,t){for(Pa[e]=t,e=0;e<t.length;e++)An.add(t[e])}var fl=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),rn={},ml={};function Yl(e){return va.call(ml,e)?!0:va.call(rn,e)?!1:fl.test(e)?ml[e]=!0:(rn[e]=!0,!1)}function Ge(e,t,a){if(Yl(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function Ot(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 ea(e,t,a,r){if(r===null)e.removeAttribute(a);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+r)}}function At(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Gl(e,t,a){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var c=r.get,d=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(x){a=""+x,d.call(this,x)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(x){a=""+x},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Vl(e){if(!e._valueTracker){var t=xt(e)?"checked":"value";e._valueTracker=Gl(e,t,""+e[t])}}function Xs(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=xt(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function Qs(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var ny=/[\n"\\]/g;function Ua(e){return e.replace(ny,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function To(e,t,a,r,c,d,x,S){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),t!=null?x==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+At(t)):e.value!==""+At(t)&&(e.value=""+At(t)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),t!=null?zo(e,x,At(t)):a!=null?zo(e,x,At(a)):r!=null&&e.removeAttribute("value"),c==null&&d!=null&&(e.defaultChecked=!!d),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.name=""+At(S):e.removeAttribute("name")}function Od(e,t,a,r,c,d,x,S){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||a!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){Vl(e);return}a=a!=null?""+At(a):"",t=t!=null?""+At(t):a,S||t===e.value||(e.value=t),e.defaultValue=t}r=r??c,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=S?e.checked:!!r,e.defaultChecked=!!r,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),Vl(e)}function zo(e,t,a){t==="number"&&Qs(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Kl(e,t,a,r){if(e=e.options,t){t={};for(var c=0;c<a.length;c++)t["$"+a[c]]=!0;for(a=0;a<e.length;a++)c=t.hasOwnProperty("$"+e[a].value),e[a].selected!==c&&(e[a].selected=c),c&&r&&(e[a].defaultSelected=!0)}else{for(a=""+At(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,r&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function Dd(e,t,a){if(t!=null&&(t=""+At(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+At(a):""}function Md(e,t,a,r){if(t==null){if(r!=null){if(a!=null)throw Error(i(92));if(pe(r)){if(1<r.length)throw Error(i(93));r=r[0]}a=r}a==null&&(a=""),t=a}a=At(t),e.defaultValue=a,r=e.textContent,r===a&&r!==""&&r!==null&&(e.value=r),Vl(e)}function Xl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var ly=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 kd(e,t,a){var r=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,a):typeof a!="number"||a===0||ly.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Ad(e,t,a){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,a!=null){for(var r in a)!a.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var c in t)r=t[c],t.hasOwnProperty(c)&&a[c]!==r&&kd(e,c,r)}else for(var d in t)t.hasOwnProperty(d)&&kd(e,d,t[d])}function Oo(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 ry=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"]]),sy=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Zs(e){return sy.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function hn(){}var Do=null;function Mo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ql=null,Zl=null;function Ld(e){var t=Ct(e);if(t&&(e=t.stateNode)){var a=e[me]||null;e:switch(e=t.stateNode,t.type){case"input":if(To(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="'+Ua(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var c=r[me]||null;if(!c)throw Error(i(90));To(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<a.length;t++)r=a[t],r.form===e.form&&Xs(r)}break e;case"textarea":Dd(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Kl(e,!!a.multiple,t,!1)}}}var ko=!1;function Ud(e,t,a){if(ko)return e(t,a);ko=!0;try{var r=e(t);return r}finally{if(ko=!1,(Ql!==null||Zl!==null)&&(Ai(),Ql&&(t=Ql,e=Zl,Zl=Ql=null,Ld(t),e)))for(t=0;t<e.length;t++)Ld(e[t])}}function Lr(e,t){var a=e.stateNode;if(a===null)return null;var r=a[me]||null;if(r===null)return null;a=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(i(231,t,typeof a));return a}var pn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ao=!1;if(pn)try{var Ur={};Object.defineProperty(Ur,"passive",{get:function(){Ao=!0}}),window.addEventListener("test",Ur,Ur),window.removeEventListener("test",Ur,Ur)}catch{Ao=!1}var Ln=null,Lo=null,Fs=null;function Hd(){if(Fs)return Fs;var e,t=Lo,a=t.length,r,c="value"in Ln?Ln.value:Ln.textContent,d=c.length;for(e=0;e<a&&t[e]===c[e];e++);var x=a-e;for(r=1;r<=x&&t[a-r]===c[d-r];r++);return Fs=c.slice(e,1<r?1-r:void 0)}function Js(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ps(){return!0}function Bd(){return!1}function ma(e){function t(a,r,c,d,x){this._reactName=a,this._targetInst=c,this.type=r,this.nativeEvent=d,this.target=x,this.currentTarget=null;for(var S in e)e.hasOwnProperty(S)&&(a=e[S],this[S]=a?a(d):d[S]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Ps:Bd,this.isPropagationStopped=Bd,this}return y(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Ps)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Ps)},persist:function(){},isPersistent:Ps}),t}var hl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Is=ma(hl),Hr=y({},hl,{view:0,detail:0}),iy=ma(Hr),Uo,Ho,Br,Ws=y({},Hr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$o,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Br&&(Br&&e.type==="mousemove"?(Uo=e.screenX-Br.screenX,Ho=e.screenY-Br.screenY):Ho=Uo=0,Br=e),Uo)},movementY:function(e){return"movementY"in e?e.movementY:Ho}}),$d=ma(Ws),oy=y({},Ws,{dataTransfer:0}),cy=ma(oy),uy=y({},Hr,{relatedTarget:0}),Bo=ma(uy),dy=y({},hl,{animationName:0,elapsedTime:0,pseudoElement:0}),fy=ma(dy),my=y({},hl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),hy=ma(my),py=y({},hl,{data:0}),qd=ma(py),gy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},xy={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"},yy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function by(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=yy[e])?!!t[e]:!1}function $o(){return by}var vy=y({},Hr,{key:function(e){if(e.key){var t=gy[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Js(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?xy[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$o,charCode:function(e){return e.type==="keypress"?Js(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Js(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Sy=ma(vy),_y=y({},Ws,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Yd=ma(_y),jy=y({},Hr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$o}),Ny=ma(jy),wy=y({},hl,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ey=ma(wy),Cy=y({},Ws,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Ry=ma(Cy),Ty=y({},hl,{newState:0,oldState:0}),zy=ma(Ty),Oy=[9,13,27,32],qo=pn&&"CompositionEvent"in window,$r=null;pn&&"documentMode"in document&&($r=document.documentMode);var Dy=pn&&"TextEvent"in window&&!$r,Gd=pn&&(!qo||$r&&8<$r&&11>=$r),Vd=" ",Kd=!1;function Xd(e,t){switch(e){case"keyup":return Oy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Qd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Fl=!1;function My(e,t){switch(e){case"compositionend":return Qd(t);case"keypress":return t.which!==32?null:(Kd=!0,Vd);case"textInput":return e=t.data,e===Vd&&Kd?null:e;default:return null}}function ky(e,t){if(Fl)return e==="compositionend"||!qo&&Xd(e,t)?(e=Hd(),Fs=Lo=Ln=null,Fl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Gd&&t.locale!=="ko"?null:t.data;default:return null}}var Ay={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 Zd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Ay[e.type]:t==="textarea"}function Fd(e,t,a,r){Ql?Zl?Zl.push(r):Zl=[r]:Ql=r,t=Yi(t,"onChange"),0<t.length&&(a=new Is("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var qr=null,Yr=null;function Ly(e){Dh(e,0)}function ei(e){var t=et(e);if(Xs(t))return e}function Jd(e,t){if(e==="change")return t}var Pd=!1;if(pn){var Yo;if(pn){var Go="oninput"in document;if(!Go){var Id=document.createElement("div");Id.setAttribute("oninput","return;"),Go=typeof Id.oninput=="function"}Yo=Go}else Yo=!1;Pd=Yo&&(!document.documentMode||9<document.documentMode)}function Wd(){qr&&(qr.detachEvent("onpropertychange",ef),Yr=qr=null)}function ef(e){if(e.propertyName==="value"&&ei(Yr)){var t=[];Fd(t,Yr,e,Mo(e)),Ud(Ly,t)}}function Uy(e,t,a){e==="focusin"?(Wd(),qr=t,Yr=a,qr.attachEvent("onpropertychange",ef)):e==="focusout"&&Wd()}function Hy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ei(Yr)}function By(e,t){if(e==="click")return ei(t)}function $y(e,t){if(e==="input"||e==="change")return ei(t)}function qy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var wa=typeof Object.is=="function"?Object.is:qy;function Gr(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),r=Object.keys(t);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var c=a[r];if(!va.call(t,c)||!wa(e[c],t[c]))return!1}return!0}function tf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function af(e,t){var a=tf(e);e=0;for(var r;a;){if(a.nodeType===3){if(r=e+a.textContent.length,e<=t&&r>=t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=tf(a)}}function nf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?nf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function lf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Qs(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Qs(e.document)}return t}function Vo(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 Yy=pn&&"documentMode"in document&&11>=document.documentMode,Jl=null,Ko=null,Vr=null,Xo=!1;function rf(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Xo||Jl==null||Jl!==Qs(r)||(r=Jl,"selectionStart"in r&&Vo(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Vr&&Gr(Vr,r)||(Vr=r,r=Yi(Ko,"onSelect"),0<r.length&&(t=new Is("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=Jl)))}function pl(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Pl={animationend:pl("Animation","AnimationEnd"),animationiteration:pl("Animation","AnimationIteration"),animationstart:pl("Animation","AnimationStart"),transitionrun:pl("Transition","TransitionRun"),transitionstart:pl("Transition","TransitionStart"),transitioncancel:pl("Transition","TransitionCancel"),transitionend:pl("Transition","TransitionEnd")},Qo={},sf={};pn&&(sf=document.createElement("div").style,"AnimationEvent"in window||(delete Pl.animationend.animation,delete Pl.animationiteration.animation,delete Pl.animationstart.animation),"TransitionEvent"in window||delete Pl.transitionend.transition);function gl(e){if(Qo[e])return Qo[e];if(!Pl[e])return e;var t=Pl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in sf)return Qo[e]=t[a];return e}var of=gl("animationend"),cf=gl("animationiteration"),uf=gl("animationstart"),Gy=gl("transitionrun"),Vy=gl("transitionstart"),Ky=gl("transitioncancel"),df=gl("transitionend"),ff=new Map,Zo="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(" ");Zo.push("scrollEnd");function Ia(e,t){ff.set(e,t),Vt(t,[e])}var ti=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Ha=[],Il=0,Fo=0;function ai(){for(var e=Il,t=Fo=Il=0;t<e;){var a=Ha[t];Ha[t++]=null;var r=Ha[t];Ha[t++]=null;var c=Ha[t];Ha[t++]=null;var d=Ha[t];if(Ha[t++]=null,r!==null&&c!==null){var x=r.pending;x===null?c.next=c:(c.next=x.next,x.next=c),r.pending=c}d!==0&&mf(a,c,d)}}function ni(e,t,a,r){Ha[Il++]=e,Ha[Il++]=t,Ha[Il++]=a,Ha[Il++]=r,Fo|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Jo(e,t,a,r){return ni(e,t,a,r),li(e)}function xl(e,t){return ni(e,null,null,t),li(e)}function mf(e,t,a){e.lanes|=a;var r=e.alternate;r!==null&&(r.lanes|=a);for(var c=!1,d=e.return;d!==null;)d.childLanes|=a,r=d.alternate,r!==null&&(r.childLanes|=a),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(c=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,c&&t!==null&&(c=31-kt(a),e=d.hiddenUpdates,r=e[c],r===null?e[c]=[t]:r.push(t),t.lane=a|536870912),d):null}function li(e){if(50<fs)throw fs=0,ru=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Wl={};function Xy(e,t,a,r){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ea(e,t,a,r){return new Xy(e,t,a,r)}function Po(e){return e=e.prototype,!(!e||!e.isReactComponent)}function gn(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 hf(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ri(e,t,a,r,c,d){var x=0;if(r=e,typeof e=="function")Po(e)&&(x=1);else if(typeof e=="string")x=Pb(e,a,le.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case $:return e=Ea(31,a,t,c),e.elementType=$,e.lanes=d,e;case T:return yl(a.children,c,d,t);case D:x=8,c|=24;break;case Y:return e=Ea(12,a,t,c|2),e.elementType=Y,e.lanes=d,e;case Q:return e=Ea(13,a,t,c),e.elementType=Q,e.lanes=d,e;case ae:return e=Ea(19,a,t,c),e.elementType=ae,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case G:x=10;break e;case Z:x=9;break e;case V:x=11;break e;case W:x=14;break e;case w:x=16,r=null;break e}x=29,a=Error(i(130,e===null?"null":typeof e,"")),r=null}return t=Ea(x,a,t,c),t.elementType=e,t.type=r,t.lanes=d,t}function yl(e,t,a,r){return e=Ea(7,e,r,t),e.lanes=a,e}function Io(e,t,a){return e=Ea(6,e,null,t),e.lanes=a,e}function pf(e){var t=Ea(18,null,null,0);return t.stateNode=e,t}function Wo(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 gf=new WeakMap;function Ba(e,t){if(typeof e=="object"&&e!==null){var a=gf.get(e);return a!==void 0?a:(t={value:e,source:t,stack:na(t)},gf.set(e,t),t)}return{value:e,source:t,stack:na(t)}}var er=[],tr=0,si=null,Kr=0,$a=[],qa=0,Un=null,sn=1,on="";function xn(e,t){er[tr++]=Kr,er[tr++]=si,si=e,Kr=t}function xf(e,t,a){$a[qa++]=sn,$a[qa++]=on,$a[qa++]=Un,Un=e;var r=sn;e=on;var c=32-kt(r)-1;r&=~(1<<c),a+=1;var d=32-kt(t)+c;if(30<d){var x=c-c%5;d=(r&(1<<x)-1).toString(32),r>>=x,c-=x,sn=1<<32-kt(t)+c|a<<c|r,on=d+e}else sn=1<<d|a<<c|r,on=e}function ec(e){e.return!==null&&(xn(e,1),xf(e,1,0))}function tc(e){for(;e===si;)si=er[--tr],er[tr]=null,Kr=er[--tr],er[tr]=null;for(;e===Un;)Un=$a[--qa],$a[qa]=null,on=$a[--qa],$a[qa]=null,sn=$a[--qa],$a[qa]=null}function yf(e,t){$a[qa++]=sn,$a[qa++]=on,$a[qa++]=Un,sn=t.id,on=t.overflow,Un=e}var Qt=null,yt=null,We=!1,Hn=null,Ya=!1,ac=Error(i(519));function Bn(e){var t=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Xr(Ba(t,e)),ac}function bf(e){var t=e.stateNode,a=e.type,r=e.memoizedProps;switch(t[ue]=e,t[me]=r,a){case"dialog":Xe("cancel",t),Xe("close",t);break;case"iframe":case"object":case"embed":Xe("load",t);break;case"video":case"audio":for(a=0;a<hs.length;a++)Xe(hs[a],t);break;case"source":Xe("error",t);break;case"img":case"image":case"link":Xe("error",t),Xe("load",t);break;case"details":Xe("toggle",t);break;case"input":Xe("invalid",t),Od(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Xe("invalid",t);break;case"textarea":Xe("invalid",t),Md(t,r.value,r.defaultValue,r.children)}a=r.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||r.suppressHydrationWarning===!0||Lh(t.textContent,a)?(r.popover!=null&&(Xe("beforetoggle",t),Xe("toggle",t)),r.onScroll!=null&&Xe("scroll",t),r.onScrollEnd!=null&&Xe("scrollend",t),r.onClick!=null&&(t.onclick=hn),t=!0):t=!1,t||Bn(e,!0)}function vf(e){for(Qt=e.return;Qt;)switch(Qt.tag){case 5:case 31:case 13:Ya=!1;return;case 27:case 3:Ya=!0;return;default:Qt=Qt.return}}function ar(e){if(e!==Qt)return!1;if(!We)return vf(e),We=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||vu(e.type,e.memoizedProps)),a=!a),a&&yt&&Bn(e),vf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));yt=Kh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));yt=Kh(e)}else t===27?(t=yt,Wn(e.type)?(e=wu,wu=null,yt=e):yt=t):yt=Qt?Va(e.stateNode.nextSibling):null;return!0}function bl(){yt=Qt=null,We=!1}function nc(){var e=Hn;return e!==null&&(xa===null?xa=e:xa.push.apply(xa,e),Hn=null),e}function Xr(e){Hn===null?Hn=[e]:Hn.push(e)}var lc=E(null),vl=null,yn=null;function $n(e,t,a){ee(lc,t._currentValue),t._currentValue=a}function bn(e){e._currentValue=lc.current,U(lc)}function rc(e,t,a){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===a)break;e=e.return}}function sc(e,t,a,r){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var d=c.dependencies;if(d!==null){var x=c.child;d=d.firstContext;e:for(;d!==null;){var S=d;d=c;for(var R=0;R<t.length;R++)if(S.context===t[R]){d.lanes|=a,S=d.alternate,S!==null&&(S.lanes|=a),rc(d.return,a,e),r||(x=null);break e}d=S.next}}else if(c.tag===18){if(x=c.return,x===null)throw Error(i(341));x.lanes|=a,d=x.alternate,d!==null&&(d.lanes|=a),rc(x,a,e),x=null}else x=c.child;if(x!==null)x.return=c;else for(x=c;x!==null;){if(x===e){x=null;break}if(c=x.sibling,c!==null){c.return=x.return,x=c;break}x=x.return}c=x}}function nr(e,t,a,r){e=null;for(var c=t,d=!1;c!==null;){if(!d){if((c.flags&524288)!==0)d=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var x=c.alternate;if(x===null)throw Error(i(387));if(x=x.memoizedProps,x!==null){var S=c.type;wa(c.pendingProps.value,x.value)||(e!==null?e.push(S):e=[S])}}else if(c===ze.current){if(x=c.alternate,x===null)throw Error(i(387));x.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(bs):e=[bs])}c=c.return}e!==null&&sc(t,e,a,r),t.flags|=262144}function ii(e){for(e=e.firstContext;e!==null;){if(!wa(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Sl(e){vl=e,yn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Zt(e){return Sf(vl,e)}function oi(e,t){return vl===null&&Sl(e),Sf(e,t)}function Sf(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},yn===null){if(e===null)throw Error(i(308));yn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else yn=yn.next=t;return a}var Qy=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Zy=n.unstable_scheduleCallback,Fy=n.unstable_NormalPriority,Lt={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ic(){return{controller:new Qy,data:new Map,refCount:0}}function Qr(e){e.refCount--,e.refCount===0&&Zy(Fy,function(){e.controller.abort()})}var Zr=null,oc=0,lr=0,rr=null;function Jy(e,t){if(Zr===null){var a=Zr=[];oc=0,lr=du(),rr={status:"pending",value:void 0,then:function(r){a.push(r)}}}return oc++,t.then(_f,_f),t}function _f(){if(--oc===0&&Zr!==null){rr!==null&&(rr.status="fulfilled");var e=Zr;Zr=null,lr=0,rr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Py(e,t){var a=[],r={status:"pending",value:null,reason:null,then:function(c){a.push(c)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var c=0;c<a.length;c++)(0,a[c])(t)},function(c){for(r.status="rejected",r.reason=c,c=0;c<a.length;c++)(0,a[c])(void 0)}),r}var jf=k.S;k.S=function(e,t){sh=ht(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Jy(e,t),jf!==null&&jf(e,t)};var _l=E(null);function cc(){var e=_l.current;return e!==null?e:mt.pooledCache}function ci(e,t){t===null?ee(_l,_l.current):ee(_l,t.pool)}function Nf(){var e=cc();return e===null?null:{parent:Lt._currentValue,pool:e}}var sr=Error(i(460)),uc=Error(i(474)),ui=Error(i(542)),di={then:function(){}};function wf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Ef(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(hn,hn),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Rf(e),e;default:if(typeof t.status=="string")t.then(hn,hn);else{if(e=mt,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=r}},function(r){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Rf(e),e}throw Nl=t,sr}}function jl(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Nl=a,sr):a}}var Nl=null;function Cf(){if(Nl===null)throw Error(i(459));var e=Nl;return Nl=null,e}function Rf(e){if(e===sr||e===ui)throw Error(i(483))}var ir=null,Fr=0;function fi(e){var t=Fr;return Fr+=1,ir===null&&(ir=[]),Ef(ir,e,t)}function Jr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function mi(e,t){throw t.$$typeof===_?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Tf(e){function t(M,z){if(e){var A=M.deletions;A===null?(M.deletions=[z],M.flags|=16):A.push(z)}}function a(M,z){if(!e)return null;for(;z!==null;)t(M,z),z=z.sibling;return null}function r(M){for(var z=new Map;M!==null;)M.key!==null?z.set(M.key,M):z.set(M.index,M),M=M.sibling;return z}function c(M,z){return M=gn(M,z),M.index=0,M.sibling=null,M}function d(M,z,A){return M.index=A,e?(A=M.alternate,A!==null?(A=A.index,A<z?(M.flags|=67108866,z):A):(M.flags|=67108866,z)):(M.flags|=1048576,z)}function x(M){return e&&M.alternate===null&&(M.flags|=67108866),M}function S(M,z,A,F){return z===null||z.tag!==6?(z=Io(A,M.mode,F),z.return=M,z):(z=c(z,A),z.return=M,z)}function R(M,z,A,F){var Ee=A.type;return Ee===T?X(M,z,A.props.children,F,A.key):z!==null&&(z.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===w&&jl(Ee)===z.type)?(z=c(z,A.props),Jr(z,A),z.return=M,z):(z=ri(A.type,A.key,A.props,null,M.mode,F),Jr(z,A),z.return=M,z)}function L(M,z,A,F){return z===null||z.tag!==4||z.stateNode.containerInfo!==A.containerInfo||z.stateNode.implementation!==A.implementation?(z=Wo(A,M.mode,F),z.return=M,z):(z=c(z,A.children||[]),z.return=M,z)}function X(M,z,A,F,Ee){return z===null||z.tag!==7?(z=yl(A,M.mode,F,Ee),z.return=M,z):(z=c(z,A),z.return=M,z)}function I(M,z,A){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=Io(""+z,M.mode,A),z.return=M,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case j:return A=ri(z.type,z.key,z.props,null,M.mode,A),Jr(A,z),A.return=M,A;case N:return z=Wo(z,M.mode,A),z.return=M,z;case w:return z=jl(z),I(M,z,A)}if(pe(z)||oe(z))return z=yl(z,M.mode,A,null),z.return=M,z;if(typeof z.then=="function")return I(M,fi(z),A);if(z.$$typeof===G)return I(M,oi(M,z),A);mi(M,z)}return null}function H(M,z,A,F){var Ee=z!==null?z.key:null;if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return Ee!==null?null:S(M,z,""+A,F);if(typeof A=="object"&&A!==null){switch(A.$$typeof){case j:return A.key===Ee?R(M,z,A,F):null;case N:return A.key===Ee?L(M,z,A,F):null;case w:return A=jl(A),H(M,z,A,F)}if(pe(A)||oe(A))return Ee!==null?null:X(M,z,A,F,null);if(typeof A.then=="function")return H(M,z,fi(A),F);if(A.$$typeof===G)return H(M,z,oi(M,A),F);mi(M,A)}return null}function q(M,z,A,F,Ee){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return M=M.get(A)||null,S(z,M,""+F,Ee);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case j:return M=M.get(F.key===null?A:F.key)||null,R(z,M,F,Ee);case N:return M=M.get(F.key===null?A:F.key)||null,L(z,M,F,Ee);case w:return F=jl(F),q(M,z,A,F,Ee)}if(pe(F)||oe(F))return M=M.get(A)||null,X(z,M,F,Ee,null);if(typeof F.then=="function")return q(M,z,A,fi(F),Ee);if(F.$$typeof===G)return q(M,z,A,oi(z,F),Ee);mi(z,F)}return null}function ye(M,z,A,F){for(var Ee=null,nt=null,ve=z,Be=z=0,Je=null;ve!==null&&Be<A.length;Be++){ve.index>Be?(Je=ve,ve=null):Je=ve.sibling;var lt=H(M,ve,A[Be],F);if(lt===null){ve===null&&(ve=Je);break}e&&ve&&lt.alternate===null&&t(M,ve),z=d(lt,z,Be),nt===null?Ee=lt:nt.sibling=lt,nt=lt,ve=Je}if(Be===A.length)return a(M,ve),We&&xn(M,Be),Ee;if(ve===null){for(;Be<A.length;Be++)ve=I(M,A[Be],F),ve!==null&&(z=d(ve,z,Be),nt===null?Ee=ve:nt.sibling=ve,nt=ve);return We&&xn(M,Be),Ee}for(ve=r(ve);Be<A.length;Be++)Je=q(ve,M,Be,A[Be],F),Je!==null&&(e&&Je.alternate!==null&&ve.delete(Je.key===null?Be:Je.key),z=d(Je,z,Be),nt===null?Ee=Je:nt.sibling=Je,nt=Je);return e&&ve.forEach(function(ll){return t(M,ll)}),We&&xn(M,Be),Ee}function Te(M,z,A,F){if(A==null)throw Error(i(151));for(var Ee=null,nt=null,ve=z,Be=z=0,Je=null,lt=A.next();ve!==null&&!lt.done;Be++,lt=A.next()){ve.index>Be?(Je=ve,ve=null):Je=ve.sibling;var ll=H(M,ve,lt.value,F);if(ll===null){ve===null&&(ve=Je);break}e&&ve&&ll.alternate===null&&t(M,ve),z=d(ll,z,Be),nt===null?Ee=ll:nt.sibling=ll,nt=ll,ve=Je}if(lt.done)return a(M,ve),We&&xn(M,Be),Ee;if(ve===null){for(;!lt.done;Be++,lt=A.next())lt=I(M,lt.value,F),lt!==null&&(z=d(lt,z,Be),nt===null?Ee=lt:nt.sibling=lt,nt=lt);return We&&xn(M,Be),Ee}for(ve=r(ve);!lt.done;Be++,lt=A.next())lt=q(ve,M,Be,lt.value,F),lt!==null&&(e&&lt.alternate!==null&&ve.delete(lt.key===null?Be:lt.key),z=d(lt,z,Be),nt===null?Ee=lt:nt.sibling=lt,nt=lt);return e&&ve.forEach(function(ov){return t(M,ov)}),We&&xn(M,Be),Ee}function ut(M,z,A,F){if(typeof A=="object"&&A!==null&&A.type===T&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case j:e:{for(var Ee=A.key;z!==null;){if(z.key===Ee){if(Ee=A.type,Ee===T){if(z.tag===7){a(M,z.sibling),F=c(z,A.props.children),F.return=M,M=F;break e}}else if(z.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===w&&jl(Ee)===z.type){a(M,z.sibling),F=c(z,A.props),Jr(F,A),F.return=M,M=F;break e}a(M,z);break}else t(M,z);z=z.sibling}A.type===T?(F=yl(A.props.children,M.mode,F,A.key),F.return=M,M=F):(F=ri(A.type,A.key,A.props,null,M.mode,F),Jr(F,A),F.return=M,M=F)}return x(M);case N:e:{for(Ee=A.key;z!==null;){if(z.key===Ee)if(z.tag===4&&z.stateNode.containerInfo===A.containerInfo&&z.stateNode.implementation===A.implementation){a(M,z.sibling),F=c(z,A.children||[]),F.return=M,M=F;break e}else{a(M,z);break}else t(M,z);z=z.sibling}F=Wo(A,M.mode,F),F.return=M,M=F}return x(M);case w:return A=jl(A),ut(M,z,A,F)}if(pe(A))return ye(M,z,A,F);if(oe(A)){if(Ee=oe(A),typeof Ee!="function")throw Error(i(150));return A=Ee.call(A),Te(M,z,A,F)}if(typeof A.then=="function")return ut(M,z,fi(A),F);if(A.$$typeof===G)return ut(M,z,oi(M,A),F);mi(M,A)}return typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint"?(A=""+A,z!==null&&z.tag===6?(a(M,z.sibling),F=c(z,A),F.return=M,M=F):(a(M,z),F=Io(A,M.mode,F),F.return=M,M=F),x(M)):a(M,z)}return function(M,z,A,F){try{Fr=0;var Ee=ut(M,z,A,F);return ir=null,Ee}catch(ve){if(ve===sr||ve===ui)throw ve;var nt=Ea(29,ve,null,M.mode);return nt.lanes=F,nt.return=M,nt}}}var wl=Tf(!0),zf=Tf(!1),qn=!1;function dc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Yn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Gn(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(rt&2)!==0){var c=r.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),r.pending=t,t=li(e),mf(e,null,a),t}return ni(e,r,t,a),li(e)}function Pr(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,ql(e,a)}}function mc(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var c=null,d=null;if(a=a.firstBaseUpdate,a!==null){do{var x={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};d===null?c=d=x:d=d.next=x,a=a.next}while(a!==null);d===null?c=d=t:d=d.next=t}else c=d=t;a={baseState:r.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:r.shared,callbacks:r.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var hc=!1;function Ir(){if(hc){var e=rr;if(e!==null)throw e}}function Wr(e,t,a,r){hc=!1;var c=e.updateQueue;qn=!1;var d=c.firstBaseUpdate,x=c.lastBaseUpdate,S=c.shared.pending;if(S!==null){c.shared.pending=null;var R=S,L=R.next;R.next=null,x===null?d=L:x.next=L,x=R;var X=e.alternate;X!==null&&(X=X.updateQueue,S=X.lastBaseUpdate,S!==x&&(S===null?X.firstBaseUpdate=L:S.next=L,X.lastBaseUpdate=R))}if(d!==null){var I=c.baseState;x=0,X=L=R=null,S=d;do{var H=S.lane&-536870913,q=H!==S.lane;if(q?(Fe&H)===H:(r&H)===H){H!==0&&H===lr&&(hc=!0),X!==null&&(X=X.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var ye=e,Te=S;H=t;var ut=a;switch(Te.tag){case 1:if(ye=Te.payload,typeof ye=="function"){I=ye.call(ut,I,H);break e}I=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=Te.payload,H=typeof ye=="function"?ye.call(ut,I,H):ye,H==null)break e;I=y({},I,H);break e;case 2:qn=!0}}H=S.callback,H!==null&&(e.flags|=64,q&&(e.flags|=8192),q=c.callbacks,q===null?c.callbacks=[H]:q.push(H))}else q={lane:H,tag:S.tag,payload:S.payload,callback:S.callback,next:null},X===null?(L=X=q,R=I):X=X.next=q,x|=H;if(S=S.next,S===null){if(S=c.shared.pending,S===null)break;q=S,S=q.next,q.next=null,c.lastBaseUpdate=q,c.shared.pending=null}}while(!0);X===null&&(R=I),c.baseState=R,c.firstBaseUpdate=L,c.lastBaseUpdate=X,d===null&&(c.shared.lanes=0),Zn|=x,e.lanes=x,e.memoizedState=I}}function Of(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function Df(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Of(a[e],t)}var or=E(null),hi=E(0);function Mf(e,t){e=Rn,ee(hi,e),ee(or,t),Rn=e|t.baseLanes}function pc(){ee(hi,Rn),ee(or,or.current)}function gc(){Rn=hi.current,U(or),U(hi)}var Ca=E(null),Ga=null;function Vn(e){var t=e.alternate;ee(Dt,Dt.current&1),ee(Ca,e),Ga===null&&(t===null||or.current!==null||t.memoizedState!==null)&&(Ga=e)}function xc(e){ee(Dt,Dt.current),ee(Ca,e),Ga===null&&(Ga=e)}function kf(e){e.tag===22?(ee(Dt,Dt.current),ee(Ca,e),Ga===null&&(Ga=e)):Kn()}function Kn(){ee(Dt,Dt.current),ee(Ca,Ca.current)}function Ra(e){U(Ca),Ga===e&&(Ga=null),U(Dt)}var Dt=E(0);function pi(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||ju(a)||Nu(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var vn=0,Ue=null,ot=null,Ut=null,gi=!1,cr=!1,El=!1,xi=0,es=0,ur=null,Iy=0;function Rt(){throw Error(i(321))}function yc(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 bc(e,t,a,r,c,d){return vn=d,Ue=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?xm:kc,El=!1,d=a(r,c),El=!1,cr&&(d=Lf(t,a,r,c)),Af(e),d}function Af(e){k.H=ns;var t=ot!==null&&ot.next!==null;if(vn=0,Ut=ot=Ue=null,gi=!1,es=0,ur=null,t)throw Error(i(300));e===null||Ht||(e=e.dependencies,e!==null&&ii(e)&&(Ht=!0))}function Lf(e,t,a,r){Ue=e;var c=0;do{if(cr&&(ur=null),es=0,cr=!1,25<=c)throw Error(i(301));if(c+=1,Ut=ot=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}k.H=ym,d=t(a,r)}while(cr);return d}function Wy(){var e=k.H,t=e.useState()[0];return t=typeof t.then=="function"?ts(t):t,e=e.useState()[0],(ot!==null?ot.memoizedState:null)!==e&&(Ue.flags|=1024),t}function vc(){var e=xi!==0;return xi=0,e}function Sc(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function _c(e){if(gi){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}gi=!1}vn=0,Ut=ot=Ue=null,cr=!1,es=xi=0,ur=null}function ca(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?Ue.memoizedState=Ut=e:Ut=Ut.next=e,Ut}function Mt(){if(ot===null){var e=Ue.alternate;e=e!==null?e.memoizedState:null}else e=ot.next;var t=Ut===null?Ue.memoizedState:Ut.next;if(t!==null)Ut=t,ot=e;else{if(e===null)throw Ue.alternate===null?Error(i(467)):Error(i(310));ot=e,e={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},Ut===null?Ue.memoizedState=Ut=e:Ut=Ut.next=e}return Ut}function yi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ts(e){var t=es;return es+=1,ur===null&&(ur=[]),e=Ef(ur,e,t),t=Ue,(Ut===null?t.memoizedState:Ut.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?xm:kc),e}function bi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ts(e);if(e.$$typeof===G)return Zt(e)}throw Error(i(438,String(e)))}function jc(e){var t=null,a=Ue.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var r=Ue.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=yi(),Ue.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),r=0;r<e;r++)a[r]=te;return t.index++,a}function Sn(e,t){return typeof t=="function"?t(e):t}function vi(e){var t=Mt();return Nc(t,ot,e)}function Nc(e,t,a){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=a;var c=e.baseQueue,d=r.pending;if(d!==null){if(c!==null){var x=c.next;c.next=d.next,d.next=x}t.baseQueue=c=d,r.pending=null}if(d=e.baseState,c===null)e.memoizedState=d;else{t=c.next;var S=x=null,R=null,L=t,X=!1;do{var I=L.lane&-536870913;if(I!==L.lane?(Fe&I)===I:(vn&I)===I){var H=L.revertLane;if(H===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),I===lr&&(X=!0);else if((vn&H)===H){L=L.next,H===lr&&(X=!0);continue}else I={lane:0,revertLane:L.revertLane,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},R===null?(S=R=I,x=d):R=R.next=I,Ue.lanes|=H,Zn|=H;I=L.action,El&&a(d,I),d=L.hasEagerState?L.eagerState:a(d,I)}else H={lane:I,revertLane:L.revertLane,gesture:L.gesture,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},R===null?(S=R=H,x=d):R=R.next=H,Ue.lanes|=I,Zn|=I;L=L.next}while(L!==null&&L!==t);if(R===null?x=d:R.next=S,!wa(d,e.memoizedState)&&(Ht=!0,X&&(a=rr,a!==null)))throw a;e.memoizedState=d,e.baseState=x,e.baseQueue=R,r.lastRenderedState=d}return c===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function wc(e){var t=Mt(),a=t.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=e;var r=a.dispatch,c=a.pending,d=t.memoizedState;if(c!==null){a.pending=null;var x=c=c.next;do d=e(d,x.action),x=x.next;while(x!==c);wa(d,t.memoizedState)||(Ht=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),a.lastRenderedState=d}return[d,r]}function Uf(e,t,a){var r=Ue,c=Mt(),d=We;if(d){if(a===void 0)throw Error(i(407));a=a()}else a=t();var x=!wa((ot||c).memoizedState,a);if(x&&(c.memoizedState=a,Ht=!0),c=c.queue,Rc($f.bind(null,r,c,e),[e]),c.getSnapshot!==t||x||Ut!==null&&Ut.memoizedState.tag&1){if(r.flags|=2048,dr(9,{destroy:void 0},Bf.bind(null,r,c,a,t),null),mt===null)throw Error(i(349));d||(vn&127)!==0||Hf(r,t,a)}return a}function Hf(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Ue.updateQueue,t===null?(t=yi(),Ue.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Bf(e,t,a,r){t.value=a,t.getSnapshot=r,qf(t)&&Yf(e)}function $f(e,t,a){return a(function(){qf(t)&&Yf(e)})}function qf(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!wa(e,a)}catch{return!0}}function Yf(e){var t=xl(e,2);t!==null&&ya(t,e,2)}function Ec(e){var t=ca();if(typeof e=="function"){var a=e;if(e=a(),El){wt(!0);try{a()}finally{wt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sn,lastRenderedState:e},t}function Gf(e,t,a,r){return e.baseState=a,Nc(e,ot,typeof r=="function"?r:Sn)}function eb(e,t,a,r,c){if(ji(e))throw Error(i(485));if(e=t.action,e!==null){var d={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){d.listeners.push(x)}};k.T!==null?a(!0):d.isTransition=!1,r(d),a=t.pending,a===null?(d.next=t.pending=d,Vf(t,d)):(d.next=a.next,t.pending=a.next=d)}}function Vf(e,t){var a=t.action,r=t.payload,c=e.state;if(t.isTransition){var d=k.T,x={};k.T=x;try{var S=a(c,r),R=k.S;R!==null&&R(x,S),Kf(e,t,S)}catch(L){Cc(e,t,L)}finally{d!==null&&x.types!==null&&(d.types=x.types),k.T=d}}else try{d=a(c,r),Kf(e,t,d)}catch(L){Cc(e,t,L)}}function Kf(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){Xf(e,t,r)},function(r){return Cc(e,t,r)}):Xf(e,t,a)}function Xf(e,t,a){t.status="fulfilled",t.value=a,Qf(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Vf(e,a)))}function Cc(e,t,a){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=a,Qf(t),t=t.next;while(t!==r)}e.action=null}function Qf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zf(e,t){return t}function Ff(e,t){if(We){var a=mt.formState;if(a!==null){e:{var r=Ue;if(We){if(yt){t:{for(var c=yt,d=Ya;c.nodeType!==8;){if(!d){c=null;break t}if(c=Va(c.nextSibling),c===null){c=null;break t}}d=c.data,c=d==="F!"||d==="F"?c:null}if(c){yt=Va(c.nextSibling),r=c.data==="F!";break e}}Bn(r)}r=!1}r&&(t=a[0])}}return a=ca(),a.memoizedState=a.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zf,lastRenderedState:t},a.queue=r,a=hm.bind(null,Ue,r),r.dispatch=a,r=Ec(!1),d=Mc.bind(null,Ue,!1,r.queue),r=ca(),c={state:t,dispatch:null,action:e,pending:null},r.queue=c,a=eb.bind(null,Ue,c,d,a),c.dispatch=a,r.memoizedState=e,[t,a,!1]}function Jf(e){var t=Mt();return Pf(t,ot,e)}function Pf(e,t,a){if(t=Nc(e,t,Zf)[0],e=vi(Sn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=ts(t)}catch(x){throw x===sr?ui:x}else r=t;t=Mt();var c=t.queue,d=c.dispatch;return a!==t.memoizedState&&(Ue.flags|=2048,dr(9,{destroy:void 0},tb.bind(null,c,a),null)),[r,d,e]}function tb(e,t){e.action=t}function If(e){var t=Mt(),a=ot;if(a!==null)return Pf(t,a,e);Mt(),t=t.memoizedState,a=Mt();var r=a.queue.dispatch;return a.memoizedState=e,[t,r,!1]}function dr(e,t,a,r){return e={tag:e,create:a,deps:r,inst:t,next:null},t=Ue.updateQueue,t===null&&(t=yi(),Ue.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e),e}function Wf(){return Mt().memoizedState}function Si(e,t,a,r){var c=ca();Ue.flags|=e,c.memoizedState=dr(1|t,{destroy:void 0},a,r===void 0?null:r)}function _i(e,t,a,r){var c=Mt();r=r===void 0?null:r;var d=c.memoizedState.inst;ot!==null&&r!==null&&yc(r,ot.memoizedState.deps)?c.memoizedState=dr(t,d,a,r):(Ue.flags|=e,c.memoizedState=dr(1|t,d,a,r))}function em(e,t){Si(8390656,8,e,t)}function Rc(e,t){_i(2048,8,e,t)}function ab(e){Ue.flags|=4;var t=Ue.updateQueue;if(t===null)t=yi(),Ue.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function tm(e){var t=Mt().memoizedState;return ab({ref:t,nextImpl:e}),function(){if((rt&2)!==0)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function am(e,t){return _i(4,2,e,t)}function nm(e,t){return _i(4,4,e,t)}function lm(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 rm(e,t,a){a=a!=null?a.concat([e]):null,_i(4,4,lm.bind(null,t,e),a)}function Tc(){}function sm(e,t){var a=Mt();t=t===void 0?null:t;var r=a.memoizedState;return t!==null&&yc(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function im(e,t){var a=Mt();t=t===void 0?null:t;var r=a.memoizedState;if(t!==null&&yc(t,r[1]))return r[0];if(r=e(),El){wt(!0);try{e()}finally{wt(!1)}}return a.memoizedState=[r,t],r}function zc(e,t,a){return a===void 0||(vn&1073741824)!==0&&(Fe&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=oh(),Ue.lanes|=e,Zn|=e,a)}function om(e,t,a,r){return wa(a,t)?a:or.current!==null?(e=zc(e,a,r),wa(e,t)||(Ht=!0),e):(vn&42)===0||(vn&1073741824)!==0&&(Fe&261930)===0?(Ht=!0,e.memoizedState=a):(e=oh(),Ue.lanes|=e,Zn|=e,t)}function cm(e,t,a,r,c){var d=P.p;P.p=d!==0&&8>d?d:8;var x=k.T,S={};k.T=S,Mc(e,!1,t,a);try{var R=c(),L=k.S;if(L!==null&&L(S,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var X=Py(R,r);as(e,t,X,Oa(e))}else as(e,t,r,Oa(e))}catch(I){as(e,t,{then:function(){},status:"rejected",reason:I},Oa())}finally{P.p=d,x!==null&&S.types!==null&&(x.types=S.types),k.T=x}}function nb(){}function Oc(e,t,a,r){if(e.tag!==5)throw Error(i(476));var c=um(e).queue;cm(e,c,t,J,a===null?nb:function(){return dm(e),a(r)})}function um(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sn,lastRenderedState:J},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function dm(e){var t=um(e);t.next===null&&(t=e.alternate.memoizedState),as(e,t.next.queue,{},Oa())}function Dc(){return Zt(bs)}function fm(){return Mt().memoizedState}function mm(){return Mt().memoizedState}function lb(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Oa();e=Yn(a);var r=Gn(t,e,a);r!==null&&(ya(r,t,a),Pr(r,t,a)),t={cache:ic()},e.payload=t;return}t=t.return}}function rb(e,t,a){var r=Oa();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},ji(e)?pm(t,a):(a=Jo(e,t,a,r),a!==null&&(ya(a,e,r),gm(a,t,r)))}function hm(e,t,a){var r=Oa();as(e,t,a,r)}function as(e,t,a,r){var c={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(ji(e))pm(t,c);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var x=t.lastRenderedState,S=d(x,a);if(c.hasEagerState=!0,c.eagerState=S,wa(S,x))return ni(e,t,c,0),mt===null&&ai(),!1}catch{}if(a=Jo(e,t,c,r),a!==null)return ya(a,e,r),gm(a,t,r),!0}return!1}function Mc(e,t,a,r){if(r={lane:2,revertLane:du(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ji(e)){if(t)throw Error(i(479))}else t=Jo(e,a,r,2),t!==null&&ya(t,e,2)}function ji(e){var t=e.alternate;return e===Ue||t!==null&&t===Ue}function pm(e,t){cr=gi=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function gm(e,t,a){if((a&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,ql(e,a)}}var ns={readContext:Zt,use:bi,useCallback:Rt,useContext:Rt,useEffect:Rt,useImperativeHandle:Rt,useLayoutEffect:Rt,useInsertionEffect:Rt,useMemo:Rt,useReducer:Rt,useRef:Rt,useState:Rt,useDebugValue:Rt,useDeferredValue:Rt,useTransition:Rt,useSyncExternalStore:Rt,useId:Rt,useHostTransitionStatus:Rt,useFormState:Rt,useActionState:Rt,useOptimistic:Rt,useMemoCache:Rt,useCacheRefresh:Rt};ns.useEffectEvent=Rt;var xm={readContext:Zt,use:bi,useCallback:function(e,t){return ca().memoizedState=[e,t===void 0?null:t],e},useContext:Zt,useEffect:em,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Si(4194308,4,lm.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Si(4194308,4,e,t)},useInsertionEffect:function(e,t){Si(4,2,e,t)},useMemo:function(e,t){var a=ca();t=t===void 0?null:t;var r=e();if(El){wt(!0);try{e()}finally{wt(!1)}}return a.memoizedState=[r,t],r},useReducer:function(e,t,a){var r=ca();if(a!==void 0){var c=a(t);if(El){wt(!0);try{a(t)}finally{wt(!1)}}}else c=t;return r.memoizedState=r.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},r.queue=e,e=e.dispatch=rb.bind(null,Ue,e),[r.memoizedState,e]},useRef:function(e){var t=ca();return e={current:e},t.memoizedState=e},useState:function(e){e=Ec(e);var t=e.queue,a=hm.bind(null,Ue,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Tc,useDeferredValue:function(e,t){var a=ca();return zc(a,e,t)},useTransition:function(){var e=Ec(!1);return e=cm.bind(null,Ue,e.queue,!0,!1),ca().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var r=Ue,c=ca();if(We){if(a===void 0)throw Error(i(407));a=a()}else{if(a=t(),mt===null)throw Error(i(349));(Fe&127)!==0||Hf(r,t,a)}c.memoizedState=a;var d={value:a,getSnapshot:t};return c.queue=d,em($f.bind(null,r,d,e),[e]),r.flags|=2048,dr(9,{destroy:void 0},Bf.bind(null,r,d,a,t),null),a},useId:function(){var e=ca(),t=mt.identifierPrefix;if(We){var a=on,r=sn;a=(r&~(1<<32-kt(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=xi++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Iy++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Dc,useFormState:Ff,useActionState:Ff,useOptimistic:function(e){var t=ca();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Mc.bind(null,Ue,!0,a),a.dispatch=t,[e,t]},useMemoCache:jc,useCacheRefresh:function(){return ca().memoizedState=lb.bind(null,Ue)},useEffectEvent:function(e){var t=ca(),a={impl:e};return t.memoizedState=a,function(){if((rt&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}},kc={readContext:Zt,use:bi,useCallback:sm,useContext:Zt,useEffect:Rc,useImperativeHandle:rm,useInsertionEffect:am,useLayoutEffect:nm,useMemo:im,useReducer:vi,useRef:Wf,useState:function(){return vi(Sn)},useDebugValue:Tc,useDeferredValue:function(e,t){var a=Mt();return om(a,ot.memoizedState,e,t)},useTransition:function(){var e=vi(Sn)[0],t=Mt().memoizedState;return[typeof e=="boolean"?e:ts(e),t]},useSyncExternalStore:Uf,useId:fm,useHostTransitionStatus:Dc,useFormState:Jf,useActionState:Jf,useOptimistic:function(e,t){var a=Mt();return Gf(a,ot,e,t)},useMemoCache:jc,useCacheRefresh:mm};kc.useEffectEvent=tm;var ym={readContext:Zt,use:bi,useCallback:sm,useContext:Zt,useEffect:Rc,useImperativeHandle:rm,useInsertionEffect:am,useLayoutEffect:nm,useMemo:im,useReducer:wc,useRef:Wf,useState:function(){return wc(Sn)},useDebugValue:Tc,useDeferredValue:function(e,t){var a=Mt();return ot===null?zc(a,e,t):om(a,ot.memoizedState,e,t)},useTransition:function(){var e=wc(Sn)[0],t=Mt().memoizedState;return[typeof e=="boolean"?e:ts(e),t]},useSyncExternalStore:Uf,useId:fm,useHostTransitionStatus:Dc,useFormState:If,useActionState:If,useOptimistic:function(e,t){var a=Mt();return ot!==null?Gf(a,ot,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:jc,useCacheRefresh:mm};ym.useEffectEvent=tm;function Ac(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:y({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Lc={enqueueSetState:function(e,t,a){e=e._reactInternals;var r=Oa(),c=Yn(r);c.payload=t,a!=null&&(c.callback=a),t=Gn(e,c,r),t!==null&&(ya(t,e,r),Pr(t,e,r))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=Oa(),c=Yn(r);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=Gn(e,c,r),t!==null&&(ya(t,e,r),Pr(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Oa(),r=Yn(a);r.tag=2,t!=null&&(r.callback=t),t=Gn(e,r,a),t!==null&&(ya(t,e,a),Pr(t,e,a))}};function bm(e,t,a,r,c,d,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,d,x):t.prototype&&t.prototype.isPureReactComponent?!Gr(a,r)||!Gr(c,d):!0}function vm(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&Lc.enqueueReplaceState(t,t.state,null)}function Cl(e,t){var a=t;if("ref"in t){a={};for(var r in t)r!=="ref"&&(a[r]=t[r])}if(e=e.defaultProps){a===t&&(a=y({},a));for(var c in e)a[c]===void 0&&(a[c]=e[c])}return a}function Sm(e){ti(e)}function _m(e){console.error(e)}function jm(e){ti(e)}function Ni(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Nm(e,t,a){try{var r=e.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Uc(e,t,a){return a=Yn(a),a.tag=3,a.payload={element:null},a.callback=function(){Ni(e,t)},a}function wm(e){return e=Yn(e),e.tag=3,e}function Em(e,t,a,r){var c=a.type.getDerivedStateFromError;if(typeof c=="function"){var d=r.value;e.payload=function(){return c(d)},e.callback=function(){Nm(t,a,r)}}var x=a.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){Nm(t,a,r),typeof c!="function"&&(Fn===null?Fn=new Set([this]):Fn.add(this));var S=r.stack;this.componentDidCatch(r.value,{componentStack:S!==null?S:""})})}function sb(e,t,a,r,c){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=a.alternate,t!==null&&nr(t,a,c,!0),a=Ca.current,a!==null){switch(a.tag){case 31:case 13:return Ga===null?Li():a.alternate===null&&Tt===0&&(Tt=3),a.flags&=-257,a.flags|=65536,a.lanes=c,r===di?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([r]):t.add(r),ou(e,r,c)),!1;case 22:return a.flags|=65536,r===di?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([r]):a.add(r)),ou(e,r,c)),!1}throw Error(i(435,a.tag))}return ou(e,r,c),Li(),!1}if(We)return t=Ca.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,r!==ac&&(e=Error(i(422),{cause:r}),Xr(Ba(e,a)))):(r!==ac&&(t=Error(i(423),{cause:r}),Xr(Ba(t,a))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,r=Ba(r,a),c=Uc(e.stateNode,r,c),mc(e,c),Tt!==4&&(Tt=2)),!1;var d=Error(i(520),{cause:r});if(d=Ba(d,a),ds===null?ds=[d]:ds.push(d),Tt!==4&&(Tt=2),t===null)return!0;r=Ba(r,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=c&-c,a.lanes|=e,e=Uc(a.stateNode,r,e),mc(a,e),!1;case 1:if(t=a.type,d=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(Fn===null||!Fn.has(d))))return a.flags|=65536,c&=-c,a.lanes|=c,c=wm(c),Em(c,e,a,r),mc(a,c),!1}a=a.return}while(a!==null);return!1}var Hc=Error(i(461)),Ht=!1;function Ft(e,t,a,r){t.child=e===null?zf(t,null,a,r):wl(t,e.child,a,r)}function Cm(e,t,a,r,c){a=a.render;var d=t.ref;if("ref"in r){var x={};for(var S in r)S!=="ref"&&(x[S]=r[S])}else x=r;return Sl(t),r=bc(e,t,a,x,d,c),S=vc(),e!==null&&!Ht?(Sc(e,t,c),_n(e,t,c)):(We&&S&&ec(t),t.flags|=1,Ft(e,t,r,c),t.child)}function Rm(e,t,a,r,c){if(e===null){var d=a.type;return typeof d=="function"&&!Po(d)&&d.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=d,Tm(e,t,d,r,c)):(e=ri(a.type,null,r,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!Xc(e,c)){var x=d.memoizedProps;if(a=a.compare,a=a!==null?a:Gr,a(x,r)&&e.ref===t.ref)return _n(e,t,c)}return t.flags|=1,e=gn(d,r),e.ref=t.ref,e.return=t,t.child=e}function Tm(e,t,a,r,c){if(e!==null){var d=e.memoizedProps;if(Gr(d,r)&&e.ref===t.ref)if(Ht=!1,t.pendingProps=r=d,Xc(e,c))(e.flags&131072)!==0&&(Ht=!0);else return t.lanes=e.lanes,_n(e,t,c)}return Bc(e,t,a,r,c)}function zm(e,t,a,r){var c=r.children,d=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(d=d!==null?d.baseLanes|a:a,e!==null){for(r=t.child=e.child,c=0;r!==null;)c=c|r.lanes|r.childLanes,r=r.sibling;r=c&~d}else r=0,t.child=null;return Om(e,t,d,a,r)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ci(t,d!==null?d.cachePool:null),d!==null?Mf(t,d):pc(),kf(t);else return r=t.lanes=536870912,Om(e,t,d!==null?d.baseLanes|a:a,a,r)}else d!==null?(ci(t,d.cachePool),Mf(t,d),Kn(),t.memoizedState=null):(e!==null&&ci(t,null),pc(),Kn());return Ft(e,t,c,a),t.child}function ls(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Om(e,t,a,r,c){var d=cc();return d=d===null?null:{parent:Lt._currentValue,pool:d},t.memoizedState={baseLanes:a,cachePool:d},e!==null&&ci(t,null),pc(),kf(t),e!==null&&nr(e,t,r,!0),t.childLanes=c,null}function wi(e,t){return t=Ci({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Dm(e,t,a){return wl(t,e.child,null,a),e=wi(t,t.pendingProps),e.flags|=2,Ra(t),t.memoizedState=null,e}function ib(e,t,a){var r=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(We){if(r.mode==="hidden")return e=wi(t,r),t.lanes=536870912,ls(null,e);if(xc(t),(e=yt)?(e=Vh(e,Ya),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Un!==null?{id:sn,overflow:on}:null,retryLane:536870912,hydrationErrors:null},a=pf(e),a.return=t,t.child=a,Qt=t,yt=null)):e=null,e===null)throw Bn(t);return t.lanes=536870912,null}return wi(t,r)}var d=e.memoizedState;if(d!==null){var x=d.dehydrated;if(xc(t),c)if(t.flags&256)t.flags&=-257,t=Dm(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Ht||nr(e,t,a,!1),c=(a&e.childLanes)!==0,Ht||c){if(r=mt,r!==null&&(x=C(r,a),x!==0&&x!==d.retryLane))throw d.retryLane=x,xl(e,x),ya(r,e,x),Hc;Li(),t=Dm(e,t,a)}else e=d.treeContext,yt=Va(x.nextSibling),Qt=t,We=!0,Hn=null,Ya=!1,e!==null&&yf(t,e),t=wi(t,r),t.flags|=4096;return t}return e=gn(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ei(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(i(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Bc(e,t,a,r,c){return Sl(t),a=bc(e,t,a,r,void 0,c),r=vc(),e!==null&&!Ht?(Sc(e,t,c),_n(e,t,c)):(We&&r&&ec(t),t.flags|=1,Ft(e,t,a,c),t.child)}function Mm(e,t,a,r,c,d){return Sl(t),t.updateQueue=null,a=Lf(t,r,a,c),Af(e),r=vc(),e!==null&&!Ht?(Sc(e,t,d),_n(e,t,d)):(We&&r&&ec(t),t.flags|=1,Ft(e,t,a,d),t.child)}function km(e,t,a,r,c){if(Sl(t),t.stateNode===null){var d=Wl,x=a.contextType;typeof x=="object"&&x!==null&&(d=Zt(x)),d=new a(r,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Lc,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=r,d.state=t.memoizedState,d.refs={},dc(t),x=a.contextType,d.context=typeof x=="object"&&x!==null?Zt(x):Wl,d.state=t.memoizedState,x=a.getDerivedStateFromProps,typeof x=="function"&&(Ac(t,a,x,r),d.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(x=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),x!==d.state&&Lc.enqueueReplaceState(d,d.state,null),Wr(t,r,d,c),Ir(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){d=t.stateNode;var S=t.memoizedProps,R=Cl(a,S);d.props=R;var L=d.context,X=a.contextType;x=Wl,typeof X=="object"&&X!==null&&(x=Zt(X));var I=a.getDerivedStateFromProps;X=typeof I=="function"||typeof d.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,X||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(S||L!==x)&&vm(t,d,r,x),qn=!1;var H=t.memoizedState;d.state=H,Wr(t,r,d,c),Ir(),L=t.memoizedState,S||H!==L||qn?(typeof I=="function"&&(Ac(t,a,I,r),L=t.memoizedState),(R=qn||bm(t,a,R,r,H,L,x))?(X||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=L),d.props=r,d.state=L,d.context=x,r=R):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{d=t.stateNode,fc(e,t),x=t.memoizedProps,X=Cl(a,x),d.props=X,I=t.pendingProps,H=d.context,L=a.contextType,R=Wl,typeof L=="object"&&L!==null&&(R=Zt(L)),S=a.getDerivedStateFromProps,(L=typeof S=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(x!==I||H!==R)&&vm(t,d,r,R),qn=!1,H=t.memoizedState,d.state=H,Wr(t,r,d,c),Ir();var q=t.memoizedState;x!==I||H!==q||qn||e!==null&&e.dependencies!==null&&ii(e.dependencies)?(typeof S=="function"&&(Ac(t,a,S,r),q=t.memoizedState),(X=qn||bm(t,a,X,r,H,q,R)||e!==null&&e.dependencies!==null&&ii(e.dependencies))?(L||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(r,q,R),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(r,q,R)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||x===e.memoizedProps&&H===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&H===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=q),d.props=r,d.state=q,d.context=R,r=X):(typeof d.componentDidUpdate!="function"||x===e.memoizedProps&&H===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&H===e.memoizedState||(t.flags|=1024),r=!1)}return d=r,Ei(e,t),r=(t.flags&128)!==0,d||r?(d=t.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&r?(t.child=wl(t,e.child,null,c),t.child=wl(t,null,a,c)):Ft(e,t,a,c),t.memoizedState=d.state,e=t.child):e=_n(e,t,c),e}function Am(e,t,a,r){return bl(),t.flags|=256,Ft(e,t,a,r),t.child}var $c={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qc(e){return{baseLanes:e,cachePool:Nf()}}function Yc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=za),e}function Lm(e,t,a){var r=t.pendingProps,c=!1,d=(t.flags&128)!==0,x;if((x=d)||(x=e!==null&&e.memoizedState===null?!1:(Dt.current&2)!==0),x&&(c=!0,t.flags&=-129),x=(t.flags&32)!==0,t.flags&=-33,e===null){if(We){if(c?Vn(t):Kn(),(e=yt)?(e=Vh(e,Ya),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Un!==null?{id:sn,overflow:on}:null,retryLane:536870912,hydrationErrors:null},a=pf(e),a.return=t,t.child=a,Qt=t,yt=null)):e=null,e===null)throw Bn(t);return Nu(e)?t.lanes=32:t.lanes=536870912,null}var S=r.children;return r=r.fallback,c?(Kn(),c=t.mode,S=Ci({mode:"hidden",children:S},c),r=yl(r,c,a,null),S.return=t,r.return=t,S.sibling=r,t.child=S,r=t.child,r.memoizedState=qc(a),r.childLanes=Yc(e,x,a),t.memoizedState=$c,ls(null,r)):(Vn(t),Gc(t,S))}var R=e.memoizedState;if(R!==null&&(S=R.dehydrated,S!==null)){if(d)t.flags&256?(Vn(t),t.flags&=-257,t=Vc(e,t,a)):t.memoizedState!==null?(Kn(),t.child=e.child,t.flags|=128,t=null):(Kn(),S=r.fallback,c=t.mode,r=Ci({mode:"visible",children:r.children},c),S=yl(S,c,a,null),S.flags|=2,r.return=t,S.return=t,r.sibling=S,t.child=r,wl(t,e.child,null,a),r=t.child,r.memoizedState=qc(a),r.childLanes=Yc(e,x,a),t.memoizedState=$c,t=ls(null,r));else if(Vn(t),Nu(S)){if(x=S.nextSibling&&S.nextSibling.dataset,x)var L=x.dgst;x=L,r=Error(i(419)),r.stack="",r.digest=x,Xr({value:r,source:null,stack:null}),t=Vc(e,t,a)}else if(Ht||nr(e,t,a,!1),x=(a&e.childLanes)!==0,Ht||x){if(x=mt,x!==null&&(r=C(x,a),r!==0&&r!==R.retryLane))throw R.retryLane=r,xl(e,r),ya(x,e,r),Hc;ju(S)||Li(),t=Vc(e,t,a)}else ju(S)?(t.flags|=192,t.child=e.child,t=null):(e=R.treeContext,yt=Va(S.nextSibling),Qt=t,We=!0,Hn=null,Ya=!1,e!==null&&yf(t,e),t=Gc(t,r.children),t.flags|=4096);return t}return c?(Kn(),S=r.fallback,c=t.mode,R=e.child,L=R.sibling,r=gn(R,{mode:"hidden",children:r.children}),r.subtreeFlags=R.subtreeFlags&65011712,L!==null?S=gn(L,S):(S=yl(S,c,a,null),S.flags|=2),S.return=t,r.return=t,r.sibling=S,t.child=r,ls(null,r),r=t.child,S=e.child.memoizedState,S===null?S=qc(a):(c=S.cachePool,c!==null?(R=Lt._currentValue,c=c.parent!==R?{parent:R,pool:R}:c):c=Nf(),S={baseLanes:S.baseLanes|a,cachePool:c}),r.memoizedState=S,r.childLanes=Yc(e,x,a),t.memoizedState=$c,ls(e.child,r)):(Vn(t),a=e.child,e=a.sibling,a=gn(a,{mode:"visible",children:r.children}),a.return=t,a.sibling=null,e!==null&&(x=t.deletions,x===null?(t.deletions=[e],t.flags|=16):x.push(e)),t.child=a,t.memoizedState=null,a)}function Gc(e,t){return t=Ci({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ci(e,t){return e=Ea(22,e,null,t),e.lanes=0,e}function Vc(e,t,a){return wl(t,e.child,null,a),e=Gc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Um(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),rc(e.return,t,a)}function Kc(e,t,a,r,c,d){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:c,treeForkCount:d}:(x.isBackwards=t,x.rendering=null,x.renderingStartTime=0,x.last=r,x.tail=a,x.tailMode=c,x.treeForkCount=d)}function Hm(e,t,a){var r=t.pendingProps,c=r.revealOrder,d=r.tail;r=r.children;var x=Dt.current,S=(x&2)!==0;if(S?(x=x&1|2,t.flags|=128):x&=1,ee(Dt,x),Ft(e,t,r,a),r=We?Kr:0,!S&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Um(e,a,t);else if(e.tag===19)Um(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(a=t.child,c=null;a!==null;)e=a.alternate,e!==null&&pi(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),Kc(t,!1,c,a,d,r);break;case"backwards":case"unstable_legacy-backwards":for(a=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&pi(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}Kc(t,!0,a,null,d,r);break;case"together":Kc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function _n(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Zn|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(nr(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,a=gn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=gn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Xc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ii(e)))}function ob(e,t,a){switch(t.tag){case 3:Pe(t,t.stateNode.containerInfo),$n(t,Lt,e.memoizedState.cache),bl();break;case 27:case 5:It(t);break;case 4:Pe(t,t.stateNode.containerInfo);break;case 10:$n(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,xc(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(Vn(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Lm(e,t,a):(Vn(t),e=_n(e,t,a),e!==null?e.sibling:null);Vn(t);break;case 19:var c=(e.flags&128)!==0;if(r=(a&t.childLanes)!==0,r||(nr(e,t,a,!1),r=(a&t.childLanes)!==0),c){if(r)return Hm(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),ee(Dt,Dt.current),r)break;return null;case 22:return t.lanes=0,zm(e,t,a,t.pendingProps);case 24:$n(t,Lt,e.memoizedState.cache)}return _n(e,t,a)}function Bm(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ht=!0;else{if(!Xc(e,a)&&(t.flags&128)===0)return Ht=!1,ob(e,t,a);Ht=(e.flags&131072)!==0}else Ht=!1,We&&(t.flags&1048576)!==0&&xf(t,Kr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=jl(t.elementType),t.type=e,typeof e=="function")Po(e)?(r=Cl(e,r),t.tag=1,t=km(null,t,e,r,a)):(t.tag=0,t=Bc(null,t,e,r,a));else{if(e!=null){var c=e.$$typeof;if(c===V){t.tag=11,t=Cm(null,t,e,r,a);break e}else if(c===W){t.tag=14,t=Rm(null,t,e,r,a);break e}}throw t=de(e)||e,Error(i(306,t,""))}}return t;case 0:return Bc(e,t,t.type,t.pendingProps,a);case 1:return r=t.type,c=Cl(r,t.pendingProps),km(e,t,r,c,a);case 3:e:{if(Pe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var d=t.memoizedState;c=d.element,fc(e,t),Wr(t,r,null,a);var x=t.memoizedState;if(r=x.cache,$n(t,Lt,r),r!==d.cache&&sc(t,[Lt],a,!0),Ir(),r=x.element,d.isDehydrated)if(d={element:r,isDehydrated:!1,cache:x.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=Am(e,t,r,a);break e}else if(r!==c){c=Ba(Error(i(424)),t),Xr(c),t=Am(e,t,r,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,yt=Va(e.firstChild),Qt=t,We=!0,Hn=null,Ya=!0,a=zf(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(bl(),r===c){t=_n(e,t,a);break e}Ft(e,t,r,a)}t=t.child}return t;case 26:return Ei(e,t),e===null?(a=Jh(t.type,null,t.pendingProps,null))?t.memoizedState=a:We||(a=t.type,e=t.pendingProps,r=Gi(Ne.current).createElement(a),r[ue]=t,r[me]=e,Jt(r,a,e),pt(r),t.stateNode=r):t.memoizedState=Jh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return It(t),e===null&&We&&(r=t.stateNode=Qh(t.type,t.pendingProps,Ne.current),Qt=t,Ya=!0,c=yt,Wn(t.type)?(wu=c,yt=Va(r.firstChild)):yt=c),Ft(e,t,t.pendingProps.children,a),Ei(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&We&&((c=r=yt)&&(r=Hb(r,t.type,t.pendingProps,Ya),r!==null?(t.stateNode=r,Qt=t,yt=Va(r.firstChild),Ya=!1,c=!0):c=!1),c||Bn(t)),It(t),c=t.type,d=t.pendingProps,x=e!==null?e.memoizedProps:null,r=d.children,vu(c,d)?r=null:x!==null&&vu(c,x)&&(t.flags|=32),t.memoizedState!==null&&(c=bc(e,t,Wy,null,null,a),bs._currentValue=c),Ei(e,t),Ft(e,t,r,a),t.child;case 6:return e===null&&We&&((e=a=yt)&&(a=Bb(a,t.pendingProps,Ya),a!==null?(t.stateNode=a,Qt=t,yt=null,e=!0):e=!1),e||Bn(t)),null;case 13:return Lm(e,t,a);case 4:return Pe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=wl(t,null,r,a):Ft(e,t,r,a),t.child;case 11:return Cm(e,t,t.type,t.pendingProps,a);case 7:return Ft(e,t,t.pendingProps,a),t.child;case 8:return Ft(e,t,t.pendingProps.children,a),t.child;case 12:return Ft(e,t,t.pendingProps.children,a),t.child;case 10:return r=t.pendingProps,$n(t,t.type,r.value),Ft(e,t,r.children,a),t.child;case 9:return c=t.type._context,r=t.pendingProps.children,Sl(t),c=Zt(c),r=r(c),t.flags|=1,Ft(e,t,r,a),t.child;case 14:return Rm(e,t,t.type,t.pendingProps,a);case 15:return Tm(e,t,t.type,t.pendingProps,a);case 19:return Hm(e,t,a);case 31:return ib(e,t,a);case 22:return zm(e,t,a,t.pendingProps);case 24:return Sl(t),r=Zt(Lt),e===null?(c=cc(),c===null&&(c=mt,d=ic(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=a),c=d),t.memoizedState={parent:r,cache:c},dc(t),$n(t,Lt,c)):((e.lanes&a)!==0&&(fc(e,t),Wr(t,null,null,a),Ir()),c=e.memoizedState,d=t.memoizedState,c.parent!==r?(c={parent:r,cache:r},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),$n(t,Lt,r)):(r=d.cache,$n(t,Lt,r),r!==c.cache&&sc(t,[Lt],a,!0))),Ft(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function jn(e){e.flags|=4}function Qc(e,t,a,r,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(fh())e.flags|=8192;else throw Nl=di,uc}else e.flags&=-16777217}function $m(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!tp(t))if(fh())e.flags|=8192;else throw Nl=di,uc}function Ri(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?oa():536870912,e.lanes|=t,pr|=t)}function rs(e,t){if(!We)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function bt(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var c=e.child;c!==null;)a|=c.lanes|c.childLanes,r|=c.subtreeFlags&65011712,r|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)a|=c.lanes|c.childLanes,r|=c.subtreeFlags,r|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function cb(e,t,a){var r=t.pendingProps;switch(tc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bt(t),null;case 1:return bt(t),null;case 3:return a=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),bn(Lt),Qe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(ar(t)?jn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,nc())),bt(t),null;case 26:var c=t.type,d=t.memoizedState;return e===null?(jn(t),d!==null?(bt(t),$m(t,d)):(bt(t),Qc(t,c,null,r,a))):d?d!==e.memoizedState?(jn(t),bt(t),$m(t,d)):(bt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&jn(t),bt(t),Qc(t,c,e,r,a)),null;case 27:if(fa(t),a=Ne.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jn(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return bt(t),null}e=le.current,ar(t)?bf(t):(e=Qh(c,r,a),t.stateNode=e,jn(t))}return bt(t),null;case 5:if(fa(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jn(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return bt(t),null}if(d=le.current,ar(t))bf(t);else{var x=Gi(Ne.current);switch(d){case 1:d=x.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:d=x.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":d=x.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":d=x.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":d=x.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof r.is=="string"?x.createElement("select",{is:r.is}):x.createElement("select"),r.multiple?d.multiple=!0:r.size&&(d.size=r.size);break;default:d=typeof r.is=="string"?x.createElement(c,{is:r.is}):x.createElement(c)}}d[ue]=t,d[me]=r;e:for(x=t.child;x!==null;){if(x.tag===5||x.tag===6)d.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===t)break e;for(;x.sibling===null;){if(x.return===null||x.return===t)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}t.stateNode=d;e:switch(Jt(d,c,r),c){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&jn(t)}}return bt(t),Qc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&jn(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(i(166));if(e=Ne.current,ar(t)){if(e=t.stateNode,a=t.memoizedProps,r=null,c=Qt,c!==null)switch(c.tag){case 27:case 5:r=c.memoizedProps}e[ue]=t,e=!!(e.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||Lh(e.nodeValue,a)),e||Bn(t,!0)}else e=Gi(e).createTextNode(r),e[ue]=t,t.stateNode=e}return bt(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(r=ar(t),a!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[ue]=t}else bl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;bt(t),e=!1}else a=nc(),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 bt(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=ar(t),r!==null&&r.dehydrated!==null){if(e===null){if(!c)throw Error(i(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[ue]=t}else bl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;bt(t),c=!1}else c=nc(),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=r!==null,e=e!==null&&e.memoizedState!==null,a&&(r=t.child,c=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(c=r.alternate.memoizedState.cachePool.pool),d=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(d=r.memoizedState.cachePool.pool),d!==c&&(r.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Ri(t,t.updateQueue),bt(t),null);case 4:return Qe(),e===null&&pu(t.stateNode.containerInfo),bt(t),null;case 10:return bn(t.type),bt(t),null;case 19:if(U(Dt),r=t.memoizedState,r===null)return bt(t),null;if(c=(t.flags&128)!==0,d=r.rendering,d===null)if(c)rs(r,!1);else{if(Tt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=pi(e),d!==null){for(t.flags|=128,rs(r,!1),e=d.updateQueue,t.updateQueue=e,Ri(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)hf(a,e),a=a.sibling;return ee(Dt,Dt.current&1|2),We&&xn(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&ht()>Mi&&(t.flags|=128,c=!0,rs(r,!1),t.lanes=4194304)}else{if(!c)if(e=pi(d),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,Ri(t,e),rs(r,!0),r.tail===null&&r.tailMode==="hidden"&&!d.alternate&&!We)return bt(t),null}else 2*ht()-r.renderingStartTime>Mi&&a!==536870912&&(t.flags|=128,c=!0,rs(r,!1),t.lanes=4194304);r.isBackwards?(d.sibling=t.child,t.child=d):(e=r.last,e!==null?e.sibling=d:t.child=d,r.last=d)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ht(),e.sibling=null,a=Dt.current,ee(Dt,c?a&1|2:a&1),We&&xn(t,r.treeForkCount),e):(bt(t),null);case 22:case 23:return Ra(t),gc(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(a&536870912)!==0&&(t.flags&128)===0&&(bt(t),t.subtreeFlags&6&&(t.flags|=8192)):bt(t),a=t.updateQueue,a!==null&&Ri(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==a&&(t.flags|=2048),e!==null&&U(_l),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),bn(Lt),bt(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function ub(e,t){switch(tc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return bn(Lt),Qe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return fa(t),null;case 31:if(t.memoizedState!==null){if(Ra(t),t.alternate===null)throw Error(i(340));bl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ra(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));bl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(Dt),null;case 4:return Qe(),null;case 10:return bn(t.type),null;case 22:case 23:return Ra(t),gc(),e!==null&&U(_l),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return bn(Lt),null;case 25:return null;default:return null}}function qm(e,t){switch(tc(t),t.tag){case 3:bn(Lt),Qe();break;case 26:case 27:case 5:fa(t);break;case 4:Qe();break;case 31:t.memoizedState!==null&&Ra(t);break;case 13:Ra(t);break;case 19:U(Dt);break;case 10:bn(t.type);break;case 22:case 23:Ra(t),gc(),e!==null&&U(_l);break;case 24:bn(Lt)}}function ss(e,t){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var c=r.next;a=c;do{if((a.tag&e)===e){r=void 0;var d=a.create,x=a.inst;r=d(),x.destroy=r}a=a.next}while(a!==c)}}catch(S){it(t,t.return,S)}}function Xn(e,t,a){try{var r=t.updateQueue,c=r!==null?r.lastEffect:null;if(c!==null){var d=c.next;r=d;do{if((r.tag&e)===e){var x=r.inst,S=x.destroy;if(S!==void 0){x.destroy=void 0,c=t;var R=a,L=S;try{L()}catch(X){it(c,R,X)}}}r=r.next}while(r!==d)}}catch(X){it(t,t.return,X)}}function Ym(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Df(t,a)}catch(r){it(e,e.return,r)}}}function Gm(e,t,a){a.props=Cl(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(r){it(e,t,r)}}function is(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof a=="function"?e.refCleanup=a(r):a.current=r}}catch(c){it(e,t,c)}}function cn(e,t){var a=e.ref,r=e.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(c){it(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(c){it(e,t,c)}else a.current=null}function Vm(e){var t=e.type,a=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(c){it(e,e.return,c)}}function Zc(e,t,a){try{var r=e.stateNode;Db(r,e.type,a,t),r[me]=t}catch(c){it(e,e.return,c)}}function Km(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Wn(e.type)||e.tag===4}function Fc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Km(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Wn(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Jc(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=hn));else if(r!==4&&(r===27&&Wn(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Jc(e,t,a),e=e.sibling;e!==null;)Jc(e,t,a),e=e.sibling}function Ti(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(r!==4&&(r===27&&Wn(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Ti(e,t,a),e=e.sibling;e!==null;)Ti(e,t,a),e=e.sibling}function Xm(e){var t=e.stateNode,a=e.memoizedProps;try{for(var r=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Jt(t,r,a),t[ue]=e,t[me]=a}catch(d){it(e,e.return,d)}}var Nn=!1,Bt=!1,Pc=!1,Qm=typeof WeakSet=="function"?WeakSet:Set,Kt=null;function db(e,t){if(e=e.containerInfo,yu=Ji,e=lf(e),Vo(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var c=r.anchorOffset,d=r.focusNode;r=r.focusOffset;try{a.nodeType,d.nodeType}catch{a=null;break e}var x=0,S=-1,R=-1,L=0,X=0,I=e,H=null;t:for(;;){for(var q;I!==a||c!==0&&I.nodeType!==3||(S=x+c),I!==d||r!==0&&I.nodeType!==3||(R=x+r),I.nodeType===3&&(x+=I.nodeValue.length),(q=I.firstChild)!==null;)H=I,I=q;for(;;){if(I===e)break t;if(H===a&&++L===c&&(S=x),H===d&&++X===r&&(R=x),(q=I.nextSibling)!==null)break;I=H,H=I.parentNode}I=q}a=S===-1||R===-1?null:{start:S,end:R}}else a=null}a=a||{start:0,end:0}}else a=null;for(bu={focusedElem:e,selectionRange:a},Ji=!1,Kt=t;Kt!==null;)if(t=Kt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Kt=e;else for(;Kt!==null;){switch(t=Kt,d=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)c=e[a],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,a=t,c=d.memoizedProps,d=d.memoizedState,r=a.stateNode;try{var ye=Cl(a.type,c);e=r.getSnapshotBeforeUpdate(ye,d),r.__reactInternalSnapshotBeforeUpdate=e}catch(Te){it(a,a.return,Te)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)_u(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":_u(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,Kt=e;break}Kt=t.return}}function Zm(e,t,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:En(e,a),r&4&&ss(5,a);break;case 1:if(En(e,a),r&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(x){it(a,a.return,x)}else{var c=Cl(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(x){it(a,a.return,x)}}r&64&&Ym(a),r&512&&is(a,a.return);break;case 3:if(En(e,a),r&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{Df(e,t)}catch(x){it(a,a.return,x)}}break;case 27:t===null&&r&4&&Xm(a);case 26:case 5:En(e,a),t===null&&r&4&&Vm(a),r&512&&is(a,a.return);break;case 12:En(e,a);break;case 31:En(e,a),r&4&&Pm(e,a);break;case 13:En(e,a),r&4&&Im(e,a),r&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=vb.bind(null,a),$b(e,a))));break;case 22:if(r=a.memoizedState!==null||Nn,!r){t=t!==null&&t.memoizedState!==null||Bt,c=Nn;var d=Bt;Nn=r,(Bt=t)&&!d?Cn(e,a,(a.subtreeFlags&8772)!==0):En(e,a),Nn=c,Bt=d}break;case 30:break;default:En(e,a)}}function Fm(e){var t=e.alternate;t!==null&&(e.alternate=null,Fm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ft(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var St=null,ha=!1;function wn(e,t,a){for(a=a.child;a!==null;)Jm(e,t,a),a=a.sibling}function Jm(e,t,a){if(_t&&typeof _t.onCommitFiberUnmount=="function")try{_t.onCommitFiberUnmount(ia,a)}catch{}switch(a.tag){case 26:Bt||cn(a,t),wn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Bt||cn(a,t);var r=St,c=ha;Wn(a.type)&&(St=a.stateNode,ha=!1),wn(e,t,a),gs(a.stateNode),St=r,ha=c;break;case 5:Bt||cn(a,t);case 6:if(r=St,c=ha,St=null,wn(e,t,a),St=r,ha=c,St!==null)if(ha)try{(St.nodeType===9?St.body:St.nodeName==="HTML"?St.ownerDocument.body:St).removeChild(a.stateNode)}catch(d){it(a,t,d)}else try{St.removeChild(a.stateNode)}catch(d){it(a,t,d)}break;case 18:St!==null&&(ha?(e=St,Yh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),jr(e)):Yh(St,a.stateNode));break;case 4:r=St,c=ha,St=a.stateNode.containerInfo,ha=!0,wn(e,t,a),St=r,ha=c;break;case 0:case 11:case 14:case 15:Xn(2,a,t),Bt||Xn(4,a,t),wn(e,t,a);break;case 1:Bt||(cn(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"&&Gm(a,t,r)),wn(e,t,a);break;case 21:wn(e,t,a);break;case 22:Bt=(r=Bt)||a.memoizedState!==null,wn(e,t,a),Bt=r;break;default:wn(e,t,a)}}function Pm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{jr(e)}catch(a){it(t,t.return,a)}}}function Im(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{jr(e)}catch(a){it(t,t.return,a)}}function fb(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Qm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Qm),t;default:throw Error(i(435,e.tag))}}function zi(e,t){var a=fb(e);t.forEach(function(r){if(!a.has(r)){a.add(r);var c=Sb.bind(null,e,r);r.then(c,c)}})}function pa(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var c=a[r],d=e,x=t,S=x;e:for(;S!==null;){switch(S.tag){case 27:if(Wn(S.type)){St=S.stateNode,ha=!1;break e}break;case 5:St=S.stateNode,ha=!1;break e;case 3:case 4:St=S.stateNode.containerInfo,ha=!0;break e}S=S.return}if(St===null)throw Error(i(160));Jm(d,x,c),St=null,ha=!1,d=c.alternate,d!==null&&(d.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Wm(t,e),t=t.sibling}var Wa=null;function Wm(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:pa(t,e),ga(e),r&4&&(Xn(3,e,e.return),ss(3,e),Xn(5,e,e.return));break;case 1:pa(t,e),ga(e),r&512&&(Bt||a===null||cn(a,a.return)),r&64&&Nn&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?r:a.concat(r))));break;case 26:var c=Wa;if(pa(t,e),ga(e),r&512&&(Bt||a===null||cn(a,a.return)),r&4){var d=a!==null?a.memoizedState:null;if(r=e.memoizedState,a===null)if(r===null)if(e.stateNode===null){e:{r=e.type,a=e.memoizedProps,c=c.ownerDocument||c;t:switch(r){case"title":d=c.getElementsByTagName("title")[0],(!d||d[Ye]||d[ue]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=c.createElement(r),c.head.insertBefore(d,c.querySelector("head > title"))),Jt(d,r,a),d[ue]=e,pt(d),r=d;break e;case"link":var x=Wh("link","href",c).get(r+(a.href||""));if(x){for(var S=0;S<x.length;S++)if(d=x[S],d.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&d.getAttribute("rel")===(a.rel==null?null:a.rel)&&d.getAttribute("title")===(a.title==null?null:a.title)&&d.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){x.splice(S,1);break t}}d=c.createElement(r),Jt(d,r,a),c.head.appendChild(d);break;case"meta":if(x=Wh("meta","content",c).get(r+(a.content||""))){for(S=0;S<x.length;S++)if(d=x[S],d.getAttribute("content")===(a.content==null?null:""+a.content)&&d.getAttribute("name")===(a.name==null?null:a.name)&&d.getAttribute("property")===(a.property==null?null:a.property)&&d.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&d.getAttribute("charset")===(a.charSet==null?null:a.charSet)){x.splice(S,1);break t}}d=c.createElement(r),Jt(d,r,a),c.head.appendChild(d);break;default:throw Error(i(468,r))}d[ue]=e,pt(d),r=d}e.stateNode=r}else ep(c,e.type,e.stateNode);else e.stateNode=Ih(c,r,e.memoizedProps);else d!==r?(d===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):d.count--,r===null?ep(c,e.type,e.stateNode):Ih(c,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Zc(e,e.memoizedProps,a.memoizedProps)}break;case 27:pa(t,e),ga(e),r&512&&(Bt||a===null||cn(a,a.return)),a!==null&&r&4&&Zc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(pa(t,e),ga(e),r&512&&(Bt||a===null||cn(a,a.return)),e.flags&32){c=e.stateNode;try{Xl(c,"")}catch(ye){it(e,e.return,ye)}}r&4&&e.stateNode!=null&&(c=e.memoizedProps,Zc(e,c,a!==null?a.memoizedProps:c)),r&1024&&(Pc=!0);break;case 6:if(pa(t,e),ga(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,a=e.stateNode;try{a.nodeValue=r}catch(ye){it(e,e.return,ye)}}break;case 3:if(Xi=null,c=Wa,Wa=Vi(t.containerInfo),pa(t,e),Wa=c,ga(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{jr(t.containerInfo)}catch(ye){it(e,e.return,ye)}Pc&&(Pc=!1,eh(e));break;case 4:r=Wa,Wa=Vi(e.stateNode.containerInfo),pa(t,e),ga(e),Wa=r;break;case 12:pa(t,e),ga(e);break;case 31:pa(t,e),ga(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,zi(e,r)));break;case 13:pa(t,e),ga(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Di=ht()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,zi(e,r)));break;case 22:c=e.memoizedState!==null;var R=a!==null&&a.memoizedState!==null,L=Nn,X=Bt;if(Nn=L||c,Bt=X||R,pa(t,e),Bt=X,Nn=L,ga(e),r&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(a===null||R||Nn||Bt||Rl(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){R=a=t;try{if(d=R.stateNode,c)x=d.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{S=R.stateNode;var I=R.memoizedProps.style,H=I!=null&&I.hasOwnProperty("display")?I.display:null;S.style.display=H==null||typeof H=="boolean"?"":(""+H).trim()}}catch(ye){it(R,R.return,ye)}}}else if(t.tag===6){if(a===null){R=t;try{R.stateNode.nodeValue=c?"":R.memoizedProps}catch(ye){it(R,R.return,ye)}}}else if(t.tag===18){if(a===null){R=t;try{var q=R.stateNode;c?Gh(q,!0):Gh(R.stateNode,!1)}catch(ye){it(R,R.return,ye)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,zi(e,a))));break;case 19:pa(t,e),ga(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,zi(e,r)));break;case 30:break;case 21:break;default:pa(t,e),ga(e)}}function ga(e){var t=e.flags;if(t&2){try{for(var a,r=e.return;r!==null;){if(Km(r)){a=r;break}r=r.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var c=a.stateNode,d=Fc(e);Ti(e,d,c);break;case 5:var x=a.stateNode;a.flags&32&&(Xl(x,""),a.flags&=-33);var S=Fc(e);Ti(e,S,x);break;case 3:case 4:var R=a.stateNode.containerInfo,L=Fc(e);Jc(e,L,R);break;default:throw Error(i(161))}}catch(X){it(e,e.return,X)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function eh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;eh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function En(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Zm(e,t.alternate,t),t=t.sibling}function Rl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Xn(4,t,t.return),Rl(t);break;case 1:cn(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Gm(t,t.return,a),Rl(t);break;case 27:gs(t.stateNode);case 26:case 5:cn(t,t.return),Rl(t);break;case 22:t.memoizedState===null&&Rl(t);break;case 30:Rl(t);break;default:Rl(t)}e=e.sibling}}function Cn(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,c=e,d=t,x=d.flags;switch(d.tag){case 0:case 11:case 15:Cn(c,d,a),ss(4,d);break;case 1:if(Cn(c,d,a),r=d,c=r.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(L){it(r,r.return,L)}if(r=d,c=r.updateQueue,c!==null){var S=r.stateNode;try{var R=c.shared.hiddenCallbacks;if(R!==null)for(c.shared.hiddenCallbacks=null,c=0;c<R.length;c++)Of(R[c],S)}catch(L){it(r,r.return,L)}}a&&x&64&&Ym(d),is(d,d.return);break;case 27:Xm(d);case 26:case 5:Cn(c,d,a),a&&r===null&&x&4&&Vm(d),is(d,d.return);break;case 12:Cn(c,d,a);break;case 31:Cn(c,d,a),a&&x&4&&Pm(c,d);break;case 13:Cn(c,d,a),a&&x&4&&Im(c,d);break;case 22:d.memoizedState===null&&Cn(c,d,a),is(d,d.return);break;case 30:break;default:Cn(c,d,a)}t=t.sibling}}function Ic(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Qr(a))}function Wc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Qr(e))}function en(e,t,a,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)th(e,t,a,r),t=t.sibling}function th(e,t,a,r){var c=t.flags;switch(t.tag){case 0:case 11:case 15:en(e,t,a,r),c&2048&&ss(9,t);break;case 1:en(e,t,a,r);break;case 3:en(e,t,a,r),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Qr(e)));break;case 12:if(c&2048){en(e,t,a,r),e=t.stateNode;try{var d=t.memoizedProps,x=d.id,S=d.onPostCommit;typeof S=="function"&&S(x,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(R){it(t,t.return,R)}}else en(e,t,a,r);break;case 31:en(e,t,a,r);break;case 13:en(e,t,a,r);break;case 23:break;case 22:d=t.stateNode,x=t.alternate,t.memoizedState!==null?d._visibility&2?en(e,t,a,r):os(e,t):d._visibility&2?en(e,t,a,r):(d._visibility|=2,fr(e,t,a,r,(t.subtreeFlags&10256)!==0||!1)),c&2048&&Ic(x,t);break;case 24:en(e,t,a,r),c&2048&&Wc(t.alternate,t);break;default:en(e,t,a,r)}}function fr(e,t,a,r,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,x=t,S=a,R=r,L=x.flags;switch(x.tag){case 0:case 11:case 15:fr(d,x,S,R,c),ss(8,x);break;case 23:break;case 22:var X=x.stateNode;x.memoizedState!==null?X._visibility&2?fr(d,x,S,R,c):os(d,x):(X._visibility|=2,fr(d,x,S,R,c)),c&&L&2048&&Ic(x.alternate,x);break;case 24:fr(d,x,S,R,c),c&&L&2048&&Wc(x.alternate,x);break;default:fr(d,x,S,R,c)}t=t.sibling}}function os(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,r=t,c=r.flags;switch(r.tag){case 22:os(a,r),c&2048&&Ic(r.alternate,r);break;case 24:os(a,r),c&2048&&Wc(r.alternate,r);break;default:os(a,r)}t=t.sibling}}var cs=8192;function mr(e,t,a){if(e.subtreeFlags&cs)for(e=e.child;e!==null;)ah(e,t,a),e=e.sibling}function ah(e,t,a){switch(e.tag){case 26:mr(e,t,a),e.flags&cs&&e.memoizedState!==null&&Ib(a,Wa,e.memoizedState,e.memoizedProps);break;case 5:mr(e,t,a);break;case 3:case 4:var r=Wa;Wa=Vi(e.stateNode.containerInfo),mr(e,t,a),Wa=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=cs,cs=16777216,mr(e,t,a),cs=r):mr(e,t,a));break;default:mr(e,t,a)}}function nh(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function us(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];Kt=r,rh(r,e)}nh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)lh(e),e=e.sibling}function lh(e){switch(e.tag){case 0:case 11:case 15:us(e),e.flags&2048&&Xn(9,e,e.return);break;case 3:us(e);break;case 12:us(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Oi(e)):us(e);break;default:us(e)}}function Oi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];Kt=r,rh(r,e)}nh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Xn(8,t,t.return),Oi(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Oi(t));break;default:Oi(t)}e=e.sibling}}function rh(e,t){for(;Kt!==null;){var a=Kt;switch(a.tag){case 0:case 11:case 15:Xn(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var r=a.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Qr(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,Kt=r;else e:for(a=e;Kt!==null;){r=Kt;var c=r.sibling,d=r.return;if(Fm(r),r===a){Kt=null;break e}if(c!==null){c.return=d,Kt=c;break e}Kt=d}}}var mb={getCacheForType:function(e){var t=Zt(Lt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Zt(Lt).controller.signal}},hb=typeof WeakMap=="function"?WeakMap:Map,rt=0,mt=null,Ke=null,Fe=0,st=0,Ta=null,Qn=!1,hr=!1,eu=!1,Rn=0,Tt=0,Zn=0,Tl=0,tu=0,za=0,pr=0,ds=null,xa=null,au=!1,Di=0,sh=0,Mi=1/0,ki=null,Fn=null,Yt=0,Jn=null,gr=null,Tn=0,nu=0,lu=null,ih=null,fs=0,ru=null;function Oa(){return(rt&2)!==0&&Fe!==0?Fe&-Fe:k.T!==null?du():ne()}function oh(){if(za===0)if((Fe&536870912)===0||We){var e=ie;ie<<=1,(ie&3932160)===0&&(ie=262144),za=e}else za=536870912;return e=Ca.current,e!==null&&(e.flags|=32),za}function ya(e,t,a){(e===mt&&(st===2||st===9)||e.cancelPendingCommit!==null)&&(xr(e,0),Pn(e,Fe,za,!1)),Na(e,a),((rt&2)===0||e!==mt)&&(e===mt&&((rt&2)===0&&(Tl|=a),Tt===4&&Pn(e,Fe,za,!1)),un(e))}function ch(e,t,a){if((rt&6)!==0)throw Error(i(327));var r=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Et(e,t),c=r?xb(e,t):iu(e,t,!0),d=r;do{if(c===0){hr&&!r&&Pn(e,t,0,!1);break}else{if(a=e.current.alternate,d&&!pb(a)){c=iu(e,t,!1),d=!1;continue}if(c===2){if(d=t,e.errorRecoveryDisabledLanes&d)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){t=x;e:{var S=e;c=ds;var R=S.current.memoizedState.isDehydrated;if(R&&(xr(S,x).flags|=256),x=iu(S,x,!1),x!==2){if(eu&&!R){S.errorRecoveryDisabledLanes|=d,Tl|=d,c=4;break e}d=xa,xa=c,d!==null&&(xa===null?xa=d:xa.push.apply(xa,d))}c=x}if(d=!1,c!==2)continue}}if(c===1){xr(e,0),Pn(e,t,0,!0);break}e:{switch(r=e,d=c,d){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Pn(r,t,za,!Qn);break e;case 2:xa=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=Di+300-ht(),10<c)){if(Pn(r,t,za,!Qn),Le(r,0,!0)!==0)break e;Tn=t,r.timeoutHandle=$h(uh.bind(null,r,a,xa,ki,au,t,za,Tl,pr,Qn,d,"Throttled",-0,0),c);break e}uh(r,a,xa,ki,au,t,za,Tl,pr,Qn,d,null,-0,0)}}break}while(!0);un(e)}function uh(e,t,a,r,c,d,x,S,R,L,X,I,H,q){if(e.timeoutHandle=-1,I=t.subtreeFlags,I&8192||(I&16785408)===16785408){I={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:hn},ah(t,d,I);var ye=(d&62914560)===d?Di-ht():(d&4194048)===d?sh-ht():0;if(ye=Wb(I,ye),ye!==null){Tn=d,e.cancelPendingCommit=ye(yh.bind(null,e,t,d,a,r,c,x,S,R,X,I,null,H,q)),Pn(e,d,x,!L);return}}yh(e,t,d,a,r,c,x,S,R)}function pb(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var r=0;r<a.length;r++){var c=a[r],d=c.getSnapshot;c=c.value;try{if(!wa(d(),c))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Pn(e,t,a,r){t&=~tu,t&=~Tl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var c=t;0<c;){var d=31-kt(c),x=1<<d;r[d]=-1,c&=~x}a!==0&&$l(e,a,t)}function Ai(){return(rt&6)===0?(ms(0),!1):!0}function su(){if(Ke!==null){if(st===0)var e=Ke.return;else e=Ke,yn=vl=null,_c(e),ir=null,Fr=0,e=Ke;for(;e!==null;)qm(e.alternate,e),e=e.return;Ke=null}}function xr(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Ab(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Tn=0,su(),mt=e,Ke=a=gn(e.current,null),Fe=t,st=0,Ta=null,Qn=!1,hr=Et(e,t),eu=!1,pr=za=tu=Tl=Zn=Tt=0,xa=ds=null,au=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var c=31-kt(r),d=1<<c;t|=e[c],r&=~d}return Rn=t,ai(),a}function dh(e,t){Ue=null,k.H=ns,t===sr||t===ui?(t=Cf(),st=3):t===uc?(t=Cf(),st=4):st=t===Hc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ta=t,Ke===null&&(Tt=1,Ni(e,Ba(t,e.current)))}function fh(){var e=Ca.current;return e===null?!0:(Fe&4194048)===Fe?Ga===null:(Fe&62914560)===Fe||(Fe&536870912)!==0?e===Ga:!1}function mh(){var e=k.H;return k.H=ns,e===null?ns:e}function hh(){var e=k.A;return k.A=mb,e}function Li(){Tt=4,Qn||(Fe&4194048)!==Fe&&Ca.current!==null||(hr=!0),(Zn&134217727)===0&&(Tl&134217727)===0||mt===null||Pn(mt,Fe,za,!1)}function iu(e,t,a){var r=rt;rt|=2;var c=mh(),d=hh();(mt!==e||Fe!==t)&&(ki=null,xr(e,t)),t=!1;var x=Tt;e:do try{if(st!==0&&Ke!==null){var S=Ke,R=Ta;switch(st){case 8:su(),x=6;break e;case 3:case 2:case 9:case 6:Ca.current===null&&(t=!0);var L=st;if(st=0,Ta=null,yr(e,S,R,L),a&&hr){x=0;break e}break;default:L=st,st=0,Ta=null,yr(e,S,R,L)}}gb(),x=Tt;break}catch(X){dh(e,X)}while(!0);return t&&e.shellSuspendCounter++,yn=vl=null,rt=r,k.H=c,k.A=d,Ke===null&&(mt=null,Fe=0,ai()),x}function gb(){for(;Ke!==null;)ph(Ke)}function xb(e,t){var a=rt;rt|=2;var r=mh(),c=hh();mt!==e||Fe!==t?(ki=null,Mi=ht()+500,xr(e,t)):hr=Et(e,t);e:do try{if(st!==0&&Ke!==null){t=Ke;var d=Ta;t:switch(st){case 1:st=0,Ta=null,yr(e,t,d,1);break;case 2:case 9:if(wf(d)){st=0,Ta=null,gh(t);break}t=function(){st!==2&&st!==9||mt!==e||(st=7),un(e)},d.then(t,t);break e;case 3:st=7;break e;case 4:st=5;break e;case 7:wf(d)?(st=0,Ta=null,gh(t)):(st=0,Ta=null,yr(e,t,d,7));break;case 5:var x=null;switch(Ke.tag){case 26:x=Ke.memoizedState;case 5:case 27:var S=Ke;if(x?tp(x):S.stateNode.complete){st=0,Ta=null;var R=S.sibling;if(R!==null)Ke=R;else{var L=S.return;L!==null?(Ke=L,Ui(L)):Ke=null}break t}}st=0,Ta=null,yr(e,t,d,5);break;case 6:st=0,Ta=null,yr(e,t,d,6);break;case 8:su(),Tt=6;break e;default:throw Error(i(462))}}yb();break}catch(X){dh(e,X)}while(!0);return yn=vl=null,k.H=r,k.A=c,rt=a,Ke!==null?0:(mt=null,Fe=0,ai(),Tt)}function yb(){for(;Ke!==null&&!la();)ph(Ke)}function ph(e){var t=Bm(e.alternate,e,Rn);e.memoizedProps=e.pendingProps,t===null?Ui(e):Ke=t}function gh(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Mm(a,t,t.pendingProps,t.type,void 0,Fe);break;case 11:t=Mm(a,t,t.pendingProps,t.type.render,t.ref,Fe);break;case 5:_c(t);default:qm(a,t),t=Ke=hf(t,Rn),t=Bm(a,t,Rn)}e.memoizedProps=e.pendingProps,t===null?Ui(e):Ke=t}function yr(e,t,a,r){yn=vl=null,_c(t),ir=null,Fr=0;var c=t.return;try{if(sb(e,c,t,a,Fe)){Tt=1,Ni(e,Ba(a,e.current)),Ke=null;return}}catch(d){if(c!==null)throw Ke=c,d;Tt=1,Ni(e,Ba(a,e.current)),Ke=null;return}t.flags&32768?(We||r===1?e=!0:hr||(Fe&536870912)!==0?e=!1:(Qn=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ca.current,r!==null&&r.tag===13&&(r.flags|=16384))),xh(t,e)):Ui(t)}function Ui(e){var t=e;do{if((t.flags&32768)!==0){xh(t,Qn);return}e=t.return;var a=cb(t.alternate,t,Rn);if(a!==null){Ke=a;return}if(t=t.sibling,t!==null){Ke=t;return}Ke=t=e}while(t!==null);Tt===0&&(Tt=5)}function xh(e,t){do{var a=ub(e.alternate,e);if(a!==null){a.flags&=32767,Ke=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Ke=e;return}Ke=e=a}while(e!==null);Tt=6,Ke=null}function yh(e,t,a,r,c,d,x,S,R){e.cancelPendingCommit=null;do Hi();while(Yt!==0);if((rt&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(d=t.lanes|t.childLanes,d|=Fo,dl(e,a,d,x,S,R),e===mt&&(Ke=mt=null,Fe=0),gr=t,Jn=e,Tn=a,nu=d,lu=c,ih=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,_b(Ve,function(){return jh(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=k.T,k.T=null,c=P.p,P.p=2,x=rt,rt|=4;try{db(e,t,a)}finally{rt=x,P.p=c,k.T=r}}Yt=1,bh(),vh(),Sh()}}function bh(){if(Yt===1){Yt=0;var e=Jn,t=gr,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=k.T,k.T=null;var r=P.p;P.p=2;var c=rt;rt|=4;try{Wm(t,e);var d=bu,x=lf(e.containerInfo),S=d.focusedElem,R=d.selectionRange;if(x!==S&&S&&S.ownerDocument&&nf(S.ownerDocument.documentElement,S)){if(R!==null&&Vo(S)){var L=R.start,X=R.end;if(X===void 0&&(X=L),"selectionStart"in S)S.selectionStart=L,S.selectionEnd=Math.min(X,S.value.length);else{var I=S.ownerDocument||document,H=I&&I.defaultView||window;if(H.getSelection){var q=H.getSelection(),ye=S.textContent.length,Te=Math.min(R.start,ye),ut=R.end===void 0?Te:Math.min(R.end,ye);!q.extend&&Te>ut&&(x=ut,ut=Te,Te=x);var M=af(S,Te),z=af(S,ut);if(M&&z&&(q.rangeCount!==1||q.anchorNode!==M.node||q.anchorOffset!==M.offset||q.focusNode!==z.node||q.focusOffset!==z.offset)){var A=I.createRange();A.setStart(M.node,M.offset),q.removeAllRanges(),Te>ut?(q.addRange(A),q.extend(z.node,z.offset)):(A.setEnd(z.node,z.offset),q.addRange(A))}}}}for(I=[],q=S;q=q.parentNode;)q.nodeType===1&&I.push({element:q,left:q.scrollLeft,top:q.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<I.length;S++){var F=I[S];F.element.scrollLeft=F.left,F.element.scrollTop=F.top}}Ji=!!yu,bu=yu=null}finally{rt=c,P.p=r,k.T=a}}e.current=t,Yt=2}}function vh(){if(Yt===2){Yt=0;var e=Jn,t=gr,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=k.T,k.T=null;var r=P.p;P.p=2;var c=rt;rt|=4;try{Zm(e,t.alternate,t)}finally{rt=c,P.p=r,k.T=a}}Yt=3}}function Sh(){if(Yt===4||Yt===3){Yt=0,ra();var e=Jn,t=gr,a=Tn,r=ih;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Yt=5:(Yt=0,gr=Jn=null,_h(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(Fn=null),B(a),t=t.stateNode,_t&&typeof _t.onCommitFiberRoot=="function")try{_t.onCommitFiberRoot(ia,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=k.T,c=P.p,P.p=2,k.T=null;try{for(var d=e.onRecoverableError,x=0;x<r.length;x++){var S=r[x];d(S.value,{componentStack:S.stack})}}finally{k.T=t,P.p=c}}(Tn&3)!==0&&Hi(),un(e),c=e.pendingLanes,(a&261930)!==0&&(c&42)!==0?e===ru?fs++:(fs=0,ru=e):fs=0,ms(0)}}function _h(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Qr(t)))}function Hi(){return bh(),vh(),Sh(),jh()}function jh(){if(Yt!==5)return!1;var e=Jn,t=nu;nu=0;var a=B(Tn),r=k.T,c=P.p;try{P.p=32>a?32:a,k.T=null,a=lu,lu=null;var d=Jn,x=Tn;if(Yt=0,gr=Jn=null,Tn=0,(rt&6)!==0)throw Error(i(331));var S=rt;if(rt|=4,lh(d.current),th(d,d.current,x,a),rt=S,ms(0,!1),_t&&typeof _t.onPostCommitFiberRoot=="function")try{_t.onPostCommitFiberRoot(ia,d)}catch{}return!0}finally{P.p=c,k.T=r,_h(e,t)}}function Nh(e,t,a){t=Ba(a,t),t=Uc(e.stateNode,t,2),e=Gn(e,t,2),e!==null&&(Na(e,2),un(e))}function it(e,t,a){if(e.tag===3)Nh(e,e,a);else for(;t!==null;){if(t.tag===3){Nh(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Fn===null||!Fn.has(r))){e=Ba(a,e),a=wm(2),r=Gn(t,a,2),r!==null&&(Em(a,r,t,e),Na(r,2),un(r));break}}t=t.return}}function ou(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new hb;var c=new Set;r.set(t,c)}else c=r.get(t),c===void 0&&(c=new Set,r.set(t,c));c.has(a)||(eu=!0,c.add(a),e=bb.bind(null,e,t,a),t.then(e,e))}function bb(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,mt===e&&(Fe&a)===a&&(Tt===4||Tt===3&&(Fe&62914560)===Fe&&300>ht()-Di?(rt&2)===0&&xr(e,0):tu|=a,pr===Fe&&(pr=0)),un(e)}function wh(e,t){t===0&&(t=oa()),e=xl(e,t),e!==null&&(Na(e,t),un(e))}function vb(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),wh(e,a)}function Sb(e,t){var a=0;switch(e.tag){case 31:case 13:var r=e.stateNode,c=e.memoizedState;c!==null&&(a=c.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),wh(e,a)}function _b(e,t){return Sa(e,t)}var Bi=null,br=null,cu=!1,$i=!1,uu=!1,In=0;function un(e){e!==br&&e.next===null&&(br===null?Bi=br=e:br=br.next=e),$i=!0,cu||(cu=!0,Nb())}function ms(e,t){if(!uu&&$i){uu=!0;do for(var a=!1,r=Bi;r!==null;){if(e!==0){var c=r.pendingLanes;if(c===0)var d=0;else{var x=r.suspendedLanes,S=r.pingedLanes;d=(1<<31-kt(42|e)+1)-1,d&=c&~(x&~S),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(a=!0,Th(r,d))}else d=Fe,d=Le(r,r===mt?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(d&3)===0||Et(r,d)||(a=!0,Th(r,d));r=r.next}while(a);uu=!1}}function jb(){Eh()}function Eh(){$i=cu=!1;var e=0;In!==0&&kb()&&(e=In);for(var t=ht(),a=null,r=Bi;r!==null;){var c=r.next,d=Ch(r,t);d===0?(r.next=null,a===null?Bi=c:a.next=c,c===null&&(br=a)):(a=r,(e!==0||(d&3)!==0)&&($i=!0)),r=c}Yt!==0&&Yt!==5||ms(e),In!==0&&(In=0)}function Ch(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var x=31-kt(d),S=1<<x,R=c[x];R===-1?((S&a)===0||(S&r)!==0)&&(c[x]=ja(S,t)):R<=t&&(e.expiredLanes|=S),d&=~S}if(t=mt,a=Fe,a=Le(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,a===0||e===t&&(st===2||st===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Aa(r),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Et(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(r!==null&&Aa(r),B(a)){case 2:case 8:a=ke;break;case 32:a=Ve;break;case 268435456:a=Nt;break;default:a=Ve}return r=Rh.bind(null,e),a=Sa(a,r),e.callbackPriority=t,e.callbackNode=a,t}return r!==null&&r!==null&&Aa(r),e.callbackPriority=2,e.callbackNode=null,2}function Rh(e,t){if(Yt!==0&&Yt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Hi()&&e.callbackNode!==a)return null;var r=Fe;return r=Le(e,e===mt?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(ch(e,r,t),Ch(e,ht()),e.callbackNode!=null&&e.callbackNode===a?Rh.bind(null,e):null)}function Th(e,t){if(Hi())return null;ch(e,t,!0)}function Nb(){Lb(function(){(rt&6)!==0?Sa(ge,jb):Eh()})}function du(){if(In===0){var e=lr;e===0&&(e=K,K<<=1,(K&261888)===0&&(K=256)),In=e}return In}function zh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Zs(""+e)}function Oh(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 wb(e,t,a,r,c){if(t==="submit"&&a&&a.stateNode===c){var d=zh((c[me]||null).action),x=r.submitter;x&&(t=(t=x[me]||null)?zh(t.formAction):x.getAttribute("formAction"),t!==null&&(d=t,x=null));var S=new Is("action","action",null,r,c);e.push({event:S,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(In!==0){var R=x?Oh(c,x):new FormData(c);Oc(a,{pending:!0,data:R,method:c.method,action:d},null,R)}}else typeof d=="function"&&(S.preventDefault(),R=x?Oh(c,x):new FormData(c),Oc(a,{pending:!0,data:R,method:c.method,action:d},d,R))},currentTarget:c}]})}}for(var fu=0;fu<Zo.length;fu++){var mu=Zo[fu],Eb=mu.toLowerCase(),Cb=mu[0].toUpperCase()+mu.slice(1);Ia(Eb,"on"+Cb)}Ia(of,"onAnimationEnd"),Ia(cf,"onAnimationIteration"),Ia(uf,"onAnimationStart"),Ia("dblclick","onDoubleClick"),Ia("focusin","onFocus"),Ia("focusout","onBlur"),Ia(Gy,"onTransitionRun"),Ia(Vy,"onTransitionStart"),Ia(Ky,"onTransitionCancel"),Ia(df,"onTransitionEnd"),ln("onMouseEnter",["mouseout","mouseover"]),ln("onMouseLeave",["mouseout","mouseover"]),ln("onPointerEnter",["pointerout","pointerover"]),ln("onPointerLeave",["pointerout","pointerover"]),Vt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Vt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Vt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Vt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Vt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Vt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hs="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Rb=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(hs));function Dh(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],c=r.event;r=r.listeners;e:{var d=void 0;if(t)for(var x=r.length-1;0<=x;x--){var S=r[x],R=S.instance,L=S.currentTarget;if(S=S.listener,R!==d&&c.isPropagationStopped())break e;d=S,c.currentTarget=L;try{d(c)}catch(X){ti(X)}c.currentTarget=null,d=R}else for(x=0;x<r.length;x++){if(S=r[x],R=S.instance,L=S.currentTarget,S=S.listener,R!==d&&c.isPropagationStopped())break e;d=S,c.currentTarget=L;try{d(c)}catch(X){ti(X)}c.currentTarget=null,d=R}}}}function Xe(e,t){var a=t[we];a===void 0&&(a=t[we]=new Set);var r=e+"__bubble";a.has(r)||(Mh(t,e,2,!1),a.add(r))}function hu(e,t,a){var r=0;t&&(r|=4),Mh(a,e,r,t)}var qi="_reactListening"+Math.random().toString(36).slice(2);function pu(e){if(!e[qi]){e[qi]=!0,An.forEach(function(a){a!=="selectionchange"&&(Rb.has(a)||hu(a,!1,e),hu(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[qi]||(t[qi]=!0,hu("selectionchange",!1,t))}}function Mh(e,t,a,r){switch(op(t)){case 2:var c=av;break;case 8:c=nv;break;default:c=zu}a=c.bind(null,t,a,e),c=void 0,!Ao||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),r?c!==void 0?e.addEventListener(t,a,{capture:!0,passive:c}):e.addEventListener(t,a,!0):c!==void 0?e.addEventListener(t,a,{passive:c}):e.addEventListener(t,a,!1)}function gu(e,t,a,r,c){var d=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var x=r.tag;if(x===3||x===4){var S=r.stateNode.containerInfo;if(S===c)break;if(x===4)for(x=r.return;x!==null;){var R=x.tag;if((R===3||R===4)&&x.stateNode.containerInfo===c)return;x=x.return}for(;S!==null;){if(x=gt(S),x===null)return;if(R=x.tag,R===5||R===6||R===26||R===27){r=d=x;continue e}S=S.parentNode}}r=r.return}Ud(function(){var L=d,X=Mo(a),I=[];e:{var H=ff.get(e);if(H!==void 0){var q=Is,ye=e;switch(e){case"keypress":if(Js(a)===0)break e;case"keydown":case"keyup":q=Sy;break;case"focusin":ye="focus",q=Bo;break;case"focusout":ye="blur",q=Bo;break;case"beforeblur":case"afterblur":q=Bo;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":q=$d;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=cy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=Ny;break;case of:case cf:case uf:q=fy;break;case df:q=Ey;break;case"scroll":case"scrollend":q=iy;break;case"wheel":q=Ry;break;case"copy":case"cut":case"paste":q=hy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":q=Yd;break;case"toggle":case"beforetoggle":q=zy}var Te=(t&4)!==0,ut=!Te&&(e==="scroll"||e==="scrollend"),M=Te?H!==null?H+"Capture":null:H;Te=[];for(var z=L,A;z!==null;){var F=z;if(A=F.stateNode,F=F.tag,F!==5&&F!==26&&F!==27||A===null||M===null||(F=Lr(z,M),F!=null&&Te.push(ps(z,F,A))),ut)break;z=z.return}0<Te.length&&(H=new q(H,ye,null,a,X),I.push({event:H,listeners:Te}))}}if((t&7)===0){e:{if(H=e==="mouseover"||e==="pointerover",q=e==="mouseout"||e==="pointerout",H&&a!==Do&&(ye=a.relatedTarget||a.fromElement)&&(gt(ye)||ye[he]))break e;if((q||H)&&(H=X.window===X?X:(H=X.ownerDocument)?H.defaultView||H.parentWindow:window,q?(ye=a.relatedTarget||a.toElement,q=L,ye=ye?gt(ye):null,ye!==null&&(ut=u(ye),Te=ye.tag,ye!==ut||Te!==5&&Te!==27&&Te!==6)&&(ye=null)):(q=null,ye=L),q!==ye)){if(Te=$d,F="onMouseLeave",M="onMouseEnter",z="mouse",(e==="pointerout"||e==="pointerover")&&(Te=Yd,F="onPointerLeave",M="onPointerEnter",z="pointer"),ut=q==null?H:et(q),A=ye==null?H:et(ye),H=new Te(F,z+"leave",q,a,X),H.target=ut,H.relatedTarget=A,F=null,gt(X)===L&&(Te=new Te(M,z+"enter",ye,a,X),Te.target=A,Te.relatedTarget=ut,F=Te),ut=F,q&&ye)t:{for(Te=Tb,M=q,z=ye,A=0,F=M;F;F=Te(F))A++;F=0;for(var Ee=z;Ee;Ee=Te(Ee))F++;for(;0<A-F;)M=Te(M),A--;for(;0<F-A;)z=Te(z),F--;for(;A--;){if(M===z||z!==null&&M===z.alternate){Te=M;break t}M=Te(M),z=Te(z)}Te=null}else Te=null;q!==null&&kh(I,H,q,Te,!1),ye!==null&&ut!==null&&kh(I,ut,ye,Te,!0)}}e:{if(H=L?et(L):window,q=H.nodeName&&H.nodeName.toLowerCase(),q==="select"||q==="input"&&H.type==="file")var nt=Jd;else if(Zd(H))if(Pd)nt=$y;else{nt=Hy;var ve=Uy}else q=H.nodeName,!q||q.toLowerCase()!=="input"||H.type!=="checkbox"&&H.type!=="radio"?L&&Oo(L.elementType)&&(nt=Jd):nt=By;if(nt&&(nt=nt(e,L))){Fd(I,nt,a,X);break e}ve&&ve(e,H,L),e==="focusout"&&L&&H.type==="number"&&L.memoizedProps.value!=null&&zo(H,"number",H.value)}switch(ve=L?et(L):window,e){case"focusin":(Zd(ve)||ve.contentEditable==="true")&&(Jl=ve,Ko=L,Vr=null);break;case"focusout":Vr=Ko=Jl=null;break;case"mousedown":Xo=!0;break;case"contextmenu":case"mouseup":case"dragend":Xo=!1,rf(I,a,X);break;case"selectionchange":if(Yy)break;case"keydown":case"keyup":rf(I,a,X)}var Be;if(qo)e:{switch(e){case"compositionstart":var Je="onCompositionStart";break e;case"compositionend":Je="onCompositionEnd";break e;case"compositionupdate":Je="onCompositionUpdate";break e}Je=void 0}else Fl?Xd(e,a)&&(Je="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Je="onCompositionStart");Je&&(Gd&&a.locale!=="ko"&&(Fl||Je!=="onCompositionStart"?Je==="onCompositionEnd"&&Fl&&(Be=Hd()):(Ln=X,Lo="value"in Ln?Ln.value:Ln.textContent,Fl=!0)),ve=Yi(L,Je),0<ve.length&&(Je=new qd(Je,e,null,a,X),I.push({event:Je,listeners:ve}),Be?Je.data=Be:(Be=Qd(a),Be!==null&&(Je.data=Be)))),(Be=Dy?My(e,a):ky(e,a))&&(Je=Yi(L,"onBeforeInput"),0<Je.length&&(ve=new qd("onBeforeInput","beforeinput",null,a,X),I.push({event:ve,listeners:Je}),ve.data=Be)),wb(I,e,L,a,X)}Dh(I,t)})}function ps(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Yi(e,t){for(var a=t+"Capture",r=[];e!==null;){var c=e,d=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||d===null||(c=Lr(e,a),c!=null&&r.unshift(ps(e,c,d)),c=Lr(e,t),c!=null&&r.push(ps(e,c,d))),e.tag===3)return r;e=e.return}return[]}function Tb(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function kh(e,t,a,r,c){for(var d=t._reactName,x=[];a!==null&&a!==r;){var S=a,R=S.alternate,L=S.stateNode;if(S=S.tag,R!==null&&R===r)break;S!==5&&S!==26&&S!==27||L===null||(R=L,c?(L=Lr(a,d),L!=null&&x.unshift(ps(a,L,R))):c||(L=Lr(a,d),L!=null&&x.push(ps(a,L,R)))),a=a.return}x.length!==0&&e.push({event:t,listeners:x})}var zb=/\r\n?/g,Ob=/\u0000|\uFFFD/g;function Ah(e){return(typeof e=="string"?e:""+e).replace(zb,`
9
+ `).replace(Ob,"")}function Lh(e,t){return t=Ah(t),Ah(e)===t}function ct(e,t,a,r,c,d){switch(a){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Xl(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Xl(e,""+r);break;case"className":Ot(e,"class",r);break;case"tabIndex":Ot(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Ot(e,a,r);break;case"style":Ad(e,r,d);break;case"data":if(t!=="object"){Ot(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Zs(""+r),e.setAttribute(a,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof d=="function"&&(a==="formAction"?(t!=="input"&&ct(e,t,"name",c.name,c,null),ct(e,t,"formEncType",c.formEncType,c,null),ct(e,t,"formMethod",c.formMethod,c,null),ct(e,t,"formTarget",c.formTarget,c,null)):(ct(e,t,"encType",c.encType,c,null),ct(e,t,"method",c.method,c,null),ct(e,t,"target",c.target,c,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Zs(""+r),e.setAttribute(a,r);break;case"onClick":r!=null&&(e.onclick=hn);break;case"onScroll":r!=null&&Xe("scroll",e);break;case"onScrollEnd":r!=null&&Xe("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(a=r.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}a=Zs(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""+r):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":r===!0?e.setAttribute(a,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,r):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(a,r):e.removeAttribute(a);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(a):e.setAttribute(a,r);break;case"popover":Xe("beforetoggle",e),Xe("toggle",e),Ge(e,"popover",r);break;case"xlinkActuate":ea(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":ea(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":ea(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":ea(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":ea(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":ea(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":ea(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":ea(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":ea(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Ge(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=ry.get(a)||a,Ge(e,a,r))}}function xu(e,t,a,r,c,d){switch(a){case"style":Ad(e,r,d);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(a=r.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"children":typeof r=="string"?Xl(e,r):(typeof r=="number"||typeof r=="bigint")&&Xl(e,""+r);break;case"onScroll":r!=null&&Xe("scroll",e);break;case"onScrollEnd":r!=null&&Xe("scrollend",e);break;case"onClick":r!=null&&(e.onclick=hn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Pa.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(c=a.endsWith("Capture"),t=a.slice(2,c?a.length-7:void 0),d=e[me]||null,d=d!=null?d[a]:null,typeof d=="function"&&e.removeEventListener(t,d,c),typeof r=="function")){typeof d!="function"&&d!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,r,c);break e}a in e?e[a]=r:r===!0?e.setAttribute(a,""):Ge(e,a,r)}}}function Jt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Xe("error",e),Xe("load",e);var r=!1,c=!1,d;for(d in a)if(a.hasOwnProperty(d)){var x=a[d];if(x!=null)switch(d){case"src":r=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:ct(e,t,d,x,a,null)}}c&&ct(e,t,"srcSet",a.srcSet,a,null),r&&ct(e,t,"src",a.src,a,null);return;case"input":Xe("invalid",e);var S=d=x=c=null,R=null,L=null;for(r in a)if(a.hasOwnProperty(r)){var X=a[r];if(X!=null)switch(r){case"name":c=X;break;case"type":x=X;break;case"checked":R=X;break;case"defaultChecked":L=X;break;case"value":d=X;break;case"defaultValue":S=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(i(137,t));break;default:ct(e,t,r,X,a,null)}}Od(e,d,S,R,L,x,c,!1);return;case"select":Xe("invalid",e),r=x=d=null;for(c in a)if(a.hasOwnProperty(c)&&(S=a[c],S!=null))switch(c){case"value":d=S;break;case"defaultValue":x=S;break;case"multiple":r=S;default:ct(e,t,c,S,a,null)}t=d,a=x,e.multiple=!!r,t!=null?Kl(e,!!r,t,!1):a!=null&&Kl(e,!!r,a,!0);return;case"textarea":Xe("invalid",e),d=c=r=null;for(x in a)if(a.hasOwnProperty(x)&&(S=a[x],S!=null))switch(x){case"value":r=S;break;case"defaultValue":c=S;break;case"children":d=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(i(91));break;default:ct(e,t,x,S,a,null)}Md(e,r,c,d);return;case"option":for(R in a)a.hasOwnProperty(R)&&(r=a[R],r!=null)&&(R==="selected"?e.selected=r&&typeof r!="function"&&typeof r!="symbol":ct(e,t,R,r,a,null));return;case"dialog":Xe("beforetoggle",e),Xe("toggle",e),Xe("cancel",e),Xe("close",e);break;case"iframe":case"object":Xe("load",e);break;case"video":case"audio":for(r=0;r<hs.length;r++)Xe(hs[r],e);break;case"image":Xe("error",e),Xe("load",e);break;case"details":Xe("toggle",e);break;case"embed":case"source":case"link":Xe("error",e),Xe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(L in a)if(a.hasOwnProperty(L)&&(r=a[L],r!=null))switch(L){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:ct(e,t,L,r,a,null)}return;default:if(Oo(t)){for(X in a)a.hasOwnProperty(X)&&(r=a[X],r!==void 0&&xu(e,t,X,r,a,void 0));return}}for(S in a)a.hasOwnProperty(S)&&(r=a[S],r!=null&&ct(e,t,S,r,a,null))}function Db(e,t,a,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,d=null,x=null,S=null,R=null,L=null,X=null;for(q in a){var I=a[q];if(a.hasOwnProperty(q)&&I!=null)switch(q){case"checked":break;case"value":break;case"defaultValue":R=I;default:r.hasOwnProperty(q)||ct(e,t,q,null,r,I)}}for(var H in r){var q=r[H];if(I=a[H],r.hasOwnProperty(H)&&(q!=null||I!=null))switch(H){case"type":d=q;break;case"name":c=q;break;case"checked":L=q;break;case"defaultChecked":X=q;break;case"value":x=q;break;case"defaultValue":S=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(i(137,t));break;default:q!==I&&ct(e,t,H,q,r,I)}}To(e,x,S,R,L,X,d,c);return;case"select":q=x=S=H=null;for(d in a)if(R=a[d],a.hasOwnProperty(d)&&R!=null)switch(d){case"value":break;case"multiple":q=R;default:r.hasOwnProperty(d)||ct(e,t,d,null,r,R)}for(c in r)if(d=r[c],R=a[c],r.hasOwnProperty(c)&&(d!=null||R!=null))switch(c){case"value":H=d;break;case"defaultValue":S=d;break;case"multiple":x=d;default:d!==R&&ct(e,t,c,d,r,R)}t=S,a=x,r=q,H!=null?Kl(e,!!a,H,!1):!!r!=!!a&&(t!=null?Kl(e,!!a,t,!0):Kl(e,!!a,a?[]:"",!1));return;case"textarea":q=H=null;for(S in a)if(c=a[S],a.hasOwnProperty(S)&&c!=null&&!r.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:ct(e,t,S,null,r,c)}for(x in r)if(c=r[x],d=a[x],r.hasOwnProperty(x)&&(c!=null||d!=null))switch(x){case"value":H=c;break;case"defaultValue":q=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==d&&ct(e,t,x,c,r,d)}Dd(e,H,q);return;case"option":for(var ye in a)H=a[ye],a.hasOwnProperty(ye)&&H!=null&&!r.hasOwnProperty(ye)&&(ye==="selected"?e.selected=!1:ct(e,t,ye,null,r,H));for(R in r)H=r[R],q=a[R],r.hasOwnProperty(R)&&H!==q&&(H!=null||q!=null)&&(R==="selected"?e.selected=H&&typeof H!="function"&&typeof H!="symbol":ct(e,t,R,H,r,q));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&&!r.hasOwnProperty(Te)&&ct(e,t,Te,null,r,H);for(L in r)if(H=r[L],q=a[L],r.hasOwnProperty(L)&&H!==q&&(H!=null||q!=null))switch(L){case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(i(137,t));break;default:ct(e,t,L,H,r,q)}return;default:if(Oo(t)){for(var ut in a)H=a[ut],a.hasOwnProperty(ut)&&H!==void 0&&!r.hasOwnProperty(ut)&&xu(e,t,ut,void 0,r,H);for(X in r)H=r[X],q=a[X],!r.hasOwnProperty(X)||H===q||H===void 0&&q===void 0||xu(e,t,X,H,r,q);return}}for(var M in a)H=a[M],a.hasOwnProperty(M)&&H!=null&&!r.hasOwnProperty(M)&&ct(e,t,M,null,r,H);for(I in r)H=r[I],q=a[I],!r.hasOwnProperty(I)||H===q||H==null&&q==null||ct(e,t,I,H,r,q)}function Uh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Mb(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var c=a[r],d=c.transferSize,x=c.initiatorType,S=c.duration;if(d&&S&&Uh(x)){for(x=0,S=c.responseEnd,r+=1;r<a.length;r++){var R=a[r],L=R.startTime;if(L>S)break;var X=R.transferSize,I=R.initiatorType;X&&Uh(I)&&(R=R.responseEnd,x+=X*(R<S?1:(S-L)/(R-L)))}if(--r,t+=8*(d+x)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var yu=null,bu=null;function Gi(e){return e.nodeType===9?e:e.ownerDocument}function Hh(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 Bh(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 vu(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 Su=null;function kb(){var e=window.event;return e&&e.type==="popstate"?e===Su?!1:(Su=e,!0):(Su=null,!1)}var $h=typeof setTimeout=="function"?setTimeout:void 0,Ab=typeof clearTimeout=="function"?clearTimeout:void 0,qh=typeof Promise=="function"?Promise:void 0,Lb=typeof queueMicrotask=="function"?queueMicrotask:typeof qh<"u"?function(e){return qh.resolve(null).then(e).catch(Ub)}:$h;function Ub(e){setTimeout(function(){throw e})}function Wn(e){return e==="head"}function Yh(e,t){var a=t,r=0;do{var c=a.nextSibling;if(e.removeChild(a),c&&c.nodeType===8)if(a=c.data,a==="/$"||a==="/&"){if(r===0){e.removeChild(c),jr(t);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")gs(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,gs(a);for(var d=a.firstChild;d;){var x=d.nextSibling,S=d.nodeName;d[Ye]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&d.rel.toLowerCase()==="stylesheet"||a.removeChild(d),d=x}}else a==="body"&&gs(e.ownerDocument.body);a=c}while(a);jr(t)}function Gh(e,t){var a=e;e=0;do{var r=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),r&&r.nodeType===8)if(a=r.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=r}while(a)}function _u(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":_u(a),ft(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Hb(e,t,a,r){for(;e.nodeType===1;){var c=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Ye])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=Va(e.nextSibling),e===null)break}return null}function Bb(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Va(e.nextSibling),e===null))return null;return e}function Vh(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Va(e.nextSibling),e===null))return null;return e}function ju(e){return e.data==="$?"||e.data==="$~"}function Nu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function $b(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var r=function(){t(),a.removeEventListener("DOMContentLoaded",r)};a.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function Va(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 wu=null;function Kh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return Va(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function Xh(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 Qh(e,t,a){switch(t=Gi(a),e){case"html":if(e=t.documentElement,!e)throw Error(i(452));return e;case"head":if(e=t.head,!e)throw Error(i(453));return e;case"body":if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function gs(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ft(e)}var Ka=new Map,Zh=new Set;function Vi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var zn=P.d;P.d={f:qb,r:Yb,D:Gb,C:Vb,L:Kb,m:Xb,X:Zb,S:Qb,M:Fb};function qb(){var e=zn.f(),t=Ai();return e||t}function Yb(e){var t=Ct(e);t!==null&&t.tag===5&&t.type==="form"?dm(t):zn.r(e)}var vr=typeof document>"u"?null:document;function Fh(e,t,a){var r=vr;if(r&&typeof t=="string"&&t){var c=Ua(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),Zh.has(c)||(Zh.add(c),e={rel:e,crossOrigin:a,href:t},r.querySelector(c)===null&&(t=r.createElement("link"),Jt(t,"link",e),pt(t),r.head.appendChild(t)))}}function Gb(e){zn.D(e),Fh("dns-prefetch",e,null)}function Vb(e,t){zn.C(e,t),Fh("preconnect",e,t)}function Kb(e,t,a){zn.L(e,t,a);var r=vr;if(r&&e&&t){var c='link[rel="preload"][as="'+Ua(t)+'"]';t==="image"&&a&&a.imageSrcSet?(c+='[imagesrcset="'+Ua(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(c+='[imagesizes="'+Ua(a.imageSizes)+'"]')):c+='[href="'+Ua(e)+'"]';var d=c;switch(t){case"style":d=Sr(e);break;case"script":d=_r(e)}Ka.has(d)||(e=y({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Ka.set(d,e),r.querySelector(c)!==null||t==="style"&&r.querySelector(xs(d))||t==="script"&&r.querySelector(ys(d))||(t=r.createElement("link"),Jt(t,"link",e),pt(t),r.head.appendChild(t)))}}function Xb(e,t){zn.m(e,t);var a=vr;if(a&&e){var r=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+Ua(r)+'"][href="'+Ua(e)+'"]',d=c;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=_r(e)}if(!Ka.has(d)&&(e=y({rel:"modulepreload",href:e},t),Ka.set(d,e),a.querySelector(c)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(ys(d)))return}r=a.createElement("link"),Jt(r,"link",e),pt(r),a.head.appendChild(r)}}}function Qb(e,t,a){zn.S(e,t,a);var r=vr;if(r&&e){var c=qt(r).hoistableStyles,d=Sr(e);t=t||"default";var x=c.get(d);if(!x){var S={loading:0,preload:null};if(x=r.querySelector(xs(d)))S.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Ka.get(d))&&Eu(e,a);var R=x=r.createElement("link");pt(R),Jt(R,"link",e),R._p=new Promise(function(L,X){R.onload=L,R.onerror=X}),R.addEventListener("load",function(){S.loading|=1}),R.addEventListener("error",function(){S.loading|=2}),S.loading|=4,Ki(x,t,r)}x={type:"stylesheet",instance:x,count:1,state:S},c.set(d,x)}}}function Zb(e,t){zn.X(e,t);var a=vr;if(a&&e){var r=qt(a).hoistableScripts,c=_r(e),d=r.get(c);d||(d=a.querySelector(ys(c)),d||(e=y({src:e,async:!0},t),(t=Ka.get(c))&&Cu(e,t),d=a.createElement("script"),pt(d),Jt(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(c,d))}}function Fb(e,t){zn.M(e,t);var a=vr;if(a&&e){var r=qt(a).hoistableScripts,c=_r(e),d=r.get(c);d||(d=a.querySelector(ys(c)),d||(e=y({src:e,async:!0,type:"module"},t),(t=Ka.get(c))&&Cu(e,t),d=a.createElement("script"),pt(d),Jt(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(c,d))}}function Jh(e,t,a,r){var c=(c=Ne.current)?Vi(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Sr(a.href),a=qt(c).hoistableStyles,r=a.get(t),r||(r={type:"style",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Sr(a.href);var d=qt(c).hoistableStyles,x=d.get(e);if(x||(c=c.ownerDocument||c,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,x),(d=c.querySelector(xs(e)))&&!d._p&&(x.instance=d,x.state.loading=5),Ka.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},Ka.set(e,a),d||Jb(c,e,a,x.state))),t&&r===null)throw Error(i(528,""));return x}if(t&&r!==null)throw Error(i(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=_r(a),a=qt(c).hoistableScripts,r=a.get(t),r||(r={type:"script",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Sr(e){return'href="'+Ua(e)+'"'}function xs(e){return'link[rel="stylesheet"]['+e+"]"}function Ph(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function Jb(e,t,a,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),Jt(t,"link",a),pt(t),e.head.appendChild(t))}function _r(e){return'[src="'+Ua(e)+'"]'}function ys(e){return"script[async]"+e}function Ih(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+Ua(a.href)+'"]');if(r)return t.instance=r,pt(r),r;var c=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),pt(r),Jt(r,"style",c),Ki(r,a.precedence,e),t.instance=r;case"stylesheet":c=Sr(a.href);var d=e.querySelector(xs(c));if(d)return t.state.loading|=4,t.instance=d,pt(d),d;r=Ph(a),(c=Ka.get(c))&&Eu(r,c),d=(e.ownerDocument||e).createElement("link"),pt(d);var x=d;return x._p=new Promise(function(S,R){x.onload=S,x.onerror=R}),Jt(d,"link",r),t.state.loading|=4,Ki(d,a.precedence,e),t.instance=d;case"script":return d=_r(a.src),(c=e.querySelector(ys(d)))?(t.instance=c,pt(c),c):(r=a,(c=Ka.get(d))&&(r=y({},a),Cu(r,c)),e=e.ownerDocument||e,c=e.createElement("script"),pt(c),Jt(c,"link",r),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(i(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Ki(r,a.precedence,e));return t.instance}function Ki(e,t,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=r.length?r[r.length-1]:null,d=c,x=0;x<r.length;x++){var S=r[x];if(S.dataset.precedence===t)d=S;else if(d!==c)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Eu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Cu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Xi=null;function Wh(e,t,a){if(Xi===null){var r=new Map,c=Xi=new Map;c.set(a,r)}else c=Xi,r=c.get(a),r||(r=new Map,c.set(a,r));if(r.has(e))return r;for(r.set(e,null),a=a.getElementsByTagName(e),c=0;c<a.length;c++){var d=a[c];if(!(d[Ye]||d[ue]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var x=d.getAttribute(t)||"";x=e+x;var S=r.get(x);S?S.push(d):r.set(x,[d])}}return r}function ep(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Pb(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 tp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Ib(e,t,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var c=Sr(r.href),d=t.querySelector(xs(c));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Qi.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=d,pt(d);return}d=t.ownerDocument||t,r=Ph(r),(c=Ka.get(c))&&Eu(r,c),d=d.createElement("link"),pt(d);var x=d;x._p=new Promise(function(S,R){x.onload=S,x.onerror=R}),Jt(d,"link",r),a.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Qi.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Ru=0;function Wb(e,t){return e.stylesheets&&e.count===0&&Fi(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var r=setTimeout(function(){if(e.stylesheets&&Fi(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&Ru===0&&(Ru=62500*Mb());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Fi(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>Ru?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(c)}}:null}function Qi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Fi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zi=null;function Fi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zi=new Map,t.forEach(ev,e),Zi=null,Qi.call(e))}function ev(e,t){if(!(t.state.loading&4)){var a=Zi.get(e);if(a)var r=a.get(null);else{a=new Map,Zi.set(e,a);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<c.length;d++){var x=c[d];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(a.set(x.dataset.precedence,x),r=x)}r&&a.set(null,r)}c=t.instance,x=c.getAttribute("data-precedence"),d=a.get(x)||r,d===r&&a.set(null,c),a.set(x,c),this.count++,r=Qi.bind(this),c.addEventListener("load",r),c.addEventListener("error",r),d?d.parentNode.insertBefore(c,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var bs={$$typeof:G,Provider:null,Consumer:null,_currentValue:J,_currentValue2:J,_threadCount:0};function tv(e,t,a,r,c,d,x,S,R){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=La(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=La(0),this.hiddenUpdates=La(null),this.identifierPrefix=r,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function ap(e,t,a,r,c,d,x,S,R,L,X,I){return e=new tv(e,t,a,x,R,L,X,I,S),t=1,d===!0&&(t|=24),d=Ea(3,null,null,t),e.current=d,d.stateNode=e,t=ic(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:r,isDehydrated:a,cache:t},dc(d),e}function np(e){return e?(e=Wl,e):Wl}function lp(e,t,a,r,c,d){c=np(c),r.context===null?r.context=c:r.pendingContext=c,r=Yn(t),r.payload={element:a},d=d===void 0?null:d,d!==null&&(r.callback=d),a=Gn(e,r,t),a!==null&&(ya(a,e,t),Pr(a,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Tu(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function sp(e){if(e.tag===13||e.tag===31){var t=xl(e,67108864);t!==null&&ya(t,e,67108864),Tu(e,67108864)}}function ip(e){if(e.tag===13||e.tag===31){var t=Oa();t=O(t);var a=xl(e,t);a!==null&&ya(a,e,t),Tu(e,t)}}var Ji=!0;function av(e,t,a,r){var c=k.T;k.T=null;var d=P.p;try{P.p=2,zu(e,t,a,r)}finally{P.p=d,k.T=c}}function nv(e,t,a,r){var c=k.T;k.T=null;var d=P.p;try{P.p=8,zu(e,t,a,r)}finally{P.p=d,k.T=c}}function zu(e,t,a,r){if(Ji){var c=Ou(r);if(c===null)gu(e,t,r,Pi,a),cp(e,r);else if(rv(c,e,t,a,r))r.stopPropagation();else if(cp(e,r),t&4&&-1<lv.indexOf(e)){for(;c!==null;){var d=Ct(c);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var x=$e(d.pendingLanes);if(x!==0){var S=d;for(S.pendingLanes|=2,S.entangledLanes|=2;x;){var R=1<<31-kt(x);S.entanglements[1]|=R,x&=~R}un(d),(rt&6)===0&&(Mi=ht()+500,ms(0))}}break;case 31:case 13:S=xl(d,2),S!==null&&ya(S,d,2),Ai(),Tu(d,2)}if(d=Ou(r),d===null&&gu(e,t,r,Pi,a),d===c)break;c=d}c!==null&&r.stopPropagation()}else gu(e,t,r,null,a)}}function Ou(e){return e=Mo(e),Du(e)}var Pi=null;function Du(e){if(Pi=null,e=gt(e),e!==null){var t=u(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=m(t),e!==null)return e;e=null}else if(a===31){if(e=p(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Pi=e,null}function op(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(sa()){case ge:return 2;case ke:return 8;case Ve:case jt:return 32;case Nt:return 268435456;default:return 32}default:return 32}}var Mu=!1,el=null,tl=null,al=null,vs=new Map,Ss=new Map,nl=[],lv="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 cp(e,t){switch(e){case"focusin":case"focusout":el=null;break;case"dragenter":case"dragleave":tl=null;break;case"mouseover":case"mouseout":al=null;break;case"pointerover":case"pointerout":vs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ss.delete(t.pointerId)}}function _s(e,t,a,r,c,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:d,targetContainers:[c]},t!==null&&(t=Ct(t),t!==null&&sp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function rv(e,t,a,r,c){switch(t){case"focusin":return el=_s(el,e,t,a,r,c),!0;case"dragenter":return tl=_s(tl,e,t,a,r,c),!0;case"mouseover":return al=_s(al,e,t,a,r,c),!0;case"pointerover":var d=c.pointerId;return vs.set(d,_s(vs.get(d)||null,e,t,a,r,c)),!0;case"gotpointercapture":return d=c.pointerId,Ss.set(d,_s(Ss.get(d)||null,e,t,a,r,c)),!0}return!1}function up(e){var t=gt(e.target);if(t!==null){var a=u(t);if(a!==null){if(t=a.tag,t===13){if(t=m(a),t!==null){e.blockedOn=t,se(e.priority,function(){ip(a)});return}}else if(t===31){if(t=p(a),t!==null){e.blockedOn=t,se(e.priority,function(){ip(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ii(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Ou(e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);Do=r,a.target.dispatchEvent(r),Do=null}else return t=Ct(a),t!==null&&sp(t),e.blockedOn=a,!1;t.shift()}return!0}function dp(e,t,a){Ii(e)&&a.delete(t)}function sv(){Mu=!1,el!==null&&Ii(el)&&(el=null),tl!==null&&Ii(tl)&&(tl=null),al!==null&&Ii(al)&&(al=null),vs.forEach(dp),Ss.forEach(dp)}function Wi(e,t){e.blockedOn===t&&(e.blockedOn=null,Mu||(Mu=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,sv)))}var eo=null;function fp(e){eo!==e&&(eo=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){eo===e&&(eo=null);for(var t=0;t<e.length;t+=3){var a=e[t],r=e[t+1],c=e[t+2];if(typeof r!="function"){if(Du(r||a)===null)continue;break}var d=Ct(a);d!==null&&(e.splice(t,3),t-=3,Oc(d,{pending:!0,data:c,method:a.method,action:r},r,c))}}))}function jr(e){function t(R){return Wi(R,e)}el!==null&&Wi(el,e),tl!==null&&Wi(tl,e),al!==null&&Wi(al,e),vs.forEach(t),Ss.forEach(t);for(var a=0;a<nl.length;a++){var r=nl[a];r.blockedOn===e&&(r.blockedOn=null)}for(;0<nl.length&&(a=nl[0],a.blockedOn===null);)up(a),a.blockedOn===null&&nl.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var c=a[r],d=a[r+1],x=c[me]||null;if(typeof d=="function")x||fp(a);else if(x){var S=null;if(d&&d.hasAttribute("formAction")){if(c=d,x=d[me]||null)S=x.formAction;else if(Du(c)!==null)continue}else S=x.action;typeof S=="function"?a[r+1]=S:(a.splice(r,3),r-=3),fp(a)}}}function mp(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(x){return c=x})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),r||setTimeout(a,20)}function a(){if(!r&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function ku(e){this._internalRoot=e}to.prototype.render=ku.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var a=t.current,r=Oa();lp(a,r,e,t,null,null)},to.prototype.unmount=ku.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;lp(e.current,2,null,e,null,null),Ai(),t[he]=null}};function to(e){this._internalRoot=e}to.prototype.unstable_scheduleHydration=function(e){if(e){var t=ne();e={blockedOn:null,target:e,priority:t};for(var a=0;a<nl.length&&t!==0&&t<nl[a].priority;a++);nl.splice(a,0,e),a===0&&up(e)}};var hp=l.version;if(hp!=="19.2.4")throw Error(i(527,hp,"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 iv={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ao=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ao.isDisabled&&ao.supportsFiber)try{ia=ao.inject(iv),_t=ao}catch{}}return ws.createRoot=function(e,t){if(!o(e))throw Error(i(299));var a=!1,r="",c=Sm,d=_m,x=jm;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(x=t.onRecoverableError)),t=ap(e,1,!1,null,null,a,r,null,c,d,x,mp),e[he]=t.current,pu(e),new ku(t)},ws.hydrateRoot=function(e,t,a){if(!o(e))throw Error(i(299));var r=!1,c="",d=Sm,x=_m,S=jm,R=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(d=a.onUncaughtError),a.onCaughtError!==void 0&&(x=a.onCaughtError),a.onRecoverableError!==void 0&&(S=a.onRecoverableError),a.formState!==void 0&&(R=a.formState)),t=ap(e,1,!0,t,a??null,r,c,R,d,x,S,mp),t.context=np(null),a=t.current,r=Oa(),r=O(r),c=Yn(r),c.callback=null,Gn(a,c,r),a=r,t.current.lanes=a,Na(t,a),un(t),e[he]=t.current,pu(e),new to(t)},ws.version="19.2.4",ws}var Kp;function w0(){if(Kp)return Yu.exports;Kp=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Yu.exports=N0(),Yu.exports}var E0=w0();var Wg=n=>{throw TypeError(n)},C0=(n,l,s)=>l.has(n)||Wg("Cannot "+s),Xu=(n,l,s)=>(C0(n,l,"read from private field"),s?s.call(n):l.get(n)),R0=(n,l,s)=>l.has(n)?Wg("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(n):l.set(n,s),Xp="popstate";function Qp(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function T0(n={}){function l(i,o){let u=o.state?.masked,{pathname:m,search:p,hash:g}=u||i.location;return Ls("",{pathname:m,search:p,hash:g},o.state&&o.state.usr||null,o.state&&o.state.key||"default",u?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function s(i,o){return typeof o=="string"?o:mn(o)}return O0(l,s,null,n)}function qe(n,l){if(n===!1||n===null||typeof n>"u")throw new Error(l)}function zt(n,l){if(!n){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function z0(){return Math.random().toString(36).substring(2,10)}function Zp(n,l){return{usr:n.state,key:n.key,idx:l,masked:n.unstable_mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function Ls(n,l,s=null,i,o){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof l=="string"?Mn(l):l,state:s,key:l&&l.key||i||z0(),unstable_mask:o}}function mn({pathname:n="/",search:l="",hash:s=""}){return l&&l!=="?"&&(n+=l.charAt(0)==="?"?l:"?"+l),s&&s!=="#"&&(n+=s.charAt(0)==="#"?s:"#"+s),n}function Mn(n){let l={};if(n){let s=n.indexOf("#");s>=0&&(l.hash=n.substring(s),n=n.substring(0,s));let i=n.indexOf("?");i>=0&&(l.search=n.substring(i),n=n.substring(0,i)),n&&(l.pathname=n)}return l}function O0(n,l,s,i={}){let{window:o=document.defaultView,v5Compat:u=!1}=i,m=o.history,p="POP",g=null,h=v();h==null&&(h=0,m.replaceState({...m.state,idx:h},""));function v(){return(m.state||{idx:null}).idx}function y(){p="POP";let D=v(),Y=D==null?null:D-h;h=D,g&&g({action:p,location:T.location,delta:Y})}function _(D,Y){p="PUSH";let Z=Qp(D)?D:Ls(T.location,D,Y);h=v()+1;let G=Zp(Z,h),V=T.createHref(Z.unstable_mask||Z);try{m.pushState(G,"",V)}catch(Q){if(Q instanceof DOMException&&Q.name==="DataCloneError")throw Q;o.location.assign(V)}u&&g&&g({action:p,location:T.location,delta:1})}function j(D,Y){p="REPLACE";let Z=Qp(D)?D:Ls(T.location,D,Y);h=v();let G=Zp(Z,h),V=T.createHref(Z.unstable_mask||Z);m.replaceState(G,"",V),u&&g&&g({action:p,location:T.location,delta:0})}function N(D){return ex(D)}let T={get action(){return p},get location(){return n(o,m)},listen(D){if(g)throw new Error("A history only accepts one active listener");return o.addEventListener(Xp,y),g=D,()=>{o.removeEventListener(Xp,y),g=null}},createHref(D){return l(o,D)},createURL:N,encodeLocation(D){let Y=N(D);return{pathname:Y.pathname,search:Y.search,hash:Y.hash}},push:_,replace:j,go(D){return m.go(D)}};return T}function ex(n,l=!1){let s="http://localhost";typeof window<"u"&&(s=window.location.origin!=="null"?window.location.origin:window.location.href),qe(s,"No window.location.(origin|href) available to create URL");let i=typeof n=="string"?n:mn(n);return i=i.replace(/ $/,"%20"),!l&&i.startsWith("//")&&(i=s+i),new URL(i,s)}var Ts,Fp=class{constructor(n){if(R0(this,Ts,new Map),n)for(let[l,s]of n)this.set(l,s)}get(n){if(Xu(this,Ts).has(n))return Xu(this,Ts).get(n);if(n.defaultValue!==void 0)return n.defaultValue;throw new Error("No value found for context")}set(n,l){Xu(this,Ts).set(n,l)}};Ts=new WeakMap;var D0=new Set(["lazy","caseSensitive","path","id","index","children"]);function M0(n){return D0.has(n)}var k0=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function A0(n){return k0.has(n)}function L0(n){return n.index===!0}function Us(n,l,s=[],i={},o=!1){return n.map((u,m)=>{let p=[...s,String(m)],g=typeof u.id=="string"?u.id:p.join("-");if(qe(u.index!==!0||!u.children,"Cannot specify children on an index route"),qe(o||!i[g],`Found a route id collision on id "${g}". Route id's must be globally unique within Data Router usages`),L0(u)){let h={...u,id:g};return i[g]=Jp(h,l(h)),h}else{let h={...u,id:g,children:void 0};return i[g]=Jp(h,l(h)),u.children&&(h.children=Us(u.children,l,p,i,o)),h}})}function Jp(n,l){return Object.assign(n,{...l,...typeof l.lazy=="object"&&l.lazy!=null?{lazy:{...n.lazy,...l.lazy}}:{}})}function rl(n,l,s="/"){return zs(n,l,s,!1)}function zs(n,l,s,i){let o=typeof l=="string"?Mn(l):l,u=Za(o.pathname||"/",s);if(u==null)return null;let m=tx(n);H0(m);let p=null;for(let g=0;p==null&&g<m.length;++g){let h=F0(u);p=Q0(m[g],h,i)}return p}function U0(n,l){let{route:s,pathname:i,params:o}=n;return{id:s.id,pathname:i,params:o,data:l[s.id],loaderData:l[s.id],handle:s.handle}}function tx(n,l=[],s=[],i="",o=!1){let u=(m,p,g=o,h)=>{let v={relativePath:h===void 0?m.path||"":h,caseSensitive:m.caseSensitive===!0,childrenIndex:p,route:m};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(i)&&g)return;qe(v.relativePath.startsWith(i),`Absolute route path "${v.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(i.length)}let y=tn([i,v.relativePath]),_=s.concat(v);m.children&&m.children.length>0&&(qe(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),tx(m.children,l,_,y,g)),!(m.path==null&&!m.index)&&l.push({path:y,score:K0(y,m.index),routesMeta:_})};return n.forEach((m,p)=>{if(m.path===""||!m.path?.includes("?"))u(m,p);else for(let g of ax(m.path))u(m,p,!0,g)}),l}function ax(n){let l=n.split("/");if(l.length===0)return[];let[s,...i]=l,o=s.endsWith("?"),u=s.replace(/\?$/,"");if(i.length===0)return o?[u,""]:[u];let m=ax(i.join("/")),p=[];return p.push(...m.map(g=>g===""?u:[u,g].join("/"))),o&&p.push(...m),p.map(g=>n.startsWith("/")&&g===""?"/":g)}function H0(n){n.sort((l,s)=>l.score!==s.score?s.score-l.score:X0(l.routesMeta.map(i=>i.childrenIndex),s.routesMeta.map(i=>i.childrenIndex)))}var B0=/^:[\w-]+$/,$0=3,q0=2,Y0=1,G0=10,V0=-2,Pp=n=>n==="*";function K0(n,l){let s=n.split("/"),i=s.length;return s.some(Pp)&&(i+=V0),l&&(i+=q0),s.filter(o=>!Pp(o)).reduce((o,u)=>o+(B0.test(u)?$0:u===""?Y0:G0),i)}function X0(n,l){return n.length===l.length&&n.slice(0,-1).every((i,o)=>i===l[o])?n[n.length-1]-l[l.length-1]:0}function Q0(n,l,s=!1){let{routesMeta:i}=n,o={},u="/",m=[];for(let p=0;p<i.length;++p){let g=i[p],h=p===i.length-1,v=u==="/"?l:l.slice(u.length)||"/",y=yo({path:g.relativePath,caseSensitive:g.caseSensitive,end:h},v),_=g.route;if(!y&&h&&s&&!i[i.length-1].route.index&&(y=yo({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},v)),!y)return null;Object.assign(o,y.params),m.push({params:o,pathname:tn([u,y.pathname]),pathnameBase:I0(tn([u,y.pathnameBase])),route:_}),y.pathnameBase!=="/"&&(u=tn([u,y.pathnameBase]))}return m}function yo(n,l){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[s,i]=Z0(n.path,n.caseSensitive,n.end),o=l.match(s);if(!o)return null;let u=o[0],m=u.replace(/(.)\/+$/,"$1"),p=o.slice(1);return{params:i.reduce((h,{paramName:v,isOptional:y},_)=>{if(v==="*"){let N=p[_]||"";m=u.slice(0,u.length-N.length).replace(/(.)\/+$/,"$1")}const j=p[_];return y&&!j?h[v]=void 0:h[v]=(j||"").replace(/%2F/g,"/"),h},{}),pathname:u,pathnameBase:m,pattern:n}}function Z0(n,l=!1,s=!0){zt(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let i=[],o="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,p,g,h,v)=>{if(i.push({paramName:p,isOptional:g!=null}),g){let y=v.charAt(h+m.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(i.push({paramName:"*"}),o+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?o+="\\/*$":n!==""&&n!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,l?void 0:"i"),i]}function F0(n){try{return n.split("/").map(l=>decodeURIComponent(l).replace(/\//g,"%2F")).join("/")}catch(l){return zt(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${l}).`),n}}function Za(n,l){if(l==="/")return n;if(!n.toLowerCase().startsWith(l.toLowerCase()))return null;let s=l.endsWith("/")?l.length-1:l.length,i=n.charAt(s);return i&&i!=="/"?null:n.slice(s)||"/"}function J0({basename:n,pathname:l}){return l==="/"?n:tn([n,l])}var nx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vd=n=>nx.test(n);function P0(n,l="/"){let{pathname:s,search:i="",hash:o=""}=typeof n=="string"?Mn(n):n,u;return s?(s=s.replace(/\/\/+/g,"/"),s.startsWith("/")?u=Ip(s.substring(1),"/"):u=Ip(s,l)):u=l,{pathname:u,search:W0(i),hash:e1(o)}}function Ip(n,l){let s=l.replace(/\/+$/,"").split("/");return n.split("/").forEach(o=>{o===".."?s.length>1&&s.pop():o!=="."&&s.push(o)}),s.length>1?s.join("/"):"/"}function Qu(n,l,s,i){return`Cannot include a '${n}' character in a manually specified \`to.${l}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function lx(n){return n.filter((l,s)=>s===0||l.route.path&&l.route.path.length>0)}function So(n){let l=lx(n);return l.map((s,i)=>i===l.length-1?s.pathname:s.pathnameBase)}function $s(n,l,s,i=!1){let o;typeof n=="string"?o=Mn(n):(o={...n},qe(!o.pathname||!o.pathname.includes("?"),Qu("?","pathname","search",o)),qe(!o.pathname||!o.pathname.includes("#"),Qu("#","pathname","hash",o)),qe(!o.search||!o.search.includes("#"),Qu("#","search","hash",o)));let u=n===""||o.pathname==="",m=u?"/":o.pathname,p;if(m==null)p=s;else{let y=l.length-1;if(!i&&m.startsWith("..")){let _=m.split("/");for(;_[0]==="..";)_.shift(),y-=1;o.pathname=_.join("/")}p=y>=0?l[y]:"/"}let g=P0(o,p),h=m&&m!=="/"&&m.endsWith("/"),v=(u||m===".")&&s.endsWith("/");return!g.pathname.endsWith("/")&&(h||v)&&(g.pathname+="/"),g}var tn=n=>n.join("/").replace(/\/\/+/g,"/"),I0=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),W0=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,e1=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,qs=class{constructor(n,l,s,i=!1){this.status=n,this.statusText=l||"",this.internal=i,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function Dr(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function Ys(n){return n.map(l=>l.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var rx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function sx(n,l){let s=n;if(typeof s!="string"||!nx.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let i=s,o=!1;if(rx)try{let u=new URL(window.location.href),m=s.startsWith("//")?new URL(u.protocol+s):new URL(s),p=Za(m.pathname,l);m.origin===u.origin&&p!=null?s=p+m.search+m.hash:o=!0}catch{zt(!1,`<Link to="${s}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:o,to:s}}var ol=Symbol("Uninstrumented");function t1(n,l){let s={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};n.forEach(o=>o({id:l.id,index:l.index,path:l.path,instrument(u){let m=Object.keys(s);for(let p of m)u[p]&&s[p].push(u[p])}}));let i={};if(typeof l.lazy=="function"&&s.lazy.length>0){let o=Tr(s.lazy,l.lazy,()=>{});o&&(i.lazy=o)}if(typeof l.lazy=="object"){let o=l.lazy;["middleware","loader","action"].forEach(u=>{let m=o[u],p=s[`lazy.${u}`];if(typeof m=="function"&&p.length>0){let g=Tr(p,m,()=>{});g&&(i.lazy=Object.assign(i.lazy||{},{[u]:g}))}})}return["loader","action"].forEach(o=>{let u=l[o];if(typeof u=="function"&&s[o].length>0){let m=u[ol]??u,p=Tr(s[o],m,(...g)=>Wp(g[0]));p&&(o==="loader"&&m.hydrate===!0&&(p.hydrate=!0),p[ol]=m,i[o]=p)}}),l.middleware&&l.middleware.length>0&&s.middleware.length>0&&(i.middleware=l.middleware.map(o=>{let u=o[ol]??o,m=Tr(s.middleware,u,(...p)=>Wp(p[0]));return m?(m[ol]=u,m):o})),i}function a1(n,l){let s={navigate:[],fetch:[]};if(l.forEach(i=>i({instrument(o){let u=Object.keys(o);for(let m of u)o[m]&&s[m].push(o[m])}})),s.navigate.length>0){let i=n.navigate[ol]??n.navigate,o=Tr(s.navigate,i,(...u)=>{let[m,p]=u;return{to:typeof m=="number"||typeof m=="string"?m:m?mn(m):".",...eg(n,p??{})}});o&&(o[ol]=i,n.navigate=o)}if(s.fetch.length>0){let i=n.fetch[ol]??n.fetch,o=Tr(s.fetch,i,(...u)=>{let[m,,p,g]=u;return{href:p??".",fetcherKey:m,...eg(n,g??{})}});o&&(o[ol]=i,n.fetch=o)}return n}function Tr(n,l,s){return n.length===0?null:async(...i)=>{let o=await ix(n,s(...i),()=>l(...i),n.length-1);if(o.type==="error")throw o.value;return o.value}}async function ix(n,l,s,i){let o=n[i],u;if(o){let m,p=async()=>(m?console.error("You cannot call instrumented handlers more than once"):m=ix(n,l,s,i-1),u=await m,qe(u,"Expected a result"),u.type==="error"&&u.value instanceof Error?{status:"error",error:u.value}:{status:"success",error:void 0});try{await o(p,l)}catch(g){console.error("An instrumentation function threw an error:",g)}m||await p(),await m}else try{u={type:"success",value:await s()}}catch(m){u={type:"error",value:m}}return u||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Wp(n){let{request:l,context:s,params:i,unstable_pattern:o}=n;return{request:n1(l),params:{...i},unstable_pattern:o,context:l1(s)}}function eg(n,l){return{currentUrl:mn(n.state.location),..."formMethod"in l?{formMethod:l.formMethod}:{},..."formEncType"in l?{formEncType:l.formEncType}:{},..."formData"in l?{formData:l.formData}:{},..."body"in l?{body:l.body}:{}}}function n1(n){return{method:n.method,url:n.url,headers:{get:(...l)=>n.headers.get(...l)}}}function l1(n){if(s1(n)){let l={...n};return Object.freeze(l),l}else return{get:l=>n.get(l)}}var r1=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function s1(n){if(n===null||typeof n!="object")return!1;const l=Object.getPrototypeOf(n);return l===Object.prototype||l===null||Object.getOwnPropertyNames(l).sort().join("\0")===r1}var ox=["POST","PUT","PATCH","DELETE"],i1=new Set(ox),o1=["GET",...ox],c1=new Set(o1),cx=new Set([301,302,303,307,308]),u1=new Set([307,308]),Zu={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},d1={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},f1=n=>({hasErrorBoundary:!!n.hasErrorBoundary}),ux="remix-router-transitions",dx=Symbol("ResetLoaderData");function m1(n){const l=n.window?n.window:typeof window<"u"?window:void 0,s=typeof l<"u"&&typeof l.document<"u"&&typeof l.document.createElement<"u";qe(n.routes.length>0,"You must provide a non-empty routes array to createRouter");let i=n.hydrationRouteProperties||[],o=n.mapRouteProperties||f1,u=o;if(n.unstable_instrumentations){let C=n.unstable_instrumentations;u=O=>({...o(O),...t1(C.map(B=>B.route).filter(Boolean),O)})}let m={},p=Us(n.routes,u,void 0,m),g,h=n.basename||"/";h.startsWith("/")||(h=`/${h}`);let v=n.dataStrategy||y1,y={...n.future},_=null,j=new Set,N=null,T=null,D=null,Y=n.hydrationData!=null,Z=rl(p,n.history.location,h),G=!1,V=null,Q,ae;if(Z==null&&!n.patchRoutesOnNavigation){let C=Xa(404,{pathname:n.history.location.pathname}),{matches:O,route:B}=lo(p);Q=!0,ae=!Q,Z=O,V={[B.id]:C}}else if(Z&&!n.hydrationData&&La(Z,p,n.history.location.pathname).active&&(Z=null),Z)if(Z.some(C=>C.route.lazy))Q=!1,ae=!Q;else if(!Z.some(C=>Sd(C.route)))Q=!0,ae=!Q;else{let C=n.hydrationData?n.hydrationData.loaderData:null,O=n.hydrationData?n.hydrationData.errors:null,B=Z;if(O){let ne=Z.findIndex(se=>O[se.route.id]!==void 0);B=B.slice(0,ne+1)}ae=!1,Q=B.every(ne=>{let se=fx(ne.route,C,O);return ae=ae||se.renderFallback,!se.shouldLoad})}else{Q=!1,ae=!Q,Z=[];let C=La(null,p,n.history.location.pathname);C.active&&C.matches&&(G=!0,Z=C.matches)}let W,w={historyAction:n.history.action,location:n.history.location,matches:Z,initialized:Q,renderFallback:ae,navigation:Zu,restoreScrollPosition:n.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:n.hydrationData&&n.hydrationData.loaderData||{},actionData:n.hydrationData&&n.hydrationData.actionData||null,errors:n.hydrationData&&n.hydrationData.errors||V,fetchers:new Map,blockers:new Map},$="POP",te=null,fe=!1,oe,re=!1,de=new Map,pe=null,k=!1,P=!1,J=new Set,ce=new Map,Se=0,E=-1,U=new Map,ee=new Set,le=new Map,be=new Map,Ne=new Set,ze=new Map,Pe,Qe=null;function It(){if(_=n.history.listen(({action:C,location:O,delta:B})=>{if(Pe){Pe(),Pe=void 0;return}zt(ze.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=Ae({currentLocation:w.location,nextLocation:O,historyAction:C});if(ne&&B!=null){let se=new Promise(xe=>{Pe=xe});n.history.go(B*-1),ie(ne,{state:"blocked",location:O,proceed(){ie(ne,{state:"proceeding",proceed:void 0,reset:void 0,location:O}),se.then(()=>n.history.go(B))},reset(){let xe=new Map(w.blockers);xe.set(ne,Es),tt({blockers:xe})}}),te?.resolve(),te=null;return}return Wt(C,O)}),s){L1(l,de);let C=()=>U1(l,de);l.addEventListener("pagehide",C),pe=()=>l.removeEventListener("pagehide",C)}return w.initialized||Wt("POP",w.location,{initialHydration:!0}),W}function fa(){_&&_(),pe&&pe(),j.clear(),oe&&oe.abort(),w.fetchers.forEach((C,O)=>ia(O)),w.blockers.forEach((C,O)=>K(O))}function Ze(C){return j.add(C),()=>j.delete(C)}function tt(C,O={}){C.matches&&(C.matches=C.matches.map(se=>{let xe=m[se.route.id],ue=se.route;return ue.element!==xe.element||ue.errorElement!==xe.errorElement||ue.hydrateFallbackElement!==xe.hydrateFallbackElement?{...se,route:xe}:se})),w={...w,...C};let B=[],ne=[];w.fetchers.forEach((se,xe)=>{se.state==="idle"&&(Ne.has(xe)?B.push(xe):ne.push(xe))}),Ne.forEach(se=>{!w.fetchers.has(se)&&!ce.has(se)&&B.push(se)}),[...j].forEach(se=>se(w,{deletedFetchers:B,newErrors:C.errors??null,viewTransitionOpts:O.viewTransitionOpts,flushSync:O.flushSync===!0})),B.forEach(se=>ia(se)),ne.forEach(se=>w.fetchers.delete(se))}function dt(C,O,{flushSync:B}={}){let ne=w.actionData!=null&&w.navigation.formMethod!=null&&aa(w.navigation.formMethod)&&w.navigation.state==="loading"&&C.state?._isRedirect!==!0,se;O.actionData?Object.keys(O.actionData).length>0?se=O.actionData:se=null:ne?se=w.actionData:se=null;let xe=O.loaderData?ug(w.loaderData,O.loaderData,O.matches||[],O.errors):w.loaderData,ue=w.blockers;ue.size>0&&(ue=new Map(ue),ue.forEach((Ce,je)=>ue.set(je,Es)));let me=k?!1:oa(C,O.matches||w.matches),he=fe===!0||w.navigation.formMethod!=null&&aa(w.navigation.formMethod)&&C.state?._isRedirect!==!0;g&&(p=g,g=void 0),k||$==="POP"||($==="PUSH"?n.history.push(C,C.state):$==="REPLACE"&&n.history.replace(C,C.state));let we;if($==="POP"){let Ce=de.get(w.location.pathname);Ce&&Ce.has(C.pathname)?we={currentLocation:w.location,nextLocation:C}:de.has(C.pathname)&&(we={currentLocation:C,nextLocation:w.location})}else if(re){let Ce=de.get(w.location.pathname);Ce?Ce.add(C.pathname):(Ce=new Set([C.pathname]),de.set(w.location.pathname,Ce)),we={currentLocation:w.location,nextLocation:C}}tt({...O,actionData:se,loaderData:xe,historyAction:$,location:C,initialized:!0,renderFallback:!1,navigation:Zu,revalidation:"idle",restoreScrollPosition:me,preventScrollReset:he,blockers:ue},{viewTransitionOpts:we,flushSync:B===!0}),$="POP",fe=!1,re=!1,k=!1,P=!1,te?.resolve(),te=null,Qe?.resolve(),Qe=null}async function $t(C,O){if(te?.resolve(),te=null,typeof C=="number"){te||(te=hg());let ft=te.promise;return n.history.go(C),ft}let B=cd(w.location,w.matches,h,C,O?.fromRouteId,O?.relative),{path:ne,submission:se,error:xe}=tg(!1,B,O),ue;O?.unstable_mask&&(ue={pathname:"",search:"",hash:"",...typeof O.unstable_mask=="string"?Mn(O.unstable_mask):{...w.location.unstable_mask,...O.unstable_mask}});let me=w.location,he=Ls(me,ne,O&&O.state,void 0,ue);he={...he,...n.history.encodeLocation(he)};let we=O&&O.replace!=null?O.replace:void 0,Ce="PUSH";we===!0?Ce="REPLACE":we===!1||se!=null&&aa(se.formMethod)&&se.formAction===w.location.pathname+w.location.search&&(Ce="REPLACE");let je=O&&"preventScrollReset"in O?O.preventScrollReset===!0:void 0,at=(O&&O.flushSync)===!0,Ye=Ae({currentLocation:me,nextLocation:he,historyAction:Ce});if(Ye){ie(Ye,{state:"blocked",location:he,proceed(){ie(Ye,{state:"proceeding",proceed:void 0,reset:void 0,location:he}),$t(C,O)},reset(){let ft=new Map(w.blockers);ft.set(Ye,Es),tt({blockers:ft})}});return}await Wt(Ce,he,{submission:se,pendingError:xe,preventScrollReset:je,replace:O&&O.replace,enableViewTransition:O&&O.viewTransition,flushSync:at,callSiteDefaultShouldRevalidate:O&&O.unstable_defaultShouldRevalidate})}function Gt(){Qe||(Qe=hg()),Ve(),tt({revalidation:"loading"});let C=Qe.promise;return w.navigation.state==="submitting"?C:w.navigation.state==="idle"?(Wt(w.historyAction,w.location,{startUninterruptedRevalidation:!0}),C):(Wt($||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:re===!0}),C)}async function Wt(C,O,B){oe&&oe.abort(),oe=null,$=C,k=(B&&B.startUninterruptedRevalidation)===!0,ja(w.location,w.matches),fe=(B&&B.preventScrollReset)===!0,re=(B&&B.enableViewTransition)===!0;let ne=g||p,se=B&&B.overrideNavigation,xe=B?.initialHydration&&w.matches&&w.matches.length>0&&!G?w.matches:rl(ne,O,h),ue=(B&&B.flushSync)===!0;if(xe&&w.initialized&&!P&&E1(w.location,O)&&!(B&&B.submission&&aa(B.submission.formMethod))){dt(O,{matches:xe},{flushSync:ue});return}let me=La(xe,ne,O.pathname);if(me.active&&me.matches&&(xe=me.matches),!xe){let{error:gt,notFoundMatches:Ct,route:et}=$e(O.pathname);dt(O,{matches:Ct,loaderData:{},errors:{[et.id]:gt}},{flushSync:ue});return}oe=new AbortController;let he=Cr(n.history,O,oe.signal,B&&B.submission),we=n.getContext?await n.getContext():new Fp,Ce;if(B&&B.pendingError)Ce=[sl(xe).route.id,{type:"error",error:B.pendingError}];else if(B&&B.submission&&aa(B.submission.formMethod)){let gt=await na(he,O,B.submission,xe,we,me.active,B&&B.initialHydration===!0,{replace:B.replace,flushSync:ue});if(gt.shortCircuited)return;if(gt.pendingActionResult){let[Ct,et]=gt.pendingActionResult;if(Da(et)&&Dr(et.error)&&et.error.status===404){oe=null,dt(O,{matches:gt.matches,loaderData:{},errors:{[Ct]:et.error}});return}}xe=gt.matches||xe,Ce=gt.pendingActionResult,se=Fu(O,B.submission),ue=!1,me.active=!1,he=Cr(n.history,he.url,he.signal)}let{shortCircuited:je,matches:at,loaderData:Ye,errors:ft}=await va(he,O,xe,we,me.active,se,B&&B.submission,B&&B.fetcherSubmission,B&&B.replace,B&&B.initialHydration===!0,ue,Ce,B&&B.callSiteDefaultShouldRevalidate);je||(oe=null,dt(O,{matches:at||xe,...dg(Ce),loaderData:Ye,errors:ft}))}async function na(C,O,B,ne,se,xe,ue,me={}){Ve();let he=k1(O,B);if(tt({navigation:he},{flushSync:me.flushSync===!0}),xe){let je=await Na(ne,O.pathname,C.signal);if(je.type==="aborted")return{shortCircuited:!0};if(je.type==="error"){if(je.partialMatches.length===0){let{matches:Ye,route:ft}=lo(p);return{matches:Ye,pendingActionResult:[ft.id,{type:"error",error:je.error}]}}let at=sl(je.partialMatches).route.id;return{matches:je.partialMatches,pendingActionResult:[at,{type:"error",error:je.error}]}}else if(je.matches)ne=je.matches;else{let{notFoundMatches:at,error:Ye,route:ft}=$e(O.pathname);return{matches:at,pendingActionResult:[ft.id,{type:"error",error:Ye}]}}}let we,Ce=fo(ne,O);if(!Ce.route.action&&!Ce.route.lazy)we={type:"error",error:Xa(405,{method:C.method,pathname:O.pathname,routeId:Ce.route.id})};else{let je=zr(u,m,C,ne,Ce,ue?[]:i,se),at=await ge(C,je,se,null);if(we=at[Ce.route.id],!we){for(let Ye of ne)if(at[Ye.route.id]){we=at[Ye.route.id];break}}if(C.signal.aborted)return{shortCircuited:!0}}if(Ol(we)){let je;return me&&me.replace!=null?je=me.replace:je=ig(we.response.headers.get("Location"),new URL(C.url),h,n.history)===w.location.pathname+w.location.search,await sa(C,we,!0,{submission:B,replace:je}),{shortCircuited:!0}}if(Da(we)){let je=sl(ne,Ce.route.id);return(me&&me.replace)!==!0&&($="PUSH"),{matches:ne,pendingActionResult:[je.route.id,we,Ce.route.id]}}return{matches:ne,pendingActionResult:[Ce.route.id,we]}}async function va(C,O,B,ne,se,xe,ue,me,he,we,Ce,je,at){let Ye=xe||Fu(O,ue),ft=ue||me||mg(Ye),gt=!k&&!we;if(se){if(gt){let Ot=Sa(je);tt({navigation:Ye,...Ot!==void 0?{actionData:Ot}:{}},{flushSync:Ce})}let Ge=await Na(B,O.pathname,C.signal);if(Ge.type==="aborted")return{shortCircuited:!0};if(Ge.type==="error"){if(Ge.partialMatches.length===0){let{matches:ea,route:At}=lo(p);return{matches:ea,loaderData:{},errors:{[At.id]:Ge.error}}}let Ot=sl(Ge.partialMatches).route.id;return{matches:Ge.partialMatches,loaderData:{},errors:{[Ot]:Ge.error}}}else if(Ge.matches)B=Ge.matches;else{let{error:Ot,notFoundMatches:ea,route:At}=$e(O.pathname);return{matches:ea,loaderData:{},errors:{[At.id]:Ot}}}}let Ct=g||p,{dsMatches:et,revalidatingFetchers:qt}=ag(C,ne,u,m,n.history,w,B,ft,O,we?[]:i,we===!0,P,J,Ne,le,ee,Ct,h,n.patchRoutesOnNavigation!=null,je,at);if(E=++Se,!n.dataStrategy&&!et.some(Ge=>Ge.shouldLoad)&&!et.some(Ge=>Ge.route.middleware&&Ge.route.middleware.length>0)&&qt.length===0){let Ge=_e();return dt(O,{matches:B,loaderData:{},errors:je&&Da(je[1])?{[je[0]]:je[1].error}:null,...dg(je),...Ge?{fetchers:new Map(w.fetchers)}:{}},{flushSync:Ce}),{shortCircuited:!0}}if(gt){let Ge={};if(!se){Ge.navigation=Ye;let Ot=Sa(je);Ot!==void 0&&(Ge.actionData=Ot)}qt.length>0&&(Ge.fetchers=Aa(qt)),tt(Ge,{flushSync:Ce})}qt.forEach(Ge=>{wt(Ge.key),Ge.controller&&ce.set(Ge.key,Ge.controller)});let pt=()=>qt.forEach(Ge=>wt(Ge.key));oe&&oe.signal.addEventListener("abort",pt);let{loaderResults:An,fetcherResults:Pa}=await ke(et,qt,C,ne);if(C.signal.aborted)return{shortCircuited:!0};oe&&oe.signal.removeEventListener("abort",pt),qt.forEach(Ge=>ce.delete(Ge.key));let Vt=ro(An);if(Vt)return await sa(C,Vt.result,!0,{replace:he}),{shortCircuited:!0};if(Vt=ro(Pa),Vt)return ee.add(Vt.key),await sa(C,Vt.result,!0,{replace:he}),{shortCircuited:!0};let{loaderData:ln,errors:fl}=cg(w,B,An,je,qt,Pa);we&&w.errors&&(fl={...w.errors,...fl});let rn=_e(),ml=He(E),Yl=rn||ml||qt.length>0;return{matches:B,loaderData:ln,errors:fl,...Yl?{fetchers:new Map(w.fetchers)}:{}}}function Sa(C){if(C&&!Da(C[1]))return{[C[0]]:C[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function Aa(C){return C.forEach(O=>{let B=w.fetchers.get(O.key),ne=Cs(void 0,B?B.data:void 0);w.fetchers.set(O.key,ne)}),new Map(w.fetchers)}async function la(C,O,B,ne){wt(C);let se=(ne&&ne.flushSync)===!0,xe=g||p,ue=cd(w.location,w.matches,h,B,O,ne?.relative),me=rl(xe,ue,h),he=La(me,xe,ue);if(he.active&&he.matches&&(me=he.matches),!me){Nt(C,O,Xa(404,{pathname:ue}),{flushSync:se});return}let{path:we,submission:Ce,error:je}=tg(!0,ue,ne);if(je){Nt(C,O,je,{flushSync:se});return}let at=n.getContext?await n.getContext():new Fp,Ye=(ne&&ne.preventScrollReset)===!0;if(Ce&&aa(Ce.formMethod)){await ra(C,O,we,me,at,he.active,se,Ye,Ce,ne&&ne.unstable_defaultShouldRevalidate);return}le.set(C,{routeId:O,path:we}),await ht(C,O,we,me,at,he.active,se,Ye,Ce)}async function ra(C,O,B,ne,se,xe,ue,me,he,we){Ve(),le.delete(C);let Ce=w.fetchers.get(C);jt(C,A1(he,Ce),{flushSync:ue});let je=new AbortController,at=Cr(n.history,B,je.signal,he);if(xe){let xt=await Na(ne,new URL(at.url).pathname,at.signal,C);if(xt.type==="aborted")return;if(xt.type==="error"){Nt(C,O,xt.error,{flushSync:ue});return}else if(xt.matches)ne=xt.matches;else{Nt(C,O,Xa(404,{pathname:B}),{flushSync:ue});return}}let Ye=fo(ne,B);if(!Ye.route.action&&!Ye.route.lazy){let xt=Xa(405,{method:he.formMethod,pathname:B,routeId:O});Nt(C,O,xt,{flushSync:ue});return}ce.set(C,je);let ft=Se,gt=zr(u,m,at,ne,Ye,i,se),Ct=await ge(at,gt,se,C),et=Ct[Ye.route.id];if(!et){for(let xt of gt)if(Ct[xt.route.id]){et=Ct[xt.route.id];break}}if(at.signal.aborted){ce.get(C)===je&&ce.delete(C);return}if(Ne.has(C)){if(Ol(et)||Da(et)){jt(C,On(void 0));return}}else{if(Ol(et))if(ce.delete(C),E>ft){jt(C,On(void 0));return}else return ee.add(C),jt(C,Cs(he)),sa(at,et,!1,{fetcherSubmission:he,preventScrollReset:me});if(Da(et)){Nt(C,O,et.error);return}}let qt=w.navigation.location||w.location,pt=Cr(n.history,qt,je.signal),An=g||p,Pa=w.navigation.state!=="idle"?rl(An,w.navigation.location,h):w.matches;qe(Pa,"Didn't find any matches after fetcher action");let Vt=++Se;U.set(C,Vt);let ln=Cs(he,et.data);w.fetchers.set(C,ln);let{dsMatches:fl,revalidatingFetchers:rn}=ag(pt,se,u,m,n.history,w,Pa,he,qt,i,!1,P,J,Ne,le,ee,An,h,n.patchRoutesOnNavigation!=null,[Ye.route.id,et],we);rn.filter(xt=>xt.key!==C).forEach(xt=>{let Gl=xt.key,Vl=w.fetchers.get(Gl),Xs=Cs(void 0,Vl?Vl.data:void 0);w.fetchers.set(Gl,Xs),wt(Gl),xt.controller&&ce.set(Gl,xt.controller)}),tt({fetchers:new Map(w.fetchers)});let ml=()=>rn.forEach(xt=>wt(xt.key));je.signal.addEventListener("abort",ml);let{loaderResults:Yl,fetcherResults:Ge}=await ke(fl,rn,pt,se);if(je.signal.aborted)return;if(je.signal.removeEventListener("abort",ml),U.delete(C),ce.delete(C),rn.forEach(xt=>ce.delete(xt.key)),w.fetchers.has(C)){let xt=On(et.data);w.fetchers.set(C,xt)}let Ot=ro(Yl);if(Ot)return sa(pt,Ot.result,!1,{preventScrollReset:me});if(Ot=ro(Ge),Ot)return ee.add(Ot.key),sa(pt,Ot.result,!1,{preventScrollReset:me});let{loaderData:ea,errors:At}=cg(w,Pa,Yl,void 0,rn,Ge);He(Vt),w.navigation.state==="loading"&&Vt>E?(qe($,"Expected pending action"),oe&&oe.abort(),dt(w.navigation.location,{matches:Pa,loaderData:ea,errors:At,fetchers:new Map(w.fetchers)})):(tt({errors:At,loaderData:ug(w.loaderData,ea,Pa,At),fetchers:new Map(w.fetchers)}),P=!1)}async function ht(C,O,B,ne,se,xe,ue,me,he){let we=w.fetchers.get(C);jt(C,Cs(he,we?we.data:void 0),{flushSync:ue});let Ce=new AbortController,je=Cr(n.history,B,Ce.signal);if(xe){let et=await Na(ne,new URL(je.url).pathname,je.signal,C);if(et.type==="aborted")return;if(et.type==="error"){Nt(C,O,et.error,{flushSync:ue});return}else if(et.matches)ne=et.matches;else{Nt(C,O,Xa(404,{pathname:B}),{flushSync:ue});return}}let at=fo(ne,B);ce.set(C,Ce);let Ye=Se,ft=zr(u,m,je,ne,at,i,se),Ct=(await ge(je,ft,se,C))[at.route.id];if(ce.get(C)===Ce&&ce.delete(C),!je.signal.aborted){if(Ne.has(C)){jt(C,On(void 0));return}if(Ol(Ct))if(E>Ye){jt(C,On(void 0));return}else{ee.add(C),await sa(je,Ct,!1,{preventScrollReset:me});return}if(Da(Ct)){Nt(C,O,Ct.error);return}jt(C,On(Ct.data))}}async function sa(C,O,B,{submission:ne,fetcherSubmission:se,preventScrollReset:xe,replace:ue}={}){B||(te?.resolve(),te=null),O.response.headers.has("X-Remix-Revalidate")&&(P=!0);let me=O.response.headers.get("Location");qe(me,"Expected a Location header on the redirect Response"),me=ig(me,new URL(C.url),h,n.history);let he=Ls(w.location,me,{_isRedirect:!0});if(s){let ft=!1;if(O.response.headers.has("X-Remix-Reload-Document"))ft=!0;else if(vd(me)){const gt=ex(me,!0);ft=gt.origin!==l.location.origin||Za(gt.pathname,h)==null}if(ft){ue?l.location.replace(me):l.location.assign(me);return}}oe=null;let we=ue===!0||O.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ce,formAction:je,formEncType:at}=w.navigation;!ne&&!se&&Ce&&je&&at&&(ne=mg(w.navigation));let Ye=ne||se;if(u1.has(O.response.status)&&Ye&&aa(Ye.formMethod))await Wt(we,he,{submission:{...Ye,formAction:me},preventScrollReset:xe||fe,enableViewTransition:B?re:void 0});else{let ft=Fu(he,ne);await Wt(we,he,{overrideNavigation:ft,fetcherSubmission:se,preventScrollReset:xe||fe,enableViewTransition:B?re:void 0})}}async function ge(C,O,B,ne){let se,xe={};try{se=await v1(v,C,O,ne,B,!1)}catch(ue){return O.filter(me=>me.shouldLoad).forEach(me=>{xe[me.route.id]={type:"error",error:ue}}),xe}if(C.signal.aborted)return xe;if(!aa(C.method))for(let ue of O){if(se[ue.route.id]?.type==="error")break;!se.hasOwnProperty(ue.route.id)&&!w.loaderData.hasOwnProperty(ue.route.id)&&(!w.errors||!w.errors.hasOwnProperty(ue.route.id))&&ue.shouldCallHandler()&&(se[ue.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${ue.route.id}`)})}for(let[ue,me]of Object.entries(se))if(z1(me)){let he=me.result;xe[ue]={type:"redirect",response:N1(he,C,ue,O,h)}}else xe[ue]=await j1(me);return xe}async function ke(C,O,B,ne){let se=ge(B,C,ne,null),xe=Promise.all(O.map(async he=>{if(he.matches&&he.match&&he.request&&he.controller){let Ce=(await ge(he.request,he.matches,ne,he.key))[he.match.route.id];return{[he.key]:Ce}}else return Promise.resolve({[he.key]:{type:"error",error:Xa(404,{pathname:he.path})}})})),ue=await se,me=(await xe).reduce((he,we)=>Object.assign(he,we),{});return{loaderResults:ue,fetcherResults:me}}function Ve(){P=!0,le.forEach((C,O)=>{ce.has(O)&&J.add(O),wt(O)})}function jt(C,O,B={}){w.fetchers.set(C,O),tt({fetchers:new Map(w.fetchers)},{flushSync:(B&&B.flushSync)===!0})}function Nt(C,O,B,ne={}){let se=sl(w.matches,O);ia(C),tt({errors:{[se.route.id]:B},fetchers:new Map(w.fetchers)},{flushSync:(ne&&ne.flushSync)===!0})}function Xt(C){return be.set(C,(be.get(C)||0)+1),Ne.has(C)&&Ne.delete(C),w.fetchers.get(C)||d1}function _a(C,O){wt(C,O?.reason),jt(C,On(null))}function ia(C){let O=w.fetchers.get(C);ce.has(C)&&!(O&&O.state==="loading"&&U.has(C))&&wt(C),le.delete(C),U.delete(C),ee.delete(C),Ne.delete(C),J.delete(C),w.fetchers.delete(C)}function _t(C){let O=(be.get(C)||0)-1;O<=0?(be.delete(C),Ne.add(C)):be.set(C,O),tt({fetchers:new Map(w.fetchers)})}function wt(C,O){let B=ce.get(C);B&&(B.abort(O),ce.delete(C))}function kt(C){for(let O of C){let B=Xt(O),ne=On(B.data);w.fetchers.set(O,ne)}}function _e(){let C=[],O=!1;for(let B of ee){let ne=w.fetchers.get(B);qe(ne,`Expected fetcher: ${B}`),ne.state==="loading"&&(ee.delete(B),C.push(B),O=!0)}return kt(C),O}function He(C){let O=[];for(let[B,ne]of U)if(ne<C){let se=w.fetchers.get(B);qe(se,`Expected fetcher: ${B}`),se.state==="loading"&&(wt(B),U.delete(B),O.push(B))}return kt(O),O.length>0}function Ie(C,O){let B=w.blockers.get(C)||Es;return ze.get(C)!==O&&ze.set(C,O),B}function K(C){w.blockers.delete(C),ze.delete(C)}function ie(C,O){let B=w.blockers.get(C)||Es;qe(B.state==="unblocked"&&O.state==="blocked"||B.state==="blocked"&&O.state==="blocked"||B.state==="blocked"&&O.state==="proceeding"||B.state==="blocked"&&O.state==="unblocked"||B.state==="proceeding"&&O.state==="unblocked",`Invalid blocker state transition: ${B.state} -> ${O.state}`);let ne=new Map(w.blockers);ne.set(C,O),tt({blockers:ne})}function Ae({currentLocation:C,nextLocation:O,historyAction:B}){if(ze.size===0)return;ze.size>1&&zt(!1,"A router only supports one blocker at a time");let ne=Array.from(ze.entries()),[se,xe]=ne[ne.length-1],ue=w.blockers.get(se);if(!(ue&&ue.state==="proceeding")&&xe({currentLocation:C,nextLocation:O,historyAction:B}))return se}function $e(C){let O=Xa(404,{pathname:C}),B=g||p,{matches:ne,route:se}=lo(B);return{notFoundMatches:ne,route:se,error:O}}function Le(C,O,B){if(N=C,D=O,T=B||null,!Y&&w.navigation===Zu){Y=!0;let ne=oa(w.location,w.matches);ne!=null&&tt({restoreScrollPosition:ne})}return()=>{N=null,D=null,T=null}}function Et(C,O){return T&&T(C,O.map(ne=>U0(ne,w.loaderData)))||C.key}function ja(C,O){if(N&&D){let B=Et(C,O);N[B]=D()}}function oa(C,O){if(N){let B=Et(C,O),ne=N[B];if(typeof ne=="number")return ne}return null}function La(C,O,B){if(n.patchRoutesOnNavigation)if(C){if(Object.keys(C[0].params).length>0)return{active:!0,matches:zs(O,B,h,!0)}}else return{active:!0,matches:zs(O,B,h,!0)||[]};return{active:!1,matches:null}}async function Na(C,O,B,ne){if(!n.patchRoutesOnNavigation)return{type:"success",matches:C};let se=C;for(;;){let xe=g==null,ue=g||p,me=m;try{await n.patchRoutesOnNavigation({signal:B,path:O,matches:se,fetcherKey:ne,patch:(Ce,je)=>{B.aborted||ng(Ce,je,ue,me,u,!1)}})}catch(Ce){return{type:"error",error:Ce,partialMatches:se}}finally{xe&&!B.aborted&&(p=[...p])}if(B.aborted)return{type:"aborted"};let he=rl(ue,O,h),we=null;if(he){if(Object.keys(he[0].params).length===0)return{type:"success",matches:he};if(we=zs(ue,O,h,!0),!(we&&se.length<we.length&&dl(se,we.slice(0,se.length))))return{type:"success",matches:he}}if(we||(we=zs(ue,O,h,!0)),!we||dl(se,we))return{type:"success",matches:null};se=we}}function dl(C,O){return C.length===O.length&&C.every((B,ne)=>B.route.id===O[ne].route.id)}function $l(C){m={},g=Us(C,u,void 0,m)}function ql(C,O,B=!1){let ne=g==null;ng(C,O,g||p,m,u,B),ne&&(p=[...p],tt({}))}return W={get basename(){return h},get future(){return y},get state(){return w},get routes(){return p},get window(){return l},initialize:It,subscribe:Ze,enableScrollRestoration:Le,navigate:$t,fetch:la,revalidate:Gt,createHref:C=>n.history.createHref(C),encodeLocation:C=>n.history.encodeLocation(C),getFetcher:Xt,resetFetcher:_a,deleteFetcher:_t,dispose:fa,getBlocker:Ie,deleteBlocker:K,patchRoutes:ql,_internalFetchControllers:ce,_internalSetRoutes:$l,_internalSetStateDoNotUseOrYouWillBreakYourApp(C){tt(C)}},n.unstable_instrumentations&&(W=a1(W,n.unstable_instrumentations.map(C=>C.router).filter(Boolean))),W}function h1(n){return n!=null&&("formData"in n&&n.formData!=null||"body"in n&&n.body!==void 0)}function cd(n,l,s,i,o,u){let m,p;if(o){m=[];for(let h of l)if(m.push(h),h.route.id===o){p=h;break}}else m=l,p=l[l.length-1];let g=$s(i||".",So(m),Za(n.pathname,s)||n.pathname,u==="path");if(i==null&&(g.search=n.search,g.hash=n.hash),(i==null||i===""||i===".")&&p){let h=jd(g.search);if(p.route.index&&!h)g.search=g.search?g.search.replace(/^\?/,"?index&"):"?index";else if(!p.route.index&&h){let v=new URLSearchParams(g.search),y=v.getAll("index");v.delete("index"),y.filter(j=>j).forEach(j=>v.append("index",j));let _=v.toString();g.search=_?`?${_}`:""}}return s!=="/"&&(g.pathname=J0({basename:s,pathname:g.pathname})),mn(g)}function tg(n,l,s){if(!s||!h1(s))return{path:l};if(s.formMethod&&!M1(s.formMethod))return{path:l,error:Xa(405,{method:s.formMethod})};let i=()=>({path:l,error:Xa(400,{type:"invalid-body"})}),u=(s.formMethod||"get").toUpperCase(),m=yx(l);if(s.body!==void 0){if(s.formEncType==="text/plain"){if(!aa(u))return i();let y=typeof s.body=="string"?s.body:s.body instanceof FormData||s.body instanceof URLSearchParams?Array.from(s.body.entries()).reduce((_,[j,N])=>`${_}${j}=${N}
10
+ `,""):String(s.body);return{path:l,submission:{formMethod:u,formAction:m,formEncType:s.formEncType,formData:void 0,json:void 0,text:y}}}else if(s.formEncType==="application/json"){if(!aa(u))return i();try{let y=typeof s.body=="string"?JSON.parse(s.body):s.body;return{path:l,submission:{formMethod:u,formAction:m,formEncType:s.formEncType,formData:void 0,json:y,text:void 0}}}catch{return i()}}}qe(typeof FormData=="function","FormData is not available in this environment");let p,g;if(s.formData)p=dd(s.formData),g=s.formData;else if(s.body instanceof FormData)p=dd(s.body),g=s.body;else if(s.body instanceof URLSearchParams)p=s.body,g=og(p);else if(s.body==null)p=new URLSearchParams,g=new FormData;else try{p=new URLSearchParams(s.body),g=og(p)}catch{return i()}let h={formMethod:u,formAction:m,formEncType:s&&s.formEncType||"application/x-www-form-urlencoded",formData:g,json:void 0,text:void 0};if(aa(h.formMethod))return{path:l,submission:h};let v=Mn(l);return n&&v.search&&jd(v.search)&&p.append("index",""),v.search=`?${p}`,{path:mn(v),submission:h}}function ag(n,l,s,i,o,u,m,p,g,h,v,y,_,j,N,T,D,Y,Z,G,V){let Q=G?Da(G[1])?G[1].error:G[1].data:void 0,ae=o.createURL(u.location),W=o.createURL(g),w;if(v&&u.errors){let pe=Object.keys(u.errors)[0];w=m.findIndex(k=>k.route.id===pe)}else if(G&&Da(G[1])){let pe=G[0];w=m.findIndex(k=>k.route.id===pe)-1}let $=G?G[1].statusCode:void 0,te=$&&$>=400,fe={currentUrl:ae,currentParams:u.matches[0]?.params||{},nextUrl:W,nextParams:m[0].params,...p,actionResult:Q,actionStatus:$},oe=Ys(m),re=m.map((pe,k)=>{let{route:P}=pe,J=null;if(w!=null&&k>w)J=!1;else if(P.lazy)J=!0;else if(!Sd(P))J=!1;else if(v){let{shouldLoad:U}=fx(P,u.loaderData,u.errors);J=U}else p1(u.loaderData,u.matches[k],pe)&&(J=!0);if(J!==null)return ud(s,i,n,oe,pe,h,l,J);let ce=!1;typeof V=="boolean"?ce=V:te?ce=!1:(y||ae.pathname+ae.search===W.pathname+W.search||ae.search!==W.search||g1(u.matches[k],pe))&&(ce=!0);let Se={...fe,defaultShouldRevalidate:ce},E=ks(pe,Se);return ud(s,i,n,oe,pe,h,l,E,Se,V)}),de=[];return N.forEach((pe,k)=>{if(v||!m.some(le=>le.route.id===pe.routeId)||j.has(k))return;let P=u.fetchers.get(k),J=P&&P.state!=="idle"&&P.data===void 0,ce=rl(D,pe.path,Y);if(!ce){if(Z&&J)return;de.push({key:k,routeId:pe.routeId,path:pe.path,matches:null,match:null,request:null,controller:null});return}if(T.has(k))return;let Se=fo(ce,pe.path),E=new AbortController,U=Cr(o,pe.path,E.signal),ee=null;if(_.has(k))_.delete(k),ee=zr(s,i,U,ce,Se,h,l);else if(J)y&&(ee=zr(s,i,U,ce,Se,h,l));else{let le;typeof V=="boolean"?le=V:te?le=!1:le=y;let be={...fe,defaultShouldRevalidate:le};ks(Se,be)&&(ee=zr(s,i,U,ce,Se,h,l,be))}ee&&de.push({key:k,routeId:pe.routeId,path:pe.path,matches:ee,match:Se,request:U,controller:E})}),{dsMatches:re,revalidatingFetchers:de}}function Sd(n){return n.loader!=null||n.middleware!=null&&n.middleware.length>0}function fx(n,l,s){if(n.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Sd(n))return{shouldLoad:!1,renderFallback:!1};let i=l!=null&&n.id in l,o=s!=null&&s[n.id]!==void 0;if(!i&&o)return{shouldLoad:!1,renderFallback:!1};if(typeof n.loader=="function"&&n.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!i};let u=!i&&!o;return{shouldLoad:u,renderFallback:u}}function p1(n,l,s){let i=!l||s.route.id!==l.route.id,o=!n.hasOwnProperty(s.route.id);return i||o}function g1(n,l){let s=n.route.path;return n.pathname!==l.pathname||s!=null&&s.endsWith("*")&&n.params["*"]!==l.params["*"]}function ks(n,l){if(n.route.shouldRevalidate){let s=n.route.shouldRevalidate(l);if(typeof s=="boolean")return s}return l.defaultShouldRevalidate}function ng(n,l,s,i,o,u){let m;if(n){let h=i[n];qe(h,`No route found to patch children into: routeId = ${n}`),h.children||(h.children=[]),m=h.children}else m=s;let p=[],g=[];if(l.forEach(h=>{let v=m.find(y=>mx(h,y));v?g.push({existingRoute:v,newRoute:h}):p.push(h)}),p.length>0){let h=Us(p,o,[n||"_","patch",String(m?.length||"0")],i);m.push(...h)}if(u&&g.length>0)for(let h=0;h<g.length;h++){let{existingRoute:v,newRoute:y}=g[h],_=v,[j]=Us([y],o,[],{},!0);Object.assign(_,{element:j.element?j.element:_.element,errorElement:j.errorElement?j.errorElement:_.errorElement,hydrateFallbackElement:j.hydrateFallbackElement?j.hydrateFallbackElement:_.hydrateFallbackElement})}}function mx(n,l){return"id"in n&&"id"in l&&n.id===l.id?!0:n.index===l.index&&n.path===l.path&&n.caseSensitive===l.caseSensitive?(!n.children||n.children.length===0)&&(!l.children||l.children.length===0)?!0:n.children?.every((s,i)=>l.children?.some(o=>mx(s,o)))??!1:!1}var lg=new WeakMap,hx=({key:n,route:l,manifest:s,mapRouteProperties:i})=>{let o=s[l.id];if(qe(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let u=o.lazy[n];if(!u)return;let m=lg.get(o);m||(m={},lg.set(o,m));let p=m[n];if(p)return p;let g=(async()=>{let h=M0(n),y=o[n]!==void 0&&n!=="hasErrorBoundary";if(h)zt(!h,"Route property "+n+" is not a supported lazy route property. This property will be ignored."),m[n]=Promise.resolve();else if(y)zt(!1,`Route "${o.id}" has a static property "${n}" defined. The lazy property will be ignored.`);else{let _=await u();_!=null&&(Object.assign(o,{[n]:_}),Object.assign(o,i(o)))}typeof o.lazy=="object"&&(o.lazy[n]=void 0,Object.values(o.lazy).every(_=>_===void 0)&&(o.lazy=void 0))})();return m[n]=g,g},rg=new WeakMap;function x1(n,l,s,i,o){let u=s[n.id];if(qe(u,"No route found in manifest"),!n.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof n.lazy=="function"){let v=rg.get(u);if(v)return{lazyRoutePromise:v,lazyHandlerPromise:v};let y=(async()=>{qe(typeof n.lazy=="function","No lazy route function found");let _=await n.lazy(),j={};for(let N in _){let T=_[N];if(T===void 0)continue;let D=A0(N),Z=u[N]!==void 0&&N!=="hasErrorBoundary";D?zt(!D,"Route property "+N+" is not a supported property to be returned from a lazy route function. This property will be ignored."):Z?zt(!Z,`Route "${u.id}" has a static property "${N}" defined but its lazy function is also returning a value for this property. The lazy route property "${N}" will be ignored.`):j[N]=T}Object.assign(u,j),Object.assign(u,{...i(u),lazy:void 0})})();return rg.set(u,y),y.catch(()=>{}),{lazyRoutePromise:y,lazyHandlerPromise:y}}let m=Object.keys(n.lazy),p=[],g;for(let v of m){if(o&&o.includes(v))continue;let y=hx({key:v,route:n,manifest:s,mapRouteProperties:i});y&&(p.push(y),v===l&&(g=y))}let h=p.length>0?Promise.all(p).then(()=>{}):void 0;return h?.catch(()=>{}),g?.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:g}}async function sg(n){let l=n.matches.filter(o=>o.shouldLoad),s={};return(await Promise.all(l.map(o=>o.resolve()))).forEach((o,u)=>{s[l[u].route.id]=o}),s}async function y1(n){return n.matches.some(l=>l.route.middleware)?px(n,()=>sg(n)):sg(n)}function px(n,l){return b1(n,l,i=>{if(D1(i))throw i;return i},R1,s);function s(i,o,u){if(u)return Promise.resolve(Object.assign(u.value,{[o]:{type:"error",result:i}}));{let{matches:m}=n,p=Math.min(Math.max(m.findIndex(h=>h.route.id===o),0),Math.max(m.findIndex(h=>h.shouldCallHandler()),0)),g=sl(m,m[p].route.id).route.id;return Promise.resolve({[g]:{type:"error",result:i}})}}}async function b1(n,l,s,i,o){let{matches:u,request:m,params:p,context:g,unstable_pattern:h}=n,v=u.flatMap(_=>_.route.middleware?_.route.middleware.map(j=>[_.route.id,j]):[]);return await gx({request:m,params:p,context:g,unstable_pattern:h},v,l,s,i,o)}async function gx(n,l,s,i,o,u,m=0){let{request:p}=n;if(p.signal.aborted)throw p.signal.reason??new Error(`Request aborted: ${p.method} ${p.url}`);let g=l[m];if(!g)return await s();let[h,v]=g,y,_=async()=>{if(y)throw new Error("You may only call `next()` once per middleware");try{return y={value:await gx(n,l,s,i,o,u,m+1)},y.value}catch(j){return y={value:await u(j,h,y)},y.value}};try{let j=await v(n,_),N=j!=null?i(j):void 0;return o(N)?N:y?N??y.value:(y={value:await _()},y.value)}catch(j){return await u(j,h,y)}}function xx(n,l,s,i,o){let u=hx({key:"middleware",route:i.route,manifest:l,mapRouteProperties:n}),m=x1(i.route,aa(s.method)?"action":"loader",l,n,o);return{middleware:u,route:m.lazyRoutePromise,handler:m.lazyHandlerPromise}}function ud(n,l,s,i,o,u,m,p,g=null,h){let v=!1,y=xx(n,l,s,o,u);return{...o,_lazyPromises:y,shouldLoad:p,shouldRevalidateArgs:g,shouldCallHandler(_){return v=!0,g?typeof h=="boolean"?ks(o,{...g,defaultShouldRevalidate:h}):typeof _=="boolean"?ks(o,{...g,defaultShouldRevalidate:_}):ks(o,g):p},resolve(_){let{lazy:j,loader:N,middleware:T}=o.route,D=v||p||_&&!aa(s.method)&&(j||N),Y=T&&T.length>0&&!N&&!j;return D&&(aa(s.method)||!Y)?S1({request:s,unstable_pattern:i,match:o,lazyHandlerPromise:y?.handler,lazyRoutePromise:y?.route,handlerOverride:_,scopedContext:m}):Promise.resolve({type:"data",result:void 0})}}}function zr(n,l,s,i,o,u,m,p=null){return i.map(g=>g.route.id!==o.route.id?{...g,shouldLoad:!1,shouldRevalidateArgs:p,shouldCallHandler:()=>!1,_lazyPromises:xx(n,l,s,g,u),resolve:()=>Promise.resolve({type:"data",result:void 0})}:ud(n,l,s,Ys(i),g,u,m,!0,p))}async function v1(n,l,s,i,o,u){s.some(h=>h._lazyPromises?.middleware)&&await Promise.all(s.map(h=>h._lazyPromises?.middleware));let m={request:l,unstable_pattern:Ys(s),params:s[0].params,context:o,matches:s},g=await n({...m,fetcherKey:i,runClientMiddleware:h=>{let v=m;return px(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 S1({request:n,unstable_pattern:l,match:s,lazyHandlerPromise:i,lazyRoutePromise:o,handlerOverride:u,scopedContext:m}){let p,g,h=aa(n.method),v=h?"action":"loader",y=_=>{let j,N=new Promise((Y,Z)=>j=Z);g=()=>j(),n.signal.addEventListener("abort",g);let T=Y=>typeof _!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${v}" [routeId: ${s.route.id}]`)):_({request:n,unstable_pattern:l,params:s.params,context:m},...Y!==void 0?[Y]:[]),D=(async()=>{try{return{type:"data",result:await(u?u(Z=>T(Z)):T())}}catch(Y){return{type:"error",result:Y}}})();return Promise.race([D,N])};try{let _=h?s.route.action:s.route.loader;if(i||o)if(_){let j,[N]=await Promise.all([y(_).catch(T=>{j=T}),i,o]);if(j!==void 0)throw j;p=N}else{await i;let j=h?s.route.action:s.route.loader;if(j)[p]=await Promise.all([y(j),o]);else if(v==="action"){let N=new URL(n.url),T=N.pathname+N.search;throw Xa(405,{method:n.method,pathname:T,routeId:s.route.id})}else return{type:"data",result:void 0}}else if(_)p=await y(_);else{let j=new URL(n.url),N=j.pathname+j.search;throw Xa(404,{pathname:N})}}catch(_){return{type:"error",result:_}}finally{g&&n.signal.removeEventListener("abort",g)}return p}async function _1(n){let l=n.headers.get("Content-Type");return l&&/\bapplication\/json\b/.test(l)?n.body==null?null:n.json():n.text()}async function j1(n){let{result:l,type:s}=n;if(_d(l)){let i;try{i=await _1(l)}catch(o){return{type:"error",error:o}}return s==="error"?{type:"error",error:new qs(l.status,l.statusText,i),statusCode:l.status,headers:l.headers}:{type:"data",data:i,statusCode:l.status,headers:l.headers}}return s==="error"?fg(l)?l.data instanceof Error?{type:"error",error:l.data,statusCode:l.init?.status,headers:l.init?.headers?new Headers(l.init.headers):void 0}:{type:"error",error:C1(l),statusCode:Dr(l)?l.status:void 0,headers:l.init?.headers?new Headers(l.init.headers):void 0}:{type:"error",error:l,statusCode:Dr(l)?l.status:void 0}:fg(l)?{type:"data",data:l.data,statusCode:l.init?.status,headers:l.init?.headers?new Headers(l.init.headers):void 0}:{type:"data",data:l}}function N1(n,l,s,i,o){let u=n.headers.get("Location");if(qe(u,"Redirects returned/thrown from loaders/actions must have a Location header"),!vd(u)){let m=i.slice(0,i.findIndex(p=>p.route.id===s)+1);u=cd(new URL(l.url),m,o,u),n.headers.set("Location",u)}return n}function ig(n,l,s,i){let o=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(vd(n)){let u=n,m=u.startsWith("//")?new URL(l.protocol+u):new URL(u);if(o.includes(m.protocol))throw new Error("Invalid redirect location");let p=Za(m.pathname,s)!=null;if(m.origin===l.origin&&p)return m.pathname+m.search+m.hash}try{let u=i.createURL(n);if(o.includes(u.protocol))throw new Error("Invalid redirect location")}catch{}return n}function Cr(n,l,s,i){let o=n.createURL(yx(l)).toString(),u={signal:s};if(i&&aa(i.formMethod)){let{formMethod:m,formEncType:p}=i;u.method=m.toUpperCase(),p==="application/json"?(u.headers=new Headers({"Content-Type":p}),u.body=JSON.stringify(i.json)):p==="text/plain"?u.body=i.text:p==="application/x-www-form-urlencoded"&&i.formData?u.body=dd(i.formData):u.body=i.formData}return new Request(o,u)}function dd(n){let l=new URLSearchParams;for(let[s,i]of n.entries())l.append(s,typeof i=="string"?i:i.name);return l}function og(n){let l=new FormData;for(let[s,i]of n.entries())l.append(s,i);return l}function w1(n,l,s,i=!1,o=!1){let u={},m=null,p,g=!1,h={},v=s&&Da(s[1])?s[1].error:void 0;return n.forEach(y=>{if(!(y.route.id in l))return;let _=y.route.id,j=l[_];if(qe(!Ol(j),"Cannot handle redirect results in processLoaderData"),Da(j)){let N=j.error;if(v!==void 0&&(N=v,v=void 0),m=m||{},o)m[_]=N;else{let T=sl(n,_);m[T.route.id]==null&&(m[T.route.id]=N)}i||(u[_]=dx),g||(g=!0,p=Dr(j.error)?j.error.status:500),j.headers&&(h[_]=j.headers)}else u[_]=j.data,j.statusCode&&j.statusCode!==200&&!g&&(p=j.statusCode),j.headers&&(h[_]=j.headers)}),v!==void 0&&s&&(m={[s[0]]:v},s[2]&&(u[s[2]]=void 0)),{loaderData:u,errors:m,statusCode:p||200,loaderHeaders:h}}function cg(n,l,s,i,o,u){let{loaderData:m,errors:p}=w1(l,s,i);return o.filter(g=>!g.matches||g.matches.some(h=>h.shouldLoad)).forEach(g=>{let{key:h,match:v,controller:y}=g;if(y&&y.signal.aborted)return;let _=u[h];if(qe(_,"Did not find corresponding fetcher result"),Da(_)){let j=sl(n.matches,v?.route.id);p&&p[j.route.id]||(p={...p,[j.route.id]:_.error}),n.fetchers.delete(h)}else if(Ol(_))qe(!1,"Unhandled fetcher revalidation redirect");else{let j=On(_.data);n.fetchers.set(h,j)}}),{loaderData:m,errors:p}}function ug(n,l,s,i){let o=Object.entries(l).filter(([,u])=>u!==dx).reduce((u,[m,p])=>(u[m]=p,u),{});for(let u of s){let m=u.route.id;if(!l.hasOwnProperty(m)&&n.hasOwnProperty(m)&&u.route.loader&&(o[m]=n[m]),i&&i.hasOwnProperty(m))break}return o}function dg(n){return n?Da(n[1])?{actionData:{}}:{actionData:{[n[0]]:n[1].data}}:{}}function sl(n,l){return(l?n.slice(0,n.findIndex(i=>i.route.id===l)+1):[...n]).reverse().find(i=>i.route.hasErrorBoundary===!0)||n[0]}function lo(n){let l=n.length===1?n[0]:n.find(s=>s.index||!s.path||s.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:l}],route:l}}function Xa(n,{pathname:l,routeId:s,method:i,type:o,message:u}={}){let m="Unknown Server Error",p="Unknown @remix-run/router error";return n===400?(m="Bad Request",i&&l&&s?p=`You made a ${i} request to "${l}" but did not provide a \`loader\` for route "${s}", so there is no way to handle the request.`:o==="invalid-body"&&(p="Unable to encode submission body")):n===403?(m="Forbidden",p=`Route "${s}" does not match URL "${l}"`):n===404?(m="Not Found",p=`No route matches URL "${l}"`):n===405&&(m="Method Not Allowed",i&&l&&s?p=`You made a ${i.toUpperCase()} request to "${l}" but did not provide an \`action\` for route "${s}", so there is no way to handle the request.`:i&&(p=`Invalid request method "${i.toUpperCase()}"`)),new qs(n||500,m,new Error(p),!0)}function ro(n){let l=Object.entries(n);for(let s=l.length-1;s>=0;s--){let[i,o]=l[s];if(Ol(o))return{key:i,result:o}}}function yx(n){let l=typeof n=="string"?Mn(n):n;return mn({...l,hash:""})}function E1(n,l){return n.pathname!==l.pathname||n.search!==l.search?!1:n.hash===""?l.hash!=="":n.hash===l.hash?!0:l.hash!==""}function C1(n){return new qs(n.init?.status??500,n.init?.statusText??"Internal Server Error",n.data)}function R1(n){return n!=null&&typeof n=="object"&&Object.entries(n).every(([l,s])=>typeof l=="string"&&T1(s))}function T1(n){return n!=null&&typeof n=="object"&&"type"in n&&"result"in n&&(n.type==="data"||n.type==="error")}function z1(n){return _d(n.result)&&cx.has(n.result.status)}function Da(n){return n.type==="error"}function Ol(n){return(n&&n.type)==="redirect"}function fg(n){return typeof n=="object"&&n!=null&&"type"in n&&"data"in n&&"init"in n&&n.type==="DataWithResponseInit"}function _d(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.headers=="object"&&typeof n.body<"u"}function O1(n){return cx.has(n)}function D1(n){return _d(n)&&O1(n.status)&&n.headers.has("Location")}function M1(n){return c1.has(n.toUpperCase())}function aa(n){return i1.has(n.toUpperCase())}function jd(n){return new URLSearchParams(n).getAll("index").some(l=>l==="")}function fo(n,l){let s=typeof l=="string"?Mn(l).search:l.search;if(n[n.length-1].route.index&&jd(s||""))return n[n.length-1];let i=lx(n);return i[i.length-1]}function mg(n){let{formMethod:l,formAction:s,formEncType:i,text:o,formData:u,json:m}=n;if(!(!l||!s||!i)){if(o!=null)return{formMethod:l,formAction:s,formEncType:i,formData:void 0,json:void 0,text:o};if(u!=null)return{formMethod:l,formAction:s,formEncType:i,formData:u,json:void 0,text:void 0};if(m!==void 0)return{formMethod:l,formAction:s,formEncType:i,formData:void 0,json:m,text:void 0}}}function Fu(n,l){return l?{state:"loading",location:n,formMethod:l.formMethod,formAction:l.formAction,formEncType:l.formEncType,formData:l.formData,json:l.json,text:l.text}:{state:"loading",location:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function k1(n,l){return{state:"submitting",location:n,formMethod:l.formMethod,formAction:l.formAction,formEncType:l.formEncType,formData:l.formData,json:l.json,text:l.text}}function Cs(n,l){return n?{state:"loading",formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text,data:l}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:l}}function A1(n,l){return{state:"submitting",formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text,data:l?l.data:void 0}}function On(n){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:n}}function L1(n,l){try{let s=n.sessionStorage.getItem(ux);if(s){let i=JSON.parse(s);for(let[o,u]of Object.entries(i||{}))u&&Array.isArray(u)&&l.set(o,new Set(u||[]))}}catch{}}function U1(n,l){if(l.size>0){let s={};for(let[i,o]of l)s[i]=[...o];try{n.sessionStorage.setItem(ux,JSON.stringify(s))}catch(i){zt(!1,`Failed to save applied view transitions in sessionStorage (${i}).`)}}}function hg(){let n,l,s=new Promise((i,o)=>{n=async u=>{i(u);try{await s}catch{}},l=async u=>{o(u);try{await s}catch{}}});return{promise:s,resolve:n,reject:l}}var Ll=b.createContext(null);Ll.displayName="DataRouter";var Gs=b.createContext(null);Gs.displayName="DataRouterState";var bx=b.createContext(!1);function H1(){return b.useContext(bx)}var Nd=b.createContext({isTransitioning:!1});Nd.displayName="ViewTransition";var vx=b.createContext(new Map);vx.displayName="Fetchers";var B1=b.createContext(null);B1.displayName="Await";var ka=b.createContext(null);ka.displayName="Navigation";var _o=b.createContext(null);_o.displayName="Location";var Fa=b.createContext({outlet:null,matches:[],isDataRoute:!1});Fa.displayName="Route";var wd=b.createContext(null);wd.displayName="RouteError";var Sx="REACT_ROUTER_ERROR",$1="REDIRECT",q1="ROUTE_ERROR_RESPONSE";function Y1(n){if(n.startsWith(`${Sx}:${$1}:{`))try{let l=JSON.parse(n.slice(28));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.location=="string"&&typeof l.reloadDocument=="boolean"&&typeof l.replace=="boolean")return l}catch{}}function G1(n){if(n.startsWith(`${Sx}:${q1}:{`))try{let l=JSON.parse(n.slice(40));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string")return new qs(l.status,l.statusText,l.data)}catch{}}function V1(n,{relative:l}={}){qe(Mr(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:i}=b.useContext(ka),{hash:o,pathname:u,search:m}=Ks(n,{relative:l}),p=u;return s!=="/"&&(p=u==="/"?s:tn([s,u])),i.createHref({pathname:p,search:m,hash:o})}function Mr(){return b.useContext(_o)!=null}function nn(){return qe(Mr(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(_o).location}var _x="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function jx(n){b.useContext(ka).static||b.useLayoutEffect(n)}function kn(){let{isDataRoute:n}=b.useContext(Fa);return n?l4():K1()}function K1(){qe(Mr(),"useNavigate() may be used only in the context of a <Router> component.");let n=b.useContext(Ll),{basename:l,navigator:s}=b.useContext(ka),{matches:i}=b.useContext(Fa),{pathname:o}=nn(),u=JSON.stringify(So(i)),m=b.useRef(!1);return jx(()=>{m.current=!0}),b.useCallback((g,h={})=>{if(zt(m.current,_x),!m.current)return;if(typeof g=="number"){s.go(g);return}let v=$s(g,JSON.parse(u),o,h.relative==="path");n==null&&l!=="/"&&(v.pathname=v.pathname==="/"?l:tn([l,v.pathname])),(h.replace?s.replace:s.push)(v,h.state,h)},[l,s,u,o,n])}var X1=b.createContext(null);function Q1(n){let l=b.useContext(Fa).outlet;return b.useMemo(()=>l&&b.createElement(X1.Provider,{value:n},l),[l,n])}function Vs(){let{matches:n}=b.useContext(Fa),l=n[n.length-1];return l?l.params:{}}function Ks(n,{relative:l}={}){let{matches:s}=b.useContext(Fa),{pathname:i}=nn(),o=JSON.stringify(So(s));return b.useMemo(()=>$s(n,JSON.parse(o),i,l==="path"),[n,o,i,l])}function Z1(n,l,s){qe(Mr(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=b.useContext(ka),{matches:o}=b.useContext(Fa),u=o[o.length-1],m=u?u.params:{},p=u?u.pathname:"/",g=u?u.pathnameBase:"/",h=u&&u.route;{let D=h&&h.path||"";Ex(p,!h||D.endsWith("*")||D.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${D}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
11
+
12
+ Please change the parent <Route path="${D}"> to <Route path="${D==="/"?"*":`${D}/*`}">.`)}let v=nn(),y;y=v;let _=y.pathname||"/",j=_;if(g!=="/"){let D=g.replace(/^\//,"").split("/");j="/"+_.replace(/^\//,"").split("/").slice(D.length).join("/")}let N=rl(n,{pathname:j});return zt(h||N!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),zt(N==null||N[N.length-1].route.element!==void 0||N[N.length-1].route.Component!==void 0||N[N.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),W1(N&&N.map(D=>Object.assign({},D,{params:Object.assign({},m,D.params),pathname:tn([g,i.encodeLocation?i.encodeLocation(D.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:D.pathname]),pathnameBase:D.pathnameBase==="/"?g:tn([g,i.encodeLocation?i.encodeLocation(D.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:D.pathnameBase])})),o,s)}function F1(){let n=wx(),l=Dr(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),s=n instanceof Error?n.stack:null,i="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:i},u={padding:"2px 4px",backgroundColor:i},m=null;return console.error("Error handled by React Router default ErrorBoundary:",n),m=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:u},"ErrorBoundary")," or"," ",b.createElement("code",{style:u},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},l),s?b.createElement("pre",{style:o},s):null,m)}var J1=b.createElement(F1,null),Nx=class extends b.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,l){return l.location!==n.location||l.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:l.error,location:l.location,revalidation:n.revalidation||l.revalidation}}componentDidCatch(n,l){this.props.onError?this.props.onError(n,l):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const s=G1(n.digest);s&&(n=s)}let l=n!==void 0?b.createElement(Fa.Provider,{value:this.props.routeContext},b.createElement(wd.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?b.createElement(P1,{error:n},l):l}};Nx.contextType=bx;var Ju=new WeakMap;function P1({children:n,error:l}){let{basename:s}=b.useContext(ka);if(typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){let i=Y1(l.digest);if(i){let o=Ju.get(l);if(o)throw o;let u=sx(i.location,s);if(rx&&!Ju.get(l))if(u.isExternal||i.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:i.replace}));throw Ju.set(l,m),m}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return n}function I1({routeContext:n,match:l,children:s}){let i=b.useContext(Ll);return i&&i.static&&i.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=l.route.id),b.createElement(Fa.Provider,{value:n},s)}function W1(n,l=[],s){let i=s?.state;if(n==null){if(!i)return null;if(i.errors)n=i.matches;else if(l.length===0&&!i.initialized&&i.matches.length>0)n=i.matches;else return null}let o=n,u=i?.errors;if(u!=null){let v=o.findIndex(y=>y.route.id&&u?.[y.route.id]!==void 0);qe(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),o=o.slice(0,Math.min(o.length,v+1))}let m=!1,p=-1;if(s&&i){m=i.renderFallback;for(let v=0;v<o.length;v++){let y=o[v];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(p=v),y.route.id){let{loaderData:_,errors:j}=i,N=y.route.loader&&!_.hasOwnProperty(y.route.id)&&(!j||j[y.route.id]===void 0);if(y.route.lazy||N){s.isStatic&&(m=!0),p>=0?o=o.slice(0,p+1):o=[o[0]];break}}}}let g=s?.onError,h=i&&g?(v,y)=>{g(v,{location:i.location,params:i.matches?.[0]?.params??{},unstable_pattern:Ys(i.matches),errorInfo:y})}:void 0;return o.reduceRight((v,y,_)=>{let j,N=!1,T=null,D=null;i&&(j=u&&y.route.id?u[y.route.id]:void 0,T=y.route.errorElement||J1,m&&(p<0&&_===0?(Ex("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),N=!0,D=null):p===_&&(N=!0,D=y.route.hydrateFallbackElement||null)));let Y=l.concat(o.slice(0,_+1)),Z=()=>{let G;return j?G=T:N?G=D:y.route.Component?G=b.createElement(y.route.Component,null):y.route.element?G=y.route.element:G=v,b.createElement(I1,{match:y,routeContext:{outlet:v,matches:Y,isDataRoute:i!=null},children:G})};return i&&(y.route.ErrorBoundary||y.route.errorElement||_===0)?b.createElement(Nx,{location:i.location,revalidation:i.revalidation,component:T,error:j,children:Z(),routeContext:{outlet:null,matches:Y,isDataRoute:!0},onError:h}):Z()},null)}function Ed(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function e4(n){let l=b.useContext(Ll);return qe(l,Ed(n)),l}function t4(n){let l=b.useContext(Gs);return qe(l,Ed(n)),l}function a4(n){let l=b.useContext(Fa);return qe(l,Ed(n)),l}function Cd(n){let l=a4(n),s=l.matches[l.matches.length-1];return qe(s.route.id,`${n} can only be used on routes that contain a unique "id"`),s.route.id}function n4(){return Cd("useRouteId")}function wx(){let n=b.useContext(wd),l=t4("useRouteError"),s=Cd("useRouteError");return n!==void 0?n:l.errors?.[s]}function l4(){let{router:n}=e4("useNavigate"),l=Cd("useNavigate"),s=b.useRef(!1);return jx(()=>{s.current=!0}),b.useCallback(async(o,u={})=>{zt(s.current,_x),s.current&&(typeof o=="number"?await n.navigate(o):await n.navigate(o,{fromRouteId:l,...u}))},[n,l])}var pg={};function Ex(n,l,s){!l&&!pg[n]&&(pg[n]=!0,zt(!1,s))}var gg={};function xg(n,l){!n&&!gg[l]&&(gg[l]=!0,console.warn(l))}var r4="useOptimistic",yg=Lv[r4],s4=()=>{};function i4(n){return yg?yg(n):[n,s4]}function o4(n){let l={hasErrorBoundary:n.hasErrorBoundary||n.ErrorBoundary!=null||n.errorElement!=null};return n.Component&&(n.element&&zt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(l,{element:b.createElement(n.Component),Component:void 0})),n.HydrateFallback&&(n.hydrateFallbackElement&&zt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(l,{hydrateFallbackElement:b.createElement(n.HydrateFallback),HydrateFallback:void 0})),n.ErrorBoundary&&(n.errorElement&&zt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(l,{errorElement:b.createElement(n.ErrorBoundary),ErrorBoundary:void 0})),l}var c4=["HydrateFallback","hydrateFallbackElement"],u4=class{constructor(){this.status="pending",this.promise=new Promise((n,l)=>{this.resolve=s=>{this.status==="pending"&&(this.status="resolved",n(s))},this.reject=s=>{this.status==="pending"&&(this.status="rejected",l(s))}})}};function d4({router:n,flushSync:l,onError:s,unstable_useTransitions:i}){i=H1()||i;let[u,m]=b.useState(n.state),[p,g]=i4(u),[h,v]=b.useState(),[y,_]=b.useState({isTransitioning:!1}),[j,N]=b.useState(),[T,D]=b.useState(),[Y,Z]=b.useState(),G=b.useRef(new Map),V=b.useCallback((w,{deletedFetchers:$,newErrors:te,flushSync:fe,viewTransitionOpts:oe})=>{te&&s&&Object.values(te).forEach(de=>s(de,{location:w.location,params:w.matches[0]?.params??{},unstable_pattern:Ys(w.matches)})),w.fetchers.forEach((de,pe)=>{de.data!==void 0&&G.current.set(pe,de.data)}),$.forEach(de=>G.current.delete(de)),xg(fe===!1||l!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let re=n.window!=null&&n.window.document!=null&&typeof n.window.document.startViewTransition=="function";if(xg(oe==null||re,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!oe||!re){l&&fe?l(()=>m(w)):i===!1?m(w):b.startTransition(()=>{i===!0&&g(de=>bg(de,w)),m(w)});return}if(l&&fe){l(()=>{T&&(j?.resolve(),T.skipTransition()),_({isTransitioning:!0,flushSync:!0,currentLocation:oe.currentLocation,nextLocation:oe.nextLocation})});let de=n.window.document.startViewTransition(()=>{l(()=>m(w))});de.finished.finally(()=>{l(()=>{N(void 0),D(void 0),v(void 0),_({isTransitioning:!1})})}),l(()=>D(de));return}T?(j?.resolve(),T.skipTransition(),Z({state:w,currentLocation:oe.currentLocation,nextLocation:oe.nextLocation})):(v(w),_({isTransitioning:!0,flushSync:!1,currentLocation:oe.currentLocation,nextLocation:oe.nextLocation}))},[n.window,l,T,j,i,g,s]);b.useLayoutEffect(()=>n.subscribe(V),[n,V]),b.useEffect(()=>{y.isTransitioning&&!y.flushSync&&N(new u4)},[y]),b.useEffect(()=>{if(j&&h&&n.window){let w=h,$=j.promise,te=n.window.document.startViewTransition(async()=>{i===!1?m(w):b.startTransition(()=>{i===!0&&g(fe=>bg(fe,w)),m(w)}),await $});te.finished.finally(()=>{N(void 0),D(void 0),v(void 0),_({isTransitioning:!1})}),D(te)}},[h,j,n.window,i,g]),b.useEffect(()=>{j&&h&&p.location.key===h.location.key&&j.resolve()},[j,T,p.location,h]),b.useEffect(()=>{!y.isTransitioning&&Y&&(v(Y.state),_({isTransitioning:!0,flushSync:!1,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation}),Z(void 0))},[y.isTransitioning,Y]);let Q=b.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:w=>n.navigate(w),push:(w,$,te)=>n.navigate(w,{state:$,preventScrollReset:te?.preventScrollReset}),replace:(w,$,te)=>n.navigate(w,{replace:!0,state:$,preventScrollReset:te?.preventScrollReset})}),[n]),ae=n.basename||"/",W=b.useMemo(()=>({router:n,navigator:Q,static:!1,basename:ae,onError:s}),[n,Q,ae,s]);return b.createElement(b.Fragment,null,b.createElement(Ll.Provider,{value:W},b.createElement(Gs.Provider,{value:p},b.createElement(vx.Provider,{value:G.current},b.createElement(Nd.Provider,{value:y},b.createElement(h4,{basename:ae,location:p.location,navigationType:p.historyAction,navigator:Q,unstable_useTransitions:i},b.createElement(f4,{routes:n.routes,future:n.future,state:p,isStatic:!1,onError:s})))))),null)}function bg(n,l){return{...n,navigation:l.navigation.state!=="idle"?l.navigation:n.navigation,revalidation:l.revalidation!=="idle"?l.revalidation:n.revalidation,actionData:l.navigation.state!=="submitting"?l.actionData:n.actionData,fetchers:l.fetchers}}var f4=b.memo(m4);function m4({routes:n,future:l,state:s,isStatic:i,onError:o}){return Z1(n,void 0,{state:s,isStatic:i,onError:o})}function vg({to:n,replace:l,state:s,relative:i}){qe(Mr(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=b.useContext(ka);zt(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=b.useContext(Fa),{pathname:m}=nn(),p=kn(),g=$s(n,So(u),m,i==="path"),h=JSON.stringify(g);return b.useEffect(()=>{p(JSON.parse(h),{replace:l,state:s,relative:i})},[p,h,i,l,s]),null}function Cx(n){return Q1(n.context)}function h4({basename:n="/",children:l=null,location:s,navigationType:i="POP",navigator:o,static:u=!1,unstable_useTransitions:m}){qe(!Mr(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=n.replace(/^\/*/,"/"),g=b.useMemo(()=>({basename:p,navigator:o,static:u,unstable_useTransitions:m,future:{}}),[p,o,u,m]);typeof s=="string"&&(s=Mn(s));let{pathname:h="/",search:v="",hash:y="",state:_=null,key:j="default",unstable_mask:N}=s,T=b.useMemo(()=>{let D=Za(h,p);return D==null?null:{location:{pathname:D,search:v,hash:y,state:_,key:j,unstable_mask:N},navigationType:i}},[p,h,v,y,_,j,i,N]);return zt(T!=null,`<Router basename="${p}"> is not able to match the URL "${h}${v}${y}" because it does not start with the basename, so the <Router> won't render anything.`),T==null?null:b.createElement(ka.Provider,{value:g},b.createElement(_o.Provider,{children:l,value:T}))}var mo="get",ho="application/x-www-form-urlencoded";function jo(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function p4(n){return jo(n)&&n.tagName.toLowerCase()==="button"}function g4(n){return jo(n)&&n.tagName.toLowerCase()==="form"}function x4(n){return jo(n)&&n.tagName.toLowerCase()==="input"}function y4(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function b4(n,l){return n.button===0&&(!l||l==="_self")&&!y4(n)}function fd(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((l,s)=>{let i=n[s];return l.concat(Array.isArray(i)?i.map(o=>[s,o]):[[s,i]])},[]))}function v4(n,l){let s=fd(n);return l&&l.forEach((i,o)=>{s.has(o)||l.getAll(o).forEach(u=>{s.append(o,u)})}),s}var so=null;function S4(){if(so===null)try{new FormData(document.createElement("form"),0),so=!1}catch{so=!0}return so}var _4=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Pu(n){return n!=null&&!_4.has(n)?(zt(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ho}"`),null):n}function j4(n,l){let s,i,o,u,m;if(g4(n)){let p=n.getAttribute("action");i=p?Za(p,l):null,s=n.getAttribute("method")||mo,o=Pu(n.getAttribute("enctype"))||ho,u=new FormData(n)}else if(p4(n)||x4(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?Za(g,l):null,s=n.getAttribute("formmethod")||p.getAttribute("method")||mo,o=Pu(n.getAttribute("formenctype"))||Pu(p.getAttribute("enctype"))||ho,u=new FormData(p,n),!S4()){let{name:h,type:v,value:y}=n;if(v==="image"){let _=h?`${h}.`:"";u.append(`${_}x`,"0"),u.append(`${_}y`,"0")}else h&&u.append(h,y)}}else{if(jo(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=mo,i=null,o=ho,m=n}return u&&o==="text/plain"&&(m=u,u=void 0),{action:i,method:s.toLowerCase(),encType:o,formData:u,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Rd(n,l){if(n===!1||n===null||typeof n>"u")throw new Error(l)}function N4(n,l,s,i){let o=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return s?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${i}`:o.pathname=`${o.pathname}.${i}`:o.pathname==="/"?o.pathname=`_root.${i}`:l&&Za(o.pathname,l)==="/"?o.pathname=`${l.replace(/\/$/,"")}/_root.${i}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${i}`,o}async function w4(n,l){if(n.id in l)return l[n.id];try{let s=await import(n.module);return l[n.id]=s,s}catch(s){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(s),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function E4(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 C4(n,l,s){let i=await Promise.all(n.map(async o=>{let u=l.routes[o.route.id];if(u){let m=await w4(u,s);return m.links?m.links():[]}return[]}));return O4(i.flat(1).filter(E4).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function Sg(n,l,s,i,o,u){let m=(g,h)=>s[h]?g.route.id!==s[h].route.id:!0,p=(g,h)=>s[h].pathname!==g.pathname||s[h].route.path?.endsWith("*")&&s[h].params["*"]!==g.params["*"];return u==="assets"?l.filter((g,h)=>m(g,h)||p(g,h)):u==="data"?l.filter((g,h)=>{let v=i.routes[g.route.id];if(!v||!v.hasLoader)return!1;if(m(g,h)||p(g,h))return!0;if(g.route.shouldRevalidate){let y=g.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:s[0]?.params||{},nextUrl:new URL(n,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function R4(n,l,{includeHydrateFallback:s}={}){return T4(n.map(i=>{let o=l.routes[i.route.id];if(!o)return[];let u=[o.module];return o.clientActionModule&&(u=u.concat(o.clientActionModule)),o.clientLoaderModule&&(u=u.concat(o.clientLoaderModule)),s&&o.hydrateFallbackModule&&(u=u.concat(o.hydrateFallbackModule)),o.imports&&(u=u.concat(o.imports)),u}).flat(1))}function T4(n){return[...new Set(n)]}function z4(n){let l={},s=Object.keys(n).sort();for(let i of s)l[i]=n[i];return l}function O4(n,l){let s=new Set;return new Set(l),n.reduce((i,o)=>{let u=JSON.stringify(z4(o));return s.has(u)||(s.add(u),i.push({key:u,link:o})),i},[])}function Rx(){let n=b.useContext(Ll);return Rd(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function D4(){let n=b.useContext(Gs);return Rd(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Td=b.createContext(void 0);Td.displayName="FrameworkContext";function Tx(){let n=b.useContext(Td);return Rd(n,"You must render this element inside a <HydratedRouter> element"),n}function M4(n,l){let s=b.useContext(Td),[i,o]=b.useState(!1),[u,m]=b.useState(!1),{onFocus:p,onBlur:g,onMouseEnter:h,onMouseLeave:v,onTouchStart:y}=l,_=b.useRef(null);b.useEffect(()=>{if(n==="render"&&m(!0),n==="viewport"){let T=Y=>{Y.forEach(Z=>{m(Z.isIntersecting)})},D=new IntersectionObserver(T,{threshold:.5});return _.current&&D.observe(_.current),()=>{D.disconnect()}}},[n]),b.useEffect(()=>{if(i){let T=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(T)}}},[i]);let j=()=>{o(!0)},N=()=>{o(!1),m(!1)};return s?n!=="intent"?[u,_,{}]:[u,_,{onFocus:Rs(p,j),onBlur:Rs(g,N),onMouseEnter:Rs(h,j),onMouseLeave:Rs(v,N),onTouchStart:Rs(y,j)}]:[!1,_,{}]}function Rs(n,l){return s=>{n&&n(s),s.defaultPrevented||l(s)}}function k4({page:n,...l}){let{router:s}=Rx(),i=b.useMemo(()=>rl(s.routes,n,s.basename),[s.routes,n,s.basename]);return i?b.createElement(L4,{page:n,matches:i,...l}):null}function A4(n){let{manifest:l,routeModules:s}=Tx(),[i,o]=b.useState([]);return b.useEffect(()=>{let u=!1;return C4(n,l,s).then(m=>{u||o(m)}),()=>{u=!0}},[n,l,s]),i}function L4({page:n,matches:l,...s}){let i=nn(),{future:o,manifest:u,routeModules:m}=Tx(),{basename:p}=Rx(),{loaderData:g,matches:h}=D4(),v=b.useMemo(()=>Sg(n,l,h,u,i,"data"),[n,l,h,u,i]),y=b.useMemo(()=>Sg(n,l,h,u,i,"assets"),[n,l,h,u,i]),_=b.useMemo(()=>{if(n===i.pathname+i.search+i.hash)return[];let T=new Set,D=!1;if(l.forEach(Z=>{let G=u.routes[Z.route.id];!G||!G.hasLoader||(!v.some(V=>V.route.id===Z.route.id)&&Z.route.id in g&&m[Z.route.id]?.shouldRevalidate||G.hasClientLoader?D=!0:T.add(Z.route.id))}),T.size===0)return[];let Y=N4(n,p,o.unstable_trailingSlashAwareDataRequests,"data");return D&&T.size>0&&Y.searchParams.set("_routes",l.filter(Z=>T.has(Z.route.id)).map(Z=>Z.route.id).join(",")),[Y.pathname+Y.search]},[p,o.unstable_trailingSlashAwareDataRequests,g,i,u,v,l,n,m]),j=b.useMemo(()=>R4(y,u),[y,u]),N=A4(y);return b.createElement(b.Fragment,null,_.map(T=>b.createElement("link",{key:T,rel:"prefetch",as:"fetch",href:T,...s})),j.map(T=>b.createElement("link",{key:T,rel:"modulepreload",href:T,...s})),N.map(({key:T,link:D})=>b.createElement("link",{key:T,nonce:s.nonce,...D,crossOrigin:D.crossOrigin??s.crossOrigin})))}function U4(...n){return l=>{n.forEach(s=>{typeof s=="function"?s(l):s!=null&&(s.current=l)})}}var H4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{H4&&(window.__reactRouterVersion="7.13.1")}catch{}function B4(n,l){return m1({basename:l?.basename,getContext:l?.getContext,future:l?.future,history:T0({window:l?.window}),hydrationData:$4(),routes:n,mapRouteProperties:o4,hydrationRouteProperties:c4,dataStrategy:l?.dataStrategy,patchRoutesOnNavigation:l?.patchRoutesOnNavigation,window:l?.window,unstable_instrumentations:l?.unstable_instrumentations}).initialize()}function $4(){let n=window?.__staticRouterHydrationData;return n&&n.errors&&(n={...n,errors:q4(n.errors)}),n}function q4(n){if(!n)return null;let l=Object.entries(n),s={};for(let[i,o]of l)if(o&&o.__type==="RouteErrorResponse")s[i]=new qs(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let u=window[o.__subType];if(typeof u=="function")try{let m=new u(o.message);m.stack="",s[i]=m}catch{}}if(s[i]==null){let u=new Error(o.message);u.stack="",s[i]=u}}else s[i]=o;return s}var zx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ba=b.forwardRef(function({onClick:l,discover:s="render",prefetch:i="none",relative:o,reloadDocument:u,replace:m,unstable_mask:p,state:g,target:h,to:v,preventScrollReset:y,viewTransition:_,unstable_defaultShouldRevalidate:j,...N},T){let{basename:D,navigator:Y,unstable_useTransitions:Z}=b.useContext(ka),G=typeof v=="string"&&zx.test(v),V=sx(v,D);v=V.to;let Q=V1(v,{relative:o}),ae=nn(),W=null;if(p){let pe=$s(p,[],ae.unstable_mask?ae.unstable_mask.pathname:"/",!0);D!=="/"&&(pe.pathname=pe.pathname==="/"?D:tn([D,pe.pathname])),W=Y.createHref(pe)}let[w,$,te]=M4(i,N),fe=V4(v,{replace:m,unstable_mask:p,state:g,target:h,preventScrollReset:y,relative:o,viewTransition:_,unstable_defaultShouldRevalidate:j,unstable_useTransitions:Z});function oe(pe){l&&l(pe),pe.defaultPrevented||fe(pe)}let re=!(V.isExternal||u),de=b.createElement("a",{...N,...te,href:(re?W:void 0)||V.absoluteURL||Q,onClick:re?oe:l,ref:U4(T,$),target:h,"data-discover":!G&&s==="render"?"true":void 0});return w&&!G?b.createElement(b.Fragment,null,de,b.createElement(k4,{page:Q})):de});ba.displayName="Link";var Hs=b.forwardRef(function({"aria-current":l="page",caseSensitive:s=!1,className:i="",end:o=!1,style:u,to:m,viewTransition:p,children:g,...h},v){let y=Ks(m,{relative:h.relative}),_=nn(),j=b.useContext(Gs),{navigator:N,basename:T}=b.useContext(ka),D=j!=null&&F4(y)&&p===!0,Y=N.encodeLocation?N.encodeLocation(y).pathname:y.pathname,Z=_.pathname,G=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;s||(Z=Z.toLowerCase(),G=G?G.toLowerCase():null,Y=Y.toLowerCase()),G&&T&&(G=Za(G,T)||G);const V=Y!=="/"&&Y.endsWith("/")?Y.length-1:Y.length;let Q=Z===Y||!o&&Z.startsWith(Y)&&Z.charAt(V)==="/",ae=G!=null&&(G===Y||!o&&G.startsWith(Y)&&G.charAt(Y.length)==="/"),W={isActive:Q,isPending:ae,isTransitioning:D},w=Q?l:void 0,$;typeof i=="function"?$=i(W):$=[i,Q?"active":null,ae?"pending":null,D?"transitioning":null].filter(Boolean).join(" ");let te=typeof u=="function"?u(W):u;return b.createElement(ba,{...h,"aria-current":w,className:$,ref:v,style:te,to:m,viewTransition:p},typeof g=="function"?g(W):g)});Hs.displayName="NavLink";var Y4=b.forwardRef(({discover:n="render",fetcherKey:l,navigate:s,reloadDocument:i,replace:o,state:u,method:m=mo,action:p,onSubmit:g,relative:h,preventScrollReset:v,viewTransition:y,unstable_defaultShouldRevalidate:_,...j},N)=>{let{unstable_useTransitions:T}=b.useContext(ka),D=Q4(),Y=Z4(p,{relative:h}),Z=m.toLowerCase()==="get"?"get":"post",G=typeof p=="string"&&zx.test(p),V=Q=>{if(g&&g(Q),Q.defaultPrevented)return;Q.preventDefault();let ae=Q.nativeEvent.submitter,W=ae?.getAttribute("formmethod")||m,w=()=>D(ae||Q.currentTarget,{fetcherKey:l,method:W,navigate:s,replace:o,state:u,relative:h,preventScrollReset:v,viewTransition:y,unstable_defaultShouldRevalidate:_});T&&s!==!1?b.startTransition(()=>w()):w()};return b.createElement("form",{ref:N,method:Z,action:Y,onSubmit:i?g:V,...j,"data-discover":!G&&n==="render"?"true":void 0})});Y4.displayName="Form";function G4(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ox(n){let l=b.useContext(Ll);return qe(l,G4(n)),l}function V4(n,{target:l,replace:s,unstable_mask:i,state:o,preventScrollReset:u,relative:m,viewTransition:p,unstable_defaultShouldRevalidate:g,unstable_useTransitions:h}={}){let v=kn(),y=nn(),_=Ks(n,{relative:m});return b.useCallback(j=>{if(b4(j,l)){j.preventDefault();let N=s!==void 0?s:mn(y)===mn(_),T=()=>v(n,{replace:N,unstable_mask:i,state:o,preventScrollReset:u,relative:m,viewTransition:p,unstable_defaultShouldRevalidate:g});h?b.startTransition(()=>T()):T()}},[y,v,_,s,i,o,l,n,u,m,p,g,h])}function No(n){zt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let l=b.useRef(fd(n)),s=b.useRef(!1),i=nn(),o=b.useMemo(()=>v4(i.search,s.current?null:l.current),[i.search]),u=kn(),m=b.useCallback((p,g)=>{const h=fd(typeof p=="function"?p(new URLSearchParams(o)):p);s.current=!0,u("?"+h,g)},[u,o]);return[o,m]}var K4=0,X4=()=>`__${String(++K4)}__`;function Q4(){let{router:n}=Ox("useSubmit"),{basename:l}=b.useContext(ka),s=n4(),i=n.fetch,o=n.navigate;return b.useCallback(async(u,m={})=>{let{action:p,method:g,encType:h,formData:v,body:y}=j4(u,l);if(m.navigate===!1){let _=m.fetcherKey||X4();await i(_,s,m.action||p,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:v,body:y,formMethod:m.method||g,formEncType:m.encType||h,flushSync:m.flushSync})}else await o(m.action||p,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:v,body:y,formMethod:m.method||g,formEncType:m.encType||h,replace:m.replace,state:m.state,fromRouteId:s,flushSync:m.flushSync,viewTransition:m.viewTransition})},[i,o,l,s])}function Z4(n,{relative:l}={}){let{basename:s}=b.useContext(ka),i=b.useContext(Fa);qe(i,"useFormAction must be used inside a RouteContext");let[o]=i.matches.slice(-1),u={...Ks(n||".",{relative:l})},m=nn();if(n==null){u.search=m.search;let p=new URLSearchParams(u.search),g=p.getAll("index");if(g.some(v=>v==="")){p.delete("index"),g.filter(y=>y).forEach(y=>p.append("index",y));let v=p.toString();u.search=v?`?${v}`:""}}return(!n||n===".")&&o.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(u.pathname=u.pathname==="/"?s:tn([s,u.pathname])),mn(u)}function F4(n,{relative:l}={}){let s=b.useContext(Nd);qe(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Ox("useViewTransitionState"),o=Ks(n,{relative:l});if(!s.isTransitioning)return!1;let u=Za(s.currentLocation.pathname,i)||s.currentLocation.pathname,m=Za(s.nextLocation.pathname,i)||s.nextLocation.pathname;return yo(o.pathname,m)!=null||yo(o.pathname,u)!=null}const _g=n=>{let l;const s=new Set,i=(h,v)=>{const y=typeof h=="function"?h(l):h;if(!Object.is(y,l)){const _=l;l=v??(typeof y!="object"||y===null)?y:Object.assign({},l,y),s.forEach(j=>j(l,_))}},o=()=>l,p={setState:i,getState:o,getInitialState:()=>g,subscribe:h=>(s.add(h),()=>s.delete(h))},g=l=n(i,o,p);return p},J4=(n=>n?_g(n):_g),P4=n=>n;function I4(n,l=P4){const s=Rr.useSyncExternalStore(n.subscribe,Rr.useCallback(()=>l(n.getState()),[n,l]),Rr.useCallback(()=>l(n.getInitialState()),[n,l]));return Rr.useDebugValue(s),s}const jg=n=>{const l=J4(n),s=i=>I4(l,i);return Object.assign(s,l),s},wo=(n=>n?jg(n):jg),Dx="/api/v1";class Dl extends Error{constructor(l,s,i){super(i),this.status=l,this.code=s,this.name="ApiError"}}async function io(n,l,s,i,o){let u=`${Dx}${l}`;if(i){const g=new URLSearchParams(i).toString();g&&(u+=`?${g}`)}const m={method:n,headers:{"Content-Type":"application/json"}};s!==void 0&&(m.body=JSON.stringify(s)),o?.signal&&(m.signal=o.signal);const p=await fetch(u,m);if(!p.ok){let g="UNKNOWN",h=p.statusText;try{const v=await p.json();v.code&&(g=v.code),v.message&&(h=v.message)}catch{}throw new Dl(p.status,g,h)}return p.json()}const Iu=new Map;function W4(n,l){let s=`${Dx}${n}`;if(l){const i=new URLSearchParams(l).toString();i&&(s+=`?${i}`)}return s}const vt={get(n,l,s){const i=W4(n,l),o=Iu.get(i);if(o)return o;const u=io("GET",n,void 0,l,s).finally(()=>{Iu.delete(i)});return Iu.set(i,u),u},post(n,l,s){return io("POST",n,l,void 0,s)},put(n,l){return io("PUT",n,l)},delete(n){return io("DELETE",n)}},eS=3e4,tS=1e3,aS=3e4;class nS{ws=null;url="";handlers=new Map;statusHandlers=new Set;heartbeatTimer=null;reconnectTimer=null;reconnectAttempt=0;intentionalClose=!1;_status="disconnected";get status(){return this._status}setStatus(l){this._status=l;for(const s of this.statusHandlers)s(l)}onStatusChange(l){return this.statusHandlers.add(l),()=>{this.statusHandlers.delete(l)}}connect(l){this.url=l,this.intentionalClose=!1,this.reconnectAttempt=0,this.open()}disconnect(){this.intentionalClose=!0,this.clearTimers(),this.ws&&(this.ws.close(),this.ws=null),this.setStatus("disconnected")}on(l,s){let i=this.handlers.get(l);return i||(i=new Set,this.handlers.set(l,i)),i.add(s),()=>{i.delete(s),i.size===0&&this.handlers.delete(l)}}send(l,s){if(this.ws?.readyState!==WebSocket.OPEN)return;const i={event:l,payload:s,timestamp:Date.now()};this.ws.send(JSON.stringify(i))}open(){this.setStatus("connecting");const l=new WebSocket(this.url);l.onopen=()=>{this.reconnectAttempt=0,this.setStatus("connected"),this.startHeartbeat()},l.onmessage=s=>{try{const i=JSON.parse(String(s.data));if(i.event==="pong")return;const o=this.handlers.get(i.event);if(o)for(const u of o)u(i.payload)}catch{}},l.onclose=()=>{this.stopHeartbeat(),this.intentionalClose||(this.setStatus("reconnecting"),this.scheduleReconnect())},l.onerror=()=>{},this.ws=l}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({event:"ping",payload:null,timestamp:Date.now()}))},eS)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}scheduleReconnect(){if(this.reconnectTimer)return;const l=Math.min(tS*2**this.reconnectAttempt,aS);this.reconnectAttempt++,this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.open()},l)}clearTimers(){this.stopHeartbeat(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}const an=new nS,ul="lib_cloud_default",Pt=wo((n,l)=>({libraries:[],loading:!1,error:null,fetchLibraries:async()=>{n({loading:!0,error:null});try{const s=await vt.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 vt.post("/libraries",s);return n(o=>({libraries:[...o.libraries,i]})),i},deleteLibrary:async s=>{await vt.delete(`/libraries/${s}`),n(i=>({libraries:i.libraries.filter(o=>o.id!==s)}))},updateLibraryName:async(s,i)=>{const o=await vt.put(`/libraries/${s}`,{name:i});n(u=>({libraries:u.libraries.map(m=>m.id===s?o:m)}))},_updateLibraryOnline:(s,i)=>{n(o=>({libraries:o.libraries.map(u=>u.id===s?{...u,is_online:i}:u)}))},_refreshLibrary:async s=>{try{const i=await vt.get(`/libraries/${s}`);n(o=>({libraries:o.libraries.map(u=>u.id===s?i:u)}))}catch{l().fetchLibraries()}}})),kr=n=>{const l=n.libraries.filter(i=>i.type==="cloud").sort((i,o)=>i.created_at.localeCompare(o.created_at)),s=n.libraries.filter(i=>i.type==="daemon").sort((i,o)=>i.name.localeCompare(o.name));return[...l,...s]},lS=n=>n.libraries.filter(l=>l.type==="daemon");an.on("ws:daemon:status",n=>{const l=n;l.lib_id&&Pt.getState()._updateLibraryOnline(l.lib_id,l.is_online),Pt.getState().fetchLibraries()});an.on("ws:daemon:connected",n=>{const l=n;l.lib_id&&Pt.getState()._updateLibraryOnline(l.lib_id,!0),Pt.getState().fetchLibraries()});an.on("ws:library:updated",n=>{const l=n;Pt.getState()._refreshLibrary(l.library_id)});const Mx=(...n)=>n.filter((l,s,i)=>!!l&&l.trim()!==""&&i.indexOf(l)===s).join(" ").trim();const rS=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const sS=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(l,s,i)=>i?i.toUpperCase():s.toLowerCase());const Ng=n=>{const l=sS(n);return l.charAt(0).toUpperCase()+l.slice(1)};var iS={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 oS=n=>{for(const l in n)if(l.startsWith("aria-")||l==="role"||l==="title")return!0;return!1};const cS=b.forwardRef(({color:n="currentColor",size:l=24,strokeWidth:s=2,absoluteStrokeWidth:i,className:o="",children:u,iconNode:m,...p},g)=>b.createElement("svg",{ref:g,...iS,width:l,height:l,stroke:n,strokeWidth:i?Number(s)*24/Number(l):s,className:Mx("lucide",o),...!u&&!oS(p)&&{"aria-hidden":"true"},...p},[...m.map(([h,v])=>b.createElement(h,v)),...Array.isArray(u)?u:[u]]));const De=(n,l)=>{const s=b.forwardRef(({className:i,...o},u)=>b.createElement(cS,{ref:u,iconNode:l,className:Mx(`lucide-${rS(Ng(n))}`,`lucide-${n}`,i),...o}));return s.displayName=Ng(n),s};const uS=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],kx=De("arrow-right",uS);const dS=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],wg=De("arrow-up-right",dS);const fS=[["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"}]],mS=De("boxes",fS);const hS=[["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"}]],pS=De("brain",hS);const gS=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Al=De("check",gS);const xS=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ua=De("chevron-right",xS);const yS=[["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"}]],Ax=De("circle-alert",yS);const bS=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],vS=De("cloud",bS);const SS=[["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"}]],md=De("copy",SS);const _S=[["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"}]],jS=De("database",_S);const NS=[["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"}]],wS=De("file-spreadsheet",NS);const ES=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],cl=De("file-text",ES);const CS=[["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"}]],Lx=De("file",CS);const RS=[["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"}]],TS=De("files",RS);const zS=[["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"}]],Eo=De("folder-git-2",zS);const OS=[["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"}]],DS=De("folder-input",OS);const MS=[["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"}]],kS=De("folder-open",MS);const AS=[["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"}]],Ux=De("folder-plus",AS);const LS=[["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"}]],Qa=De("folder",LS);const US=[["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"}]],hd=De("git-branch",US);const HS=[["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"}]],BS=De("git-commit-horizontal",HS);const $S=[["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"}]],Eg=De("github",$S);const qS=[["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"}]],YS=De("globe",qS);const GS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],VS=De("info",GS);const KS=[["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"}]],XS=De("laptop",KS);const QS=[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]],ZS=De("list-filter",QS);const FS=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ma=De("loader-circle",FS);const JS=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],PS=De("menu",JS);const IS=[["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"}]],WS=De("monitor",IS);const e2=[["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"}]],t2=De("moon",e2);const a2=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Or=De("package",a2);const n2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],l2=De("panel-left",n2);const r2=[["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"}]],pd=De("pencil",r2);const s2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Hx=De("plus",s2);const i2=[["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"}]],o2=De("refresh-cw",i2);const c2=[["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"}]],u2=De("rotate-cw",c2);const d2=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],gd=De("search",d2);const f2=[["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"}]],m2=De("settings",f2);const h2=[["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"}]],p2=De("share-2",h2);const g2=[["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"}]],x2=De("sparkles",g2);const y2=[["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"}]],b2=De("sun",y2);const v2=[["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"}]],Bx=De("trash-2",v2);const S2=[["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"}]],xd=De("upload",S2);const _2=[["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"}]],j2=De("users",_2);const N2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ul=De("x",N2),Cg=n=>Symbol.iterator in n,Rg=n=>"entries"in n,Tg=(n,l)=>{const s=n instanceof Map?n:new Map(n.entries()),i=l instanceof Map?l:new Map(l.entries());if(s.size!==i.size)return!1;for(const[o,u]of s)if(!i.has(o)||!Object.is(u,i.get(o)))return!1;return!0},w2=(n,l)=>{const s=n[Symbol.iterator](),i=l[Symbol.iterator]();let o=s.next(),u=i.next();for(;!o.done&&!u.done;){if(!Object.is(o.value,u.value))return!1;o=s.next(),u=i.next()}return!!o.done&&!!u.done};function E2(n,l){return Object.is(n,l)?!0:typeof n!="object"||n===null||typeof l!="object"||l===null||Object.getPrototypeOf(n)!==Object.getPrototypeOf(l)?!1:Cg(n)&&Cg(l)?Rg(n)&&Rg(l)?Tg(n,l):w2(n,l):Tg({entries:()=>Object.entries(n)},{entries:()=>Object.entries(l)})}function Hl(n){const l=Rr.useRef(void 0);return s=>{const i=n(s);return E2(l.current,i)?l.current:l.current=i}}function yd(){const{t:n}=Re(),l=Pt(Hl(lS));if(l.length===0)return null;const s=l.filter(m=>m.is_online).length,i=l.length,o=s>0,u=o?n("sources.header.daemon_status",{online:s,total:i}):n("sources.header.all_offline");return f.jsxs("div",{className:"group relative flex items-center",title:u,children:[f.jsx("span",{className:`inline-block h-[7px] w-[7px] rounded-full ${o?"bg-c4a-success":"bg-c4a-error"}`}),f.jsx("span",{className:"pointer-events-none absolute right-full mr-2 hidden whitespace-nowrap rounded bg-c4a-bg-elevated px-2 py-1 font-mono text-xs text-c4a-text-secondary shadow-c4a-md group-hover:block",children:u})]})}const zg=[{to:"/",labelKey:"nav.home"},{to:"/studio",labelKey:"nav.studio"},{to:"/docs",labelKey:"nav.docs"}];function C2(){const{t:n}=Re(),[l,s]=b.useState(!1);return f.jsxs("header",{className:"sticky top-0 z-40 border-b border-c4a-border-subtle bg-c4a-bg-base/95 backdrop-blur-sm",children:[f.jsxs("div",{className:"flex h-14 items-center justify-between px-4",children:[f.jsxs(ba,{to:"/",className:"flex items-center gap-2 text-c4a-text-primary",children:[f.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"}),f.jsx("span",{className:"hidden font-mono text-sm font-semibold uppercase tracking-tight md:inline",children:"Context4AI"})]}),f.jsxs("div",{className:"hidden items-center gap-6 md:flex",children:[f.jsx("nav",{className:"flex items-center gap-4",children:zg.map(({to:i,labelKey:o})=>f.jsx(Hs,{to:i,end:i==="/",className:({isActive:u})=>`font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${u?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:n(o)},i))}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(yd,{}),f.jsx(ba,{to:"/login",className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-primary",children:n("nav.login")})]})]}),f.jsx("button",{onClick:()=>s(!l),className:"text-c4a-text-secondary md:hidden",children:l?f.jsx(Ul,{size:20}):f.jsx(PS,{size:20})})]}),l&&f.jsxs("div",{className:"border-t border-c4a-border-subtle bg-c4a-bg-surface px-4 pb-4 pt-2 md:hidden",children:[f.jsx("nav",{className:"flex flex-col gap-2",children:zg.map(({to:i,labelKey:o})=>f.jsx(Hs,{to:i,end:i==="/",onClick:()=>s(!1),className:({isActive:u})=>`block py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${u?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:n(o)},i))}),f.jsx("div",{className:"mt-2 border-t border-c4a-border-subtle pt-2",children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(yd,{}),f.jsx(ba,{to:"/login",onClick:()=>s(!1),className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-primary",children:n("nav.login")})]})})]})]})}function R2(n){return n==="system"&&typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":n==="system"?"dark":n}function $x(n){if(typeof window>"u")return;const l=R2(n);document.documentElement.setAttribute("data-theme",l),localStorage.setItem("theme",n)}function T2(){try{return localStorage.getItem("theme")||"system"}catch{return"system"}}const qx=wo(n=>({theme:T2(),setTheme:l=>{$x(l),n({theme:l})}}));let Og=!1;function z2(){if(Og||typeof window>"u")return;Og=!0;const n=window.matchMedia("(prefers-color-scheme: dark)"),l=()=>{const{theme:s}=qx.getState();s==="system"&&$x("system")};n.addEventListener("change",l)}z2();const O2=[{mode:"light",icon:b2,labelKey:"footer.theme.light"},{mode:"dark",icon:t2,labelKey:"footer.theme.dark"},{mode:"system",icon:WS,labelKey:"footer.theme.system"}];function Yx(){const{t:n}=Re(),{theme:l,setTheme:s}=qx();return f.jsx("div",{className:"flex items-center gap-1",children:O2.map(({mode:i,icon:o,labelKey:u})=>f.jsx("button",{onClick:()=>s(i),title:n(u),className:`cursor-pointer rounded p-1.5 transition-colors duration-150 ${l===i?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:f.jsx(o,{size:14})},i))})}function Gx(){const{i18n:n}=Re(),l=()=>{const s=n.language==="en"?"zh":"en";n.changeLanguage(s)};return f.jsx("button",{onClick:l,className:"cursor-pointer rounded px-2 py-1 font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-secondary hover:bg-c4a-bg-hover",children:n.language==="en"?"CN":"EN"})}function Vx({compact:n}){const{t:l}=Re(),s=new Date().getFullYear(),i=n?"footer.copyright_compact":"footer.copyright";return f.jsx("p",{className:"font-mono text-[11px] text-c4a-text-muted",children:l(i,{year:s})})}const D2="_brandIcon_1c7st_1",M2="_iconPulse_1c7st_35",Dg={brandIcon:D2,iconPulse:M2};function k2({variant:n}){const{t:l}=Re(),s=n==="studio"?"bg-c4a-bg-surface":"bg-c4a-bg-base";return f.jsx("footer",{className:`border-t border-c4a-border-subtle ${s} px-4 py-4`,children:f.jsxs("div",{className:"flex items-end justify-between gap-4",children:[f.jsxs("div",{className:"hidden items-center gap-3 md:flex",children:[f.jsx("div",{className:Dg.brandIcon,children:f.jsx("span",{className:Dg.iconPulse,children:"C4A"})}),f.jsxs("div",{className:"flex flex-col",children:[f.jsx("span",{className:"font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-primary",children:"Context4AI"}),f.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wider text-c4a-text-muted",children:l("footer.tagline")})]})]}),f.jsxs("div",{className:"ml-auto flex flex-col items-end gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Yx,{}),f.jsx(Gx,{})]}),f.jsx(Vx,{})]})]})})}function A2(){return f.jsxs("div",{className:"flex min-h-screen flex-col",children:[f.jsx(C2,{}),f.jsx("main",{className:"mx-auto flex w-full max-w-[1200px] flex-1 flex-col px-4",children:f.jsx(Cx,{})}),f.jsx(k2,{})]})}function L2({onToggleSidebar:n}){const{t:l}=Re();return f.jsx("header",{className:"sticky top-0 z-40 border-b border-c4a-border-subtle bg-c4a-bg-surface/95 backdrop-blur-sm",children:f.jsxs("div",{className:"relative flex h-14 items-center justify-between px-4",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[n&&f.jsx("button",{onClick:n,className:"text-c4a-text-secondary transition-colors duration-150 hover:text-c4a-text-primary md:hidden",children:f.jsx(l2,{size:20})}),f.jsxs(ba,{to:"/",className:"hidden items-center gap-2 text-c4a-text-primary md:flex",children:[f.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"}),f.jsx("span",{className:"font-mono text-sm font-semibold uppercase tracking-tight",children:"Context4AI"})]})]}),f.jsx(ba,{to:"/",className:"absolute left-1/2 flex -translate-x-1/2 items-center gap-2 text-c4a-text-primary md:hidden",children:f.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"})}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(yd,{}),f.jsx(ba,{to:"/login",className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-primary",children:l("nav.login")})]})]})})}const U2=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"}`,H2=[{to:"/studio/modeling",icon:mS,i18nKey:"studio.sidebar.modeling"},{to:"/studio/brain",icon:pS,i18nKey:"studio.sidebar.brain"},{to:"/studio/discovery",icon:gd,i18nKey:"studio.sidebar.discovery"},{to:"/studio/sharing",icon:p2,i18nKey:"studio.sidebar.sharing"},{to:"/studio/collaboration",icon:j2,i18nKey:"studio.sidebar.collaboration"},{to:"/studio/settings",icon:m2,i18nKey:"studio.sidebar.settings"}];function Mg({onNavigate:n}){const{t:l}=Re(),s=nn(),i=kn(),o=Pt(Hl(kr)),u=s.pathname.startsWith("/studio/sources")||s.pathname.startsWith("/studio/source/"),[m,p]=b.useState(u);b.useEffect(()=>{u&&p(!0)},[u]);const g=h=>h.id===ul?l("sources.library.default_cloud_name"):h.name;return f.jsxs("aside",{className:"flex h-full w-[220px] shrink-0 flex-col border-r border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsxs("nav",{className:"flex flex-col gap-1",children:[f.jsxs("div",{className:"group/sources",children:[f.jsxs("button",{onClick:()=>p(h=>!h),className:`flex w-full cursor-pointer items-center gap-2 rounded px-3 py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${u?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[f.jsx(jS,{size:14}),l("studio.sidebar.sources"),f.jsx("span",{role:"button",tabIndex:0,onClick:h=>{h.stopPropagation(),i("/studio/sources/add-client"),n?.()},onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.stopPropagation(),i("/studio/sources/add-client"),n?.())},className:"rounded p-0.5 text-c4a-text-muted opacity-0 transition-all hover:bg-c4a-bg-hover max-md:opacity-100 group-hover/sources:opacity-100 group-hover/sources:text-c4a-accent",title:l("sources.menu.add_client"),children:f.jsx(Hx,{size:12})}),f.jsx(ua,{size:12,className:`ml-auto shrink-0 transition-transform duration-200 ${m?"rotate-90":""}`})]}),m&&f.jsx("div",{className:"mt-0.5 flex flex-col gap-0.5",children:o.map(h=>{const v=g(h);return f.jsxs(Hs,{to:`/studio/sources/${h.id}`,onClick:n,className:({isActive:y})=>`flex items-center gap-2 rounded py-1.5 pl-8 pr-3 font-mono text-xs tracking-tight transition-colors duration-150 ${y?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover hover:text-c4a-text-primary"}`,children:[h.type==="cloud"?f.jsx(vS,{size:13,className:"shrink-0 opacity-60"}):f.jsx(XS,{size:13,className:"shrink-0 opacity-60"}),f.jsx("span",{className:"truncate",children:v}),h.type==="daemon"&&(()=>{const y=h.config?.machine_id;return f.jsxs("span",{role:"button",tabIndex:0,onClick:_=>{_.preventDefault(),_.stopPropagation(),i("/studio/sources/add-client"),n?.()},onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),_.stopPropagation(),i("/studio/sources/add-client"),n?.())},className:"group/dot relative ml-auto shrink-0 cursor-pointer rounded-full p-1",children:[f.jsx("span",{className:`block h-[7px] w-[7px] rounded-full ${h.is_online?"bg-c4a-success":"bg-c4a-error"}`}),f.jsx("span",{className:"pointer-events-none absolute left-full top-1/2 z-50 ml-2 hidden -translate-y-1/2 whitespace-nowrap rounded border border-c4a-border-default bg-c4a-bg-elevated px-2.5 py-1.5 text-[11px] leading-relaxed text-c4a-text-secondary shadow-c4a-lg group-hover/dot:block",children:h.is_online?l("sources.menu.status_online",{machine:y??""}):l("sources.menu.status_offline",{machine:y??""})})]})})()]},h.id)})})]}),H2.map(({to:h,icon:v,i18nKey:y})=>f.jsxs(Hs,{to:h,onClick:n,className:({isActive:_})=>U2(_),children:[f.jsx(v,{size:14}),l(y)]},h))]}),f.jsxs("div",{className:"mt-auto flex flex-col gap-2 pt-3",children:[f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx(Yx,{}),f.jsx(Gx,{})]}),f.jsx(Vx,{compact:!0})]})]})}const Bs=wo(n=>({status:"disconnected",onlineCount:0,connections:[],setStatus:l=>n({status:l}),fetchDaemonStatus:async()=>{try{const l=await vt.get("/daemons/status");n({onlineCount:l.online_count,connections:l.connections})}catch{}}})),B2=n=>n==="connecting"?"disconnected":n;an.onStatusChange(n=>{Bs.getState().setStatus(B2(n))});an.on("ws:daemon:connected",n=>{const l=n;Bs.setState(s=>{if(s.connections.some(m=>m.machine_id===l.machine_id))return s;const o={machine_id:l.machine_id};l.lib_id&&(o.lib_id=l.lib_id);const u=[...s.connections,o];return{connections:u,onlineCount:u.length}})});an.on("ws:daemon:status",n=>{const l=n;Bs.setState(s=>{if(l.is_online){if(s.connections.some(p=>p.machine_id===l.machine_id))return s;const u={machine_id:l.machine_id};l.lib_id&&(u.lib_id=l.lib_id);const m=[...s.connections,u];return{connections:m,onlineCount:m.length}}const i=s.connections.filter(o=>o.machine_id!==l.machine_id);return{connections:i,onlineCount:i.length}})});function $2(){const[n,l]=b.useState(!1);return b.useEffect(()=>{Pt.getState().fetchLibraries(),Bs.getState().fetchDaemonStatus()},[]),b.useEffect(()=>an.onStatusChange(s=>{s==="connected"&&(Pt.getState().fetchLibraries(),Bs.getState().fetchDaemonStatus())}),[]),f.jsxs("div",{className:"flex h-screen flex-col overflow-hidden",children:[f.jsx(L2,{onToggleSidebar:()=>l(!n)}),f.jsxs("div",{className:"flex min-h-0 flex-1",children:[f.jsx("div",{className:"hidden md:block",children:f.jsx(Mg,{})}),n&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"fixed inset-0 top-14 z-30 bg-black/40 md:hidden",onClick:()=>l(!1)}),f.jsx("div",{className:"fixed bottom-0 left-0 top-14 z-30 md:hidden",children:f.jsx(Mg,{onNavigate:()=>l(!1)})})]}),f.jsx("main",{className:"flex min-h-0 flex-1 flex-col overflow-x-hidden",children:f.jsx(Cx,{})})]})]})}function q2(){const{t:n}=Re();return f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center py-20 text-center",children:[f.jsx("h1",{className:"font-mono text-4xl font-bold uppercase tracking-wide text-c4a-text-primary md:text-5xl",children:n("home.hero.title")}),f.jsx("p",{className:"mt-6 max-w-lg text-base text-c4a-text-secondary",children:n("home.hero.description")}),f.jsxs("div",{className:"mt-10 flex items-center gap-4",children:[f.jsxs(ba,{to:"/studio",className:"flex items-center gap-2 rounded bg-c4a-accent px-5 py-2.5 font-mono text-xs font-semibold uppercase tracking-tight text-white transition-colors duration-150 hover:bg-c4a-accent-hover",children:[n("home.hero.cta.studio"),f.jsx(kx,{size:14})]}),f.jsx("a",{href:"https://github.com/context4ai/c4a",target:"_blank",rel:"noopener noreferrer",className:"rounded border border-c4a-border-default px-5 py-2.5 font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary transition-colors duration-150 hover:border-c4a-border-strong hover:text-c4a-text-primary",children:n("home.hero.cta.github")})]})]})}function Ja({title:n,version:l,description:s}){const{t:i}=Re();return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsxs("div",{className:"max-w-md text-center",children:[f.jsx("h2",{className:"font-mono text-2xl font-bold uppercase text-c4a-text-primary",children:n}),l&&f.jsx("span",{className:"mt-3 inline-block rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-1 font-mono text-xs uppercase text-c4a-accent",children:i("placeholder.coming",{version:l})}),f.jsx("p",{className:"mt-4 text-sm text-c4a-text-secondary",children:s})]})})}function Y2(){const{t:n}=Re();return f.jsx(Ja,{title:n("page.login.title"),version:"0.5.0",description:n("page.login.description")})}function G2(){const{t:n}=Re();return f.jsx(Ja,{title:n("page.docs.title"),version:"0.4.13",description:n("page.docs.description")})}function V2(){const{t:n}=Re();return f.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-c4a-bg-base p-8 text-center",children:[f.jsx("h1",{className:"font-mono text-6xl font-bold text-c4a-accent",children:n("notfound.title")}),f.jsx("p",{className:"mt-4 text-base text-c4a-text-secondary",children:n("notfound.description")}),f.jsx(ba,{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 kg(){const{t:n}=Re(),l=wx();let s="500",i=n("error.description");return Dr(l)?(s=String(l.status),l.status===404?i=n("notfound.description"):l.statusText&&(i=l.statusText)):l instanceof Error&&(i=l.message),console.error(`[ErrorPage] ${s}:`,l),f.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-c4a-bg-base p-8 text-center",children:[f.jsx("h1",{className:"font-mono text-6xl font-bold text-c4a-accent",children:s}),f.jsx("p",{className:"mt-4 max-w-md text-base text-c4a-text-secondary",children:i}),f.jsxs("div",{className:"mt-8 flex items-center gap-3",children:[f.jsxs("button",{onClick:()=>window.location.reload(),className:"flex items-center gap-2 rounded bg-c4a-accent px-5 py-2.5 font-mono text-xs uppercase tracking-tight text-white transition-colors duration-150 hover:bg-c4a-accent-hover",children:[f.jsx(u2,{size:14}),n("error.reload")]}),f.jsx(ba,{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 K2(){const{t:n}=Re();return f.jsx(Ja,{title:n("page.modeling.title"),version:"0.4.16",description:n("page.modeling.description")})}function X2(){const{t:n}=Re();return f.jsx(Ja,{title:n("page.brain.title"),version:"0.4.18",description:n("page.brain.description")})}function Q2(){const{t:n}=Re();return f.jsx(Ja,{title:n("page.discovery.title"),version:"0.6.x",description:n("page.discovery.description")})}function Z2(){const{t:n}=Re();return f.jsx(Ja,{title:n("page.sharing.title"),version:"0.4.39",description:n("page.sharing.description")})}function F2(){const{t:n}=Re();return f.jsx(Ja,{title:n("page.collaboration.title"),version:"0.5.x",description:n("page.collaboration.description")})}function J2(){const{t:n}=Re();return f.jsx(Ja,{title:n("page.settings.title"),version:"0.5.x",description:n("page.settings.description")})}function P2(){const{t:n}=Re();return f.jsx(Ja,{title:n("page.code_setup.title"),version:"0.4.13",description:n("page.code_setup.description")})}function I2(){const{t:n}=Re();return f.jsx(Ja,{title:n("page.code_compile.title"),version:"0.4.13",description:n("page.code_compile.description")})}function W2(){const{t:n}=Re();return f.jsx(Ja,{title:n("page.code_review.title"),version:"0.4.14",description:n("page.code_review.description")})}function e_(){const{t:n}=Re();return f.jsx(Ja,{title:n("page.code_result.title"),version:"0.4.14",description:n("page.code_result.description")})}const Co=(n,l)=>{for(const s of n){if(s.path===l)return s;if(s.children){const i=Co(s.children,l);if(i)return i}}return null},t_=(n,l)=>l===""?n:Co(n,l)?.children??[],Os=(n,l)=>{if(!l)return[];const s=l.split("/"),i=[];let o="";for(const u of s){o=o?`${o}/${u}`:u;const m=Co(n,o);m&&i.push(m)}return i},Ro=wo(n=>({rootSources:[],currentRoot:null,loading:!1,error:null,total:0,limit:100,offset:0,filter:"all",fetchRootSources:async({library_id:l,limit:s,offset:i})=>{n({loading:!0,error:null});try{const o={library_id:l};s!==void 0&&(o.limit=String(s)),i!==void 0&&(o.offset=String(i));const u=await vt.get("/sources",o);n({rootSources:u.items,total:u.total,limit:u.limit,offset:u.offset,loading:!1})}catch(o){n({error:o instanceof Error?o.message:"Failed to load sources",loading:!1})}},fetchRootSource:async l=>{const s=await vt.get(`/sources/${l}`);return n({currentRoot:s}),s},createSource:async l=>await vt.post("/sources",l),addTreeNode:async(l,s)=>{const i=await vt.post(`/sources/${l}/tree`,s);return n(o=>({rootSources:o.rootSources.map(u=>u.id===l?i:u),currentRoot:o.currentRoot?.id===l?i:o.currentRoot})),i},updateSource:async(l,s)=>{const i=await vt.put(`/sources/${l}`,s);n(o=>({rootSources:o.rootSources.map(u=>u.id===l?i:u),currentRoot:o.currentRoot?.id===l?i:o.currentRoot}))},deleteSource:async l=>{await vt.delete(`/sources/${l}`),n(s=>({rootSources:s.rootSources.filter(i=>i.id!==l),currentRoot:s.currentRoot?.id===l?null:s.currentRoot}))},deleteTreeNode:async(l,s)=>{const i=await vt.delete(`/sources/${l}/tree?path=${encodeURIComponent(s)}`);return n(o=>({rootSources:o.rootSources.map(u=>u.id===l?i:u),currentRoot:o.currentRoot?.id===l?i:o.currentRoot})),i},uploadDoc:async l=>await vt.post("/sources/upload",l),setFilter:l=>n({filter:l}),clearSources:()=>n({rootSources:[],currentRoot:null,total:0,offset:0})}));function Ar({segments:n}){const{t:l}=Re(),s=b.useRef(null),i=b.useRef(null),[o,u]=b.useState(0),m=[{label:l("sources.breadcrumb.sources")},...n],p=Math.max(0,m.length-3);b.useEffect(()=>{const h=s.current,v=i.current;if(!h||!v)return;const y=()=>{const j=h.clientWidth,N=Array.from(v.children);if(N.length===0)return;const T=N.map(W=>W.offsetWidth),D=4;if(T.reduce((W,w)=>W+w,0)+D*(T.length-1)<=j){u(0);return}const Z=20,G=(T[0]??0)+(T[1]??0)+D,V=T[T.length-1]??0,Q=G+D+Z+D+V;let ae=p;for(let W=1;W<=p;W++){let w=0;for(let $=2+W;$<T.length-1;$++)w+=T[$]+D;if(Q+w<=j){ae=W;break}}u(ae)};y();const _=new ResizeObserver(y);return _.observe(h),()=>_.disconnect()},[p,n,l]);const g=(()=>{if(o===0||m.length<=3)return m;const h=m.slice(0,2),v=m[m.length-1],y=m.slice(2+o,m.length-1);return[...h,{label:"…"},...y,v]})();return f.jsxs("div",{ref:s,className:"relative min-w-0 overflow-hidden",children:[f.jsx("nav",{className:"flex min-h-8 items-center gap-1 font-mono text-xs tracking-tight text-c4a-text-muted",children:g.map((h,v)=>{const y=v===g.length-1;return f.jsxs("span",{className:`flex shrink-0 items-center gap-1 ${v===0?"uppercase":""}`,children:[v>0&&f.jsx(ua,{size:12,className:"shrink-0 text-c4a-text-muted"}),h.to&&!y?f.jsx(ba,{to:h.to,className:"cursor-pointer whitespace-nowrap transition-colors hover:text-c4a-text-primary",children:h.label}):f.jsx("span",{className:`whitespace-nowrap ${y?"text-c4a-text-primary":""}`,children:h.label})]},v)})}),f.jsx("div",{ref:i,"aria-hidden":!0,className:"pointer-events-none invisible absolute left-0 top-0 flex h-0 items-center gap-1 overflow-visible whitespace-nowrap font-mono text-xs tracking-tight",children:m.map((h,v)=>f.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[v>0&&f.jsx(ua,{size:12}),f.jsx("span",{className:"whitespace-nowrap",children:h.label})]},v))})]})}const a_=["all","indexed","not_indexed"];function n_({value:n,onChange:l}){const{t:s}=Re(),[i,o]=b.useState(!1),u=b.useRef(null),m=b.useRef(null),p={all:s("sources.filter.all"),indexed:s("sources.filter.indexed"),not_indexed:s("sources.filter.not_indexed")},g=b.useCallback(y=>{u.current&&!u.current.contains(y.target)&&o(!1)},[]);b.useEffect(()=>{if(i)return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[i,g]);const h=b.useCallback(()=>{m.current&&(clearTimeout(m.current),m.current=null),o(!0)},[]),v=b.useCallback(()=>{m.current=setTimeout(()=>o(!1),150)},[]);return f.jsxs("div",{ref:u,className:"relative",onMouseEnter:h,onMouseLeave:v,children:[f.jsxs("button",{className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary sm:px-2 sm:py-1",children:[f.jsx(ZS,{size:12}),f.jsx("span",{className:"hidden sm:inline",children:p[n]}),f.jsx(ua,{size:12,className:`hidden transition-transform duration-200 sm:block ${i?"rotate-90":""}`})]}),i&&f.jsx("div",{className:"absolute right-0 top-full z-20 mt-1 min-w-[120px] rounded border border-c4a-border-default bg-c4a-bg-elevated py-1 shadow-c4a-lg",children:a_.map(y=>f.jsxs("button",{onClick:()=>{l(y),o(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left font-mono text-xs transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary ${y===n?"text-c4a-accent":"text-c4a-text-secondary"}`,children:[f.jsx(Al,{size:12,className:y===n?"opacity-100":"opacity-0"}),p[y]]},y))})]})}function Kx({currentName:n,onConfirm:l,onCancel:s,error:i}){const[o,u]=b.useState(n),m=b.useRef(null);b.useEffect(()=>{m.current?.select()},[]);const p=b.useCallback(()=>{const h=o.trim();h&&h!==n?l(h):s()},[o,n,l,s]),g=b.useCallback(h=>{h.key==="Enter"?(h.preventDefault(),p()):h.key==="Escape"&&s()},[p,s]);return f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("input",{ref:m,value:o,onChange:h=>u(h.target.value),onKeyDown:g,onBlur:p,className:"min-w-0 flex-1 rounded border border-c4a-accent bg-c4a-bg-surface px-2 py-1 text-sm text-c4a-text-primary outline-none",autoFocus:!0}),f.jsx("button",{onClick:h=>{h.stopPropagation(),p()},className:"rounded p-0.5 text-c4a-success hover:bg-c4a-bg-hover",children:f.jsx(Al,{size:14})}),f.jsx("button",{onClick:h=>{h.stopPropagation(),s()},className:"rounded p-0.5 text-c4a-error hover:bg-c4a-bg-hover",children:f.jsx(Ul,{size:14})}),i&&f.jsx("span",{className:"ml-1 text-xs text-c4a-error",children:i})]})}const l_=new Set(["package.json","pyproject.toml","setup.py","go.mod","cargo.toml","pom.xml","build.gradle"]),r_=new Set([".ts",".tsx",".md"]),s_=new Set([".md",".doc",".docx",".pdf",".ppt",".pptx",".txt"]),i_=new Set([".md",".txt"]),o_=5*1024*1024,c_=10;function bd(n){const l=n.lastIndexOf(".");return l>=0?n.slice(l).toLowerCase():""}function u_(n){const l=n.includes("/")?n.split("/").pop():n;if(l_.has(l.toLowerCase()))return!0;const s=bd(l);return r_.has(s)}const d_=n=>{const l=new Date(n);if(Number.isNaN(l.getTime()))return"";const s=o=>String(o).padStart(2,"0"),i=`${s(l.getMonth()+1)}-${s(l.getDate())} ${s(l.getHours())}:${s(l.getMinutes())}`;return l.getFullYear()===new Date().getFullYear()?i:`${l.getFullYear()}-${i}`},Ag={none:"bg-c4a-text-muted/40",indexed:"bg-c4a-success",stale:"bg-c4a-warning"};function f_({source:n,isDaemonLibrary:l,isRepoRoot:s}){const{t:i}=Re(),o=n.kind==="source",u=o&&(n.source_type==="code"||u_(n.name)),m=u?"text-c4a-accent":"text-c4a-text-secondary group-hover:text-c4a-accent",p=n.metadata?.origin==="remote";let g;if(n.kind==="folder"?g=s||p?f.jsx(Eo,{size:16,className:`shrink-0 ${m}`}):l?f.jsx(kS,{size:16,className:`shrink-0 ${m}`}):f.jsx(Qa,{size:16,className:`shrink-0 ${m}`}):n.source_type==="code"?g=f.jsx(Or,{size:16,className:`shrink-0 ${m}`}):g=f.jsx(cl,{size:16,className:`shrink-0 ${m}`}),!o||!u)return f.jsx(f.Fragment,{children:g});const h=Ag[n.index_status]??Ag.none,v=i(`sources.status.${n.index_status}`);return f.jsxs("span",{className:"group/dot relative shrink-0",children:[g,f.jsx("span",{className:`absolute -right-[2px] -top-[2px] block h-[5px] w-[5px] rounded-full ${h}`}),f.jsx("span",{className:"pointer-events-none absolute bottom-full left-1/2 z-50 mb-1.5 -translate-x-1/2 whitespace-nowrap rounded bg-c4a-bg-elevated px-2 py-1 font-mono text-[10px] text-c4a-text-secondary opacity-0 shadow-lg transition-opacity group-hover/dot:opacity-100",children:v})]})}function Lg({source:n,displayName:l,childCount:s,isDaemonLibrary:i,isRepoRoot:o,hasUpdate:u,onClick:m,onRename:p,onDelete:g}){const{t:h}=Re(),[v,y]=b.useState(!1),[_,j]=b.useState(null),N=b.useCallback(async G=>{if(!p)return;const V=await p(G);V?j(V):(y(!1),j(null))},[p]),T=b.useCallback(()=>{y(!1),j(null)},[]),D=!o&&p,Y=g,Z=n.updated_at||n.created_at;return f.jsxs("div",{className:"group flex cursor-pointer items-center gap-3 rounded py-2 pl-3 pr-5 transition-colors hover:bg-c4a-accent/10 hover:text-c4a-accent",onClick:v?void 0:m,children:[f.jsx(f_,{source:n,isDaemonLibrary:i??!1,isRepoRoot:o??!1}),v?f.jsx("div",{className:"min-w-0 flex-1",onClick:G=>G.stopPropagation(),children:f.jsx(Kx,{currentName:n.name,onConfirm:N,onCancel:T,error:_})}):f.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-c4a-text-secondary group-hover:text-c4a-accent",children:l??n.name}),f.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[u&&f.jsxs("span",{className:"inline-flex items-center gap-1 rounded-sm bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-tight text-c4a-accent/60",children:[f.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-c4a-accent"}),h("sources.change_detection.has_updates")]}),n.kind==="folder"&&s!==void 0&&f.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:h("common.items",{count:s})}),Z&&f.jsx("span",{className:"hidden font-mono text-[11px] text-c4a-text-muted lg:inline",children:d_(Z)})]}),(D||Y)&&f.jsxs("div",{className:"flex items-center gap-1 md:opacity-0 md:transition-opacity md:group-hover:opacity-100",children:[D?f.jsx("button",{title:h("sources.actions.rename"),onClick:G=>{G.stopPropagation(),y(!0)},className:"rounded p-1 text-c4a-text-muted transition-colors hover:text-c4a-accent",children:f.jsx(pd,{size:14})}):Y?f.jsx("span",{className:"p-1",children:f.jsx("span",{className:"inline-block h-[14px] w-[14px]"})}):null,Y&&f.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:f.jsx(Bx,{size:14})})]})]})}function Bl({children:n,onClose:l,className:s="",overlayClass:i="bg-black/50",closeOnOverlay:o=!0,closeOnEsc:u=!0,disableClose:m=!1}){const p=b.useRef(null);b.useEffect(()=>{if(!u)return;const h=v=>{v.key==="Escape"&&!m&&l()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[l,u,m]);const g=b.useCallback(h=>{o&&!m&&p.current&&!p.current.contains(h.target)&&l()},[l,o,m]);return f.jsx("div",{className:`fixed inset-0 z-50 flex items-center justify-center ${i}`,onClick:g,children:f.jsx("div",{ref:p,className:s,children:n})})}function Ug({target:n,onConfirm:l,onCancel:s}){const{t:i}=Re();return f.jsxs(Bl,{onClose:s,className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:i("sources.delete.confirm_title")}),f.jsxs("div",{className:"mt-4 space-y-3 text-sm text-c4a-text-secondary",children:[n.type==="resource"&&f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.resource",{name:n.name})}),f.jsx("p",{children:i("sources.delete.resource_impact")}),f.jsx("p",{className:"text-c4a-warning",children:i("sources.delete.session_warning")}),f.jsx("p",{children:i("sources.delete.entity_safe")})]}),n.type==="folder"&&f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.folder",{name:n.name})}),n.folderCount!==void 0&&n.sourceCount!==void 0?f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.folder_contents",{folders:n.folderCount,sources:n.sourceCount})}),n.indexedCount!==void 0&&n.indexedCount>0&&f.jsx("p",{children:i("sources.delete.indexed_hint",{indexed:n.indexedCount,total:n.sourceCount})})]}):f.jsx("p",{children:i("sources.delete.folder_impact_generic")}),f.jsx("p",{className:"text-c4a-warning",children:i("sources.delete.irreversible")})]}),n.type==="repo"&&f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.repo",{name:n.name,library:n.libraryName})}),n.packageCount!==void 0&&n.docCount!==void 0?f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.repo_contents",{packages:n.packageCount,docs:n.docCount})}),n.indexedCount!==void 0&&n.indexedCount>0&&f.jsx("p",{children:i("sources.delete.indexed_hint",{indexed:n.indexedCount,total:n.packageCount+n.docCount})})]}):f.jsx("p",{children:i("sources.delete.repo_impact_generic")}),f.jsx("p",{children:i("sources.delete.local_safe")}),f.jsx("p",{children:i("sources.delete.entity_safe")})]}),n.type==="client"&&f.jsxs(f.Fragment,{children:[f.jsx("p",{children:i("sources.delete.client",{name:n.name})}),f.jsx("p",{children:i("sources.delete.client_impact")}),f.jsx("p",{children:i("sources.delete.local_safe")}),f.jsx("p",{children:i("sources.delete.entity_safe")}),f.jsx("p",{className:"text-c4a-warning",children:i("sources.delete.irreversible")}),f.jsx("p",{className:"text-c4a-text-muted",children:i("sources.delete.client_reregister")})]})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[f.jsx("button",{onClick:s,className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:i("common.cancel")}),f.jsx("button",{onClick:l,className:"rounded bg-c4a-error px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-error/80",children:i("common.confirm")})]})]})}function m_({onConfirm:n,onCancel:l,error:s}){const{t:i}=Re(),[o,u]=b.useState(""),m=b.useRef(null);b.useEffect(()=>{m.current?.focus()},[]);const p=b.useCallback(()=>{const h=o.trim();h&&n(h)},[o,n]),g=b.useCallback(h=>{h.key==="Enter"&&(h.preventDefault(),p())},[p]);return f.jsxs(Bl,{onClose:l,className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Ux,{size:16,className:"shrink-0 text-c4a-accent"}),f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:i("sources.actions.new_folder")})]}),f.jsxs("div",{className:"mt-4",children:[f.jsx("input",{ref:m,value:o,onChange:h=>u(h.target.value),onKeyDown:g,placeholder:i("sources.folder.name_placeholder"),className:"w-full rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-2 text-sm text-c4a-text-primary outline-none transition-colors focus:border-c4a-accent",autoFocus:!0}),s&&f.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:s})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[f.jsx("button",{onClick:l,className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:i("common.cancel")}),f.jsx("button",{onClick:p,disabled:!o.trim(),className:"rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:i("common.confirm")})]})]})}function Wu({label:n,icon:l,items:s,alignRight:i}){const[o,u]=b.useState(!1),m=b.useRef(null),p=b.useRef(null),g=b.useCallback(y=>{m.current&&!m.current.contains(y.target)&&u(!1)},[]);b.useEffect(()=>{if(o)return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[o,g]);const h=b.useCallback(()=>{p.current&&(clearTimeout(p.current),p.current=null),u(!0)},[]),v=b.useCallback(()=>{p.current=setTimeout(()=>u(!1),150)},[]);return f.jsxs("div",{ref:m,className:"relative",onMouseEnter:h,onMouseLeave:v,children:[f.jsxs("button",{className:`flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary ${n?"p-1 sm:px-2 sm:py-1":"p-1"}`,children:[l,n&&f.jsx("span",{className:"hidden sm:inline",children:n}),n&&f.jsx(ua,{size:12,className:`hidden transition-transform duration-200 sm:block ${o?"rotate-90":""}`})]}),o&&f.jsx("div",{className:`absolute top-full z-20 mt-1 min-w-[160px] rounded border border-c4a-border-default bg-c4a-bg-elevated py-1 shadow-c4a-lg ${i?"right-0":"left-0"}`,children:s.map(y=>f.jsxs("button",{onClick:()=>{y.onClick(),u(!1)},className:"flex w-full items-center gap-2 px-3 py-1.5 text-left font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:[y.icon,y.label]},y.label))})]})}function h_({onClose:n}){const{t:l}=Re();return f.jsxs(Bl,{onClose:n,closeOnEsc:!1,className:"w-full max-w-sm rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(x2,{size:18,className:"text-c4a-accent"}),f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:l("sources.upgrade.title")})]}),f.jsx("p",{className:"mt-3 text-sm text-c4a-text-secondary",children:l("sources.upgrade.description")}),f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsx("button",{onClick:n,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:l("common.confirm")})})]})}function p_(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function g_({onConfirm:n,onCancel:l,error:s,uploading:i}){const{t:o}=Re(),[u,m]=b.useState([]),[p,g]=b.useState(null),[h,v]=b.useState(!1),y=b.useRef(null),_=b.useCallback(V=>{g(null);for(const Q of V){const ae=bd(Q.name);if(!s_.has(ae)){g(o("sources.upload.unsupported_type",{name:Q.name}));return}if(Q.size>o_){g(o("sources.upload.file_too_large",{name:Q.name}));return}}m(Q=>{const ae=new Map(Q.map(w=>[w.name,w]));for(const w of V)ae.set(w.name,{name:w.name,size:w.size,file:w});const W=Array.from(ae.values());return W.length>c_?(g(o("sources.upload.too_many_files")),Q):W})},[o]),j=b.useCallback(V=>{const Q=V.target.files;!Q||Q.length===0||(_(Array.from(Q)),V.target.value="")},[_]),N=b.useCallback(V=>{m(Q=>Q.filter((ae,W)=>W!==V)),g(null)},[]),T=b.useCallback(V=>{V.preventDefault(),v(!1);const Q=V.dataTransfer?.files;!Q||Q.length===0||_(Array.from(Q))},[_]),D=b.useCallback(V=>{V.preventDefault(),v(!0)},[]),Y=b.useCallback(V=>{V.preventDefault(),v(!1)},[]),Z=b.useCallback(async()=>{if(u.length===0)return;const V=await Promise.all(u.map(Q=>new Promise((ae,W)=>{const w=bd(Q.name),$=i_.has(w),te=new FileReader;te.onerror=()=>W(te.error),$?(te.onload=()=>ae({name:Q.name,content:te.result,encoding:"utf-8"}),te.readAsText(Q.file)):(te.onload=()=>{const fe=te.result,oe=fe.slice(fe.indexOf(",")+1);ae({name:Q.name,content:oe,encoding:"base64"})},te.readAsDataURL(Q.file))})));n(V)},[u,n]),G=s||p;return f.jsxs(Bl,{onClose:l,disableClose:i??!1,className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(xd,{size:16,className:"shrink-0 text-c4a-accent"}),f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:o("sources.upload.title")})]}),f.jsxs("div",{className:"mt-4",children:[f.jsx("input",{ref:y,type:"file",accept:".md,.doc,.docx,.pdf,.ppt,.pptx,.txt",multiple:!0,onChange:j,className:"hidden"}),f.jsxs("button",{type:"button",onClick:()=>y.current?.click(),onDrop:T,onDragOver:D,onDragLeave:Y,disabled:i,className:`flex w-full flex-col items-center justify-center rounded border-2 border-dashed px-4 py-8 transition-colors ${h?"border-c4a-accent bg-c4a-accent/5":"border-c4a-border-default hover:border-c4a-accent/50"} ${i?"cursor-not-allowed opacity-40":"cursor-pointer"}`,children:[f.jsx(xd,{size:24,className:"text-c4a-text-muted"}),f.jsx("p",{className:"mt-2 text-sm text-c4a-text-secondary",children:o("sources.upload.drop_hint")}),f.jsx("p",{className:"mt-1 text-[10px] text-c4a-text-muted",children:o("sources.upload.supported_formats")})]})]}),u.length>0&&f.jsxs("div",{className:"mt-3",children:[f.jsx("p",{className:"text-xs text-c4a-text-muted",children:o("sources.upload.selected",{count:u.length})}),f.jsx("div",{className:"mt-1 max-h-40 space-y-1 overflow-y-auto c4a-scrollbar",children:u.map((V,Q)=>f.jsxs("div",{className:"flex items-center gap-2 rounded bg-c4a-bg-surface px-2 py-1",children:[f.jsx(cl,{size:12,className:"shrink-0 text-c4a-text-muted"}),f.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-c4a-text-primary",children:V.name}),f.jsx("span",{className:"shrink-0 text-[10px] text-c4a-text-muted",children:p_(V.size)}),!i&&f.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:f.jsx(Ul,{size:12})})]},`${V.name}-${Q}`))})]}),G&&f.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:G}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[f.jsx("button",{onClick:l,disabled:i,className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:opacity-40",children:o("common.cancel")}),f.jsxs("button",{onClick:Z,disabled:u.length===0||i,className:"flex items-center gap-1.5 rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:[i&&f.jsx(Ma,{size:12,className:"animate-spin"}),o(i?"sources.upload.uploading":"common.confirm")]})]})]})}function x_({pathLabel:n,loading:l,badge:s,onNavigateUp:i,children:o}){return f.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1",children:[f.jsx("p",{className:"min-w-0 shrink truncate font-mono text-xs text-c4a-text-muted",children:n}),s]}),f.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),f.jsx("div",{className:"c4a-scrollbar flex min-h-0 flex-1 flex-col overflow-y-auto",children:l?f.jsx("div",{className:"flex flex-1 items-center justify-center py-8",children:f.jsx(Ma,{size:14,className:"animate-spin text-c4a-text-muted"})}):f.jsxs(f.Fragment,{children:[i&&f.jsxs("button",{onClick:i,className:"flex w-full cursor-pointer items-center gap-3 rounded pl-3 pr-5 py-2 text-left text-sm text-c4a-text-primary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(Qa,{size:16,className:"shrink-0 text-c4a-text-muted"}),f.jsx("span",{children:".."})]}),o]})})]})}function y_(n){const l=n.match(/^[\w.-]+@([\w.-]+):([\w./-]+?)(?:\.git)?$/);if(l){const s=l[1],i=l[2];return{slug:i,repoUrl:`https://${s}/${i}`,host:s}}try{const s=new URL(n),i=s.hostname,o=s.pathname.replace(/^\//,"").replace(/\.git$/,"");return o?{slug:o,repoUrl:`https://${i}/${o}`,host:i}:null}catch{return null}}function b_(n,l){return`${n}/tree/${encodeURIComponent(l)}`}function v_(n,l){return`${n}/commit/${l}`}function Xx({remoteUrl:n,fallbackName:l,branch:s,commit:i}){const o=n?y_(n):null,u=i.slice(0,7);return f.jsxs("div",{className:"flex min-w-0 shrink flex-wrap items-center gap-1.5 font-mono text-xs leading-none text-c4a-accent",children:[o?f.jsxs("a",{href:o.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 truncate hover:underline",title:o.repoUrl,children:[f.jsx(Eg,{size:12,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:o.slug})]}):f.jsxs("span",{className:"flex items-center gap-1 truncate",children:[f.jsx(Eg,{size:12,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:l||"repo"})]}),f.jsx("span",{className:"text-c4a-text-muted",children:"/"}),o?f.jsxs("a",{href:b_(o.repoUrl,s),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 hover:underline",children:[f.jsx(hd,{size:10,className:"shrink-0"}),f.jsx("span",{children:s})]}):f.jsxs("span",{className:"flex items-center gap-1",children:[f.jsx(hd,{size:10,className:"shrink-0"}),f.jsx("span",{children:s})]}),f.jsx("span",{className:"text-c4a-text-muted",children:"/"}),o?f.jsx("a",{href:v_(o.repoUrl,i),target:"_blank",rel:"noopener noreferrer",className:"hover:underline",children:u}):f.jsx("span",{children:u})]})}function S_(n,l,s){const[i,o]=b.useState({}),u=b.useRef(new Set);return b.useEffect(()=>{if(!n||!l||s.length===0)return;const m=s.filter(p=>{const g=p.metadata;return g?.origin==="remote"&&g?.remote_url&&g?.remote_commit&&!u.current.has(p.id)});if(m.length!==0){m.forEach(p=>u.current.add(p.id));for(const p of m){const g=p.metadata;vt.post("/import/remote/refs",{library_id:n,url:g.remote_url}).then(h=>{const v=g.remote_ref||"",y=h.branches?.find(_=>_.name===v)??h.tags?.find(_=>_.name===v);y&&y.commit!==g.remote_commit&&o(_=>({..._,[p.id]:!0}))}).catch(()=>{})}}},[n,l,s]),i}function __({library:n,onNewFolder:l,onImportRepo:s,onImportDir:i,onUpgrade:o}){const{t:u}=Re(),m=n.type==="daemon";return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsxs("div",{className:"max-w-2xl text-center",children:[f.jsx("h3",{className:"font-mono text-lg font-bold uppercase text-c4a-text-primary",children:u(m?"sources.empty.daemon.title":"sources.empty.cloud.title")}),f.jsx("p",{className:"mt-3 text-sm text-c4a-text-secondary",children:u(m?"sources.empty.daemon.description":"sources.empty.cloud.description")}),f.jsx("div",{className:"mt-6 flex justify-center gap-3",children:m?f.jsxs(f.Fragment,{children:[i&&f.jsx("button",{onClick:i,disabled:!n.is_online,className:"rounded border border-c4a-border-default bg-c4a-bg-surface px-4 py-2 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:opacity-40",children:u("sources.actions.import_dir")}),s&&f.jsx("button",{onClick:s,disabled:!n.is_online,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:u("sources.actions.import_repo")})]}):f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:l,className:"rounded border border-c4a-border-default bg-c4a-bg-surface px-4 py-2 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:u("sources.actions.new_folder")}),o&&f.jsx("button",{onClick:o,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent-hover",children:u("sources.actions.import_repo_url")})]})})]})})}function j_(){const{t:n}=Re();return f.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6 text-center",children:[f.jsx("h4",{className:"font-mono text-sm font-bold text-c4a-text-primary",children:n("sources.empty.indexed.title")}),f.jsx("p",{className:"mt-2 text-xs text-c4a-text-secondary",children:n("sources.empty.indexed.description")})]})}const ed=n=>{let l=0,s=0,i=0,o=0,u=0;const m=p=>{for(const g of p.children??[])g.kind==="folder"?(l++,m(g)):g.kind==="source"&&(s++,g.source_type==="code"?i++:o++,(g.index_status==="indexed"||g.index_status==="stale")&&u++)};return m(n),{folders:l,sources:s,codeSources:i,docSources:o,indexedSources:u}};function N_(){const{t:n}=Re(),l=kn(),{libId:s}=Vs(),[i,o]=No(),u=i.get("rootId")||null,m=i.get("path")||"",g=Pt(Hl(kr)).find(K=>K.id===s),h=Pt(K=>K.updateLibraryName),v=Pt(K=>K.deleteLibrary),{rootSources:y,currentRoot:_,loading:j,filter:N,fetchRootSources:T,fetchRootSource:D,createSource:Y,addTreeNode:Z,updateSource:G,deleteSource:V,deleteTreeNode:Q,uploadDoc:ae,setFilter:W}=Ro(),[w,$]=b.useState(!1),[te,fe]=b.useState(null),[oe,re]=b.useState(null),[de,pe]=b.useState(null),[k,P]=b.useState(null),[J,ce]=b.useState(!1),[Se,E]=b.useState(!1),[U,ee]=b.useState(null),[le,be]=b.useState(!1),[Ne,ze]=b.useState(!1),[Pe,Qe]=b.useState(null),[It,fa]=b.useState(!1);b.useEffect(()=>{s&&T({library_id:s})},[s,T]),b.useEffect(()=>{u&&D(u)},[u,D]);const Ze=u!==null,tt=b.useMemo(()=>Ze?_?[...t_(_.tree,m)].sort((Ae,$e)=>Ae.kind!==$e.kind?Ae.kind==="folder"?-1:1:Ae.name.localeCompare($e.name)).map(Ae=>({type:"node",root:_,node:Ae})):[]:[...y].sort(($e,Le)=>$e.kind!==Le.kind?$e.kind==="folder"?-1:1:new Date(Le.created_at).getTime()-new Date($e.created_at).getTime()).map($e=>({type:"root",root:$e,node:null})),[Ze,y,_,m]),dt=b.useMemo(()=>N==="all"?tt:tt.filter(K=>K.type==="root"||!K.node||K.node.kind==="folder"?!0:N==="indexed"?K.node.index_status==="indexed":K.node.index_status==="none"||!K.node.index_status),[tt,N]),$t=g?.type==="daemon",Gt=g?.type==="cloud",Wt=$t&&!Ze,na=S_(s,Gt,y),va=b.useMemo(()=>{if(!g)return[];const K=[{label:g.id===ul?n("sources.library.default_cloud_name"):g.name,to:`/studio/sources/${g.id}`}];return Ze&&_&&(K.push({label:_.name,to:`/studio/sources/${g.id}?rootId=${_.id}`}),m&&Os(_.tree,m).forEach(Ae=>{K.push({label:Ae.name,to:`/studio/sources/${g.id}?rootId=${_.id}&path=${encodeURIComponent(Ae.path)}`})})),K},[g,Ze,_,m,n]),Sa=b.useCallback(async K=>{if(s)try{Ze&&u?await Z(u,{parent_path:m,kind:"folder",name:K}):(await Y({library_id:s,kind:"folder",name:K}),T({library_id:s})),$(!1),fe(null)}catch(ie){ie instanceof Dl&&ie.status===409&&fe(n("sources.error.name_conflict",{name:K}))}},[s,Ze,u,m,Y,Z,T,n]),Aa=b.useCallback(K=>{s&&(K.type==="root"?K.root.kind==="source"?l(`/studio/source/${K.root.id}`):o({rootId:K.root.id}):K.node&&(K.node.kind==="folder"?o({rootId:K.root.id,path:K.node.path}):l(`/studio/source/${K.root.id}?path=${encodeURIComponent(K.node.path)}`)))},[s,l,o]),la=b.useCallback(()=>{if(!(!u||!s))if(m){const K=m.split("/");K.pop();const ie=K.join("/");o(ie?{rootId:u,path:ie}:{rootId:u})}else o({})},[u,s,m,o]),ra=b.useCallback(async(K,ie)=>{try{return await G(K,{name:ie}),T({library_id:s}),null}catch(Ae){return Ae instanceof Dl&&Ae.status===409?n("sources.error.name_conflict",{name:ie}):null}},[s,G,T,n]),ht=b.useCallback(K=>{if(K.type==="root"){pe(K.root.id),P(null);const ie=K.root.tree.length>0?ed({children:K.root.tree}):void 0;re($t?{type:"repo",name:K.root.name,libraryName:g.name,...ie?{packageCount:ie.codeSources,docCount:ie.docSources,indexedCount:ie.indexedSources}:{}}:{type:K.root.kind==="folder"?"folder":"resource",name:K.root.name,...K.root.kind==="folder"&&ie?{folderCount:ie.folders,sourceCount:ie.sources,indexedCount:ie.indexedSources}:{}})}else if(K.node)if(pe(K.root.id),P(K.node.path),K.node.kind==="folder"){const ie=ed(K.node);re({type:"folder",name:K.node.name,folderCount:ie.folders,sourceCount:ie.sources,indexedCount:ie.indexedSources})}else re({type:"resource",name:K.node.name})},[$t,g]),sa=b.useCallback(async()=>{if(!(!de||!s)){try{k?await Q(de,k):(await V(de),T({library_id:s}))}catch{}re(null),pe(null),P(null)}},[de,k,s,V,Q,T]),ge=b.useCallback(()=>{if(!s)return;const K=new URLSearchParams;u&&(K.set("parentId",u),_&&K.set("parentName",_.name)),m&&K.set("parentPath",m);const ie=K.toString();l(`/studio/sources/import/${s}${ie?`?${ie}`:""}`)},[s,l,u,m,_]),ke=b.useCallback(()=>{s&&l(`/studio/sources/import-dir/${s}`)},[s,l]),Ve=b.useCallback(async K=>{if(s){be(!0),ee(null);try{const ie={library_id:s,files:K.map(Ae=>{const $e={file_name:Ae.name,content:Ae.content};return Ae.encoding&&($e.encoding=Ae.encoding),$e})};Ze&&u&&(ie.root_source_id=u,ie.parent_path=m),await ae(ie),Ze&&u?D(u):T({library_id:s}),E(!1)}catch(ie){ie instanceof Dl&&ie.status===409?ee(n("sources.error.name_conflict",{name:K[0]?.name??""})):ie instanceof Dl&&ee(ie.message)}finally{be(!1)}}},[s,Ze,u,m,ae,T,D,n]),jt=g?.id===ul,Nt=b.useCallback(async K=>{if(s)try{await h(s,K),ze(!1),Qe(null)}catch(ie){const Ae=ie instanceof Error?ie.message:String(ie);Qe(Ae)}},[s,h]),Xt=b.useCallback(()=>{ze(!1),Qe(null)},[]),_a=b.useCallback(async()=>{if(s){try{await v(s),l("/studio/sources/add-client")}catch{}fa(!1)}},[s,v,l]),ia=b.useCallback(()=>{fa(!1)},[]);if(!g)return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})});const _t=y.length===0&&N==="all"&&!j&&!Ze,wt=dt.filter(K=>K.type==="node"&&K.node?.kind==="source").length===0&&N==="indexed"&&!j,kt=!Ze||!_?!1:_.metadata?.origin==="remote"?!0:m?Os(_.tree,m).some(ie=>ie.metadata?.origin==="remote"):!1,_e=!Wt,He=Gt&&!kt,Ie=Wt;return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx("div",{className:"min-w-0 flex-1",children:Ne?f.jsx(Kx,{currentName:g.name,onConfirm:Nt,onCancel:Xt,error:Pe}):f.jsx(Ar,{segments:va})}),f.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[He&&f.jsxs(f.Fragment,{children:[f.jsx(Wu,{label:n("sources.actions.upload"),icon:f.jsx(xd,{size:14}),items:[{label:n("sources.actions.upload_doc"),icon:f.jsx(cl,{size:14}),onClick:()=>E(!0)}]}),f.jsx(Wu,{label:n("sources.actions.add"),icon:f.jsx(Hx,{size:14}),items:[{label:n("sources.actions.add_folder"),icon:f.jsx(Ux,{size:14}),onClick:()=>$(!0)},{label:n("sources.actions.add_web"),icon:f.jsx(YS,{size:14}),onClick:()=>ce(!0)},{label:n("sources.actions.add_feishu"),icon:f.jsx(wS,{size:14}),onClick:()=>ce(!0)}]}),f.jsxs("button",{onClick:()=>{const K=new URLSearchParams;u&&(K.set("parentId",u),_&&K.set("parentName",_.name)),m&&K.set("parentPath",m);const ie=K.toString();l(`/studio/sources/import-remote/${s}${ie?`?${ie}`:""}`)},className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary sm:px-2 sm:py-1",children:[f.jsx(wg,{size:14}),f.jsx("span",{className:"hidden sm:inline",children:n("sources.actions.import_repo_url")})]})]}),Ie&&f.jsxs(f.Fragment,{children:[f.jsxs("button",{onClick:ke,disabled:!g.is_online,title:g.is_online?void 0:n("sources.import.daemon_offline",{name:g.name}),className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:cursor-not-allowed disabled:opacity-40 sm:px-2 sm:py-1",children:[f.jsx(DS,{size:14}),f.jsx("span",{className:"hidden sm:inline",children:n("sources.actions.import_dir")})]}),f.jsxs("button",{onClick:ge,disabled:!g.is_online,title:g.is_online?void 0:n("sources.import.daemon_offline",{name:g.name}),className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:cursor-not-allowed disabled:opacity-40 sm:px-2 sm:py-1",children:[f.jsx(wg,{size:14}),f.jsx("span",{className:"hidden sm:inline",children:n("sources.actions.import_repo")})]}),f.jsx(Wu,{label:"",icon:f.jsx(pd,{size:14}),alignRight:!0,items:[{label:n("sources.library.rename"),icon:f.jsx(pd,{size:14}),onClick:()=>ze(!0)},...jt?[]:[{label:n("sources.actions.delete"),icon:f.jsx(Bx,{size:14}),onClick:()=>fa(!0)}]]})]}),_e&&f.jsx(n_,{value:N,onChange:W})]})]}),_t?f.jsx(__,{library:g,onNewFolder:()=>$(!0),...$t?{onImportRepo:ge,onImportDir:ke}:{},...Gt?{onUpgrade:()=>{const K=new URLSearchParams;u&&(K.set("parentId",u),_&&K.set("parentName",_.name)),m&&K.set("parentPath",m);const ie=K.toString();l(`/studio/sources/import-remote/${s}${ie?`?${ie}`:""}`)}}:{}}):f.jsx(x_,{pathLabel:(()=>{if(!Ze||!_)return"/";const K=_.metadata,ie=$t?typeof K?.local_path=="string"?K.local_path:_.name:"/"+_.name;if(!m)return ie;const Ae=Os(_.tree,m);return ie+"/"+Ae.map($e=>$e.name).join("/")})(),loading:j,badge:(()=>{if(!Ze||!_)return;let K=_.metadata,ie=_.name;if(!K?.origin&&m){const Le=Os(_.tree,m);for(const Et of Le){const ja=Et.metadata;if(ja?.origin==="remote"){K=ja,ie=Et.name;break}}}const Ae=K?.pinned_branch??K?.remote_ref,$e=K?.pinned_hash??K?.remote_commit;if(!(!Ae||!$e))return f.jsx(Xx,{remoteUrl:K?.remote_url,fallbackName:ie,branch:Ae,commit:$e})})(),onNavigateUp:Ze?la:void 0,children:dt.length===0?wt?f.jsx(j_,{}):Ze?null:f.jsx("p",{className:"py-8 text-center text-xs text-c4a-text-muted",children:n("common.items",{count:0})}):f.jsx("div",{className:"flex flex-col gap-0.5",children:dt.map(K=>{if(K.type==="root"){const Le=K.root,Et=$t,ja=Et?Le.metadata?.local_path:void 0,oa=Le.tree.length>0?ed({children:Le.tree}):void 0,La=oa?oa.folders+oa.sources:0,Na=Le.metadata,dl=Na?.origin==="remote",$l=Na?.import_type==="directory",ql=dl||Et&&!$l;return f.jsx(Lg,{source:{id:Le.id,library_id:Le.library_id,owner_id:Le.owner_id,path:"",kind:Le.kind,source_type:Le.source_type,name:Le.name,content_hash:Le.content_hash,metadata:Le.metadata,index_status:Le.index_status,created_at:Le.created_at,updated_at:Le.updated_at},...typeof ja=="string"?{displayName:ja}:{},...Le.kind==="folder"?{childCount:La}:{},isDaemonLibrary:$t??!1,isRepoRoot:ql,...na[Le.id]?{hasUpdate:!0}:{},onClick:()=>Aa(K),...dl?{}:{onRename:C=>ra(Le.id,C)},onDelete:()=>ht(K)},Le.id)}const ie=K.node,Ae=`${K.root.id}:${ie.path}`,$e=ie.kind==="folder"?ie.children?.length??0:void 0;return f.jsx(Lg,{source:{id:K.root.id,library_id:K.root.library_id,owner_id:K.root.owner_id,path:ie.path,kind:ie.kind,source_type:ie.source_type??null,name:ie.name,content_hash:null,metadata:ie.metadata??null,index_status:ie.index_status??"none",created_at:K.root.created_at,updated_at:K.root.updated_at},...$e!==void 0?{childCount:$e}:{},isDaemonLibrary:$t??!1,onClick:()=>Aa(K),...Gt&&K.root.metadata?.origin!=="remote"?{onDelete:()=>ht(K)}:{}},Ae)})})}),w&&f.jsx(m_,{onConfirm:Sa,onCancel:()=>{$(!1),fe(null)},error:te}),Se&&f.jsx(g_,{onConfirm:Ve,onCancel:()=>{E(!1),ee(null)},error:U,uploading:le}),J&&f.jsx(h_,{onClose:()=>ce(!1)}),oe&&f.jsx(Ug,{target:oe,onConfirm:sa,onCancel:()=>{re(null),pe(null),P(null)}}),It&&g&&f.jsx(Ug,{target:{type:"client",name:g.name},onConfirm:_a,onCancel:ia})]})}function fn({active:n,current:l}){return f.jsx("span",{className:`inline-block h-2.5 w-2.5 rounded-full border-2 ${l?"border-c4a-accent bg-c4a-accent":n?"border-c4a-accent bg-transparent":"border-c4a-border-default bg-transparent"}`})}function Ml(){return f.jsx("span",{className:"h-px flex-1 bg-c4a-border-default"})}function Qx({libraryName:n}){const{t:l}=Re();return f.jsxs("div",{className:"rounded border border-c4a-warning/30 bg-c4a-bg-surface p-6 text-center",children:[f.jsx("p",{className:"text-sm text-c4a-warning",children:l("sources.import.daemon_offline",{name:n})}),f.jsx(ba,{to:"/studio/sources/add-client",className:"mt-4 inline-block rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:l("sources.import.view_guide")})]})}function zd({step:n,totalSteps:l,importing:s,stepBusy:i,canProceed:o,safetyNoticeKey:u,confirmLabelKey:m,onPrev:p,onNext:g,onImport:h}){const{t:v}=Re();return f.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-4 sm:mt-6",children:[f.jsx("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-c4a-text-muted line-clamp-1 sm:line-clamp-none",title:v(u),onClick:y=>y.currentTarget.classList.toggle("line-clamp-1"),children:v(u)}),f.jsxs("div",{className:"flex shrink-0 gap-2",children:[n>1&&f.jsx("button",{onClick:p,disabled:s||i,className:"rounded border border-c4a-border-default px-4 py-2 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover disabled:opacity-40",children:v("common.previous")}),n<l?f.jsx("button",{onClick:g,disabled:!o||i,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:v("common.next")}):f.jsxs("button",{onClick:h,disabled:s||i||!o,className:"flex items-center gap-1.5 rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:[s&&f.jsx(Ma,{size:12,className:"animate-spin"}),v(s?"sources.import.importing":m)]})]})]})}function Zx(n,l){const s=b.useCallback(async(m,p)=>{if(!n)throw new Error("No library");const g=await vt.post(`/libraries/${n}/rpc`,{method:m,params:p});if(g.error){const h=g.error;throw new Error(h.message??JSON.stringify(g.error))}return g.result??g},[n]),[i,o]=b.useState([]);b.useEffect(()=>{if(!n)return;let m=!1;return(async()=>{try{const p=await vt.get("/sources",{library_id:n,limit:"500"});if(m)return;const g=p.items.map(h=>{const v=h.metadata;return typeof v?.local_path=="string"?v.local_path:null}).filter(h=>h!==null);o(g)}catch{}})(),()=>{m=!0}},[n]);const u=b.useMemo(()=>{const m=l?.config;return!m||!Array.isArray(m.allowed_paths)?[]:m.allowed_paths},[l]);return{rpc:s,importedPaths:i,allowedPaths:u}}function w_(n,l){const s=n.toLowerCase();try{if(s.endsWith("package.json")){const i=JSON.parse(l);if(typeof i.name=="string"&&i.name.trim())return i.name.trim()}if(s.endsWith("pyproject.toml"))return l.match(/^\s*name\s*=\s*["']([^"']+)["']/m)?.[1]??null;if(s.endsWith("go.mod"))return l.match(/^\s*module\s+([^\s]+)\s*$/m)?.[1]??null;if(s.endsWith("cargo.toml"))return l.match(/^\s*name\s*=\s*["']([^"']+)["']/m)?.[1]??null;if(s.endsWith("pom.xml"))return l.match(/<artifactId>([^<]+)<\/artifactId>/)?.[1]?.trim()??null;if(s.endsWith("build.gradle"))return l.match(/rootProject\.name\s*=\s*["']([^"']+)["']/)?.[1]??null}catch{return null}return null}function Fx(n,l,s="repo"){const i=[];for(const u of n){const m=u.path.split("/"),p=m.slice(0,-1).join("/")||".",g=m.length===1||u.path==="package.json",h=p==="."?s:m[m.length-2]||p,v=w_(u.path,u.content);i.push({name:v||h,path:p,isRoot:g})}const o=l.filter(u=>/\.md$/i.test(u.path)).map(u=>u.path);return{packages:i,mdFiles:o}}const Hg=new Set(["tree","blob","commit","commits","raw","src"]),E_=new Set(["commit","commits"]);function C_(n){let l;try{l=new URL(n.trim())}catch{return{repoUrl:n.trim()}}const s=l.pathname.split("/").filter(Boolean);let i=-1;for(let h=2;h<s.length;h++){const v=s[h];if(v==="-"&&h+1<s.length&&Hg.has(s[h+1])){i=h;break}if(Hg.has(v)){i=h;break}}if(i===-1)return{repoUrl:`${l.protocol}//${l.host}${l.pathname}`.replace(/\/+$/,"")};const o=s.slice(0,i).join("/"),u=`${l.protocol}//${l.host}/${o}`;let m,p;if(s[i]==="-"?(m=s[i+1],p=i+2):(m=s[i],p=i+1),p>=s.length)return{repoUrl:u};const g=s[p];return E_.has(m)?{repoUrl:u,commit:g}:{repoUrl:u,ref:g}}function il(n){try{return(new URL(n).pathname.split("/").pop()??"repo").replace(/\.git$/i,"")||"repo"}catch{return n.split("/").pop()||n}}function Jx(){const n=new Date;return`${String(n.getHours()).padStart(2,"0")}:${String(n.getMinutes()).padStart(2,"0")}:${String(n.getSeconds()).padStart(2,"0")}`}function Px(){const{t:n}=Re(),[l,s]=b.useState(!1),[i,o]=b.useState(null),u=b.useRef(),m=b.useRef(),p=window.location.host,g=`c4a-daemon --server ${p} --allow <dir1> <dir2>`,h=`c4a-daemon --server ${p}`,v=b.useCallback((j,N)=>{navigator.clipboard.writeText(j),o(N),clearTimeout(u.current),u.current=setTimeout(()=>o(null),1500)},[]),y=b.useCallback(()=>{clearTimeout(m.current),s(!0)},[]),_=b.useCallback(()=>{m.current=setTimeout(()=>s(!1),150)},[]);return f.jsxs("span",{className:"relative",onMouseEnter:y,onMouseLeave:_,children:[f.jsx(Ax,{size:12,className:"text-c4a-warning"}),l&&f.jsxs("span",{className:"absolute left-full top-1/2 z-10 ml-2 -translate-y-1/2 rounded border border-c4a-border-default bg-c4a-bg-elevated px-2.5 py-2 shadow-lg",onMouseEnter:y,onMouseLeave:_,children:[f.jsx("span",{className:"block whitespace-nowrap font-mono text-xs text-c4a-text-secondary",children:n("sources.import.allowed_dirs_tooltip_restrict")}),f.jsxs("span",{className:"mt-1 flex items-center gap-1.5 whitespace-nowrap",children:[f.jsx("span",{className:"font-mono text-xs text-c4a-accent",children:g}),f.jsx("button",{onClick:()=>v(g,0),className:"shrink-0 rounded p-0.5 text-c4a-accent transition-colors hover:bg-c4a-bg-hover",title:"Copy",children:i===0?f.jsx(Al,{size:10}):f.jsx(md,{size:10})})]}),f.jsx("span",{className:"mt-2 block whitespace-nowrap font-mono text-xs text-c4a-text-secondary",children:n("sources.import.allowed_dirs_tooltip_all")}),f.jsxs("span",{className:"mt-1 flex items-center gap-1.5 whitespace-nowrap",children:[f.jsx("span",{className:"font-mono text-xs text-c4a-accent",children:h}),f.jsx("button",{onClick:()=>v(h,1),className:"shrink-0 rounded p-0.5 text-c4a-accent transition-colors hover:bg-c4a-bg-hover",title:"Copy",children:i===1?f.jsx(Al,{size:10}):f.jsx(md,{size:10})})]})]})]})}function Ix({open:n,onClose:l,rpc:s,onNavigate:i,defaultPath:o}){const{t:u}=Re(),[m,p]=b.useState(o??""),[g,h]=b.useState(null),[v,y]=b.useState(!1),_=b.useRef(null);b.useEffect(()=>{o&&!m&&p(o)},[o]);const j=b.useCallback(async()=>{const T=m.trim();if(T){y(!0),h(null);try{(await s("fs/exists",{path:T})).exists?(i(T),p(o??""),h(null),l()):h(u("sources.import.wildcard_path_not_found"))}catch(D){h(D instanceof Error?D.message:String(D))}finally{y(!1)}}},[m,s,u,i,l]),N=b.useCallback(()=>{p(o??""),h(null),l()},[l,o]);return n?f.jsxs(Bl,{onClose:N,closeOnOverlay:!1,closeOnEsc:!1,overlayClass:"bg-black/40",className:"w-full max-w-md rounded-lg border border-c4a-border-default bg-c4a-bg-surface p-5 shadow-xl",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("h3",{className:"font-mono text-sm font-medium text-c4a-text-primary",children:u("sources.import.wildcard_go_title")}),f.jsx("button",{onClick:N,className:"rounded p-1 text-c4a-text-muted transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-secondary",children:f.jsx(Ul,{size:14})})]}),f.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[f.jsx("input",{ref:_,type:"text",value:m,onChange:T=>{p(T.target.value),h(null)},onKeyDown:T=>{T.key==="Enter"&&j()},placeholder:u("sources.import.wildcard_path_placeholder"),autoFocus:!0,className:"flex-1 rounded border border-c4a-border-default bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-text-primary outline-none transition-colors focus:border-c4a-accent"}),f.jsxs("button",{onClick:j,disabled:v||!m.trim(),className:"flex shrink-0 items-center gap-1.5 rounded bg-c4a-accent px-3 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:[v?f.jsx(Ma,{size:12,className:"animate-spin"}):f.jsx(kx,{size:12}),u("sources.import.wildcard_go")]})]}),g&&f.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:g})]}):null}function Wx({rpc:n,allowedPaths:l,importedPaths:s,onNavigateUpExtra:i}){const o=!!l&&l.length>0,u=o&&l.length===1&&l[0]==="*",[m,p]=b.useState(o),[g,h]=b.useState(o&&!u?"":"/"),[v,y]=b.useState([]),[_,j]=b.useState(!1),[N,T]=b.useState(null),[D,Y]=b.useState(null);b.useEffect(()=>{if(o&&!u)return;let $=!1;return(async()=>{try{const te=await n("fs/homeDir",{});$||Y(te.home_dir)}catch{$||Y("/")}})(),()=>{$=!0}},[o,u,n]);const[Z,G]=b.useState(!1),V=b.useCallback(async $=>{j(!0),T(null);try{const te=await n("fs/listTree",{path:$,depth:1});y(te.entries||[]),h($),p(!1)}catch(te){const fe=te instanceof Error?te.message:String(te);T(fe)}finally{j(!1)}},[n]);b.useEffect(()=>{o&&!u||D!==null&&V(D)},[D,o,u,V]);const Q=b.useMemo(()=>new Set(s??[]),[s]),ae=b.useCallback(()=>{if(o&&!u&&l.some(fe=>fe===g)){p(!0),h(""),y([]),T(null),i?.();return}const $=g.split("/").slice(0,-1).join("/")||"/";i?.(),V($)},[o,u,l,g,V,i]),W=b.useMemo(()=>v.filter($=>$.type==="directory"),[v]),w=b.useMemo(()=>v.filter($=>$.type==="file"),[v]);return{atRoot:m,currentPath:g,entries:v,loading:_,error:N,homeDir:D,goToOpen:Z,hasAllowedPaths:o,isWildcard:u,importedSet:Q,dirs:W,files:w,loadTree:V,handleNavigateUp:ae,setGoToOpen:G}}function R_({rpc:n,selectedPath:l,onSelect:s,allowedPaths:i,importedPaths:o}){const{t:u}=Re(),[m,p]=b.useState(null),{atRoot:g,currentPath:h,entries:v,loading:y,error:_,homeDir:j,goToOpen:N,isWildcard:T,importedSet:D,dirs:Y,files:Z,loadTree:G,handleNavigateUp:V,setGoToOpen:Q}=Wx({rpc:n,allowedPaths:i??[],importedPaths:o??[],onNavigateUpExtra:()=>p(null)}),[ae,W]=b.useState(null),[w,$]=b.useState(!1);b.useEffect(()=>{if(!l){W(null),$(!1);return}W(null),$(!0);let re=!1;return(async()=>{try{const de=await n("fs/repoStatus",{path:l});re||(W({branch:de.branch,hash:de.head_hash,remoteUrl:de.remote_url}),$(!1))}catch{re||(W(null),$(!1))}})(),()=>{re=!0}},[l,n]);const te=b.useCallback(re=>{if(re.type==="directory")if(re.is_git_repo){if(D.has(re.path))return;p(null),s(re.path,re.name)}else p(re.path),G(re.path)},[s,G,D]),fe=b.useMemo(()=>Y.sort((re,de)=>re.is_git_repo&&!de.is_git_repo?-1:!re.is_git_repo&&de.is_git_repo?1:re.name.localeCompare(de.name)),[Y]),oe=b.useMemo(()=>Z.sort((re,de)=>re.name.localeCompare(de.name)),[Z]);return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1",children:[g?f.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[f.jsx("span",{children:u("sources.import.allowed_dirs")}),f.jsx(Px,{})]}):f.jsx("p",{className:"min-w-0 shrink truncate font-mono text-xs text-c4a-text-muted",children:h}),l&&w?f.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 font-mono text-xs text-c4a-accent",children:[f.jsx(Ma,{size:12,className:"animate-spin"}),f.jsx("span",{children:u("common.loading")})]}):l&&ae?f.jsx(Xx,{remoteUrl:ae.remoteUrl,fallbackName:l.split("/").pop()||l,branch:ae.branch,commit:ae.hash}):!l&&T&&g?f.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:u("sources.import.wildcard_goto")}):null]}),f.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),g?T?f.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:j&&f.jsxs("button",{onClick:()=>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:[f.jsx(Qa,{size:14,className:"shrink-0"}),f.jsxs("span",{className:"truncate",children:[j,f.jsxs("span",{className:"ml-1.5 text-c4a-text-muted",children:["(",u("sources.import.wildcard_home"),")"]})]}),f.jsx(ua,{size:12,className:"shrink-0 text-c4a-text-muted"})]})}):f.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:i.map(re=>f.jsxs("button",{onClick:()=>G(re),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(Qa,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:re}),f.jsx(ua,{size:12,className:"shrink-0 text-c4a-text-muted"})]},re))}):_&&!y?f.jsx("p",{className:"py-4 text-xs text-c4a-error",children:_}):f.jsxs("div",{className:"relative min-h-[5rem] min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:[y&&f.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-c4a-bg-surface/60",children:f.jsx(Ma,{size:14,className:"animate-spin text-c4a-text-muted"})}),h!=="/"&&f.jsxs("button",{onClick:V,disabled:y,className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary hover:bg-c4a-bg-hover disabled:pointer-events-none",children:[f.jsx(Qa,{size:14}),f.jsx("span",{children:".."})]}),fe.map(re=>{const de=re.is_git_repo&&D.has(re.path),pe=re.is_git_repo?Eo:Qa;return f.jsxs("div",{className:`flex w-full items-center rounded pl-2 pr-4 text-left text-sm transition-colors ${de?"cursor-not-allowed text-c4a-accent/60":l===re.path?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-accent/10 hover:text-c4a-accent"}`,children:[f.jsxs("button",{onClick:()=>te(re),disabled:de||y,className:"flex flex-1 items-center gap-2 px-2 py-1.5",children:[f.jsx(pe,{size:14,className:"shrink-0"}),f.jsx("span",{className:"flex-1 truncate text-left",children:re.name}),de&&f.jsx("span",{className:"rounded bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] text-c4a-accent/60",children:u("sources.import.already_imported")})]}),!de&&f.jsx("button",{onClick:k=>{k.stopPropagation(),G(re.path)},disabled:y,className:"shrink-0 rounded p-1.5 text-c4a-text-muted transition-colors hover:bg-c4a-accent/10 hover:text-c4a-accent disabled:pointer-events-none",title:re.path,children:f.jsx(ua,{size:12})})]},re.path)}),oe.map(re=>f.jsxs("div",{className:"flex w-full items-center gap-2 pl-2 pr-4 py-1.5 text-sm text-c4a-text-muted",children:[f.jsx(Lx,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:re.name})]},re.path)),v.length===0&&!y&&f.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:u("sources.import.no_entries")})]}),m&&!l&&f.jsx("p",{className:"mt-3 text-xs text-c4a-warning",children:u("sources.import.not_git")}),f.jsx(Ix,{open:N,onClose:()=>Q(!1),rpc:n,onNavigate:G,defaultPath:j??void 0})]})}const Er=50,td=["main","master"];function T_(n){const l=[],s=[];for(const i of n)td.includes(i.name)?l.push(i):s.push(i);return l.sort((i,o)=>td.indexOf(i.name)-td.indexOf(o.name)),[...l,...s]}function Bg(n,l,s){b.useEffect(()=>{if(!s)return;const i=o=>{n.current&&!n.current.contains(o.target)&&l()};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n,l,s])}function ey({refs:n,loading:l,error:s,selectedRef:i,commit:o,onRefChange:u,onCommitChange:m,onValidChange:p,onBranchSwitch:g}){const{t:h}=Re(),[v,y]=b.useState(!1),[_,j]=b.useState(""),[N,T]=b.useState(!0),[D,Y]=b.useState(!0),Z=b.useRef(null),G=b.useRef(null),[V,Q]=b.useState(!1),[ae,W]=b.useState(""),w=b.useRef(null),$=b.useRef(null);Bg(Z,()=>{y(!1),j("")},v),Bg(w,()=>{Q(!1),W("")},V),b.useEffect(()=>{v&&setTimeout(()=>G.current?.focus(),0)},[v]),b.useEffect(()=>{V&&setTimeout(()=>$.current?.focus(),0)},[V]),b.useEffect(()=>{p(!!i)},[i,p]);const te=b.useCallback(J=>{u(J.name),m(J.commit),y(!1),j(""),g?.(J.name)},[u,m,g]),fe=b.useCallback((J,ce)=>{m(J),u(ce),Q(!1),W("")},[m,u]),oe=b.useMemo(()=>n?T_(n.branches):[],[n]),re=b.useMemo(()=>{const J=_.toLowerCase();return(J?oe.filter(Se=>Se.name.toLowerCase().includes(J)):oe).slice(0,Er)},[oe,_]),de=b.useMemo(()=>{if(!n)return[];const J=_.toLowerCase();return(J?n.tags.filter(Se=>Se.name.toLowerCase().includes(J)):n.tags).slice(0,Er)},[n,_]),pe=b.useMemo(()=>{if(!n)return[];if(n.commits&&n.commits.length>0){const U=ae.toLowerCase(),ee=n.commits.map(le=>({hash:le.hash,refName:i||"",label:`${le.hash.slice(0,8)} ${le.message?`— ${le.message.slice(0,50)}`:""}`.trim()}));return U?ee.filter(le=>le.hash.toLowerCase().includes(U)||le.label.toLowerCase().includes(U)).slice(0,Er):ee.slice(0,Er)}const J=new Set,ce=[],Se=[...n.branches??[],...n.tags??[]];for(const U of Se){const ee=U.commit.slice(0,8);J.has(U.commit)||(J.add(U.commit),ce.push({hash:U.commit,refName:U.name,label:`${ee} (${U.name})`}))}if(!ae)return ce.slice(0,Er);const E=ae.toLowerCase();return ce.filter(U=>U.hash.toLowerCase().includes(E)||U.label.toLowerCase().includes(E)).slice(0,Er)},[n,ae,i]);if(l)return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsx(Ma,{size:20,className:"animate-spin text-c4a-accent"}),f.jsx("span",{className:"mt-2 text-sm text-c4a-accent",children:h("sources.import_remote.loading_refs")})]});if(s)return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-sm font-medium text-red-400",children:[f.jsx(Ul,{size:14,className:"shrink-0"}),h("sources.import.error_title")]}),f.jsx("p",{className:"mt-2 max-h-40 overflow-y-auto break-all font-mono text-xs leading-relaxed text-red-400/70",children:s})]});if(!n)return null;const k=n.branches.find(J=>J.name===i)?.name??n.tags.find(J=>J.name===i)?.name??i,P=o?o.slice(0,8):"";return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col space-y-4 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsxs("div",{children:[f.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:h("sources.import_remote.ref_label")}),f.jsxs("div",{ref:Z,className:"relative mt-2",children:[f.jsxs("button",{onClick:()=>y(!v),className:"flex w-full items-center justify-between rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-2 font-mono text-sm font-semibold text-c4a-accent transition-colors hover:bg-c4a-bg-hover",children:[f.jsx("span",{children:k||"—"}),f.jsx(ua,{size:14,className:`text-c4a-text-muted transition-transform duration-200 ${v?"rotate-90":""}`})]}),v&&f.jsxs("div",{className:"absolute z-20 mt-1 w-full rounded border border-c4a-border-default bg-c4a-bg-elevated shadow-lg",children:[f.jsx("div",{className:"border-b border-c4a-border-default px-3 py-2.5",children:f.jsxs("div",{className:"flex items-center gap-2 rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-1.5",children:[f.jsx(gd,{size:14,className:"shrink-0 text-c4a-text-muted"}),f.jsx("input",{ref:G,type:"text",value:_,onChange:J=>j(J.target.value),placeholder:h("sources.import_remote.ref_search"),className:"w-full bg-transparent font-mono text-sm text-c4a-text-primary placeholder:text-c4a-text-muted focus:outline-none"})]})}),f.jsxs("div",{className:"flex max-h-80 flex-col md:flex-row",children:[re.length>0&&f.jsxs("div",{className:"c4a-scrollbar min-w-0 flex-1 overflow-y-auto md:border-r md:border-c4a-border-default",children:[f.jsxs("button",{onClick:()=>T(!N),className:"flex w-full items-center gap-1.5 px-3 py-2 font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:[f.jsx(ua,{size:12,className:`transition-transform duration-200 ${N?"rotate-90":""}`}),h("sources.import_remote.ref_branches")," (",n.branches.length,")"]}),N&&re.map(J=>f.jsxs("button",{onClick:()=>te(J),className:`flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm transition-colors hover:bg-c4a-bg-hover ${J.name===i?"font-semibold text-c4a-accent":"text-c4a-text-secondary"}`,children:[f.jsx("span",{className:"truncate",children:J.name}),J.name===i&&f.jsx("span",{children:"✓"})]},`b-${J.name}`))]}),de.length>0&&f.jsxs("div",{className:"c4a-scrollbar min-w-0 flex-1 overflow-y-auto border-t border-c4a-border-default md:border-t-0",children:[f.jsxs("button",{onClick:()=>Y(!D),className:"flex w-full items-center gap-1.5 px-3 py-2 font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:[f.jsx(ua,{size:12,className:`transition-transform duration-200 ${D?"rotate-90":""}`}),h("sources.import_remote.ref_tags")," (",n.tags.length,")"]}),D&&de.map(J=>f.jsxs("button",{onClick:()=>te(J),className:`flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm transition-colors hover:bg-c4a-bg-hover ${J.name===i?"font-semibold text-c4a-accent":"text-c4a-text-secondary"}`,children:[f.jsx("span",{className:"truncate",children:J.name}),J.name===i&&f.jsx("span",{children:"✓"})]},`t-${J.name}`))]})]}),re.length===0&&de.length===0&&f.jsx("div",{className:"px-3 py-4 text-center font-mono text-sm text-c4a-text-muted",children:"No matches"})]})]})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:h("sources.import_remote.commit_label")}),f.jsxs("div",{ref:w,className:"relative mt-2",children:[f.jsxs("button",{onClick:()=>Q(!V),className:"flex w-full items-center justify-between rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-2 font-mono text-sm font-semibold text-c4a-accent transition-colors hover:bg-c4a-bg-hover",children:[f.jsx("span",{className:o?"":"font-normal text-c4a-text-muted",children:P||"—"}),f.jsx(ua,{size:14,className:`text-c4a-text-muted transition-transform duration-200 ${V?"rotate-90":""}`})]}),V&&f.jsxs("div",{className:"c4a-scrollbar absolute z-20 mt-1 max-h-64 w-full overflow-y-auto rounded border border-c4a-border-default bg-c4a-bg-elevated shadow-lg",children:[f.jsx("div",{className:"sticky top-0 z-10 border-b border-c4a-border-default bg-c4a-bg-elevated px-3 py-2",children:f.jsxs("div",{className:"flex items-center gap-2 rounded border border-c4a-border-default bg-c4a-bg-surface px-2 py-1",children:[f.jsx(gd,{size:12,className:"shrink-0 text-c4a-text-muted"}),f.jsx("input",{ref:$,type:"text",value:ae,onChange:J=>W(J.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"})]})}),pe.map(J=>f.jsxs("button",{onClick:()=>fe(J.hash,J.refName),className:"flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx("span",{className:"truncate",children:J.label}),J.hash===o&&f.jsx("span",{className:"text-c4a-accent",children:"✓"})]},J.hash)),pe.length===0&&f.jsx("div",{className:"px-3 py-4 text-center font-mono text-xs text-c4a-text-muted",children:"No matches"})]})]}),f.jsxs("p",{className:"mt-3 flex items-center gap-1.5 text-xs text-c4a-text-muted",children:[f.jsx(VS,{size:12,className:"shrink-0"}),h("sources.import_remote.commit_hint")]})]})]})}const z_="_pulseBar_17bq5_1",O_={pulseBar:z_};function D_({stages:n,currentStage:l,completedStages:s,failedStage:i,progress:o}){const{t:u}=Re();return f.jsxs("div",{className:"space-y-3",children:[f.jsx("div",{className:"space-y-2",children:n.map(m=>{const p=s.includes(m.key),g=i===m.key,h=l===m.key;return f.jsxs("div",{className:"flex items-center gap-3",children:[g?f.jsx(Ul,{size:14,className:"shrink-0 text-red-400"}):p||h?f.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:f.jsx("span",{className:`block h-2 w-2 rounded-full bg-c4a-accent ${h?"animate-pulse":""}`})}):f.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:f.jsx("span",{className:"block h-2 w-2 rounded-full border border-c4a-text-muted/40"})}),f.jsx("span",{className:`flex-1 text-sm ${g?"text-red-400":h?"font-medium text-c4a-text-primary":p?"text-c4a-text-secondary":"text-c4a-text-muted"}`,children:m.label}),p&&f.jsx(Al,{size:14,className:"shrink-0 text-c4a-accent/60"}),g&&f.jsx("span",{className:"font-mono text-xs text-red-400",children:u("sources.import.error_title")}),h&&o&&o.label&&f.jsx("span",{className:"max-w-[200px] truncate font-mono text-xs text-c4a-text-muted",children:o.label})]},m.key)})}),l&&!i&&f.jsx("div",{className:"space-y-1",children:o&&o.percent>=0?f.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-c4a-bg-elevated",children:f.jsx("div",{className:"h-full rounded-full bg-c4a-accent transition-all duration-300",style:{width:`${Math.min(100,Math.max(0,o.percent))}%`}})}):f.jsx("div",{className:`h-1.5 rounded-full bg-c4a-bg-elevated ${O_.pulseBar}`})})]})}function ty({stages:n,currentStage:l,completedStages:s,failedStage:i,progress:o,failedError:u,logs:m}){const p=b.useRef(null);return b.useEffect(()=>{p.current?.scrollIntoView({behavior:"smooth"})},[m.length]),f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsx(D_,{stages:n,currentStage:l,completedStages:s,failedStage:i,progress:o}),f.jsxs("div",{className:"mt-4 min-h-0 flex-1 rounded bg-c4a-bg-base p-3 c4a-scrollbar overflow-y-auto",children:[m.map((g,h)=>f.jsx("p",{className:"font-mono text-xs text-c4a-text-muted leading-relaxed",children:g},h)),f.jsx("div",{ref:p})]}),i&&u&&f.jsx("div",{className:"mt-3 max-h-32 overflow-y-auto rounded-sm bg-red-500/5 px-4 py-3",children:f.jsx("p",{className:"break-all font-mono text-xs leading-relaxed text-red-400/80",children:u})})]})}function Dn({icon:n,label:l,value:s,tooltip:i,size:o="sm"}){const u=o==="sm";return f.jsxs("div",{className:"group/stat relative rounded border border-c4a-border-subtle bg-c4a-bg-base p-3",children:[f.jsxs("div",{className:"flex items-center gap-1.5 text-c4a-text-muted [&>svg]:size-4",children:[n,f.jsx("span",{className:"font-mono text-xs uppercase",children:l})]}),f.jsx("p",{className:`mt-1 font-mono font-bold text-c4a-text-secondary ${u?"text-sm truncate":"text-lg"}`,title:u?String(s):void 0,children:s}),i&&f.jsx("div",{className:"pointer-events-none absolute bottom-full left-0 z-30 mb-1.5 hidden w-max max-w-[260px] rounded border border-c4a-border-default bg-c4a-bg-elevated px-2.5 py-1.5 text-[11px] leading-relaxed text-c4a-text-secondary shadow-c4a-lg group-hover/stat:block",children:i})]})}const ad=100;function ay({repoName:n,repoIdentifier:l,branch:s,commit:i,packages:o,mdFiles:u,importing:m,completed:p}){const{t:g}=Re(),h=i?i.slice(0,7):"",[v,y]=b.useState("packages"),[_,j]=b.useState(ad),N=b.useRef(null),T=b.useRef(null);b.useEffect(()=>{j(ad),T.current?.scrollTo(0,0)},[v]),b.useEffect(()=>{const V=N.current;if(!V)return;const Q=v==="packages"?o.length:u.length;if(_>=Q)return;const ae=new IntersectionObserver(W=>{W[0]?.isIntersecting&&j(w=>Math.min(w+ad,Q))},{root:T.current,threshold:.1});return ae.observe(V),()=>ae.disconnect()},[v,_,o.length,u.length]);const D=v==="packages"?o:u,Y=D.slice(0,_),Z=_<D.length,G=b.useMemo(()=>p?g("sources.import_remote.complete"):m?g("sources.import.importing"):g("sources.import.confirm_heading",{name:n}),[p,m,n,g]);return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6",children:[f.jsx("p",{className:"text-sm text-c4a-text-secondary",children:G}),f.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-3 gap-y-1",children:[f.jsx("span",{className:"font-mono text-sm font-bold text-c4a-accent",children:n}),f.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:l})]}),f.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-3 sm:grid-cols-4",children:[f.jsx(Dn,{icon:f.jsx(hd,{size:14}),label:g("sources.import.branch"),value:s}),f.jsx(Dn,{icon:f.jsx(BS,{size:14}),label:g("sources.import.commit"),value:h}),f.jsx(Dn,{icon:f.jsx(Or,{size:14}),label:g("sources.import.packages"),value:String(o.length),tooltip:g("sources.import.dir_code_packages_tip")}),f.jsx(Dn,{icon:f.jsx(cl,{size:14}),label:g("sources.import.documents"),value:String(u.length),tooltip:g("sources.import.dir_doc_files_tip")})]}),m&&f.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-3",children:[f.jsx(Ma,{size:14,className:"animate-spin text-c4a-accent"}),f.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:g("sources.import.importing")})]}),(o.length>0||u.length>0)&&f.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-base",children:[f.jsxs("div",{className:"flex shrink-0 items-center justify-between px-4 py-3",children:[f.jsx("p",{className:"hidden font-mono text-xs text-c4a-text-secondary sm:block",children:g("sources.import.recognized",{packages:o.length,docs:u.length})}),f.jsxs("div",{className:"flex rounded border border-c4a-border-subtle",children:[f.jsxs("button",{onClick:()=>y("packages"),className:`flex items-center gap-1 px-2.5 py-1 text-xs transition-colors ${v==="packages"?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:[f.jsx(Or,{size:13}),f.jsx("span",{className:"font-mono",children:o.length})]}),f.jsxs("button",{onClick:()=>y("docs"),className:`flex items-center gap-1 border-l border-c4a-border-subtle px-2.5 py-1 text-xs transition-colors ${v==="docs"?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:[f.jsx(cl,{size:13}),f.jsx("span",{className:"font-mono",children:u.length})]})]})]}),f.jsx("hr",{className:"border-c4a-border-subtle"}),f.jsx("div",{ref:T,className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto px-2 py-1",children:D.length===0?f.jsx("p",{className:"py-8 text-center text-xs text-c4a-text-muted",children:v==="packages"?g("sources.import.no_packages"):"—"}):f.jsxs(f.Fragment,{children:[v==="packages"?Y.map(V=>f.jsxs("div",{className:"flex items-center gap-2 rounded pl-2 pr-4 py-1 text-xs",children:[f.jsx(Or,{size:14,className:"shrink-0 text-c4a-accent"}),f.jsx("span",{className:"text-c4a-text-secondary",children:V.name}),f.jsx("span",{className:"hidden truncate text-c4a-text-muted sm:inline",children:V.path}),V.isRoot&&f.jsx("span",{className:"rounded bg-c4a-bg-active px-1 py-0.5 font-mono text-[10px] text-c4a-text-muted",children:"root"})]},V.path)):Y.map(V=>f.jsxs("div",{className:"flex items-center gap-2 rounded pl-2 pr-4 py-1 text-xs",children:[f.jsx(cl,{size:14,className:"shrink-0 text-c4a-text-secondary"}),f.jsx("span",{className:"truncate text-c4a-text-secondary",children:V})]},V)),Z&&f.jsx("div",{ref:N,className:"h-4"})]})})]})]})}const M_=["scan","save"],oo={scan:"sources.import.stage.scan",save:"sources.import.stage.save"};function k_(){const{t:n}=Re(),l=kn(),{libId:s}=Vs(),[i]=No(),u=Pt(Hl(kr)).find(ge=>ge.id===s),m=Ro(ge=>ge.createSource),p=i.get("parentId")||"",g=i.get("parentName")||"",h=i.get("parentPath")||"",[v,y]=b.useState(1),[_,j]=b.useState(null),[N,T]=b.useState({repoPath:"",repoName:"",branch:"",branches:[],commit:"",commits:[],isDirty:!1,repoFiles:[],packages:[],mdFiles:[],repoFileContents:[]}),[D,Y]=b.useState(null),[Z,G]=b.useState(!1),[V,Q]=b.useState(null),[ae,W]=b.useState(""),[w,$]=b.useState(""),[te,fe]=b.useState(!1),[oe,re]=b.useState(!1),[de,pe]=b.useState(!1),[k,P]=b.useState(null),[J,ce]=b.useState([]),[Se,E]=b.useState(null),[U,ee]=b.useState(null),[le,be]=b.useState([]),Ne=b.useRef(null),ze=u?.is_online??!1,{rpc:Pe,importedPaths:Qe,allowedPaths:It}=Zx(s,u),fa=b.useMemo(()=>M_.map(ge=>({key:ge,label:oo[ge]?n(oo[ge]):ge})),[n]),Ze=b.useCallback(ge=>{be(ke=>[...ke,`[${Jx()}] ${ge}`])},[]),tt=b.useRef(null),dt=b.useCallback(ge=>{const ke=tt.current;ke&&ke!==ge&&(ce(Ve=>Ve.includes(ke)?Ve:[...Ve,ke]),Ze(`${n(oo[ke]??ke)} ${n("sources.import.stage.done_suffix")}`)),Ze(`${n(oo[ge]??ge)}...`),tt.current=ge,P(ge),ee(null)},[Ze,n]),$t=b.useCallback((ge,ke)=>{T(Ve=>({...Ve,repoPath:ge,repoName:ke}))},[]),Gt=b.useCallback(async()=>{G(!0),Q(null);try{const ge=await Pe("fs/repoStatus",{path:N.repoPath}),ke={branches:ge.branches??[{name:ge.branch,commit:ge.head_hash}],tags:ge.tags??[],default:ge.branch,commits:ge.commits??[{hash:ge.head_hash,message:"HEAD"}]};Y(ke),T(Ve=>({...Ve,isDirty:ge.is_dirty})),W(Ve=>{if(Ve)return Ve;const jt=ke.branches.find(_a=>_a.name===ke.default),Nt=ke.branches[0],Xt=jt??Nt;return Xt?($(Xt.commit),Xt.name):Ve})}catch(ge){const ke=ge instanceof Error?ge.message:"Failed to load repository info";Q(ke)}finally{G(!1)}},[Pe,N.repoPath]);b.useEffect(()=>{v===2&&N.repoPath&&!D&&Gt()},[v,N.repoPath,D,Gt]);const Wt=b.useCallback(async ge=>{try{const ke=await Pe("fs/repoStatus",{path:N.repoPath,branch:ge});Y(Ve=>Ve&&{...Ve,commits:ke.commits??[]})}catch{}},[Pe,N.repoPath]),na=b.useCallback(async()=>{if(s){re(!0),pe(!1),j(null),E(null),ce([]),tt.current=null,P(null),ee(null),be([]),y(3);try{dt("scan");const ge=await Pe("fs/repoScan",{path:N.repoPath,hash:w}),ke=ge.files||[],Ve=ge.manifests||[],jt=il(N.repoPath),{packages:Nt,mdFiles:Xt}=Fx(Ve,ke,jt);T(_t=>({..._t,branch:ae,commit:w,repoFiles:ke,packages:Nt,mdFiles:Xt,repoFileContents:Ve})),dt("save");const _a=await m({library_id:s,repo_name:N.repoName||jt,repo_root_path:N.repoPath,repo_branch:ae,repo_commit:w,repo_files:ke.map(_t=>_t.path),repo_file_contents:Ve,...p?{parent_source_id:p,parent_path:h}:{}});ce(["scan","save"]),tt.current=null,P(null),Ze(`${n("sources.import.stage.save")} ${n("sources.import.stage.done_suffix")}`),Ze(n("sources.import.stage.complete"));const ia=Array.isArray(_a)?_a[0]:_a;Ne.current=ia?.id??null,pe(!0),re(!1),y(4)}catch(ge){const ke=tt.current??"scan";E(ke),tt.current=null,P(null);const Ve=ge instanceof Error?ge.message:String(ge);Ze(`ERROR: ${Ve}`),j(Ve),re(!1)}}},[s,N,ae,w,p,h,Pe,m,dt,Ze]),va=b.useCallback(()=>{E(null),j(null),na()},[na]),Sa=b.useCallback(()=>{if(s)if(p){const ge=N.repoName||il(N.repoPath),ke=h?`${h}/${ge}`:ge;l(`/studio/sources/${s}?rootId=${p}&path=${encodeURIComponent(ke)}`)}else Ne.current?l(`/studio/sources/${s}?rootId=${Ne.current}`):l(`/studio/sources/${s}`)},[s,l,p,h,N.repoPath,N.repoName]),Aa=b.useMemo(()=>v===1?!!N.repoPath:v===2?te:v===3?de:!1,[v,N.repoPath,te,de]),la=b.useMemo(()=>{if(!u)return[];const ge=[{label:u.id===ul?n("sources.library.default_cloud_name"):u.name,to:`/studio/sources/${u.id}`}];if(p&&(ge.push({label:g||p,to:`/studio/sources/${u.id}?rootId=${p}`}),h)){const ke=h.split("/").filter(Boolean);for(const[Ve,jt]of ke.entries()){const Nt=ke.slice(0,Ve+1).join("/");ge.push({label:jt,to:`/studio/sources/${u.id}?rootId=${p}&path=${encodeURIComponent(Nt)}`})}}return ge.push({label:n("sources.import.title")}),ge},[u,p,g,h,n]);if(!u)return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})});const ra=v===4,ht=v===3&&!!Se&&!oe,sa=v<=2;return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[f.jsx("div",{className:"shrink-0",children:f.jsx(Ar,{segments:la})}),f.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[f.jsx(fn,{active:v>=1,current:v===1}),f.jsx("span",{className:v===1?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.select")}),f.jsx(Ml,{}),f.jsx(fn,{active:v>=2,current:v===2}),f.jsx("span",{className:v===2?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.version")}),f.jsx(Ml,{}),f.jsx(fn,{active:v>=3,current:v===3}),f.jsx("span",{className:v===3?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.loading")}),f.jsx(Ml,{}),f.jsx(fn,{active:v>=4,current:v===4}),f.jsx("span",{className:v===4?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.confirm")})]}),f.jsx("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:ze?f.jsxs(f.Fragment,{children:[v===1&&f.jsx(R_,{rpc:Pe,selectedPath:N.repoPath,onSelect:$t,allowedPaths:It,importedPaths:Qe}),v===2&&f.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:f.jsx(ey,{refs:D,loading:Z,error:V,selectedRef:ae,commit:w,onRefChange:W,onCommitChange:$,onValidChange:fe,onRetry:Gt,onBranchSwitch:Wt})}),v===3&&f.jsx(ty,{stages:fa,currentStage:k,completedStages:J,failedStage:Se,progress:U,failedError:_,logs:le}),v===4&&f.jsx(ay,{repoName:N.repoName||il(N.repoPath),repoIdentifier:N.repoPath,branch:ae,commit:w,packages:N.packages,mdFiles:N.mdFiles,importing:!1,completed:de})]}):f.jsx(Qx,{libraryName:u.name})}),ze&&f.jsx(f.Fragment,{children:ra?f.jsx("div",{className:"mt-3 flex shrink-0 justify-end sm:mt-6",children:f.jsx("button",{onClick:Sa,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("sources.import.done")})}):ht?f.jsxs("div",{className:"mt-3 flex shrink-0 justify-end gap-2 sm:mt-6",children:[f.jsx("button",{onClick:()=>{y(2),E(null),j(null),ce([]),tt.current=null,P(null),be([])},className:"rounded border border-c4a-border-default px-4 py-2 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:n("sources.import.back")}),f.jsx("button",{onClick:va,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")})]}):sa?f.jsx(zd,{step:v,totalSteps:4,importing:oe,stepBusy:Z||v===3&&oe,canProceed:Aa,safetyNoticeKey:"sources.safety.notice.repo",confirmLabelKey:"sources.import.step.confirm",onPrev:()=>y(ge=>ge-1),onNext:()=>{v===2?na():y(ge=>ge+1)},onImport:na}):null}),_&&v!==3&&f.jsxs(Bl,{onClose:()=>j(null),className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-error",children:n("sources.import.error_title")}),f.jsx("p",{className:"mt-3 whitespace-pre-wrap break-all text-sm text-c4a-text-secondary",children:_}),f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsx("button",{onClick:()=>j(null),className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("common.confirm")})})]})]})}const $g=(n,l)=>{let s=0,i=0,o=0;const u=[],m=p=>{for(const g of p)if(g.type==="directory")i++,g.is_git_repo&&o++,g.children&&m(g.children);else if(s++,/\.md$/i.test(g.name)){const h=g.path.startsWith(l)?g.path.slice(l.length).replace(/^\//,""):g.name;u.push(h)}};return m(n),{files:s,dirs:i,gitRepos:o,mdFiles:u}};function A_({rpc:n,selectedPath:l,onSelect:s,allowedPaths:i,importedPaths:o}){const{t:u}=Re(),{atRoot:m,currentPath:p,entries:g,loading:h,error:v,homeDir:y,goToOpen:_,isWildcard:j,importedSet:N,dirs:T,files:D,loadTree:Y,handleNavigateUp:Z,setGoToOpen:G}=Wx({rpc:n,allowedPaths:i??[],importedPaths:o??[]}),V=b.useCallback(w=>{if(w.type!=="directory"||N.has(w.path))return;const $=$g(w.children||[],w.path);s(w.path,w.name,$),Y(w.path)},[s,Y,N]);b.useEffect(()=>{if(p&&!m&&g.length>=0&&!h){const w=p.split("/").pop()||p,$=$g(g,p);s(p,w,$)}},[p,m,g,h,s]);const Q=b.useMemo(()=>l?l.split("/").pop()||l:"",[l]),ae=b.useMemo(()=>T.sort((w,$)=>w.is_git_repo&&!$.is_git_repo?-1:!w.is_git_repo&&$.is_git_repo?1:w.name.localeCompare($.name)),[T]),W=b.useMemo(()=>D.sort((w,$)=>w.name.localeCompare($.name)),[D]);return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[m?f.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[f.jsx("span",{children:u("sources.import.allowed_dirs")}),f.jsx(Px,{})]}):f.jsx("p",{className:"min-w-0 truncate font-mono text-xs text-c4a-text-muted",children:p}),l?f.jsxs("p",{className:"flex shrink-0 items-center gap-2 font-mono text-xs text-c4a-accent",children:[f.jsx(Qa,{size:12}),f.jsx("span",{children:Q})]}):j&&m?f.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:u("sources.import.wildcard_goto")}):null]}),f.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),m?j?f.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:y&&f.jsxs("button",{onClick:()=>Y(y),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(Qa,{size:14,className:"shrink-0"}),f.jsxs("span",{className:"truncate",children:[y,f.jsxs("span",{className:"ml-1.5 text-c4a-text-muted",children:["(",u("sources.import.wildcard_home"),")"]})]}),f.jsx(ua,{size:12,className:"shrink-0 text-c4a-text-muted"})]})}):f.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:i.map(w=>f.jsxs("button",{onClick:()=>Y(w),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(Qa,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:w}),f.jsx(ua,{size:12,className:"shrink-0 text-c4a-text-muted"})]},w))}):v&&!h?f.jsx("p",{className:"py-4 text-xs text-c4a-error",children:v}):f.jsxs("div",{className:"relative min-h-[5rem] min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:[h&&f.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-c4a-bg-surface/60",children:f.jsx(Ma,{size:14,className:"animate-spin text-c4a-text-muted"})}),p!=="/"&&f.jsxs("button",{onClick:Z,disabled:h,className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary hover:bg-c4a-bg-hover disabled:pointer-events-none",children:[f.jsx(Qa,{size:14}),f.jsx("span",{children:".."})]}),ae.map(w=>{const $=N.has(w.path),te=w.is_git_repo?Eo:Qa;return f.jsxs("button",{onClick:()=>V(w),disabled:$||h,className:`flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm transition-colors ${$?"cursor-not-allowed text-c4a-accent/60":l===w.path?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:[f.jsx(te,{size:14,className:"shrink-0"}),f.jsx("span",{className:"flex-1 truncate",children:w.name}),$&&f.jsx("span",{className:"rounded bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] text-c4a-accent/60",children:u("sources.import.already_imported")}),f.jsx(ua,{size:12,className:"shrink-0 text-c4a-text-muted"})]},w.path)}),W.map(w=>f.jsxs("div",{className:"flex w-full items-center gap-2 pl-2 pr-4 py-1.5 text-sm text-c4a-text-muted",children:[f.jsx(Lx,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:w.name})]},w.path)),g.length===0&&!h&&f.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:u("sources.import.no_entries")})]}),f.jsx(Ix,{open:_,onClose:()=>G(!1),rpc:n,onNavigate:Y,defaultPath:y??void 0})]})}const L_=new Set(["package.json","pyproject.toml","setup.py","go.mod","cargo.toml","pom.xml","build.gradle"]),U_=n=>{let l=0,s=0,i=0,o=0,u=0;const m=new Set;for(const p of n)if(p.type==="directory")s++,p.is_git_repo&&u++;else{l++,p.path.toLowerCase().endsWith(".md")&&o++;const h=p.path.split("/").pop();if(h&&L_.has(h.toLowerCase())){const v=p.path.split("/").slice(0,-1).join("/");n.some(_=>_.type==="directory"&&_.is_git_repo&&(v===_.path||v.startsWith(`${_.path}/`)))||m.add(v)}}return i=m.size,{totalFiles:l,totalDirs:s,codePackages:i,docFiles:o,gitRepos:u}};function H_({dirPath:n,rpc:l,importing:s,onScanComplete:i,onBusyChange:o}){const{t:u}=Re(),[m,p]=b.useState(!1),[g,h]=b.useState(null),[v,y]=b.useState(null),_=b.useCallback(async()=>{p(!0),o?.(!0),h(null),y(null);try{const j=await l("fs/dirScan",{path:n}),N=j.entries||[],T=j.manifests||[],D=U_(N);y(D),i(N,D,T)}catch(j){const N=j instanceof Error?j.message:String(j);h(N)}finally{p(!1),o?.(!1)}},[n,l,i,o]);return b.useEffect(()=>{_()},[_]),f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6",children:[f.jsx("p",{className:"shrink-0 font-mono text-xs text-c4a-text-muted",children:n}),f.jsx("div",{className:"mt-3 shrink-0 border-t border-c4a-border-subtle"}),f.jsxs("div",{className:"c4a-scrollbar min-h-0 flex-1 overflow-y-auto",children:[m&&f.jsxs("div",{className:"mt-6 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-4",children:[f.jsx(Ma,{size:14,className:"animate-spin text-c4a-accent"}),f.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:u("sources.import.dir_scanning")})]}),g&&f.jsxs("div",{className:"mt-6",children:[f.jsxs("p",{className:"flex items-start gap-2 text-xs text-c4a-error",children:[f.jsx(Ax,{size:14,className:"mt-0.5 shrink-0"}),u("sources.import.dir_scan_error")]}),f.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:g}),f.jsxs("button",{onClick:_,className:"mt-3 flex items-center gap-1.5 rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(o2,{size:12}),u("sources.import.dir_scan_retry")]})]}),v&&!m&&!g&&f.jsxs("div",{className:"mt-6 space-y-3",children:[f.jsxs("p",{className:"font-mono text-sm uppercase text-c4a-accent",children:[u("sources.import.dir_scan_complete"),"!"]}),f.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3 lg:grid-cols-5",children:[f.jsx(Dn,{icon:f.jsx(cl,{size:14}),label:u("sources.import.dir_doc_files"),value:v.docFiles,tooltip:u("sources.import.dir_doc_files_tip"),size:"lg"}),f.jsx(Dn,{icon:f.jsx(Or,{size:14}),label:u("sources.import.dir_code_packages"),value:v.codePackages,tooltip:u("sources.import.dir_code_packages_tip"),size:"lg"}),v.gitRepos>0&&f.jsx(Dn,{icon:f.jsx(Eo,{size:14}),label:u("sources.import.dir_git_repos"),value:v.gitRepos,size:"lg"}),f.jsx(Dn,{icon:f.jsx(Qa,{size:14}),label:u("sources.import.dir_total_dirs"),value:v.totalDirs,size:"lg"}),f.jsx(Dn,{icon:f.jsx(TS,{size:14}),label:u("sources.import.dir_total_files"),value:v.totalFiles,size:"lg"})]}),v.gitRepos>0&&f.jsx("p",{className:"text-xs text-c4a-warning",children:u("sources.import.dir_git_skip_hint",{count:v.gitRepos})})]}),s&&f.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-3",children:[f.jsx(Ma,{size:14,className:"animate-spin text-c4a-accent"}),f.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:u("sources.import.importing")})]})]})]})}function B_(){const{t:n}=Re(),l=kn(),{libId:s}=Vs(),o=Pt(Hl(kr)).find($=>$.id===s),u=Ro($=>$.createSource),[m,p]=b.useState(1),[g,h]=b.useState(!1),[v,y]=b.useState(null),[_,j]=b.useState(!1),[N,T]=b.useState({dirPath:"",dirName:"",fileCount:0,subDirCount:0,gitRepoCount:0,mdFiles:[],scanEntries:[],scanStats:null,manifests:[]}),D=o?.is_online??!1,{rpc:Y,importedPaths:Z,allowedPaths:G}=Zx(s,o),V=b.useCallback(($,te,fe)=>{T(oe=>({...oe,dirPath:$,dirName:te,fileCount:fe.files,subDirCount:fe.dirs,gitRepoCount:fe.gitRepos,mdFiles:fe.mdFiles}))},[]),Q=b.useCallback(($,te,fe)=>{T(oe=>({...oe,scanEntries:$,scanStats:te,manifests:fe}))},[]),ae=b.useCallback(async()=>{if(s){h(!0);try{const $=await u({library_id:s,dir_files:N.scanEntries,dir_name:N.dirName,dir_path:N.dirPath,dir_file_contents:N.manifests}),te=Array.isArray($)?$[0]:$;te?.id?l(`/studio/sources/${s}?rootId=${te.id}`):l(`/studio/sources/${s}`)}catch($){const te=$ instanceof Error?$.message:String($);y(te),h(!1)}}},[s,N,u,l]),W=b.useMemo(()=>m===1?!!N.dirPath:m===2?N.scanEntries.length>0:!0,[m,N]),w=b.useMemo(()=>o?[{label:o.id===ul?n("sources.library.default_cloud_name"):o.name,to:`/studio/sources/${o.id}`},{label:n("sources.import.dir_title")}]:[],[o,n]);return o?f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[f.jsx("div",{className:"shrink-0",children:f.jsx(Ar,{segments:w})}),f.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[f.jsx(fn,{active:m>=1,current:m===1}),f.jsx("span",{className:m===1?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.dir_step.select")}),f.jsx(Ml,{}),f.jsx(fn,{active:m>=2,current:m===2}),f.jsx("span",{className:m===2?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.dir_step.confirm")})]}),f.jsx("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:D?f.jsxs(f.Fragment,{children:[m===1&&f.jsx(A_,{rpc:Y,selectedPath:N.dirPath,onSelect:V,allowedPaths:G,importedPaths:Z}),m===2&&f.jsx(H_,{dirPath:N.dirPath,rpc:Y,importing:g,onScanComplete:Q,onBusyChange:j})]}):f.jsx(Qx,{libraryName:o.name})}),D&&f.jsx(zd,{step:m,totalSteps:2,importing:g,stepBusy:_,canProceed:W,safetyNoticeKey:"sources.safety.notice.dir",confirmLabelKey:"sources.import.dir_step.confirm",onPrev:()=>p($=>$-1),onNext:()=>p($=>$+1),onImport:ae}),v&&f.jsxs(Bl,{onClose:()=>y(null),className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-error",children:n("sources.import.error_title")}),f.jsx("p",{className:"mt-3 whitespace-pre-wrap break-all text-sm text-c4a-text-secondary",children:v}),f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsx("button",{onClick:()=>y(null),className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("common.confirm")})})]})]}):f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})})}const $_=/^https:\/\/[^/]+\/.+/;function q_({url:n,onUrlChange:l,onValidChange:s,onRefHint:i}){const{t:o}=Re(),[u,m]=b.useState(null),[p,g]=b.useState([]),h=b.useRef(null);b.useEffect(()=>{vt.get("/import/remote/git-hosts").then(j=>g(j.hosts),()=>{})},[]);const v=b.useCallback(j=>{if(!j){m(null),s(!1);return}const N=C_(j),T=N.repoUrl!==j.trim(),D=T?N.repoUrl:j;T&&(l(D),i?.(N.ref,N.commit)),$_.test(D)?(m(null),s(!0)):(m(o("sources.import_remote.url_invalid")),s(!1))},[l,s,i,o]),y=b.useCallback(j=>{const N=j.target.value;l(N),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>v(N),500)},[l,v]),_=b.useCallback(j=>{j.preventDefault();const N=j.clipboardData.getData("text").trim();l(N),h.current&&clearTimeout(h.current),v(N)},[l,v]);return b.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]),b.useEffect(()=>{n&&v(n)},[]),f.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center rounded border border-c4a-border-subtle bg-c4a-bg-surface px-6 py-10",children:f.jsxs("div",{className:"w-full max-w-xl space-y-5",children:[f.jsx("input",{type:"text",value:n,onChange:y,onPaste:_,placeholder:o("sources.import_remote.url_placeholder"),className:"w-full rounded-md border border-c4a-border-default bg-c4a-bg-surface px-4 py-3 text-center font-mono text-base font-semibold text-c4a-accent placeholder:font-normal placeholder:text-c4a-text-muted focus:border-c4a-accent focus:outline-none",autoFocus:!0}),f.jsx("div",{className:"h-14 text-center text-sm leading-relaxed text-c4a-text-muted",children:u?f.jsxs("p",{className:"flex items-center justify-center gap-1.5 text-red-400",children:[f.jsx(Ul,{size:14,className:"shrink-0"}),u]}):f.jsxs(f.Fragment,{children:[f.jsx("p",{children:p.length>0?f.jsxs(f.Fragment,{children:[o("sources.import_remote.url_hint_public"),p.map((j,N)=>f.jsxs("span",{children:[N>0&&"、",f.jsx("span",{className:"font-mono font-medium text-c4a-accent",children:j})]},j))]}):o("sources.import_remote.url_hint_no_auth")}),f.jsx("p",{className:"mt-1 text-c4a-text-muted/60",children:o("sources.import_remote.url_hint_format")})]})})]})})}const qg=["prepare","clone","scan","save"],co={prepare:"sources.import.stage.prepare",clone:"sources.import.stage.clone",scan:"sources.import.stage.scan",save:"sources.import.stage.save"};function Y_(n,l,s){if(n instanceof Dl){const i=n.message.toLowerCase();if(n.status===503)return s("sources.import_remote.error.capacity");if(i.includes("connect")||i.includes("connectionrefused")||i.includes("unavailable")||i.includes("econnrefused"))return s("sources.import_remote.error.network");if(i.includes("authentication")||i.includes("token")||i.includes("credential")||i.includes("401")||i.includes("403"))try{const o=new URL(l).hostname;return s("sources.import_remote.error.auth_required",{host:o})}catch{return s("sources.import_remote.error.auth_required",{host:l})}return i.includes("not found")||i.includes("404")||i.includes("does not exist")?s("sources.import_remote.error.not_found"):n.message||s("sources.import_remote.error.network")}return n instanceof TypeError&&n.message.includes("fetch")?s("sources.import_remote.error.network"):n instanceof Error?n.message:s("sources.import_remote.error.network")}function G_(n){return n==="cloning"?"clone":n==="detecting"||n==="extracting"?"scan":n==="saving"?"save":n}function V_(){const{t:n}=Re(),l=kn(),{libId:s}=Vs(),[i]=No(),o=i.get("url")||"",u=i.get("ref")||"",m=i.get("sourceUuid")||"",p=i.get("parentId")||"",g=i.get("parentName")||"",h=i.get("parentPath")||"",y=Pt(Hl(kr)).find(_e=>_e.id===s),[_,j]=b.useState(new Set),N=b.useCallback(async()=>{if(s)try{const _e=new Set;if(p){const Ie=(await vt.get(`/sources/${p}`)).tree??[];let K=h===""?Ie:[];if(h){const ie=(Ae,$e)=>{for(const Le of Ae){if(Le.path===$e)return Le.children??[];if(Le.children){const Et=ie(Le.children,$e);if(Et.length>0)return Et}}return[]};K=ie(Ie,h)}for(const ie of K)_e.add(ie.name.toLowerCase())}else{const He=await vt.get("/sources",{library_id:s});for(const Ie of He.items)_e.add(Ie.name.toLowerCase())}j(_e)}catch{}},[s,p,h]);b.useEffect(()=>{N()},[N]);const[T,D]=b.useState(o?2:1),[Y,Z]=b.useState(o),[G,V]=b.useState(!!o),[Q,ae]=b.useState(u),[W,w]=b.useState(""),[$,te]=b.useState(!!u),[fe,oe]=b.useState(""),re=b.useRef(void 0),de=b.useRef(void 0),[pe,k]=b.useState(null),[P,J]=b.useState(!1),[ce,Se]=b.useState(null),[E,U]=b.useState(!1),[ee,le]=b.useState(!1),[be,Ne]=b.useState(null),[ze,Pe]=b.useState(null),[Qe,It]=b.useState(null),[fa,Ze]=b.useState(null),[tt,dt]=b.useState([]),[$t,Gt]=b.useState(null),[Wt,na]=b.useState([]),va=b.useRef(null),Sa=b.useRef(""),Aa=b.useMemo(()=>qg.map(_e=>({key:_e,label:co[_e]?n(co[_e]):_e})),[n]),la=b.useCallback(_e=>{na(He=>[...He,`[${Jx()}] ${_e}`])},[]),ra=b.useRef(null),ht=b.useCallback(_e=>{const He=ra.current;He&&He!==_e&&(dt(Ie=>Ie.includes(He)?Ie:[...Ie,He]),la(`${n(co[He]??He)} ${n("sources.import.stage.done_suffix")}`)),la(`${n(co[_e]??_e)}...`),ra.current=_e,Ze(_e),Gt(null)},[la,n]),sa=b.useCallback((_e,He)=>{re.current=_e,de.current=He},[]),ge=b.useCallback(async _e=>{if(s){J(!0),Se(null);try{const He=await vt.post("/import/remote/refs",{library_id:s,url:Y},_e?{signal:_e}:void 0);k(He);const Ie=He.branches??[],K=He.tags??[],ie=[...Ie,...K];ie.length>0&&ae(Ae=>{if(Ae)return Ae;const $e=re.current,Le=de.current;if($e){const oa=ie.find(La=>La.name===$e);if(oa)return w(oa.commit),oa.name}Le&&w(Le);const ja=Ie.find(oa=>oa.name===He.default)??Ie[0];return ja?(Le||w(ja.commit),ja.name):Ae})}catch(He){if(_e?.aborted)return;Se(Y_(He,Y,n))}finally{_e?.aborted||J(!1)}}},[s,Y,n]);b.useEffect(()=>{if(T!==2||!s)return;const _e=new AbortController;return ge(_e.signal),()=>_e.abort()},[T,s,ge]),b.useEffect(()=>E?an.on("task/progress",He=>{const Ie=He,K=G_(Ie.stage??"");K&&qg.includes(K)&&Gt({percent:Ie.percent??-1,label:Ie.label??""})}):void 0,[E]);const ke=b.useCallback(async()=>{if(s){U(!0),le(!1),Pe(null),It(null),dt([]),ra.current=null,Ze(null),Gt(null),na([]),D(3);try{ht("prepare"),await new Promise(Et=>setTimeout(Et,300)),ht("clone");const _e=il(Y),He=fe||_e,Ie=h?`${h}/${He}`:He,K=await vt.post("/import/remote/clone",{library_id:s,url:Y,ref:Q,...W?{commit:W}:{},repo_name:Ie});Sa.current=K.commit_hash,ht("scan");const ie=await vt.post("/import/remote/scan",{library_id:s,path:K.path,hash:K.commit_hash});ht("save");const Ae=await vt.post("/import/remote/import",{library_id:s,url:Y,ref:Q,commit:K.commit_hash,repo_name:Ie,dir_name:He,repo_files:ie.files.map(Et=>Et.path),repo_file_contents:ie.manifests,...m?{source_uuid:m}:{},...p?{parent_source_id:p,parent_path:h}:{}});dt(["prepare","clone","scan","save"]),ra.current=null,Ze(null),la(`${n("sources.import.stage.save")} ${n("sources.import.stage.done_suffix")}`),la(n("sources.import.stage.complete"));const{packages:$e,mdFiles:Le}=Fx(ie.manifests,ie.files,_e);Ne({packages:$e,mdFiles:Le}),le(!0),U(!1),va.current=Ae.id,D(4)}catch(_e){const He=ra.current??"prepare";It(He),ra.current=null,Ze(null);let Ie;_e instanceof Dl||_e instanceof Error?Ie=_e.message:Ie=String(_e),la(`ERROR: ${Ie}`),Pe(Ie),U(!1)}}},[s,Y,Q,W,fe,m,p,h,ht,la]),Ve=b.useCallback(()=>{It(null),Pe(null),ke()},[ke]),jt=b.useCallback(()=>{if(s)if(p){const _e=il(Y),He=fe||_e,Ie=h?`${h}/${He}`:He;l(`/studio/sources/${s}?rootId=${p}&path=${encodeURIComponent(Ie)}`)}else va.current?l(`/studio/sources/${s}?rootId=${va.current}`):l(`/studio/sources/${s}`)},[s,l,p,h,fe,Y]),Nt=(fe||il(Y)).toLowerCase(),Xt=_.has(Nt),_a=b.useMemo(()=>T===1?G:T===2?$&&!Xt:!1,[T,G,$,Xt]),ia=b.useMemo(()=>{if(!y)return[];const _e=[{label:y.id===ul?n("sources.library.default_cloud_name"):y.name,to:`/studio/sources/${y.id}`}];if(p&&(_e.push({label:g||p,to:`/studio/sources/${y.id}?rootId=${p}`}),h)){const He=h.split("/").filter(Boolean);for(const[Ie,K]of He.entries()){const ie=He.slice(0,Ie+1).join("/");_e.push({label:K,to:`/studio/sources/${y.id}?rootId=${p}&path=${encodeURIComponent(ie)}`})}}return _e.push({label:n("sources.import_remote.title")}),_e},[y,p,g,h,n]);if(!y)return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})});const _t=T===4&&ee,wt=T===3&&!!Qe&&!E,kt=T<=2;return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[f.jsx("div",{className:"shrink-0",children:f.jsx(Ar,{segments:ia})}),f.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[f.jsx(fn,{active:T>=1,current:T===1}),f.jsx("span",{className:T===1?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.select")}),f.jsx(Ml,{}),f.jsx(fn,{active:T>=2,current:T===2}),f.jsx("span",{className:T===2?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.version")}),f.jsx(Ml,{}),f.jsx(fn,{active:T>=3,current:T===3}),f.jsx("span",{className:T===3?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.loading")}),f.jsx(Ml,{}),f.jsx(fn,{active:T>=4,current:T===4}),f.jsx("span",{className:T===4?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.confirm")})]}),f.jsxs("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:[T===1&&f.jsx(q_,{url:Y,onUrlChange:Z,onValidChange:V,onRefHint:sa}),T===2&&s&&f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[f.jsx(ey,{refs:pe,loading:P,error:ce,selectedRef:Q,commit:W,onRefChange:ae,onCommitChange:w,onValidChange:te,onRetry:()=>ge()}),!P&&pe&&f.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[f.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:n("sources.import.dir_name")}),f.jsx("input",{type:"text",value:fe,onChange:_e=>oe(_e.target.value),placeholder:il(Y),className:`mt-2 w-full rounded border bg-c4a-bg-surface px-3 py-2 font-mono text-sm text-c4a-accent placeholder:text-c4a-text-muted focus:outline-none ${Xt?"border-red-400 focus:border-red-400":"border-c4a-border-default focus:border-c4a-accent"}`}),Xt?f.jsx("p",{className:"mt-1.5 text-xs text-red-400",children:n("sources.import.dir_name_duplicate")}):f.jsx("p",{className:"mt-1.5 text-xs text-c4a-text-muted",children:n("sources.import.dir_name_hint")})]})]}),T===3&&f.jsx(ty,{stages:Aa,currentStage:fa,completedStages:tt,failedStage:Qe,progress:$t,failedError:ze,logs:Wt}),T===4&&f.jsx(ay,{repoName:il(Y),repoIdentifier:Y,branch:Q,commit:Sa.current,packages:be?.packages??[],mdFiles:be?.mdFiles??[],importing:!1,completed:ee})]}),_t?f.jsx("div",{className:"mt-3 flex shrink-0 justify-end sm:mt-6",children:f.jsx("button",{onClick:jt,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")})}):wt?f.jsxs("div",{className:"mt-3 flex shrink-0 justify-end gap-2 sm:mt-6",children:[f.jsx("button",{onClick:()=>{D(2),It(null),Pe(null),dt([]),ra.current=null,Ze(null),na([])},className:"rounded border border-c4a-border-default px-4 py-2 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:n("sources.import.back")}),f.jsx("button",{onClick:Ve,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")})]}):kt?f.jsx(zd,{step:T,totalSteps:2,importing:!1,stepBusy:P,canProceed:_a,safetyNoticeKey:"sources.safety.notice.remote",confirmLabelKey:"common.next",onPrev:()=>D(_e=>_e-1),onNext:()=>D(_e=>_e+1),onImport:ke}):null]})}function K_(){const{t:n}=Re(),l=kn(),s=Pt(_=>_.createLibrary),[i,o]=b.useState("waiting"),[u,m]=b.useState(null),[p,g]=b.useState(""),[h,v]=b.useState(!1);b.useEffect(()=>an.on("ws:daemon:connected",j=>{const N=j;m(N),g(N.machine_id),o(N.needs_registration?"new_client":"reconnected")}),[]),b.useEffect(()=>{let _=!1;return(async()=>{try{const j=await vt.get("/daemons/pending");if(_||j.pending.length===0)return;const N=j.pending[0];m({machine_id:N.machine_id,needs_registration:!0}),g(N.machine_id),o("new_client")}catch{}})(),()=>{_=!0}},[]);const y=b.useCallback(async()=>{if(u){v(!0);try{const _=await s({type:"daemon",name:p||u.machine_id,config:{machine_id:u.machine_id,os:u.os||"",daemon_version:u.daemon_version||""}});l(`/studio/sources/${_.id}`)}catch{v(!1)}}},[u,p,s,l]);return f.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[f.jsx(Ar,{segments:[{label:n("sources.add_client.title")}]}),f.jsx("p",{className:"mt-4 text-sm text-c4a-text-secondary",children:n("sources.add_client.description")}),f.jsx("div",{className:"mt-6 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-5",children:f.jsxs("ol",{className:"space-y-4 text-sm text-c4a-text-secondary",children:[f.jsxs("li",{children:[f.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["1. ",n("sources.add_client.step1")]}),f.jsxs("pre",{className:"mt-1 flex items-center gap-1.5 rounded bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-accent",children:["npm install -g @c4a/daemon ",f.jsx(nd,{text:"npm install -g @c4a/daemon"})]})]}),f.jsxs("li",{children:[f.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["2. ",n("sources.add_client.step2")]}),f.jsxs("pre",{className:"mt-1 flex items-center gap-1.5 rounded bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-accent",children:[`c4a-daemon --server ${window.location.host}`," ",f.jsx(nd,{text:`c4a-daemon --server ${window.location.host}`})]}),f.jsx("p",{className:"mt-2 text-xs text-c4a-text-muted",children:n("sources.add_client.step2_allow")}),f.jsxs("pre",{className:"mt-1 flex items-center gap-1.5 rounded bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-accent",children:[`c4a-daemon --server ${window.location.host} --allow ~/dir1,~/dir2`," ",f.jsx(nd,{text:`c4a-daemon --server ${window.location.host} --allow ~/dir1,~/dir2`})]})]}),f.jsxs("li",{children:[f.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["3. ",n("sources.add_client.step3")]}),f.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:n("sources.add_client.step3_desc")})]})]})}),f.jsxs("div",{className:"mt-6 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-5",children:[i==="waiting"&&f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(Ma,{size:16,className:"animate-spin text-c4a-warning"}),f.jsx("span",{className:"text-sm text-c4a-warning",children:n("sources.add_client.waiting")})]}),i==="new_client"&&u&&f.jsxs("div",{className:"space-y-4",children:[f.jsx("h3",{className:"font-mono text-sm font-bold text-c4a-accent",children:n("sources.add_client.detected")}),f.jsxs("div",{className:"space-y-2 text-sm",children:[f.jsx(ld,{label:n("sources.add_client.machine_name"),value:u.machine_id}),u.os&&f.jsx(ld,{label:n("sources.add_client.os"),value:u.os}),u.daemon_version&&f.jsx(ld,{label:n("sources.add_client.daemon_version"),value:u.daemon_version})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"w-32 font-mono text-xs text-c4a-text-muted",children:n("sources.add_client.client_name")}),f.jsx("input",{value:p,onChange:_=>g(_.target.value),className:"min-w-0 flex-1 rounded border border-c4a-border-default bg-c4a-bg-base px-2 py-1 font-mono text-xs text-c4a-text-primary outline-none focus:border-c4a-accent"})]}),f.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[f.jsx("button",{onClick:()=>l("/studio/sources"),className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:n("common.cancel")}),f.jsxs("button",{onClick:y,disabled:h||!p.trim(),className:"flex items-center gap-1.5 rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-50",children:[h&&f.jsx(Ma,{size:12,className:"animate-spin"}),n("sources.add_client.confirm")]})]})]}),i==="reconnected"&&u&&f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Al,{size:16,className:"text-c4a-success"}),f.jsx("span",{className:"text-sm text-c4a-text-primary",children:n("sources.add_client.reconnected",{name:u.machine_id})})]}),u.lib_id&&f.jsx(ba,{to:`/studio/sources/${u.lib_id}`,className:"inline-block rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:n("sources.add_client.go_to",{name:u.machine_id})})]})]})]})}function nd({text:n}){const[l,s]=b.useState(!1),i=b.useCallback(()=>{navigator.clipboard.writeText(n).then(()=>{s(!0),setTimeout(()=>s(!1),1500)})},[n]);return f.jsx("button",{type:"button",onClick:i,className:"shrink-0 rounded p-0.5 text-c4a-accent opacity-60 transition-opacity hover:opacity-100",title:"Copy",children:l?f.jsx(Al,{size:13}):f.jsx(md,{size:13})})}function ld({label:n,value:l}){return f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"w-32 font-mono text-xs text-c4a-text-muted",children:n}),f.jsx("span",{className:"font-mono text-xs text-c4a-text-primary",children:l})]})}function X_(){const{t:n}=Re(),{sourceUuid:l}=Vs(),[s]=No(),i=s.get("path")||"",{currentRoot:o,loading:u,fetchRootSource:m}=Ro(),p=Pt(Hl(kr)),[g,h]=b.useState("original");b.useEffect(()=>{l&&m(l)},[l,m]);const v=b.useMemo(()=>o?i?Co(o.tree,i):o.kind==="source"?{path:"",kind:o.kind,source_type:o.source_type,name:o.name,metadata:o.metadata,index_status:o.index_status}:null:null,[o,i]),y=p.find(G=>G.id===o?.library_id),_=v?.metadata,j=_?Object.fromEntries(Object.entries(_).map(([G,V])=>[G,String(V??"")])):null,N=v?.source_type==="code",T=v?.name??o?.name??"",D=v?.source_type??null,Y=b.useMemo(()=>{if(!o||!y)return[];const G=o.kind==="source"&&!i,V=[{label:y.id===ul?n("sources.library.default_cloud_name"):y.name,to:`/studio/sources/${y.id}`},{label:o.name,...G?{}:{to:`/studio/sources/${y.id}?rootId=${o.id}`}}];if(i){const Q=Os(o.tree,i);for(let ae=0;ae<Q.length-1;ae++){const W=Q[ae];V.push({label:W.name,to:`/studio/sources/${y.id}?rootId=${o.id}&path=${encodeURIComponent(W.path)}`})}Q.length>0&&V.push({label:Q[Q.length-1].name})}return V},[o,y,i,n]),Z=[{key:"original",label:n(N?"sources.detail.tab.overview":"sources.detail.tab.original")},{key:"digest",label:n("sources.detail.tab.digest")},{key:"modeling",label:n("sources.detail.tab.modeling")}];return u||!o||!v?f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})}):f.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[f.jsx(Ar,{segments:Y}),f.jsxs("div",{className:"mt-4 flex flex-wrap items-baseline gap-x-6 gap-y-2",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[N?f.jsx(Or,{size:20,className:"shrink-0 text-c4a-accent"}):f.jsx(cl,{size:20,className:"shrink-0 text-c4a-accent"}),f.jsx("h1",{className:"min-w-0 break-all font-mono text-xl font-bold leading-none text-c4a-text-primary",children:T})]}),f.jsxs("div",{className:"flex flex-wrap items-baseline gap-4 text-xs text-c4a-text-muted",children:[f.jsxs("span",{children:[n("sources.detail.type"),":"," ",f.jsx("span",{className:"text-c4a-text-secondary",children:n(D==="code"?"sources.type.code":"sources.type.doc")})]}),N&&j?.relative_path&&f.jsxs("span",{children:[n("sources.detail.path"),":"," ",f.jsx("span",{className:"font-mono text-c4a-text-secondary",children:j.relative_path})]}),!N&&f.jsxs("span",{children:[n("sources.detail.origin"),":"," ",f.jsx("span",{className:"text-c4a-text-secondary",children:y?.type==="daemon"?n("sources.detail.origin.local"):n("sources.detail.origin.upload")})]}),f.jsxs("span",{children:[n("sources.detail.status"),":"," ",f.jsx("span",{className:"text-c4a-text-secondary",children:n(`sources.status.${v.index_status??"none"}`)})]})]})]}),N&&j&&f.jsx("div",{className:"mt-4 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:f.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2 text-xs md:grid-cols-4",children:[j.repo_name&&f.jsx(uo,{label:n("sources.detail.repo"),value:j.repo_name}),j.pinned_branch&&f.jsx(uo,{label:n("sources.detail.branch"),value:j.pinned_branch}),j.pinned_hash&&f.jsx(uo,{label:n("sources.detail.commit"),value:j.pinned_hash.slice(0,7)}),j.tech_stack&&f.jsx(uo,{label:n("sources.detail.tech_stack"),value:j.tech_stack})]})}),f.jsx("div",{className:"mt-3 flex border-b border-c4a-border-subtle",children:Z.map(G=>f.jsx("button",{onClick:()=>h(G.key),className:`border-b-2 px-4 py-2 font-mono text-xs uppercase transition-colors ${g===G.key?"border-c4a-accent text-c4a-accent":"border-transparent text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:G.label},G.key))}),f.jsxs("div",{className:"mt-4 flex-1",children:[g==="original"&&f.jsx(Q_,{node:v,isCode:N}),g==="digest"&&f.jsx(Yg,{message:n("sources.detail.digest_placeholder")}),g==="modeling"&&f.jsx(Yg,{message:n("sources.detail.modeling_placeholder")})]})]})}function uo({label:n,value:l}){return f.jsxs("div",{children:[f.jsx("span",{className:"text-c4a-text-muted",children:n}),f.jsx("p",{className:"mt-0.5 font-mono text-c4a-text-primary",children:l})]})}function Q_({node:n,isCode:l}){const{t:s}=Re(),i=n.metadata;return l?f.jsxs("div",{className:"space-y-4 text-sm text-c4a-text-secondary",children:[!!i?.description&&f.jsx("p",{children:String(i.description)}),!!i?.dependencies&&f.jsxs("div",{children:[f.jsx("h4",{className:"font-mono text-xs font-bold uppercase text-c4a-text-primary",children:s("sources.detail.dependencies")}),f.jsx("div",{className:"mt-2 rounded bg-c4a-bg-surface p-3 font-mono text-xs",children:Object.entries(i.dependencies).map(([o,u])=>f.jsxs("div",{className:"flex justify-between py-0.5",children:[f.jsx("span",{className:"text-c4a-text-primary",children:o}),f.jsx("span",{className:"text-c4a-text-muted",children:u})]},o))})]}),!i?.description&&!i?.dependencies&&f.jsx("p",{className:"text-c4a-text-muted",children:s("sources.detail.original_code_placeholder")})]}):f.jsx("div",{className:"prose prose-invert max-w-none text-sm text-c4a-text-secondary",children:f.jsx("p",{className:"text-c4a-text-muted",children:s("sources.detail.original_doc_placeholder")})})}function Yg({message:n}){return f.jsx("div",{className:"flex items-center justify-center rounded border border-dashed border-c4a-border-subtle p-12",children:f.jsx("p",{className:"text-center text-sm text-c4a-text-muted",children:n})})}const Z_=B4([{element:f.jsx(A2,{}),errorElement:f.jsx(kg,{}),children:[{path:"/",element:f.jsx(q2,{})},{path:"/login",element:f.jsx(Y2,{})},{path:"/docs",element:f.jsx(G2,{})}]},{path:"/studio",element:f.jsx($2,{}),errorElement:f.jsx(kg,{}),children:[{index:!0,element:f.jsx(vg,{to:"/studio/sources",replace:!0})},{path:"sources",element:f.jsx(vg,{to:`/studio/sources/${ul}`,replace:!0})},{path:"sources/add-client",element:f.jsx(K_,{})},{path:"sources/import/:libId",element:f.jsx(k_,{})},{path:"sources/import-dir/:libId",element:f.jsx(B_,{})},{path:"sources/import-remote/:libId",element:f.jsx(V_,{})},{path:"sources/:libId",element:f.jsx(N_,{})},{path:"source/:sourceUuid",element:f.jsx(X_,{})},{path:"modeling",element:f.jsx(K2,{})},{path:"modeling/code/setup",element:f.jsx(P2,{})},{path:"modeling/code/compile",element:f.jsx(I2,{})},{path:"modeling/code/review",element:f.jsx(W2,{})},{path:"modeling/code/result",element:f.jsx(e_,{})},{path:"brain",element:f.jsx(X2,{})},{path:"discovery",element:f.jsx(Q2,{})},{path:"sharing",element:f.jsx(Z2,{})},{path:"collaboration",element:f.jsx(F2,{})},{path:"settings",element:f.jsx(J2,{})}]},{path:"*",element:f.jsx(V2,{})}]);function F_(){return b.useEffect(()=>{const l=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;return an.connect(l),()=>{an.disconnect()}},[]),f.jsx(d4,{router:Z_})}E0.createRoot(document.getElementById("root")).render(f.jsx(b.StrictMode,{children:f.jsx(F_,{})}));