@akiojin/gwt 2.9.1 → 2.11.0

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 (98) hide show
  1. package/README.md +6 -0
  2. package/dist/cli/ui/components/App.d.ts.map +1 -1
  3. package/dist/cli/ui/components/App.js +4 -37
  4. package/dist/cli/ui/components/App.js.map +1 -1
  5. package/dist/cli/ui/components/common/Input.d.ts +1 -1
  6. package/dist/cli/ui/components/screens/BranchListScreen.d.ts +1 -2
  7. package/dist/cli/ui/components/screens/BranchListScreen.d.ts.map +1 -1
  8. package/dist/cli/ui/components/screens/BranchListScreen.js +19 -14
  9. package/dist/cli/ui/components/screens/BranchListScreen.js.map +1 -1
  10. package/dist/cli/ui/components/screens/ModelSelectorScreen.d.ts.map +1 -1
  11. package/dist/cli/ui/components/screens/ModelSelectorScreen.js +6 -6
  12. package/dist/cli/ui/components/screens/ModelSelectorScreen.js.map +1 -1
  13. package/dist/cli/ui/components/screens/PRCleanupScreen.d.ts.map +1 -1
  14. package/dist/cli/ui/components/screens/PRCleanupScreen.js +0 -3
  15. package/dist/cli/ui/components/screens/PRCleanupScreen.js.map +1 -1
  16. package/dist/cli/ui/hooks/useGitData.d.ts.map +1 -1
  17. package/dist/cli/ui/hooks/useGitData.js +43 -2
  18. package/dist/cli/ui/hooks/useGitData.js.map +1 -1
  19. package/dist/cli/ui/types.d.ts +16 -4
  20. package/dist/cli/ui/types.d.ts.map +1 -1
  21. package/dist/cli/ui/utils/branchFormatter.d.ts.map +1 -1
  22. package/dist/cli/ui/utils/branchFormatter.js +124 -15
  23. package/dist/cli/ui/utils/branchFormatter.js.map +1 -1
  24. package/dist/cli/ui/utils/modelOptions.d.ts.map +1 -1
  25. package/dist/cli/ui/utils/modelOptions.js.map +1 -1
  26. package/dist/client/assets/{index-CNWntAlF.js → index-Dl798X5w.js} +1 -1
  27. package/dist/client/index.html +1 -1
  28. package/dist/config/index.d.ts.map +1 -1
  29. package/dist/config/index.js.map +1 -1
  30. package/dist/git.d.ts +6 -0
  31. package/dist/git.d.ts.map +1 -1
  32. package/dist/git.js +40 -5
  33. package/dist/git.js.map +1 -1
  34. package/dist/web/client/src/components/BranchGraph.js +1 -1
  35. package/dist/web/client/src/components/BranchGraph.js.map +1 -1
  36. package/dist/web/client/src/pages/BranchDetailPage.d.ts.map +1 -1
  37. package/dist/web/client/src/pages/BranchDetailPage.js +8 -3
  38. package/dist/web/client/src/pages/BranchDetailPage.js.map +1 -1
  39. package/dist/web/server/routes/sessions.d.ts.map +1 -1
  40. package/dist/web/server/routes/sessions.js +4 -2
  41. package/dist/web/server/routes/sessions.js.map +1 -1
  42. package/dist/worktree.d.ts.map +1 -1
  43. package/dist/worktree.js +69 -62
  44. package/dist/worktree.js.map +1 -1
  45. package/package.json +1 -1
  46. package/src/cli/ui/__tests__/acceptance/navigation.acceptance.test.tsx +9 -17
  47. package/src/cli/ui/__tests__/components/App.protected-branch.test.tsx +77 -83
  48. package/src/cli/ui/__tests__/components/App.shortcuts.test.tsx +107 -160
  49. package/src/cli/ui/__tests__/components/App.test.tsx +108 -84
  50. package/src/cli/ui/__tests__/components/ModelSelectorScreen.initial.test.tsx +12 -5
  51. package/src/cli/ui/__tests__/components/common/Confirm.test.tsx +3 -2
  52. package/src/cli/ui/__tests__/components/common/ErrorBoundary.test.tsx +3 -2
  53. package/src/cli/ui/__tests__/components/common/Input.test.tsx +3 -2
  54. package/src/cli/ui/__tests__/components/common/LoadingIndicator.test.tsx +15 -14
  55. package/src/cli/ui/__tests__/components/common/Select.memo.test.tsx +3 -3
  56. package/src/cli/ui/__tests__/components/common/Select.test.tsx +1 -4
  57. package/src/cli/ui/__tests__/components/parts/Footer.test.tsx +3 -2
  58. package/src/cli/ui/__tests__/components/parts/Header.test.tsx +3 -2
  59. package/src/cli/ui/__tests__/components/parts/ScrollableList.test.tsx +3 -2
  60. package/src/cli/ui/__tests__/components/parts/Stats.test.tsx +3 -2
  61. package/src/cli/ui/__tests__/components/screens/AIToolSelectorScreen.test.tsx +3 -2
  62. package/src/cli/ui/__tests__/components/screens/BranchCreatorScreen.test.tsx +3 -2
  63. package/src/cli/ui/__tests__/components/screens/BranchListScreen.test.tsx +31 -41
  64. package/src/cli/ui/__tests__/components/screens/ExecutionModeSelectorScreen.test.tsx +3 -2
  65. package/src/cli/ui/__tests__/components/screens/PRCleanupScreen.test.tsx +3 -2
  66. package/src/cli/ui/__tests__/components/screens/SessionSelectorScreen.test.tsx +3 -2
  67. package/src/cli/ui/__tests__/hooks/useScreenState.test.ts +18 -17
  68. package/src/cli/ui/__tests__/hooks/useTerminalSize.test.ts +3 -2
  69. package/src/cli/ui/__tests__/integration/edgeCases.test.tsx +61 -41
  70. package/src/cli/ui/__tests__/integration/navigation.test.tsx +15 -10
  71. package/src/cli/ui/__tests__/integration/realtimeUpdate.test.tsx +3 -2
  72. package/src/cli/ui/__tests__/performance/branchList.performance.test.tsx +0 -4
  73. package/src/cli/ui/__tests__/performance/useMemoOptimization.test.tsx +3 -5
  74. package/src/cli/ui/__tests__/utils/branchFormatter.test.ts +24 -22
  75. package/src/cli/ui/components/App.tsx +5 -63
  76. package/src/cli/ui/components/common/Input.tsx +1 -1
  77. package/src/cli/ui/components/screens/BranchListScreen.tsx +32 -22
  78. package/src/cli/ui/components/screens/ModelSelectorScreen.tsx +46 -49
  79. package/src/cli/ui/components/screens/PRCleanupScreen.tsx +0 -3
  80. package/src/cli/ui/hooks/useGitData.ts +59 -1
  81. package/src/cli/ui/screens/__tests__/BranchActionSelectorScreen.test.tsx +3 -2
  82. package/src/cli/ui/types.ts +24 -5
  83. package/src/cli/ui/utils/branchFormatter.ts +123 -15
  84. package/src/cli/ui/utils/modelOptions.test.ts +4 -6
  85. package/src/cli/ui/utils/modelOptions.ts +1 -2
  86. package/src/config/index.ts +2 -1
  87. package/src/git.ts +56 -16
  88. package/src/index.test.ts +1 -1
  89. package/src/web/client/src/components/BranchGraph.tsx +1 -1
  90. package/src/web/client/src/pages/BranchDetailPage.tsx +8 -3
  91. package/src/web/server/routes/sessions.ts +12 -5
  92. package/src/worktree.ts +80 -91
  93. package/dist/cli/ui/components/screens/WorktreeManagerScreen.d.ts +0 -20
  94. package/dist/cli/ui/components/screens/WorktreeManagerScreen.d.ts.map +0 -1
  95. package/dist/cli/ui/components/screens/WorktreeManagerScreen.js +0 -65
  96. package/dist/cli/ui/components/screens/WorktreeManagerScreen.js.map +0 -1
  97. package/src/cli/ui/__tests__/components/screens/WorktreeManagerScreen.test.tsx +0 -151
  98. package/src/cli/ui/components/screens/WorktreeManagerScreen.tsx +0 -117
@@ -9,7 +9,7 @@ Error generating stack: `+r.message+`
9
9
  `).replace(Fp,"")}function Wd(e,t){return t=Kd(t),Kd(e)===t}function et(e,t,i,r,a,c){switch(i){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Es(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Es(e,""+r);break;case"className":Vi(e,"class",r);break;case"tabIndex":Vi(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Vi(e,i,r);break;case"style":Ku(e,r,c);break;case"data":if(t!=="object"){Vi(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(i);break}r=fa(""+r),e.setAttribute(i,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(i,"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 c=="function"&&(i==="formAction"?(t!=="input"&&et(e,t,"name",a.name,a,null),et(e,t,"formEncType",a.formEncType,a,null),et(e,t,"formMethod",a.formMethod,a,null),et(e,t,"formTarget",a.formTarget,a,null)):(et(e,t,"encType",a.encType,a,null),et(e,t,"method",a.method,a,null),et(e,t,"target",a.target,a,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(i);break}r=fa(""+r),e.setAttribute(i,r);break;case"onClick":r!=null&&(e.onclick=Xi);break;case"onScroll":r!=null&&Fe("scroll",e);break;case"onScrollEnd":r!=null&&Fe("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(g(61));if(i=r.__html,i!=null){if(a.children!=null)throw Error(g(60));e.innerHTML=i}}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}i=fa(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);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(i,""+r):e.removeAttribute(i);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(i,""):e.removeAttribute(i);break;case"capture":case"download":r===!0?e.setAttribute(i,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(i,r):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(i,r):e.removeAttribute(i);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(i):e.setAttribute(i,r);break;case"popover":Fe("beforetoggle",e),Fe("toggle",e),ot(e,"popover",r);break;case"xlinkActuate":ui(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":ui(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":ui(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":ui(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":ui(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":ui(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":ui(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":ui(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":ui(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":ot(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=vm.get(i)||i,ot(e,i,r))}}function Lc(e,t,i,r,a,c){switch(i){case"style":Ku(e,r,c);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(g(61));if(i=r.__html,i!=null){if(a.children!=null)throw Error(g(60));e.innerHTML=i}}break;case"children":typeof r=="string"?Es(e,r):(typeof r=="number"||typeof r=="bigint")&&Es(e,""+r);break;case"onScroll":r!=null&&Fe("scroll",e);break;case"onScrollEnd":r!=null&&Fe("scrollend",e);break;case"onClick":r!=null&&(e.onclick=Xi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ki.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(a=i.endsWith("Capture"),t=i.slice(2,a?i.length-7:void 0),c=e[Se]||null,c=c!=null?c[i]:null,typeof c=="function"&&e.removeEventListener(t,c,a),typeof r=="function")){typeof c!="function"&&c!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,r,a);break e}i in e?e[i]=r:r===!0?e.setAttribute(i,""):ot(e,i,r)}}}function kt(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Fe("error",e),Fe("load",e);var r=!1,a=!1,c;for(c in i)if(i.hasOwnProperty(c)){var D=i[c];if(D!=null)switch(c){case"src":r=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(g(137,t));default:et(e,t,c,D,i,null)}}a&&et(e,t,"srcSet",i.srcSet,i,null),r&&et(e,t,"src",i.src,i,null);return;case"input":Fe("invalid",e);var H=c=D=a=null,K=null,se=null;for(r in i)if(i.hasOwnProperty(r)){var he=i[r];if(he!=null)switch(r){case"name":a=he;break;case"type":D=he;break;case"checked":K=he;break;case"defaultChecked":se=he;break;case"value":c=he;break;case"defaultValue":H=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(g(137,t));break;default:et(e,t,r,he,i,null)}}Pu(e,c,H,K,se,D,a,!1);return;case"select":Fe("invalid",e),r=D=c=null;for(a in i)if(i.hasOwnProperty(a)&&(H=i[a],H!=null))switch(a){case"value":c=H;break;case"defaultValue":D=H;break;case"multiple":r=H;default:et(e,t,a,H,i,null)}t=c,i=D,e.multiple=!!r,t!=null?Cs(e,!!r,t,!1):i!=null&&Cs(e,!!r,i,!0);return;case"textarea":Fe("invalid",e),c=a=r=null;for(D in i)if(i.hasOwnProperty(D)&&(H=i[D],H!=null))switch(D){case"value":r=H;break;case"defaultValue":a=H;break;case"children":c=H;break;case"dangerouslySetInnerHTML":if(H!=null)throw Error(g(91));break;default:et(e,t,D,H,i,null)}Iu(e,r,a,c);return;case"option":for(K in i)if(i.hasOwnProperty(K)&&(r=i[K],r!=null))switch(K){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:et(e,t,K,r,i,null)}return;case"dialog":Fe("beforetoggle",e),Fe("toggle",e),Fe("cancel",e),Fe("close",e);break;case"iframe":case"object":Fe("load",e);break;case"video":case"audio":for(r=0;r<Pn.length;r++)Fe(Pn[r],e);break;case"image":Fe("error",e),Fe("load",e);break;case"details":Fe("toggle",e);break;case"embed":case"source":case"link":Fe("error",e),Fe("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(se in i)if(i.hasOwnProperty(se)&&(r=i[se],r!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(g(137,t));default:et(e,t,se,r,i,null)}return;default:if(Kl(t)){for(he in i)i.hasOwnProperty(he)&&(r=i[he],r!==void 0&&Lc(e,t,he,r,i,void 0));return}}for(H in i)i.hasOwnProperty(H)&&(r=i[H],r!=null&&et(e,t,H,r,i,null))}function Ip(e,t,i,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,c=null,D=null,H=null,K=null,se=null,he=null;for(ce in i){var _e=i[ce];if(i.hasOwnProperty(ce)&&_e!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":K=_e;default:r.hasOwnProperty(ce)||et(e,t,ce,null,r,_e)}}for(var ne in r){var ce=r[ne];if(_e=i[ne],r.hasOwnProperty(ne)&&(ce!=null||_e!=null))switch(ne){case"type":c=ce;break;case"name":a=ce;break;case"checked":se=ce;break;case"defaultChecked":he=ce;break;case"value":D=ce;break;case"defaultValue":H=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(g(137,t));break;default:ce!==_e&&et(e,t,ne,ce,r,_e)}}Il(e,D,H,K,se,he,c,a);return;case"select":ce=D=H=ne=null;for(c in i)if(K=i[c],i.hasOwnProperty(c)&&K!=null)switch(c){case"value":break;case"multiple":ce=K;default:r.hasOwnProperty(c)||et(e,t,c,null,r,K)}for(a in r)if(c=r[a],K=i[a],r.hasOwnProperty(a)&&(c!=null||K!=null))switch(a){case"value":ne=c;break;case"defaultValue":H=c;break;case"multiple":D=c;default:c!==K&&et(e,t,a,c,r,K)}t=H,i=D,r=ce,ne!=null?Cs(e,!!i,ne,!1):!!r!=!!i&&(t!=null?Cs(e,!!i,t,!0):Cs(e,!!i,i?[]:"",!1));return;case"textarea":ce=ne=null;for(H in i)if(a=i[H],i.hasOwnProperty(H)&&a!=null&&!r.hasOwnProperty(H))switch(H){case"value":break;case"children":break;default:et(e,t,H,null,r,a)}for(D in r)if(a=r[D],c=i[D],r.hasOwnProperty(D)&&(a!=null||c!=null))switch(D){case"value":ne=a;break;case"defaultValue":ce=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(g(91));break;default:a!==c&&et(e,t,D,a,r,c)}Fu(e,ne,ce);return;case"option":for(var Ce in i)if(ne=i[Ce],i.hasOwnProperty(Ce)&&ne!=null&&!r.hasOwnProperty(Ce))switch(Ce){case"selected":e.selected=!1;break;default:et(e,t,Ce,null,r,ne)}for(K in r)if(ne=r[K],ce=i[K],r.hasOwnProperty(K)&&ne!==ce&&(ne!=null||ce!=null))switch(K){case"selected":e.selected=ne&&typeof ne!="function"&&typeof ne!="symbol";break;default:et(e,t,K,ne,r,ce)}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 Me in i)ne=i[Me],i.hasOwnProperty(Me)&&ne!=null&&!r.hasOwnProperty(Me)&&et(e,t,Me,null,r,ne);for(se in r)if(ne=r[se],ce=i[se],r.hasOwnProperty(se)&&ne!==ce&&(ne!=null||ce!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(g(137,t));break;default:et(e,t,se,ne,r,ce)}return;default:if(Kl(t)){for(var tt in i)ne=i[tt],i.hasOwnProperty(tt)&&ne!==void 0&&!r.hasOwnProperty(tt)&&Lc(e,t,tt,void 0,r,ne);for(he in r)ne=r[he],ce=i[he],!r.hasOwnProperty(he)||ne===ce||ne===void 0&&ce===void 0||Lc(e,t,he,ne,r,ce);return}}for(var Z in i)ne=i[Z],i.hasOwnProperty(Z)&&ne!=null&&!r.hasOwnProperty(Z)&&et(e,t,Z,null,r,ne);for(_e in r)ne=r[_e],ce=i[_e],!r.hasOwnProperty(_e)||ne===ce||ne==null&&ce==null||et(e,t,_e,ne,r,ce)}function Gd(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function qp(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),r=0;r<i.length;r++){var a=i[r],c=a.transferSize,D=a.initiatorType,H=a.duration;if(c&&H&&Gd(D)){for(D=0,H=a.responseEnd,r+=1;r<i.length;r++){var K=i[r],se=K.startTime;if(se>H)break;var he=K.transferSize,_e=K.initiatorType;he&&Gd(_e)&&(K=K.responseEnd,D+=he*(K<H?1:(H-se)/(K-se)))}if(--r,t+=8*(c+D)/(a.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 Oc=null,Bc=null;function ll(e){return e.nodeType===9?e:e.ownerDocument}function Yd(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 Qd(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 kc(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 Hc=null;function Kp(){var e=window.event;return e&&e.type==="popstate"?e===Hc?!1:(Hc=e,!0):(Hc=null,!1)}var Vd=typeof setTimeout=="function"?setTimeout:void 0,Wp=typeof clearTimeout=="function"?clearTimeout:void 0,Xd=typeof Promise=="function"?Promise:void 0,Gp=typeof queueMicrotask=="function"?queueMicrotask:typeof Xd<"u"?function(e){return Xd.resolve(null).then(e).catch(Yp)}:Vd;function Yp(e){setTimeout(function(){throw e})}function Hr(e){return e==="head"}function $d(e,t){var i=t,r=0;do{var a=i.nextSibling;if(e.removeChild(i),a&&a.nodeType===8)if(i=a.data,i==="/$"||i==="/&"){if(r===0){e.removeChild(a),en(t);return}r--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")r++;else if(i==="html")In(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,In(i);for(var c=i.firstChild;c;){var D=c.nextSibling,H=c.nodeName;c[Ve]||H==="SCRIPT"||H==="STYLE"||H==="LINK"&&c.rel.toLowerCase()==="stylesheet"||i.removeChild(c),c=D}}else i==="body"&&In(e.ownerDocument.body);i=a}while(i);en(t)}function Zd(e,t){var i=e;e=0;do{var r=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),r&&r.nodeType===8)if(i=r.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=r}while(i)}function Nc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Nc(i),Xe(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function Qp(e,t,i,r){for(;e.nodeType===1;){var a=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Ve])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==a.rel||e.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute("title")!==(a.title==null?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=gi(e.nextSibling),e===null)break}return null}function Vp(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=gi(e.nextSibling),e===null))return null;return e}function Jd(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=gi(e.nextSibling),e===null))return null;return e}function jc(e){return e.data==="$?"||e.data==="$~"}function zc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Xp(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var r=function(){t(),i.removeEventListener("DOMContentLoaded",r)};i.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function gi(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 Uc=null;function e_(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return gi(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function t_(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function i_(e,t,i){switch(t=ll(i),e){case"html":if(e=t.documentElement,!e)throw Error(g(452));return e;case"head":if(e=t.head,!e)throw Error(g(453));return e;case"body":if(e=t.body,!e)throw Error(g(454));return e;default:throw Error(g(451))}}function In(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Xe(e)}var yi=new Map,r_=new Set;function ol(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var fr=$.d;$.d={f:$p,r:Zp,D:Jp,C:eg,L:tg,m:ig,X:sg,S:rg,M:ng};function $p(){var e=fr.f(),t=Ja();return e||t}function Zp(e){var t=oi(e);t!==null&&t.tag===5&&t.type==="form"?Sf(t):fr.r(e)}var $s=typeof document>"u"?null:document;function s_(e,t,i){var r=$s;if(r&&typeof t=="string"&&t){var a=hi(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof i=="string"&&(a+='[crossorigin="'+i+'"]'),r_.has(a)||(r_.add(a),e={rel:e,crossOrigin:i,href:t},r.querySelector(a)===null&&(t=r.createElement("link"),kt(t,"link",e),dt(t),r.head.appendChild(t)))}}function Jp(e){fr.D(e),s_("dns-prefetch",e,null)}function eg(e,t){fr.C(e,t),s_("preconnect",e,t)}function tg(e,t,i){fr.L(e,t,i);var r=$s;if(r&&e&&t){var a='link[rel="preload"][as="'+hi(t)+'"]';t==="image"&&i&&i.imageSrcSet?(a+='[imagesrcset="'+hi(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(a+='[imagesizes="'+hi(i.imageSizes)+'"]')):a+='[href="'+hi(e)+'"]';var c=a;switch(t){case"style":c=Zs(e);break;case"script":c=Js(e)}yi.has(c)||(e=m({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),yi.set(c,e),r.querySelector(a)!==null||t==="style"&&r.querySelector(qn(c))||t==="script"&&r.querySelector(Kn(c))||(t=r.createElement("link"),kt(t,"link",e),dt(t),r.head.appendChild(t)))}}function ig(e,t){fr.m(e,t);var i=$s;if(i&&e){var r=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+hi(r)+'"][href="'+hi(e)+'"]',c=a;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=Js(e)}if(!yi.has(c)&&(e=m({rel:"modulepreload",href:e},t),yi.set(c,e),i.querySelector(a)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Kn(c)))return}r=i.createElement("link"),kt(r,"link",e),dt(r),i.head.appendChild(r)}}}function rg(e,t,i){fr.S(e,t,i);var r=$s;if(r&&e){var a=Mt(r).hoistableStyles,c=Zs(e);t=t||"default";var D=a.get(c);if(!D){var H={loading:0,preload:null};if(D=r.querySelector(qn(c)))H.loading=5;else{e=m({rel:"stylesheet",href:e,"data-precedence":t},i),(i=yi.get(c))&&Pc(e,i);var K=D=r.createElement("link");dt(K),kt(K,"link",e),K._p=new Promise(function(se,he){K.onload=se,K.onerror=he}),K.addEventListener("load",function(){H.loading|=1}),K.addEventListener("error",function(){H.loading|=2}),H.loading|=4,cl(D,t,r)}D={type:"stylesheet",instance:D,count:1,state:H},a.set(c,D)}}}function sg(e,t){fr.X(e,t);var i=$s;if(i&&e){var r=Mt(i).hoistableScripts,a=Js(e),c=r.get(a);c||(c=i.querySelector(Kn(a)),c||(e=m({src:e,async:!0},t),(t=yi.get(a))&&Fc(e,t),c=i.createElement("script"),dt(c),kt(c,"link",e),i.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},r.set(a,c))}}function ng(e,t){fr.M(e,t);var i=$s;if(i&&e){var r=Mt(i).hoistableScripts,a=Js(e),c=r.get(a);c||(c=i.querySelector(Kn(a)),c||(e=m({src:e,async:!0,type:"module"},t),(t=yi.get(a))&&Fc(e,t),c=i.createElement("script"),dt(c),kt(c,"link",e),i.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},r.set(a,c))}}function n_(e,t,i,r){var a=(a=Y.current)?ol(a):null;if(!a)throw Error(g(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=Zs(i.href),i=Mt(a).hoistableStyles,r=i.get(t),r||(r={type:"style",instance:null,count:0,state:null},i.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Zs(i.href);var c=Mt(a).hoistableStyles,D=c.get(e);if(D||(a=a.ownerDocument||a,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,D),(c=a.querySelector(qn(e)))&&!c._p&&(D.instance=c,D.state.loading=5),yi.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},yi.set(e,i),c||ag(a,e,i,D.state))),t&&r===null)throw Error(g(528,""));return D}if(t&&r!==null)throw Error(g(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Js(i),i=Mt(a).hoistableScripts,r=i.get(t),r||(r={type:"script",instance:null,count:0,state:null},i.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(g(444,e))}}function Zs(e){return'href="'+hi(e)+'"'}function qn(e){return'link[rel="stylesheet"]['+e+"]"}function a_(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function ag(e,t,i,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}),kt(t,"link",i),dt(t),e.head.appendChild(t))}function Js(e){return'[src="'+hi(e)+'"]'}function Kn(e){return"script[async]"+e}function l_(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+hi(i.href)+'"]');if(r)return t.instance=r,dt(r),r;var a=m({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),dt(r),kt(r,"style",a),cl(r,i.precedence,e),t.instance=r;case"stylesheet":a=Zs(i.href);var c=e.querySelector(qn(a));if(c)return t.state.loading|=4,t.instance=c,dt(c),c;r=a_(i),(a=yi.get(a))&&Pc(r,a),c=(e.ownerDocument||e).createElement("link"),dt(c);var D=c;return D._p=new Promise(function(H,K){D.onload=H,D.onerror=K}),kt(c,"link",r),t.state.loading|=4,cl(c,i.precedence,e),t.instance=c;case"script":return c=Js(i.src),(a=e.querySelector(Kn(c)))?(t.instance=a,dt(a),a):(r=i,(a=yi.get(c))&&(r=m({},i),Fc(r,a)),e=e.ownerDocument||e,a=e.createElement("script"),dt(a),kt(a,"link",r),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(g(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,cl(r,i.precedence,e));return t.instance}function cl(e,t,i){for(var r=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=r.length?r[r.length-1]:null,c=a,D=0;D<r.length;D++){var H=r[D];if(H.dataset.precedence===t)c=H;else if(c!==a)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function Pc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Fc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ul=null;function o_(e,t,i){if(ul===null){var r=new Map,a=ul=new Map;a.set(i,r)}else a=ul,r=a.get(i),r||(r=new Map,a.set(i,r));if(r.has(e))return r;for(r.set(e,null),i=i.getElementsByTagName(e),a=0;a<i.length;a++){var c=i[a];if(!(c[Ve]||c[be]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var D=c.getAttribute(t)||"";D=e+D;var H=r.get(D);H?H.push(c):r.set(D,[c])}}return r}function c_(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function lg(e,t,i){if(i===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;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!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 u_(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function og(e,t,i,r){if(i.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var a=Zs(r.href),c=t.querySelector(qn(a));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=hl.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=c,dt(c);return}c=t.ownerDocument||t,r=a_(r),(a=yi.get(a))&&Pc(r,a),c=c.createElement("link"),dt(c);var D=c;D._p=new Promise(function(H,K){D.onload=H,D.onerror=K}),kt(c,"link",r),i.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=hl.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Ic=0;function cg(e,t){return e.stylesheets&&e.count===0&&dl(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var r=setTimeout(function(){if(e.stylesheets&&dl(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&Ic===0&&(Ic=62500*qp());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&dl(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>Ic?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(a)}}:null}function hl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)dl(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var fl=null;function dl(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,fl=new Map,t.forEach(ug,e),fl=null,hl.call(e))}function ug(e,t){if(!(t.state.loading&4)){var i=fl.get(e);if(i)var r=i.get(null);else{i=new Map,fl.set(e,i);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<a.length;c++){var D=a[c];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(i.set(D.dataset.precedence,D),r=D)}r&&i.set(null,r)}a=t.instance,D=a.getAttribute("data-precedence"),c=i.get(D)||r,c===r&&i.set(null,a),i.set(D,a),this.count++,r=hl.bind(this),a.addEventListener("load",r),a.addEventListener("error",r),c?c.parentNode.insertBefore(a,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var Wn={$$typeof:v,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function hg(e,t,i,r,a,c,D,H,K){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=ln(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ln(0),this.hiddenUpdates=ln(null),this.identifierPrefix=r,this.onUncaughtError=a,this.onCaughtError=c,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.incompleteTransitions=new Map}function h_(e,t,i,r,a,c,D,H,K,se,he,_e){return e=new hg(e,t,i,D,K,se,he,_e,H),t=1,c===!0&&(t|=24),c=ei(3,null,null,t),e.current=c,c.stateNode=e,t=bo(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:r,isDehydrated:i,cache:t},xo(c),e}function f_(e){return e?(e=Ms,e):Ms}function d_(e,t,i,r,a,c){a=f_(a),r.context===null?r.context=a:r.pendingContext=a,r=wr(t),r.payload={element:i},c=c===void 0?null:c,c!==null&&(r.callback=c),i=xr(e,r,t),i!==null&&($t(i,e,t),En(i,e,t))}function __(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function qc(e,t){__(e,t),(e=e.alternate)&&__(e,t)}function v_(e){if(e.tag===13||e.tag===31){var t=Zr(e,67108864);t!==null&&$t(t,e,67108864),qc(e,67108864)}}function m_(e){if(e.tag===13||e.tag===31){var t=ni();t=ge(t);var i=Zr(e,t);i!==null&&$t(i,e,t),qc(e,t)}}var _l=!0;function fg(e,t,i,r){var a=q.T;q.T=null;var c=$.p;try{$.p=2,Kc(e,t,i,r)}finally{$.p=c,q.T=a}}function dg(e,t,i,r){var a=q.T;q.T=null;var c=$.p;try{$.p=8,Kc(e,t,i,r)}finally{$.p=c,q.T=a}}function Kc(e,t,i,r){if(_l){var a=Wc(r);if(a===null)Mc(e,t,r,vl,i),g_(e,r);else if(vg(a,e,t,i,r))r.stopPropagation();else if(g_(e,r),t&4&&-1<_g.indexOf(e)){for(;a!==null;){var c=oi(a);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var D=Bi(c.pendingLanes);if(D!==0){var H=c;for(H.pendingLanes|=2,H.entangledLanes|=2;D;){var K=1<<31-jt(D);H.entanglements[1]|=K,D&=~K}zi(c),(Qe&6)===0&&($a=nt()+500,Un(0))}}break;case 31:case 13:H=Zr(c,2),H!==null&&$t(H,c,2),Ja(),qc(c,2)}if(c=Wc(r),c===null&&Mc(e,t,r,vl,i),c===a)break;a=c}a!==null&&r.stopPropagation()}else Mc(e,t,r,null,i)}}function Wc(e){return e=Gl(e),Gc(e)}var vl=null;function Gc(e){if(vl=null,e=qt(e),e!==null){var t=M(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=T(t),e!==null)return e;e=null}else if(i===31){if(e=l(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return vl=e,null}function p_(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(Ut()){case li:return 2;case Ht:return 8;case ut:case Gi:return 32;case Zt:return 268435456;default:return 32}default:return 32}}var Yc=!1,Nr=null,jr=null,zr=null,Gn=new Map,Yn=new Map,Ur=[],_g="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 g_(e,t){switch(e){case"focusin":case"focusout":Nr=null;break;case"dragenter":case"dragleave":jr=null;break;case"mouseover":case"mouseout":zr=null;break;case"pointerover":case"pointerout":Gn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Yn.delete(t.pointerId)}}function Qn(e,t,i,r,a,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:i,eventSystemFlags:r,nativeEvent:c,targetContainers:[a]},t!==null&&(t=oi(t),t!==null&&v_(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function vg(e,t,i,r,a){switch(t){case"focusin":return Nr=Qn(Nr,e,t,i,r,a),!0;case"dragenter":return jr=Qn(jr,e,t,i,r,a),!0;case"mouseover":return zr=Qn(zr,e,t,i,r,a),!0;case"pointerover":var c=a.pointerId;return Gn.set(c,Qn(Gn.get(c)||null,e,t,i,r,a)),!0;case"gotpointercapture":return c=a.pointerId,Yn.set(c,Qn(Yn.get(c)||null,e,t,i,r,a)),!0}return!1}function y_(e){var t=qt(e.target);if(t!==null){var i=M(t);if(i!==null){if(t=i.tag,t===13){if(t=T(i),t!==null){e.blockedOn=t,xe(e.priority,function(){m_(i)});return}}else if(t===31){if(t=l(i),t!==null){e.blockedOn=t,xe(e.priority,function(){m_(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ml(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=Wc(e.nativeEvent);if(i===null){i=e.nativeEvent;var r=new i.constructor(i.type,i);Wl=r,i.target.dispatchEvent(r),Wl=null}else return t=oi(i),t!==null&&v_(t),e.blockedOn=i,!1;t.shift()}return!0}function S_(e,t,i){ml(e)&&i.delete(t)}function mg(){Yc=!1,Nr!==null&&ml(Nr)&&(Nr=null),jr!==null&&ml(jr)&&(jr=null),zr!==null&&ml(zr)&&(zr=null),Gn.forEach(S_),Yn.forEach(S_)}function pl(e,t){e.blockedOn===t&&(e.blockedOn=null,Yc||(Yc=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,mg)))}var gl=null;function b_(e){gl!==e&&(gl=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){gl===e&&(gl=null);for(var t=0;t<e.length;t+=3){var i=e[t],r=e[t+1],a=e[t+2];if(typeof r!="function"){if(Gc(r||i)===null)continue;break}var c=oi(i);c!==null&&(e.splice(t,3),t-=3,Wo(c,{pending:!0,data:a,method:i.method,action:r},r,a))}}))}function en(e){function t(K){return pl(K,e)}Nr!==null&&pl(Nr,e),jr!==null&&pl(jr,e),zr!==null&&pl(zr,e),Gn.forEach(t),Yn.forEach(t);for(var i=0;i<Ur.length;i++){var r=Ur[i];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ur.length&&(i=Ur[0],i.blockedOn===null);)y_(i),i.blockedOn===null&&Ur.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(r=0;r<i.length;r+=3){var a=i[r],c=i[r+1],D=a[Se]||null;if(typeof c=="function")D||b_(i);else if(D){var H=null;if(c&&c.hasAttribute("formAction")){if(a=c,D=c[Se]||null)H=D.formAction;else if(Gc(a)!==null)continue}else H=D.action;typeof H=="function"?i[r+1]=H:(i.splice(r,3),r-=3),b_(i)}}}function C_(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(D){return a=D})},focusReset:"manual",scroll:"manual"})}function t(){a!==null&&(a(),a=null),r||setTimeout(i,20)}function i(){if(!r&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,a=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),a!==null&&(a(),a=null)}}}function Qc(e){this._internalRoot=e}yl.prototype.render=Qc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(g(409));var i=t.current,r=ni();d_(i,r,e,t,null,null)},yl.prototype.unmount=Qc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;d_(e.current,2,null,e,null,null),Ja(),t[we]=null}};function yl(e){this._internalRoot=e}yl.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ae();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Ur.length&&t!==0&&t<Ur[i].priority;i++);Ur.splice(i,0,e),i===0&&y_(e)}};var E_=n.version;if(E_!=="19.2.0")throw Error(g(527,E_,"19.2.0"));$.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(g(188)):(e=Object.keys(e).join(","),Error(g(268,e)));return e=h(t),e=e!==null?p(e):null,e=e===null?null:e.stateNode,e};var pg={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Sl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Sl.isDisabled&&Sl.supportsFiber)try{Tt=Sl.inject(pg),Nt=Sl}catch{}}return Xn.createRoot=function(e,t){if(!E(e))throw Error(g(299));var i=!1,r="",a=Mf,c=Lf,D=Of;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(D=t.onRecoverableError)),t=h_(e,1,!1,null,null,i,r,null,a,c,D,C_),e[we]=t.current,Tc(e),new Qc(t)},Xn.hydrateRoot=function(e,t,i){if(!E(e))throw Error(g(299));var r=!1,a="",c=Mf,D=Lf,H=Of,K=null;return i!=null&&(i.unstable_strictMode===!0&&(r=!0),i.identifierPrefix!==void 0&&(a=i.identifierPrefix),i.onUncaughtError!==void 0&&(c=i.onUncaughtError),i.onCaughtError!==void 0&&(D=i.onCaughtError),i.onRecoverableError!==void 0&&(H=i.onRecoverableError),i.formState!==void 0&&(K=i.formState)),t=h_(e,1,!0,t,i??null,r,a,K,c,D,H,C_),t.context=f_(null),i=t.current,r=ni(),r=ge(r),a=wr(r),a.callback=null,xr(i,a,r),i=r,t.current.lanes=i,Qr(t,i),zi(t),e[we]=t.current,Tc(e),new yl(t)},Xn.version="19.2.0",Xn}var B_;function Dg(){if(B_)return $c.exports;B_=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(n){console.error(n)}}return s(),$c.exports=Rg(),$c.exports}var Ag=Dg();const Tg=Cv(Ag);var an=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(s){return this.listeners.add(s),this.onSubscribe(),()=>{this.listeners.delete(s),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Mg={setTimeout:(s,n)=>setTimeout(s,n),clearTimeout:s=>clearTimeout(s),setInterval:(s,n)=>setInterval(s,n),clearInterval:s=>clearInterval(s)},Lg=class{#e=Mg;#t=!1;setTimeoutProvider(s){this.#e=s}setTimeout(s,n){return this.#e.setTimeout(s,n)}clearTimeout(s){this.#e.clearTimeout(s)}setInterval(s,n){return this.#e.setInterval(s,n)}clearInterval(s){this.#e.clearInterval(s)}},hs=new Lg;function Og(s){setTimeout(s,0)}var ds=typeof window>"u"||"Deno"in globalThis;function Ft(){}function Bg(s,n){return typeof s=="function"?s(n):s}function cu(s){return typeof s=="number"&&s>=0&&s!==1/0}function wv(s,n){return Math.max(s+(n||0)-Date.now(),0)}function Kr(s,n){return typeof s=="function"?s(n):s}function bi(s,n){return typeof s=="function"?s(n):s}function k_(s,n){const{type:_="all",exact:g,fetchStatus:E,predicate:M,queryKey:T,stale:l}=s;if(T){if(g){if(n.queryHash!==Su(T,n.options))return!1}else if(!ia(n.queryKey,T))return!1}if(_!=="all"){const f=n.isActive();if(_==="active"&&!f||_==="inactive"&&f)return!1}return!(typeof l=="boolean"&&n.isStale()!==l||E&&E!==n.state.fetchStatus||M&&!M(n))}function H_(s,n){const{exact:_,status:g,predicate:E,mutationKey:M}=s;if(M){if(!n.options.mutationKey)return!1;if(_){if(_s(n.options.mutationKey)!==_s(M))return!1}else if(!ia(n.options.mutationKey,M))return!1}return!(g&&n.state.status!==g||E&&!E(n))}function Su(s,n){return(n?.queryKeyHashFn||_s)(s)}function _s(s){return JSON.stringify(s,(n,_)=>uu(_)?Object.keys(_).sort().reduce((g,E)=>(g[E]=_[E],g),{}):_)}function ia(s,n){return s===n?!0:typeof s!=typeof n?!1:s&&n&&typeof s=="object"&&typeof n=="object"?Object.keys(n).every(_=>ia(s[_],n[_])):!1}var kg=Object.prototype.hasOwnProperty;function xv(s,n){if(s===n)return s;const _=N_(s)&&N_(n);if(!_&&!(uu(s)&&uu(n)))return n;const E=(_?s:Object.keys(s)).length,M=_?n:Object.keys(n),T=M.length,l=_?new Array(T):{};let f=0;for(let h=0;h<T;h++){const p=_?h:M[h],m=s[p],y=n[p];if(m===y){l[p]=m,(_?h<E:kg.call(s,p))&&f++;continue}if(m===null||y===null||typeof m!="object"||typeof y!="object"){l[p]=y;continue}const b=xv(m,y);l[p]=b,b===m&&f++}return E===T&&f===E?s:l}function Ll(s,n){if(!n||Object.keys(s).length!==Object.keys(n).length)return!1;for(const _ in s)if(s[_]!==n[_])return!1;return!0}function N_(s){return Array.isArray(s)&&s.length===Object.keys(s).length}function uu(s){if(!j_(s))return!1;const n=s.constructor;if(n===void 0)return!0;const _=n.prototype;return!(!j_(_)||!_.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(s)!==Object.prototype)}function j_(s){return Object.prototype.toString.call(s)==="[object Object]"}function Hg(s){return new Promise(n=>{hs.setTimeout(n,s)})}function hu(s,n,_){return typeof _.structuralSharing=="function"?_.structuralSharing(s,n):_.structuralSharing!==!1?xv(s,n):n}function Ng(s,n,_=0){const g=[...s,n];return _&&g.length>_?g.slice(1):g}function jg(s,n,_=0){const g=[n,...s];return _&&g.length>_?g.slice(0,-1):g}var bu=Symbol();function Rv(s,n){return!s.queryFn&&n?.initialPromise?()=>n.initialPromise:!s.queryFn||s.queryFn===bu?()=>Promise.reject(new Error(`Missing queryFn: '${s.queryHash}'`)):s.queryFn}function Dv(s,n){return typeof s=="function"?s(...n):!!s}var zg=class extends an{#e;#t;#i;constructor(){super(),this.#i=s=>{if(!ds&&window.addEventListener){const n=()=>s();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#i)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(s){this.#i=s,this.#t?.(),this.#t=s(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(s){this.#e!==s&&(this.#e=s,this.onFocus())}onFocus(){const s=this.isFocused();this.listeners.forEach(n=>{n(s)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Cu=new zg;function fu(){let s,n;const _=new Promise((E,M)=>{s=E,n=M});_.status="pending",_.catch(()=>{});function g(E){Object.assign(_,E),delete _.resolve,delete _.reject}return _.resolve=E=>{g({status:"fulfilled",value:E}),s(E)},_.reject=E=>{g({status:"rejected",reason:E}),n(E)},_}var Ug=Og;function Pg(){let s=[],n=0,_=l=>{l()},g=l=>{l()},E=Ug;const M=l=>{n?s.push(l):E(()=>{_(l)})},T=()=>{const l=s;s=[],l.length&&E(()=>{g(()=>{l.forEach(f=>{_(f)})})})};return{batch:l=>{let f;n++;try{f=l()}finally{n--,n||T()}return f},batchCalls:l=>(...f)=>{M(()=>{l(...f)})},schedule:M,setNotifyFunction:l=>{_=l},setBatchNotifyFunction:l=>{g=l},setScheduler:l=>{E=l}}}var Rt=Pg(),Fg=class extends an{#e=!0;#t;#i;constructor(){super(),this.#i=s=>{if(!ds&&window.addEventListener){const n=()=>s(!0),_=()=>s(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",_,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",_)}}}}onSubscribe(){this.#t||this.setEventListener(this.#i)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(s){this.#i=s,this.#t?.(),this.#t=s(this.setOnline.bind(this))}setOnline(s){this.#e!==s&&(this.#e=s,this.listeners.forEach(_=>{_(s)}))}isOnline(){return this.#e}},Ol=new Fg;function Ig(s){return Math.min(1e3*2**s,3e4)}function Av(s){return(s??"online")==="online"?Ol.isOnline():!0}var du=class extends Error{constructor(s){super("CancelledError"),this.revert=s?.revert,this.silent=s?.silent}};function Tv(s){let n=!1,_=0,g;const E=fu(),M=()=>E.status!=="pending",T=S=>{if(!M()){const o=new du(S);y(o),s.onCancel?.(o)}},l=()=>{n=!0},f=()=>{n=!1},h=()=>Cu.isFocused()&&(s.networkMode==="always"||Ol.isOnline())&&s.canRun(),p=()=>Av(s.networkMode)&&s.canRun(),m=S=>{M()||(g?.(),E.resolve(S))},y=S=>{M()||(g?.(),E.reject(S))},b=()=>new Promise(S=>{g=o=>{(M()||h())&&S(o)},s.onPause?.()}).then(()=>{g=void 0,M()||s.onContinue?.()}),A=()=>{if(M())return;let S;const o=_===0?s.initialPromise:void 0;try{S=o??s.fn()}catch(u){S=Promise.reject(u)}Promise.resolve(S).then(m).catch(u=>{if(M())return;const d=s.retry??(ds?0:3),v=s.retryDelay??Ig,x=typeof v=="function"?v(_,u):v,R=d===!0||typeof d=="number"&&_<d||typeof d=="function"&&d(_,u);if(n||!R){y(u);return}_++,s.onFail?.(_,u),Hg(x).then(()=>h()?void 0:b()).then(()=>{n?y(u):A()})})};return{promise:E,status:()=>E.status,cancel:T,continue:()=>(g?.(),E),cancelRetry:l,continueRetry:f,canStart:p,start:()=>(p()?A():b().then(A),E)}}var Mv=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),cu(this.gcTime)&&(this.#e=hs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(s){this.gcTime=Math.max(this.gcTime||0,s??(ds?1/0:300*1e3))}clearGcTimeout(){this.#e&&(hs.clearTimeout(this.#e),this.#e=void 0)}},qg=class extends Mv{#e;#t;#i;#s;#r;#a;#l;constructor(s){super(),this.#l=!1,this.#a=s.defaultOptions,this.setOptions(s.options),this.observers=[],this.#s=s.client,this.#i=this.#s.getQueryCache(),this.queryKey=s.queryKey,this.queryHash=s.queryHash,this.#e=U_(this.options),this.state=s.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(s){if(this.options={...this.#a,...s},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=U_(this.options);n.data!==void 0&&(this.setState(z_(n.data,n.dataUpdatedAt)),this.#e=n)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#i.remove(this)}setData(s,n){const _=hu(this.state.data,s,this.options);return this.#n({data:_,type:"success",dataUpdatedAt:n?.updatedAt,manual:n?.manual}),_}setState(s,n){this.#n({type:"setState",state:s,setStateOptions:n})}cancel(s){const n=this.#r?.promise;return this.#r?.cancel(s),n?n.then(Ft).catch(Ft):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(s=>bi(s.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===bu||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(s=>Kr(s.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(s=>s.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(s=0){return this.state.data===void 0?!0:s==="static"?!1:this.state.isInvalidated?!0:!wv(this.state.dataUpdatedAt,s)}onFocus(){this.observers.find(n=>n.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(n=>n.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(s){this.observers.includes(s)||(this.observers.push(s),this.clearGcTimeout(),this.#i.notify({type:"observerAdded",query:this,observer:s}))}removeObserver(s){this.observers.includes(s)&&(this.observers=this.observers.filter(n=>n!==s),this.observers.length||(this.#r&&(this.#l?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#i.notify({type:"observerRemoved",query:this,observer:s}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#n({type:"invalidate"})}async fetch(s,n){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&n?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(s&&this.setOptions(s),!this.options.queryFn){const l=this.observers.find(f=>f.options.queryFn);l&&this.setOptions(l.options)}const _=new AbortController,g=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#l=!0,_.signal)})},E=()=>{const l=Rv(this.options,n),h=(()=>{const p={client:this.#s,queryKey:this.queryKey,meta:this.meta};return g(p),p})();return this.#l=!1,this.options.persister?this.options.persister(l,h,this):l(h)},T=(()=>{const l={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:E};return g(l),l})();this.options.behavior?.onFetch(T,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==T.fetchOptions?.meta)&&this.#n({type:"fetch",meta:T.fetchOptions?.meta}),this.#r=Tv({initialPromise:n?.initialPromise,fn:T.fetchFn,onCancel:l=>{l instanceof du&&l.revert&&this.setState({...this.#t,fetchStatus:"idle"}),_.abort()},onFail:(l,f)=>{this.#n({type:"failed",failureCount:l,error:f})},onPause:()=>{this.#n({type:"pause"})},onContinue:()=>{this.#n({type:"continue"})},retry:T.options.retry,retryDelay:T.options.retryDelay,networkMode:T.options.networkMode,canRun:()=>!0});try{const l=await this.#r.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#i.config.onSuccess?.(l,this),this.#i.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof du){if(l.silent)return this.#r.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#n({type:"error",error:l}),this.#i.config.onError?.(l,this),this.#i.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#n(s){const n=_=>{switch(s.type){case"failed":return{..._,fetchFailureCount:s.failureCount,fetchFailureReason:s.error};case"pause":return{..._,fetchStatus:"paused"};case"continue":return{..._,fetchStatus:"fetching"};case"fetch":return{..._,...Lv(_.data,this.options),fetchMeta:s.meta??null};case"success":const g={..._,...z_(s.data,s.dataUpdatedAt),dataUpdateCount:_.dataUpdateCount+1,...!s.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=s.manual?g:void 0,g;case"error":const E=s.error;return{..._,error:E,errorUpdateCount:_.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:_.fetchFailureCount+1,fetchFailureReason:E,fetchStatus:"idle",status:"error"};case"invalidate":return{..._,isInvalidated:!0};case"setState":return{..._,...s.state}}};this.state=n(this.state),Rt.batch(()=>{this.observers.forEach(_=>{_.onQueryUpdate()}),this.#i.notify({query:this,type:"updated",action:s})})}};function Lv(s,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Av(n.networkMode)?"fetching":"paused",...s===void 0&&{error:null,status:"pending"}}}function z_(s,n){return{data:s,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function U_(s){const n=typeof s.initialData=="function"?s.initialData():s.initialData,_=n!==void 0,g=_?typeof s.initialDataUpdatedAt=="function"?s.initialDataUpdatedAt():s.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:_?g??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:_?"success":"pending",fetchStatus:"idle"}}var Kg=class extends an{constructor(s,n){super(),this.options=n,this.#e=s,this.#n=null,this.#l=fu(),this.bindMethods(),this.setOptions(n)}#e;#t=void 0;#i=void 0;#s=void 0;#r;#a;#l;#n;#v;#f;#d;#c;#u;#o;#_=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),P_(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _u(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _u(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#S(),this.#b(),this.#t.removeObserver(this)}setOptions(s){const n=this.options,_=this.#t;if(this.options=this.#e.defaultQueryOptions(s),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof bi(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#C(),this.#t.setOptions(this.options),n._defaulted&&!Ll(this.options,n)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const g=this.hasListeners();g&&F_(this.#t,_,this.options,n)&&this.#h(),this.updateResult(),g&&(this.#t!==_||bi(this.options.enabled,this.#t)!==bi(n.enabled,this.#t)||Kr(this.options.staleTime,this.#t)!==Kr(n.staleTime,this.#t))&&this.#m();const E=this.#p();g&&(this.#t!==_||bi(this.options.enabled,this.#t)!==bi(n.enabled,this.#t)||E!==this.#o)&&this.#g(E)}getOptimisticResult(s){const n=this.#e.getQueryCache().build(this.#e,s),_=this.createResult(n,s);return Gg(this,_)&&(this.#s=_,this.#a=this.options,this.#r=this.#t.state),_}getCurrentResult(){return this.#s}trackResult(s,n){return new Proxy(s,{get:(_,g)=>(this.trackProp(g),n?.(g),g==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#l.status==="pending"&&this.#l.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(_,g))})}trackProp(s){this.#_.add(s)}getCurrentQuery(){return this.#t}refetch({...s}={}){return this.fetch({...s})}fetchOptimistic(s){const n=this.#e.defaultQueryOptions(s),_=this.#e.getQueryCache().build(this.#e,n);return _.fetch().then(()=>this.createResult(_,n))}fetch(s){return this.#h({...s,cancelRefetch:s.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#h(s){this.#C();let n=this.#t.fetch(this.options,s);return s?.throwOnError||(n=n.catch(Ft)),n}#m(){this.#S();const s=Kr(this.options.staleTime,this.#t);if(ds||this.#s.isStale||!cu(s))return;const _=wv(this.#s.dataUpdatedAt,s)+1;this.#c=hs.setTimeout(()=>{this.#s.isStale||this.updateResult()},_)}#p(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#g(s){this.#b(),this.#o=s,!(ds||bi(this.options.enabled,this.#t)===!1||!cu(this.#o)||this.#o===0)&&(this.#u=hs.setInterval(()=>{(this.options.refetchIntervalInBackground||Cu.isFocused())&&this.#h()},this.#o))}#y(){this.#m(),this.#g(this.#p())}#S(){this.#c&&(hs.clearTimeout(this.#c),this.#c=void 0)}#b(){this.#u&&(hs.clearInterval(this.#u),this.#u=void 0)}createResult(s,n){const _=this.#t,g=this.options,E=this.#s,M=this.#r,T=this.#a,f=s!==_?s.state:this.#i,{state:h}=s;let p={...h},m=!1,y;if(n._optimisticResults){const C=this.hasListeners(),B=!C&&P_(s,n),P=C&&F_(s,_,n,g);(B||P)&&(p={...p,...Lv(h.data,s.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:b,errorUpdatedAt:A,status:S}=p;y=p.data;let o=!1;if(n.placeholderData!==void 0&&y===void 0&&S==="pending"){let C;E?.isPlaceholderData&&n.placeholderData===T?.placeholderData?(C=E.data,o=!0):C=typeof n.placeholderData=="function"?n.placeholderData(this.#d?.state.data,this.#d):n.placeholderData,C!==void 0&&(S="success",y=hu(E?.data,C,n),m=!0)}if(n.select&&y!==void 0&&!o)if(E&&y===M?.data&&n.select===this.#v)y=this.#f;else try{this.#v=n.select,y=n.select(y),y=hu(E?.data,y,n),this.#f=y,this.#n=null}catch(C){this.#n=C}this.#n&&(b=this.#n,y=this.#f,A=Date.now(),S="error");const u=p.fetchStatus==="fetching",d=S==="pending",v=S==="error",x=d&&u,R=y!==void 0,w={status:S,fetchStatus:p.fetchStatus,isPending:d,isSuccess:S==="success",isError:v,isInitialLoading:x,isLoading:x,data:y,dataUpdatedAt:p.dataUpdatedAt,error:b,errorUpdatedAt:A,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>f.dataUpdateCount||p.errorUpdateCount>f.errorUpdateCount,isFetching:u,isRefetching:u&&!d,isLoadingError:v&&!R,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:v&&R,isStale:Eu(s,n),refetch:this.refetch,promise:this.#l,isEnabled:bi(n.enabled,s)!==!1};if(this.options.experimental_prefetchInRender){const C=I=>{w.status==="error"?I.reject(w.error):w.data!==void 0&&I.resolve(w.data)},B=()=>{const I=this.#l=w.promise=fu();C(I)},P=this.#l;switch(P.status){case"pending":s.queryHash===_.queryHash&&C(P);break;case"fulfilled":(w.status==="error"||w.data!==P.value)&&B();break;case"rejected":(w.status!=="error"||w.error!==P.reason)&&B();break}}return w}updateResult(){const s=this.#s,n=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#a=this.options,this.#r.data!==void 0&&(this.#d=this.#t),Ll(n,s))return;this.#s=n;const _=()=>{if(!s)return!0;const{notifyOnChangeProps:g}=this.options,E=typeof g=="function"?g():g;if(E==="all"||!E&&!this.#_.size)return!0;const M=new Set(E??this.#_);return this.options.throwOnError&&M.add("error"),Object.keys(this.#s).some(T=>{const l=T;return this.#s[l]!==s[l]&&M.has(l)})};this.#E({listeners:_()})}#C(){const s=this.#e.getQueryCache().build(this.#e,this.options);if(s===this.#t)return;const n=this.#t;this.#t=s,this.#i=s.state,this.hasListeners()&&(n?.removeObserver(this),s.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#E(s){Rt.batch(()=>{s.listeners&&this.listeners.forEach(n=>{n(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Wg(s,n){return bi(n.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&n.retryOnMount===!1)}function P_(s,n){return Wg(s,n)||s.state.data!==void 0&&_u(s,n,n.refetchOnMount)}function _u(s,n,_){if(bi(n.enabled,s)!==!1&&Kr(n.staleTime,s)!=="static"){const g=typeof _=="function"?_(s):_;return g==="always"||g!==!1&&Eu(s,n)}return!1}function F_(s,n,_,g){return(s!==n||bi(g.enabled,s)===!1)&&(!_.suspense||s.state.status!=="error")&&Eu(s,_)}function Eu(s,n){return bi(n.enabled,s)!==!1&&s.isStaleByTime(Kr(n.staleTime,s))}function Gg(s,n){return!Ll(s.getCurrentResult(),n)}function I_(s){return{onFetch:(n,_)=>{const g=n.options,E=n.fetchOptions?.meta?.fetchMore?.direction,M=n.state.data?.pages||[],T=n.state.data?.pageParams||[];let l={pages:[],pageParams:[]},f=0;const h=async()=>{let p=!1;const m=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>(n.signal.aborted?p=!0:n.signal.addEventListener("abort",()=>{p=!0}),n.signal)})},y=Rv(n.options,n.fetchOptions),b=async(A,S,o)=>{if(p)return Promise.reject();if(S==null&&A.pages.length)return Promise.resolve(A);const d=(()=>{const O={client:n.client,queryKey:n.queryKey,pageParam:S,direction:o?"backward":"forward",meta:n.options.meta};return m(O),O})(),v=await y(d),{maxPages:x}=n.options,R=o?jg:Ng;return{pages:R(A.pages,v,x),pageParams:R(A.pageParams,S,x)}};if(E&&M.length){const A=E==="backward",S=A?Yg:q_,o={pages:M,pageParams:T},u=S(g,o);l=await b(o,u,A)}else{const A=s??M.length;do{const S=f===0?T[0]??g.initialPageParam:q_(g,l);if(f>0&&S==null)break;l=await b(l,S),f++}while(f<A)}return l};n.options.persister?n.fetchFn=()=>n.options.persister?.(h,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},_):n.fetchFn=h}}}function q_(s,{pages:n,pageParams:_}){const g=n.length-1;return n.length>0?s.getNextPageParam(n[g],n,_[g],_):void 0}function Yg(s,{pages:n,pageParams:_}){return n.length>0?s.getPreviousPageParam?.(n[0],n,_[0],_):void 0}var Qg=class extends Mv{#e;#t;#i;#s;constructor(s){super(),this.#e=s.client,this.mutationId=s.mutationId,this.#i=s.mutationCache,this.#t=[],this.state=s.state||Ov(),this.setOptions(s.options),this.scheduleGc()}setOptions(s){this.options=s,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(s){this.#t.includes(s)||(this.#t.push(s),this.clearGcTimeout(),this.#i.notify({type:"observerAdded",mutation:this,observer:s}))}removeObserver(s){this.#t=this.#t.filter(n=>n!==s),this.scheduleGc(),this.#i.notify({type:"observerRemoved",mutation:this,observer:s})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#i.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(s){const n=()=>{this.#r({type:"continue"})},_={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=Tv({fn:()=>this.options.mutationFn?this.options.mutationFn(s,_):Promise.reject(new Error("No mutationFn found")),onFail:(M,T)=>{this.#r({type:"failed",failureCount:M,error:T})},onPause:()=>{this.#r({type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#i.canRun(this)});const g=this.state.status==="pending",E=!this.#s.canStart();try{if(g)n();else{this.#r({type:"pending",variables:s,isPaused:E}),await this.#i.config.onMutate?.(s,this,_);const T=await this.options.onMutate?.(s,_);T!==this.state.context&&this.#r({type:"pending",context:T,variables:s,isPaused:E})}const M=await this.#s.start();return await this.#i.config.onSuccess?.(M,s,this.state.context,this,_),await this.options.onSuccess?.(M,s,this.state.context,_),await this.#i.config.onSettled?.(M,null,this.state.variables,this.state.context,this,_),await this.options.onSettled?.(M,null,s,this.state.context,_),this.#r({type:"success",data:M}),M}catch(M){try{throw await this.#i.config.onError?.(M,s,this.state.context,this,_),await this.options.onError?.(M,s,this.state.context,_),await this.#i.config.onSettled?.(void 0,M,this.state.variables,this.state.context,this,_),await this.options.onSettled?.(void 0,M,s,this.state.context,_),M}finally{this.#r({type:"error",error:M})}}finally{this.#i.runNext(this)}}#r(s){const n=_=>{switch(s.type){case"failed":return{..._,failureCount:s.failureCount,failureReason:s.error};case"pause":return{..._,isPaused:!0};case"continue":return{..._,isPaused:!1};case"pending":return{..._,context:s.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:s.isPaused,status:"pending",variables:s.variables,submittedAt:Date.now()};case"success":return{..._,data:s.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{..._,data:void 0,error:s.error,failureCount:_.failureCount+1,failureReason:s.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Rt.batch(()=>{this.#t.forEach(_=>{_.onMutationUpdate(s)}),this.#i.notify({mutation:this,type:"updated",action:s})})}};function Ov(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Vg=class extends an{constructor(s={}){super(),this.config=s,this.#e=new Set,this.#t=new Map,this.#i=0}#e;#t;#i;build(s,n,_){const g=new Qg({client:s,mutationCache:this,mutationId:++this.#i,options:s.defaultMutationOptions(n),state:_});return this.add(g),g}add(s){this.#e.add(s);const n=bl(s);if(typeof n=="string"){const _=this.#t.get(n);_?_.push(s):this.#t.set(n,[s])}this.notify({type:"added",mutation:s})}remove(s){if(this.#e.delete(s)){const n=bl(s);if(typeof n=="string"){const _=this.#t.get(n);if(_)if(_.length>1){const g=_.indexOf(s);g!==-1&&_.splice(g,1)}else _[0]===s&&this.#t.delete(n)}}this.notify({type:"removed",mutation:s})}canRun(s){const n=bl(s);if(typeof n=="string"){const g=this.#t.get(n)?.find(E=>E.state.status==="pending");return!g||g===s}else return!0}runNext(s){const n=bl(s);return typeof n=="string"?this.#t.get(n)?.find(g=>g!==s&&g.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Rt.batch(()=>{this.#e.forEach(s=>{this.notify({type:"removed",mutation:s})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(s){const n={exact:!0,...s};return this.getAll().find(_=>H_(n,_))}findAll(s={}){return this.getAll().filter(n=>H_(s,n))}notify(s){Rt.batch(()=>{this.listeners.forEach(n=>{n(s)})})}resumePausedMutations(){const s=this.getAll().filter(n=>n.state.isPaused);return Rt.batch(()=>Promise.all(s.map(n=>n.continue().catch(Ft))))}};function bl(s){return s.options.scope?.id}var Xg=class extends an{#e;#t=void 0;#i;#s;constructor(n,_){super(),this.#e=n,this.setOptions(_),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){const _=this.options;this.options=this.#e.defaultMutationOptions(n),Ll(this.options,_)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#i,observer:this}),_?.mutationKey&&this.options.mutationKey&&_s(_.mutationKey)!==_s(this.options.mutationKey)?this.reset():this.#i?.state.status==="pending"&&this.#i.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#i?.removeObserver(this)}onMutationUpdate(n){this.#r(),this.#a(n)}getCurrentResult(){return this.#t}reset(){this.#i?.removeObserver(this),this.#i=void 0,this.#r(),this.#a()}mutate(n,_){return this.#s=_,this.#i?.removeObserver(this),this.#i=this.#e.getMutationCache().build(this.#e,this.options),this.#i.addObserver(this),this.#i.execute(n)}#r(){const n=this.#i?.state??Ov();this.#t={...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset}}#a(n){Rt.batch(()=>{if(this.#s&&this.hasListeners()){const _=this.#t.variables,g=this.#t.context,E={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};n?.type==="success"?(this.#s.onSuccess?.(n.data,_,g,E),this.#s.onSettled?.(n.data,null,_,g,E)):n?.type==="error"&&(this.#s.onError?.(n.error,_,g,E),this.#s.onSettled?.(void 0,n.error,_,g,E))}this.listeners.forEach(_=>{_(this.#t)})})}},$g=class extends an{constructor(s={}){super(),this.config=s,this.#e=new Map}#e;build(s,n,_){const g=n.queryKey,E=n.queryHash??Su(g,n);let M=this.get(E);return M||(M=new qg({client:s,queryKey:g,queryHash:E,options:s.defaultQueryOptions(n),state:_,defaultOptions:s.getQueryDefaults(g)}),this.add(M)),M}add(s){this.#e.has(s.queryHash)||(this.#e.set(s.queryHash,s),this.notify({type:"added",query:s}))}remove(s){const n=this.#e.get(s.queryHash);n&&(s.destroy(),n===s&&this.#e.delete(s.queryHash),this.notify({type:"removed",query:s}))}clear(){Rt.batch(()=>{this.getAll().forEach(s=>{this.remove(s)})})}get(s){return this.#e.get(s)}getAll(){return[...this.#e.values()]}find(s){const n={exact:!0,...s};return this.getAll().find(_=>k_(n,_))}findAll(s={}){const n=this.getAll();return Object.keys(s).length>0?n.filter(_=>k_(s,_)):n}notify(s){Rt.batch(()=>{this.listeners.forEach(n=>{n(s)})})}onFocus(){Rt.batch(()=>{this.getAll().forEach(s=>{s.onFocus()})})}onOnline(){Rt.batch(()=>{this.getAll().forEach(s=>{s.onOnline()})})}},Zg=class{#e;#t;#i;#s;#r;#a;#l;#n;constructor(s={}){this.#e=s.queryCache||new $g,this.#t=s.mutationCache||new Vg,this.#i=s.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#l=Cu.subscribe(async s=>{s&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#n=Ol.subscribe(async s=>{s&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#l?.(),this.#l=void 0,this.#n?.(),this.#n=void 0)}isFetching(s){return this.#e.findAll({...s,fetchStatus:"fetching"}).length}isMutating(s){return this.#t.findAll({...s,status:"pending"}).length}getQueryData(s){const n=this.defaultQueryOptions({queryKey:s});return this.#e.get(n.queryHash)?.state.data}ensureQueryData(s){const n=this.defaultQueryOptions(s),_=this.#e.build(this,n),g=_.state.data;return g===void 0?this.fetchQuery(s):(s.revalidateIfStale&&_.isStaleByTime(Kr(n.staleTime,_))&&this.prefetchQuery(n),Promise.resolve(g))}getQueriesData(s){return this.#e.findAll(s).map(({queryKey:n,state:_})=>{const g=_.data;return[n,g]})}setQueryData(s,n,_){const g=this.defaultQueryOptions({queryKey:s}),M=this.#e.get(g.queryHash)?.state.data,T=Bg(n,M);if(T!==void 0)return this.#e.build(this,g).setData(T,{..._,manual:!0})}setQueriesData(s,n,_){return Rt.batch(()=>this.#e.findAll(s).map(({queryKey:g})=>[g,this.setQueryData(g,n,_)]))}getQueryState(s){const n=this.defaultQueryOptions({queryKey:s});return this.#e.get(n.queryHash)?.state}removeQueries(s){const n=this.#e;Rt.batch(()=>{n.findAll(s).forEach(_=>{n.remove(_)})})}resetQueries(s,n){const _=this.#e;return Rt.batch(()=>(_.findAll(s).forEach(g=>{g.reset()}),this.refetchQueries({type:"active",...s},n)))}cancelQueries(s,n={}){const _={revert:!0,...n},g=Rt.batch(()=>this.#e.findAll(s).map(E=>E.cancel(_)));return Promise.all(g).then(Ft).catch(Ft)}invalidateQueries(s,n={}){return Rt.batch(()=>(this.#e.findAll(s).forEach(_=>{_.invalidate()}),s?.refetchType==="none"?Promise.resolve():this.refetchQueries({...s,type:s?.refetchType??s?.type??"active"},n)))}refetchQueries(s,n={}){const _={...n,cancelRefetch:n.cancelRefetch??!0},g=Rt.batch(()=>this.#e.findAll(s).filter(E=>!E.isDisabled()&&!E.isStatic()).map(E=>{let M=E.fetch(void 0,_);return _.throwOnError||(M=M.catch(Ft)),E.state.fetchStatus==="paused"?Promise.resolve():M}));return Promise.all(g).then(Ft)}fetchQuery(s){const n=this.defaultQueryOptions(s);n.retry===void 0&&(n.retry=!1);const _=this.#e.build(this,n);return _.isStaleByTime(Kr(n.staleTime,_))?_.fetch(n):Promise.resolve(_.state.data)}prefetchQuery(s){return this.fetchQuery(s).then(Ft).catch(Ft)}fetchInfiniteQuery(s){return s.behavior=I_(s.pages),this.fetchQuery(s)}prefetchInfiniteQuery(s){return this.fetchInfiniteQuery(s).then(Ft).catch(Ft)}ensureInfiniteQueryData(s){return s.behavior=I_(s.pages),this.ensureQueryData(s)}resumePausedMutations(){return Ol.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#i}setDefaultOptions(s){this.#i=s}setQueryDefaults(s,n){this.#s.set(_s(s),{queryKey:s,defaultOptions:n})}getQueryDefaults(s){const n=[...this.#s.values()],_={};return n.forEach(g=>{ia(s,g.queryKey)&&Object.assign(_,g.defaultOptions)}),_}setMutationDefaults(s,n){this.#r.set(_s(s),{mutationKey:s,defaultOptions:n})}getMutationDefaults(s){const n=[...this.#r.values()],_={};return n.forEach(g=>{ia(s,g.mutationKey)&&Object.assign(_,g.defaultOptions)}),_}defaultQueryOptions(s){if(s._defaulted)return s;const n={...this.#i.queries,...this.getQueryDefaults(s.queryKey),...s,_defaulted:!0};return n.queryHash||(n.queryHash=Su(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===bu&&(n.enabled=!1),n}defaultMutationOptions(s){return s?._defaulted?s:{...this.#i.mutations,...s?.mutationKey&&this.getMutationDefaults(s.mutationKey),...s,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Bv=X.createContext(void 0),vs=s=>{const n=X.useContext(Bv);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},Jg=({client:s,children:n})=>(X.useEffect(()=>(s.mount(),()=>{s.unmount()}),[s]),N.jsx(Bv.Provider,{value:s,children:n})),kv=X.createContext(!1),ey=()=>X.useContext(kv);kv.Provider;function ty(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var iy=X.createContext(ty()),ry=()=>X.useContext(iy),sy=(s,n)=>{(s.suspense||s.throwOnError||s.experimental_prefetchInRender)&&(n.isReset()||(s.retryOnMount=!1))},ny=s=>{X.useEffect(()=>{s.clearReset()},[s])},ay=({result:s,errorResetBoundary:n,throwOnError:_,query:g,suspense:E})=>s.isError&&!n.isReset()&&!s.isFetching&&g&&(E&&s.data===void 0||Dv(_,[s.error,g])),ly=s=>{if(s.suspense){const _=E=>E==="static"?E:Math.max(E??1e3,1e3),g=s.staleTime;s.staleTime=typeof g=="function"?(...E)=>_(g(...E)):_(g),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},oy=(s,n)=>s.isLoading&&s.isFetching&&!n,cy=(s,n)=>s?.suspense&&n.isPending,K_=(s,n,_)=>n.fetchOptimistic(s).catch(()=>{_.clearReset()});function uy(s,n,_){const g=ey(),E=ry(),M=vs(),T=M.defaultQueryOptions(s);M.getDefaultOptions().queries?._experimental_beforeQuery?.(T),T._optimisticResults=g?"isRestoring":"optimistic",ly(T),sy(T,E),ny(E);const l=!M.getQueryCache().get(T.queryHash),[f]=X.useState(()=>new n(M,T)),h=f.getOptimisticResult(T),p=!g&&s.subscribed!==!1;if(X.useSyncExternalStore(X.useCallback(m=>{const y=p?f.subscribe(Rt.batchCalls(m)):Ft;return f.updateResult(),y},[f,p]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),X.useEffect(()=>{f.setOptions(T)},[T,f]),cy(T,h))throw K_(T,f,E);if(ay({result:h,errorResetBoundary:E,throwOnError:T.throwOnError,query:M.getQueryCache().get(T.queryHash),suspense:T.suspense}))throw h.error;return M.getDefaultOptions().queries?._experimental_afterQuery?.(T,h),T.experimental_prefetchInRender&&!ds&&oy(h,g)&&(l?K_(T,f,E):M.getQueryCache().get(T.queryHash)?.promise)?.catch(Ft).finally(()=>{f.updateResult()}),T.notifyOnChangeProps?h:f.trackResult(h)}function jl(s,n){return uy(s,Kg)}function aa(s,n){const _=vs(),[g]=X.useState(()=>new Xg(_,s));X.useEffect(()=>{g.setOptions(s)},[g,s]);const E=X.useSyncExternalStore(X.useCallback(T=>g.subscribe(Rt.batchCalls(T)),[g]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),M=X.useCallback((T,l)=>{g.mutate(T,l).catch(Ft)},[g]);if(E.error&&Dv(g.options.throwOnError,[E.error]))throw E.error;return{...E,mutate:M,mutateAsync:E.mutate}}var Hv=s=>{throw TypeError(s)},hy=(s,n,_)=>n.has(s)||Hv("Cannot "+_),tu=(s,n,_)=>(hy(s,n,"read from private field"),_?_.call(s):n.get(s)),fy=(s,n,_)=>n.has(s)?Hv("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(s):n.set(s,_),W_="popstate";function dy(s={}){function n(g,E){let{pathname:M,search:T,hash:l}=g.location;return ra("",{pathname:M,search:T,hash:l},E.state&&E.state.usr||null,E.state&&E.state.key||"default")}function _(g,E){return typeof E=="string"?E:Pi(E)}return vy(n,_,null,s)}function je(s,n){if(s===!1||s===null||typeof s>"u")throw new Error(n)}function Et(s,n){if(!s){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function _y(){return Math.random().toString(36).substring(2,10)}function G_(s,n){return{usr:s.state,key:s.key,idx:n}}function ra(s,n,_=null,g){return{pathname:typeof s=="string"?s:s.pathname,search:"",hash:"",...typeof n=="string"?Wr(n):n,state:_,key:n&&n.key||g||_y()}}function Pi({pathname:s="/",search:n="",hash:_=""}){return n&&n!=="?"&&(s+=n.charAt(0)==="?"?n:"?"+n),_&&_!=="#"&&(s+=_.charAt(0)==="#"?_:"#"+_),s}function Wr(s){let n={};if(s){let _=s.indexOf("#");_>=0&&(n.hash=s.substring(_),s=s.substring(0,_));let g=s.indexOf("?");g>=0&&(n.search=s.substring(g),s=s.substring(0,g)),s&&(n.pathname=s)}return n}function vy(s,n,_,g={}){let{window:E=document.defaultView,v5Compat:M=!1}=g,T=E.history,l="POP",f=null,h=p();h==null&&(h=0,T.replaceState({...T.state,idx:h},""));function p(){return(T.state||{idx:null}).idx}function m(){l="POP";let o=p(),u=o==null?null:o-h;h=o,f&&f({action:l,location:S.location,delta:u})}function y(o,u){l="PUSH";let d=ra(S.location,o,u);h=p()+1;let v=G_(d,h),x=S.createHref(d);try{T.pushState(v,"",x)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;E.location.assign(x)}M&&f&&f({action:l,location:S.location,delta:1})}function b(o,u){l="REPLACE";let d=ra(S.location,o,u);h=p();let v=G_(d,h),x=S.createHref(d);T.replaceState(v,"",x),M&&f&&f({action:l,location:S.location,delta:0})}function A(o){return Nv(o)}let S={get action(){return l},get location(){return s(E,T)},listen(o){if(f)throw new Error("A history only accepts one active listener");return E.addEventListener(W_,m),f=o,()=>{E.removeEventListener(W_,m),f=null}},createHref(o){return n(E,o)},createURL:A,encodeLocation(o){let u=A(o);return{pathname:u.pathname,search:u.search,hash:u.hash}},push:y,replace:b,go(o){return T.go(o)}};return S}function Nv(s,n=!1){let _="http://localhost";typeof window<"u"&&(_=window.location.origin!=="null"?window.location.origin:window.location.href),je(_,"No window.location.(origin|href) available to create URL");let g=typeof s=="string"?s:Pi(s);return g=g.replace(/ $/,"%20"),!n&&g.startsWith("//")&&(g=_+g),new URL(g,_)}var ta,Y_=class{constructor(s){if(fy(this,ta,new Map),s)for(let[n,_]of s)this.set(n,_)}get(s){if(tu(this,ta).has(s))return tu(this,ta).get(s);if(s.defaultValue!==void 0)return s.defaultValue;throw new Error("No value found for context")}set(s,n){tu(this,ta).set(s,n)}};ta=new WeakMap;var my=new Set(["lazy","caseSensitive","path","id","index","children"]);function py(s){return my.has(s)}var gy=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function yy(s){return gy.has(s)}function Sy(s){return s.index===!0}function sa(s,n,_=[],g={},E=!1){return s.map((M,T)=>{let l=[..._,String(T)],f=typeof M.id=="string"?M.id:l.join("-");if(je(M.index!==!0||!M.children,"Cannot specify children on an index route"),je(E||!g[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),Sy(M)){let h={...M,id:f};return g[f]=Q_(h,n(h)),h}else{let h={...M,id:f,children:void 0};return g[f]=Q_(h,n(h)),M.children&&(h.children=sa(M.children,n,l,g,E)),h}})}function Q_(s,n){return Object.assign(s,{...n,...typeof n.lazy=="object"&&n.lazy!=null?{lazy:{...s.lazy,...n.lazy}}:{}})}function Fr(s,n,_="/"){return Rl(s,n,_,!1)}function Rl(s,n,_,g){let E=typeof n=="string"?Wr(n):n,M=xi(E.pathname||"/",_);if(M==null)return null;let T=jv(s);Cy(T);let l=null;for(let f=0;l==null&&f<T.length;++f){let h=By(M);l=Ly(T[f],h,g)}return l}function by(s,n){let{route:_,pathname:g,params:E}=s;return{id:_.id,pathname:g,params:E,data:n[_.id],loaderData:n[_.id],handle:_.handle}}function jv(s,n=[],_=[],g="",E=!1){let M=(T,l,f=E,h)=>{let p={relativePath:h===void 0?T.path||"":h,caseSensitive:T.caseSensitive===!0,childrenIndex:l,route:T};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(g)&&f)return;je(p.relativePath.startsWith(g),`Absolute route path "${p.relativePath}" nested under path "${g}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(g.length)}let m=Ui([g,p.relativePath]),y=_.concat(p);T.children&&T.children.length>0&&(je(T.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),jv(T.children,n,y,m,f)),!(T.path==null&&!T.index)&&n.push({path:m,score:Ty(m,T.index),routesMeta:y})};return s.forEach((T,l)=>{if(T.path===""||!T.path?.includes("?"))M(T,l);else for(let f of zv(T.path))M(T,l,!0,f)}),n}function zv(s){let n=s.split("/");if(n.length===0)return[];let[_,...g]=n,E=_.endsWith("?"),M=_.replace(/\?$/,"");if(g.length===0)return E?[M,""]:[M];let T=zv(g.join("/")),l=[];return l.push(...T.map(f=>f===""?M:[M,f].join("/"))),E&&l.push(...T),l.map(f=>s.startsWith("/")&&f===""?"/":f)}function Cy(s){s.sort((n,_)=>n.score!==_.score?_.score-n.score:My(n.routesMeta.map(g=>g.childrenIndex),_.routesMeta.map(g=>g.childrenIndex)))}var Ey=/^:[\w-]+$/,wy=3,xy=2,Ry=1,Dy=10,Ay=-2,V_=s=>s==="*";function Ty(s,n){let _=s.split("/"),g=_.length;return _.some(V_)&&(g+=Ay),n&&(g+=xy),_.filter(E=>!V_(E)).reduce((E,M)=>E+(Ey.test(M)?wy:M===""?Ry:Dy),g)}function My(s,n){return s.length===n.length&&s.slice(0,-1).every((g,E)=>g===n[E])?s[s.length-1]-n[n.length-1]:0}function Ly(s,n,_=!1){let{routesMeta:g}=s,E={},M="/",T=[];for(let l=0;l<g.length;++l){let f=g[l],h=l===g.length-1,p=M==="/"?n:n.slice(M.length)||"/",m=Bl({path:f.relativePath,caseSensitive:f.caseSensitive,end:h},p),y=f.route;if(!m&&h&&_&&!g[g.length-1].route.index&&(m=Bl({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},p)),!m)return null;Object.assign(E,m.params),T.push({params:E,pathname:Ui([M,m.pathname]),pathnameBase:jy(Ui([M,m.pathnameBase])),route:y}),m.pathnameBase!=="/"&&(M=Ui([M,m.pathnameBase]))}return T}function Bl(s,n){typeof s=="string"&&(s={path:s,caseSensitive:!1,end:!0});let[_,g]=Oy(s.path,s.caseSensitive,s.end),E=n.match(_);if(!E)return null;let M=E[0],T=M.replace(/(.)\/+$/,"$1"),l=E.slice(1);return{params:g.reduce((h,{paramName:p,isOptional:m},y)=>{if(p==="*"){let A=l[y]||"";T=M.slice(0,M.length-A.length).replace(/(.)\/+$/,"$1")}const b=l[y];return m&&!b?h[p]=void 0:h[p]=(b||"").replace(/%2F/g,"/"),h},{}),pathname:M,pathnameBase:T,pattern:s}}function Oy(s,n=!1,_=!0){Et(s==="*"||!s.endsWith("*")||s.endsWith("/*"),`Route path "${s}" will be treated as if it were "${s.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${s.replace(/\*$/,"/*")}".`);let g=[],E="^"+s.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(T,l,f)=>(g.push({paramName:l,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return s.endsWith("*")?(g.push({paramName:"*"}),E+=s==="*"||s==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):_?E+="\\/*$":s!==""&&s!=="/"&&(E+="(?:(?=\\/|$))"),[new RegExp(E,n?void 0:"i"),g]}function By(s){try{return s.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Et(!1,`The URL path "${s}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),s}}function xi(s,n){if(n==="/")return s;if(!s.toLowerCase().startsWith(n.toLowerCase()))return null;let _=n.endsWith("/")?n.length-1:n.length,g=s.charAt(_);return g&&g!=="/"?null:s.slice(_)||"/"}function ky({basename:s,pathname:n}){return n==="/"?s:Ui([s,n])}function Hy(s,n="/"){let{pathname:_,search:g="",hash:E=""}=typeof s=="string"?Wr(s):s;return{pathname:_?_.startsWith("/")?_:Ny(_,n):n,search:zy(g),hash:Uy(E)}}function Ny(s,n){let _=n.replace(/\/+$/,"").split("/");return s.split("/").forEach(E=>{E===".."?_.length>1&&_.pop():E!=="."&&_.push(E)}),_.length>1?_.join("/"):"/"}function iu(s,n,_,g){return`Cannot include a '${s}' character in a manually specified \`to.${n}\` field [${JSON.stringify(g)}]. Please separate it out to the \`to.${_}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Uv(s){return s.filter((n,_)=>_===0||n.route.path&&n.route.path.length>0)}function wu(s){let n=Uv(s);return n.map((_,g)=>g===n.length-1?_.pathname:_.pathnameBase)}function xu(s,n,_,g=!1){let E;typeof s=="string"?E=Wr(s):(E={...s},je(!E.pathname||!E.pathname.includes("?"),iu("?","pathname","search",E)),je(!E.pathname||!E.pathname.includes("#"),iu("#","pathname","hash",E)),je(!E.search||!E.search.includes("#"),iu("#","search","hash",E)));let M=s===""||E.pathname==="",T=M?"/":E.pathname,l;if(T==null)l=_;else{let m=n.length-1;if(!g&&T.startsWith("..")){let y=T.split("/");for(;y[0]==="..";)y.shift(),m-=1;E.pathname=y.join("/")}l=m>=0?n[m]:"/"}let f=Hy(E,l),h=T&&T!=="/"&&T.endsWith("/"),p=(M||T===".")&&_.endsWith("/");return!f.pathname.endsWith("/")&&(h||p)&&(f.pathname+="/"),f}var Ui=s=>s.join("/").replace(/\/\/+/g,"/"),jy=s=>s.replace(/\/+$/,"").replace(/^\/*/,"/"),zy=s=>!s||s==="?"?"":s.startsWith("?")?s:"?"+s,Uy=s=>!s||s==="#"?"":s.startsWith("#")?s:"#"+s,kl=class{constructor(s,n,_,g=!1){this.status=s,this.statusText=n||"",this.internal=g,_ instanceof Error?(this.data=_.toString(),this.error=_):this.data=_}};function na(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.internal=="boolean"&&"data"in s}function Ru(s){return s.filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var qr=Symbol("Uninstrumented");function Py(s,n){let _={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};s.forEach(E=>E({id:n.id,index:n.index,path:n.path,instrument(M){let T=Object.keys(_);for(let l of T)M[l]&&_[l].push(M[l])}}));let g={};if(typeof n.lazy=="function"&&_.lazy.length>0){let E=sn(_.lazy,n.lazy,()=>{});E&&(g.lazy=E)}if(typeof n.lazy=="object"){let E=n.lazy;["middleware","loader","action"].forEach(M=>{let T=E[M],l=_[`lazy.${M}`];if(typeof T=="function"&&l.length>0){let f=sn(l,T,()=>{});f&&(g.lazy=Object.assign(g.lazy||{},{[M]:f}))}})}return["loader","action"].forEach(E=>{let M=n[E];if(typeof M=="function"&&_[E].length>0){let T=M[qr]??M,l=sn(_[E],T,(...f)=>X_(f[0]));l&&(l[qr]=T,g[E]=l)}}),n.middleware&&n.middleware.length>0&&_.middleware.length>0&&(g.middleware=n.middleware.map(E=>{let M=E[qr]??E,T=sn(_.middleware,M,(...l)=>X_(l[0]));return T?(T[qr]=M,T):E})),g}function Fy(s,n){let _={navigate:[],fetch:[]};if(n.forEach(g=>g({instrument(E){let M=Object.keys(E);for(let T of M)E[T]&&_[T].push(E[T])}})),_.navigate.length>0){let g=s.navigate[qr]??s.navigate,E=sn(_.navigate,g,(...M)=>{let[T,l]=M;return{to:typeof T=="number"||typeof T=="string"?T:T?Pi(T):".",...$_(s,l??{})}});E&&(E[qr]=g,s.navigate=E)}if(_.fetch.length>0){let g=s.fetch[qr]??s.fetch,E=sn(_.fetch,g,(...M)=>{let[T,,l,f]=M;return{href:l??".",fetcherKey:T,...$_(s,f??{})}});E&&(E[qr]=g,s.fetch=E)}return s}function sn(s,n,_){return s.length===0?null:async(...g)=>{let E=await Pv(s,_(...g),()=>n(...g),s.length-1);if(E.type==="error")throw E.value;return E.value}}async function Pv(s,n,_,g){let E=s[g],M;if(E){let T,l=async()=>(T?console.error("You cannot call instrumented handlers more than once"):T=Pv(s,n,_,g-1),M=await T,je(M,"Expected a result"),M.type==="error"&&M.value instanceof Error?{status:"error",error:M.value}:{status:"success",error:void 0});try{await E(l,n)}catch(f){console.error("An instrumentation function threw an error:",f)}T||await l(),await T}else try{M={type:"success",value:await _()}}catch(T){M={type:"error",value:T}}return M||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function X_(s){let{request:n,context:_,params:g,unstable_pattern:E}=s;return{request:Iy(n),params:{...g},unstable_pattern:E,context:qy(_)}}function $_(s,n){return{currentUrl:Pi(s.state.location),..."formMethod"in n?{formMethod:n.formMethod}:{},..."formEncType"in n?{formEncType:n.formEncType}:{},..."formData"in n?{formData:n.formData}:{},..."body"in n?{body:n.body}:{}}}function Iy(s){return{method:s.method,url:s.url,headers:{get:(...n)=>s.headers.get(...n)}}}function qy(s){if(Wy(s)){let n={...s};return Object.freeze(n),n}else return{get:n=>s.get(n)}}var Ky=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Wy(s){if(s===null||typeof s!="object")return!1;const n=Object.getPrototypeOf(s);return n===Object.prototype||n===null||Object.getOwnPropertyNames(n).sort().join("\0")===Ky}var Fv=["POST","PUT","PATCH","DELETE"],Gy=new Set(Fv),Yy=["GET",...Fv],Qy=new Set(Yy),Vy=new Set([301,302,303,307,308]),Xy=new Set([307,308]),ru={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},$y={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},$n={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Zy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Du=s=>Zy.test(s),Jy=s=>({hasErrorBoundary:!!s.hasErrorBoundary}),Iv="remix-router-transitions",qv=Symbol("ResetLoaderData");function e0(s){const n=s.window?s.window:typeof window<"u"?window:void 0,_=typeof n<"u"&&typeof n.document<"u"&&typeof n.document.createElement<"u";je(s.routes.length>0,"You must provide a non-empty routes array to createRouter");let g=s.hydrationRouteProperties||[],E=s.mapRouteProperties||Jy,M=E;if(s.unstable_instrumentations){let W=s.unstable_instrumentations;M=J=>({...E(J),...Py(W.map(le=>le.route).filter(Boolean),J)})}let T={},l=sa(s.routes,M,void 0,T),f,h=s.basename||"/";h.startsWith("/")||(h=`/${h}`);let p=s.dataStrategy||n0,m={...s.future},y=null,b=new Set,A=null,S=null,o=null,u=s.hydrationData!=null,d=Fr(l,s.history.location,h),v=!1,x=null,R;if(d==null&&!s.patchRoutesOnNavigation){let W=Si(404,{pathname:s.history.location.pathname}),{matches:J,route:le}=Cl(l);R=!0,d=J,x={[le.id]:W}}else if(d&&!s.hydrationData&&bs(d,l,s.history.location.pathname).active&&(d=null),d)if(d.some(W=>W.route.lazy))R=!1;else if(!d.some(W=>Au(W.route)))R=!0;else{let W=s.hydrationData?s.hydrationData.loaderData:null,J=s.hydrationData?s.hydrationData.errors:null;if(J){let le=d.findIndex(pe=>J[pe.route.id]!==void 0);R=d.slice(0,le+1).every(pe=>!mu(pe.route,W,J))}else R=d.every(le=>!mu(le.route,W,J))}else{R=!1,d=[];let W=bs(null,l,s.history.location.pathname);W.active&&W.matches&&(v=!0,d=W.matches)}let O,w={historyAction:s.history.action,location:s.history.location,matches:d,initialized:R,navigation:ru,restoreScrollPosition:s.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:s.hydrationData&&s.hydrationData.loaderData||{},actionData:s.hydrationData&&s.hydrationData.actionData||null,errors:s.hydrationData&&s.hydrationData.errors||x,fetchers:new Map,blockers:new Map},C="POP",B=!1,P,I=!1,F=new Map,G=null,te=!1,ue=!1,q=new Set,$=new Map,oe=0,k=-1,U=new Map,L=new Set,j=new Map,V=new Map,ee=new Set,de=new Map,Y,re=null;function z(){if(y=s.history.listen(({action:W,location:J,delta:le})=>{if(Y){Y(),Y=void 0;return}Et(de.size===0||le!=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 pe=Gr({currentLocation:w.location,nextLocation:J,historyAction:W});if(pe&&le!=null){let ge=new Promise(De=>{Y=De});s.history.go(le*-1),gs(pe,{state:"blocked",location:J,proceed(){gs(pe,{state:"proceeding",proceed:void 0,reset:void 0,location:J}),ge.then(()=>s.history.go(le))},reset(){let De=new Map(w.blockers);De.set(pe,$n),ae({blockers:De})}});return}return Ne(W,J)}),_){S0(n,F);let W=()=>b0(n,F);n.addEventListener("pagehide",W),G=()=>n.removeEventListener("pagehide",W)}return w.initialized||Ne("POP",w.location,{initialHydration:!0}),O}function ve(){y&&y(),G&&G(),b.clear(),P&&P.abort(),w.fetchers.forEach((W,J)=>Di(J)),w.blockers.forEach((W,J)=>ua(J))}function ye(W){return b.add(W),()=>b.delete(W)}function ae(W,J={}){W.matches&&(W.matches=W.matches.map(ge=>{let De=T[ge.route.id],Ae=ge.route;return Ae.element!==De.element||Ae.errorElement!==De.errorElement||Ae.hydrateFallbackElement!==De.hydrateFallbackElement?{...ge,route:De}:ge})),w={...w,...W};let le=[],pe=[];w.fetchers.forEach((ge,De)=>{ge.state==="idle"&&(ee.has(De)?le.push(De):pe.push(De))}),ee.forEach(ge=>{!w.fetchers.has(ge)&&!$.has(ge)&&le.push(ge)}),[...b].forEach(ge=>ge(w,{deletedFetchers:le,viewTransitionOpts:J.viewTransitionOpts,flushSync:J.flushSync===!0})),le.forEach(ge=>Di(ge)),pe.forEach(ge=>w.fetchers.delete(ge))}function ze(W,J,{flushSync:le}={}){let pe=w.actionData!=null&&w.navigation.formMethod!=null&&It(w.navigation.formMethod)&&w.navigation.state==="loading"&&W.state?._isRedirect!==!0,ge;J.actionData?Object.keys(J.actionData).length>0?ge=J.actionData:ge=null:pe?ge=w.actionData:ge=null;let De=J.loaderData?lv(w.loaderData,J.loaderData,J.matches||[],J.errors):w.loaderData,Ae=w.blockers;Ae.size>0&&(Ae=new Map(Ae),Ae.forEach((Se,we)=>Ae.set(we,$n)));let xe=te?!1:mr(W,J.matches||w.matches),Ee=B===!0||w.navigation.formMethod!=null&&It(w.navigation.formMethod)&&W.state?._isRedirect!==!0;f&&(l=f,f=void 0),te||C==="POP"||(C==="PUSH"?s.history.push(W,W.state):C==="REPLACE"&&s.history.replace(W,W.state));let be;if(C==="POP"){let Se=F.get(w.location.pathname);Se&&Se.has(W.pathname)?be={currentLocation:w.location,nextLocation:W}:F.has(W.pathname)&&(be={currentLocation:W,nextLocation:w.location})}else if(I){let Se=F.get(w.location.pathname);Se?Se.add(W.pathname):(Se=new Set([W.pathname]),F.set(w.location.pathname,Se)),be={currentLocation:w.location,nextLocation:W}}ae({...J,actionData:ge,loaderData:De,historyAction:C,location:W,initialized:!0,navigation:ru,revalidation:"idle",restoreScrollPosition:xe,preventScrollReset:Ee,blockers:Ae},{viewTransitionOpts:be,flushSync:le===!0}),C="POP",B=!1,I=!1,te=!1,ue=!1,re?.resolve(),re=null}async function Be(W,J){if(typeof W=="number"){s.history.go(W);return}let le=vu(w.location,w.matches,h,W,J?.fromRouteId,J?.relative),{path:pe,submission:ge,error:De}=Z_(!1,le,J),Ae=w.location,xe=ra(w.location,pe,J&&J.state);xe={...xe,...s.history.encodeLocation(xe)};let Ee=J&&J.replace!=null?J.replace:void 0,be="PUSH";Ee===!0?be="REPLACE":Ee===!1||ge!=null&&It(ge.formMethod)&&ge.formAction===w.location.pathname+w.location.search&&(be="REPLACE");let Se=J&&"preventScrollReset"in J?J.preventScrollReset===!0:void 0,we=(J&&J.flushSync)===!0,Ue=Gr({currentLocation:Ae,nextLocation:xe,historyAction:be});if(Ue){gs(Ue,{state:"blocked",location:xe,proceed(){gs(Ue,{state:"proceeding",proceed:void 0,reset:void 0,location:xe}),Be(W,J)},reset(){let st=new Map(w.blockers);st.set(Ue,$n),ae({blockers:st})}});return}await Ne(be,xe,{submission:ge,pendingError:De,preventScrollReset:Se,replace:J&&J.replace,enableViewTransition:J&&J.viewTransition,flushSync:we})}function me(){re||(re=C0()),li(),ae({revalidation:"loading"});let W=re.promise;return w.navigation.state==="submitting"?W:w.navigation.state==="idle"?(Ne(w.historyAction,w.location,{startUninterruptedRevalidation:!0}),W):(Ne(C||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:I===!0}),W)}async function Ne(W,J,le){P&&P.abort(),P=null,C=W,te=(le&&le.startUninterruptedRevalidation)===!0,Ss(w.location,w.matches),B=(le&&le.preventScrollReset)===!0,I=(le&&le.enableViewTransition)===!0;let pe=f||l,ge=le&&le.overrideNavigation,De=le?.initialHydration&&w.matches&&w.matches.length>0&&!v?w.matches:Fr(pe,J,h),Ae=(le&&le.flushSync)===!0;if(De&&w.initialized&&!ue&&d0(w.location,J)&&!(le&&le.submission&&It(le.submission.formMethod))){ze(J,{matches:De},{flushSync:Ae});return}let xe=bs(De,pe,J.pathname);if(xe.active&&xe.matches&&(De=xe.matches),!De){let{error:Dt,notFoundMatches:Ve,route:Xe}=vr(J.pathname);ze(J,{matches:Ve,loaderData:{},errors:{[Xe.id]:Dt}},{flushSync:Ae});return}P=new AbortController;let Ee=rn(s.history,J,P.signal,le&&le.submission),be=s.getContext?await s.getContext():new Y_,Se;if(le&&le.pendingError)Se=[Ir(De).route.id,{type:"error",error:le.pendingError}];else if(le&&le.submission&&It(le.submission.formMethod)){let Dt=await ht(Ee,J,le.submission,De,be,xe.active,le&&le.initialHydration===!0,{replace:le.replace,flushSync:Ae});if(Dt.shortCircuited)return;if(Dt.pendingActionResult){let[Ve,Xe]=Dt.pendingActionResult;if(ai(Xe)&&na(Xe.error)&&Xe.error.status===404){P=null,ze(J,{matches:Dt.matches,loaderData:{},errors:{[Ve]:Xe.error}});return}}De=Dt.matches||De,Se=Dt.pendingActionResult,ge=su(J,le.submission),Ae=!1,xe.active=!1,Ee=rn(s.history,Ee.url,Ee.signal)}let{shortCircuited:we,matches:Ue,loaderData:st,errors:gt}=await Le(Ee,J,De,be,xe.active,ge,le&&le.submission,le&&le.fetcherSubmission,le&&le.replace,le&&le.initialHydration===!0,Ae,Se);we||(P=null,ze(J,{matches:Ue||De,...ov(Se),loaderData:st,errors:gt}))}async function ht(W,J,le,pe,ge,De,Ae,xe={}){li();let Ee=g0(J,le);if(ae({navigation:Ee},{flushSync:xe.flushSync===!0}),De){let we=await Yr(pe,J.pathname,W.signal);if(we.type==="aborted")return{shortCircuited:!0};if(we.type==="error"){if(we.partialMatches.length===0){let{matches:st,route:gt}=Cl(l);return{matches:st,pendingActionResult:[gt.id,{type:"error",error:we.error}]}}let Ue=Ir(we.partialMatches).route.id;return{matches:we.partialMatches,pendingActionResult:[Ue,{type:"error",error:we.error}]}}else if(we.matches)pe=we.matches;else{let{notFoundMatches:Ue,error:st,route:gt}=vr(J.pathname);return{matches:Ue,pendingActionResult:[gt.id,{type:"error",error:st}]}}}let be,Se=Dl(pe,J);if(!Se.route.action&&!Se.route.lazy)be={type:"error",error:Si(405,{method:W.method,pathname:J.pathname,routeId:Se.route.id})};else{let we=nn(M,T,W,pe,Se,Ae?[]:g,ge),Ue=await nt(W,we,ge,null);if(be=Ue[Se.route.id],!be){for(let st of pe)if(Ue[st.route.id]){be=Ue[st.route.id];break}}if(W.signal.aborted)return{shortCircuited:!0}}if(fs(be)){let we;return xe&&xe.replace!=null?we=xe.replace:we=sv(be.response.headers.get("Location"),new URL(W.url),h)===w.location.pathname+w.location.search,await ft(W,be,!0,{submission:le,replace:we}),{shortCircuited:!0}}if(ai(be)){let we=Ir(pe,Se.route.id);return(xe&&xe.replace)!==!0&&(C="PUSH"),{matches:pe,pendingActionResult:[we.route.id,be,Se.route.id]}}return{matches:pe,pendingActionResult:[Se.route.id,be]}}async function Le(W,J,le,pe,ge,De,Ae,xe,Ee,be,Se,we){let Ue=De||su(J,Ae),st=Ae||xe||uv(Ue),gt=!te&&!be;if(ge){if(gt){let wt=Ri(we);ae({navigation:Ue,...wt!==void 0?{actionData:wt}:{}},{flushSync:Se})}let Ke=await Yr(le,J.pathname,W.signal);if(Ke.type==="aborted")return{shortCircuited:!0};if(Ke.type==="error"){if(Ke.partialMatches.length===0){let{matches:Yi,route:Qi}=Cl(l);return{matches:Yi,loaderData:{},errors:{[Qi.id]:Ke.error}}}let wt=Ir(Ke.partialMatches).route.id;return{matches:Ke.partialMatches,loaderData:{},errors:{[wt]:Ke.error}}}else if(Ke.matches)le=Ke.matches;else{let{error:wt,notFoundMatches:Yi,route:Qi}=vr(J.pathname);return{matches:Yi,loaderData:{},errors:{[Qi.id]:wt}}}}let Dt=f||l,{dsMatches:Ve,revalidatingFetchers:Xe}=J_(W,pe,M,T,s.history,w,le,st,J,be?[]:g,be===!0,ue,q,ee,j,L,Dt,h,s.patchRoutesOnNavigation!=null,we);if(k=++oe,!s.dataStrategy&&!Ve.some(Ke=>Ke.shouldLoad)&&!Ve.some(Ke=>Ke.route.middleware&&Ke.route.middleware.length>0)&&Xe.length===0){let Ke=Ai();return ze(J,{matches:le,loaderData:{},errors:we&&ai(we[1])?{[we[0]]:we[1].error}:null,...ov(we),...Ke?{fetchers:new Map(w.fetchers)}:{}},{flushSync:Se}),{shortCircuited:!0}}if(gt){let Ke={};if(!ge){Ke.navigation=Ue;let wt=Ri(we);wt!==void 0&&(Ke.actionData=wt)}Xe.length>0&&(Ke.fetchers=qi(Xe)),ae(Ke,{flushSync:Se})}Xe.forEach(Ke=>{Tt(Ke.key),Ke.controller&&$.set(Ke.key,Ke.controller)});let qt=()=>Xe.forEach(Ke=>Tt(Ke.key));P&&P.signal.addEventListener("abort",qt);let{loaderResults:oi,fetcherResults:Kt}=await Ut(Ve,Xe,W,pe);if(W.signal.aborted)return{shortCircuited:!0};P&&P.signal.removeEventListener("abort",qt),Xe.forEach(Ke=>$.delete(Ke.key));let Mt=El(oi);if(Mt)return await ft(W,Mt.result,!0,{replace:Ee}),{shortCircuited:!0};if(Mt=El(Kt),Mt)return L.add(Mt.key),await ft(W,Mt.result,!0,{replace:Ee}),{shortCircuited:!0};let{loaderData:dt,errors:pr}=av(w,le,oi,we,Xe,Kt);be&&w.errors&&(pr={...w.errors,...pr});let ki=Ai(),ci=jt(k),Ti=ki||ci||Xe.length>0;return{matches:le,loaderData:dt,errors:pr,...Ti?{fetchers:new Map(w.fetchers)}:{}}}function Ri(W){if(W&&!ai(W[1]))return{[W[0]]:W[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function qi(W){return W.forEach(J=>{let le=w.fetchers.get(J.key),pe=Zn(void 0,le?le.data:void 0);w.fetchers.set(J.key,pe)}),new Map(w.fetchers)}async function Ki(W,J,le,pe){Tt(W);let ge=(pe&&pe.flushSync)===!0,De=f||l,Ae=vu(w.location,w.matches,h,le,J,pe?.relative),xe=Fr(De,Ae,h),Ee=bs(xe,De,Ae);if(Ee.active&&Ee.matches&&(xe=Ee.matches),!xe){ut(W,J,Si(404,{pathname:Ae}),{flushSync:ge});return}let{path:be,submission:Se,error:we}=Z_(!0,Ae,pe);if(we){ut(W,J,we,{flushSync:ge});return}let Ue=s.getContext?await s.getContext():new Y_,st=(pe&&pe.preventScrollReset)===!0;if(Se&&It(Se.formMethod)){await Wi(W,J,be,xe,Ue,Ee.active,ge,st,Se);return}j.set(W,{routeId:J,path:be}),await _r(W,J,be,xe,Ue,Ee.active,ge,st,Se)}async function Wi(W,J,le,pe,ge,De,Ae,xe,Ee){li(),j.delete(W);let be=w.fetchers.get(W);Ht(W,y0(Ee,be),{flushSync:Ae});let Se=new AbortController,we=rn(s.history,le,Se.signal,Ee);if(De){let ot=await Yr(pe,new URL(we.url).pathname,we.signal,W);if(ot.type==="aborted")return;if(ot.type==="error"){ut(W,J,ot.error,{flushSync:Ae});return}else if(ot.matches)pe=ot.matches;else{ut(W,J,Si(404,{pathname:le}),{flushSync:Ae});return}}let Ue=Dl(pe,le);if(!Ue.route.action&&!Ue.route.lazy){let ot=Si(405,{method:Ee.formMethod,pathname:le,routeId:J});ut(W,J,ot,{flushSync:Ae});return}$.set(W,Se);let st=oe,gt=nn(M,T,we,pe,Ue,g,ge),Ve=(await nt(we,gt,ge,W))[Ue.route.id];if(we.signal.aborted){$.get(W)===Se&&$.delete(W);return}if(ee.has(W)){if(fs(Ve)||ai(Ve)){Ht(W,dr(void 0));return}}else{if(fs(Ve))if($.delete(W),k>st){Ht(W,dr(void 0));return}else return L.add(W),Ht(W,Zn(Ee)),ft(we,Ve,!1,{fetcherSubmission:Ee,preventScrollReset:xe});if(ai(Ve)){ut(W,J,Ve.error);return}}let Xe=w.navigation.location||w.location,qt=rn(s.history,Xe,Se.signal),oi=f||l,Kt=w.navigation.state!=="idle"?Fr(oi,w.navigation.location,h):w.matches;je(Kt,"Didn't find any matches after fetcher action");let Mt=++oe;U.set(W,Mt);let dt=Zn(Ee,Ve.data);w.fetchers.set(W,dt);let{dsMatches:pr,revalidatingFetchers:ki}=J_(qt,ge,M,T,s.history,w,Kt,Ee,Xe,g,!1,ue,q,ee,j,L,oi,h,s.patchRoutesOnNavigation!=null,[Ue.route.id,Ve]);ki.filter(ot=>ot.key!==W).forEach(ot=>{let Vi=ot.key,ui=w.fetchers.get(Vi),Wt=Zn(void 0,ui?ui.data:void 0);w.fetchers.set(Vi,Wt),Tt(Vi),ot.controller&&$.set(Vi,ot.controller)}),ae({fetchers:new Map(w.fetchers)});let ci=()=>ki.forEach(ot=>Tt(ot.key));Se.signal.addEventListener("abort",ci);let{loaderResults:Ti,fetcherResults:Ke}=await Ut(pr,ki,qt,ge);if(Se.signal.aborted)return;if(Se.signal.removeEventListener("abort",ci),U.delete(W),$.delete(W),ki.forEach(ot=>$.delete(ot.key)),w.fetchers.has(W)){let ot=dr(Ve.data);w.fetchers.set(W,ot)}let wt=El(Ti);if(wt)return ft(qt,wt.result,!1,{preventScrollReset:xe});if(wt=El(Ke),wt)return L.add(wt.key),ft(qt,wt.result,!1,{preventScrollReset:xe});let{loaderData:Yi,errors:Qi}=av(w,Kt,Ti,void 0,ki,Ke);jt(Mt),w.navigation.state==="loading"&&Mt>k?(je(C,"Expected pending action"),P&&P.abort(),ze(w.navigation.location,{matches:Kt,loaderData:Yi,errors:Qi,fetchers:new Map(w.fetchers)})):(ae({errors:Qi,loaderData:lv(w.loaderData,Yi,Kt,Qi),fetchers:new Map(w.fetchers)}),ue=!1)}async function _r(W,J,le,pe,ge,De,Ae,xe,Ee){let be=w.fetchers.get(W);Ht(W,Zn(Ee,be?be.data:void 0),{flushSync:Ae});let Se=new AbortController,we=rn(s.history,le,Se.signal);if(De){let Xe=await Yr(pe,new URL(we.url).pathname,we.signal,W);if(Xe.type==="aborted")return;if(Xe.type==="error"){ut(W,J,Xe.error,{flushSync:Ae});return}else if(Xe.matches)pe=Xe.matches;else{ut(W,J,Si(404,{pathname:le}),{flushSync:Ae});return}}let Ue=Dl(pe,le);$.set(W,Se);let st=oe,gt=nn(M,T,we,pe,Ue,g,ge),Ve=(await nt(we,gt,ge,W))[Ue.route.id];if($.get(W)===Se&&$.delete(W),!we.signal.aborted){if(ee.has(W)){Ht(W,dr(void 0));return}if(fs(Ve))if(k>st){Ht(W,dr(void 0));return}else{L.add(W),await ft(we,Ve,!1,{preventScrollReset:xe});return}if(ai(Ve)){ut(W,J,Ve.error);return}Ht(W,dr(Ve.data))}}async function ft(W,J,le,{submission:pe,fetcherSubmission:ge,preventScrollReset:De,replace:Ae}={}){J.response.headers.has("X-Remix-Revalidate")&&(ue=!0);let xe=J.response.headers.get("Location");je(xe,"Expected a Location header on the redirect Response"),xe=sv(xe,new URL(W.url),h);let Ee=ra(w.location,xe,{_isRedirect:!0});if(_){let gt=!1;if(J.response.headers.has("X-Remix-Reload-Document"))gt=!0;else if(Du(xe)){const Dt=Nv(xe,!0);gt=Dt.origin!==n.location.origin||xi(Dt.pathname,h)==null}if(gt){Ae?n.location.replace(xe):n.location.assign(xe);return}}P=null;let be=Ae===!0||J.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Se,formAction:we,formEncType:Ue}=w.navigation;!pe&&!ge&&Se&&we&&Ue&&(pe=uv(w.navigation));let st=pe||ge;if(Xy.has(J.response.status)&&st&&It(st.formMethod))await Ne(be,Ee,{submission:{...st,formAction:xe},preventScrollReset:De||B,enableViewTransition:le?I:void 0});else{let gt=su(Ee,pe);await Ne(be,Ee,{overrideNavigation:gt,fetcherSubmission:ge,preventScrollReset:De||B,enableViewTransition:le?I:void 0})}}async function nt(W,J,le,pe){let ge,De={};try{ge=await l0(p,W,J,pe,le,!1)}catch(Ae){return J.filter(xe=>xe.shouldLoad).forEach(xe=>{De[xe.route.id]={type:"error",error:Ae}}),De}if(W.signal.aborted)return De;for(let[Ae,xe]of Object.entries(ge))if(m0(xe)){let Ee=xe.result;De[Ae]={type:"redirect",response:h0(Ee,W,Ae,J,h)}}else De[Ae]=await u0(xe);return De}async function Ut(W,J,le,pe){let ge=nt(le,W,pe,null),De=Promise.all(J.map(async Ee=>{if(Ee.matches&&Ee.match&&Ee.request&&Ee.controller){let Se=(await nt(Ee.request,Ee.matches,pe,Ee.key))[Ee.match.route.id];return{[Ee.key]:Se}}else return Promise.resolve({[Ee.key]:{type:"error",error:Si(404,{pathname:Ee.path})}})})),Ae=await ge,xe=(await De).reduce((Ee,be)=>Object.assign(Ee,be),{});return{loaderResults:Ae,fetcherResults:xe}}function li(){ue=!0,j.forEach((W,J)=>{$.has(J)&&q.add(J),Tt(J)})}function Ht(W,J,le={}){w.fetchers.set(W,J),ae({fetchers:new Map(w.fetchers)},{flushSync:(le&&le.flushSync)===!0})}function ut(W,J,le,pe={}){let ge=Ir(w.matches,J);Di(W),ae({errors:{[ge.route.id]:le},fetchers:new Map(w.fetchers)},{flushSync:(pe&&pe.flushSync)===!0})}function Gi(W){return V.set(W,(V.get(W)||0)+1),ee.has(W)&&ee.delete(W),w.fetchers.get(W)||$y}function Zt(W,J){Tt(W,J?.reason),Ht(W,dr(null))}function Di(W){let J=w.fetchers.get(W);$.has(W)&&!(J&&J.state==="loading"&&U.has(W))&&Tt(W),j.delete(W),U.delete(W),L.delete(W),ee.delete(W),q.delete(W),w.fetchers.delete(W)}function it(W){let J=(V.get(W)||0)-1;J<=0?(V.delete(W),ee.add(W)):V.set(W,J),ae({fetchers:new Map(w.fetchers)})}function Tt(W,J){let le=$.get(W);le&&(le.abort(J),$.delete(W))}function Nt(W){for(let J of W){let le=Gi(J),pe=dr(le.data);w.fetchers.set(J,pe)}}function Ai(){let W=[],J=!1;for(let le of L){let pe=w.fetchers.get(le);je(pe,`Expected fetcher: ${le}`),pe.state==="loading"&&(L.delete(le),W.push(le),J=!0)}return Nt(W),J}function jt(W){let J=[];for(let[le,pe]of U)if(pe<W){let ge=w.fetchers.get(le);je(ge,`Expected fetcher: ${le}`),ge.state==="loading"&&(Tt(le),U.delete(le),J.push(le))}return Nt(J),J.length>0}function Pl(W,J){let le=w.blockers.get(W)||$n;return de.get(W)!==J&&de.set(W,J),le}function ua(W){w.blockers.delete(W),de.delete(W)}function gs(W,J){let le=w.blockers.get(W)||$n;je(le.state==="unblocked"&&J.state==="blocked"||le.state==="blocked"&&J.state==="blocked"||le.state==="blocked"&&J.state==="proceeding"||le.state==="blocked"&&J.state==="unblocked"||le.state==="proceeding"&&J.state==="unblocked",`Invalid blocker state transition: ${le.state} -> ${J.state}`);let pe=new Map(w.blockers);pe.set(W,J),ae({blockers:pe})}function Gr({currentLocation:W,nextLocation:J,historyAction:le}){if(de.size===0)return;de.size>1&&Et(!1,"A router only supports one blocker at a time");let pe=Array.from(de.entries()),[ge,De]=pe[pe.length-1],Ae=w.blockers.get(ge);if(!(Ae&&Ae.state==="proceeding")&&De({currentLocation:W,nextLocation:J,historyAction:le}))return ge}function vr(W){let J=Si(404,{pathname:W}),le=f||l,{matches:pe,route:ge}=Cl(le);return{notFoundMatches:pe,route:ge,error:J}}function ys(W,J,le){if(A=W,o=J,S=le||null,!u&&w.navigation===ru){u=!0;let pe=mr(w.location,w.matches);pe!=null&&ae({restoreScrollPosition:pe})}return()=>{A=null,o=null,S=null}}function Bi(W,J){return S&&S(W,J.map(pe=>by(pe,w.loaderData)))||W.key}function Ss(W,J){if(A&&o){let le=Bi(W,J);A[le]=o()}}function mr(W,J){if(A){let le=Bi(W,J),pe=A[le];if(typeof pe=="number")return pe}return null}function bs(W,J,le){if(s.patchRoutesOnNavigation)if(W){if(Object.keys(W[0].params).length>0)return{active:!0,matches:Rl(J,le,h,!0)}}else return{active:!0,matches:Rl(J,le,h,!0)||[]};return{active:!1,matches:null}}async function Yr(W,J,le,pe){if(!s.patchRoutesOnNavigation)return{type:"success",matches:W};let ge=W;for(;;){let De=f==null,Ae=f||l,xe=T;try{await s.patchRoutesOnNavigation({signal:le,path:J,matches:ge,fetcherKey:pe,patch:(Se,we)=>{le.aborted||ev(Se,we,Ae,xe,M,!1)}})}catch(Se){return{type:"error",error:Se,partialMatches:ge}}finally{De&&!le.aborted&&(l=[...l])}if(le.aborted)return{type:"aborted"};let Ee=Fr(Ae,J,h);if(Ee)return{type:"success",matches:Ee};let be=Rl(Ae,J,h,!0);if(!be||ge.length===be.length&&ge.every((Se,we)=>Se.route.id===be[we].route.id))return{type:"success",matches:null};ge=be}}function ln(W){T={},f=sa(W,M,void 0,T)}function Qr(W,J,le=!1){let pe=f==null;ev(W,J,f||l,T,M,le),pe&&(l=[...l],ae({}))}return O={get basename(){return h},get future(){return m},get state(){return w},get routes(){return l},get window(){return n},initialize:z,subscribe:ye,enableScrollRestoration:ys,navigate:Be,fetch:Ki,revalidate:me,createHref:W=>s.history.createHref(W),encodeLocation:W=>s.history.encodeLocation(W),getFetcher:Gi,resetFetcher:Zt,deleteFetcher:it,dispose:ve,getBlocker:Pl,deleteBlocker:ua,patchRoutes:Qr,_internalFetchControllers:$,_internalSetRoutes:ln,_internalSetStateDoNotUseOrYouWillBreakYourApp(W){ae(W)}},s.unstable_instrumentations&&(O=Fy(O,s.unstable_instrumentations.map(W=>W.router).filter(Boolean))),O}function t0(s){return s!=null&&("formData"in s&&s.formData!=null||"body"in s&&s.body!==void 0)}function vu(s,n,_,g,E,M){let T,l;if(E){T=[];for(let h of n)if(T.push(h),h.route.id===E){l=h;break}}else T=n,l=n[n.length-1];let f=xu(g||".",wu(T),xi(s.pathname,_)||s.pathname,M==="path");if(g==null&&(f.search=s.search,f.hash=s.hash),(g==null||g===""||g===".")&&l){let h=Tu(f.search);if(l.route.index&&!h)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&h){let p=new URLSearchParams(f.search),m=p.getAll("index");p.delete("index"),m.filter(b=>b).forEach(b=>p.append("index",b));let y=p.toString();f.search=y?`?${y}`:""}}return _!=="/"&&(f.pathname=ky({basename:_,pathname:f.pathname})),Pi(f)}function Z_(s,n,_){if(!_||!t0(_))return{path:n};if(_.formMethod&&!p0(_.formMethod))return{path:n,error:Si(405,{method:_.formMethod})};let g=()=>({path:n,error:Si(400,{type:"invalid-body"})}),M=(_.formMethod||"get").toUpperCase(),T=Vv(n);if(_.body!==void 0){if(_.formEncType==="text/plain"){if(!It(M))return g();let m=typeof _.body=="string"?_.body:_.body instanceof FormData||_.body instanceof URLSearchParams?Array.from(_.body.entries()).reduce((y,[b,A])=>`${y}${b}=${A}
10
10
  `,""):String(_.body);return{path:n,submission:{formMethod:M,formAction:T,formEncType:_.formEncType,formData:void 0,json:void 0,text:m}}}else if(_.formEncType==="application/json"){if(!It(M))return g();try{let m=typeof _.body=="string"?JSON.parse(_.body):_.body;return{path:n,submission:{formMethod:M,formAction:T,formEncType:_.formEncType,formData:void 0,json:m,text:void 0}}}catch{return g()}}}je(typeof FormData=="function","FormData is not available in this environment");let l,f;if(_.formData)l=gu(_.formData),f=_.formData;else if(_.body instanceof FormData)l=gu(_.body),f=_.body;else if(_.body instanceof URLSearchParams)l=_.body,f=nv(l);else if(_.body==null)l=new URLSearchParams,f=new FormData;else try{l=new URLSearchParams(_.body),f=nv(l)}catch{return g()}let h={formMethod:M,formAction:T,formEncType:_&&_.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(It(h.formMethod))return{path:n,submission:h};let p=Wr(n);return s&&p.search&&Tu(p.search)&&l.append("index",""),p.search=`?${l}`,{path:Pi(p),submission:h}}function J_(s,n,_,g,E,M,T,l,f,h,p,m,y,b,A,S,o,u,d,v){let x=v?ai(v[1])?v[1].error:v[1].data:void 0,R=E.createURL(M.location),O=E.createURL(f),w;if(p&&M.errors){let te=Object.keys(M.errors)[0];w=T.findIndex(ue=>ue.route.id===te)}else if(v&&ai(v[1])){let te=v[0];w=T.findIndex(ue=>ue.route.id===te)-1}let C=v?v[1].statusCode:void 0,B=C&&C>=400,P={currentUrl:R,currentParams:M.matches[0]?.params||{},nextUrl:O,nextParams:T[0].params,...l,actionResult:x,actionStatus:C},I=Ru(T.map(te=>te.route.path)),F=T.map((te,ue)=>{let{route:q}=te,$=null;if(w!=null&&ue>w?$=!1:q.lazy?$=!0:Au(q)?p?$=mu(q,M.loaderData,M.errors):i0(M.loaderData,M.matches[ue],te)&&($=!0):$=!1,$!==null)return pu(_,g,s,I,te,h,n,$);let oe=B?!1:m||R.pathname+R.search===O.pathname+O.search||R.search!==O.search||r0(M.matches[ue],te),k={...P,defaultShouldRevalidate:oe},U=Hl(te,k);return pu(_,g,s,I,te,h,n,U,k)}),G=[];return A.forEach((te,ue)=>{if(p||!T.some(V=>V.route.id===te.routeId)||b.has(ue))return;let q=M.fetchers.get(ue),$=q&&q.state!=="idle"&&q.data===void 0,oe=Fr(o,te.path,u);if(!oe){if(d&&$)return;G.push({key:ue,routeId:te.routeId,path:te.path,matches:null,match:null,request:null,controller:null});return}if(S.has(ue))return;let k=Dl(oe,te.path),U=new AbortController,L=rn(E,te.path,U.signal),j=null;if(y.has(ue))y.delete(ue),j=nn(_,g,L,oe,k,h,n);else if($)m&&(j=nn(_,g,L,oe,k,h,n));else{let V={...P,defaultShouldRevalidate:B?!1:m};Hl(k,V)&&(j=nn(_,g,L,oe,k,h,n,V))}j&&G.push({key:ue,routeId:te.routeId,path:te.path,matches:j,match:k,request:L,controller:U})}),{dsMatches:F,revalidatingFetchers:G}}function Au(s){return s.loader!=null||s.middleware!=null&&s.middleware.length>0}function mu(s,n,_){if(s.lazy)return!0;if(!Au(s))return!1;let g=n!=null&&s.id in n,E=_!=null&&_[s.id]!==void 0;return!g&&E?!1:typeof s.loader=="function"&&s.loader.hydrate===!0?!0:!g&&!E}function i0(s,n,_){let g=!n||_.route.id!==n.route.id,E=!s.hasOwnProperty(_.route.id);return g||E}function r0(s,n){let _=s.route.path;return s.pathname!==n.pathname||_!=null&&_.endsWith("*")&&s.params["*"]!==n.params["*"]}function Hl(s,n){if(s.route.shouldRevalidate){let _=s.route.shouldRevalidate(n);if(typeof _=="boolean")return _}return n.defaultShouldRevalidate}function ev(s,n,_,g,E,M){let T;if(s){let h=g[s];je(h,`No route found to patch children into: routeId = ${s}`),h.children||(h.children=[]),T=h.children}else T=_;let l=[],f=[];if(n.forEach(h=>{let p=T.find(m=>Kv(h,m));p?f.push({existingRoute:p,newRoute:h}):l.push(h)}),l.length>0){let h=sa(l,E,[s||"_","patch",String(T?.length||"0")],g);T.push(...h)}if(M&&f.length>0)for(let h=0;h<f.length;h++){let{existingRoute:p,newRoute:m}=f[h],y=p,[b]=sa([m],E,[],{},!0);Object.assign(y,{element:b.element?b.element:y.element,errorElement:b.errorElement?b.errorElement:y.errorElement,hydrateFallbackElement:b.hydrateFallbackElement?b.hydrateFallbackElement:y.hydrateFallbackElement})}}function Kv(s,n){return"id"in s&&"id"in n&&s.id===n.id?!0:s.index===n.index&&s.path===n.path&&s.caseSensitive===n.caseSensitive?(!s.children||s.children.length===0)&&(!n.children||n.children.length===0)?!0:s.children.every((_,g)=>n.children?.some(E=>Kv(_,E))):!1}var tv=new WeakMap,Wv=({key:s,route:n,manifest:_,mapRouteProperties:g})=>{let E=_[n.id];if(je(E,"No route found in manifest"),!E.lazy||typeof E.lazy!="object")return;let M=E.lazy[s];if(!M)return;let T=tv.get(E);T||(T={},tv.set(E,T));let l=T[s];if(l)return l;let f=(async()=>{let h=py(s),m=E[s]!==void 0&&s!=="hasErrorBoundary";if(h)Et(!h,"Route property "+s+" is not a supported lazy route property. This property will be ignored."),T[s]=Promise.resolve();else if(m)Et(!1,`Route "${E.id}" has a static property "${s}" defined. The lazy property will be ignored.`);else{let y=await M();y!=null&&(Object.assign(E,{[s]:y}),Object.assign(E,g(E)))}typeof E.lazy=="object"&&(E.lazy[s]=void 0,Object.values(E.lazy).every(y=>y===void 0)&&(E.lazy=void 0))})();return T[s]=f,f},iv=new WeakMap;function s0(s,n,_,g,E){let M=_[s.id];if(je(M,"No route found in manifest"),!s.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof s.lazy=="function"){let p=iv.get(M);if(p)return{lazyRoutePromise:p,lazyHandlerPromise:p};let m=(async()=>{je(typeof s.lazy=="function","No lazy route function found");let y=await s.lazy(),b={};for(let A in y){let S=y[A];if(S===void 0)continue;let o=yy(A),d=M[A]!==void 0&&A!=="hasErrorBoundary";o?Et(!o,"Route property "+A+" is not a supported property to be returned from a lazy route function. This property will be ignored."):d?Et(!d,`Route "${M.id}" has a static property "${A}" defined but its lazy function is also returning a value for this property. The lazy route property "${A}" will be ignored.`):b[A]=S}Object.assign(M,b),Object.assign(M,{...g(M),lazy:void 0})})();return iv.set(M,m),m.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:m}}let T=Object.keys(s.lazy),l=[],f;for(let p of T){if(E&&E.includes(p))continue;let m=Wv({key:p,route:s,manifest:_,mapRouteProperties:g});m&&(l.push(m),p===n&&(f=m))}let h=l.length>0?Promise.all(l).then(()=>{}):void 0;return h?.catch(()=>{}),f?.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:f}}async function rv(s){let n=s.matches.filter(E=>E.shouldLoad),_={};return(await Promise.all(n.map(E=>E.resolve()))).forEach((E,M)=>{_[n[M].route.id]=E}),_}async function n0(s){return s.matches.some(n=>n.route.middleware)?Gv(s,()=>rv(s)):rv(s)}function Gv(s,n){return a0(s,n,g=>g,_0,_);function _(g,E,M){if(M)return Promise.resolve(Object.assign(M.value,{[E]:{type:"error",result:g}}));{let{matches:T}=s,l=Math.min(Math.max(T.findIndex(h=>h.route.id===E),0),Math.max(T.findIndex(h=>h.unstable_shouldCallHandler()),0)),f=Ir(T,T[l].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:g}})}}}async function a0(s,n,_,g,E){let{matches:M,request:T,params:l,context:f,unstable_pattern:h}=s,p=M.flatMap(y=>y.route.middleware?y.route.middleware.map(b=>[y.route.id,b]):[]);return await Yv({request:T,params:l,context:f,unstable_pattern:h},p,n,_,g,E)}async function Yv(s,n,_,g,E,M,T=0){let{request:l}=s;if(l.signal.aborted)throw l.signal.reason??new Error(`Request aborted: ${l.method} ${l.url}`);let f=n[T];if(!f)return await _();let[h,p]=f,m,y=async()=>{if(m)throw new Error("You may only call `next()` once per middleware");try{return m={value:await Yv(s,n,_,g,E,M,T+1)},m.value}catch(b){return m={value:await M(b,h,m)},m.value}};try{let b=await p(s,y),A=b!=null?g(b):void 0;return E(A)?A:m?A??m.value:(m={value:await y()},m.value)}catch(b){return await M(b,h,m)}}function Qv(s,n,_,g,E){let M=Wv({key:"middleware",route:g.route,manifest:n,mapRouteProperties:s}),T=s0(g.route,It(_.method)?"action":"loader",n,s,E);return{middleware:M,route:T.lazyRoutePromise,handler:T.lazyHandlerPromise}}function pu(s,n,_,g,E,M,T,l,f=null){let h=!1,p=Qv(s,n,_,E,M);return{...E,_lazyPromises:p,shouldLoad:l,unstable_shouldRevalidateArgs:f,unstable_shouldCallHandler(m){return h=!0,f?typeof m=="boolean"?Hl(E,{...f,defaultShouldRevalidate:m}):Hl(E,f):l},resolve(m){let{lazy:y,loader:b,middleware:A}=E.route,S=h||l||m&&!It(_.method)&&(y||b),o=A&&A.length>0&&!b&&!y;return S&&(It(_.method)||!o)?o0({request:_,unstable_pattern:g,match:E,lazyHandlerPromise:p?.handler,lazyRoutePromise:p?.route,handlerOverride:m,scopedContext:T}):Promise.resolve({type:"data",result:void 0})}}}function nn(s,n,_,g,E,M,T,l=null){return g.map(f=>f.route.id!==E.route.id?{...f,shouldLoad:!1,unstable_shouldRevalidateArgs:l,unstable_shouldCallHandler:()=>!1,_lazyPromises:Qv(s,n,_,f,M),resolve:()=>Promise.resolve({type:"data",result:void 0})}:pu(s,n,_,Ru(g.map(h=>h.route.path)),f,M,T,!0,l))}async function l0(s,n,_,g,E,M){_.some(h=>h._lazyPromises?.middleware)&&await Promise.all(_.map(h=>h._lazyPromises?.middleware));let T={request:n,unstable_pattern:Ru(_.map(h=>h.route.path)),params:_[0].params,context:E,matches:_},f=await s({...T,fetcherKey:g,runClientMiddleware:h=>{let p=T;return Gv(p,()=>h({...p,fetcherKey:g,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(_.flatMap(h=>[h._lazyPromises?.handler,h._lazyPromises?.route]))}catch{}return f}async function o0({request:s,unstable_pattern:n,match:_,lazyHandlerPromise:g,lazyRoutePromise:E,handlerOverride:M,scopedContext:T}){let l,f,h=It(s.method),p=h?"action":"loader",m=y=>{let b,A=new Promise((u,d)=>b=d);f=()=>b(),s.signal.addEventListener("abort",f);let S=u=>typeof y!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${p}" [routeId: ${_.route.id}]`)):y({request:s,unstable_pattern:n,params:_.params,context:T},...u!==void 0?[u]:[]),o=(async()=>{try{return{type:"data",result:await(M?M(d=>S(d)):S())}}catch(u){return{type:"error",result:u}}})();return Promise.race([o,A])};try{let y=h?_.route.action:_.route.loader;if(g||E)if(y){let b,[A]=await Promise.all([m(y).catch(S=>{b=S}),g,E]);if(b!==void 0)throw b;l=A}else{await g;let b=h?_.route.action:_.route.loader;if(b)[l]=await Promise.all([m(b),E]);else if(p==="action"){let A=new URL(s.url),S=A.pathname+A.search;throw Si(405,{method:s.method,pathname:S,routeId:_.route.id})}else return{type:"data",result:void 0}}else if(y)l=await m(y);else{let b=new URL(s.url),A=b.pathname+b.search;throw Si(404,{pathname:A})}}catch(y){return{type:"error",result:y}}finally{f&&s.signal.removeEventListener("abort",f)}return l}async function c0(s){let n=s.headers.get("Content-Type");return n&&/\bapplication\/json\b/.test(n)?s.body==null?null:s.json():s.text()}async function u0(s){let{result:n,type:_}=s;if(Xv(n)){let g;try{g=await c0(n)}catch(E){return{type:"error",error:E}}return _==="error"?{type:"error",error:new kl(n.status,n.statusText,g),statusCode:n.status,headers:n.headers}:{type:"data",data:g,statusCode:n.status,headers:n.headers}}return _==="error"?cv(n)?n.data instanceof Error?{type:"error",error:n.data,statusCode:n.init?.status,headers:n.init?.headers?new Headers(n.init.headers):void 0}:{type:"error",error:new kl(n.init?.status||500,void 0,n.data),statusCode:na(n)?n.status:void 0,headers:n.init?.headers?new Headers(n.init.headers):void 0}:{type:"error",error:n,statusCode:na(n)?n.status:void 0}:cv(n)?{type:"data",data:n.data,statusCode:n.init?.status,headers:n.init?.headers?new Headers(n.init.headers):void 0}:{type:"data",data:n}}function h0(s,n,_,g,E){let M=s.headers.get("Location");if(je(M,"Redirects returned/thrown from loaders/actions must have a Location header"),!Du(M)){let T=g.slice(0,g.findIndex(l=>l.route.id===_)+1);M=vu(new URL(n.url),T,E,M),s.headers.set("Location",M)}return s}function sv(s,n,_){if(Du(s)){let g=s,E=g.startsWith("//")?new URL(n.protocol+g):new URL(g),M=xi(E.pathname,_)!=null;if(E.origin===n.origin&&M)return E.pathname+E.search+E.hash}return s}function rn(s,n,_,g){let E=s.createURL(Vv(n)).toString(),M={signal:_};if(g&&It(g.formMethod)){let{formMethod:T,formEncType:l}=g;M.method=T.toUpperCase(),l==="application/json"?(M.headers=new Headers({"Content-Type":l}),M.body=JSON.stringify(g.json)):l==="text/plain"?M.body=g.text:l==="application/x-www-form-urlencoded"&&g.formData?M.body=gu(g.formData):M.body=g.formData}return new Request(E,M)}function gu(s){let n=new URLSearchParams;for(let[_,g]of s.entries())n.append(_,typeof g=="string"?g:g.name);return n}function nv(s){let n=new FormData;for(let[_,g]of s.entries())n.append(_,g);return n}function f0(s,n,_,g=!1,E=!1){let M={},T=null,l,f=!1,h={},p=_&&ai(_[1])?_[1].error:void 0;return s.forEach(m=>{if(!(m.route.id in n))return;let y=m.route.id,b=n[y];if(je(!fs(b),"Cannot handle redirect results in processLoaderData"),ai(b)){let A=b.error;if(p!==void 0&&(A=p,p=void 0),T=T||{},E)T[y]=A;else{let S=Ir(s,y);T[S.route.id]==null&&(T[S.route.id]=A)}g||(M[y]=qv),f||(f=!0,l=na(b.error)?b.error.status:500),b.headers&&(h[y]=b.headers)}else M[y]=b.data,b.statusCode&&b.statusCode!==200&&!f&&(l=b.statusCode),b.headers&&(h[y]=b.headers)}),p!==void 0&&_&&(T={[_[0]]:p},_[2]&&(M[_[2]]=void 0)),{loaderData:M,errors:T,statusCode:l||200,loaderHeaders:h}}function av(s,n,_,g,E,M){let{loaderData:T,errors:l}=f0(n,_,g);return E.filter(f=>!f.matches||f.matches.some(h=>h.shouldLoad)).forEach(f=>{let{key:h,match:p,controller:m}=f;if(m&&m.signal.aborted)return;let y=M[h];if(je(y,"Did not find corresponding fetcher result"),ai(y)){let b=Ir(s.matches,p?.route.id);l&&l[b.route.id]||(l={...l,[b.route.id]:y.error}),s.fetchers.delete(h)}else if(fs(y))je(!1,"Unhandled fetcher revalidation redirect");else{let b=dr(y.data);s.fetchers.set(h,b)}}),{loaderData:T,errors:l}}function lv(s,n,_,g){let E=Object.entries(n).filter(([,M])=>M!==qv).reduce((M,[T,l])=>(M[T]=l,M),{});for(let M of _){let T=M.route.id;if(!n.hasOwnProperty(T)&&s.hasOwnProperty(T)&&M.route.loader&&(E[T]=s[T]),g&&g.hasOwnProperty(T))break}return E}function ov(s){return s?ai(s[1])?{actionData:{}}:{actionData:{[s[0]]:s[1].data}}:{}}function Ir(s,n){return(n?s.slice(0,s.findIndex(g=>g.route.id===n)+1):[...s]).reverse().find(g=>g.route.hasErrorBoundary===!0)||s[0]}function Cl(s){let n=s.length===1?s[0]:s.find(_=>_.index||!_.path||_.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:n}],route:n}}function Si(s,{pathname:n,routeId:_,method:g,type:E,message:M}={}){let T="Unknown Server Error",l="Unknown @remix-run/router error";return s===400?(T="Bad Request",g&&n&&_?l=`You made a ${g} request to "${n}" but did not provide a \`loader\` for route "${_}", so there is no way to handle the request.`:E==="invalid-body"&&(l="Unable to encode submission body")):s===403?(T="Forbidden",l=`Route "${_}" does not match URL "${n}"`):s===404?(T="Not Found",l=`No route matches URL "${n}"`):s===405&&(T="Method Not Allowed",g&&n&&_?l=`You made a ${g.toUpperCase()} request to "${n}" but did not provide an \`action\` for route "${_}", so there is no way to handle the request.`:g&&(l=`Invalid request method "${g.toUpperCase()}"`)),new kl(s||500,T,new Error(l),!0)}function El(s){let n=Object.entries(s);for(let _=n.length-1;_>=0;_--){let[g,E]=n[_];if(fs(E))return{key:g,result:E}}}function Vv(s){let n=typeof s=="string"?Wr(s):s;return Pi({...n,hash:""})}function d0(s,n){return s.pathname!==n.pathname||s.search!==n.search?!1:s.hash===""?n.hash!=="":s.hash===n.hash?!0:n.hash!==""}function _0(s){return s!=null&&typeof s=="object"&&Object.entries(s).every(([n,_])=>typeof n=="string"&&v0(_))}function v0(s){return s!=null&&typeof s=="object"&&"type"in s&&"result"in s&&(s.type==="data"||s.type==="error")}function m0(s){return Xv(s.result)&&Vy.has(s.result.status)}function ai(s){return s.type==="error"}function fs(s){return(s&&s.type)==="redirect"}function cv(s){return typeof s=="object"&&s!=null&&"type"in s&&"data"in s&&"init"in s&&s.type==="DataWithResponseInit"}function Xv(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.headers=="object"&&typeof s.body<"u"}function p0(s){return Qy.has(s.toUpperCase())}function It(s){return Gy.has(s.toUpperCase())}function Tu(s){return new URLSearchParams(s).getAll("index").some(n=>n==="")}function Dl(s,n){let _=typeof n=="string"?Wr(n).search:n.search;if(s[s.length-1].route.index&&Tu(_||""))return s[s.length-1];let g=Uv(s);return g[g.length-1]}function uv(s){let{formMethod:n,formAction:_,formEncType:g,text:E,formData:M,json:T}=s;if(!(!n||!_||!g)){if(E!=null)return{formMethod:n,formAction:_,formEncType:g,formData:void 0,json:void 0,text:E};if(M!=null)return{formMethod:n,formAction:_,formEncType:g,formData:M,json:void 0,text:void 0};if(T!==void 0)return{formMethod:n,formAction:_,formEncType:g,formData:void 0,json:T,text:void 0}}}function su(s,n){return n?{state:"loading",location:s,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}:{state:"loading",location:s,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function g0(s,n){return{state:"submitting",location:s,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}}function Zn(s,n){return s?{state:"loading",formMethod:s.formMethod,formAction:s.formAction,formEncType:s.formEncType,formData:s.formData,json:s.json,text:s.text,data:n}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:n}}function y0(s,n){return{state:"submitting",formMethod:s.formMethod,formAction:s.formAction,formEncType:s.formEncType,formData:s.formData,json:s.json,text:s.text,data:n?n.data:void 0}}function dr(s){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:s}}function S0(s,n){try{let _=s.sessionStorage.getItem(Iv);if(_){let g=JSON.parse(_);for(let[E,M]of Object.entries(g||{}))M&&Array.isArray(M)&&n.set(E,new Set(M||[]))}}catch{}}function b0(s,n){if(n.size>0){let _={};for(let[g,E]of n)_[g]=[...E];try{s.sessionStorage.setItem(Iv,JSON.stringify(_))}catch(g){Et(!1,`Failed to save applied view transitions in sessionStorage (${g}).`)}}}function C0(){let s,n,_=new Promise((g,E)=>{s=async M=>{g(M);try{await _}catch{}},n=async M=>{E(M);try{await _}catch{}}});return{promise:_,resolve:s,reject:n}}var ms=X.createContext(null);ms.displayName="DataRouter";var la=X.createContext(null);la.displayName="DataRouterState";X.createContext(!1);var Mu=X.createContext({isTransitioning:!1});Mu.displayName="ViewTransition";var $v=X.createContext(new Map);$v.displayName="Fetchers";var E0=X.createContext(null);E0.displayName="Await";var Fi=X.createContext(null);Fi.displayName="Navigation";var zl=X.createContext(null);zl.displayName="Location";var Ii=X.createContext({outlet:null,matches:[],isDataRoute:!1});Ii.displayName="Route";var Lu=X.createContext(null);Lu.displayName="RouteError";function w0(s,{relative:n}={}){je(oa(),"useHref() may be used only in the context of a <Router> component.");let{basename:_,navigator:g}=X.useContext(Fi),{hash:E,pathname:M,search:T}=ca(s,{relative:n}),l=M;return _!=="/"&&(l=M==="/"?_:Ui([_,M])),g.createHref({pathname:l,search:T,hash:E})}function oa(){return X.useContext(zl)!=null}function ps(){return je(oa(),"useLocation() may be used only in the context of a <Router> component."),X.useContext(zl).location}var Zv="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Jv(s){X.useContext(Fi).static||X.useLayoutEffect(s)}function x0(){let{isDataRoute:s}=X.useContext(Ii);return s?U0():R0()}function R0(){je(oa(),"useNavigate() may be used only in the context of a <Router> component.");let s=X.useContext(ms),{basename:n,navigator:_}=X.useContext(Fi),{matches:g}=X.useContext(Ii),{pathname:E}=ps(),M=JSON.stringify(wu(g)),T=X.useRef(!1);return Jv(()=>{T.current=!0}),X.useCallback((f,h={})=>{if(Et(T.current,Zv),!T.current)return;if(typeof f=="number"){_.go(f);return}let p=xu(f,JSON.parse(M),E,h.relative==="path");s==null&&n!=="/"&&(p.pathname=p.pathname==="/"?n:Ui([n,p.pathname])),(h.replace?_.replace:_.push)(p,h.state,h)},[n,_,M,E,s])}X.createContext(null);function D0(){let{matches:s}=X.useContext(Ii),n=s[s.length-1];return n?n.params:{}}function ca(s,{relative:n}={}){let{matches:_}=X.useContext(Ii),{pathname:g}=ps(),E=JSON.stringify(wu(_));return X.useMemo(()=>xu(s,JSON.parse(E),g,n==="path"),[s,E,g,n])}function A0(s,n,_,g,E){je(oa(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:M}=X.useContext(Fi),{matches:T}=X.useContext(Ii),l=T[T.length-1],f=l?l.params:{},h=l?l.pathname:"/",p=l?l.pathnameBase:"/",m=l&&l.route;{let d=m&&m.path||"";em(h,!m||d.endsWith("*")||d.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (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
11
 
12
- Please change the parent <Route path="${d}"> to <Route path="${d==="/"?"*":`${d}/*`}">.`)}let y=ps(),b;b=y;let A=b.pathname||"/",S=A;if(p!=="/"){let d=p.replace(/^\//,"").split("/");S="/"+A.replace(/^\//,"").split("/").slice(d.length).join("/")}let o=Fr(s,{pathname:S});return Et(m||o!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Et(o==null||o[o.length-1].route.element!==void 0||o[o.length-1].route.Component!==void 0||o[o.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),B0(o&&o.map(d=>Object.assign({},d,{params:Object.assign({},f,d.params),pathname:Ui([p,M.encodeLocation?M.encodeLocation(d.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:d.pathname]),pathnameBase:d.pathnameBase==="/"?p:Ui([p,M.encodeLocation?M.encodeLocation(d.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:d.pathnameBase])})),T,_,g,E)}function T0(){let s=z0(),n=na(s)?`${s.status} ${s.statusText}`:s instanceof Error?s.message:JSON.stringify(s),_=s instanceof Error?s.stack:null,g="rgba(200,200,200, 0.5)",E={padding:"0.5rem",backgroundColor:g},M={padding:"2px 4px",backgroundColor:g},T=null;return console.error("Error handled by React Router default ErrorBoundary:",s),T=X.createElement(X.Fragment,null,X.createElement("p",null,"💿 Hey developer 👋"),X.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",X.createElement("code",{style:M},"ErrorBoundary")," or"," ",X.createElement("code",{style:M},"errorElement")," prop on your route.")),X.createElement(X.Fragment,null,X.createElement("h2",null,"Unexpected Application Error!"),X.createElement("h3",{style:{fontStyle:"italic"}},n),_?X.createElement("pre",{style:E},_):null,T)}var M0=X.createElement(T0,null),L0=class extends X.Component{constructor(s){super(s),this.state={location:s.location,revalidation:s.revalidation,error:s.error}}static getDerivedStateFromError(s){return{error:s}}static getDerivedStateFromProps(s,n){return n.location!==s.location||n.revalidation!=="idle"&&s.revalidation==="idle"?{error:s.error,location:s.location,revalidation:s.revalidation}:{error:s.error!==void 0?s.error:n.error,location:n.location,revalidation:s.revalidation||n.revalidation}}componentDidCatch(s,n){this.props.unstable_onError?this.props.unstable_onError(s,n):console.error("React Router caught the following error during render",s)}render(){return this.state.error!==void 0?X.createElement(Ii.Provider,{value:this.props.routeContext},X.createElement(Lu.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function O0({routeContext:s,match:n,children:_}){let g=X.useContext(ms);return g&&g.static&&g.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(g.staticContext._deepestRenderedBoundaryId=n.route.id),X.createElement(Ii.Provider,{value:s},_)}function B0(s,n=[],_=null,g=null,E=null){if(s==null){if(!_)return null;if(_.errors)s=_.matches;else if(n.length===0&&!_.initialized&&_.matches.length>0)s=_.matches;else return null}let M=s,T=_?.errors;if(T!=null){let h=M.findIndex(p=>p.route.id&&T?.[p.route.id]!==void 0);je(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(T).join(",")}`),M=M.slice(0,Math.min(M.length,h+1))}let l=!1,f=-1;if(_)for(let h=0;h<M.length;h++){let p=M[h];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(f=h),p.route.id){let{loaderData:m,errors:y}=_,b=p.route.loader&&!m.hasOwnProperty(p.route.id)&&(!y||y[p.route.id]===void 0);if(p.route.lazy||b){l=!0,f>=0?M=M.slice(0,f+1):M=[M[0]];break}}}return M.reduceRight((h,p,m)=>{let y,b=!1,A=null,S=null;_&&(y=T&&p.route.id?T[p.route.id]:void 0,A=p.route.errorElement||M0,l&&(f<0&&m===0?(em("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,S=null):f===m&&(b=!0,S=p.route.hydrateFallbackElement||null)));let o=n.concat(M.slice(0,m+1)),u=()=>{let d;return y?d=A:b?d=S:p.route.Component?d=X.createElement(p.route.Component,null):p.route.element?d=p.route.element:d=h,X.createElement(O0,{match:p,routeContext:{outlet:h,matches:o,isDataRoute:_!=null},children:d})};return _&&(p.route.ErrorBoundary||p.route.errorElement||m===0)?X.createElement(L0,{location:_.location,revalidation:_.revalidation,component:A,error:y,children:u(),routeContext:{outlet:null,matches:o,isDataRoute:!0},unstable_onError:g}):u()},null)}function Ou(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function k0(s){let n=X.useContext(ms);return je(n,Ou(s)),n}function H0(s){let n=X.useContext(la);return je(n,Ou(s)),n}function N0(s){let n=X.useContext(Ii);return je(n,Ou(s)),n}function Bu(s){let n=N0(s),_=n.matches[n.matches.length-1];return je(_.route.id,`${s} can only be used on routes that contain a unique "id"`),_.route.id}function j0(){return Bu("useRouteId")}function z0(){let s=X.useContext(Lu),n=H0("useRouteError"),_=Bu("useRouteError");return s!==void 0?s:n.errors?.[_]}function U0(){let{router:s}=k0("useNavigate"),n=Bu("useNavigate"),_=X.useRef(!1);return Jv(()=>{_.current=!0}),X.useCallback(async(E,M={})=>{Et(_.current,Zv),_.current&&(typeof E=="number"?s.navigate(E):await s.navigate(E,{fromRouteId:n,...M}))},[s,n])}var hv={};function em(s,n,_){!n&&!hv[s]&&(hv[s]=!0,Et(!1,_))}var fv={};function dv(s,n){!s&&!fv[n]&&(fv[n]=!0,console.warn(n))}function P0(s){let n={hasErrorBoundary:s.hasErrorBoundary||s.ErrorBoundary!=null||s.errorElement!=null};return s.Component&&(s.element&&Et(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(n,{element:X.createElement(s.Component),Component:void 0})),s.HydrateFallback&&(s.hydrateFallbackElement&&Et(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(n,{hydrateFallbackElement:X.createElement(s.HydrateFallback),HydrateFallback:void 0})),s.ErrorBoundary&&(s.errorElement&&Et(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(n,{errorElement:X.createElement(s.ErrorBoundary),ErrorBoundary:void 0})),n}var F0=["HydrateFallback","hydrateFallbackElement"],I0=class{constructor(){this.status="pending",this.promise=new Promise((s,n)=>{this.resolve=_=>{this.status==="pending"&&(this.status="resolved",s(_))},this.reject=_=>{this.status==="pending"&&(this.status="rejected",n(_))}})}};function q0({router:s,flushSync:n,unstable_onError:_}){let[g,E]=X.useState(s.state),[M,T]=X.useState(),[l,f]=X.useState({isTransitioning:!1}),[h,p]=X.useState(),[m,y]=X.useState(),[b,A]=X.useState(),S=X.useRef(new Map),o=X.useCallback(R=>{E(O=>(R.errors&&_&&Object.entries(R.errors).forEach(([w,C])=>{O.errors?.[w]!==C&&_(C)}),R))},[_]),u=X.useCallback((R,{deletedFetchers:O,flushSync:w,viewTransitionOpts:C})=>{R.fetchers.forEach((P,I)=>{P.data!==void 0&&S.current.set(I,P.data)}),O.forEach(P=>S.current.delete(P)),dv(w===!1||n!=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 B=s.window!=null&&s.window.document!=null&&typeof s.window.document.startViewTransition=="function";if(dv(C==null||B,"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."),!C||!B){n&&w?n(()=>o(R)):X.startTransition(()=>o(R));return}if(n&&w){n(()=>{m&&(h&&h.resolve(),m.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:C.currentLocation,nextLocation:C.nextLocation})});let P=s.window.document.startViewTransition(()=>{n(()=>o(R))});P.finished.finally(()=>{n(()=>{p(void 0),y(void 0),T(void 0),f({isTransitioning:!1})})}),n(()=>y(P));return}m?(h&&h.resolve(),m.skipTransition(),A({state:R,currentLocation:C.currentLocation,nextLocation:C.nextLocation})):(T(R),f({isTransitioning:!0,flushSync:!1,currentLocation:C.currentLocation,nextLocation:C.nextLocation}))},[s.window,n,m,h,o]);X.useLayoutEffect(()=>s.subscribe(u),[s,u]),X.useEffect(()=>{l.isTransitioning&&!l.flushSync&&p(new I0)},[l]),X.useEffect(()=>{if(h&&M&&s.window){let R=M,O=h.promise,w=s.window.document.startViewTransition(async()=>{X.startTransition(()=>o(R)),await O});w.finished.finally(()=>{p(void 0),y(void 0),T(void 0),f({isTransitioning:!1})}),y(w)}},[M,h,s.window,o]),X.useEffect(()=>{h&&M&&g.location.key===M.location.key&&h.resolve()},[h,m,g.location,M]),X.useEffect(()=>{!l.isTransitioning&&b&&(T(b.state),f({isTransitioning:!0,flushSync:!1,currentLocation:b.currentLocation,nextLocation:b.nextLocation}),A(void 0))},[l.isTransitioning,b]);let d=X.useMemo(()=>({createHref:s.createHref,encodeLocation:s.encodeLocation,go:R=>s.navigate(R),push:(R,O,w)=>s.navigate(R,{state:O,preventScrollReset:w?.preventScrollReset}),replace:(R,O,w)=>s.navigate(R,{replace:!0,state:O,preventScrollReset:w?.preventScrollReset})}),[s]),v=s.basename||"/",x=X.useMemo(()=>({router:s,navigator:d,static:!1,basename:v,unstable_onError:_}),[s,d,v,_]);return X.createElement(X.Fragment,null,X.createElement(ms.Provider,{value:x},X.createElement(la.Provider,{value:g},X.createElement($v.Provider,{value:S.current},X.createElement(Mu.Provider,{value:l},X.createElement(G0,{basename:v,location:g.location,navigationType:g.historyAction,navigator:d},X.createElement(K0,{routes:s.routes,future:s.future,state:g,unstable_onError:_})))))),null)}var K0=X.memo(W0);function W0({routes:s,future:n,state:_,unstable_onError:g}){return A0(s,void 0,_,g,n)}function G0({basename:s="/",children:n=null,location:_,navigationType:g="POP",navigator:E,static:M=!1}){je(!oa(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let T=s.replace(/^\/*/,"/"),l=X.useMemo(()=>({basename:T,navigator:E,static:M,future:{}}),[T,E,M]);typeof _=="string"&&(_=Wr(_));let{pathname:f="/",search:h="",hash:p="",state:m=null,key:y="default"}=_,b=X.useMemo(()=>{let A=xi(f,T);return A==null?null:{location:{pathname:A,search:h,hash:p,state:m,key:y},navigationType:g}},[T,f,h,p,m,y,g]);return Et(b!=null,`<Router basename="${T}"> is not able to match the URL "${f}${h}${p}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:X.createElement(Fi.Provider,{value:l},X.createElement(zl.Provider,{children:n,value:b}))}var Al="get",Tl="application/x-www-form-urlencoded";function Ul(s){return s!=null&&typeof s.tagName=="string"}function Y0(s){return Ul(s)&&s.tagName.toLowerCase()==="button"}function Q0(s){return Ul(s)&&s.tagName.toLowerCase()==="form"}function V0(s){return Ul(s)&&s.tagName.toLowerCase()==="input"}function X0(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}function $0(s,n){return s.button===0&&(!n||n==="_self")&&!X0(s)}var wl=null;function Z0(){if(wl===null)try{new FormData(document.createElement("form"),0),wl=!1}catch{wl=!0}return wl}var J0=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function nu(s){return s!=null&&!J0.has(s)?(Et(!1,`"${s}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Tl}"`),null):s}function eS(s,n){let _,g,E,M,T;if(Q0(s)){let l=s.getAttribute("action");g=l?xi(l,n):null,_=s.getAttribute("method")||Al,E=nu(s.getAttribute("enctype"))||Tl,M=new FormData(s)}else if(Y0(s)||V0(s)&&(s.type==="submit"||s.type==="image")){let l=s.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=s.getAttribute("formaction")||l.getAttribute("action");if(g=f?xi(f,n):null,_=s.getAttribute("formmethod")||l.getAttribute("method")||Al,E=nu(s.getAttribute("formenctype"))||nu(l.getAttribute("enctype"))||Tl,M=new FormData(l,s),!Z0()){let{name:h,type:p,value:m}=s;if(p==="image"){let y=h?`${h}.`:"";M.append(`${y}x`,"0"),M.append(`${y}y`,"0")}else h&&M.append(h,m)}}else{if(Ul(s))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');_=Al,g=null,E=Tl,T=s}return M&&E==="text/plain"&&(T=M,M=void 0),{action:g,method:_.toLowerCase(),encType:E,formData:M,body:T}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ku(s,n){if(s===!1||s===null||typeof s>"u")throw new Error(n)}function tS(s,n,_){let g=typeof s=="string"?new URL(s,typeof window>"u"?"server://singlefetch/":window.location.origin):s;return g.pathname==="/"?g.pathname=`_root.${_}`:n&&xi(g.pathname,n)==="/"?g.pathname=`${n.replace(/\/$/,"")}/_root.${_}`:g.pathname=`${g.pathname.replace(/\/$/,"")}.${_}`,g}async function iS(s,n){if(s.id in n)return n[s.id];try{let _=await import(s.module);return n[s.id]=_,_}catch(_){return console.error(`Error loading route module \`${s.module}\`, reloading page...`),console.error(_),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function rS(s){return s==null?!1:s.href==null?s.rel==="preload"&&typeof s.imageSrcSet=="string"&&typeof s.imageSizes=="string":typeof s.rel=="string"&&typeof s.href=="string"}async function sS(s,n,_){let g=await Promise.all(s.map(async E=>{let M=n.routes[E.route.id];if(M){let T=await iS(M,_);return T.links?T.links():[]}return[]}));return oS(g.flat(1).filter(rS).filter(E=>E.rel==="stylesheet"||E.rel==="preload").map(E=>E.rel==="stylesheet"?{...E,rel:"prefetch",as:"style"}:{...E,rel:"prefetch"}))}function _v(s,n,_,g,E,M){let T=(f,h)=>_[h]?f.route.id!==_[h].route.id:!0,l=(f,h)=>_[h].pathname!==f.pathname||_[h].route.path?.endsWith("*")&&_[h].params["*"]!==f.params["*"];return M==="assets"?n.filter((f,h)=>T(f,h)||l(f,h)):M==="data"?n.filter((f,h)=>{let p=g.routes[f.route.id];if(!p||!p.hasLoader)return!1;if(T(f,h)||l(f,h))return!0;if(f.route.shouldRevalidate){let m=f.route.shouldRevalidate({currentUrl:new URL(E.pathname+E.search+E.hash,window.origin),currentParams:_[0]?.params||{},nextUrl:new URL(s,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function nS(s,n,{includeHydrateFallback:_}={}){return aS(s.map(g=>{let E=n.routes[g.route.id];if(!E)return[];let M=[E.module];return E.clientActionModule&&(M=M.concat(E.clientActionModule)),E.clientLoaderModule&&(M=M.concat(E.clientLoaderModule)),_&&E.hydrateFallbackModule&&(M=M.concat(E.hydrateFallbackModule)),E.imports&&(M=M.concat(E.imports)),M}).flat(1))}function aS(s){return[...new Set(s)]}function lS(s){let n={},_=Object.keys(s).sort();for(let g of _)n[g]=s[g];return n}function oS(s,n){let _=new Set;return new Set(n),s.reduce((g,E)=>{let M=JSON.stringify(lS(E));return _.has(M)||(_.add(M),g.push({key:M,link:E})),g},[])}function tm(){let s=X.useContext(ms);return ku(s,"You must render this element inside a <DataRouterContext.Provider> element"),s}function cS(){let s=X.useContext(la);return ku(s,"You must render this element inside a <DataRouterStateContext.Provider> element"),s}var Hu=X.createContext(void 0);Hu.displayName="FrameworkContext";function im(){let s=X.useContext(Hu);return ku(s,"You must render this element inside a <HydratedRouter> element"),s}function uS(s,n){let _=X.useContext(Hu),[g,E]=X.useState(!1),[M,T]=X.useState(!1),{onFocus:l,onBlur:f,onMouseEnter:h,onMouseLeave:p,onTouchStart:m}=n,y=X.useRef(null);X.useEffect(()=>{if(s==="render"&&T(!0),s==="viewport"){let S=u=>{u.forEach(d=>{T(d.isIntersecting)})},o=new IntersectionObserver(S,{threshold:.5});return y.current&&o.observe(y.current),()=>{o.disconnect()}}},[s]),X.useEffect(()=>{if(g){let S=setTimeout(()=>{T(!0)},100);return()=>{clearTimeout(S)}}},[g]);let b=()=>{E(!0)},A=()=>{E(!1),T(!1)};return _?s!=="intent"?[M,y,{}]:[M,y,{onFocus:Jn(l,b),onBlur:Jn(f,A),onMouseEnter:Jn(h,b),onMouseLeave:Jn(p,A),onTouchStart:Jn(m,b)}]:[!1,y,{}]}function Jn(s,n){return _=>{s&&s(_),_.defaultPrevented||n(_)}}function hS({page:s,...n}){let{router:_}=tm(),g=X.useMemo(()=>Fr(_.routes,s,_.basename),[_.routes,s,_.basename]);return g?X.createElement(dS,{page:s,matches:g,...n}):null}function fS(s){let{manifest:n,routeModules:_}=im(),[g,E]=X.useState([]);return X.useEffect(()=>{let M=!1;return sS(s,n,_).then(T=>{M||E(T)}),()=>{M=!0}},[s,n,_]),g}function dS({page:s,matches:n,..._}){let g=ps(),{manifest:E,routeModules:M}=im(),{basename:T}=tm(),{loaderData:l,matches:f}=cS(),h=X.useMemo(()=>_v(s,n,f,E,g,"data"),[s,n,f,E,g]),p=X.useMemo(()=>_v(s,n,f,E,g,"assets"),[s,n,f,E,g]),m=X.useMemo(()=>{if(s===g.pathname+g.search+g.hash)return[];let A=new Set,S=!1;if(n.forEach(u=>{let d=E.routes[u.route.id];!d||!d.hasLoader||(!h.some(v=>v.route.id===u.route.id)&&u.route.id in l&&M[u.route.id]?.shouldRevalidate||d.hasClientLoader?S=!0:A.add(u.route.id))}),A.size===0)return[];let o=tS(s,T,"data");return S&&A.size>0&&o.searchParams.set("_routes",n.filter(u=>A.has(u.route.id)).map(u=>u.route.id).join(",")),[o.pathname+o.search]},[T,l,g,E,h,n,s,M]),y=X.useMemo(()=>nS(p,E),[p,E]),b=fS(p);return X.createElement(X.Fragment,null,m.map(A=>X.createElement("link",{key:A,rel:"prefetch",as:"fetch",href:A,..._})),y.map(A=>X.createElement("link",{key:A,rel:"modulepreload",href:A,..._})),b.map(({key:A,link:S})=>X.createElement("link",{key:A,nonce:_.nonce,...S})))}function _S(...s){return n=>{s.forEach(_=>{typeof _=="function"?_(n):_!=null&&(_.current=n)})}}var rm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{rm&&(window.__reactRouterVersion="7.9.5")}catch{}function vS(s,n){return e0({basename:n?.basename,getContext:n?.getContext,future:n?.future,history:dy({window:n?.window}),hydrationData:mS(),routes:s,mapRouteProperties:P0,hydrationRouteProperties:F0,dataStrategy:n?.dataStrategy,patchRoutesOnNavigation:n?.patchRoutesOnNavigation,window:n?.window,unstable_instrumentations:n?.unstable_instrumentations}).initialize()}function mS(){let s=window?.__staticRouterHydrationData;return s&&s.errors&&(s={...s,errors:pS(s.errors)}),s}function pS(s){if(!s)return null;let n=Object.entries(s),_={};for(let[g,E]of n)if(E&&E.__type==="RouteErrorResponse")_[g]=new kl(E.status,E.statusText,E.data,E.internal===!0);else if(E&&E.__type==="Error"){if(E.__subType){let M=window[E.__subType];if(typeof M=="function")try{let T=new M(E.message);T.stack="",_[g]=T}catch{}}if(_[g]==null){let M=new Error(E.message);M.stack="",_[g]=M}}else _[g]=E;return _}var sm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ci=X.forwardRef(function({onClick:n,discover:_="render",prefetch:g="none",relative:E,reloadDocument:M,replace:T,state:l,target:f,to:h,preventScrollReset:p,viewTransition:m,...y},b){let{basename:A}=X.useContext(Fi),S=typeof h=="string"&&sm.test(h),o,u=!1;if(typeof h=="string"&&S&&(o=h,rm))try{let B=new URL(window.location.href),P=h.startsWith("//")?new URL(B.protocol+h):new URL(h),I=xi(P.pathname,A);P.origin===B.origin&&I!=null?h=I+P.search+P.hash:u=!0}catch{Et(!1,`<Link to="${h}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let d=w0(h,{relative:E}),[v,x,R]=uS(g,y),O=bS(h,{replace:T,state:l,target:f,preventScrollReset:p,relative:E,viewTransition:m});function w(B){n&&n(B),B.defaultPrevented||O(B)}let C=X.createElement("a",{...y,...R,href:o||d,onClick:u||M?n:w,ref:_S(b,x),target:f,"data-discover":!S&&_==="render"?"true":void 0});return v&&!S?X.createElement(X.Fragment,null,C,X.createElement(hS,{page:d})):C});Ci.displayName="Link";var gS=X.forwardRef(function({"aria-current":n="page",caseSensitive:_=!1,className:g="",end:E=!1,style:M,to:T,viewTransition:l,children:f,...h},p){let m=ca(T,{relative:h.relative}),y=ps(),b=X.useContext(la),{navigator:A,basename:S}=X.useContext(Fi),o=b!=null&&RS(m)&&l===!0,u=A.encodeLocation?A.encodeLocation(m).pathname:m.pathname,d=y.pathname,v=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;_||(d=d.toLowerCase(),v=v?v.toLowerCase():null,u=u.toLowerCase()),v&&S&&(v=xi(v,S)||v);const x=u!=="/"&&u.endsWith("/")?u.length-1:u.length;let R=d===u||!E&&d.startsWith(u)&&d.charAt(x)==="/",O=v!=null&&(v===u||!E&&v.startsWith(u)&&v.charAt(u.length)==="/"),w={isActive:R,isPending:O,isTransitioning:o},C=R?n:void 0,B;typeof g=="function"?B=g(w):B=[g,R?"active":null,O?"pending":null,o?"transitioning":null].filter(Boolean).join(" ");let P=typeof M=="function"?M(w):M;return X.createElement(Ci,{...h,"aria-current":C,className:B,ref:p,style:P,to:T,viewTransition:l},typeof f=="function"?f(w):f)});gS.displayName="NavLink";var yS=X.forwardRef(({discover:s="render",fetcherKey:n,navigate:_,reloadDocument:g,replace:E,state:M,method:T=Al,action:l,onSubmit:f,relative:h,preventScrollReset:p,viewTransition:m,...y},b)=>{let A=wS(),S=xS(l,{relative:h}),o=T.toLowerCase()==="get"?"get":"post",u=typeof l=="string"&&sm.test(l),d=v=>{if(f&&f(v),v.defaultPrevented)return;v.preventDefault();let x=v.nativeEvent.submitter,R=x?.getAttribute("formmethod")||T;A(x||v.currentTarget,{fetcherKey:n,method:R,navigate:_,replace:E,state:M,relative:h,preventScrollReset:p,viewTransition:m})};return X.createElement("form",{ref:b,method:o,action:S,onSubmit:g?f:d,...y,"data-discover":!u&&s==="render"?"true":void 0})});yS.displayName="Form";function SS(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function nm(s){let n=X.useContext(ms);return je(n,SS(s)),n}function bS(s,{target:n,replace:_,state:g,preventScrollReset:E,relative:M,viewTransition:T}={}){let l=x0(),f=ps(),h=ca(s,{relative:M});return X.useCallback(p=>{if($0(p,n)){p.preventDefault();let m=_!==void 0?_:Pi(f)===Pi(h);l(s,{replace:m,state:g,preventScrollReset:E,relative:M,viewTransition:T})}},[f,l,h,_,g,n,s,E,M,T])}var CS=0,ES=()=>`__${String(++CS)}__`;function wS(){let{router:s}=nm("useSubmit"),{basename:n}=X.useContext(Fi),_=j0();return X.useCallback(async(g,E={})=>{let{action:M,method:T,encType:l,formData:f,body:h}=eS(g,n);if(E.navigate===!1){let p=E.fetcherKey||ES();await s.fetch(p,_,E.action||M,{preventScrollReset:E.preventScrollReset,formData:f,body:h,formMethod:E.method||T,formEncType:E.encType||l,flushSync:E.flushSync})}else await s.navigate(E.action||M,{preventScrollReset:E.preventScrollReset,formData:f,body:h,formMethod:E.method||T,formEncType:E.encType||l,replace:E.replace,state:E.state,fromRouteId:_,flushSync:E.flushSync,viewTransition:E.viewTransition})},[s,n,_])}function xS(s,{relative:n}={}){let{basename:_}=X.useContext(Fi),g=X.useContext(Ii);je(g,"useFormAction must be used inside a RouteContext");let[E]=g.matches.slice(-1),M={...ca(s||".",{relative:n})},T=ps();if(s==null){M.search=T.search;let l=new URLSearchParams(M.search),f=l.getAll("index");if(f.some(p=>p==="")){l.delete("index"),f.filter(m=>m).forEach(m=>l.append("index",m));let p=l.toString();M.search=p?`?${p}`:""}}return(!s||s===".")&&E.route.index&&(M.search=M.search?M.search.replace(/^\?/,"?index&"):"?index"),_!=="/"&&(M.pathname=M.pathname==="/"?_:Ui([_,M.pathname])),Pi(M)}function RS(s,{relative:n}={}){let _=X.useContext(Mu);je(_!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:g}=nm("useViewTransitionState"),E=ca(s,{relative:n});if(!_.isTransitioning)return!1;let M=xi(_.currentLocation.pathname,g)||_.currentLocation.pathname,T=xi(_.nextLocation.pathname,g)||_.nextLocation.pathname;return Bl(E.pathname,T)!=null||Bl(E.pathname,M)!=null}var DS=Ev();function AS(s){return X.createElement(q0,{flushSync:DS.flushSync,...s})}const Ei="/api";class am extends Error{constructor(n,_,g){super(n),this.statusCode=_,this.details=g,this.name="ApiError"}}async function wi(s,n){const _=await fetch(s,{...n,headers:{"Content-Type":"application/json",...n?.headers}}),g=await _.json();if(!_.ok||!g.success)throw new am(g.error||"API request failed",_.status,g.details);return g.data}const Nu={list:async()=>wi(`${Ei}/branches`),get:async s=>{const n=encodeURIComponent(s);return wi(`${Ei}/branches/${n}`)},sync:async(s,n)=>{const _=encodeURIComponent(s);return wi(`${Ei}/branches/${_}/sync`,{method:"POST",body:JSON.stringify(n)})}},TS={list:async()=>wi(`${Ei}/worktrees`),create:async s=>wi(`${Ei}/worktrees`,{method:"POST",body:JSON.stringify(s)}),delete:async s=>{const n=new URL(`${Ei}/worktrees/delete`,window.location.origin);n.searchParams.set("path",s),await wi(n.toString(),{method:"DELETE"})}},ju={list:async()=>wi(`${Ei}/sessions`),start:async s=>wi(`${Ei}/sessions`,{method:"POST",body:JSON.stringify(s)}),get:async s=>wi(`${Ei}/sessions/${s}`),delete:async s=>{await wi(`${Ei}/sessions/${s}`,{method:"DELETE"})}},lm={get:async()=>wi(`${Ei}/config`),update:async s=>wi(`${Ei}/config`,{method:"PUT",body:JSON.stringify(s)})};function MS(){return jl({queryKey:["branches"],queryFn:Nu.list})}function LS(s){return jl({queryKey:["branches",s],queryFn:()=>Nu.get(s),enabled:!!s})}function OS(s){const n=vs();return aa({mutationFn:_=>Nu.sync(s,_),onSuccess:_=>{n.setQueryData(["branches",s],_.branch),n.invalidateQueries({queryKey:["branches"]})}})}const ea="__unknown__";function BS(s){return s.name.length>32?`${s.name.slice(0,29)}...`:s.name}function kS(s){if(!s.divergence)return"divergence: n/a";const{ahead:n,behind:_,upToDate:g}=s.divergence;return g?"divergence: up-to-date":`divergence: +${n} / -${_}`}function HS({branches:s}){const n=X.useMemo(()=>new Map(s.map(E=>[E.name,E])),[s]),_=X.useMemo(()=>{const E=new Set;return s.forEach(M=>{M.baseBranch&&E.add(M.baseBranch)}),E},[s]),g=X.useMemo(()=>{const E=new Map;return s.forEach(M=>{const T=M.baseBranch??ea;if(!(!M.baseBranch&&_.has(M.name))){if(!E.has(T)){const l=T!==ea?n.get(T)??null:null;E.set(T,{id:T,baseLabel:T===ea?"ベース不明":T,baseNode:l,nodes:[],isSyntheticBase:l===null})}E.get(T).nodes.push(M)}}),Array.from(E.values()).sort((M,T)=>M.id===ea?1:T.id===ea?-1:M.baseLabel.localeCompare(T.baseLabel,"ja"))},[s,n,_]);return g.length?N.jsxs("section",{className:"branch-graph-panel",children:[N.jsxs("header",{className:"branch-graph-panel__header",children:[N.jsxs("div",{children:[N.jsx("p",{className:"branch-graph-panel__eyebrow",children:"BRANCH GRAPH"}),N.jsx("h2",{children:"ベースブランチの関係をグラフィカルに把握"}),N.jsx("p",{children:"baseRef、Git upstream、merge-baseヒューリスティクスを用いて推定したベースブランチ単位で 派生ノードをレーン表示します。"})]}),N.jsxs("div",{className:"branch-graph-panel__legend",children:[N.jsx("span",{className:"graph-chip graph-chip--base",children:"Base"}),N.jsx("span",{className:"graph-chip graph-chip--local",children:"Local"}),N.jsx("span",{className:"graph-chip graph-chip--remote",children:"Remote"}),N.jsx("span",{className:"graph-chip graph-chip--worktree",children:"Worktree"})]})]}),N.jsx("div",{className:"branch-graph",children:g.map(E=>N.jsxs("article",{className:"branch-graph__lane",children:[N.jsxs("div",{className:"branch-graph__lane-heading",children:[N.jsxs("p",{className:"branch-graph__lane-label",children:[E.baseLabel,E.baseNode&&N.jsx("span",{className:"branch-graph__lane-meta",children:E.baseNode.type==="local"?"LOCAL":"REMOTE"}),E.isSyntheticBase&&N.jsx("span",{className:"branch-graph__lane-meta lane-meta--muted",children:"推定のみ"})]}),N.jsxs("span",{className:"branch-graph__lane-count",children:[E.nodes.length," branch",E.nodes.length>1?"es":""]})]}),N.jsxs("div",{className:"branch-graph__track",children:[NS(E),E.nodes.map(M=>N.jsx(jS,{branch:M},M.name))]})]},E.id))})]}):N.jsx("section",{className:"branch-graph-panel",children:N.jsxs("div",{className:"branch-graph-panel__empty",children:[N.jsx("p",{children:"グラフ表示できるブランチがありません。"}),N.jsx("p",{children:"fetch済みのブランチやWorktreeを追加すると関係図が表示されます。"})]})})}function NS(s){const n=s.baseLabel==="ベース不明"?"Unknown base":s.baseLabel,_=N.jsxs("div",{className:`branch-graph__node branch-graph__node--base ${s.baseNode?`branch-graph__node--${s.baseNode.type}`:""}`,children:[N.jsx("span",{className:"branch-graph__node-label",children:n}),N.jsx("span",{className:"branch-graph__node-meta",children:"BASE"}),N.jsxs("div",{className:"branch-graph__tooltip",children:[N.jsx("p",{children:n}),N.jsx("p",{children:s.baseNode?`type: ${s.baseNode.type}`:"推定されたベースブランチ"})]})]});return s.baseNode?N.jsx(Ci,{to:`/${encodeURIComponent(s.baseNode.name)}`,className:"branch-graph__node-link","aria-label":`ベースブランチ ${s.baseNode.name} を開く`,children:_},`base-${s.id}`):N.jsx("div",{className:"branch-graph__node-link",children:_},`base-${s.id}`)}function jS({branch:s}){const n=N.jsxs("div",{className:`branch-graph__node branch-graph__node--${s.type} ${s.mergeStatus==="merged"?"branch-graph__node--merged":s.mergeStatus==="unmerged"?"branch-graph__node--active":""}`,children:[N.jsx("span",{className:"branch-graph__node-label",children:BS(s)}),N.jsx("span",{className:"branch-graph__node-meta",children:s.worktreePath?"Worktree":"No Worktree"}),N.jsxs("div",{className:"branch-graph__tooltip",children:[N.jsx("p",{children:s.name}),N.jsxs("p",{children:["base: ",s.baseBranch??"unknown"]}),N.jsx("p",{children:kS(s)}),N.jsx("p",{children:s.worktreePath??"Worktree未作成"})]})]});return N.jsx(Ci,{to:`/${encodeURIComponent(s.name)}`,className:"branch-graph__node-link","aria-label":`${s.name} の詳細を開く`,children:n})}const tn=new Intl.NumberFormat("ja-JP"),vv={local:"ローカル",remote:"リモート"},zS={merged:"マージ済み",unmerged:"未マージ",unknown:"状態不明"},US={merged:"success",unmerged:"warning",unknown:"muted"},PS="ブランチ名やタイプで検索...";function FS(){const{data:s,isLoading:n,error:_}=MS(),[g,E]=X.useState(""),M=s??[],T=X.useMemo(()=>{const p=M.filter(b=>!!b.worktreePath).length,m=M.filter(b=>b.type==="remote").length,y=M.filter(b=>b.divergence?.upToDate).length;return{total:M.length,worktrees:p,remote:m,healthy:y}},[M]),l=g.trim().toLowerCase(),f=X.useMemo(()=>l?M.filter(p=>[p.name,p.type,p.mergeStatus,p.commitMessage??"",p.worktreePath??""].join(" ").toLowerCase().includes(l)):M,[M,l]),h=X.useMemo(()=>n?{title:"データを読み込み中",description:"最新のブランチ一覧を取得しています..."}:_?{title:"ブランチの取得に失敗しました",description:_ instanceof Error?_.message:"未知のエラーが発生しました。"}:M.length?null:{title:"ブランチが見つかりません",description:"git fetch origin などで最新のブランチを取得してください。"},[M.length,_,n]);return N.jsxs("div",{className:"app-shell",children:[N.jsxs("header",{className:"page-hero",children:[N.jsx("p",{className:"page-hero__eyebrow",children:"WORKTREE DASHBOARD"}),N.jsx("h1",{children:"gwt Control Center"}),N.jsx("p",{children:"ローカルのGitブランチとAIツールをブラウザ上で一元管理し、Worktree状態を瞬時に 可視化します。"}),N.jsx("div",{className:"page-hero__meta",children:"リアルタイムで更新されるステータスビュー"})]}),N.jsxs("main",{className:"page-content",children:[!h&&f.length>0&&N.jsx(HS,{branches:f}),N.jsxs("section",{className:"metrics-grid",children:[N.jsxs("article",{className:"metric-card",children:[N.jsx("p",{className:"metric-card__label",children:"総ブランチ数"}),N.jsx("p",{className:"metric-card__value","data-testid":"metric-total",children:tn.format(T.total)}),N.jsx("p",{className:"metric-card__hint",children:"ローカル + リモート"})]}),N.jsxs("article",{className:"metric-card",children:[N.jsx("p",{className:"metric-card__label",children:"作成済みWorktree"}),N.jsx("p",{className:"metric-card__value","data-testid":"metric-worktrees",children:tn.format(T.worktrees)}),N.jsx("p",{className:"metric-card__hint",children:"即座にAIツールを起動可能"})]}),N.jsxs("article",{className:"metric-card",children:[N.jsx("p",{className:"metric-card__label",children:"リモート追跡ブランチ"}),N.jsx("p",{className:"metric-card__value",children:tn.format(T.remote)}),N.jsx("p",{className:"metric-card__hint",children:"origin との同期ステータス"})]}),N.jsxs("article",{className:"metric-card",children:[N.jsx("p",{className:"metric-card__label",children:"最新コミットが最新"}),N.jsx("p",{className:"metric-card__value",children:tn.format(T.healthy)}),N.jsx("p",{className:"metric-card__hint",children:"divergence 0 のブランチ"})]})]}),N.jsxs("section",{className:"toolbar",children:[N.jsxs("label",{className:"toolbar__field",children:[N.jsx("span",{className:"toolbar__icon","aria-hidden":"true",children:"🔍"}),N.jsx("input",{type:"search",className:"search-input",placeholder:PS,value:g,onChange:p=>E(p.target.value)})]}),N.jsxs("span",{className:"toolbar__count",children:[tn.format(f.length)," /"," ",tn.format(T.total)," branches"]})]}),h?N.jsxs("div",{className:"page-state page-state--card",children:[N.jsx("h2",{children:h.title}),N.jsx("p",{children:h.description})]}):f.length===0?N.jsxs("div",{className:"empty-state",children:[N.jsx("h3",{children:"一致するブランチがありません"}),N.jsx("p",{children:"検索条件を見直すか、タグ・ブランチタイプ・コミットメッセージなど別のキーワードを 試してください。"})]}):N.jsx("div",{className:"branch-grid",children:f.map(p=>N.jsxs("article",{className:"branch-card",children:[N.jsxs("div",{className:"branch-card__header",children:[N.jsxs("div",{children:[N.jsxs("p",{className:"branch-card__eyebrow",children:[vv[p.type],"ブランチ"]}),N.jsx("h2",{children:p.name})]}),N.jsxs("div",{className:"badge-group",children:[N.jsx("span",{className:`status-badge status-badge--${p.type}`,children:vv[p.type]}),N.jsx("span",{className:`status-badge status-badge--${US[p.mergeStatus]}`,children:zS[p.mergeStatus]}),N.jsx("span",{className:`status-badge ${p.worktreePath?"status-badge--success":"status-badge--muted"}`,children:p.worktreePath?"Worktreeあり":"Worktree未作成"})]})]}),N.jsx("p",{className:"branch-card__commit",children:p.commitMessage??"コミットメッセージがありません"}),N.jsxs("dl",{className:"metadata-grid metadata-grid--compact",children:[N.jsxs("div",{children:[N.jsx("dt",{children:"最新コミット"}),N.jsx("dd",{children:p.commitHash.slice(0,7)})]}),N.jsxs("div",{children:[N.jsx("dt",{children:"Author"}),N.jsx("dd",{children:p.author??"N/A"})]}),N.jsxs("div",{children:[N.jsx("dt",{children:"Worktree"}),N.jsx("dd",{children:p.worktreePath??"未作成"})]})]}),p.divergence&&N.jsxs("div",{className:"pill-group",children:[N.jsxs("span",{className:"pill",children:["Ahead ",p.divergence.ahead]}),N.jsxs("span",{className:"pill",children:["Behind ",p.divergence.behind]}),N.jsx("span",{className:`pill ${p.divergence.upToDate?"pill--success":"pill--warning"}`,children:p.divergence.upToDate?"最新":"更新あり"})]}),N.jsxs("div",{className:"branch-card__actions",children:[N.jsx(Ci,{className:"button button--ghost",to:`/${encodeURIComponent(p.name)}`,children:"詳細を見る"}),N.jsx("span",{className:`info-pill ${p.worktreePath?"info-pill--success":"info-pill--warning"}`,children:p.worktreePath??"Worktree未作成"})]})]},p.name))})]})]})}function IS(){const s=vs();return aa({mutationFn:n=>TS.create(n),onSuccess:()=>{s.invalidateQueries({queryKey:["worktrees"]}),s.invalidateQueries({queryKey:["branches"]})}})}function qS(){return jl({queryKey:["sessions"],queryFn:ju.list})}function KS(){const s=vs();return aa({mutationFn:n=>ju.start(n),onSuccess:()=>{s.invalidateQueries({queryKey:["sessions"]})}})}function WS(){const s=vs();return aa({mutationFn:n=>ju.delete(n),onSuccess:()=>{s.invalidateQueries({queryKey:["sessions"]})}})}function om(){return jl({queryKey:["config"],queryFn:lm.get})}function GS(){const s=vs();return aa({mutationFn:lm.update,onSuccess:n=>{s.setQueryData(["config"],n)}})}var au={exports:{}},mv;function YS(){return mv||(mv=1,(function(s,n){(function(_,g){s.exports=g()})(globalThis,(()=>(()=>{var _={4567:function(T,l,f){var h=this&&this.__decorate||function(u,d,v,x){var R,O=arguments.length,w=O<3?d:x===null?x=Object.getOwnPropertyDescriptor(d,v):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(u,d,v,x);else for(var C=u.length-1;C>=0;C--)(R=u[C])&&(w=(O<3?R(w):O>3?R(d,v,w):R(d,v))||w);return O>3&&w&&Object.defineProperty(d,v,w),w},p=this&&this.__param||function(u,d){return function(v,x){d(v,x,u)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const m=f(9042),y=f(9924),b=f(844),A=f(4725),S=f(2585);let o=l.AccessibilityManager=class extends b.Disposable{constructor(u,d,v,x){super(),this._terminal=u,this._coreBrowserService=v,this._renderService=x,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new y.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
12
+ Please change the parent <Route path="${d}"> to <Route path="${d==="/"?"*":`${d}/*`}">.`)}let y=ps(),b;b=y;let A=b.pathname||"/",S=A;if(p!=="/"){let d=p.replace(/^\//,"").split("/");S="/"+A.replace(/^\//,"").split("/").slice(d.length).join("/")}let o=Fr(s,{pathname:S});return Et(m||o!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Et(o==null||o[o.length-1].route.element!==void 0||o[o.length-1].route.Component!==void 0||o[o.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),B0(o&&o.map(d=>Object.assign({},d,{params:Object.assign({},f,d.params),pathname:Ui([p,M.encodeLocation?M.encodeLocation(d.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:d.pathname]),pathnameBase:d.pathnameBase==="/"?p:Ui([p,M.encodeLocation?M.encodeLocation(d.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:d.pathnameBase])})),T,_,g,E)}function T0(){let s=z0(),n=na(s)?`${s.status} ${s.statusText}`:s instanceof Error?s.message:JSON.stringify(s),_=s instanceof Error?s.stack:null,g="rgba(200,200,200, 0.5)",E={padding:"0.5rem",backgroundColor:g},M={padding:"2px 4px",backgroundColor:g},T=null;return console.error("Error handled by React Router default ErrorBoundary:",s),T=X.createElement(X.Fragment,null,X.createElement("p",null,"💿 Hey developer 👋"),X.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",X.createElement("code",{style:M},"ErrorBoundary")," or"," ",X.createElement("code",{style:M},"errorElement")," prop on your route.")),X.createElement(X.Fragment,null,X.createElement("h2",null,"Unexpected Application Error!"),X.createElement("h3",{style:{fontStyle:"italic"}},n),_?X.createElement("pre",{style:E},_):null,T)}var M0=X.createElement(T0,null),L0=class extends X.Component{constructor(s){super(s),this.state={location:s.location,revalidation:s.revalidation,error:s.error}}static getDerivedStateFromError(s){return{error:s}}static getDerivedStateFromProps(s,n){return n.location!==s.location||n.revalidation!=="idle"&&s.revalidation==="idle"?{error:s.error,location:s.location,revalidation:s.revalidation}:{error:s.error!==void 0?s.error:n.error,location:n.location,revalidation:s.revalidation||n.revalidation}}componentDidCatch(s,n){this.props.unstable_onError?this.props.unstable_onError(s,n):console.error("React Router caught the following error during render",s)}render(){return this.state.error!==void 0?X.createElement(Ii.Provider,{value:this.props.routeContext},X.createElement(Lu.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function O0({routeContext:s,match:n,children:_}){let g=X.useContext(ms);return g&&g.static&&g.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(g.staticContext._deepestRenderedBoundaryId=n.route.id),X.createElement(Ii.Provider,{value:s},_)}function B0(s,n=[],_=null,g=null,E=null){if(s==null){if(!_)return null;if(_.errors)s=_.matches;else if(n.length===0&&!_.initialized&&_.matches.length>0)s=_.matches;else return null}let M=s,T=_?.errors;if(T!=null){let h=M.findIndex(p=>p.route.id&&T?.[p.route.id]!==void 0);je(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(T).join(",")}`),M=M.slice(0,Math.min(M.length,h+1))}let l=!1,f=-1;if(_)for(let h=0;h<M.length;h++){let p=M[h];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(f=h),p.route.id){let{loaderData:m,errors:y}=_,b=p.route.loader&&!m.hasOwnProperty(p.route.id)&&(!y||y[p.route.id]===void 0);if(p.route.lazy||b){l=!0,f>=0?M=M.slice(0,f+1):M=[M[0]];break}}}return M.reduceRight((h,p,m)=>{let y,b=!1,A=null,S=null;_&&(y=T&&p.route.id?T[p.route.id]:void 0,A=p.route.errorElement||M0,l&&(f<0&&m===0?(em("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,S=null):f===m&&(b=!0,S=p.route.hydrateFallbackElement||null)));let o=n.concat(M.slice(0,m+1)),u=()=>{let d;return y?d=A:b?d=S:p.route.Component?d=X.createElement(p.route.Component,null):p.route.element?d=p.route.element:d=h,X.createElement(O0,{match:p,routeContext:{outlet:h,matches:o,isDataRoute:_!=null},children:d})};return _&&(p.route.ErrorBoundary||p.route.errorElement||m===0)?X.createElement(L0,{location:_.location,revalidation:_.revalidation,component:A,error:y,children:u(),routeContext:{outlet:null,matches:o,isDataRoute:!0},unstable_onError:g}):u()},null)}function Ou(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function k0(s){let n=X.useContext(ms);return je(n,Ou(s)),n}function H0(s){let n=X.useContext(la);return je(n,Ou(s)),n}function N0(s){let n=X.useContext(Ii);return je(n,Ou(s)),n}function Bu(s){let n=N0(s),_=n.matches[n.matches.length-1];return je(_.route.id,`${s} can only be used on routes that contain a unique "id"`),_.route.id}function j0(){return Bu("useRouteId")}function z0(){let s=X.useContext(Lu),n=H0("useRouteError"),_=Bu("useRouteError");return s!==void 0?s:n.errors?.[_]}function U0(){let{router:s}=k0("useNavigate"),n=Bu("useNavigate"),_=X.useRef(!1);return Jv(()=>{_.current=!0}),X.useCallback(async(E,M={})=>{Et(_.current,Zv),_.current&&(typeof E=="number"?s.navigate(E):await s.navigate(E,{fromRouteId:n,...M}))},[s,n])}var hv={};function em(s,n,_){!n&&!hv[s]&&(hv[s]=!0,Et(!1,_))}var fv={};function dv(s,n){!s&&!fv[n]&&(fv[n]=!0,console.warn(n))}function P0(s){let n={hasErrorBoundary:s.hasErrorBoundary||s.ErrorBoundary!=null||s.errorElement!=null};return s.Component&&(s.element&&Et(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(n,{element:X.createElement(s.Component),Component:void 0})),s.HydrateFallback&&(s.hydrateFallbackElement&&Et(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(n,{hydrateFallbackElement:X.createElement(s.HydrateFallback),HydrateFallback:void 0})),s.ErrorBoundary&&(s.errorElement&&Et(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(n,{errorElement:X.createElement(s.ErrorBoundary),ErrorBoundary:void 0})),n}var F0=["HydrateFallback","hydrateFallbackElement"],I0=class{constructor(){this.status="pending",this.promise=new Promise((s,n)=>{this.resolve=_=>{this.status==="pending"&&(this.status="resolved",s(_))},this.reject=_=>{this.status==="pending"&&(this.status="rejected",n(_))}})}};function q0({router:s,flushSync:n,unstable_onError:_}){let[g,E]=X.useState(s.state),[M,T]=X.useState(),[l,f]=X.useState({isTransitioning:!1}),[h,p]=X.useState(),[m,y]=X.useState(),[b,A]=X.useState(),S=X.useRef(new Map),o=X.useCallback(R=>{E(O=>(R.errors&&_&&Object.entries(R.errors).forEach(([w,C])=>{O.errors?.[w]!==C&&_(C)}),R))},[_]),u=X.useCallback((R,{deletedFetchers:O,flushSync:w,viewTransitionOpts:C})=>{R.fetchers.forEach((P,I)=>{P.data!==void 0&&S.current.set(I,P.data)}),O.forEach(P=>S.current.delete(P)),dv(w===!1||n!=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 B=s.window!=null&&s.window.document!=null&&typeof s.window.document.startViewTransition=="function";if(dv(C==null||B,"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."),!C||!B){n&&w?n(()=>o(R)):X.startTransition(()=>o(R));return}if(n&&w){n(()=>{m&&(h&&h.resolve(),m.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:C.currentLocation,nextLocation:C.nextLocation})});let P=s.window.document.startViewTransition(()=>{n(()=>o(R))});P.finished.finally(()=>{n(()=>{p(void 0),y(void 0),T(void 0),f({isTransitioning:!1})})}),n(()=>y(P));return}m?(h&&h.resolve(),m.skipTransition(),A({state:R,currentLocation:C.currentLocation,nextLocation:C.nextLocation})):(T(R),f({isTransitioning:!0,flushSync:!1,currentLocation:C.currentLocation,nextLocation:C.nextLocation}))},[s.window,n,m,h,o]);X.useLayoutEffect(()=>s.subscribe(u),[s,u]),X.useEffect(()=>{l.isTransitioning&&!l.flushSync&&p(new I0)},[l]),X.useEffect(()=>{if(h&&M&&s.window){let R=M,O=h.promise,w=s.window.document.startViewTransition(async()=>{X.startTransition(()=>o(R)),await O});w.finished.finally(()=>{p(void 0),y(void 0),T(void 0),f({isTransitioning:!1})}),y(w)}},[M,h,s.window,o]),X.useEffect(()=>{h&&M&&g.location.key===M.location.key&&h.resolve()},[h,m,g.location,M]),X.useEffect(()=>{!l.isTransitioning&&b&&(T(b.state),f({isTransitioning:!0,flushSync:!1,currentLocation:b.currentLocation,nextLocation:b.nextLocation}),A(void 0))},[l.isTransitioning,b]);let d=X.useMemo(()=>({createHref:s.createHref,encodeLocation:s.encodeLocation,go:R=>s.navigate(R),push:(R,O,w)=>s.navigate(R,{state:O,preventScrollReset:w?.preventScrollReset}),replace:(R,O,w)=>s.navigate(R,{replace:!0,state:O,preventScrollReset:w?.preventScrollReset})}),[s]),v=s.basename||"/",x=X.useMemo(()=>({router:s,navigator:d,static:!1,basename:v,unstable_onError:_}),[s,d,v,_]);return X.createElement(X.Fragment,null,X.createElement(ms.Provider,{value:x},X.createElement(la.Provider,{value:g},X.createElement($v.Provider,{value:S.current},X.createElement(Mu.Provider,{value:l},X.createElement(G0,{basename:v,location:g.location,navigationType:g.historyAction,navigator:d},X.createElement(K0,{routes:s.routes,future:s.future,state:g,unstable_onError:_})))))),null)}var K0=X.memo(W0);function W0({routes:s,future:n,state:_,unstable_onError:g}){return A0(s,void 0,_,g,n)}function G0({basename:s="/",children:n=null,location:_,navigationType:g="POP",navigator:E,static:M=!1}){je(!oa(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let T=s.replace(/^\/*/,"/"),l=X.useMemo(()=>({basename:T,navigator:E,static:M,future:{}}),[T,E,M]);typeof _=="string"&&(_=Wr(_));let{pathname:f="/",search:h="",hash:p="",state:m=null,key:y="default"}=_,b=X.useMemo(()=>{let A=xi(f,T);return A==null?null:{location:{pathname:A,search:h,hash:p,state:m,key:y},navigationType:g}},[T,f,h,p,m,y,g]);return Et(b!=null,`<Router basename="${T}"> is not able to match the URL "${f}${h}${p}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:X.createElement(Fi.Provider,{value:l},X.createElement(zl.Provider,{children:n,value:b}))}var Al="get",Tl="application/x-www-form-urlencoded";function Ul(s){return s!=null&&typeof s.tagName=="string"}function Y0(s){return Ul(s)&&s.tagName.toLowerCase()==="button"}function Q0(s){return Ul(s)&&s.tagName.toLowerCase()==="form"}function V0(s){return Ul(s)&&s.tagName.toLowerCase()==="input"}function X0(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}function $0(s,n){return s.button===0&&(!n||n==="_self")&&!X0(s)}var wl=null;function Z0(){if(wl===null)try{new FormData(document.createElement("form"),0),wl=!1}catch{wl=!0}return wl}var J0=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function nu(s){return s!=null&&!J0.has(s)?(Et(!1,`"${s}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Tl}"`),null):s}function eS(s,n){let _,g,E,M,T;if(Q0(s)){let l=s.getAttribute("action");g=l?xi(l,n):null,_=s.getAttribute("method")||Al,E=nu(s.getAttribute("enctype"))||Tl,M=new FormData(s)}else if(Y0(s)||V0(s)&&(s.type==="submit"||s.type==="image")){let l=s.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=s.getAttribute("formaction")||l.getAttribute("action");if(g=f?xi(f,n):null,_=s.getAttribute("formmethod")||l.getAttribute("method")||Al,E=nu(s.getAttribute("formenctype"))||nu(l.getAttribute("enctype"))||Tl,M=new FormData(l,s),!Z0()){let{name:h,type:p,value:m}=s;if(p==="image"){let y=h?`${h}.`:"";M.append(`${y}x`,"0"),M.append(`${y}y`,"0")}else h&&M.append(h,m)}}else{if(Ul(s))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');_=Al,g=null,E=Tl,T=s}return M&&E==="text/plain"&&(T=M,M=void 0),{action:g,method:_.toLowerCase(),encType:E,formData:M,body:T}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ku(s,n){if(s===!1||s===null||typeof s>"u")throw new Error(n)}function tS(s,n,_){let g=typeof s=="string"?new URL(s,typeof window>"u"?"server://singlefetch/":window.location.origin):s;return g.pathname==="/"?g.pathname=`_root.${_}`:n&&xi(g.pathname,n)==="/"?g.pathname=`${n.replace(/\/$/,"")}/_root.${_}`:g.pathname=`${g.pathname.replace(/\/$/,"")}.${_}`,g}async function iS(s,n){if(s.id in n)return n[s.id];try{let _=await import(s.module);return n[s.id]=_,_}catch(_){return console.error(`Error loading route module \`${s.module}\`, reloading page...`),console.error(_),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function rS(s){return s==null?!1:s.href==null?s.rel==="preload"&&typeof s.imageSrcSet=="string"&&typeof s.imageSizes=="string":typeof s.rel=="string"&&typeof s.href=="string"}async function sS(s,n,_){let g=await Promise.all(s.map(async E=>{let M=n.routes[E.route.id];if(M){let T=await iS(M,_);return T.links?T.links():[]}return[]}));return oS(g.flat(1).filter(rS).filter(E=>E.rel==="stylesheet"||E.rel==="preload").map(E=>E.rel==="stylesheet"?{...E,rel:"prefetch",as:"style"}:{...E,rel:"prefetch"}))}function _v(s,n,_,g,E,M){let T=(f,h)=>_[h]?f.route.id!==_[h].route.id:!0,l=(f,h)=>_[h].pathname!==f.pathname||_[h].route.path?.endsWith("*")&&_[h].params["*"]!==f.params["*"];return M==="assets"?n.filter((f,h)=>T(f,h)||l(f,h)):M==="data"?n.filter((f,h)=>{let p=g.routes[f.route.id];if(!p||!p.hasLoader)return!1;if(T(f,h)||l(f,h))return!0;if(f.route.shouldRevalidate){let m=f.route.shouldRevalidate({currentUrl:new URL(E.pathname+E.search+E.hash,window.origin),currentParams:_[0]?.params||{},nextUrl:new URL(s,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function nS(s,n,{includeHydrateFallback:_}={}){return aS(s.map(g=>{let E=n.routes[g.route.id];if(!E)return[];let M=[E.module];return E.clientActionModule&&(M=M.concat(E.clientActionModule)),E.clientLoaderModule&&(M=M.concat(E.clientLoaderModule)),_&&E.hydrateFallbackModule&&(M=M.concat(E.hydrateFallbackModule)),E.imports&&(M=M.concat(E.imports)),M}).flat(1))}function aS(s){return[...new Set(s)]}function lS(s){let n={},_=Object.keys(s).sort();for(let g of _)n[g]=s[g];return n}function oS(s,n){let _=new Set;return new Set(n),s.reduce((g,E)=>{let M=JSON.stringify(lS(E));return _.has(M)||(_.add(M),g.push({key:M,link:E})),g},[])}function tm(){let s=X.useContext(ms);return ku(s,"You must render this element inside a <DataRouterContext.Provider> element"),s}function cS(){let s=X.useContext(la);return ku(s,"You must render this element inside a <DataRouterStateContext.Provider> element"),s}var Hu=X.createContext(void 0);Hu.displayName="FrameworkContext";function im(){let s=X.useContext(Hu);return ku(s,"You must render this element inside a <HydratedRouter> element"),s}function uS(s,n){let _=X.useContext(Hu),[g,E]=X.useState(!1),[M,T]=X.useState(!1),{onFocus:l,onBlur:f,onMouseEnter:h,onMouseLeave:p,onTouchStart:m}=n,y=X.useRef(null);X.useEffect(()=>{if(s==="render"&&T(!0),s==="viewport"){let S=u=>{u.forEach(d=>{T(d.isIntersecting)})},o=new IntersectionObserver(S,{threshold:.5});return y.current&&o.observe(y.current),()=>{o.disconnect()}}},[s]),X.useEffect(()=>{if(g){let S=setTimeout(()=>{T(!0)},100);return()=>{clearTimeout(S)}}},[g]);let b=()=>{E(!0)},A=()=>{E(!1),T(!1)};return _?s!=="intent"?[M,y,{}]:[M,y,{onFocus:Jn(l,b),onBlur:Jn(f,A),onMouseEnter:Jn(h,b),onMouseLeave:Jn(p,A),onTouchStart:Jn(m,b)}]:[!1,y,{}]}function Jn(s,n){return _=>{s&&s(_),_.defaultPrevented||n(_)}}function hS({page:s,...n}){let{router:_}=tm(),g=X.useMemo(()=>Fr(_.routes,s,_.basename),[_.routes,s,_.basename]);return g?X.createElement(dS,{page:s,matches:g,...n}):null}function fS(s){let{manifest:n,routeModules:_}=im(),[g,E]=X.useState([]);return X.useEffect(()=>{let M=!1;return sS(s,n,_).then(T=>{M||E(T)}),()=>{M=!0}},[s,n,_]),g}function dS({page:s,matches:n,..._}){let g=ps(),{manifest:E,routeModules:M}=im(),{basename:T}=tm(),{loaderData:l,matches:f}=cS(),h=X.useMemo(()=>_v(s,n,f,E,g,"data"),[s,n,f,E,g]),p=X.useMemo(()=>_v(s,n,f,E,g,"assets"),[s,n,f,E,g]),m=X.useMemo(()=>{if(s===g.pathname+g.search+g.hash)return[];let A=new Set,S=!1;if(n.forEach(u=>{let d=E.routes[u.route.id];!d||!d.hasLoader||(!h.some(v=>v.route.id===u.route.id)&&u.route.id in l&&M[u.route.id]?.shouldRevalidate||d.hasClientLoader?S=!0:A.add(u.route.id))}),A.size===0)return[];let o=tS(s,T,"data");return S&&A.size>0&&o.searchParams.set("_routes",n.filter(u=>A.has(u.route.id)).map(u=>u.route.id).join(",")),[o.pathname+o.search]},[T,l,g,E,h,n,s,M]),y=X.useMemo(()=>nS(p,E),[p,E]),b=fS(p);return X.createElement(X.Fragment,null,m.map(A=>X.createElement("link",{key:A,rel:"prefetch",as:"fetch",href:A,..._})),y.map(A=>X.createElement("link",{key:A,rel:"modulepreload",href:A,..._})),b.map(({key:A,link:S})=>X.createElement("link",{key:A,nonce:_.nonce,...S})))}function _S(...s){return n=>{s.forEach(_=>{typeof _=="function"?_(n):_!=null&&(_.current=n)})}}var rm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{rm&&(window.__reactRouterVersion="7.9.5")}catch{}function vS(s,n){return e0({basename:n?.basename,getContext:n?.getContext,future:n?.future,history:dy({window:n?.window}),hydrationData:mS(),routes:s,mapRouteProperties:P0,hydrationRouteProperties:F0,dataStrategy:n?.dataStrategy,patchRoutesOnNavigation:n?.patchRoutesOnNavigation,window:n?.window,unstable_instrumentations:n?.unstable_instrumentations}).initialize()}function mS(){let s=window?.__staticRouterHydrationData;return s&&s.errors&&(s={...s,errors:pS(s.errors)}),s}function pS(s){if(!s)return null;let n=Object.entries(s),_={};for(let[g,E]of n)if(E&&E.__type==="RouteErrorResponse")_[g]=new kl(E.status,E.statusText,E.data,E.internal===!0);else if(E&&E.__type==="Error"){if(E.__subType){let M=window[E.__subType];if(typeof M=="function")try{let T=new M(E.message);T.stack="",_[g]=T}catch{}}if(_[g]==null){let M=new Error(E.message);M.stack="",_[g]=M}}else _[g]=E;return _}var sm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ci=X.forwardRef(function({onClick:n,discover:_="render",prefetch:g="none",relative:E,reloadDocument:M,replace:T,state:l,target:f,to:h,preventScrollReset:p,viewTransition:m,...y},b){let{basename:A}=X.useContext(Fi),S=typeof h=="string"&&sm.test(h),o,u=!1;if(typeof h=="string"&&S&&(o=h,rm))try{let B=new URL(window.location.href),P=h.startsWith("//")?new URL(B.protocol+h):new URL(h),I=xi(P.pathname,A);P.origin===B.origin&&I!=null?h=I+P.search+P.hash:u=!0}catch{Et(!1,`<Link to="${h}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let d=w0(h,{relative:E}),[v,x,R]=uS(g,y),O=bS(h,{replace:T,state:l,target:f,preventScrollReset:p,relative:E,viewTransition:m});function w(B){n&&n(B),B.defaultPrevented||O(B)}let C=X.createElement("a",{...y,...R,href:o||d,onClick:u||M?n:w,ref:_S(b,x),target:f,"data-discover":!S&&_==="render"?"true":void 0});return v&&!S?X.createElement(X.Fragment,null,C,X.createElement(hS,{page:d})):C});Ci.displayName="Link";var gS=X.forwardRef(function({"aria-current":n="page",caseSensitive:_=!1,className:g="",end:E=!1,style:M,to:T,viewTransition:l,children:f,...h},p){let m=ca(T,{relative:h.relative}),y=ps(),b=X.useContext(la),{navigator:A,basename:S}=X.useContext(Fi),o=b!=null&&RS(m)&&l===!0,u=A.encodeLocation?A.encodeLocation(m).pathname:m.pathname,d=y.pathname,v=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;_||(d=d.toLowerCase(),v=v?v.toLowerCase():null,u=u.toLowerCase()),v&&S&&(v=xi(v,S)||v);const x=u!=="/"&&u.endsWith("/")?u.length-1:u.length;let R=d===u||!E&&d.startsWith(u)&&d.charAt(x)==="/",O=v!=null&&(v===u||!E&&v.startsWith(u)&&v.charAt(u.length)==="/"),w={isActive:R,isPending:O,isTransitioning:o},C=R?n:void 0,B;typeof g=="function"?B=g(w):B=[g,R?"active":null,O?"pending":null,o?"transitioning":null].filter(Boolean).join(" ");let P=typeof M=="function"?M(w):M;return X.createElement(Ci,{...h,"aria-current":C,className:B,ref:p,style:P,to:T,viewTransition:l},typeof f=="function"?f(w):f)});gS.displayName="NavLink";var yS=X.forwardRef(({discover:s="render",fetcherKey:n,navigate:_,reloadDocument:g,replace:E,state:M,method:T=Al,action:l,onSubmit:f,relative:h,preventScrollReset:p,viewTransition:m,...y},b)=>{let A=wS(),S=xS(l,{relative:h}),o=T.toLowerCase()==="get"?"get":"post",u=typeof l=="string"&&sm.test(l),d=v=>{if(f&&f(v),v.defaultPrevented)return;v.preventDefault();let x=v.nativeEvent.submitter,R=x?.getAttribute("formmethod")||T;A(x||v.currentTarget,{fetcherKey:n,method:R,navigate:_,replace:E,state:M,relative:h,preventScrollReset:p,viewTransition:m})};return X.createElement("form",{ref:b,method:o,action:S,onSubmit:g?f:d,...y,"data-discover":!u&&s==="render"?"true":void 0})});yS.displayName="Form";function SS(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function nm(s){let n=X.useContext(ms);return je(n,SS(s)),n}function bS(s,{target:n,replace:_,state:g,preventScrollReset:E,relative:M,viewTransition:T}={}){let l=x0(),f=ps(),h=ca(s,{relative:M});return X.useCallback(p=>{if($0(p,n)){p.preventDefault();let m=_!==void 0?_:Pi(f)===Pi(h);l(s,{replace:m,state:g,preventScrollReset:E,relative:M,viewTransition:T})}},[f,l,h,_,g,n,s,E,M,T])}var CS=0,ES=()=>`__${String(++CS)}__`;function wS(){let{router:s}=nm("useSubmit"),{basename:n}=X.useContext(Fi),_=j0();return X.useCallback(async(g,E={})=>{let{action:M,method:T,encType:l,formData:f,body:h}=eS(g,n);if(E.navigate===!1){let p=E.fetcherKey||ES();await s.fetch(p,_,E.action||M,{preventScrollReset:E.preventScrollReset,formData:f,body:h,formMethod:E.method||T,formEncType:E.encType||l,flushSync:E.flushSync})}else await s.navigate(E.action||M,{preventScrollReset:E.preventScrollReset,formData:f,body:h,formMethod:E.method||T,formEncType:E.encType||l,replace:E.replace,state:E.state,fromRouteId:_,flushSync:E.flushSync,viewTransition:E.viewTransition})},[s,n,_])}function xS(s,{relative:n}={}){let{basename:_}=X.useContext(Fi),g=X.useContext(Ii);je(g,"useFormAction must be used inside a RouteContext");let[E]=g.matches.slice(-1),M={...ca(s||".",{relative:n})},T=ps();if(s==null){M.search=T.search;let l=new URLSearchParams(M.search),f=l.getAll("index");if(f.some(p=>p==="")){l.delete("index"),f.filter(m=>m).forEach(m=>l.append("index",m));let p=l.toString();M.search=p?`?${p}`:""}}return(!s||s===".")&&E.route.index&&(M.search=M.search?M.search.replace(/^\?/,"?index&"):"?index"),_!=="/"&&(M.pathname=M.pathname==="/"?_:Ui([_,M.pathname])),Pi(M)}function RS(s,{relative:n}={}){let _=X.useContext(Mu);je(_!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:g}=nm("useViewTransitionState"),E=ca(s,{relative:n});if(!_.isTransitioning)return!1;let M=xi(_.currentLocation.pathname,g)||_.currentLocation.pathname,T=xi(_.nextLocation.pathname,g)||_.nextLocation.pathname;return Bl(E.pathname,T)!=null||Bl(E.pathname,M)!=null}var DS=Ev();function AS(s){return X.createElement(q0,{flushSync:DS.flushSync,...s})}const Ei="/api";class am extends Error{constructor(n,_,g){super(n),this.statusCode=_,this.details=g,this.name="ApiError"}}async function wi(s,n){const _=await fetch(s,{...n,headers:{"Content-Type":"application/json",...n?.headers}}),g=await _.json();if(!_.ok||!g.success)throw new am(g.error||"API request failed",_.status,g.details);return g.data}const Nu={list:async()=>wi(`${Ei}/branches`),get:async s=>{const n=encodeURIComponent(s);return wi(`${Ei}/branches/${n}`)},sync:async(s,n)=>{const _=encodeURIComponent(s);return wi(`${Ei}/branches/${_}/sync`,{method:"POST",body:JSON.stringify(n)})}},TS={list:async()=>wi(`${Ei}/worktrees`),create:async s=>wi(`${Ei}/worktrees`,{method:"POST",body:JSON.stringify(s)}),delete:async s=>{const n=new URL(`${Ei}/worktrees/delete`,window.location.origin);n.searchParams.set("path",s),await wi(n.toString(),{method:"DELETE"})}},ju={list:async()=>wi(`${Ei}/sessions`),start:async s=>wi(`${Ei}/sessions`,{method:"POST",body:JSON.stringify(s)}),get:async s=>wi(`${Ei}/sessions/${s}`),delete:async s=>{await wi(`${Ei}/sessions/${s}`,{method:"DELETE"})}},lm={get:async()=>wi(`${Ei}/config`),update:async s=>wi(`${Ei}/config`,{method:"PUT",body:JSON.stringify(s)})};function MS(){return jl({queryKey:["branches"],queryFn:Nu.list})}function LS(s){return jl({queryKey:["branches",s],queryFn:()=>Nu.get(s),enabled:!!s})}function OS(s){const n=vs();return aa({mutationFn:_=>Nu.sync(s,_),onSuccess:_=>{n.setQueryData(["branches",s],_.branch),n.invalidateQueries({queryKey:["branches"]})}})}const ea="__unknown__";function BS(s){return s.name.length>32?`${s.name.slice(0,29)}...`:s.name}function kS(s){if(!s.divergence)return"divergence: n/a";const{ahead:n,behind:_,upToDate:g}=s.divergence;return g?"divergence: up-to-date":`divergence: +${n} / -${_}`}function HS({branches:s}){const n=X.useMemo(()=>new Map(s.map(E=>[E.name,E])),[s]),_=X.useMemo(()=>{const E=new Set;return s.forEach(M=>{M.baseBranch&&E.add(M.baseBranch)}),E},[s]),g=X.useMemo(()=>{const E=new Map;return s.forEach(M=>{const T=M.baseBranch??ea;if(!(!M.baseBranch&&_.has(M.name))){if(!E.has(T)){const l=T!==ea?n.get(T)??null:null;E.set(T,{id:T,baseLabel:T===ea?"ベース不明":T,baseNode:l,nodes:[],isSyntheticBase:l===null})}E.get(T)?.nodes.push(M)}}),Array.from(E.values()).sort((M,T)=>M.id===ea?1:T.id===ea?-1:M.baseLabel.localeCompare(T.baseLabel,"ja"))},[s,n,_]);return g.length?N.jsxs("section",{className:"branch-graph-panel",children:[N.jsxs("header",{className:"branch-graph-panel__header",children:[N.jsxs("div",{children:[N.jsx("p",{className:"branch-graph-panel__eyebrow",children:"BRANCH GRAPH"}),N.jsx("h2",{children:"ベースブランチの関係をグラフィカルに把握"}),N.jsx("p",{children:"baseRef、Git upstream、merge-baseヒューリスティクスを用いて推定したベースブランチ単位で 派生ノードをレーン表示します。"})]}),N.jsxs("div",{className:"branch-graph-panel__legend",children:[N.jsx("span",{className:"graph-chip graph-chip--base",children:"Base"}),N.jsx("span",{className:"graph-chip graph-chip--local",children:"Local"}),N.jsx("span",{className:"graph-chip graph-chip--remote",children:"Remote"}),N.jsx("span",{className:"graph-chip graph-chip--worktree",children:"Worktree"})]})]}),N.jsx("div",{className:"branch-graph",children:g.map(E=>N.jsxs("article",{className:"branch-graph__lane",children:[N.jsxs("div",{className:"branch-graph__lane-heading",children:[N.jsxs("p",{className:"branch-graph__lane-label",children:[E.baseLabel,E.baseNode&&N.jsx("span",{className:"branch-graph__lane-meta",children:E.baseNode.type==="local"?"LOCAL":"REMOTE"}),E.isSyntheticBase&&N.jsx("span",{className:"branch-graph__lane-meta lane-meta--muted",children:"推定のみ"})]}),N.jsxs("span",{className:"branch-graph__lane-count",children:[E.nodes.length," branch",E.nodes.length>1?"es":""]})]}),N.jsxs("div",{className:"branch-graph__track",children:[NS(E),E.nodes.map(M=>N.jsx(jS,{branch:M},M.name))]})]},E.id))})]}):N.jsx("section",{className:"branch-graph-panel",children:N.jsxs("div",{className:"branch-graph-panel__empty",children:[N.jsx("p",{children:"グラフ表示できるブランチがありません。"}),N.jsx("p",{children:"fetch済みのブランチやWorktreeを追加すると関係図が表示されます。"})]})})}function NS(s){const n=s.baseLabel==="ベース不明"?"Unknown base":s.baseLabel,_=N.jsxs("div",{className:`branch-graph__node branch-graph__node--base ${s.baseNode?`branch-graph__node--${s.baseNode.type}`:""}`,children:[N.jsx("span",{className:"branch-graph__node-label",children:n}),N.jsx("span",{className:"branch-graph__node-meta",children:"BASE"}),N.jsxs("div",{className:"branch-graph__tooltip",children:[N.jsx("p",{children:n}),N.jsx("p",{children:s.baseNode?`type: ${s.baseNode.type}`:"推定されたベースブランチ"})]})]});return s.baseNode?N.jsx(Ci,{to:`/${encodeURIComponent(s.baseNode.name)}`,className:"branch-graph__node-link","aria-label":`ベースブランチ ${s.baseNode.name} を開く`,children:_},`base-${s.id}`):N.jsx("div",{className:"branch-graph__node-link",children:_},`base-${s.id}`)}function jS({branch:s}){const n=N.jsxs("div",{className:`branch-graph__node branch-graph__node--${s.type} ${s.mergeStatus==="merged"?"branch-graph__node--merged":s.mergeStatus==="unmerged"?"branch-graph__node--active":""}`,children:[N.jsx("span",{className:"branch-graph__node-label",children:BS(s)}),N.jsx("span",{className:"branch-graph__node-meta",children:s.worktreePath?"Worktree":"No Worktree"}),N.jsxs("div",{className:"branch-graph__tooltip",children:[N.jsx("p",{children:s.name}),N.jsxs("p",{children:["base: ",s.baseBranch??"unknown"]}),N.jsx("p",{children:kS(s)}),N.jsx("p",{children:s.worktreePath??"Worktree未作成"})]})]});return N.jsx(Ci,{to:`/${encodeURIComponent(s.name)}`,className:"branch-graph__node-link","aria-label":`${s.name} の詳細を開く`,children:n})}const tn=new Intl.NumberFormat("ja-JP"),vv={local:"ローカル",remote:"リモート"},zS={merged:"マージ済み",unmerged:"未マージ",unknown:"状態不明"},US={merged:"success",unmerged:"warning",unknown:"muted"},PS="ブランチ名やタイプで検索...";function FS(){const{data:s,isLoading:n,error:_}=MS(),[g,E]=X.useState(""),M=s??[],T=X.useMemo(()=>{const p=M.filter(b=>!!b.worktreePath).length,m=M.filter(b=>b.type==="remote").length,y=M.filter(b=>b.divergence?.upToDate).length;return{total:M.length,worktrees:p,remote:m,healthy:y}},[M]),l=g.trim().toLowerCase(),f=X.useMemo(()=>l?M.filter(p=>[p.name,p.type,p.mergeStatus,p.commitMessage??"",p.worktreePath??""].join(" ").toLowerCase().includes(l)):M,[M,l]),h=X.useMemo(()=>n?{title:"データを読み込み中",description:"最新のブランチ一覧を取得しています..."}:_?{title:"ブランチの取得に失敗しました",description:_ instanceof Error?_.message:"未知のエラーが発生しました。"}:M.length?null:{title:"ブランチが見つかりません",description:"git fetch origin などで最新のブランチを取得してください。"},[M.length,_,n]);return N.jsxs("div",{className:"app-shell",children:[N.jsxs("header",{className:"page-hero",children:[N.jsx("p",{className:"page-hero__eyebrow",children:"WORKTREE DASHBOARD"}),N.jsx("h1",{children:"gwt Control Center"}),N.jsx("p",{children:"ローカルのGitブランチとAIツールをブラウザ上で一元管理し、Worktree状態を瞬時に 可視化します。"}),N.jsx("div",{className:"page-hero__meta",children:"リアルタイムで更新されるステータスビュー"})]}),N.jsxs("main",{className:"page-content",children:[!h&&f.length>0&&N.jsx(HS,{branches:f}),N.jsxs("section",{className:"metrics-grid",children:[N.jsxs("article",{className:"metric-card",children:[N.jsx("p",{className:"metric-card__label",children:"総ブランチ数"}),N.jsx("p",{className:"metric-card__value","data-testid":"metric-total",children:tn.format(T.total)}),N.jsx("p",{className:"metric-card__hint",children:"ローカル + リモート"})]}),N.jsxs("article",{className:"metric-card",children:[N.jsx("p",{className:"metric-card__label",children:"作成済みWorktree"}),N.jsx("p",{className:"metric-card__value","data-testid":"metric-worktrees",children:tn.format(T.worktrees)}),N.jsx("p",{className:"metric-card__hint",children:"即座にAIツールを起動可能"})]}),N.jsxs("article",{className:"metric-card",children:[N.jsx("p",{className:"metric-card__label",children:"リモート追跡ブランチ"}),N.jsx("p",{className:"metric-card__value",children:tn.format(T.remote)}),N.jsx("p",{className:"metric-card__hint",children:"origin との同期ステータス"})]}),N.jsxs("article",{className:"metric-card",children:[N.jsx("p",{className:"metric-card__label",children:"最新コミットが最新"}),N.jsx("p",{className:"metric-card__value",children:tn.format(T.healthy)}),N.jsx("p",{className:"metric-card__hint",children:"divergence 0 のブランチ"})]})]}),N.jsxs("section",{className:"toolbar",children:[N.jsxs("label",{className:"toolbar__field",children:[N.jsx("span",{className:"toolbar__icon","aria-hidden":"true",children:"🔍"}),N.jsx("input",{type:"search",className:"search-input",placeholder:PS,value:g,onChange:p=>E(p.target.value)})]}),N.jsxs("span",{className:"toolbar__count",children:[tn.format(f.length)," /"," ",tn.format(T.total)," branches"]})]}),h?N.jsxs("div",{className:"page-state page-state--card",children:[N.jsx("h2",{children:h.title}),N.jsx("p",{children:h.description})]}):f.length===0?N.jsxs("div",{className:"empty-state",children:[N.jsx("h3",{children:"一致するブランチがありません"}),N.jsx("p",{children:"検索条件を見直すか、タグ・ブランチタイプ・コミットメッセージなど別のキーワードを 試してください。"})]}):N.jsx("div",{className:"branch-grid",children:f.map(p=>N.jsxs("article",{className:"branch-card",children:[N.jsxs("div",{className:"branch-card__header",children:[N.jsxs("div",{children:[N.jsxs("p",{className:"branch-card__eyebrow",children:[vv[p.type],"ブランチ"]}),N.jsx("h2",{children:p.name})]}),N.jsxs("div",{className:"badge-group",children:[N.jsx("span",{className:`status-badge status-badge--${p.type}`,children:vv[p.type]}),N.jsx("span",{className:`status-badge status-badge--${US[p.mergeStatus]}`,children:zS[p.mergeStatus]}),N.jsx("span",{className:`status-badge ${p.worktreePath?"status-badge--success":"status-badge--muted"}`,children:p.worktreePath?"Worktreeあり":"Worktree未作成"})]})]}),N.jsx("p",{className:"branch-card__commit",children:p.commitMessage??"コミットメッセージがありません"}),N.jsxs("dl",{className:"metadata-grid metadata-grid--compact",children:[N.jsxs("div",{children:[N.jsx("dt",{children:"最新コミット"}),N.jsx("dd",{children:p.commitHash.slice(0,7)})]}),N.jsxs("div",{children:[N.jsx("dt",{children:"Author"}),N.jsx("dd",{children:p.author??"N/A"})]}),N.jsxs("div",{children:[N.jsx("dt",{children:"Worktree"}),N.jsx("dd",{children:p.worktreePath??"未作成"})]})]}),p.divergence&&N.jsxs("div",{className:"pill-group",children:[N.jsxs("span",{className:"pill",children:["Ahead ",p.divergence.ahead]}),N.jsxs("span",{className:"pill",children:["Behind ",p.divergence.behind]}),N.jsx("span",{className:`pill ${p.divergence.upToDate?"pill--success":"pill--warning"}`,children:p.divergence.upToDate?"最新":"更新あり"})]}),N.jsxs("div",{className:"branch-card__actions",children:[N.jsx(Ci,{className:"button button--ghost",to:`/${encodeURIComponent(p.name)}`,children:"詳細を見る"}),N.jsx("span",{className:`info-pill ${p.worktreePath?"info-pill--success":"info-pill--warning"}`,children:p.worktreePath??"Worktree未作成"})]})]},p.name))})]})]})}function IS(){const s=vs();return aa({mutationFn:n=>TS.create(n),onSuccess:()=>{s.invalidateQueries({queryKey:["worktrees"]}),s.invalidateQueries({queryKey:["branches"]})}})}function qS(){return jl({queryKey:["sessions"],queryFn:ju.list})}function KS(){const s=vs();return aa({mutationFn:n=>ju.start(n),onSuccess:()=>{s.invalidateQueries({queryKey:["sessions"]})}})}function WS(){const s=vs();return aa({mutationFn:n=>ju.delete(n),onSuccess:()=>{s.invalidateQueries({queryKey:["sessions"]})}})}function om(){return jl({queryKey:["config"],queryFn:lm.get})}function GS(){const s=vs();return aa({mutationFn:lm.update,onSuccess:n=>{s.setQueryData(["config"],n)}})}var au={exports:{}},mv;function YS(){return mv||(mv=1,(function(s,n){(function(_,g){s.exports=g()})(globalThis,(()=>(()=>{var _={4567:function(T,l,f){var h=this&&this.__decorate||function(u,d,v,x){var R,O=arguments.length,w=O<3?d:x===null?x=Object.getOwnPropertyDescriptor(d,v):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(u,d,v,x);else for(var C=u.length-1;C>=0;C--)(R=u[C])&&(w=(O<3?R(w):O>3?R(d,v,w):R(d,v))||w);return O>3&&w&&Object.defineProperty(d,v,w),w},p=this&&this.__param||function(u,d){return function(v,x){d(v,x,u)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const m=f(9042),y=f(9924),b=f(844),A=f(4725),S=f(2585);let o=l.AccessibilityManager=class extends b.Disposable{constructor(u,d,v,x){super(),this._terminal=u,this._coreBrowserService=v,this._renderService=x,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new y.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
13
13
  `)))),this.register(this._terminal.onA11yTab((R=>this._handleTab(R)))),this.register(this._terminal.onKey((R=>this._handleKey(R.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,b.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(u){for(let d=0;d<u;d++)this._handleChar(" ")}_handleChar(u){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==u&&(this._charsToAnnounce+=u):this._charsToAnnounce+=u,u===`
14
14
  `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=m.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(u){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(u)||this._charsToConsume.push(u)}_refreshRows(u,d){this._liveRegionDebouncer.refresh(u,d,this._terminal.rows)}_renderRows(u,d){const v=this._terminal.buffer,x=v.lines.length.toString();for(let R=u;R<=d;R++){const O=v.translateBufferLineToString(v.ydisp+R,!0),w=(v.ydisp+R+1).toString(),C=this._rowElements[R];C&&(O.length===0?C.innerText=" ":C.textContent=O,C.setAttribute("aria-posinset",w),C.setAttribute("aria-setsize",x))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(u,d){const v=u.target,x=this._rowElements[d===0?1:this._rowElements.length-2];if(v.getAttribute("aria-posinset")===(d===0?"1":`${this._terminal.buffer.lines.length}`)||u.relatedTarget!==x)return;let R,O;if(d===0?(R=v,O=this._rowElements.pop(),this._rowContainer.removeChild(O)):(R=this._rowElements.shift(),O=v,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),O.removeEventListener("focus",this._bottomBoundaryFocusListener),d===0){const w=this._createAccessibilityTreeNode();this._rowElements.unshift(w),this._rowContainer.insertAdjacentElement("afterbegin",w)}else{const w=this._createAccessibilityTreeNode();this._rowElements.push(w),this._rowContainer.appendChild(w)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(d===0?-1:1),this._rowElements[d===0?1:this._rowElements.length-2].focus(),u.preventDefault(),u.stopImmediatePropagation()}_handleResize(u){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let d=this._rowContainer.children.length;d<this._terminal.rows;d++)this._rowElements[d]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[d]);for(;this._rowElements.length>u;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const u=this._coreBrowserService.mainDocument.createElement("div");return u.setAttribute("role","listitem"),u.tabIndex=-1,this._refreshRowDimensions(u),u}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let u=0;u<this._terminal.rows;u++)this._refreshRowDimensions(this._rowElements[u])}}_refreshRowDimensions(u){u.style.height=`${this._renderService.dimensions.css.cell.height}px`}};l.AccessibilityManager=o=h([p(1,S.IInstantiationService),p(2,A.ICoreBrowserService),p(3,A.IRenderService)],o)},3614:(T,l)=>{function f(y){return y.replace(/\r?\n/g,"\r")}function h(y,b){return b?"\x1B[200~"+y+"\x1B[201~":y}function p(y,b,A,S){y=h(y=f(y),A.decPrivateModes.bracketedPasteMode&&S.rawOptions.ignoreBracketedPasteMode!==!0),A.triggerDataEvent(y,!0),b.value=""}function m(y,b,A){const S=A.getBoundingClientRect(),o=y.clientX-S.left-10,u=y.clientY-S.top-10;b.style.width="20px",b.style.height="20px",b.style.left=`${o}px`,b.style.top=`${u}px`,b.style.zIndex="1000",b.focus()}Object.defineProperty(l,"__esModule",{value:!0}),l.rightClickHandler=l.moveTextAreaUnderMouseCursor=l.paste=l.handlePasteEvent=l.copyHandler=l.bracketTextForPaste=l.prepareTextForTerminal=void 0,l.prepareTextForTerminal=f,l.bracketTextForPaste=h,l.copyHandler=function(y,b){y.clipboardData&&y.clipboardData.setData("text/plain",b.selectionText),y.preventDefault()},l.handlePasteEvent=function(y,b,A,S){y.stopPropagation(),y.clipboardData&&p(y.clipboardData.getData("text/plain"),b,A,S)},l.paste=p,l.moveTextAreaUnderMouseCursor=m,l.rightClickHandler=function(y,b,A,S,o){m(y,b,A),o&&S.rightClickSelect(y),b.value=S.selectionText,b.select()}},7239:(T,l,f)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const h=f(1505);l.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(p,m,y){this._css.set(p,m,y)}getCss(p,m){return this._css.get(p,m)}setColor(p,m,y){this._color.set(p,m,y)}getColor(p,m){return this._color.get(p,m)}clear(){this._color.clear(),this._css.clear()}}},3656:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(f,h,p,m){f.addEventListener(h,p,m);let y=!1;return{dispose:()=>{y||(y=!0,f.removeEventListener(h,p,m))}}}},6465:function(T,l,f){var h=this&&this.__decorate||function(o,u,d,v){var x,R=arguments.length,O=R<3?u:v===null?v=Object.getOwnPropertyDescriptor(u,d):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(o,u,d,v);else for(var w=o.length-1;w>=0;w--)(x=o[w])&&(O=(R<3?x(O):R>3?x(u,d,O):x(u,d))||O);return R>3&&O&&Object.defineProperty(u,d,O),O},p=this&&this.__param||function(o,u){return function(d,v){u(d,v,o)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier2=void 0;const m=f(3656),y=f(8460),b=f(844),A=f(2585);let S=l.Linkifier2=class extends b.Disposable{get currentLink(){return this._currentLink}constructor(o){super(),this._bufferService=o,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new y.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new y.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,b.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,b.toDisposable)((()=>{this._lastMouseEvent=void 0}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0})))}registerLinkProvider(o){return this._linkProviders.push(o),{dispose:()=>{const u=this._linkProviders.indexOf(o);u!==-1&&this._linkProviders.splice(u,1)}}}attachToDom(o,u,d){this._element=o,this._mouseService=u,this._renderService=d,this.register((0,m.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,m.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,m.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,m.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(o){if(this._lastMouseEvent=o,!this._element||!this._mouseService)return;const u=this._positionFromMouseEvent(o,this._element,this._mouseService);if(!u)return;this._isMouseOut=!1;const d=o.composedPath();for(let v=0;v<d.length;v++){const x=d[v];if(x.classList.contains("xterm"))break;if(x.classList.contains("xterm-hover"))return}this._lastBufferCell&&u.x===this._lastBufferCell.x&&u.y===this._lastBufferCell.y||(this._handleHover(u),this._lastBufferCell=u)}_handleHover(o){if(this._activeLine!==o.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(o,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,o)||(this._clearCurrentLink(),this._askForLink(o,!0))}_askForLink(o,u){this._activeProviderReplies&&u||(this._activeProviderReplies?.forEach((v=>{v?.forEach((x=>{x.link.dispose&&x.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=o.y);let d=!1;for(const[v,x]of this._linkProviders.entries())u?this._activeProviderReplies?.get(v)&&(d=this._checkLinkProviderResult(v,o,d)):x.provideLinks(o.y,(R=>{if(this._isMouseOut)return;const O=R?.map((w=>({link:w})));this._activeProviderReplies?.set(v,O),d=this._checkLinkProviderResult(v,o,d),this._activeProviderReplies?.size===this._linkProviders.length&&this._removeIntersectingLinks(o.y,this._activeProviderReplies)}))}_removeIntersectingLinks(o,u){const d=new Set;for(let v=0;v<u.size;v++){const x=u.get(v);if(x)for(let R=0;R<x.length;R++){const O=x[R],w=O.link.range.start.y<o?0:O.link.range.start.x,C=O.link.range.end.y>o?this._bufferService.cols:O.link.range.end.x;for(let B=w;B<=C;B++){if(d.has(B)){x.splice(R--,1);break}d.add(B)}}}}_checkLinkProviderResult(o,u,d){if(!this._activeProviderReplies)return d;const v=this._activeProviderReplies.get(o);let x=!1;for(let R=0;R<o;R++)this._activeProviderReplies.has(R)&&!this._activeProviderReplies.get(R)||(x=!0);if(!x&&v){const R=v.find((O=>this._linkAtPosition(O.link,u)));R&&(d=!0,this._handleNewLink(R))}if(this._activeProviderReplies.size===this._linkProviders.length&&!d)for(let R=0;R<this._activeProviderReplies.size;R++){const O=this._activeProviderReplies.get(R)?.find((w=>this._linkAtPosition(w.link,u)));if(O){d=!0,this._handleNewLink(O);break}}return d}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(o){if(!this._element||!this._mouseService||!this._currentLink)return;const u=this._positionFromMouseEvent(o,this._element,this._mouseService);u&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,u)&&this._currentLink.link.activate(o,this._currentLink.link.text)}_clearCurrentLink(o,u){this._element&&this._currentLink&&this._lastMouseEvent&&(!o||!u||this._currentLink.link.range.start.y>=o&&this._currentLink.link.range.end.y<=u)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,b.disposeArray)(this._linkCacheDisposables))}_handleNewLink(o){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const u=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);u&&this._linkAtPosition(o.link,u)&&(this._currentLink=o,this._currentLink.state={decorations:{underline:o.link.decorations===void 0||o.link.decorations.underline,pointerCursor:o.link.decorations===void 0||o.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,o.link,this._lastMouseEvent),o.link.decorations={},Object.defineProperties(o.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:d=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==d&&(this._currentLink.state.decorations.pointerCursor=d,this._currentLink.state.isHovered&&this._element?.classList.toggle("xterm-cursor-pointer",d))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:d=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==d&&(this._currentLink.state.decorations.underline=d,this._currentLink.state.isHovered&&this._fireUnderlineEvent(o.link,d))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((d=>{if(!this._currentLink)return;const v=d.start===0?0:d.start+1+this._bufferService.buffer.ydisp,x=this._bufferService.buffer.ydisp+1+d.end;if(this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=x&&(this._clearCurrentLink(v,x),this._lastMouseEvent&&this._element)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(o,u,d){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(u,!0),this._currentLink.state.decorations.pointerCursor&&o.classList.add("xterm-cursor-pointer")),u.hover&&u.hover(d,u.text)}_fireUnderlineEvent(o,u){const d=o.range,v=this._bufferService.buffer.ydisp,x=this._createLinkUnderlineEvent(d.start.x-1,d.start.y-v-1,d.end.x,d.end.y-v-1,void 0);(u?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(x)}_linkLeave(o,u,d){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(u,!1),this._currentLink.state.decorations.pointerCursor&&o.classList.remove("xterm-cursor-pointer")),u.leave&&u.leave(d,u.text)}_linkAtPosition(o,u){const d=o.range.start.y*this._bufferService.cols+o.range.start.x,v=o.range.end.y*this._bufferService.cols+o.range.end.x,x=u.y*this._bufferService.cols+u.x;return d<=x&&x<=v}_positionFromMouseEvent(o,u,d){const v=d.getCoords(o,u,this._bufferService.cols,this._bufferService.rows);if(v)return{x:v[0],y:v[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(o,u,d,v,x){return{x1:o,y1:u,x2:d,y2:v,cols:this._bufferService.cols,fg:x}}};l.Linkifier2=S=h([p(0,A.IBufferService)],S)},9042:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tooMuchOutput=l.promptLabel=void 0,l.promptLabel="Terminal input",l.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(T,l,f){var h=this&&this.__decorate||function(S,o,u,d){var v,x=arguments.length,R=x<3?o:d===null?d=Object.getOwnPropertyDescriptor(o,u):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(S,o,u,d);else for(var O=S.length-1;O>=0;O--)(v=S[O])&&(R=(x<3?v(R):x>3?v(o,u,R):v(o,u))||R);return x>3&&R&&Object.defineProperty(o,u,R),R},p=this&&this.__param||function(S,o){return function(u,d){o(u,d,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const m=f(511),y=f(2585);let b=l.OscLinkProvider=class{constructor(S,o,u){this._bufferService=S,this._optionsService=o,this._oscLinkService=u}provideLinks(S,o){const u=this._bufferService.buffer.lines.get(S-1);if(!u)return void o(void 0);const d=[],v=this._optionsService.rawOptions.linkHandler,x=new m.CellData,R=u.getTrimmedLength();let O=-1,w=-1,C=!1;for(let B=0;B<R;B++)if(w!==-1||u.hasContent(B)){if(u.loadCell(B,x),x.hasExtendedAttrs()&&x.extended.urlId){if(w===-1){w=B,O=x.extended.urlId;continue}C=x.extended.urlId!==O}else w!==-1&&(C=!0);if(C||w!==-1&&B===R-1){const P=this._oscLinkService.getLinkData(O)?.uri;if(P){const I={start:{x:w+1,y:S},end:{x:B+(C||B!==R-1?0:1),y:S}};let F=!1;if(!v?.allowNonHttpProtocols)try{const G=new URL(P);["http:","https:"].includes(G.protocol)||(F=!0)}catch{F=!0}F||d.push({text:P,range:I,activate:(G,te)=>v?v.activate(G,te,I):A(0,te),hover:(G,te)=>v?.hover?.(G,te,I),leave:(G,te)=>v?.leave?.(G,te,I)})}C=!1,x.hasExtendedAttrs()&&x.extended.urlId?(w=B,O=x.extended.urlId):(w=-1,O=-1)}}o(d)}};function A(S,o){if(confirm(`Do you want to navigate to ${o}?
15
15