@documentation-robotics/cli 0.1.7 → 0.1.9

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 (123) hide show
  1. package/README.md +18 -17
  2. package/dist/audit/nodes/ai/prompts.js +1 -0
  3. package/dist/audit/nodes/ai/prompts.js.map +2 -2
  4. package/dist/audit/relationships/ai/prompts.js +20 -29
  5. package/dist/audit/relationships/ai/prompts.js.map +2 -2
  6. package/dist/audit/relationships/analysis/gap-analyzer.js.map +1 -1
  7. package/dist/audit/relationships/analysis/layer-templates.js +36 -0
  8. package/dist/audit/relationships/analysis/layer-templates.js.map +2 -2
  9. package/dist/cli.js +8 -8
  10. package/dist/cli.js.map +1 -1
  11. package/dist/commands/reports.js +3 -3
  12. package/dist/commands/reports.js.map +1 -1
  13. package/dist/commands/show.js.map +1 -1
  14. package/dist/commands/upgrade.js +1 -1
  15. package/dist/commands/upgrade.js.map +1 -1
  16. package/dist/commands/validate.js.map +1 -1
  17. package/dist/commands/version.js +1 -1
  18. package/dist/commands/visualize.js +2 -8
  19. package/dist/commands/visualize.js.map +2 -2
  20. package/dist/core/layers.js +1 -0
  21. package/dist/core/layers.js.map +2 -2
  22. package/dist/core/migration-registry.js +59 -2
  23. package/dist/core/migration-registry.js.map +2 -2
  24. package/dist/core/model.js +3 -16
  25. package/dist/core/model.js.map +2 -2
  26. package/dist/core/spec-loader.js.map +1 -1
  27. package/dist/core/stats-collector.js +2 -0
  28. package/dist/core/stats-collector.js.map +2 -2
  29. package/dist/export/archimate-exporter.js.map +2 -2
  30. package/dist/export/json-schema-exporter.js.map +1 -1
  31. package/dist/export/markdown-exporter.js.map +1 -1
  32. package/dist/export/markdown-utils.js +1 -0
  33. package/dist/export/markdown-utils.js.map +2 -2
  34. package/dist/export/mermaid-markdown-exporter.js.map +1 -1
  35. package/dist/export/openapi-exporter.js.map +1 -1
  36. package/dist/export/plantuml-exporter.js.map +1 -1
  37. package/dist/export/report-formatters.js +2 -2
  38. package/dist/export/report-formatters.js.map +1 -1
  39. package/dist/export/types.js +1 -0
  40. package/dist/export/types.js.map +2 -2
  41. package/dist/generated/layer-registry.js +44 -31
  42. package/dist/generated/layer-registry.js.map +2 -2
  43. package/dist/generated/layer-types.js +1 -1
  44. package/dist/generated/layer-types.js.map +2 -2
  45. package/dist/generated/node-types.js +45 -0
  46. package/dist/generated/node-types.js.map +2 -2
  47. package/dist/generated/relationship-index.js +201 -19
  48. package/dist/generated/relationship-index.js.map +2 -2
  49. package/dist/import/archimate-importer.js.map +1 -1
  50. package/dist/import/openapi-importer.js.map +1 -1
  51. package/dist/integrations/claude_code/agents/dr-advisor.md +14 -13
  52. package/dist/integrations/claude_code/agents/dr-extractor.md +2 -2
  53. package/dist/integrations/claude_code/commands/dr-info.md +1 -1
  54. package/dist/integrations/claude_code/commands/dr-init.md +3 -3
  55. package/dist/integrations/claude_code/commands/dr-map.md +2 -2
  56. package/dist/integrations/claude_code/commands/dr-model.md +1 -1
  57. package/dist/integrations/claude_code/commands/dr-relate.md +14 -4
  58. package/dist/integrations/claude_code/docs/END_TO_END_WALKTHROUGH.md +3 -3
  59. package/dist/integrations/claude_code/docs/QUICK_START.md +1 -1
  60. package/dist/integrations/claude_code/docs/README.md +2 -2
  61. package/dist/integrations/claude_code/skills/dr_01_motivation_layer/SKILL.md +2 -2
  62. package/dist/integrations/claude_code/skills/dr_03_product_layer/SKILL.md +679 -0
  63. package/dist/integrations/claude_code/skills/{dr_08_dataset_layer → dr_09_dataset_layer}/SKILL.md +1 -1
  64. package/dist/integrations/claude_code/skills/dr_engineering_guide/SKILL.md +2 -2
  65. package/dist/integrations/github_copilot/agents/dr-advisor.md +14 -13
  66. package/dist/integrations/github_copilot/agents/dr-architect.md +15 -14
  67. package/dist/integrations/github_copilot/skills/dr_01_motivation_layer/SKILL.md +2 -2
  68. package/dist/integrations/github_copilot/skills/dr_03_product_layer/SKILL.md +253 -0
  69. package/dist/reports/model-report-orchestrator.js +3 -3
  70. package/dist/reports/model-report-orchestrator.js.map +1 -1
  71. package/dist/schemas/bundled/analyzers/cbm.json +2 -2
  72. package/dist/schemas/bundled/analyzers/manifest.json +2 -2
  73. package/dist/schemas/bundled/api.json +3 -3
  74. package/dist/schemas/bundled/apm.json +3 -3
  75. package/dist/schemas/bundled/application.json +3 -3
  76. package/dist/schemas/bundled/base.json +29 -1
  77. package/dist/schemas/bundled/business.json +1 -1
  78. package/dist/schemas/bundled/data-model.json +3 -3
  79. package/dist/schemas/bundled/data-store.json +3 -3
  80. package/dist/schemas/bundled/manifest.json +20 -13
  81. package/dist/schemas/bundled/motivation.json +1 -1
  82. package/dist/schemas/bundled/navigation.json +3 -3
  83. package/dist/schemas/bundled/product.json +469 -0
  84. package/dist/schemas/bundled/security.json +3 -3
  85. package/dist/schemas/bundled/technology.json +3 -3
  86. package/dist/schemas/bundled/testing.json +3 -3
  87. package/dist/schemas/bundled/ux.json +3 -3
  88. package/dist/server/server.js +148 -101
  89. package/dist/server/server.js.map +2 -2
  90. package/dist/server-entry.js.map +2 -2
  91. package/dist/telemetry/index.js +1 -1
  92. package/dist/utils/spec-installer.js +2 -2
  93. package/dist/utils/spec-installer.js.map +1 -1
  94. package/dist/utils/spec-version.js +1 -1
  95. package/dist/utils/spec-version.js.map +1 -1
  96. package/dist/viewer/README.md +6 -6
  97. package/dist/viewer/assets/main-D114QwJo.css +1 -0
  98. package/dist/viewer/assets/main-DyuokeQj.js +81 -0
  99. package/dist/viewer/index.html +2 -2
  100. package/dist/viewer/manifest.json +10 -10
  101. package/dist/viewer/version.json +1 -1
  102. package/package.json +4 -1
  103. package/dist/viewer/assets/main-CY0Xufuj.css +0 -1
  104. package/dist/viewer/assets/main-DtgErnwF.js +0 -81
  105. /package/dist/integrations/claude_code/skills/{dr_03_security_layer → dr_04_security_layer}/SKILL.md +0 -0
  106. /package/dist/integrations/claude_code/skills/{dr_04_application_layer → dr_05_application_layer}/SKILL.md +0 -0
  107. /package/dist/integrations/claude_code/skills/{dr_05_technology_layer → dr_06_technology_layer}/SKILL.md +0 -0
  108. /package/dist/integrations/claude_code/skills/{dr_06_api_layer → dr_07_api_layer}/SKILL.md +0 -0
  109. /package/dist/integrations/claude_code/skills/{dr_07_data_model_layer → dr_08_data_model_layer}/SKILL.md +0 -0
  110. /package/dist/integrations/claude_code/skills/{dr_09_ux_layer → dr_10_ux_layer}/SKILL.md +0 -0
  111. /package/dist/integrations/claude_code/skills/{dr_10_navigation_layer → dr_11_navigation_layer}/SKILL.md +0 -0
  112. /package/dist/integrations/claude_code/skills/{dr_11_apm_layer → dr_12_apm_layer}/SKILL.md +0 -0
  113. /package/dist/integrations/claude_code/skills/{dr_12_testing_layer → dr_13_testing_layer}/SKILL.md +0 -0
  114. /package/dist/integrations/github_copilot/skills/{dr_03_security_layer → dr_04_security_layer}/SKILL.md +0 -0
  115. /package/dist/integrations/github_copilot/skills/{dr_04_application_layer → dr_05_application_layer}/SKILL.md +0 -0
  116. /package/dist/integrations/github_copilot/skills/{dr_05_technology_layer → dr_06_technology_layer}/SKILL.md +0 -0
  117. /package/dist/integrations/github_copilot/skills/{dr_06_api_layer → dr_07_api_layer}/SKILL.md +0 -0
  118. /package/dist/integrations/github_copilot/skills/{dr_07_data_model_layer → dr_08_data_model_layer}/SKILL.md +0 -0
  119. /package/dist/integrations/github_copilot/skills/{dr_08_dataset_layer → dr_09_dataset_layer}/SKILL.md +0 -0
  120. /package/dist/integrations/github_copilot/skills/{dr_09_ux_layer → dr_10_ux_layer}/SKILL.md +0 -0
  121. /package/dist/integrations/github_copilot/skills/{dr_10_navigation_layer → dr_11_navigation_layer}/SKILL.md +0 -0
  122. /package/dist/integrations/github_copilot/skills/{dr_11_apm_layer → dr_12_apm_layer}/SKILL.md +0 -0
  123. /package/dist/integrations/github_copilot/skills/{dr_12_testing_layer → dr_13_testing_layer}/SKILL.md +0 -0
@@ -0,0 +1,81 @@
1
+ var ON=Object.defineProperty,zN=Object.defineProperties;var IN=Object.getOwnPropertyDescriptors;var cu=Object.getOwnPropertySymbols;var sb=Object.prototype.hasOwnProperty,rb=Object.prototype.propertyIsEnumerable;var lb=e=>{throw TypeError(e)},Mh=Math.pow,Th=(e,t,a)=>t in e?ON(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,T=(e,t)=>{for(var a in t||(t={}))sb.call(t,a)&&Th(e,a,t[a]);if(cu)for(var a of cu(t))rb.call(t,a)&&Th(e,a,t[a]);return e},K=(e,t)=>zN(e,IN(t));var de=(e,t)=>{var a={};for(var s in e)sb.call(e,s)&&t.indexOf(s)<0&&(a[s]=e[s]);if(e!=null&&cu)for(var s of cu(e))t.indexOf(s)<0&&rb.call(e,s)&&(a[s]=e[s]);return a};var UN=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ht=(e,t,a)=>Th(e,typeof t!="symbol"?t+"":t,a),Ah=(e,t,a)=>t.has(e)||lb("Cannot "+a);var G=(e,t,a)=>(Ah(e,t,"read from private field"),a?a.call(e):t.get(e)),Me=(e,t,a)=>t.has(e)?lb("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,a),Se=(e,t,a,s)=>(Ah(e,t,"write to private field"),s?s.call(e,a):t.set(e,a),a),Ve=(e,t,a)=>(Ah(e,t,"access private method"),a);var uu=(e,t,a,s)=>({set _(r){Se(e,t,r,a)},get _(){return G(e,t,s)}});var Ue=(e,t,a)=>new Promise((s,r)=>{var c=h=>{try{u(a.next(h))}catch(m){r(m)}},o=h=>{try{u(a.throw(h))}catch(m){r(m)}},u=h=>h.done?s(h.value):Promise.resolve(h.value).then(c,o);u((a=a.apply(e,t)).next())});import{r as fp,a as jx,g as BN,b as A,R as ie,c as Qu}from"./vendor-CxKvDp2x.js";var $z=UN(pg=>{(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const c of r)if(c.type==="childList")for(const o of c.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function a(r){const c={};return r.integrity&&(c.integrity=r.integrity),r.referrerPolicy&&(c.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?c.credentials="include":r.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(r){if(r.ep)return;r.ep=!0;const c=a(r);fetch(r.href,c)}})();var Lh={exports:{}},lo={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var ob;function FN(){if(ob)return lo;ob=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function a(s,r,c){var o=null;if(c!==void 0&&(o=""+c),r.key!==void 0&&(o=""+r.key),"key"in r){c={};for(var u in r)u!=="key"&&(c[u]=r[u])}else c=r;return r=c.ref,{$$typeof:e,type:s,key:o,ref:r!==void 0?r:null,props:c}}return lo.Fragment=t,lo.jsx=a,lo.jsxs=a,lo}var cb;function HN(){return cb||(cb=1,Lh.exports=FN()),Lh.exports}var f=HN(),Dh={exports:{}},oo={},Oh={exports:{}},zh={};/**
10
+ * @license React
11
+ * scheduler.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var ub;function PN(){return ub||(ub=1,(function(e){function t($,X){var Z=$.length;$.push(X);e:for(;0<Z;){var fe=Z-1>>>1,D=$[fe];if(0<r(D,X))$[fe]=X,$[Z]=D,Z=fe;else break e}}function a($){return $.length===0?null:$[0]}function s($){if($.length===0)return null;var X=$[0],Z=$.pop();if(Z!==X){$[0]=Z;e:for(var fe=0,D=$.length,he=D>>>1;fe<he;){var ge=2*(fe+1)-1,E=$[ge],W=ge+1,oe=$[W];if(0>r(E,Z))W<D&&0>r(oe,E)?($[fe]=oe,$[W]=Z,fe=W):($[fe]=E,$[ge]=Z,fe=ge);else if(W<D&&0>r(oe,Z))$[fe]=oe,$[W]=Z,fe=W;else break e}}return X}function r($,X){var Z=$.sortIndex-X.sortIndex;return Z!==0?Z:$.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var o=Date,u=o.now();e.unstable_now=function(){return o.now()-u}}var h=[],m=[],g=1,p=null,v=3,b=!1,_=!1,S=!1,w=!1,C=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate!="undefined"?setImmediate:null;function k($){for(var X=a(m);X!==null;){if(X.callback===null)s(m);else if(X.startTime<=$)s(m),X.sortIndex=X.expirationTime,t(h,X);else break;X=a(m)}}function I($){if(S=!1,k($),!_)if(a(h)!==null)_=!0,O||(O=!0,F());else{var X=a(m);X!==null&&Y(I,X.startTime-$)}}var O=!1,z=-1,B=5,P=-1;function M(){return w?!0:!(e.unstable_now()-P<B)}function U(){if(w=!1,O){var $=e.unstable_now();P=$;var X=!0;try{e:{_=!1,S&&(S=!1,R(z),z=-1),b=!0;var Z=v;try{t:{for(k($),p=a(h);p!==null&&!(p.expirationTime>$&&M());){var fe=p.callback;if(typeof fe=="function"){p.callback=null,v=p.priorityLevel;var D=fe(p.expirationTime<=$);if($=e.unstable_now(),typeof D=="function"){p.callback=D,k($),X=!0;break t}p===a(h)&&s(h),k($)}else s(h);p=a(h)}if(p!==null)X=!0;else{var he=a(m);he!==null&&Y(I,he.startTime-$),X=!1}}break e}finally{p=null,v=Z,b=!1}X=void 0}}finally{X?F():O=!1}}}var F;if(typeof j=="function")F=function(){j(U)};else if(typeof MessageChannel!="undefined"){var q=new MessageChannel,H=q.port2;q.port1.onmessage=U,F=function(){H.postMessage(null)}}else F=function(){C(U,0)};function Y($,X){z=C(function(){$(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function($){$.callback=null},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function($){switch(v){case 1:case 2:case 3:var X=3;break;default:X=v}var Z=v;v=X;try{return $()}finally{v=Z}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function($,X){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var Z=v;v=$;try{return X()}finally{v=Z}},e.unstable_scheduleCallback=function($,X,Z){var fe=e.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?fe+Z:fe):Z=fe,$){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=Z+D,$={id:g++,callback:X,priorityLevel:$,startTime:Z,expirationTime:D,sortIndex:-1},Z>fe?($.sortIndex=Z,t(m,$),a(h)===null&&$===a(m)&&(S?(R(z),z=-1):S=!0,Y(I,Z-fe))):($.sortIndex=D,t(h,$),_||b||(_=!0,O||(O=!0,F()))),$},e.unstable_shouldYield=M,e.unstable_wrapCallback=function($){var X=v;return function(){var Z=v;v=X;try{return $.apply(this,arguments)}finally{v=Z}}}})(zh)),zh}var db;function $N(){return db||(db=1,Oh.exports=PN()),Oh.exports}/**
18
+ * @license React
19
+ * react-dom-client.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var fb;function qN(){if(fb)return oo;fb=1;var e=$N(),t=fp(),a=jx();function s(n){var i="https://react.dev/errors/"+n;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+n+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function c(n){var i=n,l=n;if(n.alternate)for(;i.return;)i=i.return;else{n=i;do i=n,(i.flags&4098)!==0&&(l=i.return),n=i.return;while(n)}return i.tag===3?l:null}function o(n){if(n.tag===13){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function u(n){if(n.tag===31){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function h(n){if(c(n)!==n)throw Error(s(188))}function m(n){var i=n.alternate;if(!i){if(i=c(n),i===null)throw Error(s(188));return i!==n?null:n}for(var l=n,d=i;;){var y=l.return;if(y===null)break;var x=y.alternate;if(x===null){if(d=y.return,d!==null){l=d;continue}break}if(y.child===x.child){for(x=y.child;x;){if(x===l)return h(y),n;if(x===d)return h(y),i;x=x.sibling}throw Error(s(188))}if(l.return!==d.return)l=y,d=x;else{for(var N=!1,L=y.child;L;){if(L===l){N=!0,l=y,d=x;break}if(L===d){N=!0,d=y,l=x;break}L=L.sibling}if(!N){for(L=x.child;L;){if(L===l){N=!0,l=x,d=y;break}if(L===d){N=!0,d=x,l=y;break}L=L.sibling}if(!N)throw Error(s(189))}}if(l.alternate!==d)throw Error(s(190))}if(l.tag!==3)throw Error(s(188));return l.stateNode.current===l?n:i}function g(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n;for(n=n.child;n!==null;){if(i=g(n),i!==null)return i;n=n.sibling}return null}var p=Object.assign,v=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),j=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),M=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function F(n){return n===null||typeof n!="object"?null:(n=U&&n[U]||n["@@iterator"],typeof n=="function"?n:null)}var q=Symbol.for("react.client.reference");function H(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===q?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case S:return"Fragment";case C:return"Profiler";case w:return"StrictMode";case I:return"Suspense";case O:return"SuspenseList";case P:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case _:return"Portal";case j:return n.displayName||"Context";case R:return(n._context.displayName||"Context")+".Consumer";case k:var i=n.render;return n=n.displayName,n||(n=i.displayName||i.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case z:return i=n.displayName||null,i!==null?i:H(n.type)||"Memo";case B:i=n._payload,n=n._init;try{return H(n(i))}catch(l){}}return null}var Y=Array.isArray,$=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},fe=[],D=-1;function he(n){return{current:n}}function ge(n){0>D||(n.current=fe[D],fe[D]=null,D--)}function E(n,i){D++,fe[D]=n.current,n.current=i}var W=he(null),oe=he(null),me=he(null),_e=he(null);function be(n,i){switch(E(me,i),E(oe,n),E(W,null),i.nodeType){case 9:case 11:n=(n=i.documentElement)&&(n=n.namespaceURI)?E1(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=E1(i),n=R1(i,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}ge(W),E(W,n)}function Ae(){ge(W),ge(oe),ge(me)}function Ge(n){n.memoizedState!==null&&E(_e,n);var i=W.current,l=R1(i,n.type);i!==l&&(E(oe,n),E(W,l))}function ot(n){oe.current===n&&(ge(W),ge(oe)),_e.current===n&&(ge(_e),ao._currentValue=Z)}var qt,at;function Ie(n){if(qt===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);qt=i&&i[1]||"",at=-1<l.stack.indexOf(`
26
+ at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
27
+ `+qt+n+at}var qe=!1;function bt(n,i){if(!n||qe)return"";qe=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(i){var ue=function(){throw Error()};if(Object.defineProperty(ue.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ue,[])}catch(se){var ne=se}Reflect.construct(n,[],ue)}else{try{ue.call()}catch(se){ne=se}n.call(ue.prototype)}}else{try{throw Error()}catch(se){ne=se}(ue=n())&&typeof ue.catch=="function"&&ue.catch(function(){})}}catch(se){if(se&&ne&&typeof se.stack=="string")return[se.stack,ne.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=d.DetermineComponentFrameRoot(),N=x[0],L=x[1];if(N&&L){var V=N.split(`
28
+ `),te=L.split(`
29
+ `);for(y=d=0;d<V.length&&!V[d].includes("DetermineComponentFrameRoot");)d++;for(;y<te.length&&!te[y].includes("DetermineComponentFrameRoot");)y++;if(d===V.length||y===te.length)for(d=V.length-1,y=te.length-1;1<=d&&0<=y&&V[d]!==te[y];)y--;for(;1<=d&&0<=y;d--,y--)if(V[d]!==te[y]){if(d!==1||y!==1)do if(d--,y--,0>y||V[d]!==te[y]){var le=`
30
+ `+V[d].replace(" at new "," at ");return n.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",n.displayName)),le}while(1<=d&&0<=y);break}}}finally{qe=!1,Error.prepareStackTrace=l}return(l=n?n.displayName||n.name:"")?Ie(l):""}function ke(n,i){switch(n.tag){case 26:case 27:case 5:return Ie(n.type);case 16:return Ie("Lazy");case 13:return n.child!==i&&i!==null?Ie("Suspense Fallback"):Ie("Suspense");case 19:return Ie("SuspenseList");case 0:case 15:return bt(n.type,!1);case 11:return bt(n.type.render,!1);case 1:return bt(n.type,!0);case 31:return Ie("Activity");default:return""}}function ct(n){try{var i="",l=null;do i+=ke(n,l),l=n,n=n.return;while(n);return i}catch(d){return`
31
+ Error generating stack: `+d.message+`
32
+ `+d.stack}}var Fe=Object.prototype.hasOwnProperty,ma=e.unstable_scheduleCallback,pa=e.unstable_cancelCallback,Ta=e.unstable_shouldYield,ri=e.unstable_requestPaint,At=e.unstable_now,as=e.unstable_getCurrentPriorityLevel,re=e.unstable_ImmediatePriority,ve=e.unstable_UserBlockingPriority,Ee=e.unstable_NormalPriority,We=e.unstable_LowPriority,Re=e.unstable_IdlePriority,xt=e.log,Ct=e.unstable_setDisableYieldValue,Tt=null,Nt=null;function pt(n){if(typeof xt=="function"&&Ct(n),Nt&&typeof Nt.setStrictMode=="function")try{Nt.setStrictMode(Tt,n)}catch(i){}}var ut=Math.clz32?Math.clz32:Xo,ga=Math.log,nn=Math.LN2;function Xo(n){return n>>>=0,n===0?32:31-(ga(n)/nn|0)|0}var Zs=256,Js=262144,is=4194304;function on(n){var i=n&42;if(i!==0)return i;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Ma(n,i,l){var d=n.pendingLanes;if(d===0)return 0;var y=0,x=n.suspendedLanes,N=n.pingedLanes;n=n.warmLanes;var L=d&134217727;return L!==0?(d=L&~x,d!==0?y=on(d):(N&=L,N!==0?y=on(N):l||(l=L&~n,l!==0&&(y=on(l))))):(L=d&~x,L!==0?y=on(L):N!==0?y=on(N):l||(l=d&~n,l!==0&&(y=on(l)))),y===0?0:i!==0&&i!==y&&(i&x)===0&&(x=y&-y,l=i&-i,x>=l||x===32&&(l&4194048)!==0)?i:y}function Bn(n,i){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&i)===0}function Ws(n,i){switch(n){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function er(){var n=is;return is<<=1,(is&62914560)===0&&(is=4194304),n}function pl(n){for(var i=[],l=0;31>l;l++)i.push(n);return i}function ss(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function _d(n,i,l,d,y,x){var N=n.pendingLanes;n.pendingLanes=l,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=l,n.entangledLanes&=l,n.errorRecoveryDisabledLanes&=l,n.shellSuspendCounter=0;var L=n.entanglements,V=n.expirationTimes,te=n.hiddenUpdates;for(l=N&~l;0<l;){var le=31-ut(l),ue=1<<le;L[le]=0,V[le]=-1;var ne=te[le];if(ne!==null)for(te[le]=null,le=0;le<ne.length;le++){var se=ne[le];se!==null&&(se.lane&=-536870913)}l&=~ue}d!==0&&gl(n,d,0),x!==0&&y===0&&n.tag!==0&&(n.suspendedLanes|=x&~(N&~i))}function gl(n,i,l){n.pendingLanes|=i,n.suspendedLanes&=~i;var d=31-ut(i);n.entangledLanes|=i,n.entanglements[d]=n.entanglements[d]|1073741824|l&261930}function yl(n,i){var l=n.entangledLanes|=i;for(n=n.entanglements;l;){var d=31-ut(l),y=1<<d;y&i|n[d]&i&&(n[d]|=i),l&=~y}}function li(n,i){var l=i&-i;return l=(l&42)!==0?1:tr(l),(l&(n.suspendedLanes|i))!==0?0:l}function tr(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function vl(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Qo(){var n=X.p;return n!==0?n:(n=window.event,n===void 0?32:J1(n.type))}function oi(n,i){var l=X.p;try{return X.p=n,i()}finally{X.p=l}}var ia=Math.random().toString(36).slice(2),ae="__reactFiber$"+ia,xe="__reactProps$"+ia,Te="__reactContainer$"+ia,He="__reactEvents$"+ia,zt="__reactListeners$"+ia,ya="__reactHandles$"+ia,Aa="__reactResources$"+ia,cn="__reactMarker$"+ia;function sa(n){delete n[ae],delete n[xe],delete n[He],delete n[zt],delete n[ya]}function ci(n){var i=n[ae];if(i)return i;for(var l=n.parentNode;l;){if(i=l[Te]||l[ae]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(n=z1(n);n!==null;){if(l=n[ae])return l;n=z1(n)}return i}n=l,l=n.parentNode}return null}function nr(n){if(n=n[ae]||n[Te]){var i=n.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return n}return null}function bl(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n.stateNode;throw Error(s(33))}function ar(n){var i=n[Aa];return i||(i=n[Aa]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Kt(n){n[cn]=!0}var gg=new Set,yg={};function rs(n,i){ir(n,i),ir(n+"Capture",i)}function ir(n,i){for(yg[n]=i,n=0;n<i.length;n++)gg.add(i[n])}var jw=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),vg={},bg={};function kw(n){return Fe.call(bg,n)?!0:Fe.call(vg,n)?!1:jw.test(n)?bg[n]=!0:(vg[n]=!0,!1)}function Zo(n,i,l){if(kw(i))if(l===null)n.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":n.removeAttribute(i);return;case"boolean":var d=i.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){n.removeAttribute(i);return}}n.setAttribute(i,""+l)}}function Jo(n,i,l){if(l===null)n.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttribute(i,""+l)}}function La(n,i,l,d){if(d===null)n.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(l);return}n.setAttributeNS(i,l,""+d)}}function Fn(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function xg(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Ew(n,i,l){var d=Object.getOwnPropertyDescriptor(n.constructor.prototype,i);if(!n.hasOwnProperty(i)&&typeof d!="undefined"&&typeof d.get=="function"&&typeof d.set=="function"){var y=d.get,x=d.set;return Object.defineProperty(n,i,{configurable:!0,get:function(){return y.call(this)},set:function(N){l=""+N,x.call(this,N)}}),Object.defineProperty(n,i,{enumerable:d.enumerable}),{getValue:function(){return l},setValue:function(N){l=""+N},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function Sd(n){if(!n._valueTracker){var i=xg(n)?"checked":"value";n._valueTracker=Ew(n,i,""+n[i])}}function _g(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var l=i.getValue(),d="";return n&&(d=xg(n)?n.checked?"true":"false":n.value),n=d,n!==l?(i.setValue(n),!0):!1}function Wo(n){if(n=n||(typeof document!="undefined"?document:void 0),typeof n=="undefined")return null;try{return n.activeElement||n.body}catch(i){return n.body}}var Rw=/[\n"\\]/g;function Hn(n){return n.replace(Rw,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function wd(n,i,l,d,y,x,N,L){n.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?n.type=N:n.removeAttribute("type"),i!=null?N==="number"?(i===0&&n.value===""||n.value!=i)&&(n.value=""+Fn(i)):n.value!==""+Fn(i)&&(n.value=""+Fn(i)):N!=="submit"&&N!=="reset"||n.removeAttribute("value"),i!=null?Cd(n,N,Fn(i)):l!=null?Cd(n,N,Fn(l)):d!=null&&n.removeAttribute("value"),y==null&&x!=null&&(n.defaultChecked=!!x),y!=null&&(n.checked=y&&typeof y!="function"&&typeof y!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?n.name=""+Fn(L):n.removeAttribute("name")}function Sg(n,i,l,d,y,x,N,L){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(n.type=x),i!=null||l!=null){if(!(x!=="submit"&&x!=="reset"||i!=null)){Sd(n);return}l=l!=null?""+Fn(l):"",i=i!=null?""+Fn(i):l,L||i===n.value||(n.value=i),n.defaultValue=i}d=d!=null?d:y,d=typeof d!="function"&&typeof d!="symbol"&&!!d,n.checked=L?n.checked:!!d,n.defaultChecked=!!d,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(n.name=N),Sd(n)}function Cd(n,i,l){i==="number"&&Wo(n.ownerDocument)===n||n.defaultValue===""+l||(n.defaultValue=""+l)}function sr(n,i,l,d){if(n=n.options,i){i={};for(var y=0;y<l.length;y++)i["$"+l[y]]=!0;for(l=0;l<n.length;l++)y=i.hasOwnProperty("$"+n[l].value),n[l].selected!==y&&(n[l].selected=y),y&&d&&(n[l].defaultSelected=!0)}else{for(l=""+Fn(l),i=null,y=0;y<n.length;y++){if(n[y].value===l){n[y].selected=!0,d&&(n[y].defaultSelected=!0);return}i!==null||n[y].disabled||(i=n[y])}i!==null&&(i.selected=!0)}}function wg(n,i,l){if(i!=null&&(i=""+Fn(i),i!==n.value&&(n.value=i),l==null)){n.defaultValue!==i&&(n.defaultValue=i);return}n.defaultValue=l!=null?""+Fn(l):""}function Cg(n,i,l,d){if(i==null){if(d!=null){if(l!=null)throw Error(s(92));if(Y(d)){if(1<d.length)throw Error(s(93));d=d[0]}l=d}l==null&&(l=""),i=l}l=Fn(i),n.defaultValue=l,d=n.textContent,d===l&&d!==""&&d!==null&&(n.value=d),Sd(n)}function rr(n,i){if(i){var l=n.firstChild;if(l&&l===n.lastChild&&l.nodeType===3){l.nodeValue=i;return}}n.textContent=i}var Tw=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Ng(n,i,l){var d=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?d?n.setProperty(i,""):i==="float"?n.cssFloat="":n[i]="":d?n.setProperty(i,l):typeof l!="number"||l===0||Tw.has(i)?i==="float"?n.cssFloat=l:n[i]=(""+l).trim():n[i]=l+"px"}function jg(n,i,l){if(i!=null&&typeof i!="object")throw Error(s(62));if(n=n.style,l!=null){for(var d in l)!l.hasOwnProperty(d)||i!=null&&i.hasOwnProperty(d)||(d.indexOf("--")===0?n.setProperty(d,""):d==="float"?n.cssFloat="":n[d]="");for(var y in i)d=i[y],i.hasOwnProperty(y)&&l[y]!==d&&Ng(n,y,d)}else for(var x in i)i.hasOwnProperty(x)&&Ng(n,x,i[x])}function Nd(n){if(n.indexOf("-")===-1)return!1;switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Mw=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Aw=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function ec(n){return Aw.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function Da(){}var jd=null;function kd(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var lr=null,or=null;function kg(n){var i=nr(n);if(i&&(n=i.stateNode)){var l=n[xe]||null;e:switch(n=i.stateNode,i.type){case"input":if(wd(n,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),i=l.name,l.type==="radio"&&i!=null){for(l=n;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Hn(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var d=l[i];if(d!==n&&d.form===n.form){var y=d[xe]||null;if(!y)throw Error(s(90));wd(d,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(i=0;i<l.length;i++)d=l[i],d.form===n.form&&_g(d)}break e;case"textarea":wg(n,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&sr(n,!!l.multiple,i,!1)}}}var Ed=!1;function Eg(n,i,l){if(Ed)return n(i,l);Ed=!0;try{var d=n(i);return d}finally{if(Ed=!1,(lr!==null||or!==null)&&(Hc(),lr&&(i=lr,n=or,or=lr=null,kg(i),n)))for(i=0;i<n.length;i++)kg(n[i])}}function xl(n,i){var l=n.stateNode;if(l===null)return null;var d=l[xe]||null;if(d===null)return null;l=d[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(n=n.type,d=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!d;break e;default:n=!1}if(n)return null;if(l&&typeof l!="function")throw Error(s(231,i,typeof l));return l}var Oa=!(typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"),Rd=!1;if(Oa)try{var _l={};Object.defineProperty(_l,"passive",{get:function(){Rd=!0}}),window.addEventListener("test",_l,_l),window.removeEventListener("test",_l,_l)}catch(n){Rd=!1}var ui=null,Td=null,tc=null;function Rg(){if(tc)return tc;var n,i=Td,l=i.length,d,y="value"in ui?ui.value:ui.textContent,x=y.length;for(n=0;n<l&&i[n]===y[n];n++);var N=l-n;for(d=1;d<=N&&i[l-d]===y[x-d];d++);return tc=y.slice(n,1<d?1-d:void 0)}function nc(n){var i=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&i===13&&(n=13)):n=i,n===10&&(n=13),32<=n||n===13?n:0}function ac(){return!0}function Tg(){return!1}function mn(n){function i(l,d,y,x,N){this._reactName=l,this._targetInst=y,this.type=d,this.nativeEvent=x,this.target=N,this.currentTarget=null;for(var L in n)n.hasOwnProperty(L)&&(l=n[L],this[L]=l?l(x):x[L]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?ac:Tg,this.isPropagationStopped=Tg,this}return p(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=ac)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=ac)},persist:function(){},isPersistent:ac}),i}var ls={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ic=mn(ls),Sl=p({},ls,{view:0,detail:0}),Lw=mn(Sl),Md,Ad,wl,sc=p({},Sl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dd,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==wl&&(wl&&n.type==="mousemove"?(Md=n.screenX-wl.screenX,Ad=n.screenY-wl.screenY):Ad=Md=0,wl=n),Md)},movementY:function(n){return"movementY"in n?n.movementY:Ad}}),Mg=mn(sc),Dw=p({},sc,{dataTransfer:0}),Ow=mn(Dw),zw=p({},Sl,{relatedTarget:0}),Ld=mn(zw),Iw=p({},ls,{animationName:0,elapsedTime:0,pseudoElement:0}),Uw=mn(Iw),Bw=p({},ls,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),Fw=mn(Bw),Hw=p({},ls,{data:0}),Ag=mn(Hw),Pw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$w={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},qw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Vw(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=qw[n])?!!i[n]:!1}function Dd(){return Vw}var Yw=p({},Sl,{key:function(n){if(n.key){var i=Pw[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=nc(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?$w[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dd,charCode:function(n){return n.type==="keypress"?nc(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?nc(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),Gw=mn(Yw),Kw=p({},sc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Lg=mn(Kw),Xw=p({},Sl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dd}),Qw=mn(Xw),Zw=p({},ls,{propertyName:0,elapsedTime:0,pseudoElement:0}),Jw=mn(Zw),Ww=p({},sc,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),eC=mn(Ww),tC=p({},ls,{newState:0,oldState:0}),nC=mn(tC),aC=[9,13,27,32],Od=Oa&&"CompositionEvent"in window,Cl=null;Oa&&"documentMode"in document&&(Cl=document.documentMode);var iC=Oa&&"TextEvent"in window&&!Cl,Dg=Oa&&(!Od||Cl&&8<Cl&&11>=Cl),Og=" ",zg=!1;function Ig(n,i){switch(n){case"keyup":return aC.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ug(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var cr=!1;function sC(n,i){switch(n){case"compositionend":return Ug(i);case"keypress":return i.which!==32?null:(zg=!0,Og);case"textInput":return n=i.data,n===Og&&zg?null:n;default:return null}}function rC(n,i){if(cr)return n==="compositionend"||!Od&&Ig(n,i)?(n=Rg(),tc=Td=ui=null,cr=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Dg&&i.locale!=="ko"?null:i.data;default:return null}}var lC={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Bg(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!lC[n.type]:i==="textarea"}function Fg(n,i,l,d){lr?or?or.push(d):or=[d]:lr=d,i=Kc(i,"onChange"),0<i.length&&(l=new ic("onChange","change",null,l,d),n.push({event:l,listeners:i}))}var Nl=null,jl=null;function oC(n){S1(n,0)}function rc(n){var i=bl(n);if(_g(i))return n}function Hg(n,i){if(n==="change")return i}var Pg=!1;if(Oa){var zd;if(Oa){var Id="oninput"in document;if(!Id){var $g=document.createElement("div");$g.setAttribute("oninput","return;"),Id=typeof $g.oninput=="function"}zd=Id}else zd=!1;Pg=zd&&(!document.documentMode||9<document.documentMode)}function qg(){Nl&&(Nl.detachEvent("onpropertychange",Vg),jl=Nl=null)}function Vg(n){if(n.propertyName==="value"&&rc(jl)){var i=[];Fg(i,jl,n,kd(n)),Eg(oC,i)}}function cC(n,i,l){n==="focusin"?(qg(),Nl=i,jl=l,Nl.attachEvent("onpropertychange",Vg)):n==="focusout"&&qg()}function uC(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return rc(jl)}function dC(n,i){if(n==="click")return rc(i)}function fC(n,i){if(n==="input"||n==="change")return rc(i)}function hC(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var kn=typeof Object.is=="function"?Object.is:hC;function kl(n,i){if(kn(n,i))return!0;if(typeof n!="object"||n===null||typeof i!="object"||i===null)return!1;var l=Object.keys(n),d=Object.keys(i);if(l.length!==d.length)return!1;for(d=0;d<l.length;d++){var y=l[d];if(!Fe.call(i,y)||!kn(n[y],i[y]))return!1}return!0}function Yg(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Gg(n,i){var l=Yg(n);n=0;for(var d;l;){if(l.nodeType===3){if(d=n+l.textContent.length,n<=i&&d>=i)return{node:l,offset:i-n};n=d}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Yg(l)}}function Kg(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?Kg(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function Xg(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var i=Wo(n.document);i instanceof n.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch(d){l=!1}if(l)n=i.contentWindow;else break;i=Wo(n.document)}return i}function Ud(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i&&(i==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||i==="textarea"||n.contentEditable==="true")}var mC=Oa&&"documentMode"in document&&11>=document.documentMode,ur=null,Bd=null,El=null,Fd=!1;function Qg(n,i,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Fd||ur==null||ur!==Wo(d)||(d=ur,"selectionStart"in d&&Ud(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),El&&kl(El,d)||(El=d,d=Kc(Bd,"onSelect"),0<d.length&&(i=new ic("onSelect","select",null,i,l),n.push({event:i,listeners:d}),i.target=ur)))}function os(n,i){var l={};return l[n.toLowerCase()]=i.toLowerCase(),l["Webkit"+n]="webkit"+i,l["Moz"+n]="moz"+i,l}var dr={animationend:os("Animation","AnimationEnd"),animationiteration:os("Animation","AnimationIteration"),animationstart:os("Animation","AnimationStart"),transitionrun:os("Transition","TransitionRun"),transitionstart:os("Transition","TransitionStart"),transitioncancel:os("Transition","TransitionCancel"),transitionend:os("Transition","TransitionEnd")},Hd={},Zg={};Oa&&(Zg=document.createElement("div").style,"AnimationEvent"in window||(delete dr.animationend.animation,delete dr.animationiteration.animation,delete dr.animationstart.animation),"TransitionEvent"in window||delete dr.transitionend.transition);function cs(n){if(Hd[n])return Hd[n];if(!dr[n])return n;var i=dr[n],l;for(l in i)if(i.hasOwnProperty(l)&&l in Zg)return Hd[n]=i[l];return n}var Jg=cs("animationend"),Wg=cs("animationiteration"),ey=cs("animationstart"),pC=cs("transitionrun"),gC=cs("transitionstart"),yC=cs("transitioncancel"),ty=cs("transitionend"),ny=new Map,Pd="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Pd.push("scrollEnd");function ra(n,i){ny.set(n,i),rs(i,[n])}var lc=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Pn=[],fr=0,$d=0;function oc(){for(var n=fr,i=$d=fr=0;i<n;){var l=Pn[i];Pn[i++]=null;var d=Pn[i];Pn[i++]=null;var y=Pn[i];Pn[i++]=null;var x=Pn[i];if(Pn[i++]=null,d!==null&&y!==null){var N=d.pending;N===null?y.next=y:(y.next=N.next,N.next=y),d.pending=y}x!==0&&ay(l,y,x)}}function cc(n,i,l,d){Pn[fr++]=n,Pn[fr++]=i,Pn[fr++]=l,Pn[fr++]=d,$d|=d,n.lanes|=d,n=n.alternate,n!==null&&(n.lanes|=d)}function qd(n,i,l,d){return cc(n,i,l,d),uc(n)}function us(n,i){return cc(n,null,null,i),uc(n)}function ay(n,i,l){n.lanes|=l;var d=n.alternate;d!==null&&(d.lanes|=l);for(var y=!1,x=n.return;x!==null;)x.childLanes|=l,d=x.alternate,d!==null&&(d.childLanes|=l),x.tag===22&&(n=x.stateNode,n===null||n._visibility&1||(y=!0)),n=x,x=x.return;return n.tag===3?(x=n.stateNode,y&&i!==null&&(y=31-ut(l),n=x.hiddenUpdates,d=n[y],d===null?n[y]=[i]:d.push(i),i.lane=l|536870912),x):null}function uc(n){if(50<Ql)throw Ql=0,eh=null,Error(s(185));for(var i=n.return;i!==null;)n=i,i=n.return;return n.tag===3?n.stateNode:null}var hr={};function vC(n,i,l,d){this.tag=n,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function En(n,i,l,d){return new vC(n,i,l,d)}function Vd(n){return n=n.prototype,!(!n||!n.isReactComponent)}function za(n,i){var l=n.alternate;return l===null?(l=En(n.tag,i,n.key,n.mode),l.elementType=n.elementType,l.type=n.type,l.stateNode=n.stateNode,l.alternate=n,n.alternate=l):(l.pendingProps=i,l.type=n.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=n.flags&65011712,l.childLanes=n.childLanes,l.lanes=n.lanes,l.child=n.child,l.memoizedProps=n.memoizedProps,l.memoizedState=n.memoizedState,l.updateQueue=n.updateQueue,i=n.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=n.sibling,l.index=n.index,l.ref=n.ref,l.refCleanup=n.refCleanup,l}function iy(n,i){n.flags&=65011714;var l=n.alternate;return l===null?(n.childLanes=0,n.lanes=i,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=l.childLanes,n.lanes=l.lanes,n.child=l.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=l.memoizedProps,n.memoizedState=l.memoizedState,n.updateQueue=l.updateQueue,n.type=l.type,i=l.dependencies,n.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),n}function dc(n,i,l,d,y,x){var N=0;if(d=n,typeof n=="function")Vd(n)&&(N=1);else if(typeof n=="string")N=wN(n,l,W.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case P:return n=En(31,l,i,y),n.elementType=P,n.lanes=x,n;case S:return ds(l.children,y,x,i);case w:N=8,y|=24;break;case C:return n=En(12,l,i,y|2),n.elementType=C,n.lanes=x,n;case I:return n=En(13,l,i,y),n.elementType=I,n.lanes=x,n;case O:return n=En(19,l,i,y),n.elementType=O,n.lanes=x,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case j:N=10;break e;case R:N=9;break e;case k:N=11;break e;case z:N=14;break e;case B:N=16,d=null;break e}N=29,l=Error(s(130,n===null?"null":typeof n,"")),d=null}return i=En(N,l,i,y),i.elementType=n,i.type=d,i.lanes=x,i}function ds(n,i,l,d){return n=En(7,n,d,i),n.lanes=l,n}function Yd(n,i,l){return n=En(6,n,null,i),n.lanes=l,n}function sy(n){var i=En(18,null,null,0);return i.stateNode=n,i}function Gd(n,i,l){return i=En(4,n.children!==null?n.children:[],n.key,i),i.lanes=l,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}var ry=new WeakMap;function $n(n,i){if(typeof n=="object"&&n!==null){var l=ry.get(n);return l!==void 0?l:(i={value:n,source:i,stack:ct(i)},ry.set(n,i),i)}return{value:n,source:i,stack:ct(i)}}var mr=[],pr=0,fc=null,Rl=0,qn=[],Vn=0,di=null,va=1,ba="";function Ia(n,i){mr[pr++]=Rl,mr[pr++]=fc,fc=n,Rl=i}function ly(n,i,l){qn[Vn++]=va,qn[Vn++]=ba,qn[Vn++]=di,di=n;var d=va;n=ba;var y=32-ut(d)-1;d&=~(1<<y),l+=1;var x=32-ut(i)+y;if(30<x){var N=y-y%5;x=(d&(1<<N)-1).toString(32),d>>=N,y-=N,va=1<<32-ut(i)+y|l<<y|d,ba=x+n}else va=1<<x|l<<y|d,ba=n}function Kd(n){n.return!==null&&(Ia(n,1),ly(n,1,0))}function Xd(n){for(;n===fc;)fc=mr[--pr],mr[pr]=null,Rl=mr[--pr],mr[pr]=null;for(;n===di;)di=qn[--Vn],qn[Vn]=null,ba=qn[--Vn],qn[Vn]=null,va=qn[--Vn],qn[Vn]=null}function oy(n,i){qn[Vn++]=va,qn[Vn++]=ba,qn[Vn++]=di,va=i.id,ba=i.overflow,di=n}var Jt=null,kt=null,et=!1,fi=null,Yn=!1,Qd=Error(s(519));function hi(n){var i=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Tl($n(i,n)),Qd}function cy(n){var i=n.stateNode,l=n.type,d=n.memoizedProps;switch(i[ae]=n,i[xe]=d,l){case"dialog":Xe("cancel",i),Xe("close",i);break;case"iframe":case"object":case"embed":Xe("load",i);break;case"video":case"audio":for(l=0;l<Jl.length;l++)Xe(Jl[l],i);break;case"source":Xe("error",i);break;case"img":case"image":case"link":Xe("error",i),Xe("load",i);break;case"details":Xe("toggle",i);break;case"input":Xe("invalid",i),Sg(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Xe("invalid",i);break;case"textarea":Xe("invalid",i),Cg(i,d.value,d.defaultValue,d.children)}l=d.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||i.textContent===""+l||d.suppressHydrationWarning===!0||j1(i.textContent,l)?(d.popover!=null&&(Xe("beforetoggle",i),Xe("toggle",i)),d.onScroll!=null&&Xe("scroll",i),d.onScrollEnd!=null&&Xe("scrollend",i),d.onClick!=null&&(i.onclick=Da),i=!0):i=!1,i||hi(n,!0)}function uy(n){for(Jt=n.return;Jt;)switch(Jt.tag){case 5:case 31:case 13:Yn=!1;return;case 27:case 3:Yn=!0;return;default:Jt=Jt.return}}function gr(n){if(n!==Jt)return!1;if(!et)return uy(n),et=!0,!1;var i=n.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=n.type,l=!(l!=="form"&&l!=="button")||ph(n.type,n.memoizedProps)),l=!l),l&&kt&&hi(n),uy(n),i===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(317));kt=O1(n)}else if(i===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(317));kt=O1(n)}else i===27?(i=kt,ki(n.type)?(n=xh,xh=null,kt=n):kt=i):kt=Jt?Kn(n.stateNode.nextSibling):null;return!0}function fs(){kt=Jt=null,et=!1}function Zd(){var n=fi;return n!==null&&(vn===null?vn=n:vn.push.apply(vn,n),fi=null),n}function Tl(n){fi===null?fi=[n]:fi.push(n)}var Jd=he(null),hs=null,Ua=null;function mi(n,i,l){E(Jd,i._currentValue),i._currentValue=l}function Ba(n){n._currentValue=Jd.current,ge(Jd)}function Wd(n,i,l){for(;n!==null;){var d=n.alternate;if((n.childLanes&i)!==i?(n.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),n===l)break;n=n.return}}function ef(n,i,l,d){var y=n.child;for(y!==null&&(y.return=n);y!==null;){var x=y.dependencies;if(x!==null){var N=y.child;x=x.firstContext;e:for(;x!==null;){var L=x;x=y;for(var V=0;V<i.length;V++)if(L.context===i[V]){x.lanes|=l,L=x.alternate,L!==null&&(L.lanes|=l),Wd(x.return,l,n),d||(N=null);break e}x=L.next}}else if(y.tag===18){if(N=y.return,N===null)throw Error(s(341));N.lanes|=l,x=N.alternate,x!==null&&(x.lanes|=l),Wd(N,l,n),N=null}else N=y.child;if(N!==null)N.return=y;else for(N=y;N!==null;){if(N===n){N=null;break}if(y=N.sibling,y!==null){y.return=N.return,N=y;break}N=N.return}y=N}}function yr(n,i,l,d){n=null;for(var y=i,x=!1;y!==null;){if(!x){if((y.flags&524288)!==0)x=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var N=y.alternate;if(N===null)throw Error(s(387));if(N=N.memoizedProps,N!==null){var L=y.type;kn(y.pendingProps.value,N.value)||(n!==null?n.push(L):n=[L])}}else if(y===_e.current){if(N=y.alternate,N===null)throw Error(s(387));N.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(n!==null?n.push(ao):n=[ao])}y=y.return}n!==null&&ef(i,n,l,d),i.flags|=262144}function hc(n){for(n=n.firstContext;n!==null;){if(!kn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function ms(n){hs=n,Ua=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Wt(n){return dy(hs,n)}function mc(n,i){return hs===null&&ms(n),dy(n,i)}function dy(n,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},Ua===null){if(n===null)throw Error(s(308));Ua=i,n.dependencies={lanes:0,firstContext:i},n.flags|=524288}else Ua=Ua.next=i;return l}var bC=typeof AbortController!="undefined"?AbortController:function(){var n=[],i=this.signal={aborted:!1,addEventListener:function(l,d){n.push(d)}};this.abort=function(){i.aborted=!0,n.forEach(function(l){return l()})}},xC=e.unstable_scheduleCallback,_C=e.unstable_NormalPriority,Bt={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function tf(){return{controller:new bC,data:new Map,refCount:0}}function Ml(n){n.refCount--,n.refCount===0&&xC(_C,function(){n.controller.abort()})}var Al=null,nf=0,vr=0,br=null;function SC(n,i){if(Al===null){var l=Al=[];nf=0,vr=rh(),br={status:"pending",value:void 0,then:function(d){l.push(d)}}}return nf++,i.then(fy,fy),i}function fy(){if(--nf===0&&Al!==null){br!==null&&(br.status="fulfilled");var n=Al;Al=null,vr=0,br=null;for(var i=0;i<n.length;i++)(0,n[i])()}}function wC(n,i){var l=[],d={status:"pending",value:null,reason:null,then:function(y){l.push(y)}};return n.then(function(){d.status="fulfilled",d.value=i;for(var y=0;y<l.length;y++)(0,l[y])(i)},function(y){for(d.status="rejected",d.reason=y,y=0;y<l.length;y++)(0,l[y])(void 0)}),d}var hy=$.S;$.S=function(n,i){Qv=At(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&SC(n,i),hy!==null&&hy(n,i)};var ps=he(null);function af(){var n=ps.current;return n!==null?n:_t.pooledCache}function pc(n,i){i===null?E(ps,ps.current):E(ps,i.pool)}function my(){var n=af();return n===null?null:{parent:Bt._currentValue,pool:n}}var xr=Error(s(460)),sf=Error(s(474)),gc=Error(s(542)),yc={then:function(){}};function py(n){return n=n.status,n==="fulfilled"||n==="rejected"}function gy(n,i,l){switch(l=n[l],l===void 0?n.push(i):l!==i&&(i.then(Da,Da),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,vy(n),n;default:if(typeof i.status=="string")i.then(Da,Da);else{if(n=_t,n!==null&&100<n.shellSuspendCounter)throw Error(s(482));n=i,n.status="pending",n.then(function(d){if(i.status==="pending"){var y=i;y.status="fulfilled",y.value=d}},function(d){if(i.status==="pending"){var y=i;y.status="rejected",y.reason=d}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,vy(n),n}throw ys=i,xr}}function gs(n){try{var i=n._init;return i(n._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(ys=l,xr):l}}var ys=null;function yy(){if(ys===null)throw Error(s(459));var n=ys;return ys=null,n}function vy(n){if(n===xr||n===gc)throw Error(s(483))}var _r=null,Ll=0;function vc(n){var i=Ll;return Ll+=1,_r===null&&(_r=[]),gy(_r,n,i)}function Dl(n,i){i=i.props.ref,n.ref=i!==void 0?i:null}function bc(n,i){throw i.$$typeof===v?Error(s(525)):(n=Object.prototype.toString.call(i),Error(s(31,n==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":n)))}function by(n){function i(J,Q){if(n){var ee=J.deletions;ee===null?(J.deletions=[Q],J.flags|=16):ee.push(Q)}}function l(J,Q){if(!n)return null;for(;Q!==null;)i(J,Q),Q=Q.sibling;return null}function d(J){for(var Q=new Map;J!==null;)J.key!==null?Q.set(J.key,J):Q.set(J.index,J),J=J.sibling;return Q}function y(J,Q){return J=za(J,Q),J.index=0,J.sibling=null,J}function x(J,Q,ee){return J.index=ee,n?(ee=J.alternate,ee!==null?(ee=ee.index,ee<Q?(J.flags|=67108866,Q):ee):(J.flags|=67108866,Q)):(J.flags|=1048576,Q)}function N(J){return n&&J.alternate===null&&(J.flags|=67108866),J}function L(J,Q,ee,ce){return Q===null||Q.tag!==6?(Q=Yd(ee,J.mode,ce),Q.return=J,Q):(Q=y(Q,ee),Q.return=J,Q)}function V(J,Q,ee,ce){var Le=ee.type;return Le===S?le(J,Q,ee.props.children,ce,ee.key):Q!==null&&(Q.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===B&&gs(Le)===Q.type)?(Q=y(Q,ee.props),Dl(Q,ee),Q.return=J,Q):(Q=dc(ee.type,ee.key,ee.props,null,J.mode,ce),Dl(Q,ee),Q.return=J,Q)}function te(J,Q,ee,ce){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==ee.containerInfo||Q.stateNode.implementation!==ee.implementation?(Q=Gd(ee,J.mode,ce),Q.return=J,Q):(Q=y(Q,ee.children||[]),Q.return=J,Q)}function le(J,Q,ee,ce,Le){return Q===null||Q.tag!==7?(Q=ds(ee,J.mode,ce,Le),Q.return=J,Q):(Q=y(Q,ee),Q.return=J,Q)}function ue(J,Q,ee){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Q=Yd(""+Q,J.mode,ee),Q.return=J,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case b:return ee=dc(Q.type,Q.key,Q.props,null,J.mode,ee),Dl(ee,Q),ee.return=J,ee;case _:return Q=Gd(Q,J.mode,ee),Q.return=J,Q;case B:return Q=gs(Q),ue(J,Q,ee)}if(Y(Q)||F(Q))return Q=ds(Q,J.mode,ee,null),Q.return=J,Q;if(typeof Q.then=="function")return ue(J,vc(Q),ee);if(Q.$$typeof===j)return ue(J,mc(J,Q),ee);bc(J,Q)}return null}function ne(J,Q,ee,ce){var Le=Q!==null?Q.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return Le!==null?null:L(J,Q,""+ee,ce);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:return ee.key===Le?V(J,Q,ee,ce):null;case _:return ee.key===Le?te(J,Q,ee,ce):null;case B:return ee=gs(ee),ne(J,Q,ee,ce)}if(Y(ee)||F(ee))return Le!==null?null:le(J,Q,ee,ce,null);if(typeof ee.then=="function")return ne(J,Q,vc(ee),ce);if(ee.$$typeof===j)return ne(J,Q,mc(J,ee),ce);bc(J,ee)}return null}function se(J,Q,ee,ce,Le){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return J=J.get(ee)||null,L(Q,J,""+ce,Le);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case b:return J=J.get(ce.key===null?ee:ce.key)||null,V(Q,J,ce,Le);case _:return J=J.get(ce.key===null?ee:ce.key)||null,te(Q,J,ce,Le);case B:return ce=gs(ce),se(J,Q,ee,ce,Le)}if(Y(ce)||F(ce))return J=J.get(ee)||null,le(Q,J,ce,Le,null);if(typeof ce.then=="function")return se(J,Q,ee,vc(ce),Le);if(ce.$$typeof===j)return se(J,Q,ee,mc(Q,ce),Le);bc(Q,ce)}return null}function we(J,Q,ee,ce){for(var Le=null,it=null,Ne=Q,$e=Q=0,Je=null;Ne!==null&&$e<ee.length;$e++){Ne.index>$e?(Je=Ne,Ne=null):Je=Ne.sibling;var st=ne(J,Ne,ee[$e],ce);if(st===null){Ne===null&&(Ne=Je);break}n&&Ne&&st.alternate===null&&i(J,Ne),Q=x(st,Q,$e),it===null?Le=st:it.sibling=st,it=st,Ne=Je}if($e===ee.length)return l(J,Ne),et&&Ia(J,$e),Le;if(Ne===null){for(;$e<ee.length;$e++)Ne=ue(J,ee[$e],ce),Ne!==null&&(Q=x(Ne,Q,$e),it===null?Le=Ne:it.sibling=Ne,it=Ne);return et&&Ia(J,$e),Le}for(Ne=d(Ne);$e<ee.length;$e++)Je=se(Ne,J,$e,ee[$e],ce),Je!==null&&(n&&Je.alternate!==null&&Ne.delete(Je.key===null?$e:Je.key),Q=x(Je,Q,$e),it===null?Le=Je:it.sibling=Je,it=Je);return n&&Ne.forEach(function(Ai){return i(J,Ai)}),et&&Ia(J,$e),Le}function ze(J,Q,ee,ce){if(ee==null)throw Error(s(151));for(var Le=null,it=null,Ne=Q,$e=Q=0,Je=null,st=ee.next();Ne!==null&&!st.done;$e++,st=ee.next()){Ne.index>$e?(Je=Ne,Ne=null):Je=Ne.sibling;var Ai=ne(J,Ne,st.value,ce);if(Ai===null){Ne===null&&(Ne=Je);break}n&&Ne&&Ai.alternate===null&&i(J,Ne),Q=x(Ai,Q,$e),it===null?Le=Ai:it.sibling=Ai,it=Ai,Ne=Je}if(st.done)return l(J,Ne),et&&Ia(J,$e),Le;if(Ne===null){for(;!st.done;$e++,st=ee.next())st=ue(J,st.value,ce),st!==null&&(Q=x(st,Q,$e),it===null?Le=st:it.sibling=st,it=st);return et&&Ia(J,$e),Le}for(Ne=d(Ne);!st.done;$e++,st=ee.next())st=se(Ne,J,$e,st.value,ce),st!==null&&(n&&st.alternate!==null&&Ne.delete(st.key===null?$e:st.key),Q=x(st,Q,$e),it===null?Le=st:it.sibling=st,it=st);return n&&Ne.forEach(function(DN){return i(J,DN)}),et&&Ia(J,$e),Le}function vt(J,Q,ee,ce){if(typeof ee=="object"&&ee!==null&&ee.type===S&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:e:{for(var Le=ee.key;Q!==null;){if(Q.key===Le){if(Le=ee.type,Le===S){if(Q.tag===7){l(J,Q.sibling),ce=y(Q,ee.props.children),ce.return=J,J=ce;break e}}else if(Q.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===B&&gs(Le)===Q.type){l(J,Q.sibling),ce=y(Q,ee.props),Dl(ce,ee),ce.return=J,J=ce;break e}l(J,Q);break}else i(J,Q);Q=Q.sibling}ee.type===S?(ce=ds(ee.props.children,J.mode,ce,ee.key),ce.return=J,J=ce):(ce=dc(ee.type,ee.key,ee.props,null,J.mode,ce),Dl(ce,ee),ce.return=J,J=ce)}return N(J);case _:e:{for(Le=ee.key;Q!==null;){if(Q.key===Le)if(Q.tag===4&&Q.stateNode.containerInfo===ee.containerInfo&&Q.stateNode.implementation===ee.implementation){l(J,Q.sibling),ce=y(Q,ee.children||[]),ce.return=J,J=ce;break e}else{l(J,Q);break}else i(J,Q);Q=Q.sibling}ce=Gd(ee,J.mode,ce),ce.return=J,J=ce}return N(J);case B:return ee=gs(ee),vt(J,Q,ee,ce)}if(Y(ee))return we(J,Q,ee,ce);if(F(ee)){if(Le=F(ee),typeof Le!="function")throw Error(s(150));return ee=Le.call(ee),ze(J,Q,ee,ce)}if(typeof ee.then=="function")return vt(J,Q,vc(ee),ce);if(ee.$$typeof===j)return vt(J,Q,mc(J,ee),ce);bc(J,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,Q!==null&&Q.tag===6?(l(J,Q.sibling),ce=y(Q,ee),ce.return=J,J=ce):(l(J,Q),ce=Yd(ee,J.mode,ce),ce.return=J,J=ce),N(J)):l(J,Q)}return function(J,Q,ee,ce){try{Ll=0;var Le=vt(J,Q,ee,ce);return _r=null,Le}catch(Ne){if(Ne===xr||Ne===gc)throw Ne;var it=En(29,Ne,null,J.mode);return it.lanes=ce,it.return=J,it}finally{}}}var vs=by(!0),xy=by(!1),pi=!1;function rf(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function lf(n,i){n=n.updateQueue,i.updateQueue===n&&(i.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function gi(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function yi(n,i,l){var d=n.updateQueue;if(d===null)return null;if(d=d.shared,(rt&2)!==0){var y=d.pending;return y===null?i.next=i:(i.next=y.next,y.next=i),d.pending=i,i=uc(n),ay(n,null,l),i}return cc(n,d,i,l),uc(n)}function Ol(n,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194048)!==0)){var d=i.lanes;d&=n.pendingLanes,l|=d,i.lanes=l,yl(n,l)}}function of(n,i){var l=n.updateQueue,d=n.alternate;if(d!==null&&(d=d.updateQueue,l===d)){var y=null,x=null;if(l=l.firstBaseUpdate,l!==null){do{var N={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};x===null?y=x=N:x=x.next=N,l=l.next}while(l!==null);x===null?y=x=i:x=x.next=i}else y=x=i;l={baseState:d.baseState,firstBaseUpdate:y,lastBaseUpdate:x,shared:d.shared,callbacks:d.callbacks},n.updateQueue=l;return}n=l.lastBaseUpdate,n===null?l.firstBaseUpdate=i:n.next=i,l.lastBaseUpdate=i}var cf=!1;function zl(){if(cf){var n=br;if(n!==null)throw n}}function Il(n,i,l,d){cf=!1;var y=n.updateQueue;pi=!1;var x=y.firstBaseUpdate,N=y.lastBaseUpdate,L=y.shared.pending;if(L!==null){y.shared.pending=null;var V=L,te=V.next;V.next=null,N===null?x=te:N.next=te,N=V;var le=n.alternate;le!==null&&(le=le.updateQueue,L=le.lastBaseUpdate,L!==N&&(L===null?le.firstBaseUpdate=te:L.next=te,le.lastBaseUpdate=V))}if(x!==null){var ue=y.baseState;N=0,le=te=V=null,L=x;do{var ne=L.lane&-536870913,se=ne!==L.lane;if(se?(Ze&ne)===ne:(d&ne)===ne){ne!==0&&ne===vr&&(cf=!0),le!==null&&(le=le.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var we=n,ze=L;ne=i;var vt=l;switch(ze.tag){case 1:if(we=ze.payload,typeof we=="function"){ue=we.call(vt,ue,ne);break e}ue=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=ze.payload,ne=typeof we=="function"?we.call(vt,ue,ne):we,ne==null)break e;ue=p({},ue,ne);break e;case 2:pi=!0}}ne=L.callback,ne!==null&&(n.flags|=64,se&&(n.flags|=8192),se=y.callbacks,se===null?y.callbacks=[ne]:se.push(ne))}else se={lane:ne,tag:L.tag,payload:L.payload,callback:L.callback,next:null},le===null?(te=le=se,V=ue):le=le.next=se,N|=ne;if(L=L.next,L===null){if(L=y.shared.pending,L===null)break;se=L,L=se.next,se.next=null,y.lastBaseUpdate=se,y.shared.pending=null}}while(!0);le===null&&(V=ue),y.baseState=V,y.firstBaseUpdate=te,y.lastBaseUpdate=le,x===null&&(y.shared.lanes=0),Si|=N,n.lanes=N,n.memoizedState=ue}}function _y(n,i){if(typeof n!="function")throw Error(s(191,n));n.call(i)}function Sy(n,i){var l=n.callbacks;if(l!==null)for(n.callbacks=null,n=0;n<l.length;n++)_y(l[n],i)}var Sr=he(null),xc=he(0);function wy(n,i){n=Ka,E(xc,n),E(Sr,i),Ka=n|i.baseLanes}function uf(){E(xc,Ka),E(Sr,Sr.current)}function df(){Ka=xc.current,ge(Sr),ge(xc)}var Rn=he(null),Gn=null;function vi(n){var i=n.alternate;E(It,It.current&1),E(Rn,n),Gn===null&&(i===null||Sr.current!==null||i.memoizedState!==null)&&(Gn=n)}function ff(n){E(It,It.current),E(Rn,n),Gn===null&&(Gn=n)}function Cy(n){n.tag===22?(E(It,It.current),E(Rn,n),Gn===null&&(Gn=n)):bi()}function bi(){E(It,It.current),E(Rn,Rn.current)}function Tn(n){ge(Rn),Gn===n&&(Gn=null),ge(It)}var It=he(0);function _c(n){for(var i=n;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||vh(l)||bh(l)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Fa=0,Pe=null,gt=null,Ft=null,Sc=!1,wr=!1,bs=!1,wc=0,Ul=0,Cr=null,CC=0;function Lt(){throw Error(s(321))}function hf(n,i){if(i===null)return!1;for(var l=0;l<i.length&&l<n.length;l++)if(!kn(n[l],i[l]))return!1;return!0}function mf(n,i,l,d,y,x){return Fa=x,Pe=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,$.H=n===null||n.memoizedState===null?lv:Rf,bs=!1,x=l(d,y),bs=!1,wr&&(x=jy(i,l,d,y)),Ny(n),x}function Ny(n){$.H=Hl;var i=gt!==null&&gt.next!==null;if(Fa=0,Ft=gt=Pe=null,Sc=!1,Ul=0,Cr=null,i)throw Error(s(300));n===null||Ht||(n=n.dependencies,n!==null&&hc(n)&&(Ht=!0))}function jy(n,i,l,d){Pe=n;var y=0;do{if(wr&&(Cr=null),Ul=0,wr=!1,25<=y)throw Error(s(301));if(y+=1,Ft=gt=null,n.updateQueue!=null){var x=n.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}$.H=ov,x=i(l,d)}while(wr);return x}function NC(){var n=$.H,i=n.useState()[0];return i=typeof i.then=="function"?Bl(i):i,n=n.useState()[0],(gt!==null?gt.memoizedState:null)!==n&&(Pe.flags|=1024),i}function pf(){var n=wc!==0;return wc=0,n}function gf(n,i,l){i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~l}function yf(n){if(Sc){for(n=n.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Sc=!1}Fa=0,Ft=gt=Pe=null,wr=!1,Ul=wc=0,Cr=null}function un(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ft===null?Pe.memoizedState=Ft=n:Ft=Ft.next=n,Ft}function Ut(){if(gt===null){var n=Pe.alternate;n=n!==null?n.memoizedState:null}else n=gt.next;var i=Ft===null?Pe.memoizedState:Ft.next;if(i!==null)Ft=i,gt=n;else{if(n===null)throw Pe.alternate===null?Error(s(467)):Error(s(310));gt=n,n={memoizedState:gt.memoizedState,baseState:gt.baseState,baseQueue:gt.baseQueue,queue:gt.queue,next:null},Ft===null?Pe.memoizedState=Ft=n:Ft=Ft.next=n}return Ft}function Cc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Bl(n){var i=Ul;return Ul+=1,Cr===null&&(Cr=[]),n=gy(Cr,n,i),i=Pe,(Ft===null?i.memoizedState:Ft.next)===null&&(i=i.alternate,$.H=i===null||i.memoizedState===null?lv:Rf),n}function Nc(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Bl(n);if(n.$$typeof===j)return Wt(n)}throw Error(s(438,String(n)))}function vf(n){var i=null,l=Pe.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var d=Pe.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(i={data:d.data.map(function(y){return y.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),l===null&&(l=Cc(),Pe.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(n),d=0;d<n;d++)l[d]=M;return i.index++,l}function Ha(n,i){return typeof i=="function"?i(n):i}function jc(n){var i=Ut();return bf(i,gt,n)}function bf(n,i,l){var d=n.queue;if(d===null)throw Error(s(311));d.lastRenderedReducer=l;var y=n.baseQueue,x=d.pending;if(x!==null){if(y!==null){var N=y.next;y.next=x.next,x.next=N}i.baseQueue=y=x,d.pending=null}if(x=n.baseState,y===null)n.memoizedState=x;else{i=y.next;var L=N=null,V=null,te=i,le=!1;do{var ue=te.lane&-536870913;if(ue!==te.lane?(Ze&ue)===ue:(Fa&ue)===ue){var ne=te.revertLane;if(ne===0)V!==null&&(V=V.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),ue===vr&&(le=!0);else if((Fa&ne)===ne){te=te.next,ne===vr&&(le=!0);continue}else ue={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},V===null?(L=V=ue,N=x):V=V.next=ue,Pe.lanes|=ne,Si|=ne;ue=te.action,bs&&l(x,ue),x=te.hasEagerState?te.eagerState:l(x,ue)}else ne={lane:ue,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},V===null?(L=V=ne,N=x):V=V.next=ne,Pe.lanes|=ue,Si|=ue;te=te.next}while(te!==null&&te!==i);if(V===null?N=x:V.next=L,!kn(x,n.memoizedState)&&(Ht=!0,le&&(l=br,l!==null)))throw l;n.memoizedState=x,n.baseState=N,n.baseQueue=V,d.lastRenderedState=x}return y===null&&(d.lanes=0),[n.memoizedState,d.dispatch]}function xf(n){var i=Ut(),l=i.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=n;var d=l.dispatch,y=l.pending,x=i.memoizedState;if(y!==null){l.pending=null;var N=y=y.next;do x=n(x,N.action),N=N.next;while(N!==y);kn(x,i.memoizedState)||(Ht=!0),i.memoizedState=x,i.baseQueue===null&&(i.baseState=x),l.lastRenderedState=x}return[x,d]}function ky(n,i,l){var d=Pe,y=Ut(),x=et;if(x){if(l===void 0)throw Error(s(407));l=l()}else l=i();var N=!kn((gt||y).memoizedState,l);if(N&&(y.memoizedState=l,Ht=!0),y=y.queue,wf(Ty.bind(null,d,y,n),[n]),y.getSnapshot!==i||N||Ft!==null&&Ft.memoizedState.tag&1){if(d.flags|=2048,Nr(9,{destroy:void 0},Ry.bind(null,d,y,l,i),null),_t===null)throw Error(s(349));x||(Fa&127)!==0||Ey(d,i,l)}return l}function Ey(n,i,l){n.flags|=16384,n={getSnapshot:i,value:l},i=Pe.updateQueue,i===null?(i=Cc(),Pe.updateQueue=i,i.stores=[n]):(l=i.stores,l===null?i.stores=[n]:l.push(n))}function Ry(n,i,l,d){i.value=l,i.getSnapshot=d,My(i)&&Ay(n)}function Ty(n,i,l){return l(function(){My(i)&&Ay(n)})}function My(n){var i=n.getSnapshot;n=n.value;try{var l=i();return!kn(n,l)}catch(d){return!0}}function Ay(n){var i=us(n,2);i!==null&&bn(i,n,2)}function _f(n){var i=un();if(typeof n=="function"){var l=n;if(n=l(),bs){pt(!0);try{l()}finally{pt(!1)}}}return i.memoizedState=i.baseState=n,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ha,lastRenderedState:n},i}function Ly(n,i,l,d){return n.baseState=l,bf(n,gt,typeof d=="function"?d:Ha)}function jC(n,i,l,d,y){if(Rc(n))throw Error(s(485));if(n=i.action,n!==null){var x={payload:y,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){x.listeners.push(N)}};$.T!==null?l(!0):x.isTransition=!1,d(x),l=i.pending,l===null?(x.next=i.pending=x,Dy(i,x)):(x.next=l.next,i.pending=l.next=x)}}function Dy(n,i){var l=i.action,d=i.payload,y=n.state;if(i.isTransition){var x=$.T,N={};$.T=N;try{var L=l(y,d),V=$.S;V!==null&&V(N,L),Oy(n,i,L)}catch(te){Sf(n,i,te)}finally{x!==null&&N.types!==null&&(x.types=N.types),$.T=x}}else try{x=l(y,d),Oy(n,i,x)}catch(te){Sf(n,i,te)}}function Oy(n,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(d){zy(n,i,d)},function(d){return Sf(n,i,d)}):zy(n,i,l)}function zy(n,i,l){i.status="fulfilled",i.value=l,Iy(i),n.state=l,i=n.pending,i!==null&&(l=i.next,l===i?n.pending=null:(l=l.next,i.next=l,Dy(n,l)))}function Sf(n,i,l){var d=n.pending;if(n.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=l,Iy(i),i=i.next;while(i!==d)}n.action=null}function Iy(n){n=n.listeners;for(var i=0;i<n.length;i++)(0,n[i])()}function Uy(n,i){return i}function By(n,i){if(et){var l=_t.formState;if(l!==null){e:{var d=Pe;if(et){if(kt){t:{for(var y=kt,x=Yn;y.nodeType!==8;){if(!x){y=null;break t}if(y=Kn(y.nextSibling),y===null){y=null;break t}}x=y.data,y=x==="F!"||x==="F"?y:null}if(y){kt=Kn(y.nextSibling),d=y.data==="F!";break e}}hi(d)}d=!1}d&&(i=l[0])}}return l=un(),l.memoizedState=l.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uy,lastRenderedState:i},l.queue=d,l=iv.bind(null,Pe,d),d.dispatch=l,d=_f(!1),x=Ef.bind(null,Pe,!1,d.queue),d=un(),y={state:i,dispatch:null,action:n,pending:null},d.queue=y,l=jC.bind(null,Pe,y,x,l),y.dispatch=l,d.memoizedState=n,[i,l,!1]}function Fy(n){var i=Ut();return Hy(i,gt,n)}function Hy(n,i,l){if(i=bf(n,i,Uy)[0],n=jc(Ha)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var d=Bl(i)}catch(N){throw N===xr?gc:N}else d=i;i=Ut();var y=i.queue,x=y.dispatch;return l!==i.memoizedState&&(Pe.flags|=2048,Nr(9,{destroy:void 0},kC.bind(null,y,l),null)),[d,x,n]}function kC(n,i){n.action=i}function Py(n){var i=Ut(),l=gt;if(l!==null)return Hy(i,l,n);Ut(),i=i.memoizedState,l=Ut();var d=l.queue.dispatch;return l.memoizedState=n,[i,d,!1]}function Nr(n,i,l,d){return n={tag:n,create:l,deps:d,inst:i,next:null},i=Pe.updateQueue,i===null&&(i=Cc(),Pe.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=n.next=n:(d=l.next,l.next=n,n.next=d,i.lastEffect=n),n}function $y(){return Ut().memoizedState}function kc(n,i,l,d){var y=un();Pe.flags|=n,y.memoizedState=Nr(1|i,{destroy:void 0},l,d===void 0?null:d)}function Ec(n,i,l,d){var y=Ut();d=d===void 0?null:d;var x=y.memoizedState.inst;gt!==null&&d!==null&&hf(d,gt.memoizedState.deps)?y.memoizedState=Nr(i,x,l,d):(Pe.flags|=n,y.memoizedState=Nr(1|i,x,l,d))}function qy(n,i){kc(8390656,8,n,i)}function wf(n,i){Ec(2048,8,n,i)}function EC(n){Pe.flags|=4;var i=Pe.updateQueue;if(i===null)i=Cc(),Pe.updateQueue=i,i.events=[n];else{var l=i.events;l===null?i.events=[n]:l.push(n)}}function Vy(n){var i=Ut().memoizedState;return EC({ref:i,nextImpl:n}),function(){if((rt&2)!==0)throw Error(s(440));return i.impl.apply(void 0,arguments)}}function Yy(n,i){return Ec(4,2,n,i)}function Gy(n,i){return Ec(4,4,n,i)}function Ky(n,i){if(typeof i=="function"){n=n();var l=i(n);return function(){typeof l=="function"?l():i(null)}}if(i!=null)return n=n(),i.current=n,function(){i.current=null}}function Xy(n,i,l){l=l!=null?l.concat([n]):null,Ec(4,4,Ky.bind(null,i,n),l)}function Cf(){}function Qy(n,i){var l=Ut();i=i===void 0?null:i;var d=l.memoizedState;return i!==null&&hf(i,d[1])?d[0]:(l.memoizedState=[n,i],n)}function Zy(n,i){var l=Ut();i=i===void 0?null:i;var d=l.memoizedState;if(i!==null&&hf(i,d[1]))return d[0];if(d=n(),bs){pt(!0);try{n()}finally{pt(!1)}}return l.memoizedState=[d,i],d}function Nf(n,i,l){return l===void 0||(Fa&1073741824)!==0&&(Ze&261930)===0?n.memoizedState=i:(n.memoizedState=l,n=Jv(),Pe.lanes|=n,Si|=n,l)}function Jy(n,i,l,d){return kn(l,i)?l:Sr.current!==null?(n=Nf(n,l,d),kn(n,i)||(Ht=!0),n):(Fa&42)===0||(Fa&1073741824)!==0&&(Ze&261930)===0?(Ht=!0,n.memoizedState=l):(n=Jv(),Pe.lanes|=n,Si|=n,i)}function Wy(n,i,l,d,y){var x=X.p;X.p=x!==0&&8>x?x:8;var N=$.T,L={};$.T=L,Ef(n,!1,i,l);try{var V=y(),te=$.S;if(te!==null&&te(L,V),V!==null&&typeof V=="object"&&typeof V.then=="function"){var le=wC(V,d);Fl(n,i,le,Ln(n))}else Fl(n,i,d,Ln(n))}catch(ue){Fl(n,i,{then:function(){},status:"rejected",reason:ue},Ln())}finally{X.p=x,N!==null&&L.types!==null&&(N.types=L.types),$.T=N}}function RC(){}function jf(n,i,l,d){if(n.tag!==5)throw Error(s(476));var y=ev(n).queue;Wy(n,y,i,Z,l===null?RC:function(){return tv(n),l(d)})}function ev(n){var i=n.memoizedState;if(i!==null)return i;i={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ha,lastRenderedState:Z},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ha,lastRenderedState:l},next:null},n.memoizedState=i,n=n.alternate,n!==null&&(n.memoizedState=i),i}function tv(n){var i=ev(n);i.next===null&&(i=n.alternate.memoizedState),Fl(n,i.next.queue,{},Ln())}function kf(){return Wt(ao)}function nv(){return Ut().memoizedState}function av(){return Ut().memoizedState}function TC(n){for(var i=n.return;i!==null;){switch(i.tag){case 24:case 3:var l=Ln();n=gi(l);var d=yi(i,n,l);d!==null&&(bn(d,i,l),Ol(d,i,l)),i={cache:tf()},n.payload=i;return}i=i.return}}function MC(n,i,l){var d=Ln();l={lane:d,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Rc(n)?sv(i,l):(l=qd(n,i,l,d),l!==null&&(bn(l,n,d),rv(l,i,d)))}function iv(n,i,l){var d=Ln();Fl(n,i,l,d)}function Fl(n,i,l,d){var y={lane:d,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Rc(n))sv(i,y);else{var x=n.alternate;if(n.lanes===0&&(x===null||x.lanes===0)&&(x=i.lastRenderedReducer,x!==null))try{var N=i.lastRenderedState,L=x(N,l);if(y.hasEagerState=!0,y.eagerState=L,kn(L,N))return cc(n,i,y,0),_t===null&&oc(),!1}catch(V){}finally{}if(l=qd(n,i,y,d),l!==null)return bn(l,n,d),rv(l,i,d),!0}return!1}function Ef(n,i,l,d){if(d={lane:2,revertLane:rh(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Rc(n)){if(i)throw Error(s(479))}else i=qd(n,l,d,2),i!==null&&bn(i,n,2)}function Rc(n){var i=n.alternate;return n===Pe||i!==null&&i===Pe}function sv(n,i){wr=Sc=!0;var l=n.pending;l===null?i.next=i:(i.next=l.next,l.next=i),n.pending=i}function rv(n,i,l){if((l&4194048)!==0){var d=i.lanes;d&=n.pendingLanes,l|=d,i.lanes=l,yl(n,l)}}var Hl={readContext:Wt,use:Nc,useCallback:Lt,useContext:Lt,useEffect:Lt,useImperativeHandle:Lt,useLayoutEffect:Lt,useInsertionEffect:Lt,useMemo:Lt,useReducer:Lt,useRef:Lt,useState:Lt,useDebugValue:Lt,useDeferredValue:Lt,useTransition:Lt,useSyncExternalStore:Lt,useId:Lt,useHostTransitionStatus:Lt,useFormState:Lt,useActionState:Lt,useOptimistic:Lt,useMemoCache:Lt,useCacheRefresh:Lt};Hl.useEffectEvent=Lt;var lv={readContext:Wt,use:Nc,useCallback:function(n,i){return un().memoizedState=[n,i===void 0?null:i],n},useContext:Wt,useEffect:qy,useImperativeHandle:function(n,i,l){l=l!=null?l.concat([n]):null,kc(4194308,4,Ky.bind(null,i,n),l)},useLayoutEffect:function(n,i){return kc(4194308,4,n,i)},useInsertionEffect:function(n,i){kc(4,2,n,i)},useMemo:function(n,i){var l=un();i=i===void 0?null:i;var d=n();if(bs){pt(!0);try{n()}finally{pt(!1)}}return l.memoizedState=[d,i],d},useReducer:function(n,i,l){var d=un();if(l!==void 0){var y=l(i);if(bs){pt(!0);try{l(i)}finally{pt(!1)}}}else y=i;return d.memoizedState=d.baseState=y,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:y},d.queue=n,n=n.dispatch=MC.bind(null,Pe,n),[d.memoizedState,n]},useRef:function(n){var i=un();return n={current:n},i.memoizedState=n},useState:function(n){n=_f(n);var i=n.queue,l=iv.bind(null,Pe,i);return i.dispatch=l,[n.memoizedState,l]},useDebugValue:Cf,useDeferredValue:function(n,i){var l=un();return Nf(l,n,i)},useTransition:function(){var n=_f(!1);return n=Wy.bind(null,Pe,n.queue,!0,!1),un().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,l){var d=Pe,y=un();if(et){if(l===void 0)throw Error(s(407));l=l()}else{if(l=i(),_t===null)throw Error(s(349));(Ze&127)!==0||Ey(d,i,l)}y.memoizedState=l;var x={value:l,getSnapshot:i};return y.queue=x,qy(Ty.bind(null,d,x,n),[n]),d.flags|=2048,Nr(9,{destroy:void 0},Ry.bind(null,d,x,l,i),null),l},useId:function(){var n=un(),i=_t.identifierPrefix;if(et){var l=ba,d=va;l=(d&~(1<<32-ut(d)-1)).toString(32)+l,i="_"+i+"R_"+l,l=wc++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=CC++,i="_"+i+"r_"+l.toString(32)+"_";return n.memoizedState=i},useHostTransitionStatus:kf,useFormState:By,useActionState:By,useOptimistic:function(n){var i=un();i.memoizedState=i.baseState=n;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=Ef.bind(null,Pe,!0,l),l.dispatch=i,[n,i]},useMemoCache:vf,useCacheRefresh:function(){return un().memoizedState=TC.bind(null,Pe)},useEffectEvent:function(n){var i=un(),l={impl:n};return i.memoizedState=l,function(){if((rt&2)!==0)throw Error(s(440));return l.impl.apply(void 0,arguments)}}},Rf={readContext:Wt,use:Nc,useCallback:Qy,useContext:Wt,useEffect:wf,useImperativeHandle:Xy,useInsertionEffect:Yy,useLayoutEffect:Gy,useMemo:Zy,useReducer:jc,useRef:$y,useState:function(){return jc(Ha)},useDebugValue:Cf,useDeferredValue:function(n,i){var l=Ut();return Jy(l,gt.memoizedState,n,i)},useTransition:function(){var n=jc(Ha)[0],i=Ut().memoizedState;return[typeof n=="boolean"?n:Bl(n),i]},useSyncExternalStore:ky,useId:nv,useHostTransitionStatus:kf,useFormState:Fy,useActionState:Fy,useOptimistic:function(n,i){var l=Ut();return Ly(l,gt,n,i)},useMemoCache:vf,useCacheRefresh:av};Rf.useEffectEvent=Vy;var ov={readContext:Wt,use:Nc,useCallback:Qy,useContext:Wt,useEffect:wf,useImperativeHandle:Xy,useInsertionEffect:Yy,useLayoutEffect:Gy,useMemo:Zy,useReducer:xf,useRef:$y,useState:function(){return xf(Ha)},useDebugValue:Cf,useDeferredValue:function(n,i){var l=Ut();return gt===null?Nf(l,n,i):Jy(l,gt.memoizedState,n,i)},useTransition:function(){var n=xf(Ha)[0],i=Ut().memoizedState;return[typeof n=="boolean"?n:Bl(n),i]},useSyncExternalStore:ky,useId:nv,useHostTransitionStatus:kf,useFormState:Py,useActionState:Py,useOptimistic:function(n,i){var l=Ut();return gt!==null?Ly(l,gt,n,i):(l.baseState=n,[n,l.queue.dispatch])},useMemoCache:vf,useCacheRefresh:av};ov.useEffectEvent=Vy;function Tf(n,i,l,d){i=n.memoizedState,l=l(d,i),l=l==null?i:p({},i,l),n.memoizedState=l,n.lanes===0&&(n.updateQueue.baseState=l)}var Mf={enqueueSetState:function(n,i,l){n=n._reactInternals;var d=Ln(),y=gi(d);y.payload=i,l!=null&&(y.callback=l),i=yi(n,y,d),i!==null&&(bn(i,n,d),Ol(i,n,d))},enqueueReplaceState:function(n,i,l){n=n._reactInternals;var d=Ln(),y=gi(d);y.tag=1,y.payload=i,l!=null&&(y.callback=l),i=yi(n,y,d),i!==null&&(bn(i,n,d),Ol(i,n,d))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var l=Ln(),d=gi(l);d.tag=2,i!=null&&(d.callback=i),i=yi(n,d,l),i!==null&&(bn(i,n,l),Ol(i,n,l))}};function cv(n,i,l,d,y,x,N){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(d,x,N):i.prototype&&i.prototype.isPureReactComponent?!kl(l,d)||!kl(y,x):!0}function uv(n,i,l,d){n=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,d),i.state!==n&&Mf.enqueueReplaceState(i,i.state,null)}function xs(n,i){var l=i;if("ref"in i){l={};for(var d in i)d!=="ref"&&(l[d]=i[d])}if(n=n.defaultProps){l===i&&(l=p({},l));for(var y in n)l[y]===void 0&&(l[y]=n[y])}return l}function dv(n){lc(n)}function fv(n){console.error(n)}function hv(n){lc(n)}function Tc(n,i){try{var l=n.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function mv(n,i,l){try{var d=n.onCaughtError;d(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function Af(n,i,l){return l=gi(l),l.tag=3,l.payload={element:null},l.callback=function(){Tc(n,i)},l}function pv(n){return n=gi(n),n.tag=3,n}function gv(n,i,l,d){var y=l.type.getDerivedStateFromError;if(typeof y=="function"){var x=d.value;n.payload=function(){return y(x)},n.callback=function(){mv(i,l,d)}}var N=l.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(n.callback=function(){mv(i,l,d),typeof y!="function"&&(wi===null?wi=new Set([this]):wi.add(this));var L=d.stack;this.componentDidCatch(d.value,{componentStack:L!==null?L:""})})}function AC(n,i,l,d,y){if(l.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=l.alternate,i!==null&&yr(i,l,y,!0),l=Rn.current,l!==null){switch(l.tag){case 31:case 13:return Gn===null?Pc():l.alternate===null&&Dt===0&&(Dt=3),l.flags&=-257,l.flags|=65536,l.lanes=y,d===yc?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([d]):i.add(d),ah(n,d,y)),!1;case 22:return l.flags|=65536,d===yc?l.flags|=16384:(i=l.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([d])},l.updateQueue=i):(l=i.retryQueue,l===null?i.retryQueue=new Set([d]):l.add(d)),ah(n,d,y)),!1}throw Error(s(435,l.tag))}return ah(n,d,y),Pc(),!1}if(et)return i=Rn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=y,d!==Qd&&(n=Error(s(422),{cause:d}),Tl($n(n,l)))):(d!==Qd&&(i=Error(s(423),{cause:d}),Tl($n(i,l))),n=n.current.alternate,n.flags|=65536,y&=-y,n.lanes|=y,d=$n(d,l),y=Af(n.stateNode,d,y),of(n,y),Dt!==4&&(Dt=2)),!1;var x=Error(s(520),{cause:d});if(x=$n(x,l),Xl===null?Xl=[x]:Xl.push(x),Dt!==4&&(Dt=2),i===null)return!0;d=$n(d,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,n=y&-y,l.lanes|=n,n=Af(l.stateNode,d,n),of(l,n),!1;case 1:if(i=l.type,x=l.stateNode,(l.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(wi===null||!wi.has(x))))return l.flags|=65536,y&=-y,l.lanes|=y,y=pv(y),gv(y,n,l,d),of(l,y),!1}l=l.return}while(l!==null);return!1}var Lf=Error(s(461)),Ht=!1;function en(n,i,l,d){i.child=n===null?xy(i,null,l,d):vs(i,n.child,l,d)}function yv(n,i,l,d,y){l=l.render;var x=i.ref;if("ref"in d){var N={};for(var L in d)L!=="ref"&&(N[L]=d[L])}else N=d;return ms(i),d=mf(n,i,l,N,x,y),L=pf(),n!==null&&!Ht?(gf(n,i,y),Pa(n,i,y)):(et&&L&&Kd(i),i.flags|=1,en(n,i,d,y),i.child)}function vv(n,i,l,d,y){if(n===null){var x=l.type;return typeof x=="function"&&!Vd(x)&&x.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=x,bv(n,i,x,d,y)):(n=dc(l.type,null,d,i,i.mode,y),n.ref=i.ref,n.return=i,i.child=n)}if(x=n.child,!Hf(n,y)){var N=x.memoizedProps;if(l=l.compare,l=l!==null?l:kl,l(N,d)&&n.ref===i.ref)return Pa(n,i,y)}return i.flags|=1,n=za(x,d),n.ref=i.ref,n.return=i,i.child=n}function bv(n,i,l,d,y){if(n!==null){var x=n.memoizedProps;if(kl(x,d)&&n.ref===i.ref)if(Ht=!1,i.pendingProps=d=x,Hf(n,y))(n.flags&131072)!==0&&(Ht=!0);else return i.lanes=n.lanes,Pa(n,i,y)}return Df(n,i,l,d,y)}function xv(n,i,l,d){var y=d.children,x=n!==null?n.memoizedState:null;if(n===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((i.flags&128)!==0){if(x=x!==null?x.baseLanes|l:l,n!==null){for(d=i.child=n.child,y=0;d!==null;)y=y|d.lanes|d.childLanes,d=d.sibling;d=y&~x}else d=0,i.child=null;return _v(n,i,x,l,d)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},n!==null&&pc(i,x!==null?x.cachePool:null),x!==null?wy(i,x):uf(),Cy(i);else return d=i.lanes=536870912,_v(n,i,x!==null?x.baseLanes|l:l,l,d)}else x!==null?(pc(i,x.cachePool),wy(i,x),bi(),i.memoizedState=null):(n!==null&&pc(i,null),uf(),bi());return en(n,i,y,l),i.child}function Pl(n,i){return n!==null&&n.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function _v(n,i,l,d,y){var x=af();return x=x===null?null:{parent:Bt._currentValue,pool:x},i.memoizedState={baseLanes:l,cachePool:x},n!==null&&pc(i,null),uf(),Cy(i),n!==null&&yr(n,i,d,!0),i.childLanes=y,null}function Mc(n,i){return i=Lc({mode:i.mode,children:i.children},n.mode),i.ref=n.ref,n.child=i,i.return=n,i}function Sv(n,i,l){return vs(i,n.child,null,l),n=Mc(i,i.pendingProps),n.flags|=2,Tn(i),i.memoizedState=null,n}function LC(n,i,l){var d=i.pendingProps,y=(i.flags&128)!==0;if(i.flags&=-129,n===null){if(et){if(d.mode==="hidden")return n=Mc(i,d),i.lanes=536870912,Pl(null,n);if(ff(i),(n=kt)?(n=D1(n,Yn),n=n!==null&&n.data==="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:di!==null?{id:va,overflow:ba}:null,retryLane:536870912,hydrationErrors:null},l=sy(n),l.return=i,i.child=l,Jt=i,kt=null)):n=null,n===null)throw hi(i);return i.lanes=536870912,null}return Mc(i,d)}var x=n.memoizedState;if(x!==null){var N=x.dehydrated;if(ff(i),y)if(i.flags&256)i.flags&=-257,i=Sv(n,i,l);else if(i.memoizedState!==null)i.child=n.child,i.flags|=128,i=null;else throw Error(s(558));else if(Ht||yr(n,i,l,!1),y=(l&n.childLanes)!==0,Ht||y){if(d=_t,d!==null&&(N=li(d,l),N!==0&&N!==x.retryLane))throw x.retryLane=N,us(n,N),bn(d,n,N),Lf;Pc(),i=Sv(n,i,l)}else n=x.treeContext,kt=Kn(N.nextSibling),Jt=i,et=!0,fi=null,Yn=!1,n!==null&&oy(i,n),i=Mc(i,d),i.flags|=4096;return i}return n=za(n.child,{mode:d.mode,children:d.children}),n.ref=i.ref,i.child=n,n.return=i,n}function Ac(n,i){var l=i.ref;if(l===null)n!==null&&n.ref!==null&&(i.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(s(284));(n===null||n.ref!==l)&&(i.flags|=4194816)}}function Df(n,i,l,d,y){return ms(i),l=mf(n,i,l,d,void 0,y),d=pf(),n!==null&&!Ht?(gf(n,i,y),Pa(n,i,y)):(et&&d&&Kd(i),i.flags|=1,en(n,i,l,y),i.child)}function wv(n,i,l,d,y,x){return ms(i),i.updateQueue=null,l=jy(i,d,l,y),Ny(n),d=pf(),n!==null&&!Ht?(gf(n,i,x),Pa(n,i,x)):(et&&d&&Kd(i),i.flags|=1,en(n,i,l,x),i.child)}function Cv(n,i,l,d,y){if(ms(i),i.stateNode===null){var x=hr,N=l.contextType;typeof N=="object"&&N!==null&&(x=Wt(N)),x=new l(d,x),i.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Mf,i.stateNode=x,x._reactInternals=i,x=i.stateNode,x.props=d,x.state=i.memoizedState,x.refs={},rf(i),N=l.contextType,x.context=typeof N=="object"&&N!==null?Wt(N):hr,x.state=i.memoizedState,N=l.getDerivedStateFromProps,typeof N=="function"&&(Tf(i,l,N,d),x.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(N=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),N!==x.state&&Mf.enqueueReplaceState(x,x.state,null),Il(i,d,x,y),zl(),x.state=i.memoizedState),typeof x.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(n===null){x=i.stateNode;var L=i.memoizedProps,V=xs(l,L);x.props=V;var te=x.context,le=l.contextType;N=hr,typeof le=="object"&&le!==null&&(N=Wt(le));var ue=l.getDerivedStateFromProps;le=typeof ue=="function"||typeof x.getSnapshotBeforeUpdate=="function",L=i.pendingProps!==L,le||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(L||te!==N)&&uv(i,x,d,N),pi=!1;var ne=i.memoizedState;x.state=ne,Il(i,d,x,y),zl(),te=i.memoizedState,L||ne!==te||pi?(typeof ue=="function"&&(Tf(i,l,ue,d),te=i.memoizedState),(V=pi||cv(i,l,V,d,ne,te,N))?(le||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(i.flags|=4194308)):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=te),x.props=d,x.state=te,x.context=N,d=V):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{x=i.stateNode,lf(n,i),N=i.memoizedProps,le=xs(l,N),x.props=le,ue=i.pendingProps,ne=x.context,te=l.contextType,V=hr,typeof te=="object"&&te!==null&&(V=Wt(te)),L=l.getDerivedStateFromProps,(te=typeof L=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(N!==ue||ne!==V)&&uv(i,x,d,V),pi=!1,ne=i.memoizedState,x.state=ne,Il(i,d,x,y),zl();var se=i.memoizedState;N!==ue||ne!==se||pi||n!==null&&n.dependencies!==null&&hc(n.dependencies)?(typeof L=="function"&&(Tf(i,l,L,d),se=i.memoizedState),(le=pi||cv(i,l,le,d,ne,se,V)||n!==null&&n.dependencies!==null&&hc(n.dependencies))?(te||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(d,se,V),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(d,se,V)),typeof x.componentDidUpdate=="function"&&(i.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof x.componentDidUpdate!="function"||N===n.memoizedProps&&ne===n.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||N===n.memoizedProps&&ne===n.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=se),x.props=d,x.state=se,x.context=V,d=le):(typeof x.componentDidUpdate!="function"||N===n.memoizedProps&&ne===n.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||N===n.memoizedProps&&ne===n.memoizedState||(i.flags|=1024),d=!1)}return x=d,Ac(n,i),d=(i.flags&128)!==0,x||d?(x=i.stateNode,l=d&&typeof l.getDerivedStateFromError!="function"?null:x.render(),i.flags|=1,n!==null&&d?(i.child=vs(i,n.child,null,y),i.child=vs(i,null,l,y)):en(n,i,l,y),i.memoizedState=x.state,n=i.child):n=Pa(n,i,y),n}function Nv(n,i,l,d){return fs(),i.flags|=256,en(n,i,l,d),i.child}var Of={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function zf(n){return{baseLanes:n,cachePool:my()}}function If(n,i,l){return n=n!==null?n.childLanes&~l:0,i&&(n|=An),n}function jv(n,i,l){var d=i.pendingProps,y=!1,x=(i.flags&128)!==0,N;if((N=x)||(N=n!==null&&n.memoizedState===null?!1:(It.current&2)!==0),N&&(y=!0,i.flags&=-129),N=(i.flags&32)!==0,i.flags&=-33,n===null){if(et){if(y?vi(i):bi(),(n=kt)?(n=D1(n,Yn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:di!==null?{id:va,overflow:ba}:null,retryLane:536870912,hydrationErrors:null},l=sy(n),l.return=i,i.child=l,Jt=i,kt=null)):n=null,n===null)throw hi(i);return bh(n)?i.lanes=32:i.lanes=536870912,null}var L=d.children;return d=d.fallback,y?(bi(),y=i.mode,L=Lc({mode:"hidden",children:L},y),d=ds(d,y,l,null),L.return=i,d.return=i,L.sibling=d,i.child=L,d=i.child,d.memoizedState=zf(l),d.childLanes=If(n,N,l),i.memoizedState=Of,Pl(null,d)):(vi(i),Uf(i,L))}var V=n.memoizedState;if(V!==null&&(L=V.dehydrated,L!==null)){if(x)i.flags&256?(vi(i),i.flags&=-257,i=Bf(n,i,l)):i.memoizedState!==null?(bi(),i.child=n.child,i.flags|=128,i=null):(bi(),L=d.fallback,y=i.mode,d=Lc({mode:"visible",children:d.children},y),L=ds(L,y,l,null),L.flags|=2,d.return=i,L.return=i,d.sibling=L,i.child=d,vs(i,n.child,null,l),d=i.child,d.memoizedState=zf(l),d.childLanes=If(n,N,l),i.memoizedState=Of,i=Pl(null,d));else if(vi(i),bh(L)){if(N=L.nextSibling&&L.nextSibling.dataset,N)var te=N.dgst;N=te,d=Error(s(419)),d.stack="",d.digest=N,Tl({value:d,source:null,stack:null}),i=Bf(n,i,l)}else if(Ht||yr(n,i,l,!1),N=(l&n.childLanes)!==0,Ht||N){if(N=_t,N!==null&&(d=li(N,l),d!==0&&d!==V.retryLane))throw V.retryLane=d,us(n,d),bn(N,n,d),Lf;vh(L)||Pc(),i=Bf(n,i,l)}else vh(L)?(i.flags|=192,i.child=n.child,i=null):(n=V.treeContext,kt=Kn(L.nextSibling),Jt=i,et=!0,fi=null,Yn=!1,n!==null&&oy(i,n),i=Uf(i,d.children),i.flags|=4096);return i}return y?(bi(),L=d.fallback,y=i.mode,V=n.child,te=V.sibling,d=za(V,{mode:"hidden",children:d.children}),d.subtreeFlags=V.subtreeFlags&65011712,te!==null?L=za(te,L):(L=ds(L,y,l,null),L.flags|=2),L.return=i,d.return=i,d.sibling=L,i.child=d,Pl(null,d),d=i.child,L=n.child.memoizedState,L===null?L=zf(l):(y=L.cachePool,y!==null?(V=Bt._currentValue,y=y.parent!==V?{parent:V,pool:V}:y):y=my(),L={baseLanes:L.baseLanes|l,cachePool:y}),d.memoizedState=L,d.childLanes=If(n,N,l),i.memoizedState=Of,Pl(n.child,d)):(vi(i),l=n.child,n=l.sibling,l=za(l,{mode:"visible",children:d.children}),l.return=i,l.sibling=null,n!==null&&(N=i.deletions,N===null?(i.deletions=[n],i.flags|=16):N.push(n)),i.child=l,i.memoizedState=null,l)}function Uf(n,i){return i=Lc({mode:"visible",children:i},n.mode),i.return=n,n.child=i}function Lc(n,i){return n=En(22,n,null,i),n.lanes=0,n}function Bf(n,i,l){return vs(i,n.child,null,l),n=Uf(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function kv(n,i,l){n.lanes|=i;var d=n.alternate;d!==null&&(d.lanes|=i),Wd(n.return,i,l)}function Ff(n,i,l,d,y,x){var N=n.memoizedState;N===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:l,tailMode:y,treeForkCount:x}:(N.isBackwards=i,N.rendering=null,N.renderingStartTime=0,N.last=d,N.tail=l,N.tailMode=y,N.treeForkCount=x)}function Ev(n,i,l){var d=i.pendingProps,y=d.revealOrder,x=d.tail;d=d.children;var N=It.current,L=(N&2)!==0;if(L?(N=N&1|2,i.flags|=128):N&=1,E(It,N),en(n,i,d,l),d=et?Rl:0,!L&&n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&kv(n,l,i);else if(n.tag===19)kv(n,l,i);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break e;for(;n.sibling===null;){if(n.return===null||n.return===i)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(y){case"forwards":for(l=i.child,y=null;l!==null;)n=l.alternate,n!==null&&_c(n)===null&&(y=l),l=l.sibling;l=y,l===null?(y=i.child,i.child=null):(y=l.sibling,l.sibling=null),Ff(i,!1,y,l,x,d);break;case"backwards":case"unstable_legacy-backwards":for(l=null,y=i.child,i.child=null;y!==null;){if(n=y.alternate,n!==null&&_c(n)===null){i.child=y;break}n=y.sibling,y.sibling=l,l=y,y=n}Ff(i,!0,l,null,x,d);break;case"together":Ff(i,!1,null,null,void 0,d);break;default:i.memoizedState=null}return i.child}function Pa(n,i,l){if(n!==null&&(i.dependencies=n.dependencies),Si|=i.lanes,(l&i.childLanes)===0)if(n!==null){if(yr(n,i,l,!1),(l&i.childLanes)===0)return null}else return null;if(n!==null&&i.child!==n.child)throw Error(s(153));if(i.child!==null){for(n=i.child,l=za(n,n.pendingProps),i.child=l,l.return=i;n.sibling!==null;)n=n.sibling,l=l.sibling=za(n,n.pendingProps),l.return=i;l.sibling=null}return i.child}function Hf(n,i){return(n.lanes&i)!==0?!0:(n=n.dependencies,!!(n!==null&&hc(n)))}function DC(n,i,l){switch(i.tag){case 3:be(i,i.stateNode.containerInfo),mi(i,Bt,n.memoizedState.cache),fs();break;case 27:case 5:Ge(i);break;case 4:be(i,i.stateNode.containerInfo);break;case 10:mi(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,ff(i),null;break;case 13:var d=i.memoizedState;if(d!==null)return d.dehydrated!==null?(vi(i),i.flags|=128,null):(l&i.child.childLanes)!==0?jv(n,i,l):(vi(i),n=Pa(n,i,l),n!==null?n.sibling:null);vi(i);break;case 19:var y=(n.flags&128)!==0;if(d=(l&i.childLanes)!==0,d||(yr(n,i,l,!1),d=(l&i.childLanes)!==0),y){if(d)return Ev(n,i,l);i.flags|=128}if(y=i.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),E(It,It.current),d)break;return null;case 22:return i.lanes=0,xv(n,i,l,i.pendingProps);case 24:mi(i,Bt,n.memoizedState.cache)}return Pa(n,i,l)}function Rv(n,i,l){if(n!==null)if(n.memoizedProps!==i.pendingProps)Ht=!0;else{if(!Hf(n,l)&&(i.flags&128)===0)return Ht=!1,DC(n,i,l);Ht=(n.flags&131072)!==0}else Ht=!1,et&&(i.flags&1048576)!==0&&ly(i,Rl,i.index);switch(i.lanes=0,i.tag){case 16:e:{var d=i.pendingProps;if(n=gs(i.elementType),i.type=n,typeof n=="function")Vd(n)?(d=xs(n,d),i.tag=1,i=Cv(null,i,n,d,l)):(i.tag=0,i=Df(null,i,n,d,l));else{if(n!=null){var y=n.$$typeof;if(y===k){i.tag=11,i=yv(null,i,n,d,l);break e}else if(y===z){i.tag=14,i=vv(null,i,n,d,l);break e}}throw i=H(n)||n,Error(s(306,i,""))}}return i;case 0:return Df(n,i,i.type,i.pendingProps,l);case 1:return d=i.type,y=xs(d,i.pendingProps),Cv(n,i,d,y,l);case 3:e:{if(be(i,i.stateNode.containerInfo),n===null)throw Error(s(387));d=i.pendingProps;var x=i.memoizedState;y=x.element,lf(n,i),Il(i,d,null,l);var N=i.memoizedState;if(d=N.cache,mi(i,Bt,d),d!==x.cache&&ef(i,[Bt],l,!0),zl(),d=N.element,x.isDehydrated)if(x={element:d,isDehydrated:!1,cache:N.cache},i.updateQueue.baseState=x,i.memoizedState=x,i.flags&256){i=Nv(n,i,d,l);break e}else if(d!==y){y=$n(Error(s(424)),i),Tl(y),i=Nv(n,i,d,l);break e}else{switch(n=i.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for(kt=Kn(n.firstChild),Jt=i,et=!0,fi=null,Yn=!0,l=xy(i,null,d,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(fs(),d===y){i=Pa(n,i,l);break e}en(n,i,d,l)}i=i.child}return i;case 26:return Ac(n,i),n===null?(l=F1(i.type,null,i.pendingProps,null))?i.memoizedState=l:et||(l=i.type,n=i.pendingProps,d=Xc(me.current).createElement(l),d[ae]=i,d[xe]=n,tn(d,l,n),Kt(d),i.stateNode=d):i.memoizedState=F1(i.type,n.memoizedProps,i.pendingProps,n.memoizedState),null;case 27:return Ge(i),n===null&&et&&(d=i.stateNode=I1(i.type,i.pendingProps,me.current),Jt=i,Yn=!0,y=kt,ki(i.type)?(xh=y,kt=Kn(d.firstChild)):kt=y),en(n,i,i.pendingProps.children,l),Ac(n,i),n===null&&(i.flags|=4194304),i.child;case 5:return n===null&&et&&((y=d=kt)&&(d=uN(d,i.type,i.pendingProps,Yn),d!==null?(i.stateNode=d,Jt=i,kt=Kn(d.firstChild),Yn=!1,y=!0):y=!1),y||hi(i)),Ge(i),y=i.type,x=i.pendingProps,N=n!==null?n.memoizedProps:null,d=x.children,ph(y,x)?d=null:N!==null&&ph(y,N)&&(i.flags|=32),i.memoizedState!==null&&(y=mf(n,i,NC,null,null,l),ao._currentValue=y),Ac(n,i),en(n,i,d,l),i.child;case 6:return n===null&&et&&((n=l=kt)&&(l=dN(l,i.pendingProps,Yn),l!==null?(i.stateNode=l,Jt=i,kt=null,n=!0):n=!1),n||hi(i)),null;case 13:return jv(n,i,l);case 4:return be(i,i.stateNode.containerInfo),d=i.pendingProps,n===null?i.child=vs(i,null,d,l):en(n,i,d,l),i.child;case 11:return yv(n,i,i.type,i.pendingProps,l);case 7:return en(n,i,i.pendingProps,l),i.child;case 8:return en(n,i,i.pendingProps.children,l),i.child;case 12:return en(n,i,i.pendingProps.children,l),i.child;case 10:return d=i.pendingProps,mi(i,i.type,d.value),en(n,i,d.children,l),i.child;case 9:return y=i.type._context,d=i.pendingProps.children,ms(i),y=Wt(y),d=d(y),i.flags|=1,en(n,i,d,l),i.child;case 14:return vv(n,i,i.type,i.pendingProps,l);case 15:return bv(n,i,i.type,i.pendingProps,l);case 19:return Ev(n,i,l);case 31:return LC(n,i,l);case 22:return xv(n,i,l,i.pendingProps);case 24:return ms(i),d=Wt(Bt),n===null?(y=af(),y===null&&(y=_t,x=tf(),y.pooledCache=x,x.refCount++,x!==null&&(y.pooledCacheLanes|=l),y=x),i.memoizedState={parent:d,cache:y},rf(i),mi(i,Bt,y)):((n.lanes&l)!==0&&(lf(n,i),Il(i,null,null,l),zl()),y=n.memoizedState,x=i.memoizedState,y.parent!==d?(y={parent:d,cache:d},i.memoizedState=y,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=y),mi(i,Bt,d)):(d=x.cache,mi(i,Bt,d),d!==y.cache&&ef(i,[Bt],l,!0))),en(n,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(s(156,i.tag))}function $a(n){n.flags|=4}function Pf(n,i,l,d,y){if((i=(n.mode&32)!==0)&&(i=!1),i){if(n.flags|=16777216,(y&335544128)===y)if(n.stateNode.complete)n.flags|=8192;else if(n1())n.flags|=8192;else throw ys=yc,sf}else n.flags&=-16777217}function Tv(n,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!V1(i))if(n1())n.flags|=8192;else throw ys=yc,sf}function Dc(n,i){i!==null&&(n.flags|=4),n.flags&16384&&(i=n.tag!==22?er():536870912,n.lanes|=i,Rr|=i)}function $l(n,i){if(!et)switch(n.tailMode){case"hidden":i=n.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?n.tail=null:l.sibling=null;break;case"collapsed":l=n.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:d.sibling=null}}function Et(n){var i=n.alternate!==null&&n.alternate.child===n.child,l=0,d=0;if(i)for(var y=n.child;y!==null;)l|=y.lanes|y.childLanes,d|=y.subtreeFlags&65011712,d|=y.flags&65011712,y.return=n,y=y.sibling;else for(y=n.child;y!==null;)l|=y.lanes|y.childLanes,d|=y.subtreeFlags,d|=y.flags,y.return=n,y=y.sibling;return n.subtreeFlags|=d,n.childLanes=l,i}function OC(n,i,l){var d=i.pendingProps;switch(Xd(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Et(i),null;case 1:return Et(i),null;case 3:return l=i.stateNode,d=null,n!==null&&(d=n.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),Ba(Bt),Ae(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(n===null||n.child===null)&&(gr(i)?$a(i):n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Zd())),Et(i),null;case 26:var y=i.type,x=i.memoizedState;return n===null?($a(i),x!==null?(Et(i),Tv(i,x)):(Et(i),Pf(i,y,null,d,l))):x?x!==n.memoizedState?($a(i),Et(i),Tv(i,x)):(Et(i),i.flags&=-16777217):(n=n.memoizedProps,n!==d&&$a(i),Et(i),Pf(i,y,n,d,l)),null;case 27:if(ot(i),l=me.current,y=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==d&&$a(i);else{if(!d){if(i.stateNode===null)throw Error(s(166));return Et(i),null}n=W.current,gr(i)?cy(i):(n=I1(y,d,l),i.stateNode=n,$a(i))}return Et(i),null;case 5:if(ot(i),y=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==d&&$a(i);else{if(!d){if(i.stateNode===null)throw Error(s(166));return Et(i),null}if(x=W.current,gr(i))cy(i);else{var N=Xc(me.current);switch(x){case 1:x=N.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:x=N.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":x=N.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":x=N.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":x=N.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof d.is=="string"?N.createElement("select",{is:d.is}):N.createElement("select"),d.multiple?x.multiple=!0:d.size&&(x.size=d.size);break;default:x=typeof d.is=="string"?N.createElement(y,{is:d.is}):N.createElement(y)}}x[ae]=i,x[xe]=d;e:for(N=i.child;N!==null;){if(N.tag===5||N.tag===6)x.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===i)break e;for(;N.sibling===null;){if(N.return===null||N.return===i)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}i.stateNode=x;e:switch(tn(x,y,d),y){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&$a(i)}}return Et(i),Pf(i,i.type,n===null?null:n.memoizedProps,i.pendingProps,l),null;case 6:if(n&&i.stateNode!=null)n.memoizedProps!==d&&$a(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(s(166));if(n=me.current,gr(i)){if(n=i.stateNode,l=i.memoizedProps,d=null,y=Jt,y!==null)switch(y.tag){case 27:case 5:d=y.memoizedProps}n[ae]=i,n=!!(n.nodeValue===l||d!==null&&d.suppressHydrationWarning===!0||j1(n.nodeValue,l)),n||hi(i,!0)}else n=Xc(n).createTextNode(d),n[ae]=i,i.stateNode=n}return Et(i),null;case 31:if(l=i.memoizedState,n===null||n.memoizedState!==null){if(d=gr(i),l!==null){if(n===null){if(!d)throw Error(s(318));if(n=i.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(557));n[ae]=i}else fs(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Et(i),n=!1}else l=Zd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=l),n=!0;if(!n)return i.flags&256?(Tn(i),i):(Tn(i),null);if((i.flags&128)!==0)throw Error(s(558))}return Et(i),null;case 13:if(d=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(y=gr(i),d!==null&&d.dehydrated!==null){if(n===null){if(!y)throw Error(s(318));if(y=i.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(s(317));y[ae]=i}else fs(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Et(i),y=!1}else y=Zd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=y),y=!0;if(!y)return i.flags&256?(Tn(i),i):(Tn(i),null)}return Tn(i),(i.flags&128)!==0?(i.lanes=l,i):(l=d!==null,n=n!==null&&n.memoizedState!==null,l&&(d=i.child,y=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(y=d.alternate.memoizedState.cachePool.pool),x=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(x=d.memoizedState.cachePool.pool),x!==y&&(d.flags|=2048)),l!==n&&l&&(i.child.flags|=8192),Dc(i,i.updateQueue),Et(i),null);case 4:return Ae(),n===null&&uh(i.stateNode.containerInfo),Et(i),null;case 10:return Ba(i.type),Et(i),null;case 19:if(ge(It),d=i.memoizedState,d===null)return Et(i),null;if(y=(i.flags&128)!==0,x=d.rendering,x===null)if(y)$l(d,!1);else{if(Dt!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(x=_c(n),x!==null){for(i.flags|=128,$l(d,!1),n=x.updateQueue,i.updateQueue=n,Dc(i,n),i.subtreeFlags=0,n=l,l=i.child;l!==null;)iy(l,n),l=l.sibling;return E(It,It.current&1|2),et&&Ia(i,d.treeForkCount),i.child}n=n.sibling}d.tail!==null&&At()>Bc&&(i.flags|=128,y=!0,$l(d,!1),i.lanes=4194304)}else{if(!y)if(n=_c(x),n!==null){if(i.flags|=128,y=!0,n=n.updateQueue,i.updateQueue=n,Dc(i,n),$l(d,!0),d.tail===null&&d.tailMode==="hidden"&&!x.alternate&&!et)return Et(i),null}else 2*At()-d.renderingStartTime>Bc&&l!==536870912&&(i.flags|=128,y=!0,$l(d,!1),i.lanes=4194304);d.isBackwards?(x.sibling=i.child,i.child=x):(n=d.last,n!==null?n.sibling=x:i.child=x,d.last=x)}return d.tail!==null?(n=d.tail,d.rendering=n,d.tail=n.sibling,d.renderingStartTime=At(),n.sibling=null,l=It.current,E(It,y?l&1|2:l&1),et&&Ia(i,d.treeForkCount),n):(Et(i),null);case 22:case 23:return Tn(i),df(),d=i.memoizedState!==null,n!==null?n.memoizedState!==null!==d&&(i.flags|=8192):d&&(i.flags|=8192),d?(l&536870912)!==0&&(i.flags&128)===0&&(Et(i),i.subtreeFlags&6&&(i.flags|=8192)):Et(i),l=i.updateQueue,l!==null&&Dc(i,l.retryQueue),l=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==l&&(i.flags|=2048),n!==null&&ge(ps),null;case 24:return l=null,n!==null&&(l=n.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),Ba(Bt),Et(i),null;case 25:return null;case 30:return null}throw Error(s(156,i.tag))}function zC(n,i){switch(Xd(i),i.tag){case 1:return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return Ba(Bt),Ae(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 26:case 27:case 5:return ot(i),null;case 31:if(i.memoizedState!==null){if(Tn(i),i.alternate===null)throw Error(s(340));fs()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 13:if(Tn(i),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(s(340));fs()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return ge(It),null;case 4:return Ae(),null;case 10:return Ba(i.type),null;case 22:case 23:return Tn(i),df(),n!==null&&ge(ps),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 24:return Ba(Bt),null;case 25:return null;default:return null}}function Mv(n,i){switch(Xd(i),i.tag){case 3:Ba(Bt),Ae();break;case 26:case 27:case 5:ot(i);break;case 4:Ae();break;case 31:i.memoizedState!==null&&Tn(i);break;case 13:Tn(i);break;case 19:ge(It);break;case 10:Ba(i.type);break;case 22:case 23:Tn(i),df(),n!==null&&ge(ps);break;case 24:Ba(Bt)}}function ql(n,i){try{var l=i.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var y=d.next;l=y;do{if((l.tag&n)===n){d=void 0;var x=l.create,N=l.inst;d=x(),N.destroy=d}l=l.next}while(l!==y)}}catch(L){ft(i,i.return,L)}}function xi(n,i,l){try{var d=i.updateQueue,y=d!==null?d.lastEffect:null;if(y!==null){var x=y.next;d=x;do{if((d.tag&n)===n){var N=d.inst,L=N.destroy;if(L!==void 0){N.destroy=void 0,y=i;var V=l,te=L;try{te()}catch(le){ft(y,V,le)}}}d=d.next}while(d!==x)}}catch(le){ft(i,i.return,le)}}function Av(n){var i=n.updateQueue;if(i!==null){var l=n.stateNode;try{Sy(i,l)}catch(d){ft(n,n.return,d)}}}function Lv(n,i,l){l.props=xs(n.type,n.memoizedProps),l.state=n.memoizedState;try{l.componentWillUnmount()}catch(d){ft(n,i,d)}}function Vl(n,i){try{var l=n.ref;if(l!==null){switch(n.tag){case 26:case 27:case 5:var d=n.stateNode;break;case 30:d=n.stateNode;break;default:d=n.stateNode}typeof l=="function"?n.refCleanup=l(d):l.current=d}}catch(y){ft(n,i,y)}}function xa(n,i){var l=n.ref,d=n.refCleanup;if(l!==null)if(typeof d=="function")try{d()}catch(y){ft(n,i,y)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(y){ft(n,i,y)}else l.current=null}function Dv(n){var i=n.type,l=n.memoizedProps,d=n.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":l.autoFocus&&d.focus();break e;case"img":l.src?d.src=l.src:l.srcSet&&(d.srcset=l.srcSet)}}catch(y){ft(n,n.return,y)}}function $f(n,i,l){try{var d=n.stateNode;iN(d,n.type,l,i),d[xe]=i}catch(y){ft(n,n.return,y)}}function Ov(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&ki(n.type)||n.tag===4}function qf(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Ov(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&ki(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Vf(n,i,l){var d=n.tag;if(d===5||d===6)n=n.stateNode,i?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(n,i):(i=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,i.appendChild(n),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=Da));else if(d!==4&&(d===27&&ki(n.type)&&(l=n.stateNode,i=null),n=n.child,n!==null))for(Vf(n,i,l),n=n.sibling;n!==null;)Vf(n,i,l),n=n.sibling}function Oc(n,i,l){var d=n.tag;if(d===5||d===6)n=n.stateNode,i?l.insertBefore(n,i):l.appendChild(n);else if(d!==4&&(d===27&&ki(n.type)&&(l=n.stateNode),n=n.child,n!==null))for(Oc(n,i,l),n=n.sibling;n!==null;)Oc(n,i,l),n=n.sibling}function zv(n){var i=n.stateNode,l=n.memoizedProps;try{for(var d=n.type,y=i.attributes;y.length;)i.removeAttributeNode(y[0]);tn(i,d,l),i[ae]=n,i[xe]=l}catch(x){ft(n,n.return,x)}}var qa=!1,Pt=!1,Yf=!1,Iv=typeof WeakSet=="function"?WeakSet:Set,Xt=null;function IC(n,i){if(n=n.containerInfo,hh=nu,n=Xg(n),Ud(n)){if("selectionStart"in n)var l={start:n.selectionStart,end:n.selectionEnd};else e:{l=(l=n.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var y=d.anchorOffset,x=d.focusNode;d=d.focusOffset;try{l.nodeType,x.nodeType}catch(ze){l=null;break e}var N=0,L=-1,V=-1,te=0,le=0,ue=n,ne=null;t:for(;;){for(var se;ue!==l||y!==0&&ue.nodeType!==3||(L=N+y),ue!==x||d!==0&&ue.nodeType!==3||(V=N+d),ue.nodeType===3&&(N+=ue.nodeValue.length),(se=ue.firstChild)!==null;)ne=ue,ue=se;for(;;){if(ue===n)break t;if(ne===l&&++te===y&&(L=N),ne===x&&++le===d&&(V=N),(se=ue.nextSibling)!==null)break;ue=ne,ne=ue.parentNode}ue=se}l=L===-1||V===-1?null:{start:L,end:V}}else l=null}l=l||{start:0,end:0}}else l=null;for(mh={focusedElem:n,selectionRange:l},nu=!1,Xt=i;Xt!==null;)if(i=Xt,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,Xt=n;else for(;Xt!==null;){switch(i=Xt,x=i.alternate,n=i.flags,i.tag){case 0:if((n&4)!==0&&(n=i.updateQueue,n=n!==null?n.events:null,n!==null))for(l=0;l<n.length;l++)y=n[l],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&x!==null){n=void 0,l=i,y=x.memoizedProps,x=x.memoizedState,d=l.stateNode;try{var we=xs(l.type,y);n=d.getSnapshotBeforeUpdate(we,x),d.__reactInternalSnapshotBeforeUpdate=n}catch(ze){ft(l,l.return,ze)}}break;case 3:if((n&1024)!==0){if(n=i.stateNode.containerInfo,l=n.nodeType,l===9)yh(n);else if(l===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":yh(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(s(163))}if(n=i.sibling,n!==null){n.return=i.return,Xt=n;break}Xt=i.return}}function Uv(n,i,l){var d=l.flags;switch(l.tag){case 0:case 11:case 15:Ya(n,l),d&4&&ql(5,l);break;case 1:if(Ya(n,l),d&4)if(n=l.stateNode,i===null)try{n.componentDidMount()}catch(N){ft(l,l.return,N)}else{var y=xs(l.type,i.memoizedProps);i=i.memoizedState;try{n.componentDidUpdate(y,i,n.__reactInternalSnapshotBeforeUpdate)}catch(N){ft(l,l.return,N)}}d&64&&Av(l),d&512&&Vl(l,l.return);break;case 3:if(Ya(n,l),d&64&&(n=l.updateQueue,n!==null)){if(i=null,l.child!==null)switch(l.child.tag){case 27:case 5:i=l.child.stateNode;break;case 1:i=l.child.stateNode}try{Sy(n,i)}catch(N){ft(l,l.return,N)}}break;case 27:i===null&&d&4&&zv(l);case 26:case 5:Ya(n,l),i===null&&d&4&&Dv(l),d&512&&Vl(l,l.return);break;case 12:Ya(n,l);break;case 31:Ya(n,l),d&4&&Hv(n,l);break;case 13:Ya(n,l),d&4&&Pv(n,l),d&64&&(n=l.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(l=YC.bind(null,l),fN(n,l))));break;case 22:if(d=l.memoizedState!==null||qa,!d){i=i!==null&&i.memoizedState!==null||Pt,y=qa;var x=Pt;qa=d,(Pt=i)&&!x?Ga(n,l,(l.subtreeFlags&8772)!==0):Ya(n,l),qa=y,Pt=x}break;case 30:break;default:Ya(n,l)}}function Bv(n){var i=n.alternate;i!==null&&(n.alternate=null,Bv(i)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(i=n.stateNode,i!==null&&sa(i)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var Mt=null,pn=!1;function Va(n,i,l){for(l=l.child;l!==null;)Fv(n,i,l),l=l.sibling}function Fv(n,i,l){if(Nt&&typeof Nt.onCommitFiberUnmount=="function")try{Nt.onCommitFiberUnmount(Tt,l)}catch(x){}switch(l.tag){case 26:Pt||xa(l,i),Va(n,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Pt||xa(l,i);var d=Mt,y=pn;ki(l.type)&&(Mt=l.stateNode,pn=!1),Va(n,i,l),eo(l.stateNode),Mt=d,pn=y;break;case 5:Pt||xa(l,i);case 6:if(d=Mt,y=pn,Mt=null,Va(n,i,l),Mt=d,pn=y,Mt!==null)if(pn)try{(Mt.nodeType===9?Mt.body:Mt.nodeName==="HTML"?Mt.ownerDocument.body:Mt).removeChild(l.stateNode)}catch(x){ft(l,i,x)}else try{Mt.removeChild(l.stateNode)}catch(x){ft(l,i,x)}break;case 18:Mt!==null&&(pn?(n=Mt,A1(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,l.stateNode),Ir(n)):A1(Mt,l.stateNode));break;case 4:d=Mt,y=pn,Mt=l.stateNode.containerInfo,pn=!0,Va(n,i,l),Mt=d,pn=y;break;case 0:case 11:case 14:case 15:xi(2,l,i),Pt||xi(4,l,i),Va(n,i,l);break;case 1:Pt||(xa(l,i),d=l.stateNode,typeof d.componentWillUnmount=="function"&&Lv(l,i,d)),Va(n,i,l);break;case 21:Va(n,i,l);break;case 22:Pt=(d=Pt)||l.memoizedState!==null,Va(n,i,l),Pt=d;break;default:Va(n,i,l)}}function Hv(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{Ir(n)}catch(l){ft(i,i.return,l)}}}function Pv(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{Ir(n)}catch(l){ft(i,i.return,l)}}function UC(n){switch(n.tag){case 31:case 13:case 19:var i=n.stateNode;return i===null&&(i=n.stateNode=new Iv),i;case 22:return n=n.stateNode,i=n._retryCache,i===null&&(i=n._retryCache=new Iv),i;default:throw Error(s(435,n.tag))}}function zc(n,i){var l=UC(n);i.forEach(function(d){if(!l.has(d)){l.add(d);var y=GC.bind(null,n,d);d.then(y,y)}})}function gn(n,i){var l=i.deletions;if(l!==null)for(var d=0;d<l.length;d++){var y=l[d],x=n,N=i,L=N;e:for(;L!==null;){switch(L.tag){case 27:if(ki(L.type)){Mt=L.stateNode,pn=!1;break e}break;case 5:Mt=L.stateNode,pn=!1;break e;case 3:case 4:Mt=L.stateNode.containerInfo,pn=!0;break e}L=L.return}if(Mt===null)throw Error(s(160));Fv(x,N,y),Mt=null,pn=!1,x=y.alternate,x!==null&&(x.return=null),y.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)$v(i,n),i=i.sibling}var la=null;function $v(n,i){var l=n.alternate,d=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:gn(i,n),yn(n),d&4&&(xi(3,n,n.return),ql(3,n),xi(5,n,n.return));break;case 1:gn(i,n),yn(n),d&512&&(Pt||l===null||xa(l,l.return)),d&64&&qa&&(n=n.updateQueue,n!==null&&(d=n.callbacks,d!==null&&(l=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=l===null?d:l.concat(d))));break;case 26:var y=la;if(gn(i,n),yn(n),d&512&&(Pt||l===null||xa(l,l.return)),d&4){var x=l!==null?l.memoizedState:null;if(d=n.memoizedState,l===null)if(d===null)if(n.stateNode===null){e:{d=n.type,l=n.memoizedProps,y=y.ownerDocument||y;t:switch(d){case"title":x=y.getElementsByTagName("title")[0],(!x||x[cn]||x[ae]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=y.createElement(d),y.head.insertBefore(x,y.querySelector("head > title"))),tn(x,d,l),x[ae]=n,Kt(x),d=x;break e;case"link":var N=$1("link","href",y).get(d+(l.href||""));if(N){for(var L=0;L<N.length;L++)if(x=N[L],x.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&x.getAttribute("rel")===(l.rel==null?null:l.rel)&&x.getAttribute("title")===(l.title==null?null:l.title)&&x.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){N.splice(L,1);break t}}x=y.createElement(d),tn(x,d,l),y.head.appendChild(x);break;case"meta":if(N=$1("meta","content",y).get(d+(l.content||""))){for(L=0;L<N.length;L++)if(x=N[L],x.getAttribute("content")===(l.content==null?null:""+l.content)&&x.getAttribute("name")===(l.name==null?null:l.name)&&x.getAttribute("property")===(l.property==null?null:l.property)&&x.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&x.getAttribute("charset")===(l.charSet==null?null:l.charSet)){N.splice(L,1);break t}}x=y.createElement(d),tn(x,d,l),y.head.appendChild(x);break;default:throw Error(s(468,d))}x[ae]=n,Kt(x),d=x}n.stateNode=d}else q1(y,n.type,n.stateNode);else n.stateNode=P1(y,d,n.memoizedProps);else x!==d?(x===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):x.count--,d===null?q1(y,n.type,n.stateNode):P1(y,d,n.memoizedProps)):d===null&&n.stateNode!==null&&$f(n,n.memoizedProps,l.memoizedProps)}break;case 27:gn(i,n),yn(n),d&512&&(Pt||l===null||xa(l,l.return)),l!==null&&d&4&&$f(n,n.memoizedProps,l.memoizedProps);break;case 5:if(gn(i,n),yn(n),d&512&&(Pt||l===null||xa(l,l.return)),n.flags&32){y=n.stateNode;try{rr(y,"")}catch(we){ft(n,n.return,we)}}d&4&&n.stateNode!=null&&(y=n.memoizedProps,$f(n,y,l!==null?l.memoizedProps:y)),d&1024&&(Yf=!0);break;case 6:if(gn(i,n),yn(n),d&4){if(n.stateNode===null)throw Error(s(162));d=n.memoizedProps,l=n.stateNode;try{l.nodeValue=d}catch(we){ft(n,n.return,we)}}break;case 3:if(Jc=null,y=la,la=Qc(i.containerInfo),gn(i,n),la=y,yn(n),d&4&&l!==null&&l.memoizedState.isDehydrated)try{Ir(i.containerInfo)}catch(we){ft(n,n.return,we)}Yf&&(Yf=!1,qv(n));break;case 4:d=la,la=Qc(n.stateNode.containerInfo),gn(i,n),yn(n),la=d;break;case 12:gn(i,n),yn(n);break;case 31:gn(i,n),yn(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,zc(n,d)));break;case 13:gn(i,n),yn(n),n.child.flags&8192&&n.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Uc=At()),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,zc(n,d)));break;case 22:y=n.memoizedState!==null;var V=l!==null&&l.memoizedState!==null,te=qa,le=Pt;if(qa=te||y,Pt=le||V,gn(i,n),Pt=le,qa=te,yn(n),d&8192)e:for(i=n.stateNode,i._visibility=y?i._visibility&-2:i._visibility|1,y&&(l===null||V||qa||Pt||_s(n)),l=null,i=n;;){if(i.tag===5||i.tag===26){if(l===null){V=l=i;try{if(x=V.stateNode,y)N=x.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{L=V.stateNode;var ue=V.memoizedProps.style,ne=ue!=null&&ue.hasOwnProperty("display")?ue.display:null;L.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(we){ft(V,V.return,we)}}}else if(i.tag===6){if(l===null){V=i;try{V.stateNode.nodeValue=y?"":V.memoizedProps}catch(we){ft(V,V.return,we)}}}else if(i.tag===18){if(l===null){V=i;try{var se=V.stateNode;y?L1(se,!0):L1(V.stateNode,!1)}catch(we){ft(V,V.return,we)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===n)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break e;for(;i.sibling===null;){if(i.return===null||i.return===n)break e;l===i&&(l=null),i=i.return}l===i&&(l=null),i.sibling.return=i.return,i=i.sibling}d&4&&(d=n.updateQueue,d!==null&&(l=d.retryQueue,l!==null&&(d.retryQueue=null,zc(n,l))));break;case 19:gn(i,n),yn(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,zc(n,d)));break;case 30:break;case 21:break;default:gn(i,n),yn(n)}}function yn(n){var i=n.flags;if(i&2){try{for(var l,d=n.return;d!==null;){if(Ov(d)){l=d;break}d=d.return}if(l==null)throw Error(s(160));switch(l.tag){case 27:var y=l.stateNode,x=qf(n);Oc(n,x,y);break;case 5:var N=l.stateNode;l.flags&32&&(rr(N,""),l.flags&=-33);var L=qf(n);Oc(n,L,N);break;case 3:case 4:var V=l.stateNode.containerInfo,te=qf(n);Vf(n,te,V);break;default:throw Error(s(161))}}catch(le){ft(n,n.return,le)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function qv(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var i=n;qv(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),n=n.sibling}}function Ya(n,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Uv(n,i.alternate,i),i=i.sibling}function _s(n){for(n=n.child;n!==null;){var i=n;switch(i.tag){case 0:case 11:case 14:case 15:xi(4,i,i.return),_s(i);break;case 1:xa(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&Lv(i,i.return,l),_s(i);break;case 27:eo(i.stateNode);case 26:case 5:xa(i,i.return),_s(i);break;case 22:i.memoizedState===null&&_s(i);break;case 30:_s(i);break;default:_s(i)}n=n.sibling}}function Ga(n,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var d=i.alternate,y=n,x=i,N=x.flags;switch(x.tag){case 0:case 11:case 15:Ga(y,x,l),ql(4,x);break;case 1:if(Ga(y,x,l),d=x,y=d.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(te){ft(d,d.return,te)}if(d=x,y=d.updateQueue,y!==null){var L=d.stateNode;try{var V=y.shared.hiddenCallbacks;if(V!==null)for(y.shared.hiddenCallbacks=null,y=0;y<V.length;y++)_y(V[y],L)}catch(te){ft(d,d.return,te)}}l&&N&64&&Av(x),Vl(x,x.return);break;case 27:zv(x);case 26:case 5:Ga(y,x,l),l&&d===null&&N&4&&Dv(x),Vl(x,x.return);break;case 12:Ga(y,x,l);break;case 31:Ga(y,x,l),l&&N&4&&Hv(y,x);break;case 13:Ga(y,x,l),l&&N&4&&Pv(y,x);break;case 22:x.memoizedState===null&&Ga(y,x,l),Vl(x,x.return);break;case 30:break;default:Ga(y,x,l)}i=i.sibling}}function Gf(n,i){var l=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),n=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(n=i.memoizedState.cachePool.pool),n!==l&&(n!=null&&n.refCount++,l!=null&&Ml(l))}function Kf(n,i){n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&Ml(n))}function oa(n,i,l,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Vv(n,i,l,d),i=i.sibling}function Vv(n,i,l,d){var y=i.flags;switch(i.tag){case 0:case 11:case 15:oa(n,i,l,d),y&2048&&ql(9,i);break;case 1:oa(n,i,l,d);break;case 3:oa(n,i,l,d),y&2048&&(n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&Ml(n)));break;case 12:if(y&2048){oa(n,i,l,d),n=i.stateNode;try{var x=i.memoizedProps,N=x.id,L=x.onPostCommit;typeof L=="function"&&L(N,i.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(V){ft(i,i.return,V)}}else oa(n,i,l,d);break;case 31:oa(n,i,l,d);break;case 13:oa(n,i,l,d);break;case 23:break;case 22:x=i.stateNode,N=i.alternate,i.memoizedState!==null?x._visibility&2?oa(n,i,l,d):Yl(n,i):x._visibility&2?oa(n,i,l,d):(x._visibility|=2,jr(n,i,l,d,(i.subtreeFlags&10256)!==0||!1)),y&2048&&Gf(N,i);break;case 24:oa(n,i,l,d),y&2048&&Kf(i.alternate,i);break;default:oa(n,i,l,d)}}function jr(n,i,l,d,y){for(y=y&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var x=n,N=i,L=l,V=d,te=N.flags;switch(N.tag){case 0:case 11:case 15:jr(x,N,L,V,y),ql(8,N);break;case 23:break;case 22:var le=N.stateNode;N.memoizedState!==null?le._visibility&2?jr(x,N,L,V,y):Yl(x,N):(le._visibility|=2,jr(x,N,L,V,y)),y&&te&2048&&Gf(N.alternate,N);break;case 24:jr(x,N,L,V,y),y&&te&2048&&Kf(N.alternate,N);break;default:jr(x,N,L,V,y)}i=i.sibling}}function Yl(n,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=n,d=i,y=d.flags;switch(d.tag){case 22:Yl(l,d),y&2048&&Gf(d.alternate,d);break;case 24:Yl(l,d),y&2048&&Kf(d.alternate,d);break;default:Yl(l,d)}i=i.sibling}}var Gl=8192;function kr(n,i,l){if(n.subtreeFlags&Gl)for(n=n.child;n!==null;)Yv(n,i,l),n=n.sibling}function Yv(n,i,l){switch(n.tag){case 26:kr(n,i,l),n.flags&Gl&&n.memoizedState!==null&&CN(l,la,n.memoizedState,n.memoizedProps);break;case 5:kr(n,i,l);break;case 3:case 4:var d=la;la=Qc(n.stateNode.containerInfo),kr(n,i,l),la=d;break;case 22:n.memoizedState===null&&(d=n.alternate,d!==null&&d.memoizedState!==null?(d=Gl,Gl=16777216,kr(n,i,l),Gl=d):kr(n,i,l));break;default:kr(n,i,l)}}function Gv(n){var i=n.alternate;if(i!==null&&(n=i.child,n!==null)){i.child=null;do i=n.sibling,n.sibling=null,n=i;while(n!==null)}}function Kl(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];Xt=d,Xv(d,n)}Gv(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Kv(n),n=n.sibling}function Kv(n){switch(n.tag){case 0:case 11:case 15:Kl(n),n.flags&2048&&xi(9,n,n.return);break;case 3:Kl(n);break;case 12:Kl(n);break;case 22:var i=n.stateNode;n.memoizedState!==null&&i._visibility&2&&(n.return===null||n.return.tag!==13)?(i._visibility&=-3,Ic(n)):Kl(n);break;default:Kl(n)}}function Ic(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];Xt=d,Xv(d,n)}Gv(n)}for(n=n.child;n!==null;){switch(i=n,i.tag){case 0:case 11:case 15:xi(8,i,i.return),Ic(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,Ic(i));break;default:Ic(i)}n=n.sibling}}function Xv(n,i){for(;Xt!==null;){var l=Xt;switch(l.tag){case 0:case 11:case 15:xi(8,l,i);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var d=l.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:Ml(l.memoizedState.cache)}if(d=l.child,d!==null)d.return=l,Xt=d;else e:for(l=n;Xt!==null;){d=Xt;var y=d.sibling,x=d.return;if(Bv(d),d===l){Xt=null;break e}if(y!==null){y.return=x,Xt=y;break e}Xt=x}}}var BC={getCacheForType:function(n){var i=Wt(Bt),l=i.data.get(n);return l===void 0&&(l=n(),i.data.set(n,l)),l},cacheSignal:function(){return Wt(Bt).controller.signal}},FC=typeof WeakMap=="function"?WeakMap:Map,rt=0,_t=null,Ke=null,Ze=0,dt=0,Mn=null,_i=!1,Er=!1,Xf=!1,Ka=0,Dt=0,Si=0,Ss=0,Qf=0,An=0,Rr=0,Xl=null,vn=null,Zf=!1,Uc=0,Qv=0,Bc=1/0,Fc=null,wi=null,Vt=0,Ci=null,Tr=null,Xa=0,Jf=0,Wf=null,Zv=null,Ql=0,eh=null;function Ln(){return(rt&2)!==0&&Ze!==0?Ze&-Ze:$.T!==null?rh():Qo()}function Jv(){if(An===0)if((Ze&536870912)===0||et){var n=Js;Js<<=1,(Js&3932160)===0&&(Js=262144),An=n}else An=536870912;return n=Rn.current,n!==null&&(n.flags|=32),An}function bn(n,i,l){(n===_t&&(dt===2||dt===9)||n.cancelPendingCommit!==null)&&(Mr(n,0),Ni(n,Ze,An,!1)),ss(n,l),((rt&2)===0||n!==_t)&&(n===_t&&((rt&2)===0&&(Ss|=l),Dt===4&&Ni(n,Ze,An,!1)),_a(n))}function Wv(n,i,l){if((rt&6)!==0)throw Error(s(327));var d=!l&&(i&127)===0&&(i&n.expiredLanes)===0||Bn(n,i),y=d?$C(n,i):nh(n,i,!0),x=d;do{if(y===0){Er&&!d&&Ni(n,i,0,!1);break}else{if(l=n.current.alternate,x&&!HC(l)){y=nh(n,i,!1),x=!1;continue}if(y===2){if(x=i,n.errorRecoveryDisabledLanes&x)var N=0;else N=n.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){i=N;e:{var L=n;y=Xl;var V=L.current.memoizedState.isDehydrated;if(V&&(Mr(L,N).flags|=256),N=nh(L,N,!1),N!==2){if(Xf&&!V){L.errorRecoveryDisabledLanes|=x,Ss|=x,y=4;break e}x=vn,vn=y,x!==null&&(vn===null?vn=x:vn.push.apply(vn,x))}y=N}if(x=!1,y!==2)continue}}if(y===1){Mr(n,0),Ni(n,i,0,!0);break}e:{switch(d=n,x=y,x){case 0:case 1:throw Error(s(345));case 4:if((i&4194048)!==i)break;case 6:Ni(d,i,An,!_i);break e;case 2:vn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((i&62914560)===i&&(y=Uc+300-At(),10<y)){if(Ni(d,i,An,!_i),Ma(d,0,!0)!==0)break e;Xa=i,d.timeoutHandle=T1(e1.bind(null,d,l,vn,Fc,Zf,i,An,Ss,Rr,_i,x,"Throttled",-0,0),y);break e}e1(d,l,vn,Fc,Zf,i,An,Ss,Rr,_i,x,null,-0,0)}}break}while(!0);_a(n)}function e1(n,i,l,d,y,x,N,L,V,te,le,ue,ne,se){if(n.timeoutHandle=-1,ue=i.subtreeFlags,ue&8192||(ue&16785408)===16785408){ue={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Da},Yv(i,x,ue);var we=(x&62914560)===x?Uc-At():(x&4194048)===x?Qv-At():0;if(we=NN(ue,we),we!==null){Xa=x,n.cancelPendingCommit=we(o1.bind(null,n,i,x,l,d,y,N,L,V,le,ue,null,ne,se)),Ni(n,x,N,!te);return}}o1(n,i,x,l,d,y,N,L,V)}function HC(n){for(var i=n;;){var l=i.tag;if((l===0||l===11||l===15)&&i.flags&16384&&(l=i.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var d=0;d<l.length;d++){var y=l[d],x=y.getSnapshot;y=y.value;try{if(!kn(x(),y))return!1}catch(N){return!1}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Ni(n,i,l,d){i&=~Qf,i&=~Ss,n.suspendedLanes|=i,n.pingedLanes&=~i,d&&(n.warmLanes|=i),d=n.expirationTimes;for(var y=i;0<y;){var x=31-ut(y),N=1<<x;d[x]=-1,y&=~N}l!==0&&gl(n,l,i)}function Hc(){return(rt&6)===0?(Zl(0),!1):!0}function th(){if(Ke!==null){if(dt===0)var n=Ke.return;else n=Ke,Ua=hs=null,yf(n),_r=null,Ll=0,n=Ke;for(;n!==null;)Mv(n.alternate,n),n=n.return;Ke=null}}function Mr(n,i){var l=n.timeoutHandle;l!==-1&&(n.timeoutHandle=-1,lN(l)),l=n.cancelPendingCommit,l!==null&&(n.cancelPendingCommit=null,l()),Xa=0,th(),_t=n,Ke=l=za(n.current,null),Ze=i,dt=0,Mn=null,_i=!1,Er=Bn(n,i),Xf=!1,Rr=An=Qf=Ss=Si=Dt=0,vn=Xl=null,Zf=!1,(i&8)!==0&&(i|=i&32);var d=n.entangledLanes;if(d!==0)for(n=n.entanglements,d&=i;0<d;){var y=31-ut(d),x=1<<y;i|=n[y],d&=~x}return Ka=i,oc(),l}function t1(n,i){Pe=null,$.H=Hl,i===xr||i===gc?(i=yy(),dt=3):i===sf?(i=yy(),dt=4):dt=i===Lf?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Mn=i,Ke===null&&(Dt=1,Tc(n,$n(i,n.current)))}function n1(){var n=Rn.current;return n===null?!0:(Ze&4194048)===Ze?Gn===null:(Ze&62914560)===Ze||(Ze&536870912)!==0?n===Gn:!1}function a1(){var n=$.H;return $.H=Hl,n===null?Hl:n}function i1(){var n=$.A;return $.A=BC,n}function Pc(){Dt=4,_i||(Ze&4194048)!==Ze&&Rn.current!==null||(Er=!0),(Si&134217727)===0&&(Ss&134217727)===0||_t===null||Ni(_t,Ze,An,!1)}function nh(n,i,l){var d=rt;rt|=2;var y=a1(),x=i1();(_t!==n||Ze!==i)&&(Fc=null,Mr(n,i)),i=!1;var N=Dt;e:do try{if(dt!==0&&Ke!==null){var L=Ke,V=Mn;switch(dt){case 8:th(),N=6;break e;case 3:case 2:case 9:case 6:Rn.current===null&&(i=!0);var te=dt;if(dt=0,Mn=null,Ar(n,L,V,te),l&&Er){N=0;break e}break;default:te=dt,dt=0,Mn=null,Ar(n,L,V,te)}}PC(),N=Dt;break}catch(le){t1(n,le)}while(!0);return i&&n.shellSuspendCounter++,Ua=hs=null,rt=d,$.H=y,$.A=x,Ke===null&&(_t=null,Ze=0,oc()),N}function PC(){for(;Ke!==null;)s1(Ke)}function $C(n,i){var l=rt;rt|=2;var d=a1(),y=i1();_t!==n||Ze!==i?(Fc=null,Bc=At()+500,Mr(n,i)):Er=Bn(n,i);e:do try{if(dt!==0&&Ke!==null){i=Ke;var x=Mn;t:switch(dt){case 1:dt=0,Mn=null,Ar(n,i,x,1);break;case 2:case 9:if(py(x)){dt=0,Mn=null,r1(i);break}i=function(){dt!==2&&dt!==9||_t!==n||(dt=7),_a(n)},x.then(i,i);break e;case 3:dt=7;break e;case 4:dt=5;break e;case 7:py(x)?(dt=0,Mn=null,r1(i)):(dt=0,Mn=null,Ar(n,i,x,7));break;case 5:var N=null;switch(Ke.tag){case 26:N=Ke.memoizedState;case 5:case 27:var L=Ke;if(N?V1(N):L.stateNode.complete){dt=0,Mn=null;var V=L.sibling;if(V!==null)Ke=V;else{var te=L.return;te!==null?(Ke=te,$c(te)):Ke=null}break t}}dt=0,Mn=null,Ar(n,i,x,5);break;case 6:dt=0,Mn=null,Ar(n,i,x,6);break;case 8:th(),Dt=6;break e;default:throw Error(s(462))}}qC();break}catch(le){t1(n,le)}while(!0);return Ua=hs=null,$.H=d,$.A=y,rt=l,Ke!==null?0:(_t=null,Ze=0,oc(),Dt)}function qC(){for(;Ke!==null&&!Ta();)s1(Ke)}function s1(n){var i=Rv(n.alternate,n,Ka);n.memoizedProps=n.pendingProps,i===null?$c(n):Ke=i}function r1(n){var i=n,l=i.alternate;switch(i.tag){case 15:case 0:i=wv(l,i,i.pendingProps,i.type,void 0,Ze);break;case 11:i=wv(l,i,i.pendingProps,i.type.render,i.ref,Ze);break;case 5:yf(i);default:Mv(l,i),i=Ke=iy(i,Ka),i=Rv(l,i,Ka)}n.memoizedProps=n.pendingProps,i===null?$c(n):Ke=i}function Ar(n,i,l,d){Ua=hs=null,yf(i),_r=null,Ll=0;var y=i.return;try{if(AC(n,y,i,l,Ze)){Dt=1,Tc(n,$n(l,n.current)),Ke=null;return}}catch(x){if(y!==null)throw Ke=y,x;Dt=1,Tc(n,$n(l,n.current)),Ke=null;return}i.flags&32768?(et||d===1?n=!0:Er||(Ze&536870912)!==0?n=!1:(_i=n=!0,(d===2||d===9||d===3||d===6)&&(d=Rn.current,d!==null&&d.tag===13&&(d.flags|=16384))),l1(i,n)):$c(i)}function $c(n){var i=n;do{if((i.flags&32768)!==0){l1(i,_i);return}n=i.return;var l=OC(i.alternate,i,Ka);if(l!==null){Ke=l;return}if(i=i.sibling,i!==null){Ke=i;return}Ke=i=n}while(i!==null);Dt===0&&(Dt=5)}function l1(n,i){do{var l=zC(n.alternate,n);if(l!==null){l.flags&=32767,Ke=l;return}if(l=n.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(n=n.sibling,n!==null)){Ke=n;return}Ke=n=l}while(n!==null);Dt=6,Ke=null}function o1(n,i,l,d,y,x,N,L,V){n.cancelPendingCommit=null;do qc();while(Vt!==0);if((rt&6)!==0)throw Error(s(327));if(i!==null){if(i===n.current)throw Error(s(177));if(x=i.lanes|i.childLanes,x|=$d,_d(n,l,x,N,L,V),n===_t&&(Ke=_t=null,Ze=0),Tr=i,Ci=n,Xa=l,Jf=x,Wf=y,Zv=d,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,KC(Ee,function(){return h1(),null})):(n.callbackNode=null,n.callbackPriority=0),d=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||d){d=$.T,$.T=null,y=X.p,X.p=2,N=rt,rt|=4;try{IC(n,i,l)}finally{rt=N,X.p=y,$.T=d}}Vt=1,c1(),u1(),d1()}}function c1(){if(Vt===1){Vt=0;var n=Ci,i=Tr,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=$.T,$.T=null;var d=X.p;X.p=2;var y=rt;rt|=4;try{$v(i,n);var x=mh,N=Xg(n.containerInfo),L=x.focusedElem,V=x.selectionRange;if(N!==L&&L&&L.ownerDocument&&Kg(L.ownerDocument.documentElement,L)){if(V!==null&&Ud(L)){var te=V.start,le=V.end;if(le===void 0&&(le=te),"selectionStart"in L)L.selectionStart=te,L.selectionEnd=Math.min(le,L.value.length);else{var ue=L.ownerDocument||document,ne=ue&&ue.defaultView||window;if(ne.getSelection){var se=ne.getSelection(),we=L.textContent.length,ze=Math.min(V.start,we),vt=V.end===void 0?ze:Math.min(V.end,we);!se.extend&&ze>vt&&(N=vt,vt=ze,ze=N);var J=Gg(L,ze),Q=Gg(L,vt);if(J&&Q&&(se.rangeCount!==1||se.anchorNode!==J.node||se.anchorOffset!==J.offset||se.focusNode!==Q.node||se.focusOffset!==Q.offset)){var ee=ue.createRange();ee.setStart(J.node,J.offset),se.removeAllRanges(),ze>vt?(se.addRange(ee),se.extend(Q.node,Q.offset)):(ee.setEnd(Q.node,Q.offset),se.addRange(ee))}}}}for(ue=[],se=L;se=se.parentNode;)se.nodeType===1&&ue.push({element:se,left:se.scrollLeft,top:se.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<ue.length;L++){var ce=ue[L];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}nu=!!hh,mh=hh=null}finally{rt=y,X.p=d,$.T=l}}n.current=i,Vt=2}}function u1(){if(Vt===2){Vt=0;var n=Ci,i=Tr,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=$.T,$.T=null;var d=X.p;X.p=2;var y=rt;rt|=4;try{Uv(n,i.alternate,i)}finally{rt=y,X.p=d,$.T=l}}Vt=3}}function d1(){if(Vt===4||Vt===3){Vt=0,ri();var n=Ci,i=Tr,l=Xa,d=Zv;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Vt=5:(Vt=0,Tr=Ci=null,f1(n,n.pendingLanes));var y=n.pendingLanes;if(y===0&&(wi=null),vl(l),i=i.stateNode,Nt&&typeof Nt.onCommitFiberRoot=="function")try{Nt.onCommitFiberRoot(Tt,i,void 0,(i.current.flags&128)===128)}catch(V){}if(d!==null){i=$.T,y=X.p,X.p=2,$.T=null;try{for(var x=n.onRecoverableError,N=0;N<d.length;N++){var L=d[N];x(L.value,{componentStack:L.stack})}}finally{$.T=i,X.p=y}}(Xa&3)!==0&&qc(),_a(n),y=n.pendingLanes,(l&261930)!==0&&(y&42)!==0?n===eh?Ql++:(Ql=0,eh=n):Ql=0,Zl(0)}}function f1(n,i){(n.pooledCacheLanes&=i)===0&&(i=n.pooledCache,i!=null&&(n.pooledCache=null,Ml(i)))}function qc(){return c1(),u1(),d1(),h1()}function h1(){if(Vt!==5)return!1;var n=Ci,i=Jf;Jf=0;var l=vl(Xa),d=$.T,y=X.p;try{X.p=32>l?32:l,$.T=null,l=Wf,Wf=null;var x=Ci,N=Xa;if(Vt=0,Tr=Ci=null,Xa=0,(rt&6)!==0)throw Error(s(331));var L=rt;if(rt|=4,Kv(x.current),Vv(x,x.current,N,l),rt=L,Zl(0,!1),Nt&&typeof Nt.onPostCommitFiberRoot=="function")try{Nt.onPostCommitFiberRoot(Tt,x)}catch(V){}return!0}finally{X.p=y,$.T=d,f1(n,i)}}function m1(n,i,l){i=$n(l,i),i=Af(n.stateNode,i,2),n=yi(n,i,2),n!==null&&(ss(n,2),_a(n))}function ft(n,i,l){if(n.tag===3)m1(n,n,l);else for(;i!==null;){if(i.tag===3){m1(i,n,l);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(wi===null||!wi.has(d))){n=$n(l,n),l=pv(2),d=yi(i,l,2),d!==null&&(gv(l,d,i,n),ss(d,2),_a(d));break}}i=i.return}}function ah(n,i,l){var d=n.pingCache;if(d===null){d=n.pingCache=new FC;var y=new Set;d.set(i,y)}else y=d.get(i),y===void 0&&(y=new Set,d.set(i,y));y.has(l)||(Xf=!0,y.add(l),n=VC.bind(null,n,i,l),i.then(n,n))}function VC(n,i,l){var d=n.pingCache;d!==null&&d.delete(i),n.pingedLanes|=n.suspendedLanes&l,n.warmLanes&=~l,_t===n&&(Ze&l)===l&&(Dt===4||Dt===3&&(Ze&62914560)===Ze&&300>At()-Uc?(rt&2)===0&&Mr(n,0):Qf|=l,Rr===Ze&&(Rr=0)),_a(n)}function p1(n,i){i===0&&(i=er()),n=us(n,i),n!==null&&(ss(n,i),_a(n))}function YC(n){var i=n.memoizedState,l=0;i!==null&&(l=i.retryLane),p1(n,l)}function GC(n,i){var l=0;switch(n.tag){case 31:case 13:var d=n.stateNode,y=n.memoizedState;y!==null&&(l=y.retryLane);break;case 19:d=n.stateNode;break;case 22:d=n.stateNode._retryCache;break;default:throw Error(s(314))}d!==null&&d.delete(i),p1(n,l)}function KC(n,i){return ma(n,i)}var Vc=null,Lr=null,ih=!1,Yc=!1,sh=!1,ji=0;function _a(n){n!==Lr&&n.next===null&&(Lr===null?Vc=Lr=n:Lr=Lr.next=n),Yc=!0,ih||(ih=!0,QC())}function Zl(n,i){if(!sh&&Yc){sh=!0;do for(var l=!1,d=Vc;d!==null;){if(n!==0){var y=d.pendingLanes;if(y===0)var x=0;else{var N=d.suspendedLanes,L=d.pingedLanes;x=(1<<31-ut(42|n)+1)-1,x&=y&~(N&~L),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(l=!0,b1(d,x))}else x=Ze,x=Ma(d,d===_t?x:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(x&3)===0||Bn(d,x)||(l=!0,b1(d,x));d=d.next}while(l);sh=!1}}function XC(){g1()}function g1(){Yc=ih=!1;var n=0;ji!==0&&rN()&&(n=ji);for(var i=At(),l=null,d=Vc;d!==null;){var y=d.next,x=y1(d,i);x===0?(d.next=null,l===null?Vc=y:l.next=y,y===null&&(Lr=l)):(l=d,(n!==0||(x&3)!==0)&&(Yc=!0)),d=y}Vt!==0&&Vt!==5||Zl(n),ji!==0&&(ji=0)}function y1(n,i){for(var l=n.suspendedLanes,d=n.pingedLanes,y=n.expirationTimes,x=n.pendingLanes&-62914561;0<x;){var N=31-ut(x),L=1<<N,V=y[N];V===-1?((L&l)===0||(L&d)!==0)&&(y[N]=Ws(L,i)):V<=i&&(n.expiredLanes|=L),x&=~L}if(i=_t,l=Ze,l=Ma(n,n===i?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d=n.callbackNode,l===0||n===i&&(dt===2||dt===9)||n.cancelPendingCommit!==null)return d!==null&&d!==null&&pa(d),n.callbackNode=null,n.callbackPriority=0;if((l&3)===0||Bn(n,l)){if(i=l&-l,i===n.callbackPriority)return i;switch(d!==null&&pa(d),vl(l)){case 2:case 8:l=ve;break;case 32:l=Ee;break;case 268435456:l=Re;break;default:l=Ee}return d=v1.bind(null,n),l=ma(l,d),n.callbackPriority=i,n.callbackNode=l,i}return d!==null&&d!==null&&pa(d),n.callbackPriority=2,n.callbackNode=null,2}function v1(n,i){if(Vt!==0&&Vt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var l=n.callbackNode;if(qc()&&n.callbackNode!==l)return null;var d=Ze;return d=Ma(n,n===_t?d:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d===0?null:(Wv(n,d,i),y1(n,At()),n.callbackNode!=null&&n.callbackNode===l?v1.bind(null,n):null)}function b1(n,i){if(qc())return null;Wv(n,i,!0)}function QC(){oN(function(){(rt&6)!==0?ma(re,XC):g1()})}function rh(){if(ji===0){var n=vr;n===0&&(n=Zs,Zs<<=1,(Zs&261888)===0&&(Zs=256)),ji=n}return ji}function x1(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:ec(""+n)}function _1(n,i){var l=i.ownerDocument.createElement("input");return l.name=i.name,l.value=i.value,n.id&&l.setAttribute("form",n.id),i.parentNode.insertBefore(l,i),n=new FormData(n),l.parentNode.removeChild(l),n}function ZC(n,i,l,d,y){if(i==="submit"&&l&&l.stateNode===y){var x=x1((y[xe]||null).action),N=d.submitter;N&&(i=(i=N[xe]||null)?x1(i.formAction):N.getAttribute("formAction"),i!==null&&(x=i,N=null));var L=new ic("action","action",null,d,y);n.push({event:L,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(ji!==0){var V=N?_1(y,N):new FormData(y);jf(l,{pending:!0,data:V,method:y.method,action:x},null,V)}}else typeof x=="function"&&(L.preventDefault(),V=N?_1(y,N):new FormData(y),jf(l,{pending:!0,data:V,method:y.method,action:x},x,V))},currentTarget:y}]})}}for(var lh=0;lh<Pd.length;lh++){var oh=Pd[lh],JC=oh.toLowerCase(),WC=oh[0].toUpperCase()+oh.slice(1);ra(JC,"on"+WC)}ra(Jg,"onAnimationEnd"),ra(Wg,"onAnimationIteration"),ra(ey,"onAnimationStart"),ra("dblclick","onDoubleClick"),ra("focusin","onFocus"),ra("focusout","onBlur"),ra(pC,"onTransitionRun"),ra(gC,"onTransitionStart"),ra(yC,"onTransitionCancel"),ra(ty,"onTransitionEnd"),ir("onMouseEnter",["mouseout","mouseover"]),ir("onMouseLeave",["mouseout","mouseover"]),ir("onPointerEnter",["pointerout","pointerover"]),ir("onPointerLeave",["pointerout","pointerover"]),rs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),rs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),rs("onBeforeInput",["compositionend","keypress","textInput","paste"]),rs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),rs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),rs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),eN=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Jl));function S1(n,i){i=(i&4)!==0;for(var l=0;l<n.length;l++){var d=n[l],y=d.event;d=d.listeners;e:{var x=void 0;if(i)for(var N=d.length-1;0<=N;N--){var L=d[N],V=L.instance,te=L.currentTarget;if(L=L.listener,V!==x&&y.isPropagationStopped())break e;x=L,y.currentTarget=te;try{x(y)}catch(le){lc(le)}y.currentTarget=null,x=V}else for(N=0;N<d.length;N++){if(L=d[N],V=L.instance,te=L.currentTarget,L=L.listener,V!==x&&y.isPropagationStopped())break e;x=L,y.currentTarget=te;try{x(y)}catch(le){lc(le)}y.currentTarget=null,x=V}}}}function Xe(n,i){var l=i[He];l===void 0&&(l=i[He]=new Set);var d=n+"__bubble";l.has(d)||(w1(i,n,2,!1),l.add(d))}function ch(n,i,l){var d=0;i&&(d|=4),w1(l,n,d,i)}var Gc="_reactListening"+Math.random().toString(36).slice(2);function uh(n){if(!n[Gc]){n[Gc]=!0,gg.forEach(function(l){l!=="selectionchange"&&(eN.has(l)||ch(l,!1,n),ch(l,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[Gc]||(i[Gc]=!0,ch("selectionchange",!1,i))}}function w1(n,i,l,d){switch(J1(i)){case 2:var y=EN;break;case 8:y=RN;break;default:y=Nh}l=y.bind(null,i,l,n),y=void 0,!Rd||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(y=!0),d?y!==void 0?n.addEventListener(i,l,{capture:!0,passive:y}):n.addEventListener(i,l,!0):y!==void 0?n.addEventListener(i,l,{passive:y}):n.addEventListener(i,l,!1)}function dh(n,i,l,d,y){var x=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var N=d.tag;if(N===3||N===4){var L=d.stateNode.containerInfo;if(L===y)break;if(N===4)for(N=d.return;N!==null;){var V=N.tag;if((V===3||V===4)&&N.stateNode.containerInfo===y)return;N=N.return}for(;L!==null;){if(N=ci(L),N===null)return;if(V=N.tag,V===5||V===6||V===26||V===27){d=x=N;continue e}L=L.parentNode}}d=d.return}Eg(function(){var te=x,le=kd(l),ue=[];e:{var ne=ny.get(n);if(ne!==void 0){var se=ic,we=n;switch(n){case"keypress":if(nc(l)===0)break e;case"keydown":case"keyup":se=Gw;break;case"focusin":we="focus",se=Ld;break;case"focusout":we="blur",se=Ld;break;case"beforeblur":case"afterblur":se=Ld;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":se=Mg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":se=Ow;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":se=Qw;break;case Jg:case Wg:case ey:se=Uw;break;case ty:se=Jw;break;case"scroll":case"scrollend":se=Lw;break;case"wheel":se=eC;break;case"copy":case"cut":case"paste":se=Fw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":se=Lg;break;case"toggle":case"beforetoggle":se=nC}var ze=(i&4)!==0,vt=!ze&&(n==="scroll"||n==="scrollend"),J=ze?ne!==null?ne+"Capture":null:ne;ze=[];for(var Q=te,ee;Q!==null;){var ce=Q;if(ee=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||ee===null||J===null||(ce=xl(Q,J),ce!=null&&ze.push(Wl(Q,ce,ee))),vt)break;Q=Q.return}0<ze.length&&(ne=new se(ne,we,null,l,le),ue.push({event:ne,listeners:ze}))}}if((i&7)===0){e:{if(ne=n==="mouseover"||n==="pointerover",se=n==="mouseout"||n==="pointerout",ne&&l!==jd&&(we=l.relatedTarget||l.fromElement)&&(ci(we)||we[Te]))break e;if((se||ne)&&(ne=le.window===le?le:(ne=le.ownerDocument)?ne.defaultView||ne.parentWindow:window,se?(we=l.relatedTarget||l.toElement,se=te,we=we?ci(we):null,we!==null&&(vt=c(we),ze=we.tag,we!==vt||ze!==5&&ze!==27&&ze!==6)&&(we=null)):(se=null,we=te),se!==we)){if(ze=Mg,ce="onMouseLeave",J="onMouseEnter",Q="mouse",(n==="pointerout"||n==="pointerover")&&(ze=Lg,ce="onPointerLeave",J="onPointerEnter",Q="pointer"),vt=se==null?ne:bl(se),ee=we==null?ne:bl(we),ne=new ze(ce,Q+"leave",se,l,le),ne.target=vt,ne.relatedTarget=ee,ce=null,ci(le)===te&&(ze=new ze(J,Q+"enter",we,l,le),ze.target=ee,ze.relatedTarget=vt,ce=ze),vt=ce,se&&we)t:{for(ze=tN,J=se,Q=we,ee=0,ce=J;ce;ce=ze(ce))ee++;ce=0;for(var Le=Q;Le;Le=ze(Le))ce++;for(;0<ee-ce;)J=ze(J),ee--;for(;0<ce-ee;)Q=ze(Q),ce--;for(;ee--;){if(J===Q||Q!==null&&J===Q.alternate){ze=J;break t}J=ze(J),Q=ze(Q)}ze=null}else ze=null;se!==null&&C1(ue,ne,se,ze,!1),we!==null&&vt!==null&&C1(ue,vt,we,ze,!0)}}e:{if(ne=te?bl(te):window,se=ne.nodeName&&ne.nodeName.toLowerCase(),se==="select"||se==="input"&&ne.type==="file")var it=Hg;else if(Bg(ne))if(Pg)it=fC;else{it=uC;var Ne=cC}else se=ne.nodeName,!se||se.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?te&&Nd(te.elementType)&&(it=Hg):it=dC;if(it&&(it=it(n,te))){Fg(ue,it,l,le);break e}Ne&&Ne(n,ne,te),n==="focusout"&&te&&ne.type==="number"&&te.memoizedProps.value!=null&&Cd(ne,"number",ne.value)}switch(Ne=te?bl(te):window,n){case"focusin":(Bg(Ne)||Ne.contentEditable==="true")&&(ur=Ne,Bd=te,El=null);break;case"focusout":El=Bd=ur=null;break;case"mousedown":Fd=!0;break;case"contextmenu":case"mouseup":case"dragend":Fd=!1,Qg(ue,l,le);break;case"selectionchange":if(mC)break;case"keydown":case"keyup":Qg(ue,l,le)}var $e;if(Od)e:{switch(n){case"compositionstart":var Je="onCompositionStart";break e;case"compositionend":Je="onCompositionEnd";break e;case"compositionupdate":Je="onCompositionUpdate";break e}Je=void 0}else cr?Ig(n,l)&&(Je="onCompositionEnd"):n==="keydown"&&l.keyCode===229&&(Je="onCompositionStart");Je&&(Dg&&l.locale!=="ko"&&(cr||Je!=="onCompositionStart"?Je==="onCompositionEnd"&&cr&&($e=Rg()):(ui=le,Td="value"in ui?ui.value:ui.textContent,cr=!0)),Ne=Kc(te,Je),0<Ne.length&&(Je=new Ag(Je,n,null,l,le),ue.push({event:Je,listeners:Ne}),$e?Je.data=$e:($e=Ug(l),$e!==null&&(Je.data=$e)))),($e=iC?sC(n,l):rC(n,l))&&(Je=Kc(te,"onBeforeInput"),0<Je.length&&(Ne=new Ag("onBeforeInput","beforeinput",null,l,le),ue.push({event:Ne,listeners:Je}),Ne.data=$e)),ZC(ue,n,te,l,le)}S1(ue,i)})}function Wl(n,i,l){return{instance:n,listener:i,currentTarget:l}}function Kc(n,i){for(var l=i+"Capture",d=[];n!==null;){var y=n,x=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||x===null||(y=xl(n,l),y!=null&&d.unshift(Wl(n,y,x)),y=xl(n,i),y!=null&&d.push(Wl(n,y,x))),n.tag===3)return d;n=n.return}return[]}function tN(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function C1(n,i,l,d,y){for(var x=i._reactName,N=[];l!==null&&l!==d;){var L=l,V=L.alternate,te=L.stateNode;if(L=L.tag,V!==null&&V===d)break;L!==5&&L!==26&&L!==27||te===null||(V=te,y?(te=xl(l,x),te!=null&&N.unshift(Wl(l,te,V))):y||(te=xl(l,x),te!=null&&N.push(Wl(l,te,V)))),l=l.return}N.length!==0&&n.push({event:i,listeners:N})}var nN=/\r\n?/g,aN=/\u0000|\uFFFD/g;function N1(n){return(typeof n=="string"?n:""+n).replace(nN,`
33
+ `).replace(aN,"")}function j1(n,i){return i=N1(i),N1(n)===i}function yt(n,i,l,d,y,x){switch(l){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||rr(n,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&rr(n,""+d);break;case"className":Jo(n,"class",d);break;case"tabIndex":Jo(n,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":Jo(n,l,d);break;case"style":jg(n,d,x);break;case"data":if(i!=="object"){Jo(n,"data",d);break}case"src":case"href":if(d===""&&(i!=="a"||l!=="href")){n.removeAttribute(l);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(l);break}d=ec(""+d),n.setAttribute(l,d);break;case"action":case"formAction":if(typeof d=="function"){n.setAttribute(l,"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 x=="function"&&(l==="formAction"?(i!=="input"&&yt(n,i,"name",y.name,y,null),yt(n,i,"formEncType",y.formEncType,y,null),yt(n,i,"formMethod",y.formMethod,y,null),yt(n,i,"formTarget",y.formTarget,y,null)):(yt(n,i,"encType",y.encType,y,null),yt(n,i,"method",y.method,y,null),yt(n,i,"target",y.target,y,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(l);break}d=ec(""+d),n.setAttribute(l,d);break;case"onClick":d!=null&&(n.onclick=Da);break;case"onScroll":d!=null&&Xe("scroll",n);break;case"onScrollEnd":d!=null&&Xe("scrollend",n);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(s(61));if(l=d.__html,l!=null){if(y.children!=null)throw Error(s(60));n.innerHTML=l}}break;case"multiple":n.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":n.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){n.removeAttribute("xlink:href");break}l=ec(""+d),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(l,""+d):n.removeAttribute(l);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":d&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(l,""):n.removeAttribute(l);break;case"capture":case"download":d===!0?n.setAttribute(l,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(l,d):n.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?n.setAttribute(l,d):n.removeAttribute(l);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?n.removeAttribute(l):n.setAttribute(l,d);break;case"popover":Xe("beforetoggle",n),Xe("toggle",n),Zo(n,"popover",d);break;case"xlinkActuate":La(n,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":La(n,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":La(n,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":La(n,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":La(n,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":La(n,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":La(n,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":La(n,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":La(n,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":Zo(n,"is",d);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Mw.get(l)||l,Zo(n,l,d))}}function fh(n,i,l,d,y,x){switch(l){case"style":jg(n,d,x);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(s(61));if(l=d.__html,l!=null){if(y.children!=null)throw Error(s(60));n.innerHTML=l}}break;case"children":typeof d=="string"?rr(n,d):(typeof d=="number"||typeof d=="bigint")&&rr(n,""+d);break;case"onScroll":d!=null&&Xe("scroll",n);break;case"onScrollEnd":d!=null&&Xe("scrollend",n);break;case"onClick":d!=null&&(n.onclick=Da);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!yg.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(y=l.endsWith("Capture"),i=l.slice(2,y?l.length-7:void 0),x=n[xe]||null,x=x!=null?x[l]:null,typeof x=="function"&&n.removeEventListener(i,x,y),typeof d=="function")){typeof x!="function"&&x!==null&&(l in n?n[l]=null:n.hasAttribute(l)&&n.removeAttribute(l)),n.addEventListener(i,d,y);break e}l in n?n[l]=d:d===!0?n.setAttribute(l,""):Zo(n,l,d)}}}function tn(n,i,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Xe("error",n),Xe("load",n);var d=!1,y=!1,x;for(x in l)if(l.hasOwnProperty(x)){var N=l[x];if(N!=null)switch(x){case"src":d=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:yt(n,i,x,N,l,null)}}y&&yt(n,i,"srcSet",l.srcSet,l,null),d&&yt(n,i,"src",l.src,l,null);return;case"input":Xe("invalid",n);var L=x=N=y=null,V=null,te=null;for(d in l)if(l.hasOwnProperty(d)){var le=l[d];if(le!=null)switch(d){case"name":y=le;break;case"type":N=le;break;case"checked":V=le;break;case"defaultChecked":te=le;break;case"value":x=le;break;case"defaultValue":L=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(s(137,i));break;default:yt(n,i,d,le,l,null)}}Sg(n,x,L,V,te,N,y,!1);return;case"select":Xe("invalid",n),d=N=x=null;for(y in l)if(l.hasOwnProperty(y)&&(L=l[y],L!=null))switch(y){case"value":x=L;break;case"defaultValue":N=L;break;case"multiple":d=L;default:yt(n,i,y,L,l,null)}i=x,l=N,n.multiple=!!d,i!=null?sr(n,!!d,i,!1):l!=null&&sr(n,!!d,l,!0);return;case"textarea":Xe("invalid",n),x=y=d=null;for(N in l)if(l.hasOwnProperty(N)&&(L=l[N],L!=null))switch(N){case"value":d=L;break;case"defaultValue":y=L;break;case"children":x=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(s(91));break;default:yt(n,i,N,L,l,null)}Cg(n,d,y,x);return;case"option":for(V in l)if(l.hasOwnProperty(V)&&(d=l[V],d!=null))switch(V){case"selected":n.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:yt(n,i,V,d,l,null)}return;case"dialog":Xe("beforetoggle",n),Xe("toggle",n),Xe("cancel",n),Xe("close",n);break;case"iframe":case"object":Xe("load",n);break;case"video":case"audio":for(d=0;d<Jl.length;d++)Xe(Jl[d],n);break;case"image":Xe("error",n),Xe("load",n);break;case"details":Xe("toggle",n);break;case"embed":case"source":case"link":Xe("error",n),Xe("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(te in l)if(l.hasOwnProperty(te)&&(d=l[te],d!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:yt(n,i,te,d,l,null)}return;default:if(Nd(i)){for(le in l)l.hasOwnProperty(le)&&(d=l[le],d!==void 0&&fh(n,i,le,d,l,void 0));return}}for(L in l)l.hasOwnProperty(L)&&(d=l[L],d!=null&&yt(n,i,L,d,l,null))}function iN(n,i,l,d){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,x=null,N=null,L=null,V=null,te=null,le=null;for(se in l){var ue=l[se];if(l.hasOwnProperty(se)&&ue!=null)switch(se){case"checked":break;case"value":break;case"defaultValue":V=ue;default:d.hasOwnProperty(se)||yt(n,i,se,null,d,ue)}}for(var ne in d){var se=d[ne];if(ue=l[ne],d.hasOwnProperty(ne)&&(se!=null||ue!=null))switch(ne){case"type":x=se;break;case"name":y=se;break;case"checked":te=se;break;case"defaultChecked":le=se;break;case"value":N=se;break;case"defaultValue":L=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(s(137,i));break;default:se!==ue&&yt(n,i,ne,se,d,ue)}}wd(n,N,L,V,te,le,x,y);return;case"select":se=N=L=ne=null;for(x in l)if(V=l[x],l.hasOwnProperty(x)&&V!=null)switch(x){case"value":break;case"multiple":se=V;default:d.hasOwnProperty(x)||yt(n,i,x,null,d,V)}for(y in d)if(x=d[y],V=l[y],d.hasOwnProperty(y)&&(x!=null||V!=null))switch(y){case"value":ne=x;break;case"defaultValue":L=x;break;case"multiple":N=x;default:x!==V&&yt(n,i,y,x,d,V)}i=L,l=N,d=se,ne!=null?sr(n,!!l,ne,!1):!!d!=!!l&&(i!=null?sr(n,!!l,i,!0):sr(n,!!l,l?[]:"",!1));return;case"textarea":se=ne=null;for(L in l)if(y=l[L],l.hasOwnProperty(L)&&y!=null&&!d.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:yt(n,i,L,null,d,y)}for(N in d)if(y=d[N],x=l[N],d.hasOwnProperty(N)&&(y!=null||x!=null))switch(N){case"value":ne=y;break;case"defaultValue":se=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(s(91));break;default:y!==x&&yt(n,i,N,y,d,x)}wg(n,ne,se);return;case"option":for(var we in l)if(ne=l[we],l.hasOwnProperty(we)&&ne!=null&&!d.hasOwnProperty(we))switch(we){case"selected":n.selected=!1;break;default:yt(n,i,we,null,d,ne)}for(V in d)if(ne=d[V],se=l[V],d.hasOwnProperty(V)&&ne!==se&&(ne!=null||se!=null))switch(V){case"selected":n.selected=ne&&typeof ne!="function"&&typeof ne!="symbol";break;default:yt(n,i,V,ne,d,se)}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 ze in l)ne=l[ze],l.hasOwnProperty(ze)&&ne!=null&&!d.hasOwnProperty(ze)&&yt(n,i,ze,null,d,ne);for(te in d)if(ne=d[te],se=l[te],d.hasOwnProperty(te)&&ne!==se&&(ne!=null||se!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(s(137,i));break;default:yt(n,i,te,ne,d,se)}return;default:if(Nd(i)){for(var vt in l)ne=l[vt],l.hasOwnProperty(vt)&&ne!==void 0&&!d.hasOwnProperty(vt)&&fh(n,i,vt,void 0,d,ne);for(le in d)ne=d[le],se=l[le],!d.hasOwnProperty(le)||ne===se||ne===void 0&&se===void 0||fh(n,i,le,ne,d,se);return}}for(var J in l)ne=l[J],l.hasOwnProperty(J)&&ne!=null&&!d.hasOwnProperty(J)&&yt(n,i,J,null,d,ne);for(ue in d)ne=d[ue],se=l[ue],!d.hasOwnProperty(ue)||ne===se||ne==null&&se==null||yt(n,i,ue,ne,d,se)}function k1(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function sN(){if(typeof performance.getEntriesByType=="function"){for(var n=0,i=0,l=performance.getEntriesByType("resource"),d=0;d<l.length;d++){var y=l[d],x=y.transferSize,N=y.initiatorType,L=y.duration;if(x&&L&&k1(N)){for(N=0,L=y.responseEnd,d+=1;d<l.length;d++){var V=l[d],te=V.startTime;if(te>L)break;var le=V.transferSize,ue=V.initiatorType;le&&k1(ue)&&(V=V.responseEnd,N+=le*(V<L?1:(L-te)/(V-te)))}if(--d,i+=8*(x+N)/(y.duration/1e3),n++,10<n)break}}if(0<n)return i/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var hh=null,mh=null;function Xc(n){return n.nodeType===9?n:n.ownerDocument}function E1(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function R1(n,i){if(n===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&i==="foreignObject"?0:n}function ph(n,i){return n==="textarea"||n==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var gh=null;function rN(){var n=window.event;return n&&n.type==="popstate"?n===gh?!1:(gh=n,!0):(gh=null,!1)}var T1=typeof setTimeout=="function"?setTimeout:void 0,lN=typeof clearTimeout=="function"?clearTimeout:void 0,M1=typeof Promise=="function"?Promise:void 0,oN=typeof queueMicrotask=="function"?queueMicrotask:typeof M1!="undefined"?function(n){return M1.resolve(null).then(n).catch(cN)}:T1;function cN(n){setTimeout(function(){throw n})}function ki(n){return n==="head"}function A1(n,i){var l=i,d=0;do{var y=l.nextSibling;if(n.removeChild(l),y&&y.nodeType===8)if(l=y.data,l==="/$"||l==="/&"){if(d===0){n.removeChild(y),Ir(i);return}d--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")d++;else if(l==="html")eo(n.ownerDocument.documentElement);else if(l==="head"){l=n.ownerDocument.head,eo(l);for(var x=l.firstChild;x;){var N=x.nextSibling,L=x.nodeName;x[cn]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&x.rel.toLowerCase()==="stylesheet"||l.removeChild(x),x=N}}else l==="body"&&eo(n.ownerDocument.body);l=y}while(l);Ir(i)}function L1(n,i){var l=n;n=0;do{var d=l.nextSibling;if(l.nodeType===1?i?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(i?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),d&&d.nodeType===8)if(l=d.data,l==="/$"){if(n===0)break;n--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||n++;l=d}while(l)}function yh(n){var i=n.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var l=i;switch(i=i.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":yh(l),sa(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}n.removeChild(l)}}function uN(n,i,l,d){for(;n.nodeType===1;){var y=l;if(n.nodeName.toLowerCase()!==i.toLowerCase()){if(!d&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(d){if(!n[cn])switch(i){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(x=n.getAttribute("rel"),x==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(x!==y.rel||n.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||n.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||n.getAttribute("title")!==(y.title==null?null:y.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(x=n.getAttribute("src"),(x!==(y.src==null?null:y.src)||n.getAttribute("type")!==(y.type==null?null:y.type)||n.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&x&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(i==="input"&&n.type==="hidden"){var x=y.name==null?null:""+y.name;if(y.type==="hidden"&&n.getAttribute("name")===x)return n}else return n;if(n=Kn(n.nextSibling),n===null)break}return null}function dN(n,i,l){if(i==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!l||(n=Kn(n.nextSibling),n===null))return null;return n}function D1(n,i){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=Kn(n.nextSibling),n===null))return null;return n}function vh(n){return n.data==="$?"||n.data==="$~"}function bh(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function fN(n,i){var l=n.ownerDocument;if(n.data==="$~")n._reactRetry=i;else if(n.data!=="$?"||l.readyState!=="loading")i();else{var d=function(){i(),l.removeEventListener("DOMContentLoaded",d)};l.addEventListener("DOMContentLoaded",d),n._reactRetry=d}}function Kn(n){for(;n!=null;n=n.nextSibling){var i=n.nodeType;if(i===1||i===3)break;if(i===8){if(i=n.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return n}var xh=null;function O1(n){n=n.nextSibling;for(var i=0;n;){if(n.nodeType===8){var l=n.data;if(l==="/$"||l==="/&"){if(i===0)return Kn(n.nextSibling);i--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||i++}n=n.nextSibling}return null}function z1(n){n=n.previousSibling;for(var i=0;n;){if(n.nodeType===8){var l=n.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(i===0)return n;i--}else l!=="/$"&&l!=="/&"||i++}n=n.previousSibling}return null}function I1(n,i,l){switch(i=Xc(l),n){case"html":if(n=i.documentElement,!n)throw Error(s(452));return n;case"head":if(n=i.head,!n)throw Error(s(453));return n;case"body":if(n=i.body,!n)throw Error(s(454));return n;default:throw Error(s(451))}}function eo(n){for(var i=n.attributes;i.length;)n.removeAttributeNode(i[0]);sa(n)}var Xn=new Map,U1=new Set;function Qc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Qa=X.d;X.d={f:hN,r:mN,D:pN,C:gN,L:yN,m:vN,X:xN,S:bN,M:_N};function hN(){var n=Qa.f(),i=Hc();return n||i}function mN(n){var i=nr(n);i!==null&&i.tag===5&&i.type==="form"?tv(i):Qa.r(n)}var Dr=typeof document=="undefined"?null:document;function B1(n,i,l){var d=Dr;if(d&&typeof i=="string"&&i){var y=Hn(i);y='link[rel="'+n+'"][href="'+y+'"]',typeof l=="string"&&(y+='[crossorigin="'+l+'"]'),U1.has(y)||(U1.add(y),n={rel:n,crossOrigin:l,href:i},d.querySelector(y)===null&&(i=d.createElement("link"),tn(i,"link",n),Kt(i),d.head.appendChild(i)))}}function pN(n){Qa.D(n),B1("dns-prefetch",n,null)}function gN(n,i){Qa.C(n,i),B1("preconnect",n,i)}function yN(n,i,l){Qa.L(n,i,l);var d=Dr;if(d&&n&&i){var y='link[rel="preload"][as="'+Hn(i)+'"]';i==="image"&&l&&l.imageSrcSet?(y+='[imagesrcset="'+Hn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(y+='[imagesizes="'+Hn(l.imageSizes)+'"]')):y+='[href="'+Hn(n)+'"]';var x=y;switch(i){case"style":x=Or(n);break;case"script":x=zr(n)}Xn.has(x)||(n=p({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:n,as:i},l),Xn.set(x,n),d.querySelector(y)!==null||i==="style"&&d.querySelector(to(x))||i==="script"&&d.querySelector(no(x))||(i=d.createElement("link"),tn(i,"link",n),Kt(i),d.head.appendChild(i)))}}function vN(n,i){Qa.m(n,i);var l=Dr;if(l&&n){var d=i&&typeof i.as=="string"?i.as:"script",y='link[rel="modulepreload"][as="'+Hn(d)+'"][href="'+Hn(n)+'"]',x=y;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=zr(n)}if(!Xn.has(x)&&(n=p({rel:"modulepreload",href:n},i),Xn.set(x,n),l.querySelector(y)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(no(x)))return}d=l.createElement("link"),tn(d,"link",n),Kt(d),l.head.appendChild(d)}}}function bN(n,i,l){Qa.S(n,i,l);var d=Dr;if(d&&n){var y=ar(d).hoistableStyles,x=Or(n);i=i||"default";var N=y.get(x);if(!N){var L={loading:0,preload:null};if(N=d.querySelector(to(x)))L.loading=5;else{n=p({rel:"stylesheet",href:n,"data-precedence":i},l),(l=Xn.get(x))&&_h(n,l);var V=N=d.createElement("link");Kt(V),tn(V,"link",n),V._p=new Promise(function(te,le){V.onload=te,V.onerror=le}),V.addEventListener("load",function(){L.loading|=1}),V.addEventListener("error",function(){L.loading|=2}),L.loading|=4,Zc(N,i,d)}N={type:"stylesheet",instance:N,count:1,state:L},y.set(x,N)}}}function xN(n,i){Qa.X(n,i);var l=Dr;if(l&&n){var d=ar(l).hoistableScripts,y=zr(n),x=d.get(y);x||(x=l.querySelector(no(y)),x||(n=p({src:n,async:!0},i),(i=Xn.get(y))&&Sh(n,i),x=l.createElement("script"),Kt(x),tn(x,"link",n),l.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},d.set(y,x))}}function _N(n,i){Qa.M(n,i);var l=Dr;if(l&&n){var d=ar(l).hoistableScripts,y=zr(n),x=d.get(y);x||(x=l.querySelector(no(y)),x||(n=p({src:n,async:!0,type:"module"},i),(i=Xn.get(y))&&Sh(n,i),x=l.createElement("script"),Kt(x),tn(x,"link",n),l.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},d.set(y,x))}}function F1(n,i,l,d){var y=(y=me.current)?Qc(y):null;if(!y)throw Error(s(446));switch(n){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=Or(l.href),l=ar(y).hoistableStyles,d=l.get(i),d||(d={type:"style",instance:null,count:0,state:null},l.set(i,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){n=Or(l.href);var x=ar(y).hoistableStyles,N=x.get(n);if(N||(y=y.ownerDocument||y,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(n,N),(x=y.querySelector(to(n)))&&!x._p&&(N.instance=x,N.state.loading=5),Xn.has(n)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Xn.set(n,l),x||SN(y,n,l,N.state))),i&&d===null)throw Error(s(528,""));return N}if(i&&d!==null)throw Error(s(529,""));return null;case"script":return i=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=zr(l),l=ar(y).hoistableScripts,d=l.get(i),d||(d={type:"script",instance:null,count:0,state:null},l.set(i,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,n))}}function Or(n){return'href="'+Hn(n)+'"'}function to(n){return'link[rel="stylesheet"]['+n+"]"}function H1(n){return p({},n,{"data-precedence":n.precedence,precedence:null})}function SN(n,i,l,d){n.querySelector('link[rel="preload"][as="style"]['+i+"]")?d.loading=1:(i=n.createElement("link"),d.preload=i,i.addEventListener("load",function(){return d.loading|=1}),i.addEventListener("error",function(){return d.loading|=2}),tn(i,"link",l),Kt(i),n.head.appendChild(i))}function zr(n){return'[src="'+Hn(n)+'"]'}function no(n){return"script[async]"+n}function P1(n,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var d=n.querySelector('style[data-href~="'+Hn(l.href)+'"]');if(d)return i.instance=d,Kt(d),d;var y=p({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return d=(n.ownerDocument||n).createElement("style"),Kt(d),tn(d,"style",y),Zc(d,l.precedence,n),i.instance=d;case"stylesheet":y=Or(l.href);var x=n.querySelector(to(y));if(x)return i.state.loading|=4,i.instance=x,Kt(x),x;d=H1(l),(y=Xn.get(y))&&_h(d,y),x=(n.ownerDocument||n).createElement("link"),Kt(x);var N=x;return N._p=new Promise(function(L,V){N.onload=L,N.onerror=V}),tn(x,"link",d),i.state.loading|=4,Zc(x,l.precedence,n),i.instance=x;case"script":return x=zr(l.src),(y=n.querySelector(no(x)))?(i.instance=y,Kt(y),y):(d=l,(y=Xn.get(x))&&(d=p({},l),Sh(d,y)),n=n.ownerDocument||n,y=n.createElement("script"),Kt(y),tn(y,"link",d),n.head.appendChild(y),i.instance=y);case"void":return null;default:throw Error(s(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(d=i.instance,i.state.loading|=4,Zc(d,l.precedence,n));return i.instance}function Zc(n,i,l){for(var d=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=d.length?d[d.length-1]:null,x=y,N=0;N<d.length;N++){var L=d[N];if(L.dataset.precedence===i)x=L;else if(x!==y)break}x?x.parentNode.insertBefore(n,x.nextSibling):(i=l.nodeType===9?l.head:l,i.insertBefore(n,i.firstChild))}function _h(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.title==null&&(n.title=i.title)}function Sh(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.integrity==null&&(n.integrity=i.integrity)}var Jc=null;function $1(n,i,l){if(Jc===null){var d=new Map,y=Jc=new Map;y.set(l,d)}else y=Jc,d=y.get(l),d||(d=new Map,y.set(l,d));if(d.has(n))return d;for(d.set(n,null),l=l.getElementsByTagName(n),y=0;y<l.length;y++){var x=l[y];if(!(x[cn]||x[ae]||n==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var N=x.getAttribute(i)||"";N=n+N;var L=d.get(N);L?L.push(x):d.set(N,[x])}}return d}function q1(n,i,l){n=n.ownerDocument||n,n.head.insertBefore(l,i==="title"?n.querySelector("head > title"):null)}function wN(n,i,l){if(l===1||i.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return n=i.disabled,typeof i.precedence=="string"&&n==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function V1(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function CN(n,i,l,d){if(l.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var y=Or(d.href),x=i.querySelector(to(y));if(x){i=x._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(n.count++,n=Wc.bind(n),i.then(n,n)),l.state.loading|=4,l.instance=x,Kt(x);return}x=i.ownerDocument||i,d=H1(d),(y=Xn.get(y))&&_h(d,y),x=x.createElement("link"),Kt(x);var N=x;N._p=new Promise(function(L,V){N.onload=L,N.onerror=V}),tn(x,"link",d),l.instance=x}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(n.count++,l=Wc.bind(n),i.addEventListener("load",l),i.addEventListener("error",l))}}var wh=0;function NN(n,i){return n.stylesheets&&n.count===0&&tu(n,n.stylesheets),0<n.count||0<n.imgCount?function(l){var d=setTimeout(function(){if(n.stylesheets&&tu(n,n.stylesheets),n.unsuspend){var x=n.unsuspend;n.unsuspend=null,x()}},6e4+i);0<n.imgBytes&&wh===0&&(wh=62500*sN());var y=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&tu(n,n.stylesheets),n.unsuspend)){var x=n.unsuspend;n.unsuspend=null,x()}},(n.imgBytes>wh?50:800)+i);return n.unsuspend=l,function(){n.unsuspend=null,clearTimeout(d),clearTimeout(y)}}:null}function Wc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)tu(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var eu=null;function tu(n,i){n.stylesheets=null,n.unsuspend!==null&&(n.count++,eu=new Map,i.forEach(jN,n),eu=null,Wc.call(n))}function jN(n,i){if(!(i.state.loading&4)){var l=eu.get(n);if(l)var d=l.get(null);else{l=new Map,eu.set(n,l);for(var y=n.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<y.length;x++){var N=y[x];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(l.set(N.dataset.precedence,N),d=N)}d&&l.set(null,d)}y=i.instance,N=y.getAttribute("data-precedence"),x=l.get(N)||d,x===d&&l.set(null,y),l.set(N,y),this.count++,d=Wc.bind(this),y.addEventListener("load",d),y.addEventListener("error",d),x?x.parentNode.insertBefore(y,x.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(y,n.firstChild)),i.state.loading|=4}}var ao={$$typeof:j,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function kN(n,i,l,d,y,x,N,L,V){this.tag=1,this.containerInfo=n,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=pl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pl(0),this.hiddenUpdates=pl(null),this.identifierPrefix=d,this.onUncaughtError=y,this.onCaughtError=x,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=V,this.incompleteTransitions=new Map}function Y1(n,i,l,d,y,x,N,L,V,te,le,ue){return n=new kN(n,i,l,N,V,te,le,ue,L),i=1,x===!0&&(i|=24),x=En(3,null,null,i),n.current=x,x.stateNode=n,i=tf(),i.refCount++,n.pooledCache=i,i.refCount++,x.memoizedState={element:d,isDehydrated:l,cache:i},rf(x),n}function G1(n){return n?(n=hr,n):hr}function K1(n,i,l,d,y,x){y=G1(y),d.context===null?d.context=y:d.pendingContext=y,d=gi(i),d.payload={element:l},x=x===void 0?null:x,x!==null&&(d.callback=x),l=yi(n,d,i),l!==null&&(bn(l,n,i),Ol(l,n,i))}function X1(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var l=n.retryLane;n.retryLane=l!==0&&l<i?l:i}}function Ch(n,i){X1(n,i),(n=n.alternate)&&X1(n,i)}function Q1(n){if(n.tag===13||n.tag===31){var i=us(n,67108864);i!==null&&bn(i,n,67108864),Ch(n,67108864)}}function Z1(n){if(n.tag===13||n.tag===31){var i=Ln();i=tr(i);var l=us(n,i);l!==null&&bn(l,n,i),Ch(n,i)}}var nu=!0;function EN(n,i,l,d){var y=$.T;$.T=null;var x=X.p;try{X.p=2,Nh(n,i,l,d)}finally{X.p=x,$.T=y}}function RN(n,i,l,d){var y=$.T;$.T=null;var x=X.p;try{X.p=8,Nh(n,i,l,d)}finally{X.p=x,$.T=y}}function Nh(n,i,l,d){if(nu){var y=jh(d);if(y===null)dh(n,i,d,au,l),W1(n,d);else if(MN(y,n,i,l,d))d.stopPropagation();else if(W1(n,d),i&4&&-1<TN.indexOf(n)){for(;y!==null;){var x=nr(y);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var N=on(x.pendingLanes);if(N!==0){var L=x;for(L.pendingLanes|=2,L.entangledLanes|=2;N;){var V=1<<31-ut(N);L.entanglements[1]|=V,N&=~V}_a(x),(rt&6)===0&&(Bc=At()+500,Zl(0))}}break;case 31:case 13:L=us(x,2),L!==null&&bn(L,x,2),Hc(),Ch(x,2)}if(x=jh(d),x===null&&dh(n,i,d,au,l),x===y)break;y=x}y!==null&&d.stopPropagation()}else dh(n,i,d,null,l)}}function jh(n){return n=kd(n),kh(n)}var au=null;function kh(n){if(au=null,n=ci(n),n!==null){var i=c(n);if(i===null)n=null;else{var l=i.tag;if(l===13){if(n=o(i),n!==null)return n;n=null}else if(l===31){if(n=u(i),n!==null)return n;n=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;n=null}else i!==n&&(n=null)}}return au=n,null}function J1(n){switch(n){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(as()){case re:return 2;case ve:return 8;case Ee:case We:return 32;case Re:return 268435456;default:return 32}default:return 32}}var Eh=!1,Ei=null,Ri=null,Ti=null,io=new Map,so=new Map,Mi=[],TN="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 W1(n,i){switch(n){case"focusin":case"focusout":Ei=null;break;case"dragenter":case"dragleave":Ri=null;break;case"mouseover":case"mouseout":Ti=null;break;case"pointerover":case"pointerout":io.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":so.delete(i.pointerId)}}function ro(n,i,l,d,y,x){return n===null||n.nativeEvent!==x?(n={blockedOn:i,domEventName:l,eventSystemFlags:d,nativeEvent:x,targetContainers:[y]},i!==null&&(i=nr(i),i!==null&&Q1(i)),n):(n.eventSystemFlags|=d,i=n.targetContainers,y!==null&&i.indexOf(y)===-1&&i.push(y),n)}function MN(n,i,l,d,y){switch(i){case"focusin":return Ei=ro(Ei,n,i,l,d,y),!0;case"dragenter":return Ri=ro(Ri,n,i,l,d,y),!0;case"mouseover":return Ti=ro(Ti,n,i,l,d,y),!0;case"pointerover":var x=y.pointerId;return io.set(x,ro(io.get(x)||null,n,i,l,d,y)),!0;case"gotpointercapture":return x=y.pointerId,so.set(x,ro(so.get(x)||null,n,i,l,d,y)),!0}return!1}function eb(n){var i=ci(n.target);if(i!==null){var l=c(i);if(l!==null){if(i=l.tag,i===13){if(i=o(l),i!==null){n.blockedOn=i,oi(n.priority,function(){Z1(l)});return}}else if(i===31){if(i=u(l),i!==null){n.blockedOn=i,oi(n.priority,function(){Z1(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){n.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}n.blockedOn=null}function iu(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var l=jh(n.nativeEvent);if(l===null){l=n.nativeEvent;var d=new l.constructor(l.type,l);jd=d,l.target.dispatchEvent(d),jd=null}else return i=nr(l),i!==null&&Q1(i),n.blockedOn=l,!1;i.shift()}return!0}function tb(n,i,l){iu(n)&&l.delete(i)}function AN(){Eh=!1,Ei!==null&&iu(Ei)&&(Ei=null),Ri!==null&&iu(Ri)&&(Ri=null),Ti!==null&&iu(Ti)&&(Ti=null),io.forEach(tb),so.forEach(tb)}function su(n,i){n.blockedOn===i&&(n.blockedOn=null,Eh||(Eh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,AN)))}var ru=null;function nb(n){ru!==n&&(ru=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ru===n&&(ru=null);for(var i=0;i<n.length;i+=3){var l=n[i],d=n[i+1],y=n[i+2];if(typeof d!="function"){if(kh(d||l)===null)continue;break}var x=nr(l);x!==null&&(n.splice(i,3),i-=3,jf(x,{pending:!0,data:y,method:l.method,action:d},d,y))}}))}function Ir(n){function i(V){return su(V,n)}Ei!==null&&su(Ei,n),Ri!==null&&su(Ri,n),Ti!==null&&su(Ti,n),io.forEach(i),so.forEach(i);for(var l=0;l<Mi.length;l++){var d=Mi[l];d.blockedOn===n&&(d.blockedOn=null)}for(;0<Mi.length&&(l=Mi[0],l.blockedOn===null);)eb(l),l.blockedOn===null&&Mi.shift();if(l=(n.ownerDocument||n).$$reactFormReplay,l!=null)for(d=0;d<l.length;d+=3){var y=l[d],x=l[d+1],N=y[xe]||null;if(typeof x=="function")N||nb(l);else if(N){var L=null;if(x&&x.hasAttribute("formAction")){if(y=x,N=x[xe]||null)L=N.formAction;else if(kh(y)!==null)continue}else L=N.action;typeof L=="function"?l[d+1]=L:(l.splice(d,3),d-=3),nb(l)}}}function ab(){function n(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(N){return y=N})},focusReset:"manual",scroll:"manual"})}function i(){y!==null&&(y(),y=null),d||setTimeout(l,20)}function l(){if(!d&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,y=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(l,100),function(){d=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),y!==null&&(y(),y=null)}}}function Rh(n){this._internalRoot=n}lu.prototype.render=Rh.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(s(409));var l=i.current,d=Ln();K1(l,d,n,i,null,null)},lu.prototype.unmount=Rh.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;K1(n.current,2,null,n,null,null),Hc(),i[Te]=null}};function lu(n){this._internalRoot=n}lu.prototype.unstable_scheduleHydration=function(n){if(n){var i=Qo();n={blockedOn:null,target:n,priority:i};for(var l=0;l<Mi.length&&i!==0&&i<Mi[l].priority;l++);Mi.splice(l,0,n),l===0&&eb(n)}};var ib=t.version;if(ib!=="19.2.4")throw Error(s(527,ib,"19.2.4"));X.findDOMNode=function(n){var i=n._reactInternals;if(i===void 0)throw typeof n.render=="function"?Error(s(188)):(n=Object.keys(n).join(","),Error(s(268,n)));return n=m(i),n=n!==null?g(n):null,n=n===null?null:n.stateNode,n};var LN={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"){var ou=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ou.isDisabled&&ou.supportsFiber)try{Tt=ou.inject(LN),Nt=ou}catch(n){}}return oo.createRoot=function(n,i){if(!r(n))throw Error(s(299));var l=!1,d="",y=dv,x=fv,N=hv;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(y=i.onUncaughtError),i.onCaughtError!==void 0&&(x=i.onCaughtError),i.onRecoverableError!==void 0&&(N=i.onRecoverableError)),i=Y1(n,1,!1,null,null,l,d,null,y,x,N,ab),n[Te]=i.current,uh(n),new Rh(i)},oo.hydrateRoot=function(n,i,l){if(!r(n))throw Error(s(299));var d=!1,y="",x=dv,N=fv,L=hv,V=null;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(y=l.identifierPrefix),l.onUncaughtError!==void 0&&(x=l.onUncaughtError),l.onCaughtError!==void 0&&(N=l.onCaughtError),l.onRecoverableError!==void 0&&(L=l.onRecoverableError),l.formState!==void 0&&(V=l.formState)),i=Y1(n,1,!0,i,l!=null?l:null,d,y,V,x,N,L,ab),i.context=G1(null),l=i.current,d=Ln(),d=tr(d),y=gi(d),y.callback=null,yi(l,y,d),l=d,i.current.lanes=l,ss(i,l),_a(i),n[Te]=i.current,uh(n),new lu(i)},oo.version="19.2.4",oo}var hb;function VN(){if(hb)return Dh.exports;hb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Dh.exports=qN(),Dh.exports}var YN=VN();const GN=BN(YN),jm=new WeakMap,KN=new WeakMap,Du={current:[]};let Ih=!1,No=0;const xo=new Set,du=new Map;function kx(e){for(const t of e){if(Du.current.includes(t))continue;Du.current.push(t),t.recompute();const a=KN.get(t);if(a)for(const s of a){const r=jm.get(s);r!=null&&r.length&&kx(r)}}}function XN(e){const t={prevVal:e.prevState,currentVal:e.state};for(const a of e.listeners)a(t)}function QN(e){const t={prevVal:e.prevState,currentVal:e.state};for(const a of e.listeners)a(t)}function Ex(e){var t;if(No>0&&!du.has(e)&&du.set(e,e.prevState),xo.add(e),!(No>0)&&!Ih)try{for(Ih=!0;xo.size>0;){const a=Array.from(xo);xo.clear();for(const s of a){const r=(t=du.get(s))!=null?t:s.prevState;s.prevState=r,XN(s)}for(const s of a){const r=jm.get(s);r&&(Du.current.push(s),kx(r))}for(const s of a){const r=jm.get(s);if(r)for(const c of r)QN(c)}}}finally{Ih=!1,Du.current=[],du.clear()}}function ZN(e){No++;try{e()}finally{if(No--,No===0){const t=xo.values().next().value;t&&Ex(t)}}}function JN(e){return typeof e=="function"}class WN{constructor(t,a){this.listeners=new Set,this.subscribe=s=>{var r,c;this.listeners.add(s);const o=(c=(r=this.options)==null?void 0:r.onSubscribe)==null?void 0:c.call(r,s,this);return()=>{this.listeners.delete(s),o==null||o()}},this.prevState=t,this.state=t,this.options=a}setState(t){var a,s,r;this.prevState=this.state,(a=this.options)!=null&&a.updateFn?this.state=this.options.updateFn(this.prevState)(t):JN(t)?this.state=t(this.prevState):this.state=t,(r=(s=this.options)==null?void 0:s.onUpdate)==null||r.call(s),Ex(this)}}const Qi="__TSR_index",mb="popstate",pb="beforeunload";function ej(e){let t=e.getLocation();const a=new Set,s=o=>{t=e.getLocation(),a.forEach(u=>u({location:t,action:o}))},r=o=>{var u;(u=e.notifyOnIndexChange)==null||u?s(o):t=e.getLocation()},c=m=>Ue(null,null,function*(){var g=m,{task:o,navigateOpts:u}=g,h=de(g,["task","navigateOpts"]);var _,S,w,C;if((_=u==null?void 0:u.ignoreBlocker)!=null?_:!1){o();return}const v=(w=(S=e.getBlockers)==null?void 0:S.call(e))!=null?w:[],b=h.type==="PUSH"||h.type==="REPLACE";if(typeof document!="undefined"&&v.length&&b)for(const R of v){const j=Mo(h.path,h.state);if(yield R.blockerFn({currentLocation:t,nextLocation:j,action:h.type})){(C=e.onBlocked)==null||C.call(e);return}}o()});return{get location(){return t},get length(){return e.getLength()},subscribers:a,subscribe:o=>(a.add(o),()=>{a.delete(o)}),push:(o,u,h)=>{const m=t.state[Qi];u=gb(m+1,u),c({task:()=>{e.pushState(o,u),s({type:"PUSH"})},navigateOpts:h,type:"PUSH",path:o,state:u})},replace:(o,u,h)=>{const m=t.state[Qi];u=gb(m,u),c({task:()=>{e.replaceState(o,u),s({type:"REPLACE"})},navigateOpts:h,type:"REPLACE",path:o,state:u})},go:(o,u)=>{c({task:()=>{e.go(o),r({type:"GO",index:o})},navigateOpts:u,type:"GO"})},back:o=>{c({task:()=>{var u;e.back((u=o==null?void 0:o.ignoreBlocker)!=null?u:!1),r({type:"BACK"})},navigateOpts:o,type:"BACK"})},forward:o=>{c({task:()=>{var u;e.forward((u=o==null?void 0:o.ignoreBlocker)!=null?u:!1),r({type:"FORWARD"})},navigateOpts:o,type:"FORWARD"})},canGoBack:()=>t.state[Qi]!==0,createHref:o=>e.createHref(o),block:o=>{var h,m;if(!e.setBlockers)return()=>{};const u=(m=(h=e.getBlockers)==null?void 0:h.call(e))!=null?m:[];return e.setBlockers([...u,o]),()=>{var p,v,b;const g=(v=(p=e.getBlockers)==null?void 0:p.call(e))!=null?v:[];(b=e.setBlockers)==null||b.call(e,g.filter(_=>_!==o))}},flush:()=>{var o;return(o=e.flush)==null?void 0:o.call(e)},destroy:()=>{var o;return(o=e.destroy)==null?void 0:o.call(e)},notify:s}}function gb(e,t){t||(t={});const a=hp();return K(T({},t),{key:a,__TSR_key:a,[Qi]:e})}function Rx(e){var B,P,M,U,F;const t=(B=e==null?void 0:e.window)!=null?B:typeof document!="undefined"?window:void 0,a=t.history.pushState,s=t.history.replaceState;let r=[];const c=()=>r,o=q=>r=q,u=(P=e==null?void 0:e.createHref)!=null?P:(q=>q),h=(M=e==null?void 0:e.parseLocation)!=null?M:(()=>Mo(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!((U=t.history.state)!=null&&U.__TSR_key)&&!((F=t.history.state)!=null&&F.key)){const q=hp();t.history.replaceState({[Qi]:0,key:q,__TSR_key:q},"")}let m=h(),g,p=!1,v=!1,b=!1,_=!1;const S=()=>m;let w,C;const R=()=>{w&&(z._ignoreSubscribers=!0,(w.isPush?t.history.pushState:t.history.replaceState)(w.state,"",w.href),z._ignoreSubscribers=!1,w=void 0,C=void 0,g=void 0)},j=(q,H,Y)=>{const $=u(H);C||(g=m),m=Mo(H,Y),w={href:$,state:Y,isPush:(w==null?void 0:w.isPush)||q==="push"},C||(C=Promise.resolve().then(()=>R()))},k=q=>{m=h(),z.notify({type:q})},I=()=>Ue(null,null,function*(){if(v){v=!1;return}const q=h(),H=q.state[Qi]-m.state[Qi],Y=H===1,$=H===-1,X=!Y&&!$||p;p=!1;const Z=X?"GO":$?"BACK":"FORWARD",fe=X?{type:"GO",index:H}:{type:$?"BACK":"FORWARD"};if(b)b=!1;else{const D=c();if(typeof document!="undefined"&&D.length){for(const he of D)if(yield he.blockerFn({currentLocation:m,nextLocation:q,action:Z})){v=!0,t.history.go(1),z.notify(fe);return}}}m=h(),z.notify(fe)}),O=q=>{var $;if(_){_=!1;return}let H=!1;const Y=c();if(typeof document!="undefined"&&Y.length)for(const X of Y){const Z=($=X.enableBeforeUnload)!=null?$:!0;if(Z===!0){H=!0;break}if(typeof Z=="function"&&Z()===!0){H=!0;break}}if(H)return q.preventDefault(),q.returnValue=""},z=ej({getLocation:S,getLength:()=>t.history.length,pushState:(q,H)=>j("push",q,H),replaceState:(q,H)=>j("replace",q,H),back:q=>(q&&(b=!0),_=!0,t.history.back()),forward:q=>{q&&(b=!0),_=!0,t.history.forward()},go:q=>{p=!0,t.history.go(q)},createHref:q=>u(q),flush:R,destroy:()=>{t.history.pushState=a,t.history.replaceState=s,t.removeEventListener(pb,O,{capture:!0}),t.removeEventListener(mb,I)},onBlocked:()=>{g&&m!==g&&(m=g)},getBlockers:c,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(pb,O,{capture:!0}),t.addEventListener(mb,I),t.history.pushState=function(...q){const H=a.apply(t.history,q);return z._ignoreSubscribers||k("PUSH"),H},t.history.replaceState=function(...q){const H=s.apply(t.history,q);return z._ignoreSubscribers||k("REPLACE"),H},z}function tj(e){const t=typeof document!="undefined"?window:void 0;return Rx({window:t,parseLocation:()=>{var h;const a=t.location.hash.split("#").slice(1),s=(h=a[0])!=null?h:"/",r=t.location.search,c=a.slice(1),o=c.length===0?"":`#${c.join("#")}`,u=`${s}${r}${o}`;return Mo(u,t.history.state)},createHref:a=>`${t.location.pathname}${t.location.search}#${a}`})}function nj(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Mo(e,t){const a=nj(e),s=a.indexOf("#"),r=a.indexOf("?"),c=hp();return{href:a,pathname:a.substring(0,s>0?r>0?Math.min(s,r):s:r>0?r:a.length),hash:s>-1?a.substring(s):"",search:r>-1?a.slice(r,s===-1?void 0:s):"",state:t||{[Qi]:0,key:c,__TSR_key:c}}}function hp(){return(Math.random()+1).toString(36).substring(7)}const Uh=!1;function jo(e){let t;return ZN(()=>{t=e()}),t}function Ao(e){return e[e.length-1]}function aj(e){return typeof e=="function"}function Ki(e,t){return aj(e)?e(t):e}const ij=Object.prototype.hasOwnProperty,yb=Object.prototype.propertyIsEnumerable;function On(e,t,a=0){if(e===t)return e;if(a>500)return t;const s=t,r=xb(e)&&xb(s);if(!r&&!(Ou(e)&&Ou(s)))return s;const c=r?e:vb(e);if(!c)return s;const o=r?s:vb(s);if(!o)return s;const u=c.length,h=o.length,m=r?new Array(h):{};let g=0;for(let p=0;p<h;p++){const v=r?p:o[p],b=e[v],_=s[v];if(b===_){m[v]=b,(r?p<u:ij.call(e,v))&&g++;continue}if(b===null||_===null||typeof b!="object"||typeof _!="object"){m[v]=_;continue}const S=On(b,_,a+1);m[v]=S,S===b&&g++}return u===h&&g===u?e:m}function vb(e){const t=Object.getOwnPropertyNames(e);for(const r of t)if(!yb.call(e,r))return!1;const a=Object.getOwnPropertySymbols(e);if(a.length===0)return t;const s=t;for(const r of a){if(!yb.call(e,r))return!1;s.push(r)}return s}function Ou(e){if(!bb(e))return!1;const t=e.constructor;if(typeof t=="undefined")return!0;const a=t.prototype;return!(!bb(a)||!a.hasOwnProperty("isPrototypeOf"))}function bb(e){return Object.prototype.toString.call(e)==="[object Object]"}function xb(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Bs(e,t,a){var s;if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,c=e.length;r<c;r++)if(!Bs(e[r],t[r],a))return!1;return!0}if(Ou(e)&&Ou(t)){const r=(s=a==null?void 0:a.ignoreUndefined)!=null?s:!0;if(a!=null&&a.partial){for(const u in t)if((!r||t[u]!==void 0)&&!Bs(e[u],t[u],a))return!1;return!0}let c=0;if(!r)c=Object.keys(e).length;else for(const u in e)e[u]!==void 0&&c++;let o=0;for(const u in t)if((!r||t[u]!==void 0)&&(o++,o>c||!Bs(e[u],t[u],a)))return!1;return c===o}return!1}function al(e){let t,a;const s=new Promise((r,c)=>{t=r,a=c});return s.status="pending",s.resolve=r=>{s.status="resolved",s.value=r,t(r),e==null||e(r)},s.reject=r=>{s.status="rejected",a(r)},s}function $r(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function sj(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function _b(e){let t;try{t=decodeURI(e)}catch(a){t=e.replaceAll(/%[0-9A-F]{2}/gi,s=>{try{return decodeURI(s)}catch(r){return s}})}return sj(t)}const Tx=["http:","https:","mailto:","tel:"];function zu(e){if(!e)return!1;try{const t=new URL(e);return!Tx.includes(t.protocol)}catch(t){return!1}}function co(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let a=0,s="",r;for(;(r=t.exec(e))!==null;)s+=_b(e.slice(a,r.index))+r[0],a=t.lastIndex;s=s+_b(a?e.slice(a):e);let c=!1;return s.startsWith("//")&&(c=!0,s="/"+s.replace(/^\/+/,"")),{path:s,handledProtocolRelativeURL:c}}function rj(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var lj="Invariant failed";function ii(e,t){if(!e)throw new Error(lj)}function Iu(e){const t=new Map;let a,s;const r=c=>{c.next&&(c.prev?(c.prev.next=c.next,c.next.prev=c.prev,c.next=void 0,s&&(s.next=c,c.prev=s)):(c.next.prev=void 0,a=c.next,c.next=void 0,s&&(c.prev=s,s.next=c)),s=c)};return{get(c){const o=t.get(c);if(o)return r(o),o.value},set(c,o){if(t.size>=e&&a){const h=a;t.delete(h.key),h.next&&(a=h.next,h.next.prev=void 0),h===s&&(s=void 0)}const u=t.get(c);if(u)u.value=o,r(u);else{const h={key:c,value:o,prev:s};s&&(s.next=h),s=h,a||(a=h),t.set(c,h)}},clear(){t.clear(),a=void 0,s=void 0}}}const il=0,$s=1,qs=2,Lo=3,ks=4,Mx=5;function oj(e){const t=e.indexOf("{");if(t===-1)return null;const a=e.indexOf("}",t);return a===-1||t+1>=e.length?null:[t,a]}function mp(e,t,a=new Uint16Array(6)){const s=e.indexOf("/",t),r=s===-1?e.length:s,c=e.substring(t,r);if(!c||!c.includes("$"))return a[0]=il,a[1]=t,a[2]=t,a[3]=r,a[4]=r,a[5]=r,a;if(c==="$"){const u=e.length;return a[0]=qs,a[1]=t,a[2]=t,a[3]=u,a[4]=u,a[5]=u,a}if(c.charCodeAt(0)===36)return a[0]=$s,a[1]=t,a[2]=t+1,a[3]=r,a[4]=r,a[5]=r,a;const o=oj(c);if(o){const[u,h]=o,m=c.charCodeAt(u+1);if(m===45){if(u+2<c.length&&c.charCodeAt(u+2)===36){const g=u+3,p=h;if(g<p)return a[0]=Lo,a[1]=t+u,a[2]=t+g,a[3]=t+p,a[4]=t+h+1,a[5]=r,a}}else if(m===36){const g=u+1,p=u+2;return p===h?(a[0]=qs,a[1]=t+u,a[2]=t+g,a[3]=t+p,a[4]=t+h+1,a[5]=e.length,a):(a[0]=$s,a[1]=t+u,a[2]=t+p,a[3]=t+h,a[4]=t+h+1,a[5]=r,a)}}return a[0]=il,a[1]=t,a[2]=t,a[3]=r,a[4]=r,a[5]=r,a}function Zu(e,t,a,s,r,c,o){var h,m,g,p,v,b,_,S,w,C,R,j,k,I,O,z,B,P,M,U,F,q,H,Y,$,X,Z,fe,D,he,ge;o==null||o(a);let u=s;{const E=(h=a.fullPath)!=null?h:a.from,W=E.length,oe=(g=(m=a.options)==null?void 0:m.caseSensitive)!=null?g:e,me=!!((v=(p=a.options)==null?void 0:p.params)!=null&&v.parse&&((_=(b=a.options)==null?void 0:b.skipRouteOnParseError)!=null&&_.params));for(;u<W;){const be=mp(E,u,t);let Ae;const Ge=u,ot=be[5];switch(u=ot+1,c++,be[0]){case il:{const at=E.substring(be[2],be[3]);if(oe){const Ie=(S=r.static)==null?void 0:S.get(at);if(Ie)Ae=Ie;else{(w=r.static)!=null||(r.static=new Map);const qe=Es((C=a.fullPath)!=null?C:a.from);qe.parent=r,qe.depth=c,Ae=qe,r.static.set(at,qe)}}else{const Ie=at.toLowerCase(),qe=(R=r.staticInsensitive)==null?void 0:R.get(Ie);if(qe)Ae=qe;else{(j=r.staticInsensitive)!=null||(r.staticInsensitive=new Map);const bt=Es((k=a.fullPath)!=null?k:a.from);bt.parent=r,bt.depth=c,Ae=bt,r.staticInsensitive.set(Ie,bt)}}break}case $s:{const at=E.substring(Ge,be[1]),Ie=E.substring(be[4],ot),qe=oe&&!!(at||Ie),bt=at?qe?at:at.toLowerCase():void 0,ke=Ie?qe?Ie:Ie.toLowerCase():void 0,ct=!me&&((I=r.dynamic)==null?void 0:I.find(Fe=>!Fe.skipOnParamError&&Fe.caseSensitive===qe&&Fe.prefix===bt&&Fe.suffix===ke));if(ct)Ae=ct;else{const Fe=Fh($s,(O=a.fullPath)!=null?O:a.from,qe,bt,ke);Ae=Fe,Fe.depth=c,Fe.parent=r,(z=r.dynamic)!=null||(r.dynamic=[]),r.dynamic.push(Fe)}break}case Lo:{const at=E.substring(Ge,be[1]),Ie=E.substring(be[4],ot),qe=oe&&!!(at||Ie),bt=at?qe?at:at.toLowerCase():void 0,ke=Ie?qe?Ie:Ie.toLowerCase():void 0,ct=!me&&((B=r.optional)==null?void 0:B.find(Fe=>!Fe.skipOnParamError&&Fe.caseSensitive===qe&&Fe.prefix===bt&&Fe.suffix===ke));if(ct)Ae=ct;else{const Fe=Fh(Lo,(P=a.fullPath)!=null?P:a.from,qe,bt,ke);Ae=Fe,Fe.parent=r,Fe.depth=c,(M=r.optional)!=null||(r.optional=[]),r.optional.push(Fe)}break}case qs:{const at=E.substring(Ge,be[1]),Ie=E.substring(be[4],ot),qe=oe&&!!(at||Ie),bt=at?qe?at:at.toLowerCase():void 0,ke=Ie?qe?Ie:Ie.toLowerCase():void 0,ct=Fh(qs,(U=a.fullPath)!=null?U:a.from,qe,bt,ke);Ae=ct,ct.parent=r,ct.depth=c,(F=r.wildcard)!=null||(r.wildcard=[]),r.wildcard.push(ct)}}r=Ae}if(me&&a.children&&!a.isRoot&&a.id&&a.id.charCodeAt(a.id.lastIndexOf("/")+1)===95){const be=Es((q=a.fullPath)!=null?q:a.from);be.kind=Mx,be.parent=r,c++,be.depth=c,(H=r.pathless)!=null||(r.pathless=[]),r.pathless.push(be),r=be}const _e=(a.path||!a.children)&&!a.isRoot;if(_e&&E.endsWith("/")){const be=Es((Y=a.fullPath)!=null?Y:a.from);be.kind=ks,be.parent=r,c++,be.depth=c,r.index=be,r=be}r.parse=(Z=(X=($=a.options)==null?void 0:$.params)==null?void 0:X.parse)!=null?Z:null,r.skipOnParamError=me,r.parsingPriority=(he=(D=(fe=a.options)==null?void 0:fe.skipRouteOnParseError)==null?void 0:D.priority)!=null?he:0,_e&&!r.route&&(r.route=a,r.fullPath=(ge=a.fullPath)!=null?ge:a.from)}if(a.children)for(const E of a.children)Zu(e,t,E,u,r,c,o)}function Bh(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Ui(e){var t,a,s;if(e.pathless)for(const r of e.pathless)Ui(r);if(e.static)for(const r of e.static.values())Ui(r);if(e.staticInsensitive)for(const r of e.staticInsensitive.values())Ui(r);if((t=e.dynamic)!=null&&t.length){e.dynamic.sort(Bh);for(const r of e.dynamic)Ui(r)}if((a=e.optional)!=null&&a.length){e.optional.sort(Bh);for(const r of e.optional)Ui(r)}if((s=e.wildcard)!=null&&s.length){e.wildcard.sort(Bh);for(const r of e.wildcard)Ui(r)}}function Es(e){return{kind:il,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Fh(e,t,a,s,r){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:a,prefix:s,suffix:r}}function cj(e,t){const a=Es("/"),s=new Uint16Array(6);for(const r of e)Zu(!1,s,r,1,a,0);Ui(a),t.masksTree=a,t.flatCache=Iu(1e3)}function uj(e,t){e||(e="/");const a=t.flatCache.get(e);if(a)return a;const s=pp(e,t.masksTree);return t.flatCache.set(e,s),s}function dj(e,t,a,s,r){e||(e="/"),s||(s="/");const c=t?`case\0${e}`:e;let o=r.singleCache.get(c);if(!o){o=Es("/");const u=new Uint16Array(6);Zu(t,u,{from:e},1,o,0),r.singleCache.set(c,o)}return pp(s,o,a)}function fj(e,t,a=!1){const s=a?e:`nofuzz\0${e}`,r=t.matchCache.get(s);if(r!==void 0)return r;e||(e="/");let c;try{c=pp(e,t.segmentTree,a)}catch(o){if(o instanceof URIError)c=null;else throw o}return c&&(c.branch=pj(c.route)),t.matchCache.set(s,c),c}function hj(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function mj(e,t=!1,a){const s=Es(e.fullPath),r=new Uint16Array(6),c={},o={};let u=0;return Zu(t,r,e,1,s,0,m=>{if(a==null||a(m,u),ii(!(m.id in c),`Duplicate routes found with id: ${String(m.id)}`),c[m.id]=m,u!==0&&m.path){const g=hj(m.fullPath);(!o[g]||m.fullPath.endsWith("/"))&&(o[g]=m)}u++}),Ui(s),{processedTree:{segmentTree:s,singleCache:Iu(1e3),matchCache:Iu(1e3),flatCache:null,masksTree:null},routesById:c,routesByPath:o}}function pp(e,t,a=!1){const s=e.split("/"),r=yj(e,s,t,a);if(!r)return null;const[c]=Ax(e,s,r);return{route:r.node.route,rawParams:c,parsedParams:r.parsedParams}}function Ax(e,t,a){var g,p,v,b,_,S,w,C,R,j,k,I,O,z,B,P,M,U,F,q;const s=gj(a.node);let r=null;const c={};let o=(p=(g=a.extract)==null?void 0:g.part)!=null?p:0,u=(b=(v=a.extract)==null?void 0:v.node)!=null?b:0,h=(S=(_=a.extract)==null?void 0:_.path)!=null?S:0,m=(C=(w=a.extract)==null?void 0:w.segment)!=null?C:0;for(;u<s.length;o++,u++,h++,m++){const H=s[u];if(H.kind===ks)break;if(H.kind===Mx){m--,o--,h--;continue}const Y=t[o],$=h;if(Y&&(h+=Y.length),H.kind===$s){r!=null||(r=a.node.fullPath.split("/"));const X=r[m],Z=(j=(R=H.prefix)==null?void 0:R.length)!=null?j:0;if(X.charCodeAt(Z)===123){const D=(I=(k=H.suffix)==null?void 0:k.length)!=null?I:0,he=X.substring(Z+2,X.length-D-1),ge=Y.substring(Z,Y.length-D);c[he]=decodeURIComponent(ge)}else{const D=X.substring(1);c[D]=decodeURIComponent(Y)}}else if(H.kind===Lo){if(a.skipped&1<<u){o--,h=$-1;continue}r!=null||(r=a.node.fullPath.split("/"));const X=r[m],Z=(z=(O=H.prefix)==null?void 0:O.length)!=null?z:0,fe=(P=(B=H.suffix)==null?void 0:B.length)!=null?P:0,D=X.substring(Z+3,X.length-fe-1),he=H.suffix||H.prefix?Y.substring(Z,Y.length-fe):Y;he&&(c[D]=decodeURIComponent(he))}else if(H.kind===qs){const X=H,Z=e.substring($+((U=(M=X.prefix)==null?void 0:M.length)!=null?U:0),e.length-((q=(F=X.suffix)==null?void 0:F.length)!=null?q:0)),fe=decodeURIComponent(Z);c["*"]=fe,c._splat=fe;break}}return a.rawParams&&Object.assign(c,a.rawParams),[c,{part:o,node:u,path:h,segment:m}]}function pj(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function gj(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function yj(e,t,a,s){var p;if(e==="/"&&a.index)return{node:a.index,skipped:0};const r=!Ao(t),c=r&&e!=="/",o=t.length-(r?1:0),u=[{node:a,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let h=null,m=null,g=null;for(;u.length;){const v=u.pop(),{node:b,index:_,skipped:S,depth:w,statics:C,dynamics:R,optionals:j}=v;let{extract:k,rawParams:I,parsedParams:O}=v;if(b.skipOnParamError){if(!Hh(e,t,v))continue;I=v.rawParams,k=v.extract,O=v.parsedParams}s&&b.route&&b.kind!==ks&&uo(m,v)&&(m=v);const z=_===o;if(z&&(b.route&&!c&&uo(g,v)&&(g=v),!b.optional&&!b.wildcard&&!b.index&&!b.pathless))continue;const B=z?void 0:t[_];let P;if(z&&b.index){const M={node:b.index,index:_,skipped:S,depth:w+1,statics:C,dynamics:R,optionals:j,extract:k,rawParams:I,parsedParams:O};let U=!0;if(b.index.skipOnParamError&&(Hh(e,t,M)||(U=!1)),U){if(C===o&&!R&&!j&&!S)return M;uo(g,M)&&(g=M)}}if(b.wildcard&&uo(h,v))for(const M of b.wildcard){const{prefix:U,suffix:F}=M;if(U&&(z||!(M.caseSensitive?B:P!=null?P:P=B.toLowerCase()).startsWith(U)))continue;if(F){if(z)continue;const H=t.slice(_).join("/").slice(-F.length);if((M.caseSensitive?H:H.toLowerCase())!==F)continue}const q={node:M,index:o,skipped:S,depth:w,statics:C,dynamics:R,optionals:j,extract:k,rawParams:I,parsedParams:O};if(!(M.skipOnParamError&&!Hh(e,t,q))){h=q;break}}if(b.optional){const M=S|1<<w,U=w+1;for(let F=b.optional.length-1;F>=0;F--){const q=b.optional[F];u.push({node:q,index:_,skipped:M,depth:U,statics:C,dynamics:R,optionals:j,extract:k,rawParams:I,parsedParams:O})}if(!z)for(let F=b.optional.length-1;F>=0;F--){const q=b.optional[F],{prefix:H,suffix:Y}=q;if(H||Y){const $=q.caseSensitive?B:P!=null?P:P=B.toLowerCase();if(H&&!$.startsWith(H)||Y&&!$.endsWith(Y))continue}u.push({node:q,index:_+1,skipped:S,depth:U,statics:C,dynamics:R,optionals:j+1,extract:k,rawParams:I,parsedParams:O})}}if(!z&&b.dynamic&&B)for(let M=b.dynamic.length-1;M>=0;M--){const U=b.dynamic[M],{prefix:F,suffix:q}=U;if(F||q){const H=U.caseSensitive?B:P!=null?P:P=B.toLowerCase();if(F&&!H.startsWith(F)||q&&!H.endsWith(q))continue}u.push({node:U,index:_+1,skipped:S,depth:w+1,statics:C,dynamics:R+1,optionals:j,extract:k,rawParams:I,parsedParams:O})}if(!z&&b.staticInsensitive){const M=b.staticInsensitive.get(P!=null?P:P=B.toLowerCase());M&&u.push({node:M,index:_+1,skipped:S,depth:w+1,statics:C+1,dynamics:R,optionals:j,extract:k,rawParams:I,parsedParams:O})}if(!z&&b.static){const M=b.static.get(B);M&&u.push({node:M,index:_+1,skipped:S,depth:w+1,statics:C+1,dynamics:R,optionals:j,extract:k,rawParams:I,parsedParams:O})}if(b.pathless){const M=w+1;for(let U=b.pathless.length-1;U>=0;U--){const F=b.pathless[U];u.push({node:F,index:_,skipped:S,depth:M,statics:C,dynamics:R,optionals:j,extract:k,rawParams:I,parsedParams:O})}}}if(g&&h)return uo(h,g)?g:h;if(g)return g;if(h)return h;if(s&&m){let v=m.index;for(let _=0;_<m.index;_++)v+=t[_].length;const b=v===e.length?"/":e.slice(v);return(p=m.rawParams)!=null||(m.rawParams={}),m.rawParams["**"]=decodeURIComponent(b),m}return null}function Hh(e,t,a){try{const[s,r]=Ax(e,t,a);a.rawParams=s,a.extract=r;const c=a.node.parse(s);return a.parsedParams=Object.assign({},a.parsedParams,c),!0}catch(s){return null}}function uo(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===ks)>(e.node.kind===ks)||t.node.kind===ks==(e.node.kind===ks)&&t.depth>e.depth))):!0}function ku(e){return gp(e.filter(t=>t!==void 0).join("/"))}function gp(e){return e.replace(/\/{2,}/g,"/")}function Lx(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function ni(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function Dx(e){return ni(Lx(e))}function Uu(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function vj(e,t,a){return Uu(e,a)===Uu(t,a)}function bj({base:e,to:t,trailingSlash:a="never",cache:s}){const r=t.startsWith("/"),c=!r&&t===".";let o;if(s){o=r?t:c?e:e+"\0"+t;const p=s.get(o);if(p)return p}let u;if(c)u=e.split("/");else if(r)u=t.split("/");else{for(u=e.split("/");u.length>1&&Ao(u)==="";)u.pop();const p=t.split("/");for(let v=0,b=p.length;v<b;v++){const _=p[v];_===""?v?v===b-1&&u.push(_):u=[_]:_===".."?u.pop():_==="."||u.push(_)}}u.length>1&&(Ao(u)===""?a==="never"&&u.pop():a==="always"&&u.push(""));let h,m="";for(let p=0;p<u.length;p++){p>0&&(m+="/");const v=u[p];if(!v)continue;h=mp(v,0,h);const b=h[0];if(b===il){m+=v;continue}const _=h[5],S=v.substring(0,h[1]),w=v.substring(h[4],_),C=v.substring(h[2],h[3]);b===$s?m+=S||w?`${S}{$${C}}${w}`:`$${C}`:b===qs?m+=S||w?`${S}{$}${w}`:"$":m+=`${S}{-$${C}}${w}`}m=gp(m);const g=m||"/";return o&&s&&s.set(o,g),g}function xj(e){const t=new Map(e.map(r=>[encodeURIComponent(r),r])),a=Array.from(t.keys()).map(r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),s=new RegExp(a,"g");return r=>r.replace(s,c=>{var o;return(o=t.get(c))!=null?o:c})}function Ph(e,t,a){const s=t[e];return typeof s!="string"?s:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(s)?s:s.split("/").map(r=>Sb(r,a)).join("/"):Sb(s,a)}function $h(r){var c=r,{path:e,params:t,decoder:a}=c,s=de(c,["path","params","decoder"]);var b,_;let o=!1;const u={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:u,isMissingParams:o};if(!e.includes("$"))return{interpolatedPath:e,usedParams:u,isMissingParams:o};const h=e.length;let m=0,g,p="";for(;m<h;){const S=m;g=mp(e,S,g);const w=g[5];if(m=w+1,S===w)continue;const C=g[0];if(C===il){p+="/"+e.substring(S,w);continue}if(C===qs){const R=t._splat;u._splat=R,u["*"]=R;const j=e.substring(S,g[1]),k=e.substring(g[4],w);if(!R){o=!0,(j||k)&&(p+="/"+j+k);continue}const I=Ph("_splat",t,a);p+="/"+j+I+k;continue}if(C===$s){const R=e.substring(g[2],g[3]);!o&&!(R in t)&&(o=!0),u[R]=t[R];const j=e.substring(S,g[1]),k=e.substring(g[4],w),I=(b=Ph(R,t,a))!=null?b:"undefined";p+="/"+j+I+k;continue}if(C===Lo){const R=e.substring(g[2],g[3]),j=t[R];if(j==null)continue;u[R]=j;const k=e.substring(S,g[1]),I=e.substring(g[4],w),O=(_=Ph(R,t,a))!=null?_:"";p+="/"+k+O+I;continue}}return e.endsWith("/")&&(p+="/"),{usedParams:u,interpolatedPath:p||"/",isMissingParams:o}}function Sb(e,t){var s;const a=encodeURIComponent(e);return(s=t==null?void 0:t(a))!=null?s:a}function zn(e){return!!(e!=null&&e.isNotFound)}function _j(){try{if(typeof window!="undefined"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch(e){}}const km="tsr-scroll-restoration-v1_3",Sj=(e,t)=>{let a;return(...s)=>{a||(a=setTimeout(()=>{e(...s),a=null},t))}};function wj(){const e=_j();if(!e)return null;const t=e.getItem(km);let a=t?JSON.parse(t):{};return{state:a,set:s=>{a=Ki(s,a)||a;try{e.setItem(km,JSON.stringify(a))}catch(r){console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const fu=wj(),Cj=e=>e.state.__TSR_key||e.href;function Nj(e){const t=[];let a;for(;a=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(a.children,e)+1})`),e=a;return`${t.reverse().join(" > ")}`.toLowerCase()}let Bu=!1;function jj({storageKey:e,key:t,behavior:a,shouldScrollRestoration:s,scrollToTopSelectors:r,location:c}){var m,g,p;let o;try{o=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(v){console.error(v);return}const u=t||((m=window.history.state)==null?void 0:m.__TSR_key),h=o[u];Bu=!0;e:{if(s&&h&&Object.keys(h).length>0){for(const _ in h){const S=h[_];if(_==="window")window.scrollTo({top:S.scrollY,left:S.scrollX,behavior:a});else if(_){const w=document.querySelector(_);w&&(w.scrollLeft=S.scrollX,w.scrollTop=S.scrollY)}}break e}const v=(c!=null?c:window.location).hash.split("#",2)[1];if(v){const _=(p=(g=window.history.state)==null?void 0:g.__hashScrollIntoViewOptions)!=null?p:!0;if(_){const S=document.getElementById(v);S&&S.scrollIntoView(_)}break e}const b={top:0,left:0,behavior:a};if(window.scrollTo(b),r)for(const _ of r){if(_==="window")continue;const S=typeof _=="function"?_():document.querySelector(_);S&&S.scrollTo(b)}}Bu=!1}function kj(e,t){var c;if(!fu||(((c=e.options.scrollRestoration)!=null?c:!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!fu))return;e.isScrollRestorationSetup=!0,Bu=!1;const s=e.options.getScrollRestorationKey||Cj;window.history.scrollRestoration="manual";const r=o=>{if(Bu||!e.isScrollRestoring)return;let u="";if(o.target===document||o.target===window)u="window";else{const m=o.target.getAttribute("data-scroll-restoration-id");m?u=`[data-scroll-restoration-id="${m}"]`:u=Nj(o.target)}const h=s(e.state.location);fu.set(m=>{const g=m[h]||(m[h]={}),p=g[u]||(g[u]={});if(u==="window")p.scrollX=window.scrollX||0,p.scrollY=window.scrollY||0;else if(u){const v=document.querySelector(u);v&&(p.scrollX=v.scrollLeft||0,p.scrollY=v.scrollTop||0)}return m})};typeof document!="undefined"&&document.addEventListener("scroll",Sj(r,100),!0),e.subscribe("onRendered",o=>{const u=s(o.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(jj({storageKey:km,key:u,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&fu.set(h=>(h[u]||(h[u]={}),h)))})}function Ej(e){var t;if(typeof document!="undefined"&&document.querySelector){const a=(t=e.state.location.state.__hashScrollIntoViewOptions)!=null?t:!0;if(a&&e.state.location.hash!==""){const s=document.getElementById(e.state.location.hash);s&&s.scrollIntoView(a)}}}function Rj(e,t=String){const a=new URLSearchParams;for(const s in e){const r=e[s];r!==void 0&&a.set(s,t(r))}return a.toString()}function qh(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function Tj(e){const t=new URLSearchParams(e),a={};for(const[s,r]of t.entries()){const c=a[s];c==null?a[s]=qh(r):Array.isArray(c)?c.push(qh(r)):a[s]=[c,qh(r)]}return a}const Mj=Lj(JSON.parse),Aj=Dj(JSON.stringify,JSON.parse);function Lj(e){return t=>{t[0]==="?"&&(t=t.substring(1));const a=Tj(t);for(const s in a){const r=a[s];if(typeof r=="string")try{a[s]=e(r)}catch(c){}}return a}}function Dj(e,t){const a=typeof t=="function";function s(r){if(typeof r=="object"&&r!==null)try{return e(r)}catch(c){}else if(a&&typeof r=="string")try{return t(r),e(r)}catch(c){}return r}return r=>{const c=Rj(r,s);return c?`?${c}`:""}}const Jn="__root__";function Oj(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&typeof e.href=="string"&&zu(e.href))throw new Error(`Redirect blocked: unsafe protocol in href "${e.href}". Only ${Tx.join(", ")} protocols are allowed.`);if(!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch(s){}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const a=new Response(null,{status:e.statusCode,headers:t});if(a.options=e,e.throw)throw a;return a}function ta(e){return e instanceof Response&&!!e.options}const Eu=e=>{var t;if(!e.rendered)return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)},Ju=(e,t)=>!!(e.preload&&!e.router.state.matches.some(a=>a.id===t)),qr=(e,t,a=!0)=>{var c;const s=T({},(c=e.router.options.context)!=null?c:{}),r=a?t:t-1;for(let o=0;o<=r;o++){const u=e.matches[o];if(!u)continue;const h=e.router.getMatch(u.id);h&&Object.assign(s,h.__routeContext,h.__beforeLoadContext)}return s},Ox=(e,t)=>{var r,c,o;const a=(c=e.router.routesById[(r=t.routeId)!=null?r:""])!=null?c:e.router.routeTree;!a.options.notFoundComponent&&((o=e.router.options)!=null&&o.defaultNotFoundComponent)&&(a.options.notFoundComponent=e.router.options.defaultNotFoundComponent),ii(a.options.notFoundComponent);const s=e.matches.find(u=>u.routeId===a.id);ii(s,"Could not find match for route: "+a.id),e.updateMatch(s.id,u=>K(T({},u),{status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&a.parentRoute&&(t.routeId=a.parentRoute.id,Ox(e,t))},Xi=(e,t,a)=>{var s,r,c;if(!(!ta(a)&&!zn(a))){if(ta(a)&&a.redirectHandled&&!a.options.reloadDocument)throw a;if(t){(s=t._nonReactive.beforeLoadPromise)==null||s.resolve(),(r=t._nonReactive.loaderPromise)==null||r.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const o=ta(a)?"redirected":"notFound";t._nonReactive.error=a,e.updateMatch(t.id,u=>K(T({},u),{status:o,context:qr(e,t.index),isFetching:!1,error:a})),zn(a)&&!a.routeId&&(a.routeId=t.routeId),(c=t._nonReactive.loadPromise)==null||c.resolve()}throw ta(a)?(e.rendered=!0,a.options._fromLocation=e.location,a.redirectHandled=!0,a=e.router.resolveRedirect(a),a):(Ox(e,a),a)}},zx=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,fo=(e,t,a,s)=>{var u,h,m;const{id:r,routeId:c}=e.matches[t],o=e.router.looseRoutesById[c];if(a instanceof Promise)throw a;a.routerCode=s,(u=e.firstBadMatchIndex)!=null||(e.firstBadMatchIndex=t),Xi(e,e.router.getMatch(r),a);try{(m=(h=o.options).onError)==null||m.call(h,a)}catch(g){a=g,Xi(e,e.router.getMatch(r),a)}e.updateMatch(r,g=>{var p,v;return(p=g._nonReactive.beforeLoadPromise)==null||p.resolve(),g._nonReactive.beforeLoadPromise=void 0,(v=g._nonReactive.loadPromise)==null||v.resolve(),K(T({},g),{error:a,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})})},Ix=(e,t,a,s)=>{var o,u,h;if(s._nonReactive.pendingTimeout!==void 0)return;const r=(o=a.options.pendingMs)!=null?o:e.router.options.defaultPendingMs;if(!!(e.onReady&&!Ju(e,t)&&(a.options.loader||a.options.beforeLoad||Fx(a))&&typeof r=="number"&&r!==1/0&&((h=a.options.pendingComponent)!=null?h:(u=e.router.options)!=null&&u.defaultPendingComponent))){const m=setTimeout(()=>{Eu(e)},r);s._nonReactive.pendingTimeout=m}},zj=(e,t,a)=>{const s=e.router.getMatch(t);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;Ix(e,t,a,s);const r=()=>{const c=e.router.getMatch(t);c.preload&&(c.status==="redirected"||c.status==="notFound")&&Xi(e,c,c.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(r):r()},Ij=(e,t,a,s)=>{const r=e.router.getMatch(t),c=r._nonReactive.loadPromise;r._nonReactive.loadPromise=al(()=>{c==null||c.resolve()});const{paramsError:o,searchError:u}=r;o&&fo(e,a,o,"PARSE_PARAMS"),u&&fo(e,a,u,"VALIDATE_SEARCH"),Ix(e,t,s,r);const h=new AbortController;let m=!1;const g=()=>{m||(m=!0,e.updateMatch(t,k=>K(T({},k),{isFetching:"beforeLoad",fetchCount:k.fetchCount+1,abortController:h})))},p=()=>{var k;(k=r._nonReactive.beforeLoadPromise)==null||k.resolve(),r._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,I=>K(T({},I),{isFetching:!1}))};if(!s.options.beforeLoad){jo(()=>{g(),p()});return}r._nonReactive.beforeLoadPromise=al();const v=T(T({},qr(e,a,!1)),r.__routeContext),{search:b,params:_,cause:S}=r,w=Ju(e,t),C=T({search:b,abortController:h,params:_,preload:w,context:v,location:e.location,navigate:k=>e.router.navigate(K(T({},k),{_fromLocation:e.location})),buildLocation:e.router.buildLocation,cause:w?"preload":S,matches:e.matches,routeId:s.id},e.router.options.additionalContext),R=k=>{if(k===void 0){jo(()=>{g(),p()});return}(ta(k)||zn(k))&&(g(),fo(e,a,k,"BEFORE_LOAD")),jo(()=>{g(),e.updateMatch(t,I=>K(T({},I),{__beforeLoadContext:k})),p()})};let j;try{if(j=s.options.beforeLoad(C),$r(j))return g(),j.catch(k=>{fo(e,a,k,"BEFORE_LOAD")}).then(R)}catch(k){g(),fo(e,a,k,"BEFORE_LOAD")}R(j)},Uj=(e,t)=>{const{id:a,routeId:s}=e.matches[t],r=e.router.looseRoutesById[s],c=()=>u(),o=()=>Ij(e,a,t,r),u=()=>{if(zx(e,a))return;const h=zj(e,a,r);return $r(h)?h.then(o):o()};return c()},Bj=(e,t,a)=>{var c,o,u,h,m,g;const s=e.router.getMatch(t);if(!s||!a.options.head&&!a.options.scripts&&!a.options.headers)return;const r={ssr:e.router.options.ssr,matches:e.matches,match:s,params:s.params,loaderData:s.loaderData};return Promise.all([(o=(c=a.options).head)==null?void 0:o.call(c,r),(h=(u=a.options).scripts)==null?void 0:h.call(u,r),(g=(m=a.options).headers)==null?void 0:g.call(m,r)]).then(([p,v,b])=>{const _=p==null?void 0:p.meta,S=p==null?void 0:p.links,w=p==null?void 0:p.scripts,C=p==null?void 0:p.styles;return{meta:_,links:S,headScripts:w,headers:b,scripts:v,styles:C}})},Ux=(e,t,a,s)=>{const r=e.matchPromises[a-1],{params:c,loaderDeps:o,abortController:u,cause:h}=e.router.getMatch(t),m=qr(e,a),g=Ju(e,t);return T({params:c,deps:o,preload:!!g,parentMatchPromise:r,abortController:u,context:m,location:e.location,navigate:p=>e.router.navigate(K(T({},p),{_fromLocation:e.location})),cause:g?"preload":h,route:s},e.router.options.additionalContext)},wb=(e,t,a,s)=>Ue(null,null,function*(){var r,c,o,u,h,m,g;try{const p=e.router.getMatch(t);try{(!(Uh!=null?Uh:e.router.isServer)||p.ssr===!0)&&Bx(s);const v=(c=(r=s.options).loader)==null?void 0:c.call(r,Ux(e,t,a,s)),b=s.options.loader&&$r(v);if(!!(b||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||p._nonReactive.minPendingPromise)&&e.updateMatch(t,w=>K(T({},w),{isFetching:"loader"})),s.options.loader){const w=b?yield v:v;Xi(e,e.router.getMatch(t),w),w!==void 0&&e.updateMatch(t,C=>K(T({},C),{loaderData:w}))}s._lazyPromise&&(yield s._lazyPromise);const S=p._nonReactive.minPendingPromise;S&&(yield S),s._componentsPromise&&(yield s._componentsPromise),e.updateMatch(t,w=>K(T({},w),{error:void 0,context:qr(e,a),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(v){let b=v;if((b==null?void 0:b.name)==="AbortError"){if(p.abortController.signal.aborted){(o=p._nonReactive.loaderPromise)==null||o.resolve(),p._nonReactive.loaderPromise=void 0;return}e.updateMatch(t,S=>K(T({},S),{status:S.status==="pending"?"success":S.status,isFetching:!1,context:qr(e,a)}));return}const _=p._nonReactive.minPendingPromise;_&&(yield _),zn(v)&&(yield(h=(u=s.options.notFoundComponent)==null?void 0:u.preload)==null?void 0:h.call(u)),Xi(e,e.router.getMatch(t),v);try{(g=(m=s.options).onError)==null||g.call(m,v)}catch(S){b=S,Xi(e,e.router.getMatch(t),S)}e.updateMatch(t,S=>K(T({},S),{error:b,context:qr(e,a),status:"error",isFetching:!1}))}}catch(p){const v=e.router.getMatch(t);v&&(v._nonReactive.loaderPromise=void 0),Xi(e,v,p)}}),Fj=(e,t)=>Ue(null,null,function*(){var g,p;function a(v,b,_,S){return Ue(this,null,function*(){var O,z,B,P;const w=Date.now()-b.updatedAt,C=v?(z=(O=S.options.preloadStaleTime)!=null?O:e.router.options.defaultPreloadStaleTime)!=null?z:3e4:(P=(B=S.options.staleTime)!=null?B:e.router.options.defaultStaleTime)!=null?P:0,R=S.options.shouldReload,j=typeof R=="function"?R(Ux(e,s,t,S)):R,{status:k,invalid:I}=_;c=k==="success"&&(I||(j!=null?j:w>C)),v&&S.options.preload===!1||(c&&!e.sync?(o=!0,Ue(null,null,function*(){var M,U;try{yield wb(e,s,t,S);const F=e.router.getMatch(s);(M=F._nonReactive.loaderPromise)==null||M.resolve(),(U=F._nonReactive.loadPromise)==null||U.resolve(),F._nonReactive.loaderPromise=void 0}catch(F){ta(F)&&(yield e.router.navigate(F.options))}})):(k!=="success"||c&&e.sync)&&(yield wb(e,s,t,S)))})}const{id:s,routeId:r}=e.matches[t];let c=!1,o=!1;const u=e.router.looseRoutesById[r];if(!zx(e,s)){const v=e.router.getMatch(s),b=Ju(e,s);if(v._nonReactive.loaderPromise){if(v.status==="success"&&!e.sync&&!v.preload)return v;yield v._nonReactive.loaderPromise;const _=e.router.getMatch(s),S=_._nonReactive.error||_.error;S&&Xi(e,_,S),_.status==="pending"&&(yield a(b,v,_,u))}else{const _=b&&!e.router.state.matches.some(w=>w.id===s),S=e.router.getMatch(s);S._nonReactive.loaderPromise=al(),_!==S.preload&&e.updateMatch(s,w=>K(T({},w),{preload:_})),yield a(b,v,S,u)}}const h=e.router.getMatch(s);o||((g=h._nonReactive.loaderPromise)==null||g.resolve(),(p=h._nonReactive.loadPromise)==null||p.resolve()),clearTimeout(h._nonReactive.pendingTimeout),h._nonReactive.pendingTimeout=void 0,o||(h._nonReactive.loaderPromise=void 0),h._nonReactive.dehydrated=void 0;const m=o?h.isFetching:!1;return m!==h.isFetching||h.invalid!==!1?(e.updateMatch(s,v=>K(T({},v),{isFetching:m,invalid:!1})),e.router.getMatch(s)):h});function Cb(e){return Ue(this,null,function*(){var a;const t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(s=>s._forcePending)&&Eu(t);try{for(let h=0;h<t.matches.length;h++){const m=Uj(t,h);$r(m)&&(yield m)}const s=(a=t.firstBadMatchIndex)!=null?a:t.matches.length;for(let h=0;h<s;h++)t.matchPromises.push(Fj(t,h));const c=(yield Promise.allSettled(t.matchPromises)).filter(h=>h.status==="rejected").map(h=>h.reason);let o;for(const h of c){if(ta(h))throw h;!o&&zn(h)&&(o=h)}for(const h of t.matches){const{id:m,routeId:g}=h,p=t.router.looseRoutesById[g];try{const v=Bj(t,m,p);if(v){const b=yield v;t.updateMatch(m,_=>T(T({},_),b))}}catch(v){console.error(`Error executing head for route ${g}:`,v)}}if(o)throw o;const u=Eu(t);$r(u)&&(yield u)}catch(s){if(zn(s)&&!t.preload){const r=Eu(t);throw $r(r)&&(yield r),s}if(ta(s))throw s}return t.matches})}function Bx(e){return Ue(this,null,function*(){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const r=t.options,{id:a}=r,s=de(r,["id"]);Object.assign(e.options,s),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{var s;const a=[];for(const r of Hx){const c=(s=e.options[r])==null?void 0:s.preload;c&&a.push(c())}if(a.length)return Promise.all(a).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise})}function Fx(e){var t;for(const a of Hx)if((t=e.options[a])!=null&&t.preload)return!0;return!1}const Hx=["component","errorComponent","pendingComponent","notFoundComponent"];function Hj(e){return{input:({url:t})=>{for(const a of e)t=Em(a,t);return t},output:({url:t})=>{for(let a=e.length-1;a>=0;a--)t=Px(e[a],t);return t}}}function Pj(e){const t=Dx(e.basepath),a=`/${t}`,s=`${a}/`,r=e.caseSensitive?a:a.toLowerCase(),c=e.caseSensitive?s:s.toLowerCase();return{input:({url:o})=>{const u=e.caseSensitive?o.pathname:o.pathname.toLowerCase();return u===r?o.pathname="/":u.startsWith(c)&&(o.pathname=o.pathname.slice(a.length)),o},output:({url:o})=>(o.pathname=ku(["/",t,o.pathname]),o)}}function Em(e,t){var s;const a=(s=e==null?void 0:e.input)==null?void 0:s.call(e,{url:t});if(a){if(typeof a=="string")return new URL(a);if(a instanceof URL)return a}return t}function Px(e,t){var s;const a=(s=e==null?void 0:e.output)==null?void 0:s.call(e,{url:t});if(a){if(typeof a=="string")return new URL(a);if(a instanceof URL)return a}return t}function Fs(e){const t=e.resolvedLocation,a=e.location,s=(t==null?void 0:t.pathname)!==a.pathname,r=(t==null?void 0:t.href)!==a.href,c=(t==null?void 0:t.hash)!==a.hash;return{fromLocation:t,toLocation:a,pathChanged:s,hrefChanged:r,hashChanged:c}}class $j{constructor(t){var a,s,r,c;this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=o=>o(),this.update=o=>{var w,C,R,j,k;o.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const u=this.options,h=(C=(w=this.basepath)!=null?w:u==null?void 0:u.basepath)!=null?C:"/",m=this.basepath===void 0,g=u==null?void 0:u.rewrite;if(this.options=T(T({},u),o),this.isServer=(R=this.options.isServer)!=null?R:typeof document=="undefined",this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=xj(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Rx()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let I;this.resolvePathCache=Iu(1e3),I=this.buildRouteTree(),this.setRoutes(I)}!this.__store&&this.latestLocation&&(this.__store=new WN(Vj(this.latestLocation),{onUpdate:()=>{this.__store.state=K(T({},this.state),{cachedMatches:this.state.cachedMatches.filter(I=>!["redirected"].includes(I.status))})}}),kj(this));let p=!1;const v=(j=this.options.basepath)!=null?j:"/",b=this.options.rewrite;if(m||h!==v||g!==b){this.basepath=v;const I=[],O=Dx(v);O&&O!=="/"&&I.push(Pj({basepath:v})),b&&I.push(b),this.rewrite=I.length===0?void 0:I.length===1?I[0]:Hj(I),this.history&&this.updateLatestLocation(),p=!0}p&&this.__store&&(this.__store.state=K(T({},this.state),{location:this.latestLocation})),typeof window!="undefined"&&"CSS"in window&&typeof((k=window.CSS)==null?void 0:k.supports)=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const o=mj(this.routeTree,this.options.caseSensitive,(u,h)=>{u.init({originalIndex:h})});return this.options.routeMasks&&cj(this.options.routeMasks,o.processedTree),o},this.subscribe=(o,u)=>{const h={eventType:o,fn:u};return this.subscribers.add(h),()=>{this.subscribers.delete(h)}},this.emit=o=>{this.subscribers.forEach(u=>{u.eventType===o.type&&u.fn(o)})},this.parseLocation=(o,u)=>{const h=({pathname:v,search:b,hash:_,href:S,state:w})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(v)){const O=this.options.parseSearch(b),z=this.options.stringifySearch(O);return{href:v+z+_,publicHref:S,pathname:co(v).path,external:!1,searchStr:z,search:On(u==null?void 0:u.search,O),hash:co(_.slice(1)).path,state:On(u==null?void 0:u.state,w)}}const C=new URL(S,this.origin),R=Em(this.rewrite,C),j=this.options.parseSearch(R.search),k=this.options.stringifySearch(j);return R.search=k,{href:R.href.replace(R.origin,""),publicHref:S,pathname:co(R.pathname).path,external:!!this.rewrite&&R.origin!==this.origin,searchStr:k,search:On(u==null?void 0:u.search,j),hash:co(R.hash.slice(1)).path,state:On(u==null?void 0:u.state,w)}},m=h(o),{__tempLocation:g,__tempKey:p}=m.state;if(g&&(!p||p===this.tempLocationKey)){const v=h(g);return v.state.key=m.state.key,v.state.__TSR_key=m.state.__TSR_key,delete v.state.__tempLocation,K(T({},v),{maskedLocation:m})}return m},this.resolvePathWithBase=(o,u)=>bj({base:o,to:gp(u),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(o,u,h)=>typeof o=="string"?this.matchRoutesInternal({pathname:o,search:u},h):this.matchRoutesInternal(o,u),this.getMatchedRoutes=o=>Yj({pathname:o,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=o=>{const u=this.getMatch(o);u&&(u.abortController.abort(),clearTimeout(u._nonReactive.pendingTimeout),u._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{var m;const o=this.state.matches.filter(g=>g.status==="pending"),u=this.state.matches.filter(g=>g.isFetching==="loader");new Set([...(m=this.state.pendingMatches)!=null?m:[],...o,...u]).forEach(g=>{this.cancelMatch(g.id)})},this.buildLocation=o=>{const u=(m={})=>{var X,Z,fe,D,he;const g=m._fromLocation||this.pendingBuiltLocation||this.latestLocation,p=this.matchRoutesLightweight(g);m.from;const v=m.unsafeRelative==="path"?g.pathname:(X=m.from)!=null?X:p.fullPath,b=this.resolvePathWithBase(v,"."),_=p.search,S=T({},p.params),w=m.to?this.resolvePathWithBase(b,`${m.to}`):this.resolvePathWithBase(b,"."),C=m.params===!1||m.params===null?{}:((Z=m.params)!=null?Z:!0)===!0?S:Object.assign(S,Ki(m.params,S)),R=$h({path:w,params:C,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,j=this.getMatchedRoutes(R);let k=j.matchedRoutes;(j.foundRoute?j.foundRoute.path!=="/"&&j.routeParams["**"]:ni(R))&&this.options.notFoundRoute&&(k=[...k,this.options.notFoundRoute]);let O=!1;if(Object.keys(C).length>0)for(const ge of k){const E=(D=(fe=ge.options.params)==null?void 0:fe.stringify)!=null?D:ge.options.stringifyParams;E&&(O=!0,Object.assign(C,E(C)))}const z=o.leaveParams?w:co(O?$h({path:w,params:C,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:R).path;let B=_;if(o._includeValidateSearch&&((he=this.options.search)!=null&&he.strict)){const ge={};k.forEach(E=>{if(E.options.validateSearch)try{Object.assign(ge,Ru(E.options.validateSearch,T(T({},ge),B)))}catch(W){}}),B=ge}B=Gj({search:B,dest:m,destRoutes:k,_includeValidateSearch:o._includeValidateSearch}),B=On(_,B);const P=this.options.stringifySearch(B),M=m.hash===!0?g.hash:m.hash?Ki(m.hash,g.hash):void 0,U=M?`#${M}`:"";let F=m.state===!0?g.state:m.state?Ki(m.state,g.state):{};F=On(g.state,F);const q=`${z}${P}${U}`;let H,Y,$=!1;if(this.rewrite){const ge=new URL(q,this.origin),E=Px(this.rewrite,ge);H=ge.href.replace(ge.origin,""),E.origin!==this.origin?(Y=E.href,$=!0):Y=E.pathname+E.search+E.hash}else H=rj(q),Y=H;return{publicHref:Y,href:H,pathname:z,search:B,searchStr:P,state:F,hash:M!=null?M:"",external:$,unmaskOnReload:m.unmaskOnReload}},h=(m={},g)=>{const p=u(m);let v=g?u(g):void 0;if(!v){const _={};if(this.options.routeMasks){const S=uj(p.pathname,this.processedTree);if(S){Object.assign(_,S.rawParams);const b=S.route,{from:w,params:C}=b,R=de(b,["from","params"]),j=C===!1||C===null?{}:(C!=null?C:!0)===!0?_:Object.assign(_,Ki(C,_));g=K(T({from:o.from},R),{params:j}),v=u(g)}}}return v&&(p.maskedLocation=v),p};return o.mask?h(o,T({from:o.from},o.mask)):h(o)},this.commitLocation=m=>Ue(this,null,function*(){var g=m,{viewTransition:o,ignoreBlocker:u}=g,h=de(g,["viewTransition","ignoreBlocker"]);var S,w,C,R;const p=()=>{const j=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];j.forEach(I=>{h.state[I]=this.latestLocation.state[I]});const k=Bs(h.state,this.latestLocation.state);return j.forEach(I=>{delete h.state[I]}),k},v=ni(this.latestLocation.href)===ni(h.href),b=this.commitLocationPromise;if(this.commitLocationPromise=al(()=>{b==null||b.resolve()}),v&&p())this.load();else{let _=h,{maskedLocation:j,hashScrollIntoView:k}=_,I=de(_,["maskedLocation","hashScrollIntoView"]);j&&(I=K(T({},j),{state:K(T({},j.state),{__tempKey:void 0,__tempLocation:K(T({},I),{search:I.searchStr,state:K(T({},I.state),{__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0})})})}),(w=(S=I.unmaskOnReload)!=null?S:this.options.unmaskOnReload)!=null&&w&&(I.state.__tempKey=this.tempLocationKey)),I.state.__hashScrollIntoViewOptions=(C=k!=null?k:this.options.defaultHashScrollIntoView)!=null?C:!0,this.shouldViewTransition=o,this.history[h.replace?"replace":"push"](I.publicHref,I.state,{ignoreBlocker:u})}return this.resetNextScroll=(R=h.resetScroll)!=null?R:!0,this.history.subscribers.size||this.load(),this.commitLocationPromise}),this.buildAndCommitLocation=(b={})=>{var _=b,{replace:o,resetScroll:u,hashScrollIntoView:h,viewTransition:m,ignoreBlocker:g,href:p}=_,v=de(_,["replace","resetScroll","hashScrollIntoView","viewTransition","ignoreBlocker","href"]);if(p){const C=this.history.location.state.__TSR_index,R=Mo(p,{__TSR_index:o?C:C+1}),j=new URL(R.pathname,this.origin),k=Em(this.rewrite,j);v.to=k.pathname,v.search=this.options.parseSearch(R.search),v.hash=R.hash.slice(1)}const S=this.buildLocation(K(T({},v),{_includeValidateSearch:!0}));this.pendingBuiltLocation=S;const w=this.commitLocation(K(T({},S),{viewTransition:m,replace:o,resetScroll:u,hashScrollIntoView:h,ignoreBlocker:g}));return Promise.resolve().then(()=>{this.pendingBuiltLocation===S&&(this.pendingBuiltLocation=void 0)}),w},this.navigate=p=>Ue(this,null,function*(){var v=p,{to:o,reloadDocument:u,href:h,publicHref:m}=v,g=de(v,["to","reloadDocument","href","publicHref"]);var _,S;let b=!1;if(h)try{new URL(`${h}`),b=!0}catch(w){}if(b&&!u&&(u=!0),u){if(o!==void 0||!h){const C=this.buildLocation(T({to:o},g));h=h!=null?h:C.publicHref,m=m!=null?m:C.publicHref}const w=!b&&m?m:h;if(zu(w))return Promise.resolve();if(!g.ignoreBlocker){const C=this.history,R=(S=(_=C.getBlockers)==null?void 0:_.call(C))!=null?S:[];for(const j of R)if(j!=null&&j.blockerFn&&(yield j.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"})))return Promise.resolve()}return g.replace?window.location.replace(w):window.location.href=w,Promise.resolve()}return this.buildAndCommitLocation(K(T({},g),{href:h,to:o,_isNavigate:!0}))}),this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const o=this.matchRoutes(this.latestLocation);this.__store.setState(u=>K(T({},u),{status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:o,cachedMatches:u.cachedMatches.filter(h=>!o.some(m=>m.id===h.id))}))},this.load=o=>Ue(this,null,function*(){let u,h,m;for(m=new Promise(p=>{this.startTransition(()=>Ue(this,null,function*(){var v;try{this.beforeLoad();const b=this.latestLocation,_=this.state.resolvedLocation;this.state.redirect||this.emit(T({type:"onBeforeNavigate"},Fs({resolvedLocation:_,location:b}))),this.emit(T({type:"onBeforeLoad"},Fs({resolvedLocation:_,location:b}))),yield Cb({router:this,sync:o==null?void 0:o.sync,matches:this.state.pendingMatches,location:b,updateMatch:this.updateMatch,onReady:()=>Ue(this,null,function*(){this.startTransition(()=>{this.startViewTransition(()=>Ue(this,null,function*(){let S=[],w=[],C=[];jo(()=>{this.__store.setState(R=>{const j=R.matches,k=R.pendingMatches||R.matches;return S=j.filter(I=>!k.some(O=>O.id===I.id)),w=k.filter(I=>!j.some(O=>O.id===I.id)),C=k.filter(I=>j.some(O=>O.id===I.id)),K(T({},R),{isLoading:!1,loadedAt:Date.now(),matches:k,pendingMatches:void 0,cachedMatches:[...R.cachedMatches,...S.filter(I=>I.status!=="error"&&I.status!=="notFound")]})}),this.clearExpiredCache()}),[[S,"onLeave"],[w,"onEnter"],[C,"onStay"]].forEach(([R,j])=>{R.forEach(k=>{var I,O;(O=(I=this.looseRoutesById[k.routeId].options)[j])==null||O.call(I,k)})})}))})})})}catch(b){ta(b)?(u=b,this.navigate(K(T({},u.options),{replace:!0,ignoreBlocker:!0}))):zn(b)&&(h=b),this.__store.setState(_=>K(T({},_),{statusCode:u?u.status:h?404:_.matches.some(S=>S.status==="error")?500:200,redirect:u}))}this.latestLoadPromise===m&&((v=this.commitLocationPromise)==null||v.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),p()}))}),this.latestLoadPromise=m,yield m;this.latestLoadPromise&&m!==this.latestLoadPromise;)yield this.latestLoadPromise;let g;this.hasNotFoundMatch()?g=404:this.__store.state.matches.some(p=>p.status==="error")&&(g=500),g!==void 0&&this.__store.setState(p=>K(T({},p),{statusCode:g}))}),this.startViewTransition=o=>{var h;const u=(h=this.shouldViewTransition)!=null?h:this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,u&&typeof document!="undefined"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let m;if(typeof u=="object"&&this.isViewTransitionTypesSupported){const g=this.latestLocation,p=this.state.resolvedLocation,v=typeof u.types=="function"?u.types(Fs({resolvedLocation:p,location:g})):u.types;if(v===!1){o();return}m={update:o,types:v}}else m=o;document.startViewTransition(m)}else o()},this.updateMatch=(o,u)=>{this.startTransition(()=>{var m;const h=(m=this.state.pendingMatches)!=null&&m.some(g=>g.id===o)?"pendingMatches":this.state.matches.some(g=>g.id===o)?"matches":this.state.cachedMatches.some(g=>g.id===o)?"cachedMatches":"";h&&this.__store.setState(g=>{var p;return K(T({},g),{[h]:(p=g[h])==null?void 0:p.map(v=>v.id===o?u(v):v)})})})},this.getMatch=o=>{var h,m,g;const u=p=>p.id===o;return(g=(m=this.state.cachedMatches.find(u))!=null?m:(h=this.state.pendingMatches)==null?void 0:h.find(u))!=null?g:this.state.matches.find(u)},this.invalidate=o=>{const u=h=>{var m,g;return(g=(m=o==null?void 0:o.filter)==null?void 0:m.call(o,h))==null||g?T(K(T({},h),{invalid:!0}),o!=null&&o.forcePending||h.status==="error"||h.status==="notFound"?{status:"pending",error:void 0}:void 0):h};return this.__store.setState(h=>{var m;return K(T({},h),{matches:h.matches.map(u),cachedMatches:h.cachedMatches.map(u),pendingMatches:(m=h.pendingMatches)==null?void 0:m.map(u)})}),this.shouldViewTransition=!1,this.load({sync:o==null?void 0:o.sync})},this.getParsedLocationHref=o=>o.publicHref||"/",this.resolveRedirect=o=>{var h;const u=o.headers.get("Location");if(!o.options.href||o.options._builtLocation){const m=(h=o.options._builtLocation)!=null?h:this.buildLocation(o.options),g=this.getParsedLocationHref(m);o.options.href=g,o.headers.set("Location",g)}else if(u)try{const m=new URL(u);if(this.origin&&m.origin===this.origin){const g=m.pathname+m.search+m.hash;o.options.href=g,o.headers.set("Location",g)}}catch(m){}return o.headers.get("Location")||o.headers.set("Location",o.options.href),o},this.clearCache=o=>{const u=o==null?void 0:o.filter;u!==void 0?this.__store.setState(h=>K(T({},h),{cachedMatches:h.cachedMatches.filter(m=>!u(m))})):this.__store.setState(h=>K(T({},h),{cachedMatches:[]}))},this.clearExpiredCache=()=>{const o=u=>{var v,b,_;const h=this.looseRoutesById[u.routeId];if(!h.options.loader)return!0;const m=(_=u.preload?(v=h.options.preloadGcTime)!=null?v:this.options.defaultPreloadGcTime:(b=h.options.gcTime)!=null?b:this.options.defaultGcTime)!=null?_:300*1e3;return u.status==="error"?!0:Date.now()-u.updatedAt>=m};this.clearCache({filter:o})},this.loadRouteChunk=Bx,this.preloadRoute=o=>Ue(this,null,function*(){var p;const u=this.buildLocation(o);let h=this.matchRoutes(u,{throwOnError:!0,preload:!0,dest:o});const m=new Set([...this.state.matches,...(p=this.state.pendingMatches)!=null?p:[]].map(v=>v.id)),g=new Set([...m,...this.state.cachedMatches.map(v=>v.id)]);jo(()=>{h.forEach(v=>{g.has(v.id)||this.__store.setState(b=>K(T({},b),{cachedMatches:[...b.cachedMatches,v]}))})});try{return h=yield Cb({router:this,matches:h,location:u,preload:!0,updateMatch:(v,b)=>{m.has(v)?h=h.map(_=>_.id===v?b(_):_):this.updateMatch(v,b)}}),h}catch(v){if(ta(v))return v.options.reloadDocument?void 0:yield this.preloadRoute(K(T({},v.options),{_fromLocation:u}));zn(v)||console.error(v);return}}),this.matchRoute=(o,u)=>{var b,_,S;const h=K(T({},o),{to:o.to?this.resolvePathWithBase(o.from||"",o.to):void 0,params:o.params||{},leaveParams:!0}),m=this.buildLocation(h);if(u!=null&&u.pending&&this.state.status!=="pending")return!1;const p=((u==null?void 0:u.pending)===void 0?!this.state.isLoading:u.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,v=dj(m.pathname,(b=u==null?void 0:u.caseSensitive)!=null?b:!1,(_=u==null?void 0:u.fuzzy)!=null?_:!1,p.pathname,this.processedTree);return!v||o.params&&!Bs(v.rawParams,o.params,{partial:!0})?!1:(S=u==null?void 0:u.includeSearch)==null||S?Bs(p.search,m.search,{partial:!0})?v.rawParams:!1:v.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(o=>o.status==="notFound"||o.globalNotFound),this.update(K(T({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0},t),{caseSensitive:(a=t.caseSensitive)!=null?a:!1,notFoundMode:(s=t.notFoundMode)!=null?s:"fuzzy",stringifySearch:(r=t.stringifySearch)!=null?r:Aj,parseSearch:(c=t.parseSearch)!=null?c:Mj})),typeof document!="undefined"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:a,processedTree:s}){this.routesById=t,this.routesByPath=a,this.processedTree=s;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(t){var r,c,o;return(t==null?void 0:t.id)?(o=(c=t.context)!=null?c:this.options.context)!=null?o:void 0:(r=this.options.context)!=null?r:void 0}matchRoutesInternal(t,a){var v,b,_,S,w,C,R,j,k,I;const s=this.getMatchedRoutes(t.pathname),{foundRoute:r,routeParams:c,parsedParams:o}=s;let{matchedRoutes:u}=s,h=!1;(r?r.path!=="/"&&c["**"]:ni(t.pathname))&&(this.options.notFoundRoute?u=[...u,this.options.notFoundRoute]:h=!0);const m=h?Xj(this.options.notFoundMode,u):void 0,g=new Array(u.length),p=new Map(this.state.matches.map(O=>[O.routeId,O]));for(let O=0;O<u.length;O++){const z=u[O],B=g[O-1];let P,M,U;{const W=(v=B==null?void 0:B.search)!=null?v:t.search,oe=(b=B==null?void 0:B._strictSearch)!=null?b:void 0;try{const me=(_=Ru(z.options.validateSearch,T({},W)))!=null?_:void 0;P=T(T({},W),me),M=T(T({},oe),me),U=void 0}catch(me){let _e=me;if(me instanceof Fu||(_e=new Fu(me.message,{cause:me})),a!=null&&a.throwOnError)throw _e;P=W,M={},U=_e}}const F=(C=(w=(S=z.options).loaderDeps)==null?void 0:w.call(S,{search:P}))!=null?C:"",q=F?JSON.stringify(F):"",{interpolatedPath:H,usedParams:Y}=$h({path:z.fullPath,params:c,decoder:this.pathParamsDecoder,server:this.isServer}),$=z.id+H+q,X=this.getMatch($),Z=p.get(z.id),fe=(R=X==null?void 0:X._strictParams)!=null?R:Y;let D;if(!X)try{Nb(z,Y,o,fe)}catch(W){if(zn(W)||ta(W)?D=W:D=new qj(W.message,{cause:W}),a!=null&&a.throwOnError)throw D}Object.assign(c,fe);const he=Z?"stay":"enter";let ge;if(X)ge=K(T({},X),{cause:he,params:(j=Z==null?void 0:Z.params)!=null?j:c,_strictParams:fe,search:On(Z?Z.search:X.search,P),_strictSearch:M});else{const W=z.options.loader||z.options.beforeLoad||z.lazyFn||Fx(z)?"pending":"success";ge={id:$,ssr:z.options.ssr,index:O,routeId:z.id,params:(k=Z==null?void 0:Z.params)!=null?k:c,_strictParams:fe,pathname:H,updatedAt:Date.now(),search:Z?On(Z.search,P):P,_strictSearch:M,searchError:void 0,status:W,isFetching:!1,error:void 0,paramsError:D,__routeContext:void 0,_nonReactive:{loadPromise:al()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:he,loaderDeps:Z?On(Z.loaderDeps,F):F,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:z.options.staticData||{},fullPath:z.fullPath}}a!=null&&a.preload||(ge.globalNotFound=m===z.id),ge.searchError=U;const E=this.getParentContext(B);ge.context=T(T(T({},E),ge.__routeContext),ge.__beforeLoadContext),g[O]=ge}for(let O=0;O<g.length;O++){const z=g[O],B=this.looseRoutesById[z.routeId],P=this.getMatch(z.id),M=p.get(z.routeId);if(z.params=M?On(M.params,c):c,!P){const U=g[O-1],F=this.getParentContext(U);if(B.options.context){const q={deps:z.loaderDeps,params:z.params,context:F!=null?F:{},location:t,navigate:H=>this.navigate(K(T({},H),{_fromLocation:t})),buildLocation:this.buildLocation,cause:z.cause,abortController:z.abortController,preload:!!z.preload,matches:g,routeId:B.id};z.__routeContext=(I=B.options.context(q))!=null?I:void 0}z.context=T(T(T({},F),z.__routeContext),z.__beforeLoadContext)}}return g}matchRoutesLightweight(t){const{matchedRoutes:a,routeParams:s,parsedParams:r}=this.getMatchedRoutes(t.pathname),c=Ao(a),o=T({},t.search);for(const g of a)try{Object.assign(o,Ru(g.options.validateSearch,o))}catch(p){}const u=Ao(this.state.matches),h=u&&u.routeId===c.id&&t.pathname===this.state.location.pathname;let m;if(h)m=u.params;else{const g=T({},s);for(const p of a)try{Nb(p,s,r!=null?r:{},g)}catch(v){}m=g}return{matchedRoutes:a,fullPath:c.fullPath,search:o,params:m}}}class Fu extends Error{}class qj extends Error{}function Vj(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Ru(e,t){if(e==null)return{};if("~standard"in e){const a=e["~standard"].validate(t);if(a instanceof Promise)throw new Fu("Async validation not supported");if(a.issues)throw new Fu(JSON.stringify(a.issues,void 0,2),{cause:a});return a.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function Yj({pathname:e,routesById:t,processedTree:a}){const s={},r=ni(e);let c,o;const u=fj(r,a,!0);return u&&(c=u.route,Object.assign(s,u.rawParams),o=Object.assign({},u.parsedParams)),{matchedRoutes:(u==null?void 0:u.branch)||[t[Jn]],routeParams:s,foundRoute:c,parsedParams:o}}function Gj({search:e,dest:t,destRoutes:a,_includeValidateSearch:s}){return Kj(a)(e,t,s!=null?s:!1)}function Kj(e){var r;const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const c of e){if("search"in c.options)(r=c.options.search)!=null&&r.middlewares&&t.middlewares.push(...c.options.search.middlewares);else if(c.options.preSearchFilters||c.options.postSearchFilters){const o=({search:u,next:h})=>{let m=u;"preSearchFilters"in c.options&&c.options.preSearchFilters&&(m=c.options.preSearchFilters.reduce((p,v)=>v(p),u));const g=h(m);return"postSearchFilters"in c.options&&c.options.postSearchFilters?c.options.postSearchFilters.reduce((p,v)=>v(p),g):g};t.middlewares.push(o)}if(c.options.validateSearch){const o=({search:u,next:h})=>{var g;const m=h(u);if(!t._includeValidateSearch)return m;try{return T(T({},m),(g=Ru(c.options.validateSearch,m))!=null?g:void 0)}catch(p){return m}};t.middlewares.push(o)}}const a=({search:c})=>{const o=t.dest;return o.search?o.search===!0?c:Ki(o.search,c):{}};t.middlewares.push(a);const s=(c,o,u)=>{if(c>=u.length)return o;const h=u[c];return h({search:o,next:g=>s(c+1,g,u)})};return function(o,u,h){return t.dest=u,t._includeValidateSearch=h,s(0,o,t.middlewares)}}function Xj(e,t){if(e!=="root")for(let a=t.length-1;a>=0;a--){const s=t[a];if(s.children)return s.id}return Jn}function Nb(e,t,a,s){var c,o;const r=(o=(c=e.options.params)==null?void 0:c.parse)!=null?o:e.options.parseParams;if(r)if(e.options.skipRouteOnParseError)for(const u in t)u in a&&(s[u]=a[u]);else{const u=r(s);Object.assign(s,u)}}const Qj="Error preloading route! ☝️";class $x{constructor(t){if(this.init=a=>{var m,g;this.originalIndex=a.originalIndex;const s=this.options,r=!(s!=null&&s.path)&&!(s!=null&&s.id);this.parentRoute=(g=(m=this.options).getParentRoute)==null?void 0:g.call(m),r?this._path=Jn:this.parentRoute||ii(!1);let c=r?Jn:s==null?void 0:s.path;c&&c!=="/"&&(c=Lx(c));const o=(s==null?void 0:s.id)||c;let u=r?Jn:ku([this.parentRoute.id===Jn?"":this.parentRoute.id,o]);c===Jn&&(c="/"),u!==Jn&&(u=ku(["/",u]));const h=u===Jn?"/":ku([this.parentRoute.fullPath,c]);this._path=c,this._id=u,this._fullPath=h,this._to=ni(h)},this.addChildren=a=>this._addFileChildren(a),this._addFileChildren=a=>(Array.isArray(a)&&(this.children=a),typeof a=="object"&&a!==null&&(this.children=Object.values(a)),this),this._addFileTypes=()=>this,this.updateLoader=a=>(Object.assign(this.options,a),this),this.update=a=>(Object.assign(this.options,a),this),this.lazy=a=>(this.lazyFn=a,this),this.redirect=a=>Oj(T({from:this.fullPath},a)),this.options=t||{},this.isRoot=!(t!=null&&t.getParentRoute),t!=null&&t.id&&(t!=null&&t.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class Zj extends $x{constructor(t){super(t)}}const hu=typeof window!="undefined"?A.useLayoutEffect:A.useEffect;function Vh(e){const t=A.useRef({value:e,prev:null}),a=t.current.value;return e!==a&&(t.current={value:e,prev:a}),t.current.prev}function Jj(e,t,a={},s={}){A.useEffect(()=>{if(!e.current||s.disabled||typeof IntersectionObserver!="function")return;const r=new IntersectionObserver(([c])=>{t(c)},a);return r.observe(e.current),()=>{r.disconnect()}},[t,a,s.disabled,e])}function Wj(e){const t=A.useRef(null);return A.useImperativeHandle(e,()=>t.current,[]),t}function yp(e){var a;const t=(a=e.errorComponent)!=null?a:vp;return f.jsx(ek,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:s,reset:r})=>s?A.createElement(t,{error:s,reset:r}):e.children})}class ek extends A.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,a){a.error&&a.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,a){this.props.onCatch&&this.props.onCatch(t,a)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function vp({error:e}){const[t,a]=A.useState(!1);return f.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),f.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>a(s=>!s),children:t?"Hide Error":"Show Error"})]}),f.jsx("div",{style:{height:".25rem"}}),t?f.jsx("div",{children:f.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?f.jsx("code",{children:e.message}):null})}):null]})}function tk({children:e,fallback:t=null}){return qx()?f.jsx(ie.Fragment,{children:e}):f.jsx(ie.Fragment,{children:t})}function qx(){return ie.useSyncExternalStore(nk,()=>!0,()=>!1)}function nk(){return()=>{}}var Yh={exports:{}},Gh={},Kh={exports:{}},Xh={};/**
34
+ * @license React
35
+ * use-sync-external-store-shim.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var jb;function ak(){if(jb)return Xh;jb=1;var e=fp();function t(p,v){return p===v&&(p!==0||1/p===1/v)||p!==p&&v!==v}var a=typeof Object.is=="function"?Object.is:t,s=e.useState,r=e.useEffect,c=e.useLayoutEffect,o=e.useDebugValue;function u(p,v){var b=v(),_=s({inst:{value:b,getSnapshot:v}}),S=_[0].inst,w=_[1];return c(function(){S.value=b,S.getSnapshot=v,h(S)&&w({inst:S})},[p,b,v]),r(function(){return h(S)&&w({inst:S}),p(function(){h(S)&&w({inst:S})})},[p]),o(b),b}function h(p){var v=p.getSnapshot;p=p.value;try{var b=v();return!a(p,b)}catch(_){return!0}}function m(p,v){return v()}var g=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?m:u;return Xh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,Xh}var kb;function ik(){return kb||(kb=1,Kh.exports=ak()),Kh.exports}/**
42
+ * @license React
43
+ * use-sync-external-store-shim/with-selector.production.js
44
+ *
45
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
46
+ *
47
+ * This source code is licensed under the MIT license found in the
48
+ * LICENSE file in the root directory of this source tree.
49
+ */var Eb;function sk(){if(Eb)return Gh;Eb=1;var e=fp(),t=ik();function a(m,g){return m===g&&(m!==0||1/m===1/g)||m!==m&&g!==g}var s=typeof Object.is=="function"?Object.is:a,r=t.useSyncExternalStore,c=e.useRef,o=e.useEffect,u=e.useMemo,h=e.useDebugValue;return Gh.useSyncExternalStoreWithSelector=function(m,g,p,v,b){var _=c(null);if(_.current===null){var S={hasValue:!1,value:null};_.current=S}else S=_.current;_=u(function(){function C(O){if(!R){if(R=!0,j=O,O=v(O),b!==void 0&&S.hasValue){var z=S.value;if(b(z,O))return k=z}return k=O}if(z=k,s(j,O))return z;var B=v(O);return b!==void 0&&b(z,B)?(j=O,z):(j=O,k=B)}var R=!1,j,k,I=p===void 0?null:p;return[function(){return C(g())},I===null?void 0:function(){return C(I())}]},[g,p,v,b]);var w=r(m,_[0],_[1]);return o(function(){S.hasValue=!0,S.value=w},[w]),h(w),w},Gh}var Rb;function rk(){return Rb||(Rb=1,Yh.exports=sk()),Yh.exports}var lk=rk();function ok(e,t=s=>s,a={}){var c;const s=(c=a.equal)!=null?c:ck;return lk.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,s)}function ck(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,r]of e)if(!t.has(s)||!Object.is(r,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const a=Tb(e);if(a.length!==Tb(t).length)return!1;for(let s=0;s<a.length;s++)if(!Object.prototype.hasOwnProperty.call(t,a[s])||!Object.is(e[a[s]],t[a[s]]))return!1;return!0}function Tb(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const Qh=A.createContext(null);function Vx(){return typeof document=="undefined"?Qh:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=Qh,Qh)}function aa(e){var a;const t=A.useContext(Vx());return(a=e==null?void 0:e.warn)==null,t}function na(e){const t=aa({warn:(e==null?void 0:e.router)===void 0}),a=(e==null?void 0:e.router)||t,s=A.useRef(void 0);return ok(a.__store,r=>{var c;if(e!=null&&e.select){if((c=e.structuralSharing)!=null?c:a.options.defaultStructuralSharing){const o=On(s.current,e.select(r));return s.current=o,o}return e.select(r)}return r})}const Wu=A.createContext(void 0),uk=A.createContext(void 0);function Ea(e){const t=A.useContext(e.from?uk:Wu);return na({select:s=>{var c;const r=s.matches.find(o=>e.from?e.from===o.routeId:o.id===t);if(ii(!(((c=e.shouldThrow)==null||c)&&!r),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),r!==void 0)return e.select?e.select(r):r},structuralSharing:e.structuralSharing})}function bp(e){return Ea({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function xp(e){const s=e,{select:t}=s,a=de(s,["select"]);return Ea(K(T({},a),{select:r=>t?t(r.loaderDeps):r.loaderDeps}))}function ed(e){return Ea({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const a=e.strict===!1?t.params:t._strictParams;return e.select?e.select(a):a}})}function td(e){return Ea({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function _p(e){const t=aa();return A.useCallback(a=>{var s;return t.navigate(K(T({},a),{from:(s=a.from)!=null?s:e==null?void 0:e.from}))},[e==null?void 0:e.from,t])}var dk=jx();function fk(e,t){var ve,Ee,We;const a=aa(),s=Wj(t),re=e,{activeProps:r,inactiveProps:c,activeOptions:o,to:u,preload:h,preloadDelay:m,hashScrollIntoView:g,replace:p,startTransition:v,resetScroll:b,viewTransition:_,children:S,target:w,disabled:C,style:R,className:j,onClick:k,onFocus:I,onMouseEnter:O,onMouseLeave:z,onTouchStart:B,ignoreBlocker:P,params:M,search:U,hash:F,state:q,mask:H,reloadDocument:Y,unsafeRelative:$,from:X,_fromLocation:Z}=re,fe=de(re,["activeProps","inactiveProps","activeOptions","to","preload","preloadDelay","hashScrollIntoView","replace","startTransition","resetScroll","viewTransition","children","target","disabled","style","className","onClick","onFocus","onMouseEnter","onMouseLeave","onTouchStart","ignoreBlocker","params","search","hash","state","mask","reloadDocument","unsafeRelative","from","_fromLocation"]),D=qx(),he=na({select:Re=>Re.location.search,structuralSharing:!0}),ge=e.from,E=A.useMemo(()=>K(T({},e),{from:ge}),[a,he,ge,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),W=A.useMemo(()=>a.buildLocation(T({},E)),[a,E]),oe=W.maskedLocation?W.maskedLocation.publicHref:W.publicHref,me=W.maskedLocation?W.maskedLocation.external:W.external,_e=A.useMemo(()=>vk(oe,me,a.history,C),[C,me,oe,a.history]),be=A.useMemo(()=>{if(_e!=null&&_e.external)return zu(_e.href)?void 0:_e.href;if(!bk(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),zu(u)?void 0:u}catch(xt){}},[u,_e]),Ae=na({select:Re=>{var xt;if(be)return!1;if(o!=null&&o.exact){if(!vj(Re.location.pathname,W.pathname,a.basepath))return!1}else{const Ct=Uu(Re.location.pathname,a.basepath),Tt=Uu(W.pathname,a.basepath);if(!(Ct.startsWith(Tt)&&(Ct.length===Tt.length||Ct[Tt.length]==="/")))return!1}return((xt=o==null?void 0:o.includeSearch)==null||xt)&&!Bs(Re.location.search,W.search,{partial:!(o!=null&&o.exact),ignoreUndefined:!(o!=null&&o.explicitUndefined)})?!1:o!=null&&o.includeHash?D&&Re.location.hash===W.hash:!0}}),Ge=Ae?(ve=Ki(r,{}))!=null?ve:hk:Zh,ot=Ae?Zh:(Ee=Ki(c,{}))!=null?Ee:Zh,qt=[j,Ge.className,ot.className].filter(Boolean).join(" "),at=(R||Ge.style||ot.style)&&T(T(T({},R),Ge.style),ot.style),[Ie,qe]=A.useState(!1),bt=A.useRef(!1),ke=e.reloadDocument||be?!1:h!=null?h:a.options.defaultPreload,ct=(We=m!=null?m:a.options.defaultPreloadDelay)!=null?We:0,Fe=A.useCallback(()=>{a.preloadRoute(T({},E)).catch(Re=>{console.warn(Re),console.warn(Qj)})},[a,E]),ma=A.useCallback(Re=>{Re!=null&&Re.isIntersecting&&Fe()},[Fe]);Jj(s,ma,yk,{disabled:!!C||ke!=="viewport"}),A.useEffect(()=>{bt.current||!C&&ke==="render"&&(Fe(),bt.current=!0)},[C,Fe,ke]);const pa=Re=>{const xt=Re.currentTarget.getAttribute("target"),Ct=w!==void 0?w:xt;if(!C&&!xk(Re)&&!Re.defaultPrevented&&(!Ct||Ct==="_self")&&Re.button===0){Re.preventDefault(),dk.flushSync(()=>{qe(!0)});const Tt=a.subscribe("onResolved",()=>{Tt(),qe(!1)});a.navigate(K(T({},E),{replace:p,resetScroll:b,hashScrollIntoView:g,startTransition:v,viewTransition:_,ignoreBlocker:P}))}};if(be)return T(T(T(T(T(T(T(T(T(T(K(T({},fe),{ref:s,href:be}),S&&{children:S}),w&&{target:w}),C&&{disabled:C}),R&&{style:R}),j&&{className:j}),k&&{onClick:k}),I&&{onFocus:I}),O&&{onMouseEnter:O}),z&&{onMouseLeave:z}),B&&{onTouchStart:B});const Ta=Re=>{C||ke&&Fe()},ri=Ta,At=Re=>{if(!(C||!ke))if(!ct)Fe();else{const xt=Re.target;if(ho.has(xt))return;const Ct=setTimeout(()=>{ho.delete(xt),Fe()},ct);ho.set(xt,Ct)}},as=Re=>{if(C||!ke||!ct)return;const xt=Re.target,Ct=ho.get(xt);Ct&&(clearTimeout(Ct),ho.delete(xt))};return T(T(T(T(T(K(T(T(T({},fe),Ge),ot),{href:_e==null?void 0:_e.href,ref:s,onClick:mo([k,pa]),onFocus:mo([I,Ta]),onMouseEnter:mo([O,At]),onMouseLeave:mo([z,as]),onTouchStart:mo([B,ri]),disabled:!!C,target:w}),at&&{style:at}),qt&&{className:qt}),C&&mk),Ae&&pk),D&&Ie&&gk)}const Zh={},hk={className:"active"},mk={role:"link","aria-disabled":!0},pk={"data-status":"active","aria-current":"page"},gk={"data-transitioning":"transitioning"},ho=new WeakMap,yk={rootMargin:"100px"},mo=e=>t=>{for(const a of e)if(a){if(t.defaultPrevented)return;a(t)}};function vk(e,t,a,s){if(!s)return t?{href:e,external:!0}:{href:a.createHref(e)||"/",external:!1}}function bk(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const Yx=A.forwardRef((e,t)=>{const u=e,{_asChild:a}=u,s=de(u,["_asChild"]),h=fk(s,t),{type:r}=h,c=de(h,["type"]),o=typeof s.children=="function"?s.children({isActive:c["data-status"]==="active"}):s.children;if(!a){const m=c,{disabled:g}=m,p=de(m,["disabled"]);return A.createElement("a",p,o)}return A.createElement(a,c,o)});function xk(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class _k extends $x{constructor(t){super(t),this.useMatch=a=>Ea({select:a==null?void 0:a.select,from:this.id,structuralSharing:a==null?void 0:a.structuralSharing}),this.useRouteContext=a=>Ea(K(T({},a),{from:this.id,select:s=>a!=null&&a.select?a.select(s.context):s.context})),this.useSearch=a=>td({select:a==null?void 0:a.select,structuralSharing:a==null?void 0:a.structuralSharing,from:this.id}),this.useParams=a=>ed({select:a==null?void 0:a.select,structuralSharing:a==null?void 0:a.structuralSharing,from:this.id}),this.useLoaderDeps=a=>xp(K(T({},a),{from:this.id})),this.useLoaderData=a=>bp(K(T({},a),{from:this.id})),this.useNavigate=()=>_p({from:this.fullPath}),this.Link=ie.forwardRef((a,s)=>f.jsx(Yx,T({ref:s,from:this.fullPath},a))),this.$$typeof=Symbol.for("react.memo")}}function Sp(e){return new _k(e)}class Sk extends Zj{constructor(t){super(t),this.useMatch=a=>Ea({select:a==null?void 0:a.select,from:this.id,structuralSharing:a==null?void 0:a.structuralSharing}),this.useRouteContext=a=>Ea(K(T({},a),{from:this.id,select:s=>a!=null&&a.select?a.select(s.context):s.context})),this.useSearch=a=>td({select:a==null?void 0:a.select,structuralSharing:a==null?void 0:a.structuralSharing,from:this.id}),this.useParams=a=>ed({select:a==null?void 0:a.select,structuralSharing:a==null?void 0:a.structuralSharing,from:this.id}),this.useLoaderDeps=a=>xp(K(T({},a),{from:this.id})),this.useLoaderData=a=>bp(K(T({},a),{from:this.id})),this.useNavigate=()=>_p({from:this.fullPath}),this.Link=ie.forwardRef((a,s)=>f.jsx(Yx,T({ref:s,from:this.fullPath},a))),this.$$typeof=Symbol.for("react.memo")}}function wk(e){return new Sk(e)}function Mb(e){return typeof e=="object"?new Ab(e,{silent:!0}).createRoute(e):new Ab(e,{silent:!0}).createRoute}class Ab{constructor(t,a){this.path=t,this.createRoute=s=>{this.silent;const r=Sp(s);return r.isRoot=!1,r},this.silent=a==null?void 0:a.silent}}class Lb{constructor(t){this.useMatch=a=>Ea({select:a==null?void 0:a.select,from:this.options.id,structuralSharing:a==null?void 0:a.structuralSharing}),this.useRouteContext=a=>Ea({from:this.options.id,select:s=>a!=null&&a.select?a.select(s.context):s.context}),this.useSearch=a=>td({select:a==null?void 0:a.select,structuralSharing:a==null?void 0:a.structuralSharing,from:this.options.id}),this.useParams=a=>ed({select:a==null?void 0:a.select,structuralSharing:a==null?void 0:a.structuralSharing,from:this.options.id}),this.useLoaderDeps=a=>xp(K(T({},a),{from:this.options.id})),this.useLoaderData=a=>bp(K(T({},a),{from:this.options.id})),this.useNavigate=()=>{const a=aa();return _p({from:a.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function Db(e){return typeof e=="object"?new Lb(e):t=>new Lb(T({id:e},t))}function Ck(){const e=aa(),t=A.useRef({router:e,mounted:!1}),[a,s]=A.useState(!1),{hasPendingMatches:r,isLoading:c}=na({select:p=>({isLoading:p.isLoading,hasPendingMatches:p.matches.some(v=>v.status==="pending")}),structuralSharing:!0}),o=Vh(c),u=c||a||r,h=Vh(u),m=c||r,g=Vh(m);return e.startTransition=p=>{s(!0),A.startTransition(()=>{p(),s(!1)})},A.useEffect(()=>{const p=e.history.subscribe(e.load),v=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return ni(e.latestLocation.publicHref)!==ni(v.publicHref)&&e.commitLocation(K(T({},v),{replace:!0})),()=>{p()}},[e,e.history]),hu(()=>{if(typeof window!="undefined"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},Ue(null,null,function*(){try{yield e.load()}catch(v){console.error(v)}})},[e]),hu(()=>{o&&!c&&e.emit(T({type:"onLoad"},Fs(e.state)))},[o,e,c]),hu(()=>{g&&!m&&e.emit(T({type:"onBeforeRouteMount"},Fs(e.state)))},[m,g,e]),hu(()=>{if(h&&!u){const p=Fs(e.state);e.emit(T({type:"onResolved"},p)),e.__store.setState(v=>K(T({},v),{status:"idle",resolvedLocation:v.location})),p.hrefChanged&&Ej(e)}},[u,h,e]),null}function Nk(e){const t=na({select:a=>`not-found-${a.location.pathname}-${a.status}`});return f.jsx(yp,{getResetKey:()=>t,onCatch:(a,s)=>{var r;if(zn(a))(r=e.onCatch)==null||r.call(e,a,s);else throw a},errorComponent:({error:a})=>{var s;if(zn(a))return(s=e.fallback)==null?void 0:s.call(e,a);throw a},children:e.children})}function jk(){return f.jsx("p",{children:"Not Found"})}function Hr(e){return f.jsx(f.Fragment,{children:e.children})}function Gx(e,t,a){return t.options.notFoundComponent?f.jsx(t.options.notFoundComponent,T({},a)):e.options.defaultNotFoundComponent?f.jsx(e.options.defaultNotFoundComponent,T({},a)):f.jsx(jk,{})}function kk(){return aa().isScrollRestoring,null}const Kx=A.memo(function({matchId:t}){var S,w,C,R,j,k,I,O,z;const a=aa(),s=na({select:B=>{var U;const P=B.matches.findIndex(F=>F.id===t),M=B.matches[P];return ii(M),{routeId:M.routeId,ssr:M.ssr,_displayPending:M._displayPending,resetKey:B.loadedAt,parentRouteId:(U=B.matches[P-1])==null?void 0:U.routeId}},structuralSharing:!0}),r=a.routesById[s.routeId],c=(S=r.options.pendingComponent)!=null?S:a.options.defaultPendingComponent,o=c?f.jsx(c,{}):null,u=(w=r.options.errorComponent)!=null?w:a.options.defaultErrorComponent,h=(C=r.options.onCatch)!=null?C:a.options.defaultOnCatch,m=r.isRoot?(j=r.options.notFoundComponent)!=null?j:(R=a.options.notFoundRoute)==null?void 0:R.options.component:r.options.notFoundComponent,g=s.ssr===!1||s.ssr==="data-only",p=(!r.isRoot||r.options.wrapInSuspense||g)&&((O=(k=r.options.wrapInSuspense)!=null?k:c)!=null?O:(I=r.options.errorComponent)!=null&&I.preload||g)?A.Suspense:Hr,v=u?yp:Hr,b=m?Nk:Hr,_=r.isRoot&&(z=r.options.shellComponent)!=null?z:Hr;return f.jsxs(_,{children:[f.jsx(Wu.Provider,{value:t,children:f.jsx(p,{fallback:o,children:f.jsx(v,{getResetKey:()=>s.resetKey,errorComponent:u||vp,onCatch:(B,P)=>{if(zn(B))throw B;h==null||h(B,P)},children:f.jsx(b,{fallback:B=>{if(!m||B.routeId&&B.routeId!==s.routeId||!B.routeId&&!r.isRoot)throw B;return A.createElement(m,B)},children:g||s._displayPending?f.jsx(tk,{fallback:o,children:f.jsx(Ob,{matchId:t})}):f.jsx(Ob,{matchId:t})})})})}),s.parentRouteId===Jn&&a.options.scrollRestoration?f.jsxs(f.Fragment,{children:[f.jsx(Ek,{}),f.jsx(kk,{})]}):null]})});function Ek(){const e=aa(),t=A.useRef(void 0);return f.jsx("script",{suppressHydrationWarning:!0,ref:a=>{a&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit(T({type:"onRendered"},Fs(e.state))),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const Ob=A.memo(function({matchId:t}){var h,m,g,p,v;const a=aa(),{match:s,key:r,routeId:c}=na({select:b=>{var j;const _=b.matches.find(k=>k.id===t),S=_.routeId,w=(j=a.routesById[S].options.remountDeps)!=null?j:a.options.defaultRemountDeps,C=w==null?void 0:w({routeId:S,loaderDeps:_.loaderDeps,params:_._strictParams,search:_._strictSearch});return{key:C?JSON.stringify(C):void 0,routeId:S,match:{id:_.id,status:_.status,error:_.error,invalid:_.invalid,_forcePending:_._forcePending,_displayPending:_._displayPending}}},structuralSharing:!0}),o=a.routesById[c],u=A.useMemo(()=>{var _;const b=(_=o.options.component)!=null?_:a.options.defaultComponent;return b?f.jsx(b,{},r):f.jsx(Xx,{})},[r,o.options.component,a.options.defaultComponent]);if(s._displayPending)throw(h=a.getMatch(s.id))==null?void 0:h._nonReactive.displayPendingPromise;if(s._forcePending)throw(m=a.getMatch(s.id))==null?void 0:m._nonReactive.minPendingPromise;if(s.status==="pending"){const b=(g=o.options.pendingMinMs)!=null?g:a.options.defaultPendingMinMs;if(b){const _=a.getMatch(s.id);if(_&&!_._nonReactive.minPendingPromise){const S=al();_._nonReactive.minPendingPromise=S,setTimeout(()=>{S.resolve(),_._nonReactive.minPendingPromise=void 0},b)}}throw(p=a.getMatch(s.id))==null?void 0:p._nonReactive.loadPromise}if(s.status==="notFound")return ii(zn(s.error)),Gx(a,o,s.error);if(s.status==="redirected")throw ii(ta(s.error)),(v=a.getMatch(s.id))==null?void 0:v._nonReactive.loadPromise;if(s.status==="error")throw s.error;return u}),Xx=A.memo(function(){const t=aa(),a=A.useContext(Wu),s=na({select:m=>{var g;return(g=m.matches.find(p=>p.id===a))==null?void 0:g.routeId}}),r=t.routesById[s],c=na({select:m=>{const p=m.matches.find(v=>v.id===a);return ii(p),p.globalNotFound}}),o=na({select:m=>{var v;const g=m.matches,p=g.findIndex(b=>b.id===a);return(v=g[p+1])==null?void 0:v.id}}),u=t.options.defaultPendingComponent?f.jsx(t.options.defaultPendingComponent,{}):null;if(c)return Gx(t,r,void 0);if(!o)return null;const h=f.jsx(Kx,{matchId:o});return s===Jn?f.jsx(A.Suspense,{fallback:u,children:h}):h});function Rk(){var o;const e=aa(),a=(o=e.routesById[Jn].options.pendingComponent)!=null?o:e.options.defaultPendingComponent,s=a?f.jsx(a,{}):null,r=typeof document!="undefined"&&e.ssr?Hr:A.Suspense,c=f.jsxs(r,{fallback:s,children:[f.jsx(Ck,{}),f.jsx(Tk,{})]});return e.options.InnerWrap?f.jsx(e.options.InnerWrap,{children:c}):c}function Tk(){const e=aa(),t=na({select:r=>{var c;return(c=r.matches[0])==null?void 0:c.id}}),a=na({select:r=>r.loadedAt}),s=t?f.jsx(Kx,{matchId:t}):null;return f.jsx(Wu.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?s:f.jsx(yp,{getResetKey:()=>a,errorComponent:vp,onCatch:r=>{r.message||r.toString()},children:s})})}const Mk=e=>new Ak(e);class Ak extends $j{constructor(t){super(t)}}typeof globalThis!="undefined"?(globalThis.createFileRoute=Mb,globalThis.createLazyFileRoute=Db):typeof window!="undefined"&&(window.createFileRoute=Mb,window.createLazyFileRoute=Db);function Lk(s){var r=s,{router:e,children:t}=r,a=de(r,["router","children"]);Object.keys(a).length>0&&e.update(K(T(T({},e.options),a),{context:T(T({},e.options.context),a.context)}));const c=Vx(),o=f.jsx(c.Provider,{value:e,children:t});return e.options.Wrap?f.jsx(e.options.Wrap,{children:o}):o}function Dk(a){var s=a,{router:e}=s,t=de(s,["router"]);return f.jsx(Lk,K(T({router:e},t),{children:f.jsx(Rk,{})}))}var ul=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ok={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Bi,dp,px,zk=(px=class{constructor(){Me(this,Bi,Ok);Me(this,dp,!1)}setTimeoutProvider(e){Se(this,Bi,e)}setTimeout(e,t){return G(this,Bi).setTimeout(e,t)}clearTimeout(e){G(this,Bi).clearTimeout(e)}setInterval(e,t){return G(this,Bi).setInterval(e,t)}clearInterval(e){G(this,Bi).clearInterval(e)}},Bi=new WeakMap,dp=new WeakMap,px),Rs=new zk;function Ik(e){setTimeout(e,0)}var Vs=typeof window=="undefined"||"Deno"in globalThis;function fn(){}function Uk(e,t){return typeof e=="function"?e(t):e}function Rm(e){return typeof e=="number"&&e>=0&&e!==1/0}function Qx(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Zi(e,t){return typeof e=="function"?e(t):e}function Wn(e,t){return typeof e=="function"?e(t):e}function zb(e,t){const{type:a="all",exact:s,fetchStatus:r,predicate:c,queryKey:o,stale:u}=e;if(o){if(s){if(t.queryHash!==wp(o,t.options))return!1}else if(!Do(t.queryKey,o))return!1}if(a!=="all"){const h=t.isActive();if(a==="active"&&!h||a==="inactive"&&h)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||r&&r!==t.state.fetchStatus||c&&!c(t))}function Ib(e,t){const{exact:a,status:s,predicate:r,mutationKey:c}=e;if(c){if(!t.options.mutationKey)return!1;if(a){if(Ys(t.options.mutationKey)!==Ys(c))return!1}else if(!Do(t.options.mutationKey,c))return!1}return!(s&&t.state.status!==s||r&&!r(t))}function wp(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ys)(e)}function Ys(e){return JSON.stringify(e,(t,a)=>Tm(a)?Object.keys(a).sort().reduce((s,r)=>(s[r]=a[r],s),{}):a)}function Do(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(a=>Do(e[a],t[a])):!1}var Bk=Object.prototype.hasOwnProperty;function Zx(e,t,a=0){if(e===t)return e;if(a>500)return t;const s=Ub(e)&&Ub(t);if(!s&&!(Tm(e)&&Tm(t)))return t;const c=(s?e:Object.keys(e)).length,o=s?t:Object.keys(t),u=o.length,h=s?new Array(u):{};let m=0;for(let g=0;g<u;g++){const p=s?g:o[g],v=e[p],b=t[p];if(v===b){h[p]=v,(s?g<c:Bk.call(e,p))&&m++;continue}if(v===null||b===null||typeof v!="object"||typeof b!="object"){h[p]=b;continue}const _=Zx(v,b,a+1);h[p]=_,_===v&&m++}return c===u&&m===c?e:h}function Hu(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const a in e)if(e[a]!==t[a])return!1;return!0}function Ub(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Tm(e){if(!Bb(e))return!1;const t=e.constructor;if(t===void 0)return!0;const a=t.prototype;return!(!Bb(a)||!a.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Bb(e){return Object.prototype.toString.call(e)==="[object Object]"}function Fk(e){return new Promise(t=>{Rs.setTimeout(t,e)})}function Mm(e,t,a){return typeof a.structuralSharing=="function"?a.structuralSharing(e,t):a.structuralSharing!==!1?Zx(e,t):t}function Hk(e,t,a=0){const s=[...e,t];return a&&s.length>a?s.slice(1):s}function Pk(e,t,a=0){const s=[t,...e];return a&&s.length>a?s.slice(0,-1):s}var Cp=Symbol();function Jx(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Cp?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Np(e,t){return typeof e=="function"?e(...t):!!e}function $k(e,t,a){let s=!1,r;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(r!=null||(r=t()),s||(s=!0,r.aborted?a():r.addEventListener("abort",a,{once:!0})),r)}),e}var Ts,Fi,Vr,gx,qk=(gx=class extends ul{constructor(){super();Me(this,Ts);Me(this,Fi);Me(this,Vr);Se(this,Vr,t=>{if(!Vs&&window.addEventListener){const a=()=>t();return window.addEventListener("visibilitychange",a,!1),()=>{window.removeEventListener("visibilitychange",a)}}})}onSubscribe(){G(this,Fi)||this.setEventListener(G(this,Vr))}onUnsubscribe(){var t;this.hasListeners()||((t=G(this,Fi))==null||t.call(this),Se(this,Fi,void 0))}setEventListener(t){var a;Se(this,Vr,t),(a=G(this,Fi))==null||a.call(this),Se(this,Fi,t(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(t){G(this,Ts)!==t&&(Se(this,Ts,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(a=>{a(t)})}isFocused(){var t;return typeof G(this,Ts)=="boolean"?G(this,Ts):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ts=new WeakMap,Fi=new WeakMap,Vr=new WeakMap,gx),jp=new qk;function Am(){let e,t;const a=new Promise((r,c)=>{e=r,t=c});a.status="pending",a.catch(()=>{});function s(r){Object.assign(a,r),delete a.resolve,delete a.reject}return a.resolve=r=>{s({status:"fulfilled",value:r}),e(r)},a.reject=r=>{s({status:"rejected",reason:r}),t(r)},a}var Vk=Ik;function Yk(){let e=[],t=0,a=u=>{u()},s=u=>{u()},r=Vk;const c=u=>{t?e.push(u):r(()=>{a(u)})},o=()=>{const u=e;e=[],u.length&&r(()=>{s(()=>{u.forEach(h=>{a(h)})})})};return{batch:u=>{let h;t++;try{h=u()}finally{t--,t||o()}return h},batchCalls:u=>(...h)=>{c(()=>{u(...h)})},schedule:c,setNotifyFunction:u=>{a=u},setBatchNotifyFunction:u=>{s=u},setScheduler:u=>{r=u}}}var Gt=Yk(),Yr,Hi,Gr,yx,Gk=(yx=class extends ul{constructor(){super();Me(this,Yr,!0);Me(this,Hi);Me(this,Gr);Se(this,Gr,t=>{if(!Vs&&window.addEventListener){const a=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",s)}}})}onSubscribe(){G(this,Hi)||this.setEventListener(G(this,Gr))}onUnsubscribe(){var t;this.hasListeners()||((t=G(this,Hi))==null||t.call(this),Se(this,Hi,void 0))}setEventListener(t){var a;Se(this,Gr,t),(a=G(this,Hi))==null||a.call(this),Se(this,Hi,t(this.setOnline.bind(this)))}setOnline(t){G(this,Yr)!==t&&(Se(this,Yr,t),this.listeners.forEach(s=>{s(t)}))}isOnline(){return G(this,Yr)}},Yr=new WeakMap,Hi=new WeakMap,Gr=new WeakMap,yx),Pu=new Gk;function Kk(e){return Math.min(1e3*Mh(2,e),3e4)}function Wx(e){return(e!=null?e:"online")==="online"?Pu.isOnline():!0}var Lm=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function e_(e){let t=!1,a=0,s;const r=Am(),c=()=>r.status!=="pending",o=S=>{var w;if(!c()){const C=new Lm(S);v(C),(w=e.onCancel)==null||w.call(e,C)}},u=()=>{t=!0},h=()=>{t=!1},m=()=>jp.isFocused()&&(e.networkMode==="always"||Pu.isOnline())&&e.canRun(),g=()=>Wx(e.networkMode)&&e.canRun(),p=S=>{c()||(s==null||s(),r.resolve(S))},v=S=>{c()||(s==null||s(),r.reject(S))},b=()=>new Promise(S=>{var w;s=C=>{(c()||m())&&S(C)},(w=e.onPause)==null||w.call(e)}).then(()=>{var S;s=void 0,c()||(S=e.onContinue)==null||S.call(e)}),_=()=>{if(c())return;let S;const w=a===0?e.initialPromise:void 0;try{S=w!=null?w:e.fn()}catch(C){S=Promise.reject(C)}Promise.resolve(S).then(p).catch(C=>{var O,z,B;if(c())return;const R=(O=e.retry)!=null?O:Vs?0:3,j=(z=e.retryDelay)!=null?z:Kk,k=typeof j=="function"?j(a,C):j,I=R===!0||typeof R=="number"&&a<R||typeof R=="function"&&R(a,C);if(t||!I){v(C);return}a++,(B=e.onFail)==null||B.call(e,a,C),Fk(k).then(()=>m()?void 0:b()).then(()=>{t?v(C):_()})})};return{promise:r,status:()=>r.status,cancel:o,continue:()=>(s==null||s(),r),cancelRetry:u,continueRetry:h,canStart:g,start:()=>(g()?_():b().then(_),r)}}var Ms,vx,t_=(vx=class{constructor(){Me(this,Ms)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Rm(this.gcTime)&&Se(this,Ms,Rs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e!=null?e:Vs?1/0:300*1e3)}clearGcTimeout(){G(this,Ms)&&(Rs.clearTimeout(G(this,Ms)),Se(this,Ms,void 0))}},Ms=new WeakMap,vx),As,Kr,Zn,Ls,Zt,Fo,Ds,ca,Za,bx,Xk=(bx=class extends t_{constructor(t){var a;super();Me(this,ca);Me(this,As);Me(this,Kr);Me(this,Zn);Me(this,Ls);Me(this,Zt);Me(this,Fo);Me(this,Ds);Se(this,Ds,!1),Se(this,Fo,t.defaultOptions),this.setOptions(t.options),this.observers=[],Se(this,Ls,t.client),Se(this,Zn,G(this,Ls).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Se(this,As,Hb(this.options)),this.state=(a=t.state)!=null?a:G(this,As),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=G(this,Zt))==null?void 0:t.promise}setOptions(t){if(this.options=T(T({},G(this,Fo)),t),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const a=Hb(this.options);a.data!==void 0&&(this.setState(Fb(a.data,a.dataUpdatedAt)),Se(this,As,a))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&G(this,Zn).remove(this)}setData(t,a){const s=Mm(this.state.data,t,this.options);return Ve(this,ca,Za).call(this,{data:s,type:"success",dataUpdatedAt:a==null?void 0:a.updatedAt,manual:a==null?void 0:a.manual}),s}setState(t,a){Ve(this,ca,Za).call(this,{type:"setState",state:t,setStateOptions:a})}cancel(t){var s,r;const a=(s=G(this,Zt))==null?void 0:s.promise;return(r=G(this,Zt))==null||r.cancel(t),a?a.then(fn).catch(fn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(G(this,As))}isActive(){return this.observers.some(t=>Wn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Cp||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Zi(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Qx(this.state.dataUpdatedAt,t)}onFocus(){var a;const t=this.observers.find(s=>s.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(a=G(this,Zt))==null||a.continue()}onOnline(){var a;const t=this.observers.find(s=>s.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(a=G(this,Zt))==null||a.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),G(this,Zn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(a=>a!==t),this.observers.length||(G(this,Zt)&&(G(this,Ds)?G(this,Zt).cancel({revert:!0}):G(this,Zt).cancelRetry()),this.scheduleGc()),G(this,Zn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ve(this,ca,Za).call(this,{type:"invalidate"})}fetch(t,a){return Ue(this,null,function*(){var h,m,g,p,v,b,_,S,w,C,R,j;if(this.state.fetchStatus!=="idle"&&((h=G(this,Zt))==null?void 0:h.status())!=="rejected"){if(this.state.data!==void 0&&(a!=null&&a.cancelRefetch))this.cancel({silent:!0});else if(G(this,Zt))return G(this,Zt).continueRetry(),G(this,Zt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const k=this.observers.find(I=>I.options.queryFn);k&&this.setOptions(k.options)}const s=new AbortController,r=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(Se(this,Ds,!0),s.signal)})},c=()=>{const k=Jx(this.options,a),O=(()=>{const z={client:G(this,Ls),queryKey:this.queryKey,meta:this.meta};return r(z),z})();return Se(this,Ds,!1),this.options.persister?this.options.persister(k,O,this):k(O)},u=(()=>{const k={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:G(this,Ls),state:this.state,fetchFn:c};return r(k),k})();(m=this.options.behavior)==null||m.onFetch(u,this),Se(this,Kr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=u.fetchOptions)==null?void 0:g.meta))&&Ve(this,ca,Za).call(this,{type:"fetch",meta:(p=u.fetchOptions)==null?void 0:p.meta}),Se(this,Zt,e_({initialPromise:a==null?void 0:a.initialPromise,fn:u.fetchFn,onCancel:k=>{k instanceof Lm&&k.revert&&this.setState(K(T({},G(this,Kr)),{fetchStatus:"idle"})),s.abort()},onFail:(k,I)=>{Ve(this,ca,Za).call(this,{type:"failed",failureCount:k,error:I})},onPause:()=>{Ve(this,ca,Za).call(this,{type:"pause"})},onContinue:()=>{Ve(this,ca,Za).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const k=yield G(this,Zt).start();if(k===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(k),(b=(v=G(this,Zn).config).onSuccess)==null||b.call(v,k,this),(S=(_=G(this,Zn).config).onSettled)==null||S.call(_,k,this.state.error,this),k}catch(k){if(k instanceof Lm){if(k.silent)return G(this,Zt).promise;if(k.revert){if(this.state.data===void 0)throw k;return this.state.data}}throw Ve(this,ca,Za).call(this,{type:"error",error:k}),(C=(w=G(this,Zn).config).onError)==null||C.call(w,k,this),(j=(R=G(this,Zn).config).onSettled)==null||j.call(R,this.state.data,k,this),k}finally{this.scheduleGc()}})}},As=new WeakMap,Kr=new WeakMap,Zn=new WeakMap,Ls=new WeakMap,Zt=new WeakMap,Fo=new WeakMap,Ds=new WeakMap,ca=new WeakSet,Za=function(t){const a=s=>{var r;switch(t.type){case"failed":return K(T({},s),{fetchFailureCount:t.failureCount,fetchFailureReason:t.error});case"pause":return K(T({},s),{fetchStatus:"paused"});case"continue":return K(T({},s),{fetchStatus:"fetching"});case"fetch":return K(T(T({},s),n_(s.data,this.options)),{fetchMeta:(r=t.meta)!=null?r:null});case"success":const c=T(K(T(T({},s),Fb(t.data,t.dataUpdatedAt)),{dataUpdateCount:s.dataUpdateCount+1}),!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null});return Se(this,Kr,t.manual?c:void 0),c;case"error":const o=t.error;return K(T({},s),{error:o,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0});case"invalidate":return K(T({},s),{isInvalidated:!0});case"setState":return T(T({},s),t.state)}};this.state=a(this.state),Gt.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),G(this,Zn).notify({query:this,type:"updated",action:t})})},bx);function n_(e,t){return T({fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Wx(t.networkMode)?"fetching":"paused"},e===void 0&&{error:null,status:"pending"})}function Fb(e,t){return{data:e,dataUpdatedAt:t!=null?t:Date.now(),error:null,isInvalidated:!1,status:"success"}}function Hb(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,a=t!==void 0,s=a?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:a?s!=null?s:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:a?"success":"pending",fetchStatus:"idle"}}var _n,tt,Ho,dn,Os,Xr,Ja,Pi,Po,Qr,Zr,zs,Is,$i,Jr,lt,_o,Dm,Om,zm,Im,Um,Bm,Fm,a_,xx,Qk=(xx=class extends ul{constructor(t,a){super();Me(this,lt);Me(this,_n);Me(this,tt);Me(this,Ho);Me(this,dn);Me(this,Os);Me(this,Xr);Me(this,Ja);Me(this,Pi);Me(this,Po);Me(this,Qr);Me(this,Zr);Me(this,zs);Me(this,Is);Me(this,$i);Me(this,Jr,new Set);this.options=a,Se(this,_n,t),Se(this,Pi,null),Se(this,Ja,Am()),this.bindMethods(),this.setOptions(a)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(G(this,tt).addObserver(this),Pb(G(this,tt),this.options)?Ve(this,lt,_o).call(this):this.updateResult(),Ve(this,lt,Im).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Hm(G(this,tt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Hm(G(this,tt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ve(this,lt,Um).call(this),Ve(this,lt,Bm).call(this),G(this,tt).removeObserver(this)}setOptions(t){const a=this.options,s=G(this,tt);if(this.options=G(this,_n).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Wn(this.options.enabled,G(this,tt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ve(this,lt,Fm).call(this),G(this,tt).setOptions(this.options),a._defaulted&&!Hu(this.options,a)&&G(this,_n).getQueryCache().notify({type:"observerOptionsUpdated",query:G(this,tt),observer:this});const r=this.hasListeners();r&&$b(G(this,tt),s,this.options,a)&&Ve(this,lt,_o).call(this),this.updateResult(),r&&(G(this,tt)!==s||Wn(this.options.enabled,G(this,tt))!==Wn(a.enabled,G(this,tt))||Zi(this.options.staleTime,G(this,tt))!==Zi(a.staleTime,G(this,tt)))&&Ve(this,lt,Dm).call(this);const c=Ve(this,lt,Om).call(this);r&&(G(this,tt)!==s||Wn(this.options.enabled,G(this,tt))!==Wn(a.enabled,G(this,tt))||c!==G(this,$i))&&Ve(this,lt,zm).call(this,c)}getOptimisticResult(t){const a=G(this,_n).getQueryCache().build(G(this,_n),t),s=this.createResult(a,t);return Jk(this,s)&&(Se(this,dn,s),Se(this,Xr,this.options),Se(this,Os,G(this,tt).state)),s}getCurrentResult(){return G(this,dn)}trackResult(t,a){return new Proxy(t,{get:(s,r)=>(this.trackProp(r),a==null||a(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&G(this,Ja).status==="pending"&&G(this,Ja).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,r))})}trackProp(t){G(this,Jr).add(t)}getCurrentQuery(){return G(this,tt)}refetch(a={}){var t=de(a,[]);return this.fetch(T({},t))}fetchOptimistic(t){const a=G(this,_n).defaultQueryOptions(t),s=G(this,_n).getQueryCache().build(G(this,_n),a);return s.fetch().then(()=>this.createResult(s,a))}fetch(t){var a;return Ve(this,lt,_o).call(this,K(T({},t),{cancelRefetch:(a=t.cancelRefetch)!=null?a:!0})).then(()=>(this.updateResult(),G(this,dn)))}createResult(t,a){var P;const s=G(this,tt),r=this.options,c=G(this,dn),o=G(this,Os),u=G(this,Xr),m=t!==s?t.state:G(this,Ho),{state:g}=t;let p=T({},g),v=!1,b;if(a._optimisticResults){const M=this.hasListeners(),U=!M&&Pb(t,a),F=M&&$b(t,s,a,r);(U||F)&&(p=T(T({},p),n_(g.data,t.options))),a._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:_,errorUpdatedAt:S,status:w}=p;b=p.data;let C=!1;if(a.placeholderData!==void 0&&b===void 0&&w==="pending"){let M;c!=null&&c.isPlaceholderData&&a.placeholderData===(u==null?void 0:u.placeholderData)?(M=c.data,C=!0):M=typeof a.placeholderData=="function"?a.placeholderData((P=G(this,Zr))==null?void 0:P.state.data,G(this,Zr)):a.placeholderData,M!==void 0&&(w="success",b=Mm(c==null?void 0:c.data,M,a),v=!0)}if(a.select&&b!==void 0&&!C)if(c&&b===(o==null?void 0:o.data)&&a.select===G(this,Po))b=G(this,Qr);else try{Se(this,Po,a.select),b=a.select(b),b=Mm(c==null?void 0:c.data,b,a),Se(this,Qr,b),Se(this,Pi,null)}catch(M){Se(this,Pi,M)}G(this,Pi)&&(_=G(this,Pi),b=G(this,Qr),S=Date.now(),w="error");const R=p.fetchStatus==="fetching",j=w==="pending",k=w==="error",I=j&&R,O=b!==void 0,B={status:w,fetchStatus:p.fetchStatus,isPending:j,isSuccess:w==="success",isError:k,isInitialLoading:I,isLoading:I,data:b,dataUpdatedAt:p.dataUpdatedAt,error:_,errorUpdatedAt:S,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>m.dataUpdateCount||p.errorUpdateCount>m.errorUpdateCount,isFetching:R,isRefetching:R&&!j,isLoadingError:k&&!O,isPaused:p.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:k&&O,isStale:kp(t,a),refetch:this.refetch,promise:G(this,Ja),isEnabled:Wn(a.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const M=B.data!==void 0,U=B.status==="error"&&!M,F=Y=>{U?Y.reject(B.error):M&&Y.resolve(B.data)},q=()=>{const Y=Se(this,Ja,B.promise=Am());F(Y)},H=G(this,Ja);switch(H.status){case"pending":t.queryHash===s.queryHash&&F(H);break;case"fulfilled":(U||B.data!==H.value)&&q();break;case"rejected":(!U||B.error!==H.reason)&&q();break}}return B}updateResult(){const t=G(this,dn),a=this.createResult(G(this,tt),this.options);if(Se(this,Os,G(this,tt).state),Se(this,Xr,this.options),G(this,Os).data!==void 0&&Se(this,Zr,G(this,tt)),Hu(a,t))return;Se(this,dn,a);const s=()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,c=typeof r=="function"?r():r;if(c==="all"||!c&&!G(this,Jr).size)return!0;const o=new Set(c!=null?c:G(this,Jr));return this.options.throwOnError&&o.add("error"),Object.keys(G(this,dn)).some(u=>{const h=u;return G(this,dn)[h]!==t[h]&&o.has(h)})};Ve(this,lt,a_).call(this,{listeners:s()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ve(this,lt,Im).call(this)}},_n=new WeakMap,tt=new WeakMap,Ho=new WeakMap,dn=new WeakMap,Os=new WeakMap,Xr=new WeakMap,Ja=new WeakMap,Pi=new WeakMap,Po=new WeakMap,Qr=new WeakMap,Zr=new WeakMap,zs=new WeakMap,Is=new WeakMap,$i=new WeakMap,Jr=new WeakMap,lt=new WeakSet,_o=function(t){Ve(this,lt,Fm).call(this);let a=G(this,tt).fetch(this.options,t);return t!=null&&t.throwOnError||(a=a.catch(fn)),a},Dm=function(){Ve(this,lt,Um).call(this);const t=Zi(this.options.staleTime,G(this,tt));if(Vs||G(this,dn).isStale||!Rm(t))return;const s=Qx(G(this,dn).dataUpdatedAt,t)+1;Se(this,zs,Rs.setTimeout(()=>{G(this,dn).isStale||this.updateResult()},s))},Om=function(){var t;return(t=typeof this.options.refetchInterval=="function"?this.options.refetchInterval(G(this,tt)):this.options.refetchInterval)!=null?t:!1},zm=function(t){Ve(this,lt,Bm).call(this),Se(this,$i,t),!(Vs||Wn(this.options.enabled,G(this,tt))===!1||!Rm(G(this,$i))||G(this,$i)===0)&&Se(this,Is,Rs.setInterval(()=>{(this.options.refetchIntervalInBackground||jp.isFocused())&&Ve(this,lt,_o).call(this)},G(this,$i)))},Im=function(){Ve(this,lt,Dm).call(this),Ve(this,lt,zm).call(this,Ve(this,lt,Om).call(this))},Um=function(){G(this,zs)&&(Rs.clearTimeout(G(this,zs)),Se(this,zs,void 0))},Bm=function(){G(this,Is)&&(Rs.clearInterval(G(this,Is)),Se(this,Is,void 0))},Fm=function(){const t=G(this,_n).getQueryCache().build(G(this,_n),this.options);if(t===G(this,tt))return;const a=G(this,tt);Se(this,tt,t),Se(this,Ho,t.state),this.hasListeners()&&(a==null||a.removeObserver(this),t.addObserver(this))},a_=function(t){Gt.batch(()=>{t.listeners&&this.listeners.forEach(a=>{a(G(this,dn))}),G(this,_n).getQueryCache().notify({query:G(this,tt),type:"observerResultsUpdated"})})},xx);function Zk(e,t){return Wn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Pb(e,t){return Zk(e,t)||e.state.data!==void 0&&Hm(e,t,t.refetchOnMount)}function Hm(e,t,a){if(Wn(t.enabled,e)!==!1&&Zi(t.staleTime,e)!=="static"){const s=typeof a=="function"?a(e):a;return s==="always"||s!==!1&&kp(e,t)}return!1}function $b(e,t,a,s){return(e!==t||Wn(s.enabled,e)===!1)&&(!a.suspense||e.state.status!=="error")&&kp(e,a)}function kp(e,t){return Wn(t.enabled,e)!==!1&&e.isStaleByTime(Zi(t.staleTime,e))}function Jk(e,t){return!Hu(e.getCurrentResult(),t)}function qb(e){return{onFetch:(t,a)=>{var g,p,v,b,_;const s=t.options,r=(v=(p=(g=t.fetchOptions)==null?void 0:g.meta)==null?void 0:p.fetchMore)==null?void 0:v.direction,c=((b=t.state.data)==null?void 0:b.pages)||[],o=((_=t.state.data)==null?void 0:_.pageParams)||[];let u={pages:[],pageParams:[]},h=0;const m=()=>Ue(null,null,function*(){var j;let S=!1;const w=k=>{$k(k,()=>t.signal,()=>S=!0)},C=Jx(t.options,t.fetchOptions),R=(k,I,O)=>Ue(null,null,function*(){if(S)return Promise.reject();if(I==null&&k.pages.length)return Promise.resolve(k);const B=(()=>{const F={client:t.client,queryKey:t.queryKey,pageParam:I,direction:O?"backward":"forward",meta:t.options.meta};return w(F),F})(),P=yield C(B),{maxPages:M}=t.options,U=O?Pk:Hk;return{pages:U(k.pages,P,M),pageParams:U(k.pageParams,I,M)}});if(r&&c.length){const k=r==="backward",I=k?Wk:Vb,O={pages:c,pageParams:o},z=I(s,O);u=yield R(O,z,k)}else{const k=e!=null?e:c.length;do{const I=h===0?(j=o[0])!=null?j:s.initialPageParam:Vb(s,u);if(h>0&&I==null)break;u=yield R(u,I),h++}while(h<k)}return u});t.options.persister?t.fetchFn=()=>{var S,w;return(w=(S=t.options).persister)==null?void 0:w.call(S,m,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},a)}:t.fetchFn=m}}}function Vb(e,{pages:t,pageParams:a}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,a[s],a):void 0}function Wk(e,{pages:t,pageParams:a}){var s;return t.length>0?(s=e.getPreviousPageParam)==null?void 0:s.call(e,t[0],t,a[0],a):void 0}var $o,wa,an,Us,Ca,Ii,_x,eE=(_x=class extends t_{constructor(t){super();Me(this,Ca);Me(this,$o);Me(this,wa);Me(this,an);Me(this,Us);Se(this,$o,t.client),this.mutationId=t.mutationId,Se(this,an,t.mutationCache),Se(this,wa,[]),this.state=t.state||i_(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){G(this,wa).includes(t)||(G(this,wa).push(t),this.clearGcTimeout(),G(this,an).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Se(this,wa,G(this,wa).filter(a=>a!==t)),this.scheduleGc(),G(this,an).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){G(this,wa).length||(this.state.status==="pending"?this.scheduleGc():G(this,an).remove(this))}continue(){var t,a;return(a=(t=G(this,Us))==null?void 0:t.continue())!=null?a:this.execute(this.state.variables)}execute(t){return Ue(this,null,function*(){var o,u,h,m,g,p,v,b,_,S,w,C,R,j,k,I,O,z,B;const a=()=>{Ve(this,Ca,Ii).call(this,{type:"continue"})},s={client:G(this,$o),meta:this.options.meta,mutationKey:this.options.mutationKey};Se(this,Us,e_({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):Promise.reject(new Error("No mutationFn found")),onFail:(P,M)=>{Ve(this,Ca,Ii).call(this,{type:"failed",failureCount:P,error:M})},onPause:()=>{Ve(this,Ca,Ii).call(this,{type:"pause"})},onContinue:a,retry:(o=this.options.retry)!=null?o:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>G(this,an).canRun(this)}));const r=this.state.status==="pending",c=!G(this,Us).canStart();try{if(r)a();else{Ve(this,Ca,Ii).call(this,{type:"pending",variables:t,isPaused:c}),G(this,an).config.onMutate&&(yield G(this,an).config.onMutate(t,this,s));const M=yield(h=(u=this.options).onMutate)==null?void 0:h.call(u,t,s);M!==this.state.context&&Ve(this,Ca,Ii).call(this,{type:"pending",context:M,variables:t,isPaused:c})}const P=yield G(this,Us).start();return yield(g=(m=G(this,an).config).onSuccess)==null?void 0:g.call(m,P,t,this.state.context,this,s),yield(v=(p=this.options).onSuccess)==null?void 0:v.call(p,P,t,this.state.context,s),yield(_=(b=G(this,an).config).onSettled)==null?void 0:_.call(b,P,null,this.state.variables,this.state.context,this,s),yield(w=(S=this.options).onSettled)==null?void 0:w.call(S,P,null,t,this.state.context,s),Ve(this,Ca,Ii).call(this,{type:"success",data:P}),P}catch(P){try{yield(R=(C=G(this,an).config).onError)==null?void 0:R.call(C,P,t,this.state.context,this,s)}catch(M){Promise.reject(M)}try{yield(k=(j=this.options).onError)==null?void 0:k.call(j,P,t,this.state.context,s)}catch(M){Promise.reject(M)}try{yield(O=(I=G(this,an).config).onSettled)==null?void 0:O.call(I,void 0,P,this.state.variables,this.state.context,this,s)}catch(M){Promise.reject(M)}try{yield(B=(z=this.options).onSettled)==null?void 0:B.call(z,void 0,P,t,this.state.context,s)}catch(M){Promise.reject(M)}throw Ve(this,Ca,Ii).call(this,{type:"error",error:P}),P}finally{G(this,an).runNext(this)}})}},$o=new WeakMap,wa=new WeakMap,an=new WeakMap,Us=new WeakMap,Ca=new WeakSet,Ii=function(t){const a=s=>{switch(t.type){case"failed":return K(T({},s),{failureCount:t.failureCount,failureReason:t.error});case"pause":return K(T({},s),{isPaused:!0});case"continue":return K(T({},s),{isPaused:!1});case"pending":return K(T({},s),{context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()});case"success":return K(T({},s),{data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1});case"error":return K(T({},s),{data:void 0,error:t.error,failureCount:s.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"})}};this.state=a(this.state),Gt.batch(()=>{G(this,wa).forEach(s=>{s.onMutationUpdate(t)}),G(this,an).notify({mutation:this,type:"updated",action:t})})},_x);function i_(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Wa,ua,qo,Sx,tE=(Sx=class extends ul{constructor(t={}){super();Me(this,Wa);Me(this,ua);Me(this,qo);this.config=t,Se(this,Wa,new Set),Se(this,ua,new Map),Se(this,qo,0)}build(t,a,s){const r=new eE({client:t,mutationCache:this,mutationId:++uu(this,qo)._,options:t.defaultMutationOptions(a),state:s});return this.add(r),r}add(t){G(this,Wa).add(t);const a=mu(t);if(typeof a=="string"){const s=G(this,ua).get(a);s?s.push(t):G(this,ua).set(a,[t])}this.notify({type:"added",mutation:t})}remove(t){if(G(this,Wa).delete(t)){const a=mu(t);if(typeof a=="string"){const s=G(this,ua).get(a);if(s)if(s.length>1){const r=s.indexOf(t);r!==-1&&s.splice(r,1)}else s[0]===t&&G(this,ua).delete(a)}}this.notify({type:"removed",mutation:t})}canRun(t){const a=mu(t);if(typeof a=="string"){const s=G(this,ua).get(a),r=s==null?void 0:s.find(c=>c.state.status==="pending");return!r||r===t}else return!0}runNext(t){var s,r;const a=mu(t);if(typeof a=="string"){const c=(s=G(this,ua).get(a))==null?void 0:s.find(o=>o!==t&&o.state.isPaused);return(r=c==null?void 0:c.continue())!=null?r:Promise.resolve()}else return Promise.resolve()}clear(){Gt.batch(()=>{G(this,Wa).forEach(t=>{this.notify({type:"removed",mutation:t})}),G(this,Wa).clear(),G(this,ua).clear()})}getAll(){return Array.from(G(this,Wa))}find(t){const a=T({exact:!0},t);return this.getAll().find(s=>Ib(a,s))}findAll(t={}){return this.getAll().filter(a=>Ib(t,a))}notify(t){Gt.batch(()=>{this.listeners.forEach(a=>{a(t)})})}resumePausedMutations(){const t=this.getAll().filter(a=>a.state.isPaused);return Gt.batch(()=>Promise.all(t.map(a=>a.continue().catch(fn))))}},Wa=new WeakMap,ua=new WeakMap,qo=new WeakMap,Sx);function mu(e){var t;return(t=e.options.scope)==null?void 0:t.id}var ei,qi,Sn,ti,ai,Tu,Pm,wx,nE=(wx=class extends ul{constructor(a,s){super();Me(this,ai);Me(this,ei);Me(this,qi);Me(this,Sn);Me(this,ti);Se(this,ei,a),this.setOptions(s),this.bindMethods(),Ve(this,ai,Tu).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(a){var r;const s=this.options;this.options=G(this,ei).defaultMutationOptions(a),Hu(this.options,s)||G(this,ei).getMutationCache().notify({type:"observerOptionsUpdated",mutation:G(this,Sn),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&Ys(s.mutationKey)!==Ys(this.options.mutationKey)?this.reset():((r=G(this,Sn))==null?void 0:r.state.status)==="pending"&&G(this,Sn).setOptions(this.options)}onUnsubscribe(){var a;this.hasListeners()||(a=G(this,Sn))==null||a.removeObserver(this)}onMutationUpdate(a){Ve(this,ai,Tu).call(this),Ve(this,ai,Pm).call(this,a)}getCurrentResult(){return G(this,qi)}reset(){var a;(a=G(this,Sn))==null||a.removeObserver(this),Se(this,Sn,void 0),Ve(this,ai,Tu).call(this),Ve(this,ai,Pm).call(this)}mutate(a,s){var r;return Se(this,ti,s),(r=G(this,Sn))==null||r.removeObserver(this),Se(this,Sn,G(this,ei).getMutationCache().build(G(this,ei),this.options)),G(this,Sn).addObserver(this),G(this,Sn).execute(a)}},ei=new WeakMap,qi=new WeakMap,Sn=new WeakMap,ti=new WeakMap,ai=new WeakSet,Tu=function(){var s,r;const a=(r=(s=G(this,Sn))==null?void 0:s.state)!=null?r:i_();Se(this,qi,K(T({},a),{isPending:a.status==="pending",isSuccess:a.status==="success",isError:a.status==="error",isIdle:a.status==="idle",mutate:this.mutate,reset:this.reset}))},Pm=function(a){Gt.batch(()=>{var s,r,c,o,u,h,m,g;if(G(this,ti)&&this.hasListeners()){const p=G(this,qi).variables,v=G(this,qi).context,b={client:G(this,ei),meta:this.options.meta,mutationKey:this.options.mutationKey};if((a==null?void 0:a.type)==="success"){try{(r=(s=G(this,ti)).onSuccess)==null||r.call(s,a.data,p,v,b)}catch(_){Promise.reject(_)}try{(o=(c=G(this,ti)).onSettled)==null||o.call(c,a.data,null,p,v,b)}catch(_){Promise.reject(_)}}else if((a==null?void 0:a.type)==="error"){try{(h=(u=G(this,ti)).onError)==null||h.call(u,a.error,p,v,b)}catch(_){Promise.reject(_)}try{(g=(m=G(this,ti)).onSettled)==null||g.call(m,void 0,a.error,p,v,b)}catch(_){Promise.reject(_)}}}this.listeners.forEach(p=>{p(G(this,qi))})})},wx),Na,Cx,aE=(Cx=class extends ul{constructor(t={}){super();Me(this,Na);this.config=t,Se(this,Na,new Map)}build(t,a,s){var u;const r=a.queryKey,c=(u=a.queryHash)!=null?u:wp(r,a);let o=this.get(c);return o||(o=new Xk({client:t,queryKey:r,queryHash:c,options:t.defaultQueryOptions(a),state:s,defaultOptions:t.getQueryDefaults(r)}),this.add(o)),o}add(t){G(this,Na).has(t.queryHash)||(G(this,Na).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const a=G(this,Na).get(t.queryHash);a&&(t.destroy(),a===t&&G(this,Na).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Gt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return G(this,Na).get(t)}getAll(){return[...G(this,Na).values()]}find(t){const a=T({exact:!0},t);return this.getAll().find(s=>zb(a,s))}findAll(t={}){const a=this.getAll();return Object.keys(t).length>0?a.filter(s=>zb(t,s)):a}notify(t){Gt.batch(()=>{this.listeners.forEach(a=>{a(t)})})}onFocus(){Gt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Gt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Na=new WeakMap,Cx),Ot,Vi,Yi,Wr,el,Gi,tl,nl,Nx,iE=(Nx=class{constructor(e={}){Me(this,Ot);Me(this,Vi);Me(this,Yi);Me(this,Wr);Me(this,el);Me(this,Gi);Me(this,tl);Me(this,nl);Se(this,Ot,e.queryCache||new aE),Se(this,Vi,e.mutationCache||new tE),Se(this,Yi,e.defaultOptions||{}),Se(this,Wr,new Map),Se(this,el,new Map),Se(this,Gi,0)}mount(){uu(this,Gi)._++,G(this,Gi)===1&&(Se(this,tl,jp.subscribe(e=>Ue(this,null,function*(){e&&(yield this.resumePausedMutations(),G(this,Ot).onFocus())}))),Se(this,nl,Pu.subscribe(e=>Ue(this,null,function*(){e&&(yield this.resumePausedMutations(),G(this,Ot).onOnline())}))))}unmount(){var e,t;uu(this,Gi)._--,G(this,Gi)===0&&((e=G(this,tl))==null||e.call(this),Se(this,tl,void 0),(t=G(this,nl))==null||t.call(this),Se(this,nl,void 0))}isFetching(e){return G(this,Ot).findAll(K(T({},e),{fetchStatus:"fetching"})).length}isMutating(e){return G(this,Vi).findAll(K(T({},e),{status:"pending"})).length}getQueryData(e){var a;const t=this.defaultQueryOptions({queryKey:e});return(a=G(this,Ot).get(t.queryHash))==null?void 0:a.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),a=G(this,Ot).build(this,t),s=a.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&a.isStaleByTime(Zi(t.staleTime,a))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return G(this,Ot).findAll(e).map(({queryKey:t,state:a})=>{const s=a.data;return[t,s]})}setQueryData(e,t,a){const s=this.defaultQueryOptions({queryKey:e}),r=G(this,Ot).get(s.queryHash),c=r==null?void 0:r.state.data,o=Uk(t,c);if(o!==void 0)return G(this,Ot).build(this,s).setData(o,K(T({},a),{manual:!0}))}setQueriesData(e,t,a){return Gt.batch(()=>G(this,Ot).findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,a)]))}getQueryState(e){var a;const t=this.defaultQueryOptions({queryKey:e});return(a=G(this,Ot).get(t.queryHash))==null?void 0:a.state}removeQueries(e){const t=G(this,Ot);Gt.batch(()=>{t.findAll(e).forEach(a=>{t.remove(a)})})}resetQueries(e,t){const a=G(this,Ot);return Gt.batch(()=>(a.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries(T({type:"active"},e),t)))}cancelQueries(e,t={}){const a=T({revert:!0},t),s=Gt.batch(()=>G(this,Ot).findAll(e).map(r=>r.cancel(a)));return Promise.all(s).then(fn).catch(fn)}invalidateQueries(e,t={}){return Gt.batch(()=>{var a,s;return G(this,Ot).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries(K(T({},e),{type:(s=(a=e==null?void 0:e.refetchType)!=null?a:e==null?void 0:e.type)!=null?s:"active"}),t)})}refetchQueries(e,t={}){var r;const a=K(T({},t),{cancelRefetch:(r=t.cancelRefetch)!=null?r:!0}),s=Gt.batch(()=>G(this,Ot).findAll(e).filter(c=>!c.isDisabled()&&!c.isStatic()).map(c=>{let o=c.fetch(void 0,a);return a.throwOnError||(o=o.catch(fn)),c.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(s).then(fn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const a=G(this,Ot).build(this,t);return a.isStaleByTime(Zi(t.staleTime,a))?a.fetch(t):Promise.resolve(a.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(fn).catch(fn)}fetchInfiniteQuery(e){return e.behavior=qb(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(fn).catch(fn)}ensureInfiniteQueryData(e){return e.behavior=qb(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Pu.isOnline()?G(this,Vi).resumePausedMutations():Promise.resolve()}getQueryCache(){return G(this,Ot)}getMutationCache(){return G(this,Vi)}getDefaultOptions(){return G(this,Yi)}setDefaultOptions(e){Se(this,Yi,e)}setQueryDefaults(e,t){G(this,Wr).set(Ys(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...G(this,Wr).values()],a={};return t.forEach(s=>{Do(e,s.queryKey)&&Object.assign(a,s.defaultOptions)}),a}setMutationDefaults(e,t){G(this,el).set(Ys(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...G(this,el).values()],a={};return t.forEach(s=>{Do(e,s.mutationKey)&&Object.assign(a,s.defaultOptions)}),a}defaultQueryOptions(e){if(e._defaulted)return e;const t=K(T(T(T({},G(this,Yi).queries),this.getQueryDefaults(e.queryKey)),e),{_defaulted:!0});return t.queryHash||(t.queryHash=wp(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Cp&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:K(T(T(T({},G(this,Yi).mutations),(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey)),e),{_defaulted:!0})}clear(){G(this,Ot).clear(),G(this,Vi).clear()}},Ot=new WeakMap,Vi=new WeakMap,Yi=new WeakMap,Wr=new WeakMap,el=new WeakMap,Gi=new WeakMap,tl=new WeakMap,nl=new WeakMap,Nx),s_=A.createContext(void 0),dl=e=>{const t=A.useContext(s_);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},sE=({client:e,children:t})=>(A.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(s_.Provider,{value:e,children:t})),r_=A.createContext(!1),rE=()=>A.useContext(r_);r_.Provider;function lE(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var oE=A.createContext(lE()),cE=()=>A.useContext(oE),uE=(e,t,a)=>{const s=a!=null&&a.state.error&&typeof e.throwOnError=="function"?Np(e.throwOnError,[a.state.error,a]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(t.isReset()||(e.retryOnMount=!1))},dE=e=>{A.useEffect(()=>{e.clearReset()},[e])},fE=({result:e,errorResetBoundary:t,throwOnError:a,query:s,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(r&&e.data===void 0||Np(a,[e.error,s])),hE=e=>{if(e.suspense){const a=r=>r==="static"?r:Math.max(r!=null?r:1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...r)=>a(s(...r)):a(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},mE=(e,t)=>e.isLoading&&e.isFetching&&!t,pE=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Yb=(e,t,a)=>t.fetchOptimistic(e).catch(()=>{a.clearReset()});function gE(e,t,a){var v,b,_,S;const s=rE(),r=cE(),c=dl(),o=c.defaultQueryOptions(e);(b=(v=c.getDefaultOptions().queries)==null?void 0:v._experimental_beforeQuery)==null||b.call(v,o);const u=c.getQueryCache().get(o.queryHash);o._optimisticResults=s?"isRestoring":"optimistic",hE(o),uE(o,r,u),dE(r);const h=!c.getQueryCache().get(o.queryHash),[m]=A.useState(()=>new t(c,o)),g=m.getOptimisticResult(o),p=!s&&e.subscribed!==!1;if(A.useSyncExternalStore(A.useCallback(w=>{const C=p?m.subscribe(Gt.batchCalls(w)):fn;return m.updateResult(),C},[m,p]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),A.useEffect(()=>{m.setOptions(o)},[o,m]),pE(o,g))throw Yb(o,m,r);if(fE({result:g,errorResetBoundary:r,throwOnError:o.throwOnError,query:u,suspense:o.suspense}))throw g.error;if((S=(_=c.getDefaultOptions().queries)==null?void 0:_._experimental_afterQuery)==null||S.call(_,o,g),o.experimental_prefetchInRender&&!Vs&&mE(g,s)){const w=h?Yb(o,m,r):u==null?void 0:u.promise;w==null||w.catch(fn).finally(()=>{m.updateResult()})}return o.notifyOnChangeProps?g:m.trackResult(g)}function fl(e,t){return gE(e,Qk)}function nd(e,t){const a=dl(),[s]=A.useState(()=>new nE(a,e));A.useEffect(()=>{s.setOptions(e)},[s,e]);const r=A.useSyncExternalStore(A.useCallback(o=>s.subscribe(Gt.batchCalls(o)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),c=A.useCallback((o,u)=>{s.mutate(o,u).catch(fn)},[s]);if(r.error&&Np(s.options.throwOnError,[r.error]))throw r.error;return K(T({},r),{mutate:c,mutateAsync:r.mutate})}const yE="dr_auth_token";function vE(){const e=window.fetch;window.fetch=function(...t){const[a,s]=t,r=typeof window!="undefined"?localStorage.getItem(yE):null,c=s||{};if(r&&!c.headers)c.headers={Authorization:`Bearer ${r}`};else if(r&&c.headers){const o=c.headers;o.Authorization||(o.Authorization=`Bearer ${r}`)}return e(a,c)},console.log("[FetchInterceptor] Installed - will add Authorization header to all requests")}var bE={};class xE{constructor(t){ht(this,"baseUrl");ht(this,"token",null);this.baseUrl=t,this.loadToken()}loadToken(){typeof window!="undefined"&&(this.token=localStorage.getItem("dr_auth_token"))}setToken(t){this.token=t}getBaseUrl(){return this.baseUrl}getHeaders(){const t={"Content-Type":"application/json"};return this.token&&(t.Authorization=`Bearer ${this.token}`),t}gethealth(){return Ue(this,null,function*(){const s=`${this.getBaseUrl()}/health`,r={method:"GET",headers:this.getHeaders(),credentials:"include"},c=yield fetch(s,r);if(!c.ok){const o=yield c.text();throw new Error(`GET /health failed: ${c.status} ${o}`)}return c.json()})}getapimodel(){return Ue(this,null,function*(){const s=`${this.getBaseUrl()}/api/model`,r={method:"GET",headers:this.getHeaders(),credentials:"include"},c=yield fetch(s,r);if(!c.ok){const o=yield c.text();throw new Error(`GET /api/model failed: ${c.status} ${o}`)}return c.json()})}getapilayerslayerName(t){return Ue(this,null,function*(){const a=this.getBaseUrl(),s=`/api/layers/${encodeURIComponent(t)}`,r=`${a}${s}`,c={method:"GET",headers:this.getHeaders(),credentials:"include"},o=yield fetch(r,c);if(!o.ok){const u=yield o.text();throw new Error(`GET /api/layers/:layerName failed: ${o.status} ${u}`)}return o.json()})}getapispec(){return Ue(this,null,function*(){const s=`${this.getBaseUrl()}/api/spec`,r={method:"GET",headers:this.getHeaders(),credentials:"include"},c=yield fetch(s,r);if(!c.ok){const o=yield c.text();throw new Error(`GET /api/spec failed: ${c.status} ${o}`)}return c.json()})}getapiannotations(t){return Ue(this,null,function*(){const a=this.getBaseUrl(),s="/api/annotations",r=new URLSearchParams;t&&Object.entries(t).forEach(([h,m])=>{m!=null&&r.append(h,m)});const c=r.toString()?`${a}${s}?${r.toString()}`:`${a}${s}`,o={method:"GET",headers:this.getHeaders(),credentials:"include"},u=yield fetch(c,o);if(!u.ok){const h=yield u.text();throw new Error(`GET /api/annotations failed: ${u.status} ${h}`)}return u.json()})}postapiannotations(t){return Ue(this,null,function*(){const r=`${this.getBaseUrl()}/api/annotations`,c={method:"POST",headers:this.getHeaders(),credentials:"include"};t&&(c.body=JSON.stringify(t));const o=yield fetch(r,c);if(!o.ok){const u=yield o.text();throw new Error(`POST /api/annotations failed: ${o.status} ${u}`)}return o.json()})}getapiannotationsannotationId(t){return Ue(this,null,function*(){const a=this.getBaseUrl(),s=`/api/annotations/${encodeURIComponent(t)}`,r=`${a}${s}`,c={method:"GET",headers:this.getHeaders(),credentials:"include"},o=yield fetch(r,c);if(!o.ok){const u=yield o.text();throw new Error(`GET /api/annotations/:annotationId failed: ${o.status} ${u}`)}return o.json()})}putapiannotationsannotationId(t,a){return Ue(this,null,function*(){const s=this.getBaseUrl(),r=`/api/annotations/${encodeURIComponent(t)}`,c=`${s}${r}`,o={method:"PUT",headers:this.getHeaders(),credentials:"include"};a&&(o.body=JSON.stringify(a));const u=yield fetch(c,o);if(!u.ok){const h=yield u.text();throw new Error(`PUT /api/annotations/:annotationId failed: ${u.status} ${h}`)}return u.json()})}patchapiannotationsannotationId(t,a){return Ue(this,null,function*(){const s=this.getBaseUrl(),r=`/api/annotations/${encodeURIComponent(t)}`,c=`${s}${r}`,o={method:"PATCH",headers:this.getHeaders(),credentials:"include"};a&&(o.body=JSON.stringify(a));const u=yield fetch(c,o);if(!u.ok){const h=yield u.text();throw new Error(`PATCH /api/annotations/:annotationId failed: ${u.status} ${h}`)}return u.json()})}deleteapiannotationsannotationId(t){return Ue(this,null,function*(){const a=this.getBaseUrl(),s=`/api/annotations/${encodeURIComponent(t)}`,r=`${a}${s}`,c={method:"DELETE",headers:this.getHeaders(),credentials:"include"},o=yield fetch(r,c);if(!o.ok){const u=yield o.text();throw new Error(`DELETE /api/annotations/:annotationId failed: ${o.status} ${u}`)}if(o.status!==204)return o.json()})}getapiannotationsannotationIdreplies(t){return Ue(this,null,function*(){const a=this.getBaseUrl(),s=`/api/annotations/${encodeURIComponent(t)}/replies`,r=`${a}${s}`,c={method:"GET",headers:this.getHeaders(),credentials:"include"},o=yield fetch(r,c);if(!o.ok){const u=yield o.text();throw new Error(`GET /api/annotations/:annotationId/replies failed: ${o.status} ${u}`)}return o.json()})}postapiannotationsannotationIdreplies(t,a){return Ue(this,null,function*(){const s=this.getBaseUrl(),r=`/api/annotations/${encodeURIComponent(t)}/replies`,c=`${s}${r}`,o={method:"POST",headers:this.getHeaders(),credentials:"include"};a&&(o.body=JSON.stringify(a));const u=yield fetch(c,o);if(!u.ok){const h=yield u.text();throw new Error(`POST /api/annotations/:annotationId/replies failed: ${u.status} ${h}`)}return u.json()})}getapichangesets(){return Ue(this,null,function*(){const s=`${this.getBaseUrl()}/api/changesets`,r={method:"GET",headers:this.getHeaders(),credentials:"include"},c=yield fetch(s,r);if(!c.ok){const o=yield c.text();throw new Error(`GET /api/changesets failed: ${c.status} ${o}`)}return c.json()})}getapichangesetschangesetId(t){return Ue(this,null,function*(){const a=this.getBaseUrl(),s=`/api/changesets/${encodeURIComponent(t)}`,r=`${a}${s}`,c={method:"GET",headers:this.getHeaders(),credentials:"include"},o=yield fetch(r,c);if(!o.ok){const u=yield o.text();throw new Error(`GET /api/changesets/:changesetId failed: ${o.status} ${u}`)}return o.json()})}}let Jh=null;function Ks(e){if(!Jh){const t=typeof window!="undefined"?window.location.origin:bE.API_URL||"http://localhost:8080";Jh=new xE(t)}return Jh}const ad=Ks();function _E(e){return fl({queryKey:["getapimodel"],queryFn:()=>ad.getapimodel()})}function SE(e){return fl({queryKey:["getapispec"],queryFn:()=>ad.getapispec()})}function wE(e){return fl({queryKey:["getapichangesets"],queryFn:()=>ad.getapichangesets()})}function CE(e,t){return fl(T({queryKey:["getapichangesetschangesetId",e],queryFn:()=>ad.getapichangesetschangesetId(e)},t))}function NE(){return new iE({defaultOptions:{queries:{staleTime:1e3*60*5,gcTime:1e3*60*10,retry:1},mutations:{retry:0}}})}const ko="dr_auth_token";function Gb(){if(typeof window=="undefined")return null;const e=localStorage.getItem(ko);if(e)return console.log("[Auth] Token loaded from localStorage"),e;const t=jE();return t?(console.log("[Auth] Token loaded from cookie"),t):(console.log("[Auth] No token found - running in development mode"),null)}function jE(){if(typeof document=="undefined")return null;const e=document.cookie.split(";").map(t=>t.trim()).find(t=>t.startsWith(`${ko}=`));if(!e)return null;try{return decodeURIComponent(e.split("=")[1]||"")}catch(t){return e.split("=")[1]||null}}const Ep=Qu((e,t)=>({token:Gb(),isAuthenticated:!!Gb(),setToken:a=>{typeof window!="undefined"&&(a?localStorage.setItem(ko,a):localStorage.removeItem(ko)),e({token:a,isAuthenticated:!!a}),console.log("[Auth] Token updated:",a?"present":"cleared")},clearToken:()=>{typeof window!="undefined"&&localStorage.removeItem(ko),e({token:null,isAuthenticated:!1}),console.log("[Auth] Token cleared from store and localStorage")},getAuthHeaders:()=>{const{token:a}=t();return a?{Authorization:`Bearer ${a}`}:{}},getAuthQueryParams:()=>{const{token:a}=t();return a?{token:a}:{}}}));function kE(){const e=td({strict:!1}),t=Ep(a=>a.setToken);return A.useEffect(()=>{const a=e==null?void 0:e.token,s=window.location.hash.slice(1)||"/model/graph";a&&(console.log("[AuthRoute] Storing token in localStorage"),localStorage.setItem("dr_auth_token",a),t(a),console.log("[AuthRoute] Updated authStore with new token")),window.location.hash=s},[e==null?void 0:e.token,t]),f.jsx("div",{className:"flex items-center justify-center h-screen",children:f.jsx("p",{className:"text-gray-500","data-testid":"auth-loading",children:"Authenticating..."})})}const EE={dashboard:"M3 3 L10 3 L10 10 L3 10 Z M14 3 L21 3 L21 10 L14 10 Z M14 14 L21 14 L21 21 L14 21 Z M3 14 L10 14 L10 21 L3 21 Z",schema:"M3 12 L9 6 L21 6 M3 12 L9 18 L21 18 M3 12 C4.7 12 6 10.3 6 8 C6 5.7 4.7 4 3 4 C1.3 4 0 5.7 0 8 C0 10.3 1.3 12 3 12 M21 6 C22.7 6 24 4.3 24 2 C24 0.3 22.7 0 21 0 C19.3 0 18 0.3 18 2 C18 4.3 19.3 6 21 6 M21 18 C22.7 18 24 16.3 24 14 C24 12.3 22.7 11 21 11 C19.3 11 18 12.3 18 14 C18 16.3 19.3 18 21 18",data:"M12 5 C18.6 5 24 6.3 24 8 L24 8 L24 16 C24 17.7 18.6 19 12 19 C5.4 19 0 17.7 0 16 L0 8 C0 6.3 5.4 5 12 5 M3 5 L3 14 L21 14 L21 5 M3 11 L3 19 L21 19 L21 11",pipeline:"M2 12 L6 12 L6 6 L18 6 L18 12 L22 12 M8 12 L16 12 M12 9 L15 12 L12 15",graph:"M6 10 C8.8 10 11 7.8 11 5 C11 2.2 8.8 0 6 0 C3.2 0 1 2.2 1 5 C1 7.8 3.2 10 6 10 M18 10 C20.8 10 23 7.8 23 5 C23 2.2 20.8 0 18 0 C15.2 0 13 2.2 13 5 C13 7.8 15.2 10 18 10 M12 18 C14.8 18 17 15.8 17 13 C17 10.2 14.8 8 12 8 C9.2 8 7 10.2 7 13 C7 15.8 9.2 18 12 18 M8 8 L16 16 M16 8 L8 16 M12 9 L12 15",search:"M10.6 14.8 C14.2 14.8 17.2 11.5 17.2 7.4 C17.2 3 14.2 0 10.6 0 C6.9 0 3 3 3 7.4 C3 11.5 6.9 14.8 10.6 14.8 M19.8 19.2 L16.7 16.3",bell:"M6.55 9.7 C6.55 3.7 11.15 0 11.15 0 C11.15 0 15.75 3.7 15.75 9.7 C15.75 12 17.25 13.4 17.25 13.4 L4.6 13.4 C4.6 13.4 6.55 12 6.55 9.7 M9.4 19.4 C9.73 19.8 10.8 20.1 10.95 20.1 C11.1 20.1 12.18 19.8 12.5 19.4",plus:"M12 5 L12 19 M5 12 L19 12",check:"M2 12 L8 18 L22 4",x:"M3 3 L21 21 M21 3 L3 21",chevronDown:"M6 9 L12 15 L18 9",chevronUp:"M18 15 L12 9 L6 15",chevronLeft:"M15 6 L9 12 L15 18",chevronRight:"M9 6 L15 12 L9 18",menu:"M3 6 L21 6 M3 12 L21 12 M3 18 L21 18",settings:"M12 1.5 C12.4 1.5 12.7 1.8 12.7 2.2 L12.7 4 C14.2 4.4 15.6 5.3 16.7 6.6 L18 5.4 C18.4 5.1 19 5.1 19.3 5.4 C19.7 5.7 19.7 6.3 19.3 6.6 L18 7.8 C19.2 8.9 20.2 10.3 20.6 12 L22.4 12 C22.9 12 23.2 12.3 23.2 12.8 C23.2 13.3 22.9 13.6 22.4 13.6 L20.6 13.6 C20.2 15.3 19.2 16.7 18 17.8 L19.3 19 C19.7 19.3 19.7 19.9 19.3 20.2 C19 20.5 18.4 20.5 18 20.2 L16.7 19 C15.6 20.3 14.2 21.2 12.7 21.6 L12.7 23.4 C12.7 23.8 12.4 24.1 12 24.1 C11.6 24.1 11.3 23.8 11.3 23.4 L11.3 21.6 C9.8 21.2 8.4 20.3 7.3 19 L6 20.2 C5.6 20.5 5 20.5 4.7 20.2 C4.3 19.9 4.3 19.3 4.7 19 L6 17.8 C4.8 16.7 3.8 15.3 3.4 13.6 L1.6 13.6 C1.1 13.6 0.8 13.3 0.8 12.8 C0.8 12.3 1.1 12 1.6 12 L3.4 12 C3.8 10.3 4.8 8.9 6 7.8 L4.7 6.6 C4.3 6.3 4.3 5.7 4.7 5.4 C5 5.1 5.6 5.1 6 5.4 L7.3 6.6 C8.4 5.3 9.8 4.4 11.3 4 L11.3 2.2 C11.3 1.8 11.6 1.5 12 1.5 Z M12 8.5 C10.6 8.5 9.5 9.6 9.5 11 C9.5 12.4 10.6 13.5 12 13.5 C13.4 13.5 14.5 12.4 14.5 11 C14.5 9.6 13.4 8.5 12 8.5 Z",alert:"M12 2 L2 20 L22 20 Z M12 9 L12 13 M12 17 L12.01 17",trash:"M3 6 L3 20 C3 21.1 3.9 22 5 22 L19 22 C20.1 22 21 21.1 21 20 L21 6 M1 6 L23 6 M7 6 L7 4 C7 2.9 7.9 2 9 2 L15 2 C16.1 2 17 2.9 17 4 L17 6 M9 11 L9 17 M15 11 L15 17",edit:"M3 17.25 L3 21 L6.75 21 L17.81 9.94 L14.06 6.19 Z M20.71 7.04 C21.1 6.65 21.1 6.02 20.71 5.63 L18.37 3.29 C17.98 2.9 17.35 2.9 16.96 3.29 L15.12 5.12 L18.87 8.87 Z",download:"M12 2 L12 13 M5 10 L12 17 L19 10",upload:"M12 22 L12 11 M5 14 L12 7 L19 14",eye:"M12 5 C7 5 2.73 8.11 1 12.46 C2.73 16.89 7 20 12 20 C17 20 21.27 16.89 23 12.46 C21.27 8.11 17 5 12 5 Z M12 16 C14.2 16 16 14.2 16 12 C16 9.8 14.2 8 12 8 C9.8 8 8 9.8 8 12 C8 14.2 9.8 16 12 16 Z",eyeOff:"M12 5.69 C8.5 5.69 5.2 7.6 3.2 10.4 M21 19 L2 2 M9.88 9.88 C9.4 10.5 9 11.2 9 12 C9 14.21 10.79 16 13 16 C13.8 16 14.5 15.6 15.12 15.12 M18.8 10.4 C20.8 7.6 17.5 5.69 12 5.69",clock:"M12 2 C6.48 2 2 6.48 2 12 C2 17.52 6.48 22 12 22 C17.52 22 22 17.52 22 12 C22 6.48 17.52 2 12 2 Z M12 20 C7.58 20 4 16.42 4 12 C4 7.58 7.58 4 12 4 C16.42 4 20 7.58 20 12 C20 16.42 16.42 20 12 20 Z M13 7 L11 7 L11 13 L16.25 15.85 L17 14.32 L13 12 Z",calendar:"M5 2 L5 4 L19 4 L19 2 M3 4 L3 20 C3 21.1 3.9 22 5 22 L19 22 C20.1 22 21 21.1 21 20 L21 4 M7 11 L7 13 L9 13 L9 11 L7 11 Z M12 11 L12 13 L14 13 L14 11 L12 11 Z M17 11 L17 13 L19 13 L19 11 L17 11 Z",filter:"M3 6 L21 6 L18 13 L18 20 L6 20 L6 13 Z",link:"M10 11 C10.8 10.3 12 10.2 12.7 10.2 L20 10.2 C21 10.2 21.8 11 21.8 12 L21.8 19 C21.8 20 21 20.8 20 20.8 L12.7 20.8 C11.7 20.8 10.9 20 10.9 19 L10.9 12 C10.9 11.9 10.91 11.8 10.92 11.7 M7 11 C7.8 10.3 6.5 10.2 5.8 10.2 L1 10.2 C0.1 10.2 0.2 11 0.2 12 L0.2 19 C0.2 20 0.9 20.8 1.8 20.8 L5.8 20.8 C6.8 20.8 7.6 20 7.6 19 L7.6 12 C7.6 11.9 7.59 11.8 7.58 11.7",lock:"M7 10 L7 7 C7 4.24 9.24 2 12 2 C14.76 2 17 4.24 17 7 L17 10 M5 10 L19 10 L19 20 C19 21.1 18.1 22 17 22 L7 22 C5.9 22 5 21.1 5 20 Z",unlock:"M7 10 L19 10 L19 20 C19 21.1 18.1 22 17 22 L7 22 C5.9 22 5 21.1 5 20 L5 10 L5 7 C5 4.24 7.24 2 10 2 C12.76 2 15 4.24 15 7 L13 7 C13 5.34 11.66 4 10 4 C8.34 4 7 5.34 7 7 Z",user:"M12 12 C13.66 12 15 10.66 15 9 C15 7.34 13.66 6 12 6 C10.34 6 9 7.34 9 9 C9 10.66 10.34 12 12 12 Z M12 22 C16.42 22 21 20 21 16 L21 14 C21 11.79 19.21 10 17 10 L7 10 C4.79 10 3 11.79 3 14 L3 16 C3 20 7.58 22 12 22 Z",copy:"M16 1 L4 1 C2.9 1 2 1.9 2 3 L2 17 L4 17 L4 3 L16 3 Z M20 5 L8 5 C6.9 5 6 5.9 6 7 L6 21 C6 22.1 6.9 23 8 23 L20 23 C21.1 23 22 22.1 22 21 L22 7 C22 5.9 21.1 5 20 5 Z",info:"M12 2 C6.48 2 2 6.48 2 12 C2 17.52 6.48 22 12 22 C17.52 22 22 17.52 22 12 C22 6.48 17.52 2 12 2 Z M13 17 L11 17 L11 11 L13 11 Z M13 9 L11 9 L11 7 L13 7 Z",help:"M12 2 C6.48 2 2 6.48 2 12 C2 17.52 6.48 22 12 22 C17.52 22 22 17.52 22 12 C22 6.48 17.52 2 12 2 Z M13 19 L11 19 L11 17 L13 17 Z M15.07 10.25 C14.29 11.29 13.5 12 13 12.9 L13 14 L11 14 L11 13 C11 11.52 11.79 10.29 12.93 9.07 C13.62 8.29 14.29 7.5 14.29 6.5 C14.29 5.42 13.47 4.6 12.4 4.6 C11.4 4.6 10.6 5.36 10.6 6.3 L8.6 6.2 C8.72 4.5 10.09 3.1 12.4 3.1 C14.84 3.1 16.3 4.5 16.3 6.42 C16.3 7.8 15.66 8.9 15.07 10.25 Z",spinner:"M12 2 C6.48 2 2 6.48 2 12 C2 17.52 6.48 22 12 22 C17.52 22 22 17.52 22 12 M12 2 C6.48 2 2 6.48 2 12",loading:"M12 2 C6.48 2 2 6.48 2 12",moreVertical:"M12 8 C13.1 8 14 7.1 14 6 C14 4.9 13.1 4 12 4 C10.9 4 10 4.9 10 6 C10 7.1 10.9 8 12 8 Z M12 14 C13.1 14 14 13.1 14 12 C14 10.9 13.1 10 12 10 C10.9 10 10 10.9 10 12 C10 13.1 10.9 14 12 14 Z M12 20 C13.1 20 14 19.1 14 18 C14 16.9 13.1 16 12 16 C10.9 16 10 16.9 10 18 C10 19.1 10.9 20 12 20 Z",moreHorizontal:"M6 10 C4.9 10 4 10.9 4 12 C4 13.1 4.9 14 6 14 C7.1 14 8 13.1 8 12 C8 10.9 7.1 10 6 10 Z M18 10 C16.9 10 16 10.9 16 12 C16 13.1 16.9 14 18 14 C19.1 14 20 13.1 20 12 C20 10.9 19.1 10 18 10 Z M12 10 C10.9 10 10 10.9 10 12 C10 13.1 10.9 14 12 14 C13.1 14 14 13.1 14 12 C14 10.9 13.1 10 12 10 Z",reload:"M7 7 C4.24 7 2 9.24 2 12 C2 14.56 3.68 16.73 6 17.73 L6 15.95 C4.29 15.16 3 13.32 3 11.13 C3 8.82 4.82 7 7 7 Z M17 7 C19.76 7 22 9.24 22 12 C22 14.13 20.71 15.97 18.7 16.76 L18.7 18.54 C21.32 17.54 23 15.56 23 13 C23 10.24 20.76 8 18 8 Z M11.5 5 L14.5 8 L8.5 8 Z M8.5 16 L14.5 16 L11.5 19 Z",arrowRight:"M5 12 L19 12 M13 6 L19 12 L13 18",arrowLeft:"M19 12 L5 12 M11 6 L5 12 L11 18",arrowUp:"M12 19 L12 5 M6 11 L12 5 L18 11",arrowDown:"M12 5 L12 19 M6 13 L12 19 L18 13",star:"M12 2 L15.09 10.26 L24 10.26 L17.55 15.13 L19.64 23.39 L12 18.53 L4.36 23.39 L6.45 15.13 L0 10.26 L8.91 10.26 Z",heart:"M20.84 4.61 C20.02 3.78 18.98 3.37 17.93 3.37 C16.88 3.37 15.84 3.78 15.02 4.61 L12 7.63 L8.98 4.61 C7.30 2.92 4.71 2.92 3.02 4.61 C1.33 6.30 1.33 8.88 3.02 10.57 L12 19.58 L20.99 10.57 C22.68 8.88 22.68 6.30 20.84 4.61 Z",palette:"M12 2 C6.48 2 2 6.48 2 12 C2 17.52 6.48 22 12 22 C17.52 22 22 17.52 22 12 C22 6.48 17.52 2 12 2 Z M7 12 C8.1 12 9 11.1 9 10 C9 8.9 8.1 8 7 8 C5.9 8 5 8.9 5 10 C5 11.1 5.9 12 7 12 Z M17 12 C18.1 12 19 11.1 19 10 C19 8.9 18.1 8 17 8 C15.9 8 15 8.9 15 10 C15 11.1 15.9 12 17 12 Z M12 17 C10.9 17 10 16.1 10 15 C10 13.9 10.9 13 12 13 C13.1 13 14 13.9 14 15 C14 16.1 13.1 17 12 17 Z M7 17 C5.9 17 5 16.1 5 15 C5 13.9 5.9 13 7 13 C8.1 13 9 13.9 9 15 C9 16.1 8.1 17 7 17 Z M17 17 C15.9 17 15 16.1 15 15 C15 13.9 15.9 13 17 13 C18.1 13 19 13.9 19 15 C19 16.1 18.1 17 17 17 Z",component:"M5 3 L19 3 L19 9 L5 9 Z M5 11 L19 11 L19 17 L5 17 Z M3 20 L21 20",table:"M3 4 L21 4 M3 4 L3 20 L21 20 L21 4 M3 8 L21 8 M3 12 L21 12 M3 16 L21 16 M8 4 L8 20 M13 4 L13 20 M18 4 L18 20",layout:"M3 3 L21 3 L21 21 L3 21 Z M3 8 L21 8 M3 3 L3 21 M8 8 L8 21",moon:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z",sun:"M12 3v2M12 19v2M5.64 5.64l1.42 1.42M16.95 16.95l1.41 1.41M3 12h2M19 12h2M5.64 18.36l1.41-1.41M16.95 7.05l1.41-1.41M12 7a5 5 0 1 0 0 10A5 5 0 0 0 12 7z","bar-chart":"M3 3 L3 20 L21 20 M5 16 L5 9 M12 16 L12 5 M19 16 L19 8","trending-up":"M23 6 L13.5 15.5 M23 6 L23 13 L16 13 M1 23 L6.5 17.5 L13 24 L23 6","trending-down":"M23 18 L13.5 8.5 M23 18 L23 11 L16 11 M1 1 L6.5 6.5 L13 0 L23 18",send:"M16 8 L2 5 L9.5 12 L2 19 L16 16 M7 12 L16 12",bot:"M12 2 C6.48 2 2 6.48 2 12 C2 17.52 6.48 22 12 22 C17.52 22 22 17.52 22 12 C22 6.48 17.52 2 12 2 Z M7 8 L7 10 L9 10 L9 8 Z M15 8 L15 10 L17 10 L17 8 Z M9 14 L15 14 M12 14 L12 18",paperclip:"M12.5 2 C9.46 2 7 4.46 7 7.5 C7 10.54 9.46 13 12.5 13 L18 13 C18.55 13 19 12.55 19 12 C19 11.45 18.55 11 18 11 L12.5 11 C10.57 11 9 9.43 9 7.5 C9 5.57 10.57 4 12.5 4 C14.43 4 16 5.57 16 7.5 L16 15 C16 18.31 13.31 21 10 21 C6.69 21 4 18.31 4 15 L4 7 C4 5.9 4.9 5 6 5 C7.1 5 8 5.9 8 7 L8 15 C8 16.1 8.9 17 10 17 C11.1 17 12 16.1 12 15 L12 7.5","pie-chart":"M21.21 15.89 L12 12 L12 2.69 A10 10 0 0 1 21.21 15.89 M12 12 L5.5 5.5 A10 10 0 0 0 2 12 M2 12 A10 10 0 0 0 12 22 A10 10 0 0 0 12 12",slash:"M21 3 L3 21",file:"M14 2 L6 2 C4.9 2 4 2.9 4 4 L4 20 C4 21.1 4.9 22 6 22 L18 22 C19.1 22 20 21.1 20 20 L20 8 Z M14 2 L14 8 L20 8 M16 13 L8 13 M16 17 L8 17 M10 9 L8 9",zap:"M13 2 L3 14 L12 14 L11 22 L21 10 L12 10 Z",hardDrive:"M22 12 L2 12 M2 9 C2 7.9 2.9 7 4 7 L20 7 C21.1 7 22 7.9 22 9 L22 19 C22 20.1 21.1 21 20 21 L4 21 C2.9 21 2 20.1 2 19 Z M6 17 L6.01 17",folder:"M20 20 C21.1 20 22 19.1 22 18 L22 8 C22 6.9 21.1 6 20 6 L12.1 6 C11.43 6 10.8 5.68 10.41 5.13 L9.6 3.9 C9.22 3.34 8.59 3 7.93 3 L4 3 C2.9 3 2 3.9 2 5 L2 18 C2 19.1 2.9 20 4 20 Z",tag:"M12.59 2.59 C12.21 2.21 11.7 2 11.17 2 L4 2 C2.9 2 2 2.9 2 4 L2 11.17 C2 11.7 2.21 12.21 2.59 12.59 L11.29 21.29 C12.07 22.07 13.34 22.07 14.12 21.29 L20.7 14.71 C21.48 13.93 21.48 12.66 20.7 11.88 Z M7.5 7.5 L7.51 7.5",gitBranch:"M6 3 L6 15 M6 6 C7.66 6 9 4.66 9 3 C9 1.34 7.66 0 6 0 C4.34 0 3 1.34 3 3 C3 4.66 4.34 6 6 6 Z M6 24 C7.66 24 9 22.66 9 21 C9 19.34 7.66 18 6 18 C4.34 18 3 19.34 3 21 C3 22.66 4.34 24 6 24 Z M18 9 C19.66 9 21 7.66 21 6 C21 4.34 19.66 3 18 3 C16.34 3 15 4.34 15 6 C15 7.66 16.34 9 18 9 Z M18 9 C18 13 15 15 9 15",image:"M3 3 L21 3 L21 21 L3 21 Z M8.5 10 C9.6 10 10.5 9.1 10.5 8 C10.5 6.9 9.6 6 8.5 6 C7.4 6 6.5 6.9 6.5 8 C6.5 9.1 7.4 10 8.5 10 Z M21 15 L16 10 L5 21",code:"M9 18 L3 12 L9 6 M15 6 L21 12 L15 18",map:"M9 3 L3 5 L3 19 L9 17 M9 3 L15 5 M9 3 L9 17 M15 5 L21 3 L21 17 L15 19 M15 5 L15 19 M9 17 L15 19",sparkles:"M12 2 L14 9 L21 11 L14 13 L12 20 L10 13 L3 11 L10 9 Z M19 3 L20 5.5 L22.5 6.5 L20 7.5 L19 10 L18 7.5 L15.5 6.5 L18 5.5 Z",share:"M18 8 C19.66 8 21 6.66 21 5 C21 3.34 19.66 2 18 2 C16.34 2 15 3.34 15 5 C15 6.66 16.34 8 18 8 Z M6 15 C7.66 15 9 13.66 9 12 C9 10.34 7.66 9 6 9 C4.34 9 3 10.34 3 12 C3 13.66 4.34 15 6 15 Z M18 22 C19.66 22 21 20.66 21 19 C21 17.34 19.66 16 18 16 C16.34 16 15 17.34 15 19 C15 20.66 16.34 22 18 22 Z M8.59 13.51 L15.42 17.49 M15.41 6.51 L8.59 10.49",ellipsis:"M6 12 C6 13.1 5.1 14 4 14 C2.9 14 2 13.1 2 12 C2 10.9 2.9 10 4 10 C5.1 10 6 10.9 6 12 Z M14 12 C14 13.1 13.1 14 12 14 C10.9 14 10 13.1 10 12 C10 10.9 10.9 10 12 10 C13.1 10 14 10.9 14 12 Z M22 12 C22 13.1 21.1 14 20 14 C18.9 14 18 13.1 18 12 C18 10.9 18.9 10 20 10 C21.1 10 22 10.9 22 12 Z"},Ce=ie.forwardRef((o,c)=>{var u=o,{name:e,size:t=24,className:a="","aria-label":s}=u,r=de(u,["name","size","className","aria-label"]);const h=EE[e];return h?f.jsx("svg",K(T({ref:c,viewBox:"0 0 24 24",width:t,height:t,fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":s?void 0:!0,"aria-label":s,className:a},r),{children:f.jsx("path",{d:h})})):(console.warn(`Icon "${e}" does not exist in ICONS map`),null)});Ce.displayName="Icon";function RE(e){return e.split(" ").slice(0,2).map(t=>t[0]).join("").toUpperCase()}const So={amber:"linear-gradient(135deg, rgb(var(--accent-primary)), rgb(var(--accent-primary-deep)))",emerald:"linear-gradient(135deg, rgb(var(--status-emerald)), rgb(var(--semantic-emerald-fg)))",rose:"linear-gradient(135deg, rgb(var(--status-rose)), rgb(var(--status-rose-deep)))",cyan:"linear-gradient(135deg, rgb(var(--status-cyan)), rgb(var(--status-cyan-deep)))",violet:"linear-gradient(135deg, rgb(var(--status-violet)), rgb(var(--semantic-violet-fg)))",neutral:"linear-gradient(135deg, rgb(var(--status-neutral)), rgb(var(--semantic-neutral-fg)))"},Kb=Object.keys(So);function TE(e){let t=0;for(let a=0;a<e.length;a++){const s=e.charCodeAt(a);t=(t<<5)-t+s,t=t&t}return Math.abs(t)}function ME(e){const t=TE(e)%Kb.length;return Kb[t]}function AE(e,t){if(e&&e in So)return So[e];if(e)return e;if(t){const a=ME(t);return So[a]}return So.amber}const LE=ie.forwardRef((p,g)=>{var v=p,{name:e,src:t,size:a="md",shape:s="circle",status:r,color:c,decorative:o,className:u="",style:h}=v,m=de(v,["name","src","size","shape","status","color","decorative","className","style"]);const[b,_]=A.useState(!1),S=RE(e),w=!t||b,C=["avatar",`avatar--${a}`,`avatar--${s}`,u].filter(Boolean).join(" "),R=w?{background:AE(c,e)}:{display:"none"},j=w?{display:"none"}:{};return f.jsxs("div",K(T({ref:g,className:C,style:h,role:o?void 0:"img","aria-label":o?void 0:r?`${e} (${r})`:e,"aria-hidden":o?"true":void 0},m),{children:[f.jsx("div",{className:"avatar__initials",style:R,children:S}),t&&f.jsx("img",{className:"avatar__image",src:t,alt:"",onError:()=>_(!0),style:j}),r&&f.jsx("div",{className:`avatar__status avatar__status--${r}`,"aria-label":r})]}))});LE.displayName="Avatar";const rn=ie.forwardRef((h,u)=>{var m=h,{variant:e="primary",size:t="md",icon:a,className:s="",disabled:r,type:c="button"}=m,o=de(m,["variant","size","icon","className","disabled","type"]);const g=["btn",`btn--${e}`,`btn--${t}`,a?"btn--icon":"",s].filter(Boolean).join(" ");return f.jsx("button",T({ref:u,type:c,disabled:r,className:g},o))});rn.displayName="Button";const Nn=ie.forwardRef((o,c)=>{var u=o,{variant:e="neutral",form:t="default",className:a="",children:s}=u,r=de(u,["variant","form","className","children"]);const h=["chip",`chip--${t}`,t==="default"&&`chip--${e}`,a].filter(Boolean).join(" ");return f.jsxs("span",K(T({ref:c,className:h},r),{children:[t==="default"&&f.jsx("span",{className:"chip__dot"}),t==="env"&&f.jsx("span",{className:"chip__dot chip__dot--env"}),s]}))});Nn.displayName="Chip";const Rp=ie.forwardRef((c,r)=>{var o=c,{color:e="cyan",pulse:t=!1,className:a=""}=o,s=de(o,["color","pulse","className"]);const u=["badge",`badge--${e}`,t&&"badge--pulse",a].filter(Boolean).join(" ");return f.jsx("span",T({ref:r,className:u},s))});Rp.displayName="Badge";const l_=ie.forwardRef((o,c)=>{var u=o,{color:e="cyan",pulse:t=!1,className:a="",role:s="img"}=u,r=de(u,["color","pulse","className","role"]);const h=["status-badge",`status-badge--${e}`,t&&"status-badge--pulse",a].filter(Boolean).join(" ");return f.jsx("div",T({ref:c,role:s,className:h},r))});l_.displayName="StatusBadge";const Oo=ie.forwardRef((c,r)=>{var o=c,{mono:e=!1,error:t=!1,className:a=""}=o,s=de(o,["mono","error","className"]);const u=["text-input",e&&"text-input--mono",t&&"text-input--error",a].filter(Boolean).join(" ");return f.jsx("input",T({type:"text",ref:r,className:u},s))});Oo.displayName="TextInput";const Tp=ie.forwardRef((c,r)=>{var o=c,{mono:e=!1,error:t=!1,className:a=""}=o,s=de(o,["mono","error","className"]);const u=["text-area",e&&"text-area--mono",t&&"text-area--error",a].filter(Boolean).join(" ");return f.jsx("textarea",T({ref:r,className:u},s))});Tp.displayName="TextArea";const DE=ie.forwardRef((c,r)=>{var o=c,{mono:e=!1,error:t=!1,className:a=""}=o,s=de(o,["mono","error","className"]);const u=["number-input",e&&"number-input--mono",t&&"number-input--error",a].filter(Boolean).join(" ");return f.jsx("input",T({ref:r,type:"number",className:u},s))});DE.displayName="NumberInput";const OE="[data-dropdown-item]:not([data-disabled])";function id({triggerRef:e,panelRef:t,isOpen:a,onClose:s,itemSelector:r=OE,restoreFocus:c=!0}){const[o,u]=A.useState(null),h=A.useRef(!1),m=A.useCallback(()=>{const g=t.current;return g?Array.from(g.querySelectorAll(r)).map(p=>p.getAttribute("data-dropdown-item")).filter(p=>p!==null&&p.length>0):[]},[t,r]);return A.useEffect(()=>{var g;if(a&&!h.current){h.current=!0;const p=m();u(v=>{var b;return v&&p.includes(v)?v:(b=p[0])!=null?b:null})}else!a&&h.current&&(h.current=!1,u(null),c&&((g=e.current)==null||g.focus()))},[a,m,c,e]),A.useEffect(()=>{if(!a)return;const g=v=>{const b=v.target,_=e.current,S=t.current;_!=null&&_.contains(b)||S!=null&&S.contains(b)||s()},p=v=>{v.key==="Escape"&&(v.preventDefault(),s())};return document.addEventListener("mousedown",g),document.addEventListener("keydown",p),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",p)}},[a,s,e,t]),A.useEffect(()=>{if(!a)return;const g=e.current,p=t.current,v=b=>{var _;const S=m();if(S.length===0)return;const w=S.indexOf(o!=null?o:""),C=S.length-1,R=(_=b.target)==null?void 0:_.hasAttribute("data-dropdown-item");switch(b.key){case"ArrowDown":{b.preventDefault();const j=w<C?w+1:0;u(S[j]);break}case"ArrowUp":{b.preventDefault();const j=w>0?w-1:C;u(S[j]);break}case"Tab":{if(!R)return;b.preventDefault();const j=b.shiftKey?-1:1,k=(w+j+S.length)%S.length;u(S[k]);break}case"Home":{b.preventDefault(),u(S[0]);break}case"End":{b.preventDefault(),u(S[C]);break}}};return g==null||g.addEventListener("keydown",v),p==null||p.addEventListener("keydown",v),()=>{g==null||g.removeEventListener("keydown",v),p==null||p.removeEventListener("keydown",v)}},[a,o,m,e,t]),{focusedValue:o,setFocusedValue:u}}const sd=(e="bottom-start")=>`dropdown-panel--placement-${e}`,o_=A.createContext(void 0);function c_(e){const t=A.useContext(o_);if(!t)throw new Error(`${e} must be used inside <Select>`);return t}const u_=ie.forwardRef((e,t)=>{var ge;const{placeholder:a="Select…",error:s=!1,disabled:r=!1,id:c,name:o,className:u="",ariaLabel:h,children:m,placement:g="bottom-start"}=e,p=e["data-testid"],v=e.multiple?"multi":"single",b=v==="single"&&e.value!==void 0,_=v==="multi"&&e.values!==void 0,[S,w]=A.useState(v==="single"&&(ge=e.defaultValue)!=null?ge:""),[C,R]=A.useState(()=>{var E;return new Set(v==="multi"?(E=e.defaultValues)!=null?E:[]:[])}),j=A.useMemo(()=>{var E,W;if(v==="single"){const oe=b?(E=e.value)!=null?E:"":S;return oe?new Set([oe]):new Set}return _?new Set((W=e.values)!=null?W:[]):C},[v,b,_,e.value,e.values,S,C]),[k,I]=A.useState(!1),O=A.useRef(null),z=A.useRef(null),B=A.useRef(null),[P,M]=A.useState(new Map),U=A.useCallback((E,W)=>(M(oe=>{if(oe.get(E)===W)return oe;const me=new Map(oe);return me.set(E,W),me}),()=>{M(oe=>{if(!oe.has(E))return oe;const me=new Map(oe);return me.delete(E),me})}),[]),F=A.useCallback(E=>{r||I(E)},[r]),q=A.useCallback(()=>I(!1),[]),{focusedValue:H,setFocusedValue:Y}=id({triggerRef:O,panelRef:z,isOpen:k,onClose:q});A.useEffect(()=>{if(k&&j.size>0&&!H){const E=j.values().next().value;E&&Y(E)}},[k,j,H,Y]);const $=A.useCallback(E=>{var W,oe;if(v==="single")b||w(E),(W=e.onChange)==null||W.call(e,E),I(!1);else{const me=new Set(j);me.has(E)?me.delete(E):me.add(E),_||R(me),(oe=e.onValuesChange)==null||oe.call(e,Array.from(me))}},[v,b,_,j,e]),X={mode:v,isOpen:k,onOpenChange:F,selectedValues:j,onValueChange:$,focusedValue:H,setFocusedValue:Y,registerItem:U,panelRef:z},Z=A.useMemo(()=>{var me,_e;if(j.size===0)return f.jsx("span",{className:"select__placeholder",children:a});if(v==="single"){const be=j.values().next().value;return f.jsx("span",{className:"select__value",children:(me=P.get(be))!=null?me:be})}const E=Array.from(j),W=E[0],oe=(_e=P.get(W))!=null?_e:W;return E.length===1?f.jsx("span",{className:"select__value",children:oe}):f.jsxs("span",{className:"select__value",children:[oe," ",f.jsxs("span",{className:"select__value-count",children:["+",E.length-1]})]})},[j,P,v,a]),fe=E=>{k||(E.key==="ArrowDown"||E.key==="ArrowUp"||E.key==="Enter"||E.key===" ")&&(E.preventDefault(),F(!0))},D=o&&j.size>0?Array.from(j).map(E=>f.jsx("input",{type:"hidden",name:o,value:E},E)):null,he=E=>{O.current=E,typeof t=="function"?t(E):t&&(t.current=E)};return f.jsx(o_.Provider,{value:X,children:f.jsxs("div",{ref:B,className:["select",s&&"select--error",r&&"select--disabled",u].filter(Boolean).join(" "),"data-testid":p,children:[f.jsxs("button",{ref:he,id:c,type:"button",className:"select__trigger","aria-haspopup":"listbox","aria-expanded":k,"aria-invalid":s||void 0,"aria-label":h,disabled:r,onClick:()=>F(!k),onKeyDown:fe,children:[Z,f.jsx(Ce,{name:"chevronDown",size:14,className:`select__chevron ${k?"select__chevron--open":""}`})]}),D,f.jsx("div",{ref:z,role:"listbox","aria-multiselectable":v==="multi"?!0:void 0,className:`dropdown-panel ${sd(g)} select__panel`,hidden:!k,children:m})]})})});u_.displayName="Select";function zE({value:e,icon:t,description:a,disabled:s=!1,children:r}){const{selectedValues:c,onValueChange:o,focusedValue:u,setFocusedValue:h,registerItem:m,mode:g}=c_("Select.Item"),p=A.useRef(null),v=c.has(e),b=u===e;return A.useEffect(()=>m(e,r),[e,r,m]),A.useEffect(()=>{var _;b&&((_=p.current)==null||_.focus())},[b]),f.jsxs("button",{ref:p,type:"button",role:"option","aria-selected":v,tabIndex:b?0:-1,"data-dropdown-item":e,"data-disabled":s||void 0,disabled:s,onClick:()=>o(e),onMouseEnter:()=>!s&&h(e),className:["dropdown-item",v&&"dropdown-item--selected",b&&"dropdown-item--focused",s&&"dropdown-item--disabled"].filter(Boolean).join(" "),children:[t?f.jsx("span",{className:"dropdown-item__leading",children:f.jsx(Ce,{name:t,size:16})}):null,f.jsxs("span",{className:"dropdown-item__body",children:[f.jsx("span",{className:"dropdown-item__label",children:r}),a&&f.jsx("span",{className:"dropdown-item__description",children:a})]}),g==="single"&&v&&f.jsx("span",{className:"dropdown-item__trailing",children:f.jsx(Ce,{name:"check",size:14})})]})}function IE({value:e,description:t,disabled:a=!1,children:s}){const{selectedValues:r,onValueChange:c,focusedValue:o,setFocusedValue:u,registerItem:h}=c_("Select.CheckboxItem"),m=A.useRef(null),g=r.has(e),p=o===e;return A.useEffect(()=>h(e,s),[e,s,h]),A.useEffect(()=>{var v;p&&((v=m.current)==null||v.focus())},[p]),f.jsxs("button",{ref:m,type:"button",role:"option","aria-selected":g,tabIndex:p?0:-1,"data-dropdown-item":e,"data-disabled":a||void 0,disabled:a,onClick:()=>c(e),onMouseEnter:()=>!a&&u(e),className:["dropdown-item",p&&"dropdown-item--focused",a&&"dropdown-item--disabled"].filter(Boolean).join(" "),children:[f.jsx("span",{className:"dropdown-item__leading",children:f.jsx("input",{type:"checkbox",className:"dropdown-item__checkbox",checked:g,readOnly:!0,tabIndex:-1,"aria-hidden":"true"})}),f.jsxs("span",{className:"dropdown-item__body",children:[f.jsx("span",{className:"dropdown-item__label",children:s}),t&&f.jsx("span",{className:"dropdown-item__description",children:t})]})]})}function UE(){return f.jsx("div",{role:"separator",className:"dropdown-separator"})}function BE({children:e}){return f.jsx("div",{className:"dropdown-section-title",children:e})}const $u=Object.assign(u_,{Item:zE,CheckboxItem:IE,Separator:UE,SectionTitle:BE}),FE=ie.forwardRef((c,r)=>{var o=c,{indeterminate:e=!1,className:t="","aria-checked":a}=o,s=de(o,["indeterminate","className","aria-checked"]);const u=ie.useRef(null),h=ie.useCallback(g=>{u.current=g,typeof r=="function"?r(g):r&&(r.current=g)},[r]);ie.useEffect(()=>{u.current&&(u.current.indeterminate=e)},[e]);const m=["tri-state",e&&"tri-state--indeterminate",t].filter(Boolean).join(" ");return f.jsx("input",K(T({ref:h,type:"checkbox",className:m},s),{"aria-checked":a!=null?a:e?"mixed":s.checked!==void 0?!!s.checked:void 0}))});FE.displayName="TriState";const HE=ie.forwardRef((p,g)=>{var v=p,{label:e,htmlFor:t,required:a=!1,disabled:s=!1,error:r,errorId:c,hint:o,children:u,className:h=""}=v,m=de(v,["label","htmlFor","required","disabled","error","errorId","hint","children","className"]);const b=["field",s?"field--disabled":"",h].filter(Boolean).join(" ");return f.jsxs("div",K(T({ref:g,className:b},m),{children:[e&&f.jsxs("label",{className:"field__label",htmlFor:t,children:[f.jsx("span",{children:e}),a&&f.jsx("span",{className:"field__required",children:"*"}),o&&f.jsx("span",{className:"field__hint",children:o})]}),f.jsx("div",{className:"field__input",children:u}),r&&f.jsx("div",{className:"field__error",id:c,children:r})]}))});HE.displayName="Field";const zo={emerald:"rgb(16 185 129)",amber:"rgb(245 158 11)",rose:"rgb(244 63 94)",cyan:"rgb(34 211 238)",violet:"rgb(139 92 246)",neutral:"rgb(var(--canvas-fg-2))"};function PE(e){return e in zo?zo[e]:e}function $E(e){return e.map(([t,a],s)=>(s?"L":"M")+t.toFixed(2)+","+a.toFixed(2)).join(" ")}const Mp=ie.forwardRef((g,m)=>{var p=g,{data:e,width:t=88,height:a=28,color:s="emerald",area:r=!0,label:c,className:o="",style:u}=p,h=de(p,["data","width","height","color","area","label","className","style"]);const v=ie.useId(),b=ie.useMemo(()=>{if(!e||e.length<2)return null;const C=Math.min(...e),R=Math.max(...e),j=e.map((O,z)=>[z/(e.length-1)*t,a-2-(O-C)/(R-C||1)*(a-4)]),k=$E(j),I=`${k} L${t},${a} L0,${a} Z`;return{line:k,fill:I}},[e,t,a]);if(!b)return null;const _=PE(String(s)),{line:S,fill:w}=b;return f.jsxs("svg",K(T({ref:m,role:"img","aria-label":c!=null?c:"trend sparkline",width:t,height:a,viewBox:`0 0 ${t} ${a}`,preserveAspectRatio:"none",style:T({display:"block"},u),className:o},h),{children:[r&&f.jsx("defs",{children:f.jsxs("linearGradient",{id:v,x1:"0",y1:"0",x2:"0",y2:"1",children:[f.jsx("stop",{offset:"0%",stopColor:_,stopOpacity:"0.22"}),f.jsx("stop",{offset:"100%",stopColor:_,stopOpacity:"0"})]})}),r&&f.jsx("path",{d:w,fill:`url(#${v})`}),f.jsx("path",{d:S,stroke:_,strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})]}))});Mp.displayName="Sparkline";const Mu=ie.forwardRef((v,p)=>{var b=v,{label:e="",value:t="",delta:a,color:s="cyan",icon:r,sparkData:c,meta:o,metaIcon:u,className:h="","aria-label":m}=b,g=de(b,["label","value","delta","color","icon","sparkData","meta","metaIcon","className","aria-label"]);const _=["stat-tile",`stat-tile--${s}`,h].filter(Boolean).join(" ");return f.jsxs("div",K(T({ref:p,className:_,"aria-label":m!=null?m:`${e}: ${t}`},g),{children:[f.jsxs("div",{className:"stat-tile__header",children:[f.jsx("div",{className:"stat-tile__label",children:e}),r&&f.jsx(Ce,{name:r,size:14,"aria-hidden":"true"})]}),f.jsx("div",{className:"stat-tile__value",children:t}),(a||o)&&f.jsxs("div",{className:"stat-tile__footer",children:[a&&f.jsxs("span",{className:`stat-tile__delta stat-tile__delta--${a.direction||"up"}`,children:[f.jsxs("span",{className:"stat-tile__delta-value",children:[a.direction==="down"?"−":"+",Math.abs(a.value)]}),a.label&&f.jsx("span",{className:"stat-tile__delta-label",children:a.label})]}),o&&f.jsxs("div",{className:"stat-tile__meta",children:[u&&f.jsx(Ce,{name:u,size:12,"aria-hidden":"true"}),f.jsx("span",{className:"stat-tile__meta-text",children:o})]})]}),c&&f.jsx("div",{className:"stat-tile__sparkline",children:f.jsx(Mp,{data:c,width:88,height:28,color:s||"cyan"})})]}))});Mu.displayName="StatTile";const qE=ie.forwardRef((c,r)=>{var o=c,{columns:e=4,className:t="",children:a}=o,s=de(o,["columns","className","children"]);const u=["stat-grid",`stat-grid--cols-${e}`,t].filter(Boolean).join(" ");return f.jsx("div",K(T({ref:r,className:u},s),{children:a}))});qE.displayName="StatGrid";const In=ie.forwardRef((c,r)=>{var o=c,{className:e="",children:t,tone:a="amber"}=o,s=de(o,["className","children","tone"]);const u=["version-pill",`version-pill--${a}`,e].filter(Boolean).join(" ");return f.jsx("span",K(T({ref:r,className:u},s),{children:t}))});In.displayName="VersionPill";const rd=ie.forwardRef((u,o)=>{var h=u,{value:e,onChange:t,options:a,disabled:s=!1,className:r=""}=h,c=de(h,["value","onChange","options","disabled","className"]);const m=["segmented-control",s?"segmented-control--disabled":"",r].filter(Boolean).join(" "),g=A.useRef([]),p=A.useCallback((_,S)=>{var w;const C=a.map((k,I)=>k.disabled?null:I).filter(k=>k!==null),R=C.indexOf(S);let j;_.key==="ArrowRight"||_.key==="ArrowDown"?(_.preventDefault(),j=C[(R+1)%C.length]):(_.key==="ArrowLeft"||_.key==="ArrowUp")&&(_.preventDefault(),j=C[(R-1+C.length)%C.length]),j!==void 0&&((w=g.current[j])==null||w.focus(),t(a[j].value))},[a,t]),v=a.some(_=>_.value===e),b=a.findIndex(_=>!_.disabled);return f.jsx("div",K(T({ref:o,className:m,role:"radiogroup"},c),{children:a.map((_,S)=>{const w=e===_.value,C=w||!v&&S===b?0:-1;return f.jsx("button",{ref:R=>{g.current[S]=R},className:`segmented-control__segment ${w?"segmented-control__segment--active":""}`,onClick:()=>!s&&!_.disabled&&t(_.value),onKeyDown:R=>p(R,S),type:"button",role:"radio","aria-checked":w,disabled:s||_.disabled,tabIndex:C,children:_.label},_.value)})}))});rd.displayName="SegmentedControl";const VE=ie.forwardRef((v,p)=>{var b=v,{columns:e,data:t,rowKey:a,selectable:s=!1,selectedRows:r=[],onSelectRows:c,onRowClick:o,onSort:u,emptyState:h,className:m=""}=b,g=de(b,["columns","data","rowKey","selectable","selectedRows","onSelectRows","onRowClick","onSort","emptyState","className"]);const[_,S]=A.useState(null),[w,C]=A.useState("asc"),R=A.useRef(null),j=t.length>0&&r.length===t.length,k=r.length>0&&r.length<t.length;A.useEffect(()=>{R.current&&(R.current.indeterminate=k)},[k]);const I=(U,F)=>typeof a=="function"?a(U,F):U[a],O=()=>{j?c==null||c([]):c==null||c(t.map((U,F)=>I(U,F)))},z=U=>{r.includes(U)?c==null||c(r.filter(F=>F!==U)):c==null||c([...r,U])},B=U=>{_===U?w==="asc"?(C("desc"),u==null||u(U,"desc")):(S(null),u==null||u(U,null)):(S(U),C("asc"),u==null||u(U,"asc"))},P=(U,F)=>{(U.key==="Enter"||U.key===" ")&&(U.preventDefault(),B(F))},M=["table",m].filter(Boolean).join(" ");return f.jsxs("table",K(T({ref:p,className:M},g),{children:[f.jsx("thead",{className:"table__head",children:f.jsxs("tr",{className:"table__row",children:[s&&f.jsx("th",{className:"table__header table__header--checkbox",style:{width:"30px"},children:f.jsx("input",{ref:R,type:"checkbox",className:"table__checkbox",checked:j,onChange:O,"aria-label":"Select all rows"})}),e.map(U=>{const F=String(U.key),q=_===F,H=q?w==="asc"?"ascending":"descending":U.sortable?"none":void 0;return f.jsx("th",{className:`table__header ${U.sortable?"table__header--sortable":""}`,style:{width:U.width},"aria-sort":H,tabIndex:U.sortable?0:void 0,onClick:()=>U.sortable&&B(F),onKeyDown:U.sortable?Y=>P(Y,F):void 0,children:f.jsxs("div",{className:"table__header-content",children:[U.label,q&&f.jsx(Ce,{name:w==="asc"?"chevronUp":"chevronDown",size:14,className:"table__sort-icon"})]})},F)})]})}),f.jsx("tbody",{className:"table__body",children:t.length===0&&h?f.jsx("tr",{className:"table__row",children:f.jsx("td",{className:"table__cell table__cell--empty",colSpan:e.length+(s?1:0),children:h})}):t.map((U,F)=>{const q=I(U,F),H=r.includes(q),Y=!!o;return f.jsxs("tr",{"data-row-key":q,className:["table__row",H?"table__row--selected":"",Y?"table__row--clickable":""].filter(Boolean).join(" "),onClick:Y?()=>o(U,q):void 0,onKeyDown:Y?$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),o(U,q))}:void 0,tabIndex:Y?0:void 0,children:[s&&f.jsx("td",{className:"table__cell table__cell--checkbox",children:f.jsx("input",{type:"checkbox",className:"table__checkbox",checked:H,"aria-label":`Select row ${q}`,onChange:()=>z(q),onClick:$=>$.stopPropagation()})}),e.map($=>f.jsx("td",{className:"table__cell",children:$.render?$.render(U[$.key],U,F):U[$.key]},`${q}-${String($.key)}`))]},q)})})]}))});VE.displayName="Table";const Io=ie.forwardRef((g,m)=>{var p=g,{icon:e,label:t,count:a,active:s=!1,depth:r=0,onClick:c,className:o="",type:u="button"}=p,h=de(p,["icon","label","count","active","depth","onClick","className","type"]);const v=["nav-item",s&&"nav-item--active",r===1&&"nav-item--depth-1",o].filter(Boolean).join(" ");return f.jsxs("button",K(T({ref:m,type:u,className:v,onClick:c,"aria-current":s?"page":void 0},h),{children:[r===0&&e&&f.jsx(Ce,{name:e,size:16,className:"nav-item__icon"}),f.jsx("span",{className:"nav-item__label",children:t}),a!==void 0&&f.jsx("span",{className:"nav-item__count",children:a})]}))});Io.displayName="NavItem";const Ap=ie.forwardRef((h,u)=>{var m=h,{title:e,version:t,collapsed:a=!1,action:s,className:r="","aria-label":c}=m,o=de(m,["title","version","collapsed","action","className","aria-label"]);const g=["app-title",a&&"app-title--collapsed",r].filter(Boolean).join(" "),p=c!=null?c:t?`${e} ${t}`:e;return f.jsxs("div",K(T({ref:u,className:g,"aria-label":p,role:"banner"},o),{children:[f.jsx("div",{className:"app-title__mark","aria-hidden":"true"}),!a&&f.jsxs("div",{className:"app-title__text",children:[f.jsx("div",{className:"app-title__name",children:e}),t&&f.jsx("span",{className:"app-title__version",children:t})]}),s&&f.jsx("div",{className:"app-title__action",children:s})]}))});Ap.displayName="AppTitle";const d_=ie.forwardRef((_,b)=>{var S=_,{sections:e,activeItemId:t,collapsed:a=!1,onCollapse:s,onSelectItem:r,defaultExpandedIds:c,expandedIds:o,onExpandedChange:u,showCollapseToggle:h=!0,appTitle:m,footer:g,className:p=""}=S,v=de(S,["sections","activeItemId","collapsed","onCollapse","onSelectItem","defaultExpandedIds","expandedIds","onExpandedChange","showCollapseToggle","appTitle","footer","className"]);var z;const w=o!==void 0,[C,R]=A.useState(()=>new Set(c)),j=w?new Set(o):C,k=B=>{const P=new Set(j);P.has(B)?P.delete(B):P.add(B),w||R(P),u==null||u(Array.from(P))},I=["sidebar",a&&"sidebar--collapsed",p].filter(Boolean).join(" "),O=f.jsx("button",{type:"button",className:"sidebar__toggle",onClick:()=>s==null?void 0:s(!a),"aria-label":a?"Expand sidebar":"Collapse sidebar",children:f.jsx(Ce,{name:a?"chevronRight":"chevronLeft",size:16})});return f.jsxs("div",K(T({ref:b,className:I},v),{children:[m?f.jsxs(f.Fragment,{children:[f.jsx(Ap,K(T({},m),{collapsed:a,action:a?m.action:(z=m.action)!=null?z:O})),a&&O]}):h&&O,f.jsx("nav",{className:"sidebar__nav","aria-label":"Sidebar navigation",children:e.map(B=>f.jsxs("div",{className:"sidebar__section",children:[!a&&f.jsx("div",{className:"sidebar__section-title",children:B.title}),f.jsx("div",{className:"sidebar__items",children:B.items.map(P=>{const M=P.children&&P.children.length>0,U=j.has(P.id),F=t===P.id;return f.jsxs(ie.Fragment,{children:[f.jsxs("button",{type:"button",className:`sidebar__item ${F?"sidebar__item--active":""}`,onClick:()=>{M?k(P.id):r==null||r(P.id)},title:a?P.label:void 0,"aria-current":F?"page":void 0,"aria-expanded":M?U:void 0,children:[P.icon&&f.jsx(Ce,{name:P.icon,size:18,className:"sidebar__item-icon"}),!a&&f.jsx("span",{className:"sidebar__item-label",children:P.label}),!a&&P.count!==void 0&&f.jsx("span",{className:"sidebar__item-count",children:P.count}),!a&&M&&f.jsx(Ce,{name:"chevronRight",size:14,className:`sidebar__item-chevron ${U?"sidebar__item-chevron--open":""}`})]}),!a&&M&&U&&P.children.map(q=>f.jsxs("button",{type:"button",className:`sidebar__item sidebar__item--child ${t===q.id?"sidebar__item--active":""}`,onClick:()=>r==null?void 0:r(q.id),"aria-current":t===q.id?"page":void 0,children:[f.jsx("span",{className:"sidebar__item-label",children:q.label}),q.count!==void 0&&f.jsx("span",{className:"sidebar__item-count",children:q.count})]},q.id))]},P.id)})})]},B.title))}),g&&f.jsx("div",{className:"sidebar__footer",children:g})]}))});d_.displayName="Sidebar";const f_=ie.forwardRef((m,h)=>{var g=m,{breadcrumbs:e,searchPlaceholder:t="Search…",onSearch:a,leadingContent:s,searchHint:r,children:c,className:o=""}=g,u=de(g,["breadcrumbs","searchPlaceholder","onSearch","leadingContent","searchHint","children","className"]);const p=["topbar",o].filter(Boolean).join(" "),v=e?e.length-1:-1;return f.jsxs("div",K(T({ref:h,className:p},u),{children:[s&&f.jsx("div",{className:"topbar__leading",children:s}),f.jsx("div",{className:"topbar__breadcrumbs",children:e&&e.length>0&&f.jsx("nav",{className:"breadcrumbs","aria-label":"Breadcrumb",children:e.map((b,_)=>f.jsxs(ie.Fragment,{children:[_>0&&f.jsx("span",{className:"breadcrumbs__separator","aria-hidden":"true",children:"/"}),b.href?f.jsx("a",{href:b.href,className:"breadcrumbs__link","aria-current":_===v?"page":void 0,children:b.label}):b.onClick?f.jsx("button",{type:"button",className:"breadcrumbs__link breadcrumbs__link--button",onClick:b.onClick,"aria-current":_===v?"page":void 0,children:b.label}):f.jsx("span",{className:"breadcrumbs__link breadcrumbs__link--static","aria-current":_===v?"page":void 0,children:b.label})]},_))})}),f.jsxs("div",{className:"topbar__actions",children:[a&&f.jsxs("div",{className:"topbar__search-wrap",children:[f.jsx("input",{type:"search",placeholder:t,"aria-label":t,className:"topbar__search",onChange:b=>a(b.target.value)}),r&&f.jsx("span",{className:"topbar__search-hint",children:r})]}),c]})]}))});f_.displayName="Topbar";const YE=ie.forwardRef((o,c)=>{var u=o,{tabs:e=[],activeTabId:t="",onSelectTab:a,className:s=""}=u,r=de(u,["tabs","activeTabId","onSelectTab","className"]);const h=["tab-bar",s].filter(Boolean).join(" "),m=A.useRef([]),g=A.useCallback((p,v)=>{var b;const _=e.map((C,R)=>C.disabled?-1:R).filter(C=>C!==-1),S=_.indexOf(v);let w;p.key==="ArrowRight"?w=_[(S+1)%_.length]:p.key==="ArrowLeft"?w=_[(S-1+_.length)%_.length]:p.key==="Home"?w=_[0]:p.key==="End"&&(w=_[_.length-1]),w!==void 0&&(p.preventDefault(),(b=m.current[w])==null||b.focus(),a==null||a(e[w].id))},[e,a]);return f.jsx("div",K(T({ref:c,className:h,role:"tablist"},r),{children:f.jsx("div",{className:"tab-bar__tabs",children:e.map((p,v)=>f.jsxs("button",{type:"button",ref:b=>{m.current[v]=b},role:"tab","aria-selected":t===p.id,"aria-disabled":p.disabled,tabIndex:p.disabled?-1:t===p.id?0:-1,className:["tab-bar__tab",t===p.id?"tab-bar__tab--active":"",p.disabled?"tab-bar__tab--disabled":""].filter(Boolean).join(" "),onClick:()=>!p.disabled&&(a==null?void 0:a(p.id)),onKeyDown:b=>g(b,v),children:[f.jsx("span",{className:"tab-bar__tab-label",children:p.label}),p.count!==void 0&&f.jsx(Nn,{form:"id-tag",children:p.count})]},p.id))})}))});YE.displayName="TabBar";const h_=ie.forwardRef((h,u)=>{var m=h,{left:e,center:t,right:a,className:s="",role:r="banner","aria-label":c="Application titlebar"}=m,o=de(m,["left","center","right","className","role","aria-label"]);const g=["titlebar",s].filter(Boolean).join(" ");return f.jsxs("div",K(T({ref:u,className:g,role:r,"aria-label":c},o),{children:[e&&f.jsx("div",{className:"titlebar__slot titlebar__slot--left",children:e}),t&&f.jsx("div",{className:"titlebar__slot titlebar__slot--center",children:t}),a&&f.jsx("div",{className:"titlebar__slot titlebar__slot--right",children:a})]}))});h_.displayName="Titlebar";const GE=e=>typeof e=="object"&&e!==null&&"kind"in e,KE=e=>e.map((t,a)=>{switch(t.kind){case"divider":return f.jsx("div",{className:"statusbar__divider"},a);case"pulse":return f.jsxs("div",{className:"statusbar__item statusbar__item--pulse",children:[f.jsx("div",{className:`statusbar__pulse statusbar__pulse--${t.tone}`}),t.mono?f.jsx("span",{className:"statusbar__label statusbar__label--mono",children:t.label}):f.jsx("span",{className:"statusbar__label",children:t.label})]},a);case"icon":return f.jsxs("div",{className:`statusbar__item ${t.mono?"statusbar__item--mono":""}`,"aria-label":t.label,children:[f.jsx(Ce,{name:t.icon,size:14}),t.label&&f.jsx("span",{className:"statusbar__label",children:t.label})]},a);default:return t}}),Lp=ie.forwardRef((o,c)=>{var u=o,{left:e,center:t,right:a,className:s=""}=u,r=de(u,["left","center","right","className"]);const h=["statusbar",s].filter(Boolean).join(" "),m=g=>g?Array.isArray(g)&&g.length>0&&GE(g[0])?KE(g):g:null;return f.jsxs("div",K(T({ref:c,role:"status",className:h},r),{children:[e&&f.jsx("div",{className:"statusbar__slot statusbar__slot--left statusbar__left",children:m(e)}),t&&f.jsx("div",{className:"statusbar__slot statusbar__slot--center",children:m(t)}),a&&f.jsx("div",{className:"statusbar__slot statusbar__slot--right statusbar__right",children:m(a)})]}))});Lp.displayName="Statusbar";const XE=ie.forwardRef((m,h)=>{var g=m,{titlebar:e,appTitle:t,topbar:a,sidebar:s,statusbar:r,children:c,className:o=""}=g,u=de(g,["titlebar","appTitle","topbar","sidebar","statusbar","children","className"]);const p=["shell-layout",o].filter(Boolean).join(" "),U=e!=null?e:{},{hide:v}=U,b=de(U,["hide"]),_=e&&!e.hide,F=t!=null?t:{},{hide:S}=F,w=de(F,["hide"]),C=t&&!t.hide,q=a!=null?a:{},{hide:R}=q,j=de(q,["hide"]),k=a&&!a.hide,H=s!=null?s:{},{hide:I}=H,O=de(H,["hide"]),z=s&&!s.hide,Y=r!=null?r:{},{hide:B}=Y,P=de(Y,["hide"]),M=r&&!r.hide;return f.jsxs("div",K(T({ref:h,className:p},u),{children:[_&&f.jsx(h_,T({},b)),f.jsxs("div",{className:"shell-layout__main",children:[z?f.jsx("div",{className:"shell-layout__sidebar-col",children:f.jsx(d_,K(T({},O),{appTitle:C?w:O.appTitle}))}):C?f.jsx(Ap,T({},w)):null,f.jsxs("div",{className:"shell-layout__content",children:[k&&f.jsx(f_,T({},j)),f.jsx("main",{className:"shell-layout__canvas",children:c})]})]}),M&&f.jsx(Lp,T({},P))]}))});XE.displayName="ShellLayout";const QE=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'];function ld(e,t,a){var c;const s=A.useRef(null),r=(c=a==null?void 0:a.mode)!=null?c:"modal";A.useEffect(()=>{if(!t||!e.current)return;s.current=document.activeElement;const o=()=>e.current?Array.from(e.current.querySelectorAll(QE.join(","))):[],u=m=>{if(m.key!=="Tab")return;const g=o();if(g.length===0)return;const p=g[0],v=g[g.length-1];m.shiftKey?document.activeElement===p&&(m.preventDefault(),v.focus()):document.activeElement===v&&(m.preventDefault(),p.focus())},h=o();return h.length>0&&r==="modal"&&h[0].focus(),e.current.addEventListener("keydown",u),()=>{var m;(m=e.current)==null||m.removeEventListener("keydown",u);const g=s.current;g&&document.body.contains(g)&&g.focus()}},[e,t,r])}let pu=0,gu=null;function Dp(e){A.useEffect(()=>{if(e)return pu===0&&(gu=document.body.style.overflow,document.body.style.overflow="hidden"),pu++,()=>{pu--,pu===0&&gu!==null&&(document.body.style.overflow=gu,gu=null)}},[e])}const Op=ie.forwardRef((p,g)=>{var v=p,{isOpen:e,onClose:t,title:a,subtitle:s,children:r,footer:c,hintFooter:o,size:u="md",className:h=""}=v,m=de(v,["isOpen","onClose","title","subtitle","children","footer","hintFooter","size","className"]);const b=ie.useId(),_=A.useRef(null),S=A.useRef(null);A.useImperativeHandle(g,()=>S.current),ld(S,e),Dp(e),A.useEffect(()=>{const C=R=>{R.key==="Escape"&&e&&t()};if(e)return document.addEventListener("keydown",C),()=>{document.removeEventListener("keydown",C)}},[e,t]);const w=C=>{C.target===_.current&&t()};return e?f.jsx("div",{ref:_,className:"modal-backdrop",onClick:w,children:f.jsxs("div",K(T({ref:S,className:["modal",`modal--${u}`,h].filter(Boolean).join(" "),role:"dialog","aria-modal":"true","aria-labelledby":a?b:void 0},m),{children:[a&&f.jsxs("div",{className:"modal__header",children:[f.jsxs("div",{className:"modal__header-text",children:[f.jsx("div",{id:b,className:"modal__title",children:a}),s&&f.jsx("div",{className:"modal__subtitle",children:s})]}),f.jsx("button",{type:"button",className:"modal__close",onClick:t,"aria-label":"Close dialog",children:f.jsx(Ce,{name:"x",size:14})})]}),f.jsx("div",{className:"modal__body",children:r}),c&&f.jsx("div",{className:"modal__footer",children:c}),o&&f.jsx("div",{className:"modal__foot-hint",children:o})]}))}):null});Op.displayName="Modal";const m_=ie.forwardRef(({isOpen:e,onClose:t,onConfirm:a,title:s,subtitle:r,message:c,confirmLabel:o="Confirm",cancelLabel:u="Cancel",variant:h="danger"},m)=>f.jsxs(Op,{ref:m,isOpen:e,onClose:t,title:s,subtitle:r,children:[f.jsx("div",{className:"confirm-dialog__message",children:c}),f.jsxs("div",{className:"confirm-dialog__footer",children:[f.jsx(rn,{variant:"ghost",size:"sm",onClick:t,children:u}),f.jsx(rn,{variant:h,size:"sm",onClick:a,children:o})]})]}));m_.displayName="ConfirmDialog";function Wh({icon:e,title:t,description:a,onClick:s}){return f.jsxs("button",{type:"button",className:"workspace-switcher-dialog__action-tile",onClick:s,children:[f.jsx("div",{className:"workspace-switcher-dialog__action-icon",children:f.jsx(Ce,{name:e,size:20})}),f.jsx("div",{className:"workspace-switcher-dialog__action-title",children:t}),f.jsx("div",{className:"workspace-switcher-dialog__action-desc",children:a})]})}const ZE=ie.forwardRef(({isOpen:e,onClose:t,title:a="Switch Workspace",current:s,recent:r=[],onOpenFolder:c,onNewWorkspace:o,onCloneFromGit:u,onPickRecent:h},m)=>f.jsx(Op,{ref:m,isOpen:e,onClose:t,title:a,size:"lg",children:f.jsxs("div",{className:"workspace-switcher-dialog__content",children:[(c||o||u)&&f.jsxs("div",{className:"workspace-switcher-dialog__tiles",children:[c&&f.jsx(Wh,{icon:"folder",title:"Open folder…",description:"Point to an existing workspace directory",onClick:c}),o&&f.jsx(Wh,{icon:"plus",title:"New workspace…",description:"Initialize a fresh local workspace",onClick:o}),u&&f.jsx(Wh,{icon:"gitBranch",title:"Clone from git…",description:"Pull a workspace from a remote repository",onClick:u})]}),r.length>0&&f.jsxs("div",{className:"workspace-switcher-dialog__recent",children:[f.jsx("div",{className:"workspace-switcher-dialog__recent-header",children:"Recent"}),f.jsx("div",{className:"workspace-switcher-dialog__recent-list",children:r.map(g=>{const p=(s==null?void 0:s.id)===g.id;return f.jsxs("button",{type:"button",className:`workspace-switcher-dialog__recent-item ${p?"workspace-switcher-dialog__recent-item--current":""}`,"aria-current":p?!0:void 0,onClick:()=>h(g),children:[f.jsxs("div",{className:"workspace-switcher-dialog__recent-main",children:[f.jsx("span",{className:"workspace-switcher-dialog__recent-name",children:g.name}),p&&f.jsx("span",{className:"workspace-switcher-dialog__open-badge",children:"open"})]}),f.jsxs("div",{className:"workspace-switcher-dialog__recent-meta",children:[g.path&&f.jsx("span",{className:"workspace-switcher-dialog__recent-path",children:g.path}),(g.classCount!=null||g.individualCount!=null)&&f.jsxs("span",{className:"workspace-switcher-dialog__recent-stats",children:[g.classCount!=null&&`${g.classCount} cls`,g.classCount!=null&&g.individualCount!=null&&" · ",g.individualCount!=null&&`${g.individualCount} ind`]})]})]},g.id)})})]})]})}));ZE.displayName="WorkspaceSwitcherDialog";const p_=A.createContext(void 0);function od(){const e=A.useContext(p_);if(!e)throw new Error("FilterDropdown components must be used within FilterDropdown");return e}const g_=ie.forwardRef(({mode:e="checkbox",children:t,onChange:a,className:s="",defaultValue:r,value:c,placement:o="bottom-start"},u)=>{const[h,m]=A.useState(!1),g=c!==void 0,[p,v]=A.useState(new Set(r!=null?r:[])),b=g?new Set(c):p,_=A.useRef(null),S=A.useRef(null),w=A.useRef(null),C=A.useCallback(()=>m(!1),[]),{focusedValue:R,setFocusedValue:j}=id({triggerRef:_,panelRef:S,isOpen:h,onClose:C}),k=A.useCallback(z=>{m(z)},[]),I=A.useCallback((z,B)=>{const P=new Set(b);B?(e==="radio"&&P.clear(),P.add(z)):P.delete(z),g||v(P),a==null||a(Array.from(P)),e==="radio"&&B&&m(!1)},[b,e,a,g]),O={isOpen:h,onOpenChange:k,mode:e,selectedValues:b,onValueChange:I,focusedValue:R,setFocusedValue:j,triggerRef:_,panelRef:S,placement:o};return f.jsx(p_.Provider,{value:O,children:f.jsx("div",{ref:z=>{w.current=z,typeof u=="function"?u(z):u&&(u.current=z)},className:`filter-dropdown ${s}`.trim(),children:t})})});g_.displayName="FilterDropdown";function JE(s){var r=s,{label:e,summary:t}=r,a=de(r,["label","summary"]);const{isOpen:c,onOpenChange:o,triggerRef:u,mode:h}=od();return f.jsxs("button",K(T({ref:u,type:"button"},a),{className:"filter-dropdown__trigger",onClick:()=>o(!c),"aria-haspopup":h==="radio"?"dialog":"listbox","aria-expanded":c,children:[f.jsx("span",{className:"filter-dropdown__label",children:e}),f.jsx("span",{className:"filter-dropdown__summary",children:t}),f.jsx(Ce,{name:"chevronDown",size:14,className:`filter-dropdown__chevron ${c?"filter-dropdown__chevron--open":""}`})]}))}function WE(r){var c=r,{children:e,className:t="",style:a}=c,s=de(c,["children","className","style"]);const{isOpen:o,mode:u,panelRef:h,placement:m}=od();return f.jsx("div",K(T({ref:h,className:`dropdown-panel ${sd(m)} filter-dropdown__panel ${t}`.trim(),role:u==="checkbox"?"listbox":"radiogroup","aria-multiselectable":u==="checkbox"?!0:void 0,hidden:!o,style:o?a:void 0},s),{children:e}))}function eR({title:e,children:t}){return f.jsxs("div",{className:"dropdown-section",children:[e&&f.jsx("div",{className:"dropdown-section-title",children:e}),f.jsx("div",{className:"filter-dropdown__section-content",children:t})]})}function tR({value:e,label:t,description:a}){const{selectedValues:s,onValueChange:r,focusedValue:c,setFocusedValue:o,mode:u}=od(),h=A.useRef(null),m=s.has(e),g=c===e;return A.useEffect(()=>{var p;g&&((p=h.current)==null||p.focus())},[g]),f.jsxs("button",{ref:h,type:"button",role:u==="checkbox"?"option":void 0,"aria-selected":m,tabIndex:g?0:-1,"data-dropdown-item":e,onClick:()=>r(e,!m),onMouseEnter:()=>o(e),className:["dropdown-item",g&&"dropdown-item--focused"].filter(Boolean).join(" "),children:[f.jsx("span",{className:"dropdown-item__leading",children:f.jsx("input",{type:"checkbox",className:"dropdown-item__checkbox",checked:m,readOnly:!0,tabIndex:-1,"aria-hidden":"true"})}),f.jsxs("span",{className:"dropdown-item__body",children:[f.jsx("span",{className:"dropdown-item__label",children:t}),a&&f.jsx("span",{className:"dropdown-item__description",children:a})]})]})}function nR({value:e,label:t,description:a}){const{selectedValues:s,onValueChange:r,focusedValue:c,setFocusedValue:o}=od(),u=A.useRef(null),h=s.has(e),m=c===e;return A.useEffect(()=>{var g;m&&((g=u.current)==null||g.focus())},[m]),f.jsxs("button",{ref:u,type:"button",role:"radio","aria-checked":h,tabIndex:m?0:-1,"data-dropdown-item":e,onClick:()=>r(e,!0),onMouseEnter:()=>o(e),className:["dropdown-item",m&&"dropdown-item--focused"].filter(Boolean).join(" "),children:[f.jsx("span",{className:"dropdown-item__leading",children:f.jsx("input",{type:"radio",className:"dropdown-item__radio",checked:h,readOnly:!0,tabIndex:-1,"aria-hidden":"true"})}),f.jsxs("span",{className:"dropdown-item__body",children:[f.jsx("span",{className:"dropdown-item__label",children:t}),a&&f.jsx("span",{className:"dropdown-item__description",children:a})]})]})}Object.assign(g_,{Trigger:JE,Panel:WE,Section:eR,Checkbox:tR,Radio:nR});const aR={success:"check",error:"x",warning:"alert",info:"info"},iR={success:"emerald",error:"rose",warning:"amber",info:"cyan"},y_=ie.forwardRef((g,m)=>{var p=g,{isOpen:e,onClose:t,title:a,subtitle:s,variant:r="info",icon:c,duration:o=4e3,className:u=""}=p,h=de(p,["isOpen","onClose","title","subtitle","variant","icon","duration","className"]);if(A.useEffect(()=>{if(e&&o){const _=setTimeout(t,o);return()=>clearTimeout(_)}},[e,o,t]),!e)return null;const v=c||aR[r],b=iR[r];return f.jsxs("div",K(T({ref:m,className:["toast",`toast--${r}`,u].filter(Boolean).join(" "),role:r==="error"||r==="warning"?"alert":"status","aria-live":r==="error"||r==="warning"?"assertive":"polite","aria-atomic":"true"},h),{children:[f.jsx("div",{className:`toast__icon toast__icon--${b}`,children:f.jsx(Ce,{name:v,size:12})}),f.jsxs("div",{className:"toast__content",children:[a&&f.jsx("div",{className:"toast__title",children:a}),s&&f.jsx("div",{className:"toast__subtitle",children:s})]}),f.jsx("button",{type:"button",className:"toast__close",onClick:t,"aria-label":"Dismiss notification",children:f.jsx(Ce,{name:"x",size:14})})]}))});y_.displayName="Toast";const sR=ie.forwardRef(({isOpen:e,onClose:t,commands:a=[],placeholder:s="Search commands…",emptyMessage:r="No commands found"},c)=>{const[o,u]=A.useState(""),[h,m]=A.useState(0),g=A.useRef(null),p=A.useRef(null),v=ie.useId(),b=ie.useId();A.useImperativeHandle(c,()=>p.current),ld(p,e),Dp(e);const _=A.useMemo(()=>{const C=o.toLowerCase();return a.filter(R=>{var k;var j;return R.label.toLowerCase().includes(C)||((k=(j=R.description)==null?void 0:j.toLowerCase().includes(C))!=null?k:!1)})},[a,o]),S=A.useMemo(()=>{const C=[],R=new Map;return _.forEach((j,k)=>{R.has(j.group)||(R.set(j.group,[]),C.push(j.group)),R.get(j.group).push({cmd:j,index:k})}),C.map(j=>({name:j,items:R.get(j)}))},[_]);A.useEffect(()=>{e?setTimeout(()=>{var C;return(C=g.current)==null?void 0:C.focus()},0):(u(""),m(0))},[e]),A.useEffect(()=>{const C=R=>{e&&(R.key==="Escape"?t():R.key==="ArrowDown"?(R.preventDefault(),_.length>0&&m(j=>(j+1)%_.length)):R.key==="ArrowUp"?(R.preventDefault(),_.length>0&&m(j=>(j-1+_.length)%_.length)):R.key==="Enter"&&(R.preventDefault(),_[h]&&(_[h].onSelect(),t(),u(""))))};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[e,t,_,h]);const w=C=>{C.target===C.currentTarget&&t()};return e?f.jsx("div",{ref:p,className:"command-palette-backdrop",onClick:w,children:f.jsxs("div",{className:"command-palette",role:"dialog","aria-modal":"true","aria-labelledby":b,children:[f.jsx("span",{id:b,className:"command-palette__sr-title",children:"Command palette"}),f.jsxs("div",{className:"command-palette__header",children:[f.jsx(Ce,{name:"search",size:16}),f.jsx("input",{ref:g,type:"text",role:"combobox","aria-autocomplete":"list","aria-expanded":!0,"aria-controls":v,"aria-activedescendant":_[h]?`${v}-${_[h].id}`:void 0,"aria-label":s,className:"command-palette__input",placeholder:s,value:o,onChange:C=>{u(C.target.value),m(0)}})]}),f.jsx("div",{id:v,role:"listbox",className:"command-palette__list",children:_.length===0?f.jsx("div",{className:"command-palette__empty",children:r}):S.map(C=>{var R;return f.jsxs("div",{className:"command-palette__group",role:"group",children:[C.name&&f.jsx("div",{className:"command-palette__group-header","aria-hidden":"true",children:C.name}),C.items.map(({cmd:j,index:k})=>f.jsxs("button",{type:"button",id:`${v}-${j.id}`,role:"option","aria-selected":k===h,className:["command-palette__item",k===h&&"command-palette__item--selected"].filter(Boolean).join(" "),onClick:()=>{j.onSelect(),t(),u("")},children:[j.icon&&f.jsx(Ce,{name:j.icon,size:16}),f.jsxs("div",{className:"command-palette__item-content",children:[f.jsx("div",{className:"command-palette__item-label",children:j.label}),j.description&&f.jsx("div",{className:"command-palette__item-description",children:j.description})]})]},j.id))]},(R=C.name)!=null?R:"__ungrouped")})})]})}):null});sR.displayName="CommandPalette";const v_=ie.forwardRef((g,m)=>{var p=g,{title:e,subtitle:t,headerAction:a,footer:s,bordered:r=!0,noPadding:c=!1,className:o="",children:u}=p,h=de(p,["title","subtitle","headerAction","footer","bordered","noPadding","className","children"]);const v=["panel",!r&&"panel--no-border",o].filter(Boolean).join(" ");return f.jsxs("div",K(T({ref:m,className:v},h),{children:[(e||t||a)&&f.jsxs("div",{className:"panel__header",children:[f.jsxs("div",{className:"panel__header-left",children:[e&&f.jsx("div",{className:"panel__title",children:e}),t&&f.jsx("div",{className:"panel__subtitle",children:t})]}),a&&f.jsx("div",{className:"panel__header-action",children:a})]}),u!=null&&f.jsx("div",{className:c?"panel__body panel__body--no-padding":"panel__body",children:u}),s&&f.jsx("div",{className:"panel__footer",children:s})]}))});v_.displayName="Panel";const rR=ie.forwardRef((m,h)=>{var g=m,{isOpen:e,onClose:t,title:a,position:s="right",width:r="320px",children:c,className:o=""}=g,u=de(g,["isOpen","onClose","title","position","width","children","className"]);const p=ie.useId(),v=A.useRef(null);A.useImperativeHandle(h,()=>v.current),ld(v,e),Dp(e),A.useEffect(()=>{const _=S=>{S.key==="Escape"&&e&&t()};if(e)return document.addEventListener("keydown",_),()=>{document.removeEventListener("keydown",_)}},[e,t]);const b=_=>{_.target===_.currentTarget&&t()};return e?f.jsx("div",{className:"drawer-backdrop",onClick:b,children:f.jsxs("div",K(T({ref:v,className:["drawer",`drawer--${s}`,o].filter(Boolean).join(" "),style:{width:r},role:"dialog","aria-modal":"true","aria-labelledby":a?p:void 0},u),{children:[f.jsxs("div",{className:["drawer__header",a?"":"drawer__header--no-title"].filter(Boolean).join(" "),children:[a&&f.jsx("h2",{id:p,className:"drawer__title",children:a}),f.jsx("button",{type:"button",className:"drawer__close",onClick:t,"aria-label":"Close drawer",children:f.jsx(Ce,{name:"x",size:14})})]}),f.jsx("div",{className:"drawer__body",children:c})]}))}):null});rR.displayName="Drawer";const lR=ie.forwardRef((v,p)=>{var b=v,{direction:e="horizontal",initialSplitPercent:t=50,splitPercent:a,onSplitChange:s,minSize:r=200,maxSize:c=800,first:o,second:u,dividerLabel:h,className:m=""}=b,g=de(b,["direction","initialSplitPercent","splitPercent","onSplitChange","minSize","maxSize","first","second","dividerLabel","className"]);const[_,S]=A.useState(t),w=A.useRef(null),C=a!==void 0,R=C?a:_,j=A.useCallback((P,M)=>{const U=r/M*100,F=c/M*100;return Math.max(U,Math.min(P,F))},[r,c]),k=A.useCallback(P=>{C||S(P),s==null||s(P)},[C,s]),I=A.useCallback(P=>M=>{P.forEach(U=>{typeof U=="function"?U(M):U&&(U.current=M)})},[]),O=A.useCallback(()=>{const P=U=>{if(!w.current)return;const F=w.current.getBoundingClientRect(),q=e==="horizontal",H=q?U.clientX-F.left:U.clientY-F.top,Y=q?F.width:F.height,$=H/Y*100;k(j($,Y))},M=()=>{document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",M)};document.addEventListener("mousemove",P),document.addEventListener("mouseup",M)},[e,j,k]),z=A.useCallback(P=>{if(!w.current)return;const M=P.shiftKey?10:2,U=e==="horizontal",F=w.current.getBoundingClientRect(),q=U?F.width:F.height;P.key==="ArrowLeft"||P.key==="ArrowUp"?(P.preventDefault(),k(j(R-M,q))):(P.key==="ArrowRight"||P.key==="ArrowDown")&&(P.preventDefault(),k(j(R+M,q)))},[e,R,j,k]),B=["split-pane",`split-pane--${e}`,m].filter(Boolean).join(" ");return f.jsxs("div",K(T({ref:I([w,p]),className:B},g),{children:[f.jsx("div",{className:"split-pane__first",style:e==="horizontal"?{width:`${R}%`}:{height:`${R}%`},children:o}),f.jsx("div",{role:"separator","aria-orientation":e==="horizontal"?"vertical":"horizontal","aria-valuenow":Math.round(R),"aria-valuemin":0,"aria-valuemax":100,"aria-label":h!=null?h:e==="horizontal"?"Horizontal divider":"Vertical divider",tabIndex:0,className:`split-pane__divider split-pane__divider--${e}`,onMouseDown:O,onKeyDown:z}),f.jsx("div",{className:"split-pane__second",style:e==="horizontal"?{width:`${100-R}%`}:{height:`${100-R}%`},children:u})]}))});lR.displayName="SplitPane";const b_=A.createContext(void 0),x_=()=>{const e=A.useContext(b_);if(!e)throw new Error("InspectorPanel.Section must be used within an InspectorPanel");return e},__=ie.forwardRef((u,o)=>{var h=u,{title:e,count:t,actions:a,children:s,className:r=""}=h,c=de(h,["title","count","actions","children","className"]);x_();const m=["inspector-panel__section",r].filter(Boolean).join(" ");return f.jsxs("div",K(T({ref:o,className:m},c),{children:[f.jsxs("div",{className:"inspector-panel__section-header",children:[f.jsxs("div",{className:"inspector-panel__section-title",children:[f.jsx("span",{children:e}),t!==void 0&&f.jsxs("span",{className:"inspector-panel__section-count",children:["· ",t]})]}),a&&f.jsx("div",{className:"inspector-panel__section-actions",children:a})]}),s&&f.jsx("div",{className:"inspector-panel__section-content",children:s})]}))});__.displayName="InspectorPanel.Section";const S_=ie.forwardRef((m,h)=>{var g=m,{title:e,count:t,actionIcon:a,actionLabel:s,onAction:r,rows:c,className:o=""}=g,u=de(g,["title","count","actionIcon","actionLabel","onAction","rows","className"]);x_();const p=["inspector-panel__property-section",o].filter(Boolean).join(" ");return f.jsxs("div",K(T({ref:h,className:p},u),{children:[f.jsxs("div",{className:"inspector-panel__property-section-header",children:[f.jsx("span",{className:"inspector-panel__property-section-title",children:e}),t!==void 0&&f.jsx("span",{className:"inspector-panel__property-section-count",children:t}),r&&f.jsx("button",{className:"inspector-panel__property-section-action",onClick:r,type:"button","aria-label":s,children:a})]}),c.length>0&&f.jsx("div",{className:"inspector-panel__property-rows",children:c.map(v=>f.jsxs("div",{className:"inspector-panel__property-row",children:[f.jsx("span",{className:"inspector-panel__property-key",children:v.key}),f.jsx("span",{className:"inspector-panel__property-value",children:v.value}),v.usageCount!==void 0&&f.jsxs("span",{className:"inspector-panel__property-usage",children:["used ",v.usageCount]})]},v.key))})]}))});S_.displayName="InspectorPanel.PropertySection";const w_=ie.forwardRef((m,h)=>{var g=m,{eyebrow:e="",title:t,id:a,version:s,actions:r,children:c,className:o=""}=g,u=de(g,["eyebrow","title","id","version","actions","children","className"]);const p=["inspector-panel",o].filter(Boolean).join(" ");return f.jsx(b_.Provider,{value:!0,children:f.jsxs("div",K(T({ref:h,className:p},u),{children:[f.jsxs("div",{className:"inspector-panel__head",children:[e&&f.jsx("div",{className:"inspector-panel__eyebrow",children:e}),f.jsx("div",{className:"inspector-panel__title",children:t}),f.jsxs("div",{className:"inspector-panel__id-version",children:[f.jsx("span",{className:"inspector-panel__id",children:a}),s!==void 0&&f.jsx(In,{children:s})]}),r&&f.jsx("div",{className:"inspector-panel__actions",children:r})]}),f.jsx("div",{className:"inspector-panel__body",children:c})]}))})});w_.displayName="InspectorPanel";Object.assign(w_,{Section:__,PropertySection:S_});const oR=ie.forwardRef((o,c)=>{var u=o,{rows:e=[],keyWidth:t,className:a="",style:s}=u,r=de(u,["rows","keyWidth","className","style"]);const h=["kv-grid",a].filter(Boolean).join(" "),m=t?K(T({},s),{gridTemplateColumns:`${typeof t=="number"?`${t}px`:t} 1fr`}):s;return f.jsx("dl",K(T({ref:c,className:h,style:m},r),{children:e.map(g=>f.jsxs(ie.Fragment,{children:[f.jsx("dt",{className:"kv-grid__key",children:g.key}),f.jsx("dd",{className:"kv-grid__value",children:g.value})]},g.key))}))});oR.displayName="KVGrid";const cR=ie.forwardRef((h,u)=>{var m=h,{label:e,width:t,height:a,viewBox:s,className:r="",children:c}=m,o=de(m,["label","width","height","viewBox","className","children"]);return f.jsx("svg",K(T({ref:u,role:"img","aria-label":e,width:t,height:a,viewBox:s,className:r,style:{display:"block"}},o),{children:c}))});cR.displayName="ChartWrapper";const sl=["#22D3EE","#10B981","#F59E0B","#818CF8","#8B5CF6","#F43F5E"],Xb=sl,es={light:{fg1:"#0B1220",fg2:"#475569",fg3:"#64748B",fg4:"#94A3B8",grid:"#EEF1F4",border:"#E5E9EE",card:"#FFFFFF",inset:"#F7F9FB"},dark:{fg1:"#E2E8F0",fg2:"#94A3B8",fg3:"#64748B",fg4:"#475569",grid:"#1B2949",border:"#243763",card:"#1B2949",inset:"#13203A"}};function rl(e){return Math.abs(e)>=1e3?(e/1e3).toFixed(1)+"k":Number.isInteger(e)?String(e):e.toFixed(1)}const Qb="#F59E0B",uR="#B45309",dR="#1B2949",fR="#2A3A5C",hR="#E6EDF3",mR="#A6B1BD",pR=ie.forwardRef((R,C)=>{var j=R,{series:e,colors:t,xLabels:a,width:s=480,height:r=200,area:c=!1,axes:o=!1,grid:u=!1,ticks:h=4,threshold:m,markers:g,tooltip:p=!1,tone:v="light",padding:b,className:_="",style:S}=j,w=de(j,["series","colors","xLabels","width","height","area","axes","grid","ticks","threshold","markers","tooltip","tone","padding","className","style"]);var E;const k=es[v],I=ie.useId(),O=t!=null?t:e.length===1?[sl[0]]:sl,z=T({top:8,right:p?12:8,bottom:o?22:6,left:o?30:6},b),B=s-z.left-z.right,P=r-z.top-z.bottom,M=e.flat();if(M.length===0)return null;let U=Math.min(...M),F=Math.max(...M);const q=F-U||1;U-=q*.08,F+=q*.08,m&&(U=Math.min(U,m.value),F=Math.max(F,m.value));const H=Math.max(...e.map(W=>W.length)),Y=W=>z.left+(H<=1?B/2:W/(H-1)*B),$=W=>z.top+P-(W-U)/(F-U)*P,X=[];for(let W=0;W<=h;W++)X.push(U+W/h*(F-U));const[Z,fe]=ie.useState(null);function D(W){const oe=W.currentTarget.getBoundingClientRect(),me=(W.clientX-oe.left)/oe.width*s,_e=Math.max(0,Math.min(H-1,Math.round((me-z.left)/B*(H-1))));fe(_e)}function he(W){return W.map(([oe,me],_e)=>(_e?"L":"M")+oe.toFixed(2)+","+me.toFixed(2)).join(" ")}const ge=e.map(W=>W.map((oe,me)=>[Y(me),$(oe)]));return f.jsxs("svg",K(T({ref:C,width:s,height:r,viewBox:`0 0 ${s} ${r}`,className:_,role:"img","aria-label":(E=w["aria-label"])!=null?E:"Line chart",style:T({display:"block",cursor:p?"crosshair":"default"},S),onMouseMove:p?D:void 0,onMouseLeave:p?()=>fe(null):void 0},w),{children:[u&&X.map((W,oe)=>f.jsx("line",{x1:z.left,x2:s-z.right,y1:$(W),y2:$(W),stroke:k.grid,strokeWidth:"1"},"g"+oe)),o&&f.jsxs(f.Fragment,{children:[f.jsx("line",{x1:z.left,x2:z.left,y1:z.top,y2:z.top+P,stroke:k.border,strokeWidth:"1"}),f.jsx("line",{x1:z.left,x2:s-z.right,y1:z.top+P,y2:z.top+P,stroke:k.border,strokeWidth:"1"}),X.map((W,oe)=>f.jsx("text",{x:z.left-6,y:$(W)+3,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:k.fg3,children:rl(W)},"yt"+oe)),a&&a.map((W,oe)=>f.jsx("text",{x:Y(oe),y:z.top+P+14,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:k.fg3,children:W},"xt"+oe))]}),m&&f.jsxs(f.Fragment,{children:[f.jsx("line",{x1:z.left,x2:s-z.right,y1:$(m.value),y2:$(m.value),stroke:k.fg3,strokeWidth:"1",strokeDasharray:"3 3"}),m.label&&f.jsx("text",{x:s-z.right-4,y:$(m.value)-4,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:k.fg3,style:{textTransform:"uppercase",letterSpacing:"0.08em"},children:m.label})]}),g&&g.map((W,oe)=>f.jsxs("g",{children:[f.jsx("line",{x1:Y(W.x),x2:Y(W.x),y1:z.top-2,y2:z.top+P,stroke:Qb,strokeWidth:"1",strokeDasharray:"2 2"}),f.jsx("circle",{cx:Y(W.x),cy:z.top+4,r:"3",fill:Qb}),W.label&&f.jsx("text",{x:Y(W.x)+6,y:z.top+7,fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:uR,style:{textTransform:"uppercase",letterSpacing:"0.08em"},children:W.label})]},"mk"+oe)),ge.map((W,oe)=>{const me=O[oe%O.length],_e=he(W),be=`${_e} L${W[W.length-1][0].toFixed(2)},${z.top+P} L${W[0][0].toFixed(2)},${z.top+P} Z`,Ae=`${I}-lg${oe}`;return f.jsxs("g",{children:[c&&f.jsxs(f.Fragment,{children:[f.jsx("defs",{children:f.jsxs("linearGradient",{id:Ae,x1:"0",y1:"0",x2:"0",y2:"1",children:[f.jsx("stop",{offset:"0%",stopColor:me,stopOpacity:"0.22"}),f.jsx("stop",{offset:"100%",stopColor:me,stopOpacity:"0"})]})}),f.jsx("path",{d:be,fill:`url(#${Ae})`})]}),f.jsx("path",{d:_e,stroke:me,strokeWidth:p?1.75:1.5,fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})]},"s"+oe)}),p&&Z!==null&&(()=>{const W=18+e.length*16;let oe=Y(Z)+10;oe+132>s-4&&(oe=Y(Z)-132-10);const me=z.top+4;return f.jsxs("g",{children:[f.jsx("line",{x1:Y(Z),x2:Y(Z),y1:z.top,y2:z.top+P,stroke:k.fg3,strokeWidth:"1",strokeDasharray:"2 3"}),e.map((_e,be)=>_e[Z]!=null&&f.jsx("circle",{cx:Y(Z),cy:$(_e[Z]),r:"3",fill:k.card,stroke:O[be%O.length],strokeWidth:"1.75"},"h"+be)),f.jsx("rect",{x:oe,y:me,width:132,height:W,rx:"6",fill:dR,stroke:fR}),f.jsx("text",{x:oe+9,y:me+13,fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:mR,style:{textTransform:"uppercase",letterSpacing:"0.10em"},children:a?a[Z]:`t${Z}`}),e.map((_e,be)=>f.jsxs("g",{children:[f.jsx("rect",{x:oe+9,y:me+22+be*16,width:"6",height:"6",rx:"1",fill:O[be%O.length]}),f.jsx("text",{x:oe+20,y:me+28+be*16,fontFamily:"JetBrains Mono, monospace",fontSize:"10.5",fill:hR,children:_e[Z]!=null?rl(_e[Z]):"—"})]},"tt"+be))]})})()]}))});pR.displayName="LineChart";const gR=ie.forwardRef((b,v)=>{var _=b,{series:e,xLabels:t=[],yMin:a,yMax:s,yTickCount:r=5,legend:c=!1,width:o=400,height:u=200,tone:h="light",ariaLabel:m,className:g=""}=_,p=de(_,["series","xLabels","yMin","yMax","yTickCount","legend","width","height","tone","ariaLabel","className"]);const S=es[h],w=X=>f.jsx("div",K(T({ref:v,className:g,style:{width:o,height:u,display:"flex",alignItems:"center",justifyContent:"center",color:S.fg3,fontSize:"12px"}},p),{children:X}));if(!e||e.length===0)return w("No data");let C=1/0,R=-1/0,j=0;if(e.forEach(X=>{if(X.data&&X.data.length>0){X.data.length>j&&(j=X.data.length);for(let Z=0;Z<X.data.length;Z++){const fe=X.data[Z];fe<C&&(C=fe),fe>R&&(R=fe)}}}),j===0)return w("No data");const k=isFinite(C)&&isFinite(R),I=a!==void 0?a:k?Math.min(0,C):0,O=(s!==void 0?s:k?R:1)-I||1,z={top:8,right:10,bottom:22,left:36},B=o-z.left-z.right,P=u-z.top-z.bottom,M=X=>z.top+P-(X-I)/O*P,U=M(Math.max(I,0)),F=Array.from({length:r},(X,Z)=>{const fe=r===1?1:r-1,D=I+O*Z/fe;return{value:D,y:M(D)}}),q=B/j,H=q*.18,Y=Math.max(1,(q-H*2)/e.length),$=(X,Z)=>X.color?zo[X.color]:Xb[Z%Xb.length];return f.jsxs("div",K(T({ref:v,style:{display:"flex",flexDirection:"column",gap:"8px"},className:g},p),{children:[f.jsxs("svg",{role:"img","aria-label":m!=null?m:e.map(X=>X.name).join(", "),width:o,height:u,viewBox:`0 0 ${o} ${u}`,style:{display:"block"},children:[m&&f.jsx("title",{children:m}),F.map((X,Z)=>f.jsxs("g",{children:[f.jsx("line",{x1:z.left,x2:o-z.right,y1:X.y,y2:X.y,stroke:S.grid,strokeWidth:"1"}),f.jsx("text",{x:z.left-6,y:X.y+3,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:S.fg3,children:rl(X.value)})]},`y-${Z}`)),f.jsx("line",{x1:z.left,x2:z.left,y1:z.top,y2:z.top+P,stroke:S.border,strokeWidth:"1"}),f.jsx("line",{x1:z.left,x2:o-z.right,y1:z.top+P,y2:z.top+P,stroke:S.border,strokeWidth:"1"}),e.map((X,Z)=>{const fe=$(X,Z);return f.jsx("g",{children:X.data.map((D,he)=>{const ge=z.left+he*q+H+Z*Y,E=M(D),W=Math.min(E,U),oe=Math.abs(U-E);return f.jsx("rect",{x:ge,y:W,width:Math.max(1,Y-1),height:Math.max(0,oe),fill:fe,rx:"1"},`bar-${Z}-${he}`)})},`series-${Z}`)}),t.map((X,Z)=>f.jsx("text",{x:z.left+(Z+.5)*q,y:z.top+P+14,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:S.fg3,children:X},`x-${Z}`))]}),c&&f.jsx("div",{style:{display:"flex",gap:"12px",fontSize:"12px",flexWrap:"wrap",color:S.fg2},children:e.map((X,Z)=>f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[f.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"1px",backgroundColor:$(X,Z)}}),f.jsx("span",{children:X.name})]},`legend-${Z}`))})]}))});gR.displayName="BarChart";const yR=ie.forwardRef((S,_)=>{var w=S,{values:e,xLabels:t,color:a,width:s=480,height:r=200,axes:c=!1,grid:o=!1,ticks:u=4,threshold:h,tone:m="light",label:g,className:p="",style:v}=w,b=de(w,["values","xLabels","color","width","height","axes","grid","ticks","threshold","tone","label","className","style"]);const C=es[m],R=a!=null?a:sl[2],j={top:8,right:8,bottom:c?22:6,left:c?30:6},k=s-j.left-j.right,I=r-j.top-j.bottom;if(!e||e.length===0)return null;const O=Math.max(...e,h?h.value:0),z=e.length,B=Math.max(2,k/z*.22),P=(k-B*(z-1))/z,M=F=>j.top+I-F/(O||1)*I,U=[];for(let F=0;F<=u;F++)U.push(F/u*O);return f.jsxs("svg",K(T({ref:_,role:"img","aria-label":g,width:s,height:r,viewBox:`0 0 ${s} ${r}`,className:p,style:T({display:"block"},v)},b),{children:[o&&U.map((F,q)=>f.jsx("line",{x1:j.left,x2:s-j.right,y1:M(F),y2:M(F),stroke:C.grid,strokeWidth:"1"},"g"+q)),c&&f.jsxs(f.Fragment,{children:[f.jsx("line",{x1:j.left,x2:j.left,y1:j.top,y2:j.top+I,stroke:C.border,strokeWidth:"1"}),f.jsx("line",{x1:j.left,x2:s-j.right,y1:j.top+I,y2:j.top+I,stroke:C.border,strokeWidth:"1"}),U.map((F,q)=>f.jsx("text",{x:j.left-6,y:M(F)+3,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:C.fg3,children:rl(F)},"yt"+q))]}),e.map((F,q)=>{const H=j.left+q*(P+B),Y=M(F);return f.jsxs("g",{children:[f.jsx("rect",{x:H,y:Y,width:P,height:j.top+I-Y,fill:R,rx:"1"}),c&&t&&t[q]!==void 0&&f.jsx("text",{x:H+P/2,y:j.top+I+14,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:C.fg3,children:t[q]})]},q)}),h&&f.jsxs(f.Fragment,{children:[f.jsx("line",{x1:j.left,x2:s-j.right,y1:M(h.value),y2:M(h.value),stroke:C.fg3,strokeWidth:"1",strokeDasharray:"3 3"}),h.label&&f.jsx("text",{x:s-j.right-4,y:M(h.value)-4,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:C.fg3,style:{textTransform:"uppercase",letterSpacing:"0.08em"},children:h.label})]})]}))});yR.displayName="BarV";const vR="#22D3EE",bR=ie.forwardRef((v,p)=>{var b=v,{items:e,width:t=320,height:a=200,tone:s="light",showValues:r=!0,valueFormat:c,maxValue:o,label:u,className:h="",style:m}=b,g=de(b,["items","width","height","tone","showValues","valueFormat","maxValue","label","className","style"]);const _=es[s],S={top:4,right:36,bottom:4,left:92},w=t-S.left-S.right,C=a-S.top-S.bottom;if(!e||e.length===0)return null;const R=o!=null?o:Math.max(...e.map(O=>O.value)),j=C/e.length,k=Math.min(j*.62,14),I=c!=null?c:rl;return f.jsx("svg",K(T({ref:p,role:"img","aria-label":u!=null?u:"Horizontal bar chart",width:t,height:a,viewBox:`0 0 ${t} ${a}`,className:h,style:T({display:"block"},m)},g),{children:e.map((O,z)=>{var U;const B=S.top+z*j+(j-k)/2,P=O.value/(R||1)*w,M=(U=O.color)!=null?U:vR;return f.jsxs("g",{children:[f.jsx("text",{x:S.left-10,y:B+k*.78,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"11",fill:_.fg2,children:O.label}),f.jsx("rect",{x:S.left,y:B,width:w,height:k,fill:_.inset,rx:"2"}),f.jsx("rect",{x:S.left,y:B,width:P,height:k,fill:M,rx:"2"}),r&&f.jsx("text",{x:S.left+P+6,y:B+k*.78,fontFamily:"JetBrains Mono, monospace",fontSize:"11",fill:_.fg2,fontWeight:"500",children:I(O.value)})]},O.label)})}))});bR.displayName="BarH";const xR=ie.forwardRef((_,b)=>{var S=_,{stacks:e,colors:t,width:a=480,height:s=200,axes:r=!1,grid:c=!1,ticks:o=4,normalized:u=!1,tone:h="light",label:m="Stacked bar chart",className:g="",style:p}=S,v=de(S,["stacks","colors","width","height","axes","grid","ticks","normalized","tone","label","className","style"]);const w=es[h],C=t!=null?t:sl,R={top:8,right:8,bottom:r?22:6,left:r?30:6},j=a-R.left-R.right,k=s-R.top-R.bottom;if(!e||e.length===0)return null;const I=e.map(F=>F.parts.reduce((q,H)=>q+H,0)),O=u?1:Math.max(...I),z=e.length,B=Math.max(2,j/z*.22),P=(j-B*(z-1))/z,M=[];for(let F=0;F<=o;F++)M.push(F/o*O);const U=F=>R.top+k-F/(O||1)*k;return f.jsxs("svg",K(T({ref:b,role:"img","aria-label":m,width:a,height:s,viewBox:`0 0 ${a} ${s}`,className:g,style:T({display:"block"},p)},v),{children:[c&&M.map((F,q)=>f.jsx("line",{x1:R.left,x2:a-R.right,y1:U(F),y2:U(F),stroke:w.grid,strokeWidth:"1"},"g"+q)),r&&f.jsxs(f.Fragment,{children:[f.jsx("line",{x1:R.left,x2:R.left,y1:R.top,y2:R.top+k,stroke:w.border,strokeWidth:"1"}),f.jsx("line",{x1:R.left,x2:a-R.right,y1:R.top+k,y2:R.top+k,stroke:w.border,strokeWidth:"1"}),M.map((F,q)=>f.jsx("text",{x:R.left-6,y:U(F)+3,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:w.fg3,children:u?`${Math.round(F*100)}%`:rl(F)},"yt"+q))]}),e.map((F,q)=>{const H=R.left+q*(P+B),Y=I[q]||1;let $=0;return f.jsxs("g",{children:[F.parts.map((X,Z)=>{const fe=(u?X/Y:X)/(O||1)*k,D=R.top+k-$-fe;return $+=fe,f.jsx("rect",{x:H,y:D,width:P,height:fe,fill:C[Z%C.length]},Z)}),r&&f.jsx("text",{x:H+P/2,y:R.top+k+14,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:w.fg3,children:F.label})]},q)})]}))});xR.displayName="StackedBar";const _R=ie.forwardRef((_,b)=>{var S=_,{slices:e,colors:t,width:a=160,height:s=160,thickness:r=14,gap:c=.03,centerValue:o,centerLabel:u,"aria-label":h,tone:m="light",className:g="",style:p}=S,v=de(S,["slices","colors","width","height","thickness","gap","centerValue","centerLabel","aria-label","tone","className","style"]);const w=es[m],C=t!=null?t:sl;if(!e||e.length===0)return null;const R=a/2,j=s/2,k=Math.min(a,s)/2-4,I=k-r,O=e.reduce((q,H)=>q+H.value,0)||1;function z(q,H){const Y=Math.cos(q),$=Math.sin(q),X=Math.cos(H),Z=Math.sin(H),fe=H-q>Math.PI?1:0;return[`M ${R+k*Y} ${j+k*$}`,`A ${k} ${k} 0 ${fe} 1 ${R+k*X} ${j+k*Z}`,`L ${R+I*X} ${j+I*Z}`,`A ${I} ${I} 0 ${fe} 0 ${R+I*Y} ${j+I*$}`,"Z"].join(" ")}const B=e.length>1?c:0;let P=-Math.PI/2;const M=e.map((q,H)=>{var Z;const Y=q.value/O*Math.PI*2,$=P+B/2;let X=P+Y-B/2;return X-$>=Math.PI*2-1e-6&&(X=$+Math.PI*2-1e-6),X<=$&&(X=$+1e-4),P+=Y,{d:z($,X),color:(Z=q.color)!=null?Z:C[H%C.length]}}),U=Math.min(a,s)*.22,F=j+Math.min(a,s)*.18;return f.jsxs("svg",K(T({ref:b,role:"img","aria-label":h!=null?h:"Donut chart",width:a,height:s,viewBox:`0 0 ${a} ${s}`,className:g,style:T({display:"block"},p)},v),{children:[M.map((q,H)=>f.jsx("path",{d:q.d,fill:q.color},H)),o!=null&&f.jsx("text",{x:R,y:j+1,textAnchor:"middle",fontFamily:"Inter, sans-serif",fontSize:U,fontWeight:"700",fill:w.fg1,style:{letterSpacing:"-0.02em",fontVariantNumeric:"tabular-nums"},children:o}),u!=null&&f.jsx("text",{x:R,y:F,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:w.fg3,style:{textTransform:"uppercase",letterSpacing:"0.08em"},children:u})]}))});_R.displayName="Donut";const SR=ie.forwardRef((b,v)=>{var _=b,{data:e,baseColor:t="#10B981",xLabels:a,yLabels:s,width:r=480,height:c=120,axes:o=!1,tone:u="light",ariaLabel:h,className:m="",style:g}=_,p=de(_,["data","baseColor","xLabels","yLabels","width","height","axes","tone","ariaLabel","className","style"]);const S=es[u];if(!e||e.length===0)return null;const w=e.length,C=e[0].length,R={top:4,right:8,bottom:o?18:4,left:o?28:4},j=(r-R.left-R.right)/C,k=(c-R.top-R.bottom)/w,I=e.flat().filter(M=>M!=null),O=I.length?Math.min(...I):0,z=I.length?Math.max(...I):1,B=t.replace("#","");function P(M){if(M==null)return S.inset;const U=(M-O)/(z-O||1),F=Math.round((.12+U*.88)*255).toString(16).padStart(2,"0");return`#${B}${F}`}return f.jsxs("svg",K(T({ref:v,role:"img","aria-label":h!=null?h:"Heatmap",width:r,height:c,viewBox:`0 0 ${r} ${c}`,className:m,style:T({display:"block"},g)},p),{children:[h&&f.jsx("title",{children:h}),e.map((M,U)=>M.map((F,q)=>f.jsx("rect",{x:R.left+q*j+1,y:R.top+U*k+1,width:Math.max(0,j-2),height:Math.max(0,k-2),fill:P(F),rx:"2"},`${U}-${q}`))),o&&s&&s.map((M,U)=>f.jsx("text",{x:R.left-6,y:R.top+U*k+k/2+3,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:S.fg3,children:M},"y"+U)),o&&a&&a.map((M,U)=>f.jsx("text",{x:R.left+U*j+j/2,y:c-R.bottom+12,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:S.fg3,children:M},"x"+U))]}))});SR.displayName="Heatmap";const wR="#B45309",em={ok:"#10B981",warn:"#F59E0B",error:"#F43F5E",idle:"",info:"#22D3EE"},CR=ie.forwardRef((b,v)=>{var _=b,{tracks:e,range:t=[0,100],width:a=480,height:s=160,axes:r=!1,xLabels:c,marker:o,tone:u="light","aria-label":h,className:m="",style:g}=_,p=de(_,["tracks","range","width","height","axes","xLabels","marker","tone","aria-label","className","style"]);const S=es[u];if(!e||e.length===0)return null;const w={top:6,right:8,bottom:r?22:6,left:92},C=a-w.left-w.right,R=s-w.top-w.bottom,j=R/e.length,k=Math.min(j*.6,14),I=z=>w.left+(z-t[0])/(t[1]-t[0]||1)*C;function O(z){var B;return z==="idle"?S.border:(B=em[z])!=null?B:z}return f.jsxs("svg",K(T({ref:v,role:"img","aria-label":h,width:a,height:s,viewBox:`0 0 ${a} ${s}`,className:m,style:T({display:"block"},g)},p),{children:[e.map((z,B)=>{const P=w.top+B*j+(j-k)/2;return f.jsxs("g",{children:[f.jsx("text",{x:w.left-10,y:P+k*.78,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"11",fill:S.fg2,children:z.label}),f.jsx("rect",{x:w.left,y:P,width:C,height:k,fill:S.inset,rx:"2"}),z.segments.map((M,U)=>f.jsx("rect",{x:I(M.start),y:P,width:Math.max(2,I(M.end)-I(M.start)),height:k,fill:O(M.kind),rx:"2"},U))]},B)}),r&&c&&c.map((z,B)=>f.jsx("text",{x:w.left+B/(c.length-1)*C,y:w.top+R+14,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:S.fg3,children:z},"x"+B)),o&&f.jsxs(f.Fragment,{children:[f.jsx("line",{x1:I(o.x),x2:I(o.x),y1:w.top-2,y2:w.top+R+2,stroke:em.warn,strokeWidth:"1",strokeDasharray:"2 2"}),f.jsx("circle",{cx:I(o.x),cy:w.top-2,r:"3",fill:em.warn}),o.label&&f.jsx("text",{x:I(o.x)+6,y:w.top+2,fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:wR,style:{textTransform:"uppercase",letterSpacing:"0.08em"},children:o.label})]})]}))});CR.displayName="StatusTimeline";const zp=ie.forwardRef((u,o)=>{var h=u,{percent:e,color:t="emerald",height:a=6,label:s,className:r=""}=h,c=de(h,["percent","color","height","label","className"]);const m=Number.isNaN(e)?0:Math.min(Math.max(e,0),100),g=`progress-bar--${t}`;return f.jsx("div",K(T({ref:o,className:`progress-bar ${g} ${r}`.trim(),style:{height:`${a}px`},role:"progressbar","aria-valuenow":m,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},c),{children:f.jsx("div",{className:"progress-bar__fill",style:{width:`${m}%`}})}))});zp.displayName="ProgressBar";const NR=ie.forwardRef((p,g)=>{var v=p,{label:e,value:t,unit:a,percent:s,sparklineData:r=[],color:c="emerald",progressLabel:o,className:u="","aria-label":h}=v,m=de(v,["label","value","unit","percent","sparklineData","color","progressLabel","className","aria-label"]);return f.jsxs("div",K(T({ref:g,role:"row","aria-label":h!=null?h:e,className:`metric-row ${u}`.trim()},m),{children:[f.jsx("div",{className:"metric-row__label",children:e}),f.jsx("div",{className:"metric-row__progress",children:f.jsx(zp,{percent:s,color:c,height:6,label:o!=null?o:e})}),f.jsx("div",{className:"metric-row__sparkline",children:f.jsx(Mp,{data:r,width:60,height:18,color:c})}),f.jsxs("div",{className:"metric-row__value",children:[t,a&&f.jsx("span",{className:"metric-row__unit",children:a})]})]}))});NR.displayName="MetricRow";const Ip=ie.forwardRef((h,u)=>{var m=h,{eyebrow:e,title:t,idChip:a,subtitle:s,actions:r,className:c=""}=m,o=de(m,["eyebrow","title","idChip","subtitle","actions","className"]);const g=["page-header",c].filter(Boolean).join(" ");return f.jsxs("div",K(T({ref:u,className:g,role:"banner"},o),{children:[f.jsxs("div",{className:"page-header__text",children:[e&&f.jsx("div",{className:"page-header__eyebrow","data-testid":"page-header-eyebrow",children:e}),f.jsxs("h1",{className:"page-header__title","data-testid":"page-header-title",children:[t,a&&f.jsx(Nn,{form:"id-tag",className:"page-header__id-chip","data-testid":"page-header-id-chip",children:a})]}),s&&f.jsx("div",{className:"page-header__subtitle","data-testid":"page-header-subtitle",children:s})]}),r&&f.jsx("div",{className:"page-header__actions","data-testid":"page-header-actions",children:r})]}))});Ip.displayName="PageHeader";const jR=ie.forwardRef((b,v)=>{var _=b,{filters:e=[],value:t,defaultValue:a="",onSearchChange:s,onFilterRemove:r,onClearAll:c,searchPlaceholder:o="Search...",children:u,showingCount:h,totalCount:m,className:g=""}=_,p=de(_,["filters","value","defaultValue","onSearchChange","onFilterRemove","onClearAll","searchPlaceholder","children","showingCount","totalCount","className"]);const S=t!==void 0,[w,C]=A.useState(a),R=S?t:w,j=z=>{const B=z.target.value;S||C(B),s==null||s(B)},k=()=>{S||C(""),c==null||c()},I=["filter-bar",g].filter(Boolean).join(" "),O=ie.Children.count(u)>0;return f.jsxs("div",K(T({ref:v,className:I,"data-testid":"filter-bar"},p),{children:[f.jsxs("div",{className:"filter-bar__controls",children:[f.jsxs("div",{className:"filter-bar__search-wrapper",role:"search",children:[f.jsx(Ce,{name:"search",size:16,className:"filter-bar__search-icon"}),f.jsx("input",{type:"text","aria-label":"Search",placeholder:o,value:R,onChange:j,className:"filter-bar__search-input","data-testid":"filter-bar-search"})]}),O&&f.jsx("div",{className:"filter-bar__children",children:u}),h!==void 0&&m!==void 0&&f.jsxs("div",{className:"filter-bar__caption",children:["Showing ",h," of ",m]})]}),e.length>0&&f.jsxs("div",{className:"filter-bar__chips","data-testid":"filter-bar-chips",children:[c&&f.jsx("button",{type:"button",className:"filter-bar__clear-all",onClick:k,"data-testid":"filter-bar-clear-all",children:"Clear all"}),e.map(z=>f.jsxs(Nn,{variant:"neutral",className:"filter-bar__chip","data-testid":`filter-chip-${z.id}`,children:[f.jsx("span",{className:"filter-bar__chip-label",children:z.label}),f.jsx("button",{type:"button",className:"filter-bar__chip-close",onClick:()=>r==null?void 0:r(z.id),"aria-label":`Remove ${z.label} filter`,"data-testid":`filter-chip-close-${z.id}`,children:f.jsx(Ce,{name:"x",size:14})})]},z.id))]})]}))});jR.displayName="FilterBar";const C_=e=>{const t=typeof e=="string"?new Date(e):e,a=new Date().getTime()-t.getTime();if(Number.isNaN(a))return"";const s=Math.floor(a/6e4),r=Math.floor(a/36e5),c=Math.floor(a/864e5);return s<1?"just now":s<60?`${s}m ago`:r<24?`${r}h ago`:c<7?`${c}d ago`:t.toLocaleDateString()},kR=e=>{const t=typeof e=="string"?new Date(e):e;if(Number.isNaN(t.getTime()))return"";const a=String(t.getHours()).padStart(2,"0"),s=String(t.getMinutes()).padStart(2,"0"),r=String(t.getSeconds()).padStart(2,"0");return`${a}:${s}:${r}`},ll=(e,t)=>{const a=typeof e=="string"?new Date(e):e,s=typeof t=="string"?new Date(t):t;return a.getFullYear()===s.getFullYear()&&a.getMonth()===s.getMonth()&&a.getDate()===s.getDate()},N_=e=>ll(e,new Date),ol=(e,t=0)=>{const a=typeof e=="string"?new Date(e):new Date(e);let s=a.getDay()-t;s<0&&(s+=7);const r=new Date(a);r.setDate(a.getDate()-s);const c=[];for(let o=0;o<7;o++){const u=new Date(r);u.setDate(r.getDate()+o),c.push(u)}return c},ER=8,j_=(e,t=0)=>{const a=typeof e=="string"?new Date(e):e;if(Number.isNaN(a.getTime()))return[];const s=new Date(a.getFullYear(),a.getMonth(),1),r=ol(s,t),c=[];let o=new Date(r[0]);for(;c.length<ER;){const u=ol(o,t);c.push(u);const h=u[u.length-1];if(h.getMonth()>a.getMonth()||h.getFullYear()>a.getFullYear())break;o=new Date(h),o.setDate(o.getDate()+1)}return c},RR=e=>(typeof e=="string"?new Date(e):new Date(e)).toLocaleDateString("en-US",{month:"long",year:"numeric"}),$m=e=>(typeof e=="string"?new Date(e):new Date(e)).toLocaleDateString("en-US",{month:"short",day:"numeric"}),TR=(e,t)=>{const a=ol(e,t),s=$m(a[0]),r=$m(a[6]);return`${s} – ${r}`},MR={create:"emerald",update:"cyan",delete:"rose",run:"amber"},AR=ie.forwardRef((c,r)=>{var o=c,{events:e=[],emptyState:t="No activity recorded",className:a=""}=o,s=de(o,["events","emptyState","className"]);const u=["activity-timeline",a].filter(Boolean).join(" ");return e.length===0?f.jsx("div",K(T({ref:r,className:u,"data-testid":"activity-timeline"},s),{children:f.jsx("div",{className:"activity-timeline__empty","data-testid":"activity-timeline-empty",children:t})})):f.jsx("div",K(T({ref:r,className:u,"data-testid":"activity-timeline"},s),{children:f.jsx("div",{className:"activity-timeline__list",children:e.map(h=>f.jsxs("div",K(T(T({className:["activity-timeline__event",h.onClick?"activity-timeline__event--clickable":""].filter(Boolean).join(" "),"data-testid":`activity-event-${h.id}`},h.kind&&{"data-kind":h.kind}),h.onClick&&{role:"button",tabIndex:0,onClick:()=>h.onClick(h),onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),h.onClick(h))}}),{children:[f.jsx("div",{className:"activity-timeline__dot-container",children:h.dotColor?f.jsx("div",{className:"activity-timeline__dot--custom",style:{backgroundColor:zo[h.dotColor]},"data-testid":`activity-dot-custom-${h.id}`}):f.jsx(Rp,{color:MR[h.type],className:"activity-timeline__dot","data-testid":`activity-dot-${h.type}`})}),f.jsxs("div",{className:"activity-timeline__content",children:[f.jsxs("div",{className:"activity-timeline__header",children:[h.kind&&f.jsx("span",{className:"activity-timeline__kind-label","data-testid":`activity-kind-tag-${h.id}`,children:h.kindLabel||h.kind}),f.jsx("div",{className:"activity-timeline__subject","data-testid":"activity-subject",children:h.headline||h.subject})]}),h.meta&&f.jsx("div",{className:"activity-timeline__meta","data-testid":"activity-meta",children:h.meta})]}),f.jsx("div",{className:"activity-timeline__timestamp","data-testid":"activity-timestamp",children:C_(h.timestamp)})]}),h.id))})}))});AR.displayName="ActivityTimeline";const LR=ie.forwardRef((h,u)=>{var m=h,{entries:e=[],selectedId:t,onSelect:a,order:s="newest-first",emptyState:r="No versions available",className:c=""}=m,o=de(m,["entries","selectedId","onSelect","order","emptyState","className"]);const g=A.useRef(null),p=ie.useMemo(()=>{const w=[...e];return s==="oldest-first"?w.reverse():w},[e,s]),v=p.findIndex(w=>w.id===t),b=w=>{a&&(w.key==="ArrowUp"?(w.preventDefault(),v>0&&a(p[v-1].id)):w.key==="ArrowDown"?(w.preventDefault(),v<p.length-1&&a(p[v+1].id)):(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),v>=0&&a(p[v].id)))};A.useEffect(()=>{if(v>=0&&g.current&&t){const w=g.current.querySelector(`[data-version-id="${CSS.escape(t)}"]`);w&&w.scrollIntoView({block:"nearest"})}},[t,v]);const _=["version-timeline",c].filter(Boolean).join(" ");if(p.length===0)return f.jsx("div",K(T({ref:u,className:_,"data-testid":"version-timeline"},o),{children:f.jsx("div",{className:"version-timeline__empty","data-testid":"version-timeline-empty",children:r})}));const S=p.length>1;return f.jsx("div",K(T({ref:u,className:_,"data-testid":"version-timeline",role:"listbox",tabIndex:0,onKeyDown:b},o),{children:f.jsx("div",{className:"version-timeline__list",ref:g,children:p.map((w,C)=>f.jsxs("div",K(T({className:["version-timeline__entry",t===w.id?"version-timeline__entry--selected":"",a?"version-timeline__entry--clickable":""].filter(Boolean).join(" "),"data-version-id":w.id,"data-testid":`version-entry-${w.id}`,role:"option","aria-selected":t===w.id},a&&{onClick:()=>a(w.id),tabIndex:0}),{children:[f.jsxs("div",{className:"version-timeline__rail",children:[S&&C<p.length-1&&f.jsx("div",{className:"version-timeline__connector"}),f.jsx("div",{className:["version-timeline__dot",w.head?"version-timeline__dot--head":"version-timeline__dot--hollow"].filter(Boolean).join(" "),"data-testid":`version-dot-${w.id}`})]}),f.jsxs("div",{className:"version-timeline__content",children:[f.jsxs("div",{className:"version-timeline__header",children:[f.jsx(In,{tone:"amber",className:"version-timeline__pill",children:w.label}),w.head&&f.jsx(Nn,{variant:"amber",form:"default",className:"version-timeline__head-chip","data-testid":`version-head-${w.id}`,children:"head"})]}),w.headline&&f.jsx("div",{className:"version-timeline__headline","data-testid":`version-headline-${w.id}`,children:w.headline}),w.transition?f.jsxs("div",{className:"version-timeline__transition","data-testid":`version-transition-${w.id}`,children:[f.jsx("span",{className:"version-timeline__transition-label",children:w.transition.from}),f.jsx("span",{className:"version-timeline__transition-arrow",children:"→"}),f.jsx("span",{className:"version-timeline__transition-label",children:w.transition.to})]}):w.stats?f.jsxs("div",{className:"version-timeline__stats","data-testid":`version-stats-${w.id}`,children:[w.stats.added!==void 0&&f.jsxs("span",{className:"version-timeline__stat version-timeline__stat--added",children:[f.jsxs("span",{className:"version-timeline__stat-symbol",children:["+",w.stats.added]}),f.jsxs("span",{className:"version-timeline__stat-label","aria-label":`${w.stats.added} added`,children:[w.stats.added," added"]})]}),w.stats.removed!==void 0&&f.jsxs("span",{className:"version-timeline__stat version-timeline__stat--removed",children:[f.jsxs("span",{className:"version-timeline__stat-symbol",children:["−",w.stats.removed]}),f.jsxs("span",{className:"version-timeline__stat-label","aria-label":`${w.stats.removed} removed`,children:[w.stats.removed," removed"]})]}),w.stats.kept!==void 0&&f.jsxs("span",{className:"version-timeline__stat version-timeline__stat--kept",children:[f.jsxs("span",{className:"version-timeline__stat-symbol",children:["∩",w.stats.kept]}),f.jsxs("span",{className:"version-timeline__stat-label","aria-label":`${w.stats.kept} kept`,children:[w.stats.kept," kept"]})]})]}):null]}),f.jsx("div",{className:"version-timeline__timestamp","data-testid":`version-timestamp-${w.id}`,children:C_(w.timestamp)})]}),w.id))})}))});LR.displayName="VersionTimeline";const Up=({itemCount:e,itemHeight:t,containerHeight:a,overscan:s=5})=>{const r=A.useRef(null),c=A.useRef(null),[o,u]=A.useState([0,Math.ceil(a/t)]);return A.useEffect(()=>{const h=r.current,m=c.current;if(!h||!m)return;const g=()=>{const p=m.getBoundingClientRect(),v=h.getBoundingClientRect().top-p.top,b=Math.max(0,Math.floor(v/t)-s),_=Math.min(e,Math.ceil((v+a)/t)+s);u(S=>S[0]===b&&S[1]===_?S:[b,_])};return h.addEventListener("scroll",g,{passive:!0}),g(),()=>{h.removeEventListener("scroll",g)}},[e,t,a,s]),{visibleRange:o,containerRef:r,sentinelRef:c}},Ur=28,DR=400,k_=ie.forwardRef((u,o)=>{var h=u,{added:e=[],removed:t=[],kept:a=[],maxVisible:s=10,className:r=""}=h,c=de(h,["added","removed","kept","maxVisible","className"]);const[m,g]=A.useState(!1),p=e.length>0||t.length>0||a.length>0,v=a.length>s&&!m,b=m?a:a.slice(0,s),_=a.length-b.length,S=Math.max(e.length,t.length,v?s+1:a.length),{visibleRange:w,containerRef:C,sentinelRef:R}=Up({itemCount:S,itemHeight:Ur,containerHeight:DR}),[j,k]=w,I=["hash-set-diff",r].filter(Boolean).join(" ");return p?f.jsxs("div",K(T({ref:o,className:I,role:"table"},c),{children:[f.jsxs("div",{className:"hash-set-diff__header",role:"row",children:[f.jsxs("div",{className:"hash-set-diff__column hash-set-diff__column--added",role:"cell",children:[f.jsx(In,{tone:"emerald",className:"hash-set-diff__pill",children:"Added"}),f.jsx("span",{className:"hash-set-diff__count",children:e.length})]}),f.jsxs("div",{className:"hash-set-diff__column hash-set-diff__column--removed",role:"cell",children:[f.jsx(In,{tone:"rose",className:"hash-set-diff__pill",children:"Removed"}),f.jsx("span",{className:"hash-set-diff__count",children:t.length})]}),f.jsxs("div",{className:"hash-set-diff__column hash-set-diff__column--kept",role:"cell",children:[f.jsx(In,{className:"hash-set-diff__pill",children:"Kept"}),f.jsx("span",{className:"hash-set-diff__count",children:a.length})]})]}),f.jsx("div",{className:"hash-set-diff__viewport",ref:C,children:f.jsxs("div",{className:"hash-set-diff__content",style:{height:S*Ur,position:"relative"},children:[f.jsx("div",{ref:R,style:{position:"absolute",top:0,left:0,width:"1px",height:`${S*Ur}px`,visibility:"hidden",pointerEvents:"none"}}),f.jsx("div",{style:{height:j*Ur}}),Array.from({length:Math.min(k-j,S-j)}).map((O,z)=>{const B=j+z,P=B<e.length?e[B]:null,M=B<t.length?t[B]:null;let U=null,F=!1;return v&&B===s?F=!0:B<b.length&&(U=b[B]),f.jsxs("div",{className:"hash-set-diff__row",style:{height:Ur},role:"row",children:[f.jsx("div",{className:"hash-set-diff__cell hash-set-diff__cell--added",role:"cell",children:P&&f.jsx("div",{className:"hash-set-diff__item",children:P})}),f.jsx("div",{className:"hash-set-diff__cell hash-set-diff__cell--removed",role:"cell",children:M&&f.jsx("div",{className:"hash-set-diff__item",children:M})}),f.jsx("div",{className:"hash-set-diff__cell hash-set-diff__cell--kept",role:"cell",children:F?f.jsxs("button",{type:"button",className:"hash-set-diff__expand-button",onClick:()=>g(!0),"aria-label":`Show ${_} more kept items`,children:["… ",_," more carried forward"]}):U&&f.jsx("div",{className:"hash-set-diff__item",children:U})})]},B)}),f.jsx("div",{style:{height:Math.max(0,(S-k)*Ur)}})]})})]})):f.jsx("div",K(T({ref:o,className:I},c),{children:f.jsx("div",{className:"hash-set-diff__empty",children:"No changes between these versions"})}))});k_.displayName="HashSetDiff";const Br=24,OR=500,Bp=ie.forwardRef((r,s)=>{var c=r,{lines:e=[],className:t=""}=c,a=de(c,["lines","className"]);const{visibleRange:o,containerRef:u,sentinelRef:h}=Up({itemCount:e.length,itemHeight:Br,containerHeight:OR}),[m,g]=o,p=["side-by-side-diff",t].filter(Boolean).join(" ");return e.length>0?f.jsxs("div",K(T({ref:s,className:p,role:"table"},a),{children:[f.jsxs("div",{className:"side-by-side-diff__header",role:"row",children:[f.jsx("div",{className:"side-by-side-diff__gutter",role:"cell"}),f.jsx("div",{role:"cell",className:"side-by-side-diff__header-cell",children:f.jsx(In,{tone:"emerald",className:"side-by-side-diff__pill side-by-side-diff__pill--added",children:"Version 2 (Added)"})}),f.jsx("div",{role:"cell",className:"side-by-side-diff__header-cell",children:f.jsx(In,{tone:"rose",className:"side-by-side-diff__pill side-by-side-diff__pill--removed",children:"Version 1 (Removed)"})})]}),f.jsx("div",{className:"side-by-side-diff__viewport",ref:u,children:f.jsxs("div",{className:"side-by-side-diff__content",style:{height:e.length*Br,position:"relative"},children:[f.jsx("div",{ref:h,style:{position:"absolute",top:0,left:0,width:"1px",height:`${e.length*Br}px`,visibility:"hidden",pointerEvents:"none"}}),f.jsx("div",{style:{height:m*Br}}),e.slice(m,g).map((v,b)=>{const _=m+b,S=v.type==="hunk",w=v.type==="added",C=v.type==="removed";return f.jsx("div",{className:["side-by-side-diff__row",`side-by-side-diff__row--${v.type}`].filter(Boolean).join(" "),style:{height:Br},role:"row",children:S?f.jsx("div",{className:"side-by-side-diff__hunk",role:"cell",children:v.content}):f.jsxs(f.Fragment,{children:[f.jsx("div",{className:["side-by-side-diff__gutter",w&&"side-by-side-diff__gutter--added",C&&"side-by-side-diff__gutter--removed"].filter(Boolean).join(" "),role:"cell",children:f.jsx("span",{className:"sr-only",children:w?"added":C?"removed":""})}),f.jsx("div",{className:["side-by-side-diff__line",w&&"side-by-side-diff__line--added",C&&"side-by-side-diff__line--removed"].filter(Boolean).join(" "),role:"cell",children:f.jsx("span",{className:"side-by-side-diff__content",children:v.content})})]})},_)}),f.jsx("div",{style:{height:Math.max(0,(e.length-g)*Br)}})]})})]})):f.jsx("div",K(T({ref:s,className:p},a),{children:f.jsx("div",{className:"side-by-side-diff__empty",children:"No changes between these versions"})}))});Bp.displayName="SideBySideDiff";const Fp=A.createContext(null),E_=ie.forwardRef((o,c)=>{var u=o,{mode:e="hash-set",onModeChange:t,children:a,className:s=""}=u,r=de(u,["mode","onModeChange","children","className"]);const[h,m]=A.useState(e);A.useEffect(()=>{m(e)},[e]);const g=b=>{m(b),t==null||t(b)},p=b=>{var _,S,w,C,R;const j=Array.from(((_=b.currentTarget.closest('[role="tablist"]'))==null?void 0:_.querySelectorAll('[role="tab"]'))||[]),k=j.indexOf(b.currentTarget);if(b.key==="ArrowLeft"){b.preventDefault();const I=k>0?k-1:j.length-1;(S=j[I])==null||S.focus()}else if(b.key==="ArrowRight"){b.preventDefault();const I=k<j.length-1?k+1:0;(w=j[I])==null||w.focus()}else b.key==="Home"?(b.preventDefault(),(C=j[0])==null||C.focus()):b.key==="End"&&(b.preventDefault(),(R=j[j.length-1])==null||R.focus())},v=["diff-viewer",s].filter(Boolean).join(" ");return f.jsx(Fp.Provider,{value:h,children:f.jsxs("div",K(T({ref:c,className:v,role:"region","aria-label":"Diff Viewer","data-testid":"diff-viewer"},r),{children:[f.jsxs("div",{className:"diff-viewer__header",role:"tablist",children:[f.jsx("button",{type:"button",id:"diff-viewer-hash-set-tab",role:"tab","aria-selected":h==="hash-set","aria-controls":"diff-viewer-hash-set-panel",className:["diff-viewer__tab",h==="hash-set"&&"diff-viewer__tab--active"].filter(Boolean).join(" "),onClick:()=>g("hash-set"),onKeyDown:p,children:"Hash Set"}),f.jsx("button",{type:"button",id:"diff-viewer-side-by-side-tab",role:"tab","aria-selected":h==="side-by-side","aria-controls":"diff-viewer-side-by-side-panel",className:["diff-viewer__tab",h==="side-by-side"&&"diff-viewer__tab--active"].filter(Boolean).join(" "),onClick:()=>g("side-by-side"),onKeyDown:p,children:"Side by Side"})]}),f.jsxs("div",{className:"diff-viewer__content","data-testid":"diff-viewer-content",children:[h==="hash-set"&&f.jsx("div",{id:"diff-viewer-hash-set-panel",role:"tabpanel","aria-labelledby":"diff-viewer-hash-set-tab",className:"diff-viewer__panel diff-viewer__panel--hash-set",children:a}),h==="side-by-side"&&f.jsx("div",{id:"diff-viewer-side-by-side-panel",role:"tabpanel","aria-labelledby":"diff-viewer-side-by-side-tab",className:"diff-viewer__panel diff-viewer__panel--side-by-side",children:a})]})]}))})});E_.displayName="DiffViewer";function R_(h){var m=h,{added:e,removed:t,kept:a,maxVisible:s,label:r="Changes",labelTone:c="amber",className:o=""}=m,u=de(m,["added","removed","kept","maxVisible","label","labelTone","className"]);return A.useContext(Fp)!=="hash-set"?null:f.jsxs("div",K(T({className:["diff-viewer-hash-set",o].filter(Boolean).join(" ")},u),{children:[r&&f.jsx("div",{className:"diff-viewer-hash-set__header",children:f.jsx(In,{tone:c,className:"diff-viewer-hash-set__label",children:r})}),f.jsx(k_,{added:e,removed:t,kept:a,maxVisible:s})]}))}R_.displayName="DiffViewerHashSet";function T_(u){var h=u,{lines:e,addedLabel:t="Version 2 (Added)",removedLabel:a="Version 1 (Removed)",addedLabelTone:s="emerald",removedLabelTone:r="rose",className:c=""}=h,o=de(h,["lines","addedLabel","removedLabel","addedLabelTone","removedLabelTone","className"]);return A.useContext(Fp)!=="side-by-side"?null:f.jsxs("div",K(T({className:["diff-viewer-side-by-side",c].filter(Boolean).join(" ")},o),{children:[(t||a)&&f.jsx("div",{className:"diff-viewer-side-by-side__header",children:f.jsxs("div",{className:"diff-viewer-side-by-side__labels",children:[t&&f.jsx(In,{tone:s,className:"diff-viewer-side-by-side__label",children:t}),a&&f.jsx(In,{tone:r,className:"diff-viewer-side-by-side__label",children:a})]})}),f.jsx(Bp,{lines:e})]}))}T_.displayName="DiffViewerSideBySide";Object.assign(E_,{HashSet:R_,SideBySide:T_});const zR={error:"rose",warn:"amber",info:"cyan",success:"emerald"},IR=ie.forwardRef((c,r)=>{var o=c,{alerts:e=[],onDismiss:t,className:a=""}=o,s=de(o,["alerts","onDismiss","className"]);const u=["alert-strip",a].filter(Boolean).join(" ");return e.length===0?null:f.jsx("div",K(T({ref:r,className:u,"data-testid":"alert-strip"},s),{children:e.map(h=>f.jsxs("div",{className:"alert-strip__alert","data-testid":`alert-${h.id}`,children:[f.jsx(Rp,{color:zR[h.severity],"data-testid":`alert-severity-${h.severity}`}),f.jsx("div",{className:"alert-strip__message","data-testid":"alert-message",children:h.message}),t&&f.jsx("button",{type:"button",className:"alert-strip__dismiss",onClick:()=>t(h.id),"aria-label":`Dismiss alert: ${h.message}`,"data-testid":`alert-dismiss-${h.id}`,children:f.jsx(Ce,{name:"x",size:16})})]},h.id))}))});IR.displayName="AlertStrip";const M_=ie.forwardRef((o,c)=>{var u=o,{icon:e,title:t,description:a,className:s=""}=u,r=de(u,["icon","title","description","className"]);const h=["quick-access-tile",s].filter(Boolean).join(" ");return f.jsxs("button",K(T({ref:c,type:"button",className:h,"data-testid":"quick-access-tile"},r),{children:[f.jsx("div",{className:"quick-access-tile__icon",children:f.jsx(Ce,{name:e,size:16})}),f.jsxs("div",{className:"quick-access-tile__body",children:[f.jsx("div",{className:"quick-access-tile__title",children:t}),a&&f.jsx("div",{className:"quick-access-tile__description",children:a})]}),f.jsx(Ce,{name:"chevronRight",size:13,className:"quick-access-tile__chev"})]}))});M_.displayName="QuickAccessTile";const UR=ie.forwardRef((o,c)=>{var u=o,{tiles:e,onAction:t,columns:a=4,className:s=""}=u,r=de(u,["tiles","onAction","columns","className"]);const h=["quick-access-grid",s].filter(Boolean).join(" ");return f.jsx("div",K(T({ref:c,className:h,style:{"--qa-columns":a},"data-testid":"quick-access-grid"},r),{children:e.map(m=>f.jsx(M_,{icon:m.icon,title:m.title,description:m.description,onClick:()=>t==null?void 0:t(m.id),"data-testid":`quick-access-tile-${m.id}`},m.id))}))});UR.displayName="QuickAccessGrid";const BR=ie.forwardRef((g,m)=>{var p=g,{icon:e,title:t,description:a,summary:s=[],onClick:r,className:c="",disabled:o,type:u="button"}=p,h=de(p,["icon","title","description","summary","onClick","className","disabled","type"]);const v=["config-tile",o&&"config-tile--disabled",c].filter(Boolean).join(" ");return f.jsxs("button",K(T({ref:m,type:u,className:v,onClick:r,disabled:o,"data-testid":"config-tile"},h),{children:[f.jsx("div",{className:"config-tile__icon",children:f.jsx(Ce,{name:e,size:24})}),f.jsxs("div",{className:"config-tile__content",children:[f.jsx("div",{className:"config-tile__title",children:t}),a&&f.jsx("div",{className:"config-tile__description",children:a}),s.length>0&&f.jsx("div",{className:"config-tile__summary",children:s.map((b,_)=>f.jsxs(ie.Fragment,{children:[f.jsx("div",{className:"config-tile__summary-key",children:b.label}),f.jsx("div",{className:"config-tile__summary-value",children:b.value})]},_))})]}),f.jsx("div",{className:"config-tile__chevron",children:f.jsx(Ce,{name:"chevronRight",size:16})})]}))});BR.displayName="ConfigTile";const FR=e=>/^https?:\/\//.test(e)||e.startsWith("/"),A_=ie.forwardRef((p,g)=>{var v=p,{role:e,senderName:t,timestamp:a,body:s,avatar:r,badge:c,toolBlock:o,thinkingBlock:u,className:h=""}=v,m=de(v,["role","senderName","timestamp","body","avatar","badge","toolBlock","thinkingBlock","className"]);const b=r&&FR(r)?f.jsx("img",{src:r,alt:t,className:"chat-message__avatar-img"}):r||t.slice(0,2).toUpperCase();return f.jsxs("div",K(T({ref:g,className:["chat-message",`chat-message--${e}`,h].filter(Boolean).join(" "),"data-testid":`chat-message-${e}`},m),{children:[f.jsx("div",{className:"chat-message__avatar",children:b}),f.jsxs("div",{className:"chat-message__content",children:[f.jsxs("div",{className:"chat-message__meta",children:[f.jsx("span",{className:"chat-message__sender",children:t}),c&&f.jsx("span",{className:"chat-message__badge",children:c}),f.jsx("span",{className:"chat-message__timestamp",children:a})]}),f.jsx("div",{className:"chat-message__body",children:s}),u&&f.jsx(D_,{content:u.content}),o&&f.jsx(L_,{name:o.name,status:o.status,output:o.output})]})]}))});A_.displayName="ChatMessage";const L_=ie.forwardRef((h,u)=>{var m=h,{name:e,status:t,output:a=[],defaultCollapsed:s=!1,onToggleCollapsed:r,className:c=""}=m,o=de(m,["name","status","output","defaultCollapsed","onToggleCollapsed","className"]);const[g,p]=ie.useState(s),v=ie.useId(),b=ie.useCallback(()=>{const S=!g;p(S),r==null||r(S)},[g,r]),_=t==="running"?"amber":t==="success"?"emerald":"rose";return f.jsxs("div",K(T({ref:u,className:["tool-block",c].filter(Boolean).join(" "),"data-testid":"tool-block"},o),{children:[f.jsxs("button",{type:"button",className:"tool-block__header",onClick:b,"aria-expanded":!g,"aria-controls":a.length>0?v:void 0,children:[f.jsx(Ce,{name:g?"chevronRight":"chevronDown",size:12,className:"tool-block__toggle-icon"}),f.jsx("span",{className:"tool-block__name",children:e}),f.jsx("span",{className:`tool-block__status tool-block__status--${_}`,children:t==="running"?"running":t==="success"?"success":"error"})]}),!g&&a.length>0&&f.jsx("div",{id:v,className:"tool-block__output",children:a.map((S,w)=>f.jsxs("div",{className:"tool-block__output-row",children:[S.key&&f.jsx("span",{className:"tool-block__key",children:S.key}),f.jsx("span",{className:"tool-block__value",children:S.value})]},w))})]}))});L_.displayName="ToolBlock";const D_=ie.forwardRef((u,o)=>{var h=u,{content:e,label:t="thinking",defaultCollapsed:a=!1,onToggleCollapsed:s,className:r=""}=h,c=de(h,["content","label","defaultCollapsed","onToggleCollapsed","className"]);const[m,g]=ie.useState(a),p=ie.useId(),v=ie.useCallback(()=>{const b=!m;g(b),s==null||s(b)},[m,s]);return f.jsxs("div",K(T({ref:o,className:["thinking-block",r].filter(Boolean).join(" "),"data-testid":"thinking-block"},c),{children:[f.jsxs("button",{type:"button",className:"thinking-block__header",onClick:v,"aria-expanded":!m,"aria-controls":m?void 0:p,children:[f.jsx(Ce,{name:m?"chevronRight":"chevronDown",size:12,className:"thinking-block__toggle-icon"}),f.jsx("span",{className:"thinking-block__label",children:t})]}),!m&&f.jsx("div",{id:p,className:"thinking-block__content",children:e})]}))});D_.displayName="ThinkingBlock";const HR=ie.forwardRef((r,s)=>{var c=r,{label:e,className:t=""}=c,a=de(c,["label","className"]);return f.jsxs("div",K(T({ref:s,role:"separator","aria-label":e,className:["chat-divider",t].filter(Boolean).join(" "),"data-testid":"chat-divider"},a),{children:[f.jsx("span",{className:"chat-divider__line"}),f.jsx("span",{className:"chat-divider__label","aria-hidden":"true",children:e}),f.jsx("span",{className:"chat-divider__line"})]}))});HR.displayName="ChatDivider";const O_=ie.forwardRef((u,o)=>{var h=u,{suggestions:e,onSelect:t,selected:a,className:s="","aria-label":r="Suggestions"}=h,c=de(h,["suggestions","onSelect","selected","className","aria-label"]);if(!e||e.length===0)return null;const m=a!==void 0;return f.jsx("div",K(T({ref:o,role:"group","aria-label":r,className:["chat-suggestions",s].filter(Boolean).join(" "),"data-testid":"chat-suggestions"},c),{children:e.map(g=>{const p=g===a,v=m&&!p;return f.jsx("button",{className:["chat-suggestions__pill",p?"chat-suggestions__pill--selected":"",v?"chat-suggestions__pill--disabled":""].filter(Boolean).join(" "),onClick:()=>!v&&t(g),type:"button",disabled:v,"aria-pressed":p,children:g},g)})}))});O_.displayName="ChatSuggestions";const PR=()=>typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`id-${Math.random().toString(36).slice(2,11)}-${Date.now()}`,z_=ie.forwardRef((S,_)=>{var w=S,{placeholder:e="Type a message...",value:t,onChange:a,onSubmit:s,onContextChange:r,onAttachmentChange:c,scopeLabel:o,contextItems:u=[],attachments:h=[],disabled:m=!1,loading:g=!1,label:p="Message",className:v}=w,b=de(w,["placeholder","value","onChange","onSubmit","onContextChange","onAttachmentChange","scopeLabel","contextItems","attachments","disabled","loading","label","className"]);const C=A.useRef(null),R=A.useRef(null);A.useEffect(()=>{if(C.current){C.current.style.height="auto";const B=Math.min(C.current.scrollHeight,200);C.current.style.height=`${B}px`}},[t]);const j=B=>{B.key==="Enter"&&!B.shiftKey&&(B.preventDefault(),t.trim()&&!m&&!g&&s(t,u))},k=()=>{t.trim()&&!m&&!g&&s(t,u)},I=B=>{const P=u.filter(M=>M.id!==B);r==null||r(P)},O=B=>{if(!B.target.files)return;const P=Array.from(B.target.files).map(U=>({id:PR(),name:U.name,size:U.size})),M=[...h,...P];c==null||c(M),R.current&&(R.current.value="")},z=B=>{const P=h.filter(M=>M.id!==B);c==null||c(P)};return f.jsxs("div",K(T({ref:_,className:["chat-composer",m&&"chat-composer--disabled",v].filter(Boolean).join(" ")},b),{children:[f.jsxs("div",{className:"chat-composer__tools",children:[o&&f.jsxs("span",{className:"chat-composer__scope",children:["talking to ",f.jsx("b",{children:o})]}),u.map(B=>f.jsxs("div",{className:"chat-composer__context-pill",children:[f.jsx("span",{className:"chat-composer__context-label",children:B.label}),f.jsx("button",{className:"chat-composer__context-remove",onClick:()=>I(B.id),"aria-label":`Remove ${B.label}`,type:"button",children:f.jsx(Ce,{name:"x",size:10})})]},B.id)),h.map(B=>f.jsxs("div",{className:"chat-composer__attachment-pill",children:[f.jsx(Ce,{name:"paperclip",size:10}),f.jsx("span",{className:"chat-composer__attachment-label",children:B.name}),f.jsx("button",{className:"chat-composer__attachment-remove",onClick:()=>z(B.id),"aria-label":`Remove ${B.name}`,type:"button",children:f.jsx(Ce,{name:"x",size:10})})]},B.id))]}),f.jsxs("div",{className:"chat-composer__input-wrapper",children:[f.jsx("textarea",{ref:C,className:"chat-composer__input",placeholder:e,value:t,onChange:B=>a(B.target.value),onKeyDown:j,rows:2,disabled:m,"aria-label":p}),f.jsxs("div",{className:"chat-composer__footer",children:[f.jsx("div",{className:"chat-composer__footer-start",children:f.jsxs("span",{className:"chat-composer__hint",children:[f.jsx("b",{children:"↵"})," send · ",f.jsx("b",{children:"⇧↵"})," newline"]})}),f.jsxs("div",{className:"chat-composer__footer-end",children:[f.jsx("input",{ref:R,type:"file",multiple:!0,onChange:O,className:"chat-composer__file-input","aria-label":"Attach files"}),f.jsx("button",{className:"chat-composer__attach-button",onClick:()=>{var B;return(B=R.current)==null?void 0:B.click()},type:"button","aria-label":"Attach files",disabled:m,children:f.jsx(Ce,{name:"paperclip",size:12})}),f.jsxs(rn,{variant:"primary",size:"sm",onClick:k,disabled:!t.trim()||m||g,children:[f.jsx(Ce,{name:"send",size:12}),"send"]})]})]})]})]}))});z_.displayName="ChatComposer";const I_=ie.forwardRef((m,h)=>{var g=m,{children:e,bots:t=[],activeBotId:a,onBotChange:s,autoScroll:r=!0,composer:c,className:o=""}=g,u=de(g,["children","bots","activeBotId","onBotChange","autoScroll","composer","className"]);const p=A.useRef(null);return A.useEffect(()=>{r&&p.current&&(p.current.scrollTop=p.current.scrollHeight)},[e,r]),f.jsxs("div",K(T({ref:h,className:["chat-container",o].filter(Boolean).join(" ")},u),{children:[t&&t.length>0&&f.jsx("div",{className:"chat-container__bot-tabs",role:"group","aria-label":"Bot tabs",children:t.map(v=>f.jsxs("button",{type:"button",className:["chat-container__bot-tab",a===v.id&&"chat-container__bot-tab--active"].filter(Boolean).join(" "),onClick:()=>s==null?void 0:s(v.id),"aria-pressed":a===v.id,"aria-label":`${v.label} — ${v.role}`,children:[f.jsxs("span",{className:"chat-container__bot-label",children:[f.jsx("span",{className:["chat-container__bot-status",`chat-container__bot-status--${v.status}`].filter(Boolean).join(" ")}),v.label]}),f.jsx("span",{className:"chat-container__bot-role",children:v.role})]},v.id))}),f.jsx("div",{ref:p,className:"chat-container__thread",role:"log","aria-live":"polite","aria-atomic":"false",children:f.jsx("div",{className:"chat-container__messages",children:e})}),c]}))});I_.displayName="ChatContainer";function $R(e,t){const a={};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const qR=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,VR=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,YR={};function Zb(e,t){return(YR.jsx?VR:qR).test(e)}const GR=/[ \t\n\f\r]/g;function KR(e){return typeof e=="object"?e.type==="text"?Jb(e.value):!1:Jb(e)}function Jb(e){return e.replace(GR,"")===""}class Vo{constructor(t,a,s){this.normal=a,this.property=t,s&&(this.space=s)}}Vo.prototype.normal={};Vo.prototype.property={};Vo.prototype.space=void 0;function U_(e,t){const a={},s={};for(const r of e)Object.assign(a,r.property),Object.assign(s,r.normal);return new Vo(a,s,t)}function qm(e){return e.toLowerCase()}class jn{constructor(t,a){this.attribute=a,this.property=t}}jn.prototype.attribute="";jn.prototype.booleanish=!1;jn.prototype.boolean=!1;jn.prototype.commaOrSpaceSeparated=!1;jn.prototype.commaSeparated=!1;jn.prototype.defined=!1;jn.prototype.mustUseProperty=!1;jn.prototype.number=!1;jn.prototype.overloadedBoolean=!1;jn.prototype.property="";jn.prototype.spaceSeparated=!1;jn.prototype.space=void 0;let XR=0;const Be=Xs(),$t=Xs(),Vm=Xs(),ye=Xs(),St=Xs(),Hs=Xs(),Dn=Xs();function Xs(){return Mh(2,++XR)}const Ym=Object.freeze(Object.defineProperty({__proto__:null,boolean:Be,booleanish:$t,commaOrSpaceSeparated:Dn,commaSeparated:Hs,number:ye,overloadedBoolean:Vm,spaceSeparated:St},Symbol.toStringTag,{value:"Module"})),tm=Object.keys(Ym);class Hp extends jn{constructor(t,a,s,r){let c=-1;if(super(t,a),Wb(this,"space",r),typeof s=="number")for(;++c<tm.length;){const o=tm[c];Wb(this,tm[c],(s&Ym[o])===Ym[o])}}}Hp.prototype.defined=!0;function Wb(e,t,a){a&&(e[t]=a)}function hl(e){const t={},a={};for(const[s,r]of Object.entries(e.properties)){const c=new Hp(s,e.transform(e.attributes||{},s),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(c.mustUseProperty=!0),t[s]=c,a[qm(s)]=s,a[qm(c.attribute)]=s}return new Vo(t,a,e.space)}const B_=hl({properties:{ariaActiveDescendant:null,ariaAtomic:$t,ariaAutoComplete:null,ariaBusy:$t,ariaChecked:$t,ariaColCount:ye,ariaColIndex:ye,ariaColSpan:ye,ariaControls:St,ariaCurrent:null,ariaDescribedBy:St,ariaDetails:null,ariaDisabled:$t,ariaDropEffect:St,ariaErrorMessage:null,ariaExpanded:$t,ariaFlowTo:St,ariaGrabbed:$t,ariaHasPopup:null,ariaHidden:$t,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:St,ariaLevel:ye,ariaLive:null,ariaModal:$t,ariaMultiLine:$t,ariaMultiSelectable:$t,ariaOrientation:null,ariaOwns:St,ariaPlaceholder:null,ariaPosInSet:ye,ariaPressed:$t,ariaReadOnly:$t,ariaRelevant:null,ariaRequired:$t,ariaRoleDescription:St,ariaRowCount:ye,ariaRowIndex:ye,ariaRowSpan:ye,ariaSelected:$t,ariaSetSize:ye,ariaSort:null,ariaValueMax:ye,ariaValueMin:ye,ariaValueNow:ye,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function F_(e,t){return t in e?e[t]:t}function H_(e,t){return F_(e,t.toLowerCase())}const QR=hl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Hs,acceptCharset:St,accessKey:St,action:null,allow:null,allowFullScreen:Be,allowPaymentRequest:Be,allowUserMedia:Be,alpha:Be,alt:null,as:null,async:Be,autoCapitalize:null,autoComplete:St,autoFocus:Be,autoPlay:Be,blocking:St,capture:null,charSet:null,checked:Be,cite:null,className:St,closedBy:null,colorSpace:null,cols:ye,colSpan:ye,command:null,commandFor:null,content:null,contentEditable:$t,controls:Be,controlsList:St,coords:ye|Hs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Be,defer:Be,dir:null,dirName:null,disabled:Be,download:Vm,draggable:$t,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Be,formTarget:null,headers:St,height:ye,hidden:Vm,high:ye,href:null,hrefLang:null,htmlFor:St,httpEquiv:St,id:null,imageSizes:null,imageSrcSet:null,inert:Be,inputMode:null,integrity:null,is:null,isMap:Be,itemId:null,itemProp:St,itemRef:St,itemScope:Be,itemType:St,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Be,low:ye,manifest:null,max:null,maxLength:ye,media:null,method:null,min:null,minLength:ye,multiple:Be,muted:Be,name:null,nonce:null,noModule:Be,noValidate:Be,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Be,optimum:ye,pattern:null,ping:St,placeholder:null,playsInline:Be,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Be,referrerPolicy:null,rel:St,required:Be,reversed:Be,rows:ye,rowSpan:ye,sandbox:St,scope:null,scoped:Be,seamless:Be,selected:Be,shadowRootClonable:Be,shadowRootCustomElementRegistry:Be,shadowRootDelegatesFocus:Be,shadowRootMode:null,shadowRootSerializable:Be,shape:null,size:ye,sizes:null,slot:null,span:ye,spellCheck:$t,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ye,step:null,style:null,tabIndex:ye,target:null,title:null,translate:null,type:null,typeMustMatch:Be,useMap:null,value:$t,width:ye,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:St,axis:null,background:null,bgColor:null,border:ye,borderColor:null,bottomMargin:ye,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Be,declare:Be,event:null,face:null,frame:null,frameBorder:null,hSpace:ye,leftMargin:ye,link:null,longDesc:null,lowSrc:null,marginHeight:ye,marginWidth:ye,noResize:Be,noHref:Be,noShade:Be,noWrap:Be,object:null,profile:null,prompt:null,rev:null,rightMargin:ye,rules:null,scheme:null,scrolling:$t,standby:null,summary:null,text:null,topMargin:ye,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ye,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Be,disablePictureInPicture:Be,disableRemotePlayback:Be,exportParts:Hs,part:St,prefix:null,property:null,results:ye,security:null,unselectable:null},space:"html",transform:H_}),ZR=hl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Dn,accentHeight:ye,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ye,amplitude:ye,arabicForm:null,ascent:ye,attributeName:null,attributeType:null,azimuth:ye,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ye,by:null,calcMode:null,capHeight:ye,className:St,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ye,diffuseConstant:ye,direction:null,display:null,dur:null,divisor:ye,dominantBaseline:null,download:Be,dx:null,dy:null,edgeMode:null,editable:null,elevation:ye,enableBackground:null,end:null,event:null,exponent:ye,externalResourcesRequired:null,fill:null,fillOpacity:ye,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Hs,g2:Hs,glyphName:Hs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ye,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ye,horizOriginX:ye,horizOriginY:ye,id:null,ideographic:ye,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ye,k:ye,k1:ye,k2:ye,k3:ye,k4:ye,kernelMatrix:Dn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ye,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ye,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ye,overlineThickness:ye,paintOrder:null,panose1:null,path:null,pathLength:ye,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:St,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ye,pointsAtY:ye,pointsAtZ:ye,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Dn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Dn,rev:Dn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Dn,requiredFeatures:Dn,requiredFonts:Dn,requiredFormats:Dn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ye,specularExponent:ye,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ye,strikethroughThickness:ye,string:null,stroke:null,strokeDashArray:Dn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ye,strokeOpacity:ye,strokeWidth:null,style:null,surfaceScale:ye,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Dn,tabIndex:ye,tableValues:null,target:null,targetX:ye,targetY:ye,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Dn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ye,underlineThickness:ye,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ye,values:null,vAlphabetic:ye,vMathematical:ye,vectorEffect:null,vHanging:ye,vIdeographic:ye,version:null,vertAdvY:ye,vertOriginX:ye,vertOriginY:ye,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ye,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:F_}),P_=hl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),$_=hl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:H_}),q_=hl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),JR={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},WR=/[A-Z]/g,e0=/-[a-z]/g,eT=/^data[-\w.:]+$/i;function tT(e,t){const a=qm(t);let s=t,r=jn;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&eT.test(t)){if(t.charAt(4)==="-"){const c=t.slice(5).replace(e0,aT);s="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=t.slice(4);if(!e0.test(c)){let o=c.replace(WR,nT);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}r=Hp}return new r(s,t)}function nT(e){return"-"+e.toLowerCase()}function aT(e){return e.charAt(1).toUpperCase()}const iT=U_([B_,QR,P_,$_,q_],"html"),Pp=U_([B_,ZR,P_,$_,q_],"svg");function sT(e){return e.join(" ").trim()}var qu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function V_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $p={},t0=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,rT=/\n/g,lT=/^\s*/,oT=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,cT=/^:\s*/,uT=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,dT=/^[;\s]*/,fT=/^\s+|\s+$/g,hT=`
50
+ `,n0="/",a0="*",js="",mT="comment",pT="declaration";function gT(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var a=1,s=1;function r(_){var S=_.match(rT);S&&(a+=S.length);var w=_.lastIndexOf(hT);s=~w?_.length-w:s+_.length}function c(){var _={line:a,column:s};return function(S){return S.position=new o(_),m(),S}}function o(_){this.start=_,this.end={line:a,column:s},this.source=t.source}o.prototype.content=e;function u(_){var S=new Error(t.source+":"+a+":"+s+": "+_);if(S.reason=_,S.filename=t.source,S.line=a,S.column=s,S.source=e,!t.silent)throw S}function h(_){var S=_.exec(e);if(S){var w=S[0];return r(w),e=e.slice(w.length),S}}function m(){h(lT)}function g(_){var S;for(_=_||[];S=p();)S!==!1&&_.push(S);return _}function p(){var _=c();if(!(n0!=e.charAt(0)||a0!=e.charAt(1))){for(var S=2;js!=e.charAt(S)&&(a0!=e.charAt(S)||n0!=e.charAt(S+1));)++S;if(S+=2,js===e.charAt(S-1))return u("End of comment missing");var w=e.slice(2,S-2);return s+=2,r(w),e=e.slice(S),s+=2,_({type:mT,comment:w})}}function v(){var _=c(),S=h(oT);if(S){if(p(),!h(cT))return u("property missing ':'");var w=h(uT),C=_({type:pT,property:i0(S[0].replace(t0,js)),value:w?i0(w[0].replace(t0,js)):js});return h(dT),C}}function b(){var _=[];g(_);for(var S;S=v();)S!==!1&&(_.push(S),g(_));return _}return m(),b()}function i0(e){return e?e.replace(fT,js):js}var yT=gT,vT=qu&&qu.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($p,"__esModule",{value:!0});$p.default=xT;const bT=vT(yT);function xT(e,t){let a=null;if(!e||typeof e!="string")return a;const s=(0,bT.default)(e),r=typeof t=="function";return s.forEach(c=>{if(c.type!=="declaration")return;const{property:o,value:u}=c;r?t(o,u,c):u&&(a=a||{},a[o]=u)}),a}var cd={};Object.defineProperty(cd,"__esModule",{value:!0});cd.camelCase=void 0;var _T=/^--[a-zA-Z0-9_-]+$/,ST=/-([a-z])/g,wT=/^[^-]+$/,CT=/^-(webkit|moz|ms|o|khtml)-/,NT=/^-(ms)-/,jT=function(e){return!e||wT.test(e)||_T.test(e)},kT=function(e,t){return t.toUpperCase()},s0=function(e,t){return"".concat(t,"-")},ET=function(e,t){return t===void 0&&(t={}),jT(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(NT,s0):e=e.replace(CT,s0),e.replace(ST,kT))};cd.camelCase=ET;var RT=qu&&qu.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},TT=RT($p),MT=cd;function Gm(e,t){var a={};return!e||typeof e!="string"||(0,TT.default)(e,function(s,r){s&&r&&(a[(0,MT.camelCase)(s,t)]=r)}),a}Gm.default=Gm;var AT=Gm;const LT=V_(AT),Y_=G_("end"),qp=G_("start");function G_(e){return t;function t(a){const s=a&&a.position&&a.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function DT(e){const t=qp(e),a=Y_(e);if(t&&a)return{start:t,end:a}}function Eo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?r0(e.position):"start"in e||"end"in e?r0(e):"line"in e||"column"in e?Km(e):""}function Km(e){return l0(e&&e.line)+":"+l0(e&&e.column)}function r0(e){return Km(e&&e.start)+"-"+Km(e&&e.end)}function l0(e){return e&&typeof e=="number"?e:1}class ln extends Error{constructor(t,a,s){super(),typeof a=="string"&&(s=a,a=void 0);let r="",c={},o=!1;if(a&&("line"in a&&"column"in a?c={place:a}:"start"in a&&"end"in a?c={place:a}:"type"in a?c={ancestors:[a],place:a.position}:c=T({},a)),typeof t=="string"?r=t:!c.cause&&t&&(o=!0,r=t.message,c.cause=t),!c.ruleId&&!c.source&&typeof s=="string"){const h=s.indexOf(":");h===-1?c.ruleId=s:(c.source=s.slice(0,h),c.ruleId=s.slice(h+1))}if(!c.place&&c.ancestors&&c.ancestors){const h=c.ancestors[c.ancestors.length-1];h&&(c.place=h.position)}const u=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=u?u.line:void 0,this.name=Eo(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=o&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ln.prototype.file="";ln.prototype.name="";ln.prototype.reason="";ln.prototype.message="";ln.prototype.stack="";ln.prototype.column=void 0;ln.prototype.line=void 0;ln.prototype.ancestors=void 0;ln.prototype.cause=void 0;ln.prototype.fatal=void 0;ln.prototype.place=void 0;ln.prototype.ruleId=void 0;ln.prototype.source=void 0;const Vp={}.hasOwnProperty,OT=new Map,zT=/[A-Z]/g,IT=new Set(["table","tbody","thead","tfoot","tr"]),UT=new Set(["td","th"]),K_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function BT(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=t.filePath||void 0;let s;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=GT(a,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=YT(a,t.jsx,t.jsxs)}const r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Pp:iT,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},c=X_(r,e,void 0);return c&&typeof c!="string"?c:r.create(e,r.Fragment,{children:c||void 0},void 0)}function X_(e,t,a){if(t.type==="element")return FT(e,t,a);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return HT(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return $T(e,t,a);if(t.type==="mdxjsEsm")return PT(e,t);if(t.type==="root")return qT(e,t,a);if(t.type==="text")return VT(e,t)}function FT(e,t,a){const s=e.schema;let r=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(r=Pp,e.schema=r),e.ancestors.push(t);const c=Z_(e,t.tagName,!1),o=KT(e,t);let u=Gp(e,t);return IT.has(t.tagName)&&(u=u.filter(function(h){return typeof h=="string"?!KR(h):!0})),Q_(e,o,c,t),Yp(o,u),e.ancestors.pop(),e.schema=s,e.create(t,c,o,a)}function HT(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}Uo(e,t.position)}function PT(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Uo(e,t.position)}function $T(e,t,a){const s=e.schema;let r=s;t.name==="svg"&&s.space==="html"&&(r=Pp,e.schema=r),e.ancestors.push(t);const c=t.name===null?e.Fragment:Z_(e,t.name,!0),o=XT(e,t),u=Gp(e,t);return Q_(e,o,c,t),Yp(o,u),e.ancestors.pop(),e.schema=s,e.create(t,c,o,a)}function qT(e,t,a){const s={};return Yp(s,Gp(e,t)),e.create(t,e.Fragment,s,a)}function VT(e,t){return t.value}function Q_(e,t,a,s){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(t.node=s)}function Yp(e,t){if(t.length>0){const a=t.length>1?t:t[0];a&&(e.children=a)}}function YT(e,t,a){return s;function s(r,c,o,u){const h=Array.isArray(o.children)?a:t;return u?h(c,o,u):h(c,o)}}function GT(e,t){return a;function a(s,r,c,o){const u=Array.isArray(c.children),h=qp(s);return t(r,c,o,u,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function KT(e,t){const a={};let s,r;for(r in t.properties)if(r!=="children"&&Vp.call(t.properties,r)){const c=QT(e,r,t.properties[r]);if(c){const[o,u]=c;e.tableCellAlignToStyle&&o==="align"&&typeof u=="string"&&UT.has(t.tagName)?s=u:a[o]=u}}if(s){const c=a.style||(a.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return a}function XT(e,t){const a={};for(const s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const r=s.data.estree.body[0];r.type;const c=r.expression;c.type;const o=c.properties[0];o.type,Object.assign(a,e.evaluater.evaluateExpression(o.argument))}else Uo(e,t.position);else{const r=s.name;let c;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const o=s.value.data.estree.body[0];o.type,c=e.evaluater.evaluateExpression(o.expression)}else Uo(e,t.position);else c=s.value===null?!0:s.value;a[r]=c}return a}function Gp(e,t){const a=[];let s=-1;const r=e.passKeys?new Map:OT;for(;++s<t.children.length;){const c=t.children[s];let o;if(e.passKeys){const h=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(h){const m=r.get(h)||0;o=h+"-"+m,r.set(h,m+1)}}const u=X_(e,c,o);u!==void 0&&a.push(u)}return a}function QT(e,t,a){const s=tT(e.schema,t);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=s.commaSeparated?$R(a):sT(a)),s.property==="style"){let r=typeof a=="object"?a:ZT(e,String(a));return e.stylePropertyNameCase==="css"&&(r=JT(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&s.space?JR[s.property]||s.property:s.attribute,a]}}function ZT(e,t){try{return LT(t,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const s=a,r=new ln("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=K_+"#cannot-parse-style-attribute",r}}function Z_(e,t,a){let s;if(!a)s={type:"Literal",value:t};else if(t.includes(".")){const r=t.split(".");let c=-1,o;for(;++c<r.length;){const u=Zb(r[c])?{type:"Identifier",name:r[c]}:{type:"Literal",value:r[c]};o=o?{type:"MemberExpression",object:o,property:u,computed:!!(c&&u.type==="Literal"),optional:!1}:u}s=o}else s=Zb(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){const r=s.value;return Vp.call(e.components,r)?e.components[r]:r}if(e.evaluater)return e.evaluater.evaluateExpression(s);Uo(e)}function Uo(e,t){const a=new ln("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=K_+"#cannot-handle-mdx-estrees-without-createevaluater",a}function JT(e){const t={};let a;for(a in e)Vp.call(e,a)&&(t[WT(a)]=e[a]);return t}function WT(e){let t=e.replace(zT,eM);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function eM(e){return"-"+e.toLowerCase()}const nm={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},tM={};function Kp(e,t){const a=tM,s=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,r=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return J_(e,s,r)}function J_(e,t,a){if(nM(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return o0(e.children,t,a)}return Array.isArray(e)?o0(e,t,a):""}function o0(e,t,a){const s=[];let r=-1;for(;++r<e.length;)s[r]=J_(e[r],t,a);return s.join("")}function nM(e){return!!(e&&typeof e=="object")}const c0=document.createElement("i");function Xp(e){const t="&"+e+";";c0.innerHTML=t;const a=c0.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===t?!1:a}function Un(e,t,a,s){const r=e.length;let c=0,o;if(t<0?t=-t>r?0:r+t:t=t>r?r:t,a=a>0?a:0,s.length<1e4)o=Array.from(s),o.unshift(t,a),e.splice(...o);else for(a&&e.splice(t,a);c<s.length;)o=s.slice(c,c+1e4),o.unshift(t,0),e.splice(...o),c+=1e4,t+=1e4}function ea(e,t){return e.length>0?(Un(e,e.length,0,t),e):t}const u0={}.hasOwnProperty;function W_(e){const t={};let a=-1;for(;++a<e.length;)aM(t,e[a]);return t}function aM(e,t){let a;for(a in t){const s=(u0.call(e,a)?e[a]:void 0)||(e[a]={}),r=t[a];let c;if(r)for(c in r){u0.call(s,c)||(s[c]=[]);const o=r[c];iM(s[c],Array.isArray(o)?o:o?[o]:[])}}}function iM(e,t){let a=-1;const s=[];for(;++a<t.length;)(t[a].add==="after"?e:s).push(t[a]);Un(e,0,0,s)}function eS(e,t){const a=Number.parseInt(e,t);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function da(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const hn=ts(/[A-Za-z]/),sn=ts(/[\dA-Za-z]/),sM=ts(/[#-'*+\--9=?A-Z^-~]/);function Vu(e){return e!==null&&(e<32||e===127)}const Xm=ts(/\d/),rM=ts(/[\dA-Fa-f]/),lM=ts(/[!-/:-@[-`{-~]/);function Oe(e){return e!==null&&e<-2}function wt(e){return e!==null&&(e<0||e===32)}function Qe(e){return e===-2||e===-1||e===32}const ud=ts(new RegExp("\\p{P}|\\p{S}","u")),Gs=ts(/\s/);function ts(e){return t;function t(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function ml(e){const t=[];let a=-1,s=0,r=0;for(;++a<e.length;){const c=e.charCodeAt(a);let o="";if(c===37&&sn(e.charCodeAt(a+1))&&sn(e.charCodeAt(a+2)))r=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(o=String.fromCharCode(c));else if(c>55295&&c<57344){const u=e.charCodeAt(a+1);c<56320&&u>56319&&u<57344?(o=String.fromCharCode(c,u),r=1):o="�"}else o=String.fromCharCode(c);o&&(t.push(e.slice(s,a),encodeURIComponent(o)),s=a+r+1,o=""),r&&(a+=r,r=0)}return t.join("")+e.slice(s)}function nt(e,t,a,s){const r=s?s-1:Number.POSITIVE_INFINITY;let c=0;return o;function o(h){return Qe(h)?(e.enter(a),u(h)):t(h)}function u(h){return Qe(h)&&c++<r?(e.consume(h),u):(e.exit(a),t(h))}}const oM={tokenize:cM};function cM(e){const t=e.attempt(this.parser.constructs.contentInitial,s,r);let a;return t;function s(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),nt(e,t,"linePrefix")}function r(u){return e.enter("paragraph"),c(u)}function c(u){const h=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=h),a=h,o(u)}function o(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return Oe(u)?(e.consume(u),e.exit("chunkText"),c):(e.consume(u),o)}}const uM={tokenize:dM},d0={tokenize:fM};function dM(e){const t=this,a=[];let s=0,r,c,o;return u;function u(j){if(s<a.length){const k=a[s];return t.containerState=k[1],e.attempt(k[0].continuation,h,m)(j)}return m(j)}function h(j){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&R();const k=t.events.length;let I=k,O;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){O=t.events[I][1].end;break}C(s);let z=k;for(;z<t.events.length;)t.events[z][1].end=T({},O),z++;return Un(t.events,I+1,0,t.events.slice(k)),t.events.length=z,m(j)}return u(j)}function m(j){if(s===a.length){if(!r)return v(j);if(r.currentConstruct&&r.currentConstruct.concrete)return _(j);t.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(d0,g,p)(j)}function g(j){return r&&R(),C(s),v(j)}function p(j){return t.parser.lazy[t.now().line]=s!==a.length,o=t.now().offset,_(j)}function v(j){return t.containerState={},e.attempt(d0,b,_)(j)}function b(j){return s++,a.push([t.currentConstruct,t.containerState]),v(j)}function _(j){if(j===null){r&&R(),C(0),e.consume(j);return}return r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:c}),S(j)}function S(j){if(j===null){w(e.exit("chunkFlow"),!0),C(0),e.consume(j);return}return Oe(j)?(e.consume(j),w(e.exit("chunkFlow")),s=0,t.interrupt=void 0,u):(e.consume(j),S)}function w(j,k){const I=t.sliceStream(j);if(k&&I.push(null),j.previous=c,c&&(c.next=j),c=j,r.defineSkip(j.start),r.write(I),t.parser.lazy[j.start.line]){let O=r.events.length;for(;O--;)if(r.events[O][1].start.offset<o&&(!r.events[O][1].end||r.events[O][1].end.offset>o))return;const z=t.events.length;let B=z,P,M;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){if(P){M=t.events[B][1].end;break}P=!0}for(C(s),O=z;O<t.events.length;)t.events[O][1].end=T({},M),O++;Un(t.events,B+1,0,t.events.slice(z)),t.events.length=O}}function C(j){let k=a.length;for(;k-- >j;){const I=a[k];t.containerState=I[1],I[0].exit.call(t,e)}a.length=j}function R(){r.write([null]),c=void 0,r=void 0,t.containerState._closeFlow=void 0}}function fM(e,t,a){return nt(e,e.attempt(this.parser.constructs.document,t,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function cl(e){if(e===null||wt(e)||Gs(e))return 1;if(ud(e))return 2}function dd(e,t,a){const s=[];let r=-1;for(;++r<e.length;){const c=e[r].resolveAll;c&&!s.includes(c)&&(t=c(t,a),s.push(c))}return t}const Qm={name:"attention",resolveAll:hM,tokenize:mM};function hM(e,t){let a=-1,s,r,c,o,u,h,m,g;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(s=a;s--;)if(e[s][0]==="exit"&&e[s][1].type==="attentionSequence"&&e[s][1]._open&&t.sliceSerialize(e[s][1]).charCodeAt(0)===t.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[s][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[s][1].end.offset-e[s][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;h=e[s][1].end.offset-e[s][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;const p=T({},e[s][1].end),v=T({},e[a][1].start);f0(p,-h),f0(v,h),o={type:h>1?"strongSequence":"emphasisSequence",start:p,end:T({},e[s][1].end)},u={type:h>1?"strongSequence":"emphasisSequence",start:T({},e[a][1].start),end:v},c={type:h>1?"strongText":"emphasisText",start:T({},e[s][1].end),end:T({},e[a][1].start)},r={type:h>1?"strong":"emphasis",start:T({},o.start),end:T({},u.end)},e[s][1].end=T({},o.start),e[a][1].start=T({},u.end),m=[],e[s][1].end.offset-e[s][1].start.offset&&(m=ea(m,[["enter",e[s][1],t],["exit",e[s][1],t]])),m=ea(m,[["enter",r,t],["enter",o,t],["exit",o,t],["enter",c,t]]),m=ea(m,dd(t.parser.constructs.insideSpan.null,e.slice(s+1,a),t)),m=ea(m,[["exit",c,t],["enter",u,t],["exit",u,t],["exit",r,t]]),e[a][1].end.offset-e[a][1].start.offset?(g=2,m=ea(m,[["enter",e[a][1],t],["exit",e[a][1],t]])):g=0,Un(e,s-1,a-s+3,m),a=s+m.length-g-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function mM(e,t){const a=this.parser.constructs.attentionMarkers.null,s=this.previous,r=cl(s);let c;return o;function o(h){return c=h,e.enter("attentionSequence"),u(h)}function u(h){if(h===c)return e.consume(h),u;const m=e.exit("attentionSequence"),g=cl(h),p=!g||g===2&&r||a.includes(h),v=!r||r===2&&g||a.includes(s);return m._open=!!(c===42?p:p&&(r||!v)),m._close=!!(c===42?v:v&&(g||!p)),t(h)}}function f0(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const pM={name:"autolink",tokenize:gM};function gM(e,t,a){let s=0;return r;function r(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),c}function c(b){return hn(b)?(e.consume(b),o):b===64?a(b):m(b)}function o(b){return b===43||b===45||b===46||sn(b)?(s=1,u(b)):m(b)}function u(b){return b===58?(e.consume(b),s=0,h):(b===43||b===45||b===46||sn(b))&&s++<32?(e.consume(b),u):(s=0,m(b))}function h(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||Vu(b)?a(b):(e.consume(b),h)}function m(b){return b===64?(e.consume(b),g):sM(b)?(e.consume(b),m):a(b)}function g(b){return sn(b)?p(b):a(b)}function p(b){return b===46?(e.consume(b),s=0,g):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):v(b)}function v(b){if((b===45||sn(b))&&s++<63){const _=b===45?v:p;return e.consume(b),_}return a(b)}}const Yo={partial:!0,tokenize:yM};function yM(e,t,a){return s;function s(c){return Qe(c)?nt(e,r,"linePrefix")(c):r(c)}function r(c){return c===null||Oe(c)?t(c):a(c)}}const tS={continuation:{tokenize:bM},exit:xM,name:"blockQuote",tokenize:vM};function vM(e,t,a){const s=this;return r;function r(o){if(o===62){const u=s.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),c}return a(o)}function c(o){return Qe(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function bM(e,t,a){const s=this;return r;function r(o){return Qe(o)?nt(e,c,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):c(o)}function c(o){return e.attempt(tS,t,a)(o)}}function xM(e){e.exit("blockQuote")}const nS={name:"characterEscape",tokenize:_M};function _M(e,t,a){return s;function s(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),r}function r(c){return lM(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):a(c)}}const aS={name:"characterReference",tokenize:SM};function SM(e,t,a){const s=this;let r=0,c,o;return u;function u(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),h}function h(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),c=31,o=sn,g(p))}function m(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,o=rM,g):(e.enter("characterReferenceValue"),c=7,o=Xm,g(p))}function g(p){if(p===59&&r){const v=e.exit("characterReferenceValue");return o===sn&&!Xp(s.sliceSerialize(v))?a(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(p)&&r++<c?(e.consume(p),g):a(p)}}const h0={partial:!0,tokenize:CM},m0={concrete:!0,name:"codeFenced",tokenize:wM};function wM(e,t,a){const s=this,r={partial:!0,tokenize:I};let c=0,o=0,u;return h;function h(O){return m(O)}function m(O){const z=s.events[s.events.length-1];return c=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,u=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(O)}function g(O){return O===u?(o++,e.consume(O),g):o<3?a(O):(e.exit("codeFencedFenceSequence"),Qe(O)?nt(e,p,"whitespace")(O):p(O))}function p(O){return O===null||Oe(O)?(e.exit("codeFencedFence"),s.interrupt?t(O):e.check(h0,S,k)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(O))}function v(O){return O===null||Oe(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(O)):Qe(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),nt(e,b,"whitespace")(O)):O===96&&O===u?a(O):(e.consume(O),v)}function b(O){return O===null||Oe(O)?p(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),_(O))}function _(O){return O===null||Oe(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(O)):O===96&&O===u?a(O):(e.consume(O),_)}function S(O){return e.attempt(r,k,w)(O)}function w(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),C}function C(O){return c>0&&Qe(O)?nt(e,R,"linePrefix",c+1)(O):R(O)}function R(O){return O===null||Oe(O)?e.check(h0,S,k)(O):(e.enter("codeFlowValue"),j(O))}function j(O){return O===null||Oe(O)?(e.exit("codeFlowValue"),R(O)):(e.consume(O),j)}function k(O){return e.exit("codeFenced"),t(O)}function I(O,z,B){let P=0;return M;function M(Y){return O.enter("lineEnding"),O.consume(Y),O.exit("lineEnding"),U}function U(Y){return O.enter("codeFencedFence"),Qe(Y)?nt(O,F,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):F(Y)}function F(Y){return Y===u?(O.enter("codeFencedFenceSequence"),q(Y)):B(Y)}function q(Y){return Y===u?(P++,O.consume(Y),q):P>=o?(O.exit("codeFencedFenceSequence"),Qe(Y)?nt(O,H,"whitespace")(Y):H(Y)):B(Y)}function H(Y){return Y===null||Oe(Y)?(O.exit("codeFencedFence"),z(Y)):B(Y)}}}function CM(e,t,a){const s=this;return r;function r(o){return o===null?a(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),c)}function c(o){return s.parser.lazy[s.now().line]?a(o):t(o)}}const am={name:"codeIndented",tokenize:jM},NM={partial:!0,tokenize:kM};function jM(e,t,a){const s=this;return r;function r(m){return e.enter("codeIndented"),nt(e,c,"linePrefix",5)(m)}function c(m){const g=s.events[s.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?o(m):a(m)}function o(m){return m===null?h(m):Oe(m)?e.attempt(NM,o,h)(m):(e.enter("codeFlowValue"),u(m))}function u(m){return m===null||Oe(m)?(e.exit("codeFlowValue"),o(m)):(e.consume(m),u)}function h(m){return e.exit("codeIndented"),t(m)}}function kM(e,t,a){const s=this;return r;function r(o){return s.parser.lazy[s.now().line]?a(o):Oe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r):nt(e,c,"linePrefix",5)(o)}function c(o){const u=s.events[s.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(o):Oe(o)?r(o):a(o)}}const EM={name:"codeText",previous:TM,resolve:RM,tokenize:MM};function RM(e){let t=e.length-4,a=3,s,r;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(s=a;++s<t;)if(e[s][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[t][1].type="codeTextPadding",a+=2,t-=2;break}}for(s=a-1,t++;++s<=t;)r===void 0?s!==t&&e[s][1].type!=="lineEnding"&&(r=s):(s===t||e[s][1].type==="lineEnding")&&(e[r][1].type="codeTextData",s!==r+2&&(e[r][1].end=e[s-1][1].end,e.splice(r+2,s-r-2),t-=s-r-2,s=r+2),r=void 0);return e}function TM(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function MM(e,t,a){let s=0,r,c;return o;function o(p){return e.enter("codeText"),e.enter("codeTextSequence"),u(p)}function u(p){return p===96?(e.consume(p),s++,u):(e.exit("codeTextSequence"),h(p))}function h(p){return p===null?a(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),h):p===96?(c=e.enter("codeTextSequence"),r=0,g(p)):Oe(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),h):(e.enter("codeTextData"),m(p))}function m(p){return p===null||p===32||p===96||Oe(p)?(e.exit("codeTextData"),h(p)):(e.consume(p),m)}function g(p){return p===96?(e.consume(p),r++,g):r===s?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(c.type="codeTextData",m(p))}}class AM{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,a){const s=a!=null?a:Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(t,s):t>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(t,a,s){const r=a||0;this.setCursor(Math.trunc(t));const c=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return s&&po(this.left,s),c.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),po(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),po(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const a=this.left.splice(t,Number.POSITIVE_INFINITY);po(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);po(this.left,a.reverse())}}}function po(e,t){let a=0;if(t.length<1e4)e.push(...t);else for(;a<t.length;)e.push(...t.slice(a,a+1e4)),a+=1e4}function iS(e){const t={};let a=-1,s,r,c,o,u,h,m;const g=new AM(e);for(;++a<g.length;){for(;a in t;)a=t[a];if(s=g.get(a),a&&s[1].type==="chunkFlow"&&g.get(a-1)[1].type==="listItemPrefix"&&(h=s[1]._tokenizer.events,c=0,c<h.length&&h[c][1].type==="lineEndingBlank"&&(c+=2),c<h.length&&h[c][1].type==="content"))for(;++c<h.length&&h[c][1].type!=="content";)h[c][1].type==="chunkText"&&(h[c][1]._isInFirstContentOfListItem=!0,c++);if(s[0]==="enter")s[1].contentType&&(Object.assign(t,LM(g,a)),a=t[a],m=!0);else if(s[1]._container){for(c=a,r=void 0;c--;)if(o=g.get(c),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(r&&(g.get(r)[1].type="lineEndingBlank"),o[1].type="lineEnding",r=c);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;r&&(s[1].end=T({},g.get(r)[1].start),u=g.slice(r,a),u.unshift(s),g.splice(r,a-r+1,u))}}return Un(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!m}function LM(e,t){const a=e.get(t)[1],s=e.get(t)[2];let r=t-1;const c=[];let o=a._tokenizer;o||(o=s.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const u=o.events,h=[],m={};let g,p,v=-1,b=a,_=0,S=0;const w=[S];for(;b;){for(;e.get(++r)[1]!==b;);c.push(r),b._tokenizer||(g=s.sliceStream(b),b.next||g.push(null),p&&o.defineSkip(b.start),b._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(g),b._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),p=b,b=b.next}for(b=a;++v<u.length;)u[v][0]==="exit"&&u[v-1][0]==="enter"&&u[v][1].type===u[v-1][1].type&&u[v][1].start.line!==u[v][1].end.line&&(S=v+1,w.push(S),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(o.events=[],b?(b._tokenizer=void 0,b.previous=void 0):w.pop(),v=w.length;v--;){const C=u.slice(w[v],w[v+1]),R=c.pop();h.push([R,R+C.length-1]),e.splice(R,2,C)}for(h.reverse(),v=-1;++v<h.length;)m[_+h[v][0]]=_+h[v][1],_+=h[v][1]-h[v][0]-1;return m}const DM={resolve:zM,tokenize:IM},OM={partial:!0,tokenize:UM};function zM(e){return iS(e),e}function IM(e,t){let a;return s;function s(u){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),r(u)}function r(u){return u===null?c(u):Oe(u)?e.check(OM,o,c)(u):(e.consume(u),r)}function c(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function o(u){return e.consume(u),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,r}}function UM(e,t,a){const s=this;return r;function r(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),nt(e,c,"linePrefix")}function c(o){if(o===null||Oe(o))return a(o);const u=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(o):e.interrupt(s.parser.constructs.flow,a,t)(o)}}function sS(e,t,a,s,r,c,o,u,h){const m=h||Number.POSITIVE_INFINITY;let g=0;return p;function p(C){return C===60?(e.enter(s),e.enter(r),e.enter(c),e.consume(C),e.exit(c),v):C===null||C===32||C===41||Vu(C)?a(C):(e.enter(s),e.enter(o),e.enter(u),e.enter("chunkString",{contentType:"string"}),S(C))}function v(C){return C===62?(e.enter(c),e.consume(C),e.exit(c),e.exit(r),e.exit(s),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),b(C))}function b(C){return C===62?(e.exit("chunkString"),e.exit(u),v(C)):C===null||C===60||Oe(C)?a(C):(e.consume(C),C===92?_:b)}function _(C){return C===60||C===62||C===92?(e.consume(C),b):b(C)}function S(C){return!g&&(C===null||C===41||wt(C))?(e.exit("chunkString"),e.exit(u),e.exit(o),e.exit(s),t(C)):g<m&&C===40?(e.consume(C),g++,S):C===41?(e.consume(C),g--,S):C===null||C===32||C===40||Vu(C)?a(C):(e.consume(C),C===92?w:S)}function w(C){return C===40||C===41||C===92?(e.consume(C),S):S(C)}}function rS(e,t,a,s,r,c){const o=this;let u=0,h;return m;function m(b){return e.enter(s),e.enter(r),e.consume(b),e.exit(r),e.enter(c),g}function g(b){return u>999||b===null||b===91||b===93&&!h||b===94&&!u&&"_hiddenFootnoteSupport"in o.parser.constructs?a(b):b===93?(e.exit(c),e.enter(r),e.consume(b),e.exit(r),e.exit(s),t):Oe(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===null||b===91||b===93||Oe(b)||u++>999?(e.exit("chunkString"),g(b)):(e.consume(b),h||(h=!Qe(b)),b===92?v:p)}function v(b){return b===91||b===92||b===93?(e.consume(b),u++,p):p(b)}}function lS(e,t,a,s,r,c){let o;return u;function u(v){return v===34||v===39||v===40?(e.enter(s),e.enter(r),e.consume(v),e.exit(r),o=v===40?41:v,h):a(v)}function h(v){return v===o?(e.enter(r),e.consume(v),e.exit(r),e.exit(s),t):(e.enter(c),m(v))}function m(v){return v===o?(e.exit(c),h(o)):v===null?a(v):Oe(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),nt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===o||v===null||Oe(v)?(e.exit("chunkString"),m(v)):(e.consume(v),v===92?p:g)}function p(v){return v===o||v===92?(e.consume(v),g):g(v)}}function Ro(e,t){let a;return s;function s(r){return Oe(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),a=!0,s):Qe(r)?nt(e,s,a?"linePrefix":"lineSuffix")(r):t(r)}}const BM={name:"definition",tokenize:HM},FM={partial:!0,tokenize:PM};function HM(e,t,a){const s=this;let r;return c;function c(b){return e.enter("definition"),o(b)}function o(b){return rS.call(s,e,u,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function u(b){return r=da(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),h):a(b)}function h(b){return wt(b)?Ro(e,m)(b):m(b)}function m(b){return sS(e,g,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function g(b){return e.attempt(FM,p,p)(b)}function p(b){return Qe(b)?nt(e,v,"whitespace")(b):v(b)}function v(b){return b===null||Oe(b)?(e.exit("definition"),s.parser.defined.push(r),t(b)):a(b)}}function PM(e,t,a){return s;function s(u){return wt(u)?Ro(e,r)(u):a(u)}function r(u){return lS(e,c,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function c(u){return Qe(u)?nt(e,o,"whitespace")(u):o(u)}function o(u){return u===null||Oe(u)?t(u):a(u)}}const $M={name:"hardBreakEscape",tokenize:qM};function qM(e,t,a){return s;function s(c){return e.enter("hardBreakEscape"),e.consume(c),r}function r(c){return Oe(c)?(e.exit("hardBreakEscape"),t(c)):a(c)}}const VM={name:"headingAtx",resolve:YM,tokenize:GM};function YM(e,t){let a=e.length-2,s=3,r,c;return e[s][1].type==="whitespace"&&(s+=2),a-2>s&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(s===a-1||a-4>s&&e[a-2][1].type==="whitespace")&&(a-=s+1===a?2:4),a>s&&(r={type:"atxHeadingText",start:e[s][1].start,end:e[a][1].end},c={type:"chunkText",start:e[s][1].start,end:e[a][1].end,contentType:"text"},Un(e,s,a-s+1,[["enter",r,t],["enter",c,t],["exit",c,t],["exit",r,t]])),e}function GM(e,t,a){let s=0;return r;function r(g){return e.enter("atxHeading"),c(g)}function c(g){return e.enter("atxHeadingSequence"),o(g)}function o(g){return g===35&&s++<6?(e.consume(g),o):g===null||wt(g)?(e.exit("atxHeadingSequence"),u(g)):a(g)}function u(g){return g===35?(e.enter("atxHeadingSequence"),h(g)):g===null||Oe(g)?(e.exit("atxHeading"),t(g)):Qe(g)?nt(e,u,"whitespace")(g):(e.enter("atxHeadingText"),m(g))}function h(g){return g===35?(e.consume(g),h):(e.exit("atxHeadingSequence"),u(g))}function m(g){return g===null||g===35||wt(g)?(e.exit("atxHeadingText"),u(g)):(e.consume(g),m)}}const KM=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],p0=["pre","script","style","textarea"],XM={concrete:!0,name:"htmlFlow",resolveTo:JM,tokenize:WM},QM={partial:!0,tokenize:tA},ZM={partial:!0,tokenize:eA};function JM(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function WM(e,t,a){const s=this;let r,c,o,u,h;return m;function m(E){return g(E)}function g(E){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(E),p}function p(E){return E===33?(e.consume(E),v):E===47?(e.consume(E),c=!0,S):E===63?(e.consume(E),r=3,s.interrupt?t:D):hn(E)?(e.consume(E),o=String.fromCharCode(E),w):a(E)}function v(E){return E===45?(e.consume(E),r=2,b):E===91?(e.consume(E),r=5,u=0,_):hn(E)?(e.consume(E),r=4,s.interrupt?t:D):a(E)}function b(E){return E===45?(e.consume(E),s.interrupt?t:D):a(E)}function _(E){const W="CDATA[";return E===W.charCodeAt(u++)?(e.consume(E),u===W.length?s.interrupt?t:F:_):a(E)}function S(E){return hn(E)?(e.consume(E),o=String.fromCharCode(E),w):a(E)}function w(E){if(E===null||E===47||E===62||wt(E)){const W=E===47,oe=o.toLowerCase();return!W&&!c&&p0.includes(oe)?(r=1,s.interrupt?t(E):F(E)):KM.includes(o.toLowerCase())?(r=6,W?(e.consume(E),C):s.interrupt?t(E):F(E)):(r=7,s.interrupt&&!s.parser.lazy[s.now().line]?a(E):c?R(E):j(E))}return E===45||sn(E)?(e.consume(E),o+=String.fromCharCode(E),w):a(E)}function C(E){return E===62?(e.consume(E),s.interrupt?t:F):a(E)}function R(E){return Qe(E)?(e.consume(E),R):M(E)}function j(E){return E===47?(e.consume(E),M):E===58||E===95||hn(E)?(e.consume(E),k):Qe(E)?(e.consume(E),j):M(E)}function k(E){return E===45||E===46||E===58||E===95||sn(E)?(e.consume(E),k):I(E)}function I(E){return E===61?(e.consume(E),O):Qe(E)?(e.consume(E),I):j(E)}function O(E){return E===null||E===60||E===61||E===62||E===96?a(E):E===34||E===39?(e.consume(E),h=E,z):Qe(E)?(e.consume(E),O):B(E)}function z(E){return E===h?(e.consume(E),h=null,P):E===null||Oe(E)?a(E):(e.consume(E),z)}function B(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||wt(E)?I(E):(e.consume(E),B)}function P(E){return E===47||E===62||Qe(E)?j(E):a(E)}function M(E){return E===62?(e.consume(E),U):a(E)}function U(E){return E===null||Oe(E)?F(E):Qe(E)?(e.consume(E),U):a(E)}function F(E){return E===45&&r===2?(e.consume(E),$):E===60&&r===1?(e.consume(E),X):E===62&&r===4?(e.consume(E),he):E===63&&r===3?(e.consume(E),D):E===93&&r===5?(e.consume(E),fe):Oe(E)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(QM,ge,q)(E)):E===null||Oe(E)?(e.exit("htmlFlowData"),q(E)):(e.consume(E),F)}function q(E){return e.check(ZM,H,ge)(E)}function H(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),Y}function Y(E){return E===null||Oe(E)?q(E):(e.enter("htmlFlowData"),F(E))}function $(E){return E===45?(e.consume(E),D):F(E)}function X(E){return E===47?(e.consume(E),o="",Z):F(E)}function Z(E){if(E===62){const W=o.toLowerCase();return p0.includes(W)?(e.consume(E),he):F(E)}return hn(E)&&o.length<8?(e.consume(E),o+=String.fromCharCode(E),Z):F(E)}function fe(E){return E===93?(e.consume(E),D):F(E)}function D(E){return E===62?(e.consume(E),he):E===45&&r===2?(e.consume(E),D):F(E)}function he(E){return E===null||Oe(E)?(e.exit("htmlFlowData"),ge(E)):(e.consume(E),he)}function ge(E){return e.exit("htmlFlow"),t(E)}}function eA(e,t,a){const s=this;return r;function r(o){return Oe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),c):a(o)}function c(o){return s.parser.lazy[s.now().line]?a(o):t(o)}}function tA(e,t,a){return s;function s(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(Yo,t,a)}}const nA={name:"htmlText",tokenize:aA};function aA(e,t,a){const s=this;let r,c,o;return u;function u(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),h}function h(D){return D===33?(e.consume(D),m):D===47?(e.consume(D),I):D===63?(e.consume(D),j):hn(D)?(e.consume(D),B):a(D)}function m(D){return D===45?(e.consume(D),g):D===91?(e.consume(D),c=0,_):hn(D)?(e.consume(D),R):a(D)}function g(D){return D===45?(e.consume(D),b):a(D)}function p(D){return D===null?a(D):D===45?(e.consume(D),v):Oe(D)?(o=p,X(D)):(e.consume(D),p)}function v(D){return D===45?(e.consume(D),b):p(D)}function b(D){return D===62?$(D):D===45?v(D):p(D)}function _(D){const he="CDATA[";return D===he.charCodeAt(c++)?(e.consume(D),c===he.length?S:_):a(D)}function S(D){return D===null?a(D):D===93?(e.consume(D),w):Oe(D)?(o=S,X(D)):(e.consume(D),S)}function w(D){return D===93?(e.consume(D),C):S(D)}function C(D){return D===62?$(D):D===93?(e.consume(D),C):S(D)}function R(D){return D===null||D===62?$(D):Oe(D)?(o=R,X(D)):(e.consume(D),R)}function j(D){return D===null?a(D):D===63?(e.consume(D),k):Oe(D)?(o=j,X(D)):(e.consume(D),j)}function k(D){return D===62?$(D):j(D)}function I(D){return hn(D)?(e.consume(D),O):a(D)}function O(D){return D===45||sn(D)?(e.consume(D),O):z(D)}function z(D){return Oe(D)?(o=z,X(D)):Qe(D)?(e.consume(D),z):$(D)}function B(D){return D===45||sn(D)?(e.consume(D),B):D===47||D===62||wt(D)?P(D):a(D)}function P(D){return D===47?(e.consume(D),$):D===58||D===95||hn(D)?(e.consume(D),M):Oe(D)?(o=P,X(D)):Qe(D)?(e.consume(D),P):$(D)}function M(D){return D===45||D===46||D===58||D===95||sn(D)?(e.consume(D),M):U(D)}function U(D){return D===61?(e.consume(D),F):Oe(D)?(o=U,X(D)):Qe(D)?(e.consume(D),U):P(D)}function F(D){return D===null||D===60||D===61||D===62||D===96?a(D):D===34||D===39?(e.consume(D),r=D,q):Oe(D)?(o=F,X(D)):Qe(D)?(e.consume(D),F):(e.consume(D),H)}function q(D){return D===r?(e.consume(D),r=void 0,Y):D===null?a(D):Oe(D)?(o=q,X(D)):(e.consume(D),q)}function H(D){return D===null||D===34||D===39||D===60||D===61||D===96?a(D):D===47||D===62||wt(D)?P(D):(e.consume(D),H)}function Y(D){return D===47||D===62||wt(D)?P(D):a(D)}function $(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):a(D)}function X(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),Z}function Z(D){return Qe(D)?nt(e,fe,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):fe(D)}function fe(D){return e.enter("htmlTextData"),o(D)}}const Qp={name:"labelEnd",resolveAll:lA,resolveTo:oA,tokenize:cA},iA={tokenize:uA},sA={tokenize:dA},rA={tokenize:fA};function lA(e){let t=-1;const a=[];for(;++t<e.length;){const s=e[t][1];if(a.push(e[t]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const r=s.type==="labelImage"?4:2;s.type="data",t+=r}}return e.length!==a.length&&Un(e,0,e.length,a),e}function oA(e,t){let a=e.length,s=0,r,c,o,u;for(;a--;)if(r=e[a][1],c){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;e[a][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(o){if(e[a][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(c=a,r.type!=="labelLink")){s=2;break}}else r.type==="labelEnd"&&(o=a);const h={type:e[c][1].type==="labelLink"?"link":"image",start:T({},e[c][1].start),end:T({},e[e.length-1][1].end)},m={type:"label",start:T({},e[c][1].start),end:T({},e[o][1].end)},g={type:"labelText",start:T({},e[c+s+2][1].end),end:T({},e[o-2][1].start)};return u=[["enter",h,t],["enter",m,t]],u=ea(u,e.slice(c+1,c+s+3)),u=ea(u,[["enter",g,t]]),u=ea(u,dd(t.parser.constructs.insideSpan.null,e.slice(c+s+4,o-3),t)),u=ea(u,[["exit",g,t],e[o-2],e[o-1],["exit",m,t]]),u=ea(u,e.slice(o+1)),u=ea(u,[["exit",h,t]]),Un(e,c,e.length,u),e}function cA(e,t,a){const s=this;let r=s.events.length,c,o;for(;r--;)if((s.events[r][1].type==="labelImage"||s.events[r][1].type==="labelLink")&&!s.events[r][1]._balanced){c=s.events[r][1];break}return u;function u(v){return c?c._inactive?p(v):(o=s.parser.defined.includes(da(s.sliceSerialize({start:c.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),h):a(v)}function h(v){return v===40?e.attempt(iA,g,o?g:p)(v):v===91?e.attempt(sA,g,o?m:p)(v):o?g(v):p(v)}function m(v){return e.attempt(rA,g,p)(v)}function g(v){return t(v)}function p(v){return c._balanced=!0,a(v)}}function uA(e,t,a){return s;function s(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),r}function r(p){return wt(p)?Ro(e,c)(p):c(p)}function c(p){return p===41?g(p):sS(e,o,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function o(p){return wt(p)?Ro(e,h)(p):g(p)}function u(p){return a(p)}function h(p){return p===34||p===39||p===40?lS(e,m,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):g(p)}function m(p){return wt(p)?Ro(e,g)(p):g(p)}function g(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):a(p)}}function dA(e,t,a){const s=this;return r;function r(u){return rS.call(s,e,c,o,"reference","referenceMarker","referenceString")(u)}function c(u){return s.parser.defined.includes(da(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(u):a(u)}function o(u){return a(u)}}function fA(e,t,a){return s;function s(c){return e.enter("reference"),e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),r}function r(c){return c===93?(e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),e.exit("reference"),t):a(c)}}const hA={name:"labelStartImage",resolveAll:Qp.resolveAll,tokenize:mA};function mA(e,t,a){const s=this;return r;function r(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),c}function c(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),o):a(u)}function o(u){return u===94&&"_hiddenFootnoteSupport"in s.parser.constructs?a(u):t(u)}}const pA={name:"labelStartLink",resolveAll:Qp.resolveAll,tokenize:gA};function gA(e,t,a){const s=this;return r;function r(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),c}function c(o){return o===94&&"_hiddenFootnoteSupport"in s.parser.constructs?a(o):t(o)}}const im={name:"lineEnding",tokenize:yA};function yA(e,t){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),nt(e,t,"linePrefix")}}const Au={name:"thematicBreak",tokenize:vA};function vA(e,t,a){let s=0,r;return c;function c(m){return e.enter("thematicBreak"),o(m)}function o(m){return r=m,u(m)}function u(m){return m===r?(e.enter("thematicBreakSequence"),h(m)):s>=3&&(m===null||Oe(m))?(e.exit("thematicBreak"),t(m)):a(m)}function h(m){return m===r?(e.consume(m),s++,h):(e.exit("thematicBreakSequence"),Qe(m)?nt(e,u,"whitespace")(m):u(m))}}const xn={continuation:{tokenize:SA},exit:CA,name:"list",tokenize:_A},bA={partial:!0,tokenize:NA},xA={partial:!0,tokenize:wA};function _A(e,t,a){const s=this,r=s.events[s.events.length-1];let c=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,o=0;return u;function u(b){const _=s.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(_==="listUnordered"?!s.containerState.marker||b===s.containerState.marker:Xm(b)){if(s.containerState.type||(s.containerState.type=_,e.enter(_,{_container:!0})),_==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(Au,a,m)(b):m(b);if(!s.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(b)}return a(b)}function h(b){return Xm(b)&&++o<10?(e.consume(b),h):(!s.interrupt||o<2)&&(s.containerState.marker?b===s.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),m(b)):a(b)}function m(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||b,e.check(Yo,s.interrupt?a:g,e.attempt(bA,v,p))}function g(b){return s.containerState.initialBlankLine=!0,c++,v(b)}function p(b){return Qe(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),v):a(b)}function v(b){return s.containerState.size=c+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function SA(e,t,a){const s=this;return s.containerState._closeFlow=void 0,e.check(Yo,r,c);function r(u){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,nt(e,t,"listItemIndent",s.containerState.size+1)(u)}function c(u){return s.containerState.furtherBlankLines||!Qe(u)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,o(u)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(xA,t,o)(u))}function o(u){return s.containerState._closeFlow=!0,s.interrupt=void 0,nt(e,e.attempt(xn,t,a),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function wA(e,t,a){const s=this;return nt(e,r,"listItemIndent",s.containerState.size+1);function r(c){const o=s.events[s.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===s.containerState.size?t(c):a(c)}}function CA(e){e.exit(this.containerState.type)}function NA(e,t,a){const s=this;return nt(e,r,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(c){const o=s.events[s.events.length-1];return!Qe(c)&&o&&o[1].type==="listItemPrefixWhitespace"?t(c):a(c)}}const g0={name:"setextUnderline",resolveTo:jA,tokenize:kA};function jA(e,t){let a=e.length,s,r,c;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){s=a;break}e[a][1].type==="paragraph"&&(r=a)}else e[a][1].type==="content"&&e.splice(a,1),!c&&e[a][1].type==="definition"&&(c=a);const o={type:"setextHeading",start:T({},e[s][1].start),end:T({},e[e.length-1][1].end)};return e[r][1].type="setextHeadingText",c?(e.splice(r,0,["enter",o,t]),e.splice(c+1,0,["exit",e[s][1],t]),e[s][1].end=T({},e[c][1].end)):e[s][1]=o,e.push(["exit",o,t]),e}function kA(e,t,a){const s=this;let r;return c;function c(m){let g=s.events.length,p;for(;g--;)if(s.events[g][1].type!=="lineEnding"&&s.events[g][1].type!=="linePrefix"&&s.events[g][1].type!=="content"){p=s.events[g][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||p)?(e.enter("setextHeadingLine"),r=m,o(m)):a(m)}function o(m){return e.enter("setextHeadingLineSequence"),u(m)}function u(m){return m===r?(e.consume(m),u):(e.exit("setextHeadingLineSequence"),Qe(m)?nt(e,h,"lineSuffix")(m):h(m))}function h(m){return m===null||Oe(m)?(e.exit("setextHeadingLine"),t(m)):a(m)}}const EA={tokenize:RA};function RA(e){const t=this,a=e.attempt(Yo,s,e.attempt(this.parser.constructs.flowInitial,r,nt(e,e.attempt(this.parser.constructs.flow,r,e.attempt(DM,r)),"linePrefix")));return a;function s(c){if(c===null){e.consume(c);return}return e.enter("lineEndingBlank"),e.consume(c),e.exit("lineEndingBlank"),t.currentConstruct=void 0,a}function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),t.currentConstruct=void 0,a}}const TA={resolveAll:cS()},MA=oS("string"),AA=oS("text");function oS(e){return{resolveAll:cS(e==="text"?LA:void 0),tokenize:t};function t(a){const s=this,r=this.parser.constructs[e],c=a.attempt(r,o,u);return o;function o(g){return m(g)?c(g):u(g)}function u(g){if(g===null){a.consume(g);return}return a.enter("data"),a.consume(g),h}function h(g){return m(g)?(a.exit("data"),c(g)):(a.consume(g),h)}function m(g){if(g===null)return!0;const p=r[g];let v=-1;if(p)for(;++v<p.length;){const b=p[v];if(!b.previous||b.previous.call(s,s.previous))return!0}return!1}}}function cS(e){return t;function t(a,s){let r=-1,c;for(;++r<=a.length;)c===void 0?a[r]&&a[r][1].type==="data"&&(c=r,r++):(!a[r]||a[r][1].type!=="data")&&(r!==c+2&&(a[c][1].end=a[r-1][1].end,a.splice(c+2,r-c-2),r=c+2),c=void 0);return e?e(a,s):a}}function LA(e,t){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){const s=e[a-1][1],r=t.sliceStream(s);let c=r.length,o=-1,u=0,h;for(;c--;){const m=r[c];if(typeof m=="string"){for(o=m.length;m.charCodeAt(o-1)===32;)u++,o--;if(o)break;o=-1}else if(m===-2)h=!0,u++;else if(m!==-1){c++;break}}if(t._contentTypeTextTrailing&&a===e.length&&(u=0),u){const m={type:a===e.length||h||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?o:s.start._bufferIndex+o,_index:s.start._index+c,line:s.end.line,column:s.end.column-u,offset:s.end.offset-u},end:T({},s.end)};s.end=T({},m.start),s.start.offset===s.end.offset?Object.assign(s,m):(e.splice(a,0,["enter",m,t],["exit",m,t]),a+=2)}a++}return e}const DA={42:xn,43:xn,45:xn,48:xn,49:xn,50:xn,51:xn,52:xn,53:xn,54:xn,55:xn,56:xn,57:xn,62:tS},OA={91:BM},zA={[-2]:am,[-1]:am,32:am},IA={35:VM,42:Au,45:[g0,Au],60:XM,61:g0,95:Au,96:m0,126:m0},UA={38:aS,92:nS},BA={[-5]:im,[-4]:im,[-3]:im,33:hA,38:aS,42:Qm,60:[pM,nA],91:pA,92:[$M,nS],93:Qp,95:Qm,96:EM},FA={null:[Qm,TA]},HA={null:[42,95]},PA={null:[]},$A=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:HA,contentInitial:OA,disable:PA,document:DA,flow:IA,flowInitial:zA,insideSpan:FA,string:UA,text:BA},Symbol.toStringTag,{value:"Module"}));function qA(e,t,a){let s={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const r={},c=[];let o=[],u=[];const h={attempt:z(I),check:z(O),consume:R,enter:j,exit:k,interrupt:z(O,{interrupt:!0})},m={code:null,containerState:{},defineSkip:S,events:[],now:_,parser:e,previous:null,sliceSerialize:v,sliceStream:b,write:p};let g=t.tokenize.call(m,h);return t.resolveAll&&c.push(t),m;function p(U){return o=ea(o,U),w(),o[o.length-1]!==null?[]:(B(t,0),m.events=dd(c,m.events,m),m.events)}function v(U,F){return YA(b(U),F)}function b(U){return VA(o,U)}function _(){const{_bufferIndex:U,_index:F,line:q,column:H,offset:Y}=s;return{_bufferIndex:U,_index:F,line:q,column:H,offset:Y}}function S(U){r[U.line]=U.column,M()}function w(){let U;for(;s._index<o.length;){const F=o[s._index];if(typeof F=="string")for(U=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===U&&s._bufferIndex<F.length;)C(F.charCodeAt(s._bufferIndex));else C(F)}}function C(U){g=g(U)}function R(U){Oe(U)?(s.line++,s.column=1,s.offset+=U===-3?2:1,M()):U!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===o[s._index].length&&(s._bufferIndex=-1,s._index++)),m.previous=U}function j(U,F){const q=F||{};return q.type=U,q.start=_(),m.events.push(["enter",q,m]),u.push(q),q}function k(U){const F=u.pop();return F.end=_(),m.events.push(["exit",F,m]),F}function I(U,F){B(U,F.from)}function O(U,F){F.restore()}function z(U,F){return q;function q(H,Y,$){let X,Z,fe,D;return Array.isArray(H)?ge(H):"tokenize"in H?ge([H]):he(H);function he(me){return _e;function _e(be){const Ae=be!==null&&me[be],Ge=be!==null&&me.null,ot=[...Array.isArray(Ae)?Ae:Ae?[Ae]:[],...Array.isArray(Ge)?Ge:Ge?[Ge]:[]];return ge(ot)(be)}}function ge(me){return X=me,Z=0,me.length===0?$:E(me[Z])}function E(me){return _e;function _e(be){return D=P(),fe=me,me.partial||(m.currentConstruct=me),me.name&&m.parser.constructs.disable.null.includes(me.name)?oe():me.tokenize.call(F?Object.assign(Object.create(m),F):m,h,W,oe)(be)}}function W(me){return U(fe,D),Y}function oe(me){return D.restore(),++Z<X.length?E(X[Z]):$}}}function B(U,F){U.resolveAll&&!c.includes(U)&&c.push(U),U.resolve&&Un(m.events,F,m.events.length-F,U.resolve(m.events.slice(F),m)),U.resolveTo&&(m.events=U.resolveTo(m.events,m))}function P(){const U=_(),F=m.previous,q=m.currentConstruct,H=m.events.length,Y=Array.from(u);return{from:H,restore:$};function $(){s=U,m.previous=F,m.currentConstruct=q,m.events.length=H,u=Y,M()}}function M(){s.line in r&&s.column<2&&(s.column=r[s.line],s.offset+=r[s.line]-1)}}function VA(e,t){const a=t.start._index,s=t.start._bufferIndex,r=t.end._index,c=t.end._bufferIndex;let o;if(a===r)o=[e[a].slice(s,c)];else{if(o=e.slice(a,r),s>-1){const u=o[0];typeof u=="string"?o[0]=u.slice(s):o.shift()}c>0&&o.push(e[r].slice(0,c))}return o}function YA(e,t){let a=-1;const s=[];let r;for(;++a<e.length;){const c=e[a];let o;if(typeof c=="string")o=c;else switch(c){case-5:{o="\r";break}case-4:{o=`
51
+ `;break}case-3:{o=`\r
52
+ `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&r)continue;o=" ";break}default:o=String.fromCharCode(c)}r=c===-2,s.push(o)}return s.join("")}function GA(e){const t={constructs:W_([$A,...(e||{}).extensions||[]]),content:a(oM),defined:[],document:a(uM),flow:a(EA),lazy:{},string:a(MA),text:a(AA)};return t;function a(s){return r;function r(c){return qA(t,s,c)}}}function KA(e){for(;!iS(e););return e}const y0=/[\0\t\n\r]/g;function XA(){let e=1,t="",a=!0,s;return r;function r(c,o,u){const h=[];let m,g,p,v,b;for(c=t+(typeof c=="string"?c.toString():new TextDecoder(o||void 0).decode(c)),p=0,t="",a&&(c.charCodeAt(0)===65279&&p++,a=void 0);p<c.length;){if(y0.lastIndex=p,m=y0.exec(c),v=m&&m.index!==void 0?m.index:c.length,b=c.charCodeAt(v),!m){t=c.slice(p);break}if(b===10&&p===v&&s)h.push(-3),s=void 0;else switch(s&&(h.push(-5),s=void 0),p<v&&(h.push(c.slice(p,v)),e+=v-p),b){case 0:{h.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,h.push(-2);e++<g;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:s=!0,e=1}p=v+1}return u&&(s&&h.push(-5),t&&h.push(t),h.push(null)),h}}const QA=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ZA(e){return e.replace(QA,JA)}function JA(e,t,a){if(t)return t;if(a.charCodeAt(0)===35){const s=a.charCodeAt(1),r=s===120||s===88;return eS(a.slice(r?2:1),r?16:10)}return Xp(a)||e}const uS={}.hasOwnProperty;function WA(e,t,a){return t&&typeof t=="object"&&(a=t,t=void 0),eL(a)(KA(GA(a).document().write(XA()(e,t,!0))))}function eL(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(Fe),autolinkProtocol:P,autolinkEmail:P,atxHeading:c(qe),blockQuote:c(Ge),characterEscape:P,characterReference:P,codeFenced:c(ot),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:c(ot,o),codeText:c(qt,o),codeTextData:P,data:P,codeFlowValue:P,definition:c(at),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:c(Ie),hardBreakEscape:c(bt),hardBreakTrailing:c(bt),htmlFlow:c(ke,o),htmlFlowData:P,htmlText:c(ke,o),htmlTextData:P,image:c(ct),label:o,link:c(Fe),listItem:c(pa),listItemValue:v,listOrdered:c(ma,p),listUnordered:c(ma),paragraph:c(Ta),reference:E,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:c(qe),strong:c(ri),thematicBreak:c(as)},exit:{atxHeading:h(),atxHeadingSequence:I,autolink:h(),autolinkEmail:Ae,autolinkProtocol:be,blockQuote:h(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:oe,characterReferenceMarkerNumeric:oe,characterReferenceValue:me,characterReference:_e,codeFenced:h(w),codeFencedFence:S,codeFencedFenceInfo:b,codeFencedFenceMeta:_,codeFlowValue:M,codeIndented:h(C),codeText:h(Y),codeTextData:M,data:M,definition:h(),definitionDestinationString:k,definitionLabelString:R,definitionTitleString:j,emphasis:h(),hardBreakEscape:h(F),hardBreakTrailing:h(F),htmlFlow:h(q),htmlFlowData:M,htmlText:h(H),htmlTextData:M,image:h(X),label:fe,labelText:Z,lineEnding:U,link:h($),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:W,resourceDestinationString:D,resourceTitleString:he,resource:ge,setextHeading:h(B),setextHeadingLineSequence:z,setextHeadingText:O,strong:h(),thematicBreak:h()}};dS(t,(e||{}).mdastExtensions||[]);const a={};return s;function s(re){let ve={type:"root",children:[]};const Ee={stack:[ve],tokenStack:[],config:t,enter:u,exit:m,buffer:o,resume:g,data:a},We=[];let Re=-1;for(;++Re<re.length;)if(re[Re][1].type==="listOrdered"||re[Re][1].type==="listUnordered")if(re[Re][0]==="enter")We.push(Re);else{const xt=We.pop();Re=r(re,xt,Re)}for(Re=-1;++Re<re.length;){const xt=t[re[Re][0]];uS.call(xt,re[Re][1].type)&&xt[re[Re][1].type].call(Object.assign({sliceSerialize:re[Re][2].sliceSerialize},Ee),re[Re][1])}if(Ee.tokenStack.length>0){const xt=Ee.tokenStack[Ee.tokenStack.length-1];(xt[1]||v0).call(Ee,void 0,xt[0])}for(ve.position={start:Li(re.length>0?re[0][1].start:{line:1,column:1,offset:0}),end:Li(re.length>0?re[re.length-2][1].end:{line:1,column:1,offset:0})},Re=-1;++Re<t.transforms.length;)ve=t.transforms[Re](ve)||ve;return ve}function r(re,ve,Ee){let We=ve-1,Re=-1,xt=!1,Ct,Tt,Nt,pt;for(;++We<=Ee;){const ut=re[We];switch(ut[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ut[0]==="enter"?Re++:Re--,pt=void 0;break}case"lineEndingBlank":{ut[0]==="enter"&&(Ct&&!pt&&!Re&&!Nt&&(Nt=We),pt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:pt=void 0}if(!Re&&ut[0]==="enter"&&ut[1].type==="listItemPrefix"||Re===-1&&ut[0]==="exit"&&(ut[1].type==="listUnordered"||ut[1].type==="listOrdered")){if(Ct){let ga=We;for(Tt=void 0;ga--;){const nn=re[ga];if(nn[1].type==="lineEnding"||nn[1].type==="lineEndingBlank"){if(nn[0]==="exit")continue;Tt&&(re[Tt][1].type="lineEndingBlank",xt=!0),nn[1].type="lineEnding",Tt=ga}else if(!(nn[1].type==="linePrefix"||nn[1].type==="blockQuotePrefix"||nn[1].type==="blockQuotePrefixWhitespace"||nn[1].type==="blockQuoteMarker"||nn[1].type==="listItemIndent"))break}Nt&&(!Tt||Nt<Tt)&&(Ct._spread=!0),Ct.end=Object.assign({},Tt?re[Tt][1].start:ut[1].end),re.splice(Tt||We,0,["exit",Ct,ut[2]]),We++,Ee++}if(ut[1].type==="listItemPrefix"){const ga={type:"listItem",_spread:!1,start:Object.assign({},ut[1].start),end:void 0};Ct=ga,re.splice(We,0,["enter",ga,ut[2]]),We++,Ee++,Nt=void 0,pt=!0}}}return re[ve][1]._spread=xt,Ee}function c(re,ve){return Ee;function Ee(We){u.call(this,re(We),We),ve&&ve.call(this,We)}}function o(){this.stack.push({type:"fragment",children:[]})}function u(re,ve,Ee){this.stack[this.stack.length-1].children.push(re),this.stack.push(re),this.tokenStack.push([ve,Ee||void 0]),re.position={start:Li(ve.start),end:void 0}}function h(re){return ve;function ve(Ee){re&&re.call(this,Ee),m.call(this,Ee)}}function m(re,ve){const Ee=this.stack.pop(),We=this.tokenStack.pop();if(We)We[0].type!==re.type&&(ve?ve.call(this,re,We[0]):(We[1]||v0).call(this,re,We[0]));else throw new Error("Cannot close `"+re.type+"` ("+Eo({start:re.start,end:re.end})+"): it’s not open");Ee.position.end=Li(re.end)}function g(){return Kp(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function v(re){if(this.data.expectingFirstListItemValue){const ve=this.stack[this.stack.length-2];ve.start=Number.parseInt(this.sliceSerialize(re),10),this.data.expectingFirstListItemValue=void 0}}function b(){const re=this.resume(),ve=this.stack[this.stack.length-1];ve.lang=re}function _(){const re=this.resume(),ve=this.stack[this.stack.length-1];ve.meta=re}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const re=this.resume(),ve=this.stack[this.stack.length-1];ve.value=re.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const re=this.resume(),ve=this.stack[this.stack.length-1];ve.value=re.replace(/(\r?\n|\r)$/g,"")}function R(re){const ve=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=ve,Ee.identifier=da(this.sliceSerialize(re)).toLowerCase()}function j(){const re=this.resume(),ve=this.stack[this.stack.length-1];ve.title=re}function k(){const re=this.resume(),ve=this.stack[this.stack.length-1];ve.url=re}function I(re){const ve=this.stack[this.stack.length-1];if(!ve.depth){const Ee=this.sliceSerialize(re).length;ve.depth=Ee}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function z(re){const ve=this.stack[this.stack.length-1];ve.depth=this.sliceSerialize(re).codePointAt(0)===61?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function P(re){const ve=this.stack[this.stack.length-1].children;let Ee=ve[ve.length-1];(!Ee||Ee.type!=="text")&&(Ee=At(),Ee.position={start:Li(re.start),end:void 0},ve.push(Ee)),this.stack.push(Ee)}function M(re){const ve=this.stack.pop();ve.value+=this.sliceSerialize(re),ve.position.end=Li(re.end)}function U(re){const ve=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ee=ve.children[ve.children.length-1];Ee.position.end=Li(re.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ve.type)&&(P.call(this,re),M.call(this,re))}function F(){this.data.atHardBreak=!0}function q(){const re=this.resume(),ve=this.stack[this.stack.length-1];ve.value=re}function H(){const re=this.resume(),ve=this.stack[this.stack.length-1];ve.value=re}function Y(){const re=this.resume(),ve=this.stack[this.stack.length-1];ve.value=re}function $(){const re=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";re.type+="Reference",re.referenceType=ve,delete re.url,delete re.title}else delete re.identifier,delete re.label;this.data.referenceType=void 0}function X(){const re=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";re.type+="Reference",re.referenceType=ve,delete re.url,delete re.title}else delete re.identifier,delete re.label;this.data.referenceType=void 0}function Z(re){const ve=this.sliceSerialize(re),Ee=this.stack[this.stack.length-2];Ee.label=ZA(ve),Ee.identifier=da(ve).toLowerCase()}function fe(){const re=this.stack[this.stack.length-1],ve=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){const We=re.children;Ee.children=We}else Ee.alt=ve}function D(){const re=this.resume(),ve=this.stack[this.stack.length-1];ve.url=re}function he(){const re=this.resume(),ve=this.stack[this.stack.length-1];ve.title=re}function ge(){this.data.inReference=void 0}function E(){this.data.referenceType="collapsed"}function W(re){const ve=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=ve,Ee.identifier=da(this.sliceSerialize(re)).toLowerCase(),this.data.referenceType="full"}function oe(re){this.data.characterReferenceType=re.type}function me(re){const ve=this.sliceSerialize(re),Ee=this.data.characterReferenceType;let We;Ee?(We=eS(ve,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):We=Xp(ve);const Re=this.stack[this.stack.length-1];Re.value+=We}function _e(re){const ve=this.stack.pop();ve.position.end=Li(re.end)}function be(re){M.call(this,re);const ve=this.stack[this.stack.length-1];ve.url=this.sliceSerialize(re)}function Ae(re){M.call(this,re);const ve=this.stack[this.stack.length-1];ve.url="mailto:"+this.sliceSerialize(re)}function Ge(){return{type:"blockquote",children:[]}}function ot(){return{type:"code",lang:null,meta:null,value:""}}function qt(){return{type:"inlineCode",value:""}}function at(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ie(){return{type:"emphasis",children:[]}}function qe(){return{type:"heading",depth:0,children:[]}}function bt(){return{type:"break"}}function ke(){return{type:"html",value:""}}function ct(){return{type:"image",title:null,url:"",alt:null}}function Fe(){return{type:"link",title:null,url:"",children:[]}}function ma(re){return{type:"list",ordered:re.type==="listOrdered",start:null,spread:re._spread,children:[]}}function pa(re){return{type:"listItem",spread:re._spread,checked:null,children:[]}}function Ta(){return{type:"paragraph",children:[]}}function ri(){return{type:"strong",children:[]}}function At(){return{type:"text",value:""}}function as(){return{type:"thematicBreak"}}}function Li(e){return{line:e.line,column:e.column,offset:e.offset}}function dS(e,t){let a=-1;for(;++a<t.length;){const s=t[a];Array.isArray(s)?dS(e,s):tL(e,s)}}function tL(e,t){let a;for(a in t)if(uS.call(t,a))switch(a){case"canContainEols":{const s=t[a];s&&e[a].push(...s);break}case"transforms":{const s=t[a];s&&e[a].push(...s);break}case"enter":case"exit":{const s=t[a];s&&Object.assign(e[a],s);break}}}function v0(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Eo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Eo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Eo({start:t.start,end:t.end})+") is still open")}function nL(e){const t=this;t.parser=a;function a(s){return WA(s,K(T(T({},t.data("settings")),e),{extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]}))}}function aL(e,t){const a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,a),e.applyData(t,a)}function iL(e,t){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,a),[e.applyData(t,a),{type:"text",value:`
53
+ `}]}function sL(e,t){const a=t.value?t.value+`
54
+ `:"",s={},r=t.lang?t.lang.split(/\s+/):[];r.length>0&&(s.className=["language-"+r[0]]);let c={type:"element",tagName:"code",properties:s,children:[{type:"text",value:a}]};return t.meta&&(c.data={meta:t.meta}),e.patch(t,c),c=e.applyData(t,c),c={type:"element",tagName:"pre",properties:{},children:[c]},e.patch(t,c),c}function rL(e,t){const a={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function lL(e,t){const a={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function oL(e,t){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(t.identifier).toUpperCase(),r=ml(s.toLowerCase()),c=e.footnoteOrder.indexOf(s);let o,u=e.footnoteCounts.get(s);u===void 0?(u=0,e.footnoteOrder.push(s),o=e.footnoteOrder.length):o=c+1,u+=1,e.footnoteCounts.set(s,u);const h={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+r,id:a+"fnref-"+r+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,h);const m={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,m),e.applyData(t,m)}function cL(e,t){const a={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function uL(e,t){if(e.options.allowDangerousHtml){const a={type:"raw",value:t.value};return e.patch(t,a),e.applyData(t,a)}}function fS(e,t){const a=t.referenceType;let s="]";if(a==="collapsed"?s+="[]":a==="full"&&(s+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+s}];const r=e.all(t),c=r[0];c&&c.type==="text"?c.value="["+c.value:r.unshift({type:"text",value:"["});const o=r[r.length-1];return o&&o.type==="text"?o.value+=s:r.push({type:"text",value:s}),r}function dL(e,t){const a=String(t.identifier).toUpperCase(),s=e.definitionById.get(a);if(!s)return fS(e,t);const r={src:ml(s.url||""),alt:t.alt};s.title!==null&&s.title!==void 0&&(r.title=s.title);const c={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,c),e.applyData(t,c)}function fL(e,t){const a={src:ml(t.url)};t.alt!==null&&t.alt!==void 0&&(a.alt=t.alt),t.title!==null&&t.title!==void 0&&(a.title=t.title);const s={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,s),e.applyData(t,s)}function hL(e,t){const a={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,a);const s={type:"element",tagName:"code",properties:{},children:[a]};return e.patch(t,s),e.applyData(t,s)}function mL(e,t){const a=String(t.identifier).toUpperCase(),s=e.definitionById.get(a);if(!s)return fS(e,t);const r={href:ml(s.url||"")};s.title!==null&&s.title!==void 0&&(r.title=s.title);const c={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,c),e.applyData(t,c)}function pL(e,t){const a={href:ml(t.url)};t.title!==null&&t.title!==void 0&&(a.title=t.title);const s={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function gL(e,t,a){const s=e.all(t),r=a?yL(a):hS(t),c={},o=[];if(typeof t.checked=="boolean"){const g=s[0];let p;g&&g.type==="element"&&g.tagName==="p"?p=g:(p={type:"element",tagName:"p",properties:{},children:[]},s.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let u=-1;for(;++u<s.length;){const g=s[u];(r||u!==0||g.type!=="element"||g.tagName!=="p")&&o.push({type:"text",value:`
55
+ `}),g.type==="element"&&g.tagName==="p"&&!r?o.push(...g.children):o.push(g)}const h=s[s.length-1];h&&(r||h.type!=="element"||h.tagName!=="p")&&o.push({type:"text",value:`
56
+ `});const m={type:"element",tagName:"li",properties:c,children:o};return e.patch(t,m),e.applyData(t,m)}function yL(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const a=e.children;let s=-1;for(;!t&&++s<a.length;)t=hS(a[s])}return t}function hS(e){const t=e.spread;return t!=null?t:e.children.length>1}function vL(e,t){const a={},s=e.all(t);let r=-1;for(typeof t.start=="number"&&t.start!==1&&(a.start=t.start);++r<s.length;){const o=s[r];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}const c={type:"element",tagName:t.ordered?"ol":"ul",properties:a,children:e.wrap(s,!0)};return e.patch(t,c),e.applyData(t,c)}function bL(e,t){const a={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function xL(e,t){const a={type:"root",children:e.wrap(e.all(t))};return e.patch(t,a),e.applyData(t,a)}function _L(e,t){const a={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function SL(e,t){const a=e.all(t),s=a.shift(),r=[];if(s){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(t.children[0],o),r.push(o)}if(a.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},u=qp(t.children[1]),h=Y_(t.children[t.children.length-1]);u&&h&&(o.position={start:u,end:h}),r.push(o)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,c),e.applyData(t,c)}function wL(e,t,a){const s=a?a.children:void 0,r=(s?s.indexOf(t):1)===0?"th":"td",c=a&&a.type==="table"?a.align:void 0,o=c?c.length:t.children.length;let u=-1;const h=[];for(;++u<o;){const g=t.children[u],p={},v=c?c[u]:void 0;v&&(p.align=v);let b={type:"element",tagName:r,properties:p,children:[]};g&&(b.children=e.all(g),e.patch(g,b),b=e.applyData(g,b)),h.push(b)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,m),e.applyData(t,m)}function CL(e,t){const a={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}const b0=9,x0=32;function NL(e){const t=String(e),a=/\r?\n|\r/g;let s=a.exec(t),r=0;const c=[];for(;s;)c.push(_0(t.slice(r,s.index),r>0,!0),s[0]),r=s.index+s[0].length,s=a.exec(t);return c.push(_0(t.slice(r),r>0,!1)),c.join("")}function _0(e,t,a){let s=0,r=e.length;if(t){let c=e.codePointAt(s);for(;c===b0||c===x0;)s++,c=e.codePointAt(s)}if(a){let c=e.codePointAt(r-1);for(;c===b0||c===x0;)r--,c=e.codePointAt(r-1)}return r>s?e.slice(s,r):""}function jL(e,t){const a={type:"text",value:NL(String(t.value))};return e.patch(t,a),e.applyData(t,a)}function kL(e,t){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,a),e.applyData(t,a)}const EL={blockquote:aL,break:iL,code:sL,delete:rL,emphasis:lL,footnoteReference:oL,heading:cL,html:uL,imageReference:dL,image:fL,inlineCode:hL,linkReference:mL,link:pL,listItem:gL,list:vL,paragraph:bL,root:xL,strong:_L,table:SL,tableCell:CL,tableRow:wL,text:jL,thematicBreak:kL,toml:yu,yaml:yu,definition:yu,footnoteDefinition:yu};function yu(){}const mS=-1,fd=0,To=1,Yu=2,Zp=3,Jp=4,Wp=5,eg=6,pS=7,gS=8,RL=typeof self=="object"?self:globalThis,S0=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new RL[e](t)},TL=(e,t)=>{const a=(r,c)=>(e.set(c,r),r),s=r=>{if(e.has(r))return e.get(r);const[c,o]=t[r];switch(c){case fd:case mS:return a(o,r);case To:{const u=a([],r);for(const h of o)u.push(s(h));return u}case Yu:{const u=a({},r);for(const[h,m]of o)u[s(h)]=s(m);return u}case Zp:return a(new Date(o),r);case Jp:{const{source:u,flags:h}=o;return a(new RegExp(u,h),r)}case Wp:{const u=a(new Map,r);for(const[h,m]of o)u.set(s(h),s(m));return u}case eg:{const u=a(new Set,r);for(const h of o)u.add(s(h));return u}case pS:{const{name:u,message:h}=o;return a(S0(u,h),r)}case gS:return a(BigInt(o),r);case"BigInt":return a(Object(BigInt(o)),r);case"ArrayBuffer":return a(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:u}=new Uint8Array(o);return a(new DataView(u),o)}}return a(S0(c,o),r)};return s},w0=e=>TL(new Map,e)(0),Fr="",{toString:ML}={},{keys:AL}=Object,go=e=>{const t=typeof e;if(t!=="object"||!e)return[fd,t];const a=ML.call(e).slice(8,-1);switch(a){case"Array":return[To,Fr];case"Object":return[Yu,Fr];case"Date":return[Zp,Fr];case"RegExp":return[Jp,Fr];case"Map":return[Wp,Fr];case"Set":return[eg,Fr];case"DataView":return[To,a]}return a.includes("Array")?[To,a]:a.includes("Error")?[pS,a]:[Yu,a]},vu=([e,t])=>e===fd&&(t==="function"||t==="symbol"),LL=(e,t,a,s)=>{const r=(o,u)=>{const h=s.push(o)-1;return a.set(u,h),h},c=o=>{if(a.has(o))return a.get(o);let[u,h]=go(o);switch(u){case fd:{let g=o;switch(h){case"bigint":u=gS,g=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);g=null;break;case"undefined":return r([mS],o)}return r([u,g],o)}case To:{if(h){let v=o;return h==="DataView"?v=new Uint8Array(o.buffer):h==="ArrayBuffer"&&(v=new Uint8Array(o)),r([h,[...v]],o)}const g=[],p=r([u,g],o);for(const v of o)g.push(c(v));return p}case Yu:{if(h)switch(h){case"BigInt":return r([h,o.toString()],o);case"Boolean":case"Number":case"String":return r([h,o.valueOf()],o)}if(t&&"toJSON"in o)return c(o.toJSON());const g=[],p=r([u,g],o);for(const v of AL(o))(e||!vu(go(o[v])))&&g.push([c(v),c(o[v])]);return p}case Zp:return r([u,o.toISOString()],o);case Jp:{const{source:g,flags:p}=o;return r([u,{source:g,flags:p}],o)}case Wp:{const g=[],p=r([u,g],o);for(const[v,b]of o)(e||!(vu(go(v))||vu(go(b))))&&g.push([c(v),c(b)]);return p}case eg:{const g=[],p=r([u,g],o);for(const v of o)(e||!vu(go(v)))&&g.push(c(v));return p}}const{message:m}=o;return r([u,{name:h,message:m}],o)};return c},C0=(e,{json:t,lossy:a}={})=>{const s=[];return LL(!(t||a),!!t,new Map,s)(e),s},Gu=typeof structuredClone=="function"?((e,t)=>t&&("json"in t||"lossy"in t)?w0(C0(e,t)):structuredClone(e)):(e,t)=>w0(C0(e,t));function DL(e,t){const a=[{type:"text",value:"↩"}];return t>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),a}function OL(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function zL(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||DL,s=e.options.footnoteBackLabel||OL,r=e.options.footnoteLabel||"Footnotes",c=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let h=-1;for(;++h<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[h]);if(!m)continue;const g=e.all(m),p=String(m.identifier).toUpperCase(),v=ml(p.toLowerCase());let b=0;const _=[],S=e.footnoteCounts.get(p);for(;S!==void 0&&++b<=S;){_.length>0&&_.push({type:"text",value:" "});let R=typeof a=="string"?a:a(h,b);typeof R=="string"&&(R={type:"text",value:R}),_.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(h,b),className:["data-footnote-backref"]},children:Array.isArray(R)?R:[R]})}const w=g[g.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const R=w.children[w.children.length-1];R&&R.type==="text"?R.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(..._)}else g.push(..._);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(g,!0)};e.patch(m,C),u.push(C)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:K(T({},Gu(o)),{id:"footnote-label"}),children:[{type:"text",value:r}]},{type:"text",value:`
57
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
58
+ `}]}}const hd=(function(e){if(e==null)return FL;if(typeof e=="function")return md(e);if(typeof e=="object")return Array.isArray(e)?IL(e):UL(e);if(typeof e=="string")return BL(e);throw new Error("Expected function, string, or object as test")});function IL(e){const t=[];let a=-1;for(;++a<e.length;)t[a]=hd(e[a]);return md(s);function s(...r){let c=-1;for(;++c<t.length;)if(t[c].apply(this,r))return!0;return!1}}function UL(e){const t=e;return md(a);function a(s){const r=s;let c;for(c in e)if(r[c]!==t[c])return!1;return!0}}function BL(e){return md(t);function t(a){return a&&a.type===e}}function md(e){return t;function t(a,s,r){return!!(HL(a)&&e.call(this,a,typeof s=="number"?s:void 0,r||void 0))}}function FL(){return!0}function HL(e){return e!==null&&typeof e=="object"&&"type"in e}const yS=[],PL=!0,Zm=!1,$L="skip";function vS(e,t,a,s){let r;typeof t=="function"&&typeof a!="function"?(s=a,a=t):r=t;const c=hd(r),o=s?-1:1;u(e,void 0,[])();function u(h,m,g){const p=h&&typeof h=="object"?h:{};if(typeof p.type=="string"){const b=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(h.type+(b?"<"+b+">":""))+")"})}return v;function v(){let b=yS,_,S,w;if((!t||c(h,m,g[g.length-1]||void 0))&&(b=qL(a(h,g)),b[0]===Zm))return b;if("children"in h&&h.children){const C=h;if(C.children&&b[0]!==$L)for(S=(s?C.children.length:-1)+o,w=g.concat(C);S>-1&&S<C.children.length;){const R=C.children[S];if(_=u(R,S,w)(),_[0]===Zm)return _;S=typeof _[1]=="number"?_[1]:S+o}}return b}}}function qL(e){return Array.isArray(e)?e:typeof e=="number"?[PL,e]:e==null?yS:[e]}function tg(e,t,a,s){let r,c,o;typeof t=="function"&&typeof a!="function"?(c=void 0,o=t,r=a):(c=t,o=a,r=s),vS(e,c,u,r);function u(h,m){const g=m[m.length-1],p=g?g.children.indexOf(h):void 0;return o(h,p,g)}}const Jm={}.hasOwnProperty,VL={};function YL(e,t){const a=t||VL,s=new Map,r=new Map,c=new Map,o=T(T({},EL),a.handlers),u={all:m,applyData:KL,definitionById:s,footnoteById:r,footnoteCounts:c,footnoteOrder:[],handlers:o,one:h,options:a,patch:GL,wrap:QL};return tg(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const p=g.type==="definition"?s:r,v=String(g.identifier).toUpperCase();p.has(v)||p.set(v,g)}}),u;function h(g,p){const v=g.type,b=u.handlers[v];if(Jm.call(u.handlers,v)&&b)return b(u,g,p);if(u.options.passThrough&&u.options.passThrough.includes(v)){if("children"in g){const _=g,{children:S}=_,w=de(_,["children"]),C=Gu(w);return C.children=u.all(g),C}return Gu(g)}return(u.options.unknownHandler||XL)(u,g,p)}function m(g){const p=[];if("children"in g){const v=g.children;let b=-1;for(;++b<v.length;){const _=u.one(v[b],g);if(_){if(b&&v[b-1].type==="break"&&(!Array.isArray(_)&&_.type==="text"&&(_.value=N0(_.value)),!Array.isArray(_)&&_.type==="element")){const S=_.children[0];S&&S.type==="text"&&(S.value=N0(S.value))}Array.isArray(_)?p.push(..._):p.push(_)}}}return p}}function GL(e,t){e.position&&(t.position=DT(e))}function KL(e,t){let a=t;if(e&&e.data){const s=e.data.hName,r=e.data.hChildren,c=e.data.hProperties;if(typeof s=="string")if(a.type==="element")a.tagName=s;else{const o="children"in a?a.children:[a];a={type:"element",tagName:s,properties:{},children:o}}a.type==="element"&&c&&Object.assign(a.properties,Gu(c)),"children"in a&&a.children&&r!==null&&r!==void 0&&(a.children=r)}return a}function XL(e,t){const a=t.data||{},s="value"in t&&!(Jm.call(a,"hProperties")||Jm.call(a,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function QL(e,t){const a=[];let s=-1;for(t&&a.push({type:"text",value:`
59
+ `});++s<e.length;)s&&a.push({type:"text",value:`
60
+ `}),a.push(e[s]);return t&&e.length>0&&a.push({type:"text",value:`
61
+ `}),a}function N0(e){let t=0,a=e.charCodeAt(t);for(;a===9||a===32;)t++,a=e.charCodeAt(t);return e.slice(t)}function j0(e,t){const a=YL(e,t),s=a.one(e,void 0),r=zL(a),c=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return r&&c.children.push({type:"text",value:`
62
+ `},r),c}function ZL(e,t){return e&&"run"in e?function(a,s){return Ue(this,null,function*(){const r=j0(a,T({file:s},t));yield e.run(r,s)})}:function(a,s){return j0(a,T({file:s},e||t))}}function k0(e){if(e)throw e}var Lu=Object.prototype.hasOwnProperty,bS=Object.prototype.toString,E0=Object.defineProperty,R0=Object.getOwnPropertyDescriptor,T0=function(e){return typeof Array.isArray=="function"?Array.isArray(e):bS.call(e)==="[object Array]"},M0=function(e){if(!e||bS.call(e)!=="[object Object]")return!1;var t=Lu.call(e,"constructor"),a=e.constructor&&e.constructor.prototype&&Lu.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!t&&!a)return!1;var s;for(s in e);return typeof s>"u"||Lu.call(e,s)},A0=function(e,t){E0&&t.name==="__proto__"?E0(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},L0=function(e,t){if(t==="__proto__")if(Lu.call(e,t)){if(R0)return R0(e,t).value}else return;return e[t]},JL=function e(){var t,a,s,r,c,o,u=arguments[0],h=1,m=arguments.length,g=!1;for(typeof u=="boolean"&&(g=u,u=arguments[1]||{},h=2),(u==null||typeof u!="object"&&typeof u!="function")&&(u={});h<m;++h)if(t=arguments[h],t!=null)for(a in t)s=L0(u,a),r=L0(t,a),u!==r&&(g&&r&&(M0(r)||(c=T0(r)))?(c?(c=!1,o=s&&T0(s)?s:[]):o=s&&M0(s)?s:{},A0(u,{name:a,newValue:e(g,o,r)})):typeof r<"u"&&A0(u,{name:a,newValue:r}));return u};const sm=V_(JL);function Wm(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function WL(){const e=[],t={run:a,use:s};return t;function a(...r){let c=-1;const o=r.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);u(null,...r);function u(h,...m){const g=e[++c];let p=-1;if(h){o(h);return}for(;++p<r.length;)(m[p]===null||m[p]===void 0)&&(m[p]=r[p]);r=m,g?eD(g,u)(...m):o(null,...m)}}function s(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return e.push(r),t}}function eD(e,t){let a;return s;function s(...o){const u=e.length>o.length;let h;u&&o.push(r);try{h=e.apply(this,o)}catch(m){const g=m;if(u&&a)throw g;return r(g)}u||(h&&h.then&&typeof h.then=="function"?h.then(c,r):h instanceof Error?r(h):c(h))}function r(o,...u){a||(a=!0,t(o,...u))}function c(o){r(null,o)}}const Sa={basename:tD,dirname:nD,extname:aD,join:iD,sep:"/"};function tD(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Go(e);let a=0,s=-1,r=e.length,c;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(c){a=r+1;break}}else s<0&&(c=!0,s=r+1);return s<0?"":e.slice(a,s)}if(t===e)return"";let o=-1,u=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(c){a=r+1;break}}else o<0&&(c=!0,o=r+1),u>-1&&(e.codePointAt(r)===t.codePointAt(u--)?u<0&&(s=r):(u=-1,s=o));return a===s?s=o:s<0&&(s=e.length),e.slice(a,s)}function nD(e){if(Go(e),e.length===0)return".";let t=-1,a=e.length,s;for(;--a;)if(e.codePointAt(a)===47){if(s){t=a;break}}else s||(s=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function aD(e){Go(e);let t=e.length,a=-1,s=0,r=-1,c=0,o;for(;t--;){const u=e.codePointAt(t);if(u===47){if(o){s=t+1;break}continue}a<0&&(o=!0,a=t+1),u===46?r<0?r=t:c!==1&&(c=1):r>-1&&(c=-1)}return r<0||a<0||c===0||c===1&&r===a-1&&r===s+1?"":e.slice(r,a)}function iD(...e){let t=-1,a;for(;++t<e.length;)Go(e[t]),e[t]&&(a=a===void 0?e[t]:a+"/"+e[t]);return a===void 0?".":sD(a)}function sD(e){Go(e);const t=e.codePointAt(0)===47;let a=rD(e,!t);return a.length===0&&!t&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),t?"/"+a:a}function rD(e,t){let a="",s=0,r=-1,c=0,o=-1,u,h;for(;++o<=e.length;){if(o<e.length)u=e.codePointAt(o);else{if(u===47)break;u=47}if(u===47){if(!(r===o-1||c===1))if(r!==o-1&&c===2){if(a.length<2||s!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(h=a.lastIndexOf("/"),h!==a.length-1){h<0?(a="",s=0):(a=a.slice(0,h),s=a.length-1-a.lastIndexOf("/")),r=o,c=0;continue}}else if(a.length>0){a="",s=0,r=o,c=0;continue}}t&&(a=a.length>0?a+"/..":"..",s=2)}else a.length>0?a+="/"+e.slice(r+1,o):a=e.slice(r+1,o),s=o-r-1;r=o,c=0}else u===46&&c>-1?c++:c=-1}return a}function Go(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const lD={cwd:oD};function oD(){return"/"}function ep(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function cD(e){if(typeof e=="string")e=new URL(e);else if(!ep(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return uD(e)}function uD(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const t=e.pathname;let a=-1;for(;++a<t.length;)if(t.codePointAt(a)===37&&t.codePointAt(a+1)===50){const s=t.codePointAt(a+2);if(s===70||s===102){const r=new TypeError("File URL path must not include encoded / characters");throw r.code="ERR_INVALID_FILE_URL_PATH",r}}return decodeURIComponent(t)}const rm=["history","path","basename","stem","extname","dirname"];class xS{constructor(t){let a;t?ep(t)?a={path:t}:typeof t=="string"||dD(t)?a={value:t}:a=t:a={},this.cwd="cwd"in a?"":lD.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<rm.length;){const c=rm[s];c in a&&a[c]!==void 0&&a[c]!==null&&(this[c]=c==="history"?[...a[c]]:a[c])}let r;for(r in a)rm.includes(r)||(this[r]=a[r])}get basename(){return typeof this.path=="string"?Sa.basename(this.path):void 0}set basename(t){om(t,"basename"),lm(t,"basename"),this.path=Sa.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Sa.dirname(this.path):void 0}set dirname(t){D0(this.basename,"dirname"),this.path=Sa.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Sa.extname(this.path):void 0}set extname(t){if(lm(t,"extname"),D0(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Sa.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ep(t)&&(t=cD(t)),om(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Sa.basename(this.path,this.extname):void 0}set stem(t){om(t,"stem"),lm(t,"stem"),this.path=Sa.join(this.dirname||"",t+(this.extname||""))}fail(t,a,s){const r=this.message(t,a,s);throw r.fatal=!0,r}info(t,a,s){const r=this.message(t,a,s);return r.fatal=void 0,r}message(t,a,s){const r=new ln(t,a,s);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function lm(e,t){if(e&&e.includes(Sa.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Sa.sep+"`")}function om(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function D0(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function dD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const fD=(function(e){const t=this.constructor.prototype,a=t[e],s=function(){return a.apply(s,arguments)};return Object.setPrototypeOf(s,t),s}),hD={}.hasOwnProperty;class ng extends fD{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=WL()}copy(){const t=new ng;let a=-1;for(;++a<this.attachers.length;){const s=this.attachers[a];t.use(...s)}return t.data(sm(!0,{},this.namespace)),t}data(t,a){return typeof t=="string"?arguments.length===2?(dm("data",this.frozen),this.namespace[t]=a,this):hD.call(this.namespace,t)&&this.namespace[t]||void 0:t?(dm("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[a,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const r=a.call(t,...s);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const a=bu(t),s=this.parser||this.Parser;return cm("parse",s),s(String(a),a)}process(t,a){const s=this;return this.freeze(),cm("process",this.parser||this.Parser),um("process",this.compiler||this.Compiler),a?r(void 0,a):new Promise(r);function r(c,o){const u=bu(t),h=s.parse(u);s.run(h,u,function(g,p,v){if(g||!p||!v)return m(g);const b=p,_=s.stringify(b,v);gD(_)?v.value=_:v.result=_,m(g,v)});function m(g,p){g||!p?o(g):c?c(p):a(void 0,p)}}}processSync(t){let a=!1,s;return this.freeze(),cm("processSync",this.parser||this.Parser),um("processSync",this.compiler||this.Compiler),this.process(t,r),z0("processSync","process",a),s;function r(c,o){a=!0,k0(c),s=o}}run(t,a,s){O0(t),this.freeze();const r=this.transformers;return!s&&typeof a=="function"&&(s=a,a=void 0),s?c(void 0,s):new Promise(c);function c(o,u){const h=bu(a);r.run(t,h,m);function m(g,p,v){const b=p||t;g?u(g):o?o(b):s(void 0,b,v)}}}runSync(t,a){let s=!1,r;return this.run(t,a,c),z0("runSync","run",s),r;function c(o,u){k0(o),r=u,s=!0}}stringify(t,a){this.freeze();const s=bu(a),r=this.compiler||this.Compiler;return um("stringify",r),O0(t),r(t,s)}use(t,...a){const s=this.attachers,r=this.namespace;if(dm("use",this.frozen),t!=null)if(typeof t=="function")h(t,a);else if(typeof t=="object")Array.isArray(t)?u(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function c(m){if(typeof m=="function")h(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[g,...p]=m;h(g,p)}else o(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function o(m){if(!("plugins"in m)&&!("settings"in m))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(m.plugins),m.settings&&(r.settings=sm(!0,r.settings,m.settings))}function u(m){let g=-1;if(m!=null)if(Array.isArray(m))for(;++g<m.length;){const p=m[g];c(p)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function h(m,g){let p=-1,v=-1;for(;++p<s.length;)if(s[p][0]===m){v=p;break}if(v===-1)s.push([m,...g]);else if(g.length>0){let[b,..._]=g;const S=s[v][1];Wm(S)&&Wm(b)&&(b=sm(!0,S,b)),s[v]=[m,b,..._]}}}}const mD=new ng().freeze();function cm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function um(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function dm(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function O0(e){if(!Wm(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function z0(e,t,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function bu(e){return pD(e)?e:new xS(e)}function pD(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function gD(e){return typeof e=="string"||yD(e)}function yD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const vD="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",I0=[],U0={allowDangerousHtml:!0},bD=/^(https?|ircs?|mailto|xmpp)$/i,xD=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function _D(e){const t=SD(e),a=wD(e);return CD(t.runSync(t.parse(a),a),e)}function SD(e){const t=e.rehypePlugins||I0,a=e.remarkPlugins||I0,s=e.remarkRehypeOptions?T(T({},e.remarkRehypeOptions),U0):U0;return mD().use(nL).use(a).use(ZL,s).use(t)}function wD(e){const t=e.children||"",a=new xS;return typeof t=="string"&&(a.value=t),a}function CD(e,t){const a=t.allowedElements,s=t.allowElement,r=t.components,c=t.disallowedElements,o=t.skipHtml,u=t.unwrapDisallowed,h=t.urlTransform||ND;for(const g of xD)Object.hasOwn(t,g.from)&&""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+vD+g.id;return tg(e,m),BT(e,{Fragment:f.Fragment,components:r,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function m(g,p,v){if(g.type==="raw"&&v&&typeof p=="number")return o?v.children.splice(p,1):v.children[p]={type:"text",value:g.value},p;if(g.type==="element"){let b;for(b in nm)if(Object.hasOwn(nm,b)&&Object.hasOwn(g.properties,b)){const _=g.properties[b],S=nm[b];(S===null||S.includes(g.tagName))&&(g.properties[b]=h(String(_||""),b,g))}}if(g.type==="element"){let b=a?!a.includes(g.tagName):c?c.includes(g.tagName):!1;if(!b&&s&&typeof p=="number"&&(b=!s(g,p,v)),b&&v&&typeof p=="number")return u&&g.children?v.children.splice(p,1,...g.children):v.children.splice(p,1),p}}}function ND(e){const t=e.indexOf(":"),a=e.indexOf("?"),s=e.indexOf("#"),r=e.indexOf("/");return t===-1||r!==-1&&t>r||a!==-1&&t>a||s!==-1&&t>s||bD.test(e.slice(0,t))?e:""}function B0(e,t){const a=String(e);if(typeof t!="string")throw new TypeError("Expected character");let s=0,r=a.indexOf(t);for(;r!==-1;)s++,r=a.indexOf(t,r+t.length);return s}function jD(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function kD(e,t,a){const s=hd((a||{}).ignore||[]),r=ED(t);let c=-1;for(;++c<r.length;)vS(e,"text",o);function o(h,m){let g=-1,p;for(;++g<m.length;){const v=m[g],b=p?p.children:void 0;if(s(v,b?b.indexOf(v):void 0,p))return;p=v}if(p)return u(h,m)}function u(h,m){const g=m[m.length-1],p=r[c][0],v=r[c][1];let b=0;const _=g.children.indexOf(h);let S=!1,w=[];p.lastIndex=0;let C=p.exec(h.value);for(;C;){const R=C.index,j={index:C.index,input:C.input,stack:[...m,h]};let k=v(...C,j);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1?p.lastIndex=R+1:(b!==R&&w.push({type:"text",value:h.value.slice(b,R)}),Array.isArray(k)?w.push(...k):k&&w.push(k),b=R+C[0].length,S=!0),!p.global)break;C=p.exec(h.value)}return S?(b<h.value.length&&w.push({type:"text",value:h.value.slice(b)}),g.children.splice(_,1,...w)):w=[h],_+w.length}}function ED(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!e[0]||Array.isArray(e[0])?e:[e];let s=-1;for(;++s<a.length;){const r=a[s];t.push([RD(r[0]),TD(r[1])])}return t}function RD(e){return typeof e=="string"?new RegExp(jD(e),"g"):e}function TD(e){return typeof e=="function"?e:function(){return e}}const fm="phrasing",hm=["autolink","link","image","label"];function MD(){return{transforms:[UD],enter:{literalAutolink:LD,literalAutolinkEmail:mm,literalAutolinkHttp:mm,literalAutolinkWww:mm},exit:{literalAutolink:ID,literalAutolinkEmail:zD,literalAutolinkHttp:DD,literalAutolinkWww:OD}}}function AD(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:fm,notInConstruct:hm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:fm,notInConstruct:hm},{character:":",before:"[ps]",after:"\\/",inConstruct:fm,notInConstruct:hm}]}}function LD(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function mm(e){this.config.enter.autolinkProtocol.call(this,e)}function DD(e){this.config.exit.autolinkProtocol.call(this,e)}function OD(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function zD(e){this.config.exit.autolinkEmail.call(this,e)}function ID(e){this.exit(e)}function UD(e){kD(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,BD],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),FD]],{ignore:["link","linkReference"]})}function BD(e,t,a,s,r){let c="";if(!_S(r)||(/^w/i.test(t)&&(a=t+a,t="",c="http://"),!HD(a)))return!1;const o=PD(a+s);if(!o[0])return!1;const u={type:"link",title:null,url:c+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[u,{type:"text",value:o[1]}]:u}function FD(e,t,a,s){return!_S(s,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+a,children:[{type:"text",value:t+"@"+a}]}}function HD(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function PD(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let a=t[0],s=a.indexOf(")");const r=B0(e,"(");let c=B0(e,")");for(;s!==-1&&r>c;)e+=a.slice(0,s+1),a=a.slice(s+1),s=a.indexOf(")"),c++;return[e,a]}function _S(e,t){const a=e.input.charCodeAt(e.index-1);return(e.index===0||Gs(a)||ud(a))&&(!t||a!==47)}SS.peek=ZD;function $D(){this.buffer()}function qD(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function VD(){this.buffer()}function YD(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function GD(e){const t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=da(this.sliceSerialize(e)).toLowerCase(),a.label=t}function KD(e){this.exit(e)}function XD(e){const t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=da(this.sliceSerialize(e)).toLowerCase(),a.label=t}function QD(e){this.exit(e)}function ZD(){return"["}function SS(e,t,a,s){const r=a.createTracker(s);let c=r.move("[^");const o=a.enter("footnoteReference"),u=a.enter("reference");return c+=r.move(a.safe(a.associationId(e),{after:"]",before:c})),u(),o(),c+=r.move("]"),c}function JD(){return{enter:{gfmFootnoteCallString:$D,gfmFootnoteCall:qD,gfmFootnoteDefinitionLabelString:VD,gfmFootnoteDefinition:YD},exit:{gfmFootnoteCallString:GD,gfmFootnoteCall:KD,gfmFootnoteDefinitionLabelString:XD,gfmFootnoteDefinition:QD}}}function WD(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:a,footnoteReference:SS},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(s,r,c,o){const u=c.createTracker(o);let h=u.move("[^");const m=c.enter("footnoteDefinition"),g=c.enter("label");return h+=u.move(c.safe(c.associationId(s),{before:h,after:"]"})),g(),h+=u.move("]:"),s.children&&s.children.length>0&&(u.shift(4),h+=u.move((t?`
63
+ `:" ")+c.indentLines(c.containerFlow(s,u.current()),t?wS:e3))),m(),h}}function e3(e,t,a){return t===0?e:wS(e,t,a)}function wS(e,t,a){return(a?"":" ")+e}const t3=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];CS.peek=r3;function n3(){return{canContainEols:["delete"],enter:{strikethrough:i3},exit:{strikethrough:s3}}}function a3(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:t3}],handlers:{delete:CS}}}function i3(e){this.enter({type:"delete",children:[]},e)}function s3(e){this.exit(e)}function CS(e,t,a,s){const r=a.createTracker(s),c=a.enter("strikethrough");let o=r.move("~~");return o+=a.containerPhrasing(e,K(T({},r.current()),{before:o,after:"~"})),o+=r.move("~~"),c(),o}function r3(){return"~"}function l3(e){return e.length}function o3(e,t){const a=t||{},s=(a.align||[]).concat(),r=a.stringLength||l3,c=[],o=[],u=[],h=[];let m=0,g=-1;for(;++g<e.length;){const S=[],w=[];let C=-1;for(e[g].length>m&&(m=e[g].length);++C<e[g].length;){const R=c3(e[g][C]);if(a.alignDelimiters!==!1){const j=r(R);w[C]=j,(h[C]===void 0||j>h[C])&&(h[C]=j)}S.push(R)}o[g]=S,u[g]=w}let p=-1;if(typeof s=="object"&&"length"in s)for(;++p<m;)c[p]=F0(s[p]);else{const S=F0(s);for(;++p<m;)c[p]=S}p=-1;const v=[],b=[];for(;++p<m;){const S=c[p];let w="",C="";S===99?(w=":",C=":"):S===108?w=":":S===114&&(C=":");let R=a.alignDelimiters===!1?1:Math.max(1,h[p]-w.length-C.length);const j=w+"-".repeat(R)+C;a.alignDelimiters!==!1&&(R=w.length+R+C.length,R>h[p]&&(h[p]=R),b[p]=R),v[p]=j}o.splice(1,0,v),u.splice(1,0,b),g=-1;const _=[];for(;++g<o.length;){const S=o[g],w=u[g];p=-1;const C=[];for(;++p<m;){const R=S[p]||"";let j="",k="";if(a.alignDelimiters!==!1){const I=h[p]-(w[p]||0),O=c[p];O===114?j=" ".repeat(I):O===99?I%2?(j=" ".repeat(I/2+.5),k=" ".repeat(I/2-.5)):(j=" ".repeat(I/2),k=j):k=" ".repeat(I)}a.delimiterStart!==!1&&!p&&C.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&R==="")&&(a.delimiterStart!==!1||p)&&C.push(" "),a.alignDelimiters!==!1&&C.push(j),C.push(R),a.alignDelimiters!==!1&&C.push(k),a.padding!==!1&&C.push(" "),(a.delimiterEnd!==!1||p!==m-1)&&C.push("|")}_.push(a.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return _.join(`
64
+ `)}function c3(e){return e==null?"":String(e)}function F0(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function u3(e,t,a,s){const r=a.enter("blockquote"),c=a.createTracker(s);c.move("> "),c.shift(2);const o=a.indentLines(a.containerFlow(e,c.current()),d3);return r(),o}function d3(e,t,a){return">"+(a?"":" ")+e}function f3(e,t){return H0(e,t.inConstruct,!0)&&!H0(e,t.notInConstruct,!1)}function H0(e,t,a){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return a;let s=-1;for(;++s<t.length;)if(e.includes(t[s]))return!0;return!1}function P0(e,t,a,s){let r=-1;for(;++r<a.unsafe.length;)if(a.unsafe[r].character===`
65
+ `&&f3(a.stack,a.unsafe[r]))return/[ \t]/.test(s.before)?"":" ";return`\\
66
+ `}function h3(e,t){const a=String(e);let s=a.indexOf(t),r=s,c=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;s!==-1;)s===r?++c>o&&(o=c):c=1,r=s+t.length,s=a.indexOf(t,r);return o}function m3(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function p3(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function g3(e,t,a,s){const r=p3(a),c=e.value||"",o=r==="`"?"GraveAccent":"Tilde";if(m3(e,a)){const p=a.enter("codeIndented"),v=a.indentLines(c,y3);return p(),v}const u=a.createTracker(s),h=r.repeat(Math.max(h3(c,r)+1,3)),m=a.enter("codeFenced");let g=u.move(h);if(e.lang){const p=a.enter(`codeFencedLang${o}`);g+=u.move(a.safe(e.lang,T({before:g,after:" ",encode:["`"]},u.current()))),p()}if(e.lang&&e.meta){const p=a.enter(`codeFencedMeta${o}`);g+=u.move(" "),g+=u.move(a.safe(e.meta,T({before:g,after:`
67
+ `,encode:["`"]},u.current()))),p()}return g+=u.move(`
68
+ `),c&&(g+=u.move(c+`
69
+ `)),g+=u.move(h),m(),g}function y3(e,t,a){return(a?"":" ")+e}function ag(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function v3(e,t,a,s){const r=ag(a),c=r==='"'?"Quote":"Apostrophe",o=a.enter("definition");let u=a.enter("label");const h=a.createTracker(s);let m=h.move("[");return m+=h.move(a.safe(a.associationId(e),T({before:m,after:"]"},h.current()))),m+=h.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=a.enter("destinationLiteral"),m+=h.move("<"),m+=h.move(a.safe(e.url,T({before:m,after:">"},h.current()))),m+=h.move(">")):(u=a.enter("destinationRaw"),m+=h.move(a.safe(e.url,T({before:m,after:e.title?" ":`
70
+ `},h.current())))),u(),e.title&&(u=a.enter(`title${c}`),m+=h.move(" "+r),m+=h.move(a.safe(e.title,T({before:m,after:r},h.current()))),m+=h.move(r),u()),o(),m}function b3(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Bo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Ku(e,t,a){const s=cl(e),r=cl(t);return s===void 0?r===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:s===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}NS.peek=x3;function NS(e,t,a,s){const r=b3(a),c=a.enter("emphasis"),o=a.createTracker(s),u=o.move(r);let h=o.move(a.containerPhrasing(e,T({after:r,before:u},o.current())));const m=h.charCodeAt(0),g=Ku(s.before.charCodeAt(s.before.length-1),m,r);g.inside&&(h=Bo(m)+h.slice(1));const p=h.charCodeAt(h.length-1),v=Ku(s.after.charCodeAt(0),p,r);v.inside&&(h=h.slice(0,-1)+Bo(p));const b=o.move(r);return c(),a.attentionEncodeSurroundingInfo={after:v.outside,before:g.outside},u+h+b}function x3(e,t,a){return a.options.emphasis||"*"}function _3(e,t){let a=!1;return tg(e,function(s){if("value"in s&&/\r?\n|\r/.test(s.value)||s.type==="break")return a=!0,Zm}),!!((!e.depth||e.depth<3)&&Kp(e)&&(t.options.setext||a))}function S3(e,t,a,s){const r=Math.max(Math.min(6,e.depth||1),1),c=a.createTracker(s);if(_3(e,a)){const g=a.enter("headingSetext"),p=a.enter("phrasing"),v=a.containerPhrasing(e,K(T({},c.current()),{before:`
71
+ `,after:`
72
+ `}));return p(),g(),v+`
73
+ `+(r===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
74
+ `))+1))}const o="#".repeat(r),u=a.enter("headingAtx"),h=a.enter("phrasing");c.move(o+" ");let m=a.containerPhrasing(e,T({before:"# ",after:`
75
+ `},c.current()));return/^[\t ]/.test(m)&&(m=Bo(m.charCodeAt(0))+m.slice(1)),m=m?o+" "+m:o,a.options.closeAtx&&(m+=" "+o),h(),u(),m}jS.peek=w3;function jS(e){return e.value||""}function w3(){return"<"}kS.peek=C3;function kS(e,t,a,s){const r=ag(a),c=r==='"'?"Quote":"Apostrophe",o=a.enter("image");let u=a.enter("label");const h=a.createTracker(s);let m=h.move("![");return m+=h.move(a.safe(e.alt,T({before:m,after:"]"},h.current()))),m+=h.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=a.enter("destinationLiteral"),m+=h.move("<"),m+=h.move(a.safe(e.url,T({before:m,after:">"},h.current()))),m+=h.move(">")):(u=a.enter("destinationRaw"),m+=h.move(a.safe(e.url,T({before:m,after:e.title?" ":")"},h.current())))),u(),e.title&&(u=a.enter(`title${c}`),m+=h.move(" "+r),m+=h.move(a.safe(e.title,T({before:m,after:r},h.current()))),m+=h.move(r),u()),m+=h.move(")"),o(),m}function C3(){return"!"}ES.peek=N3;function ES(e,t,a,s){const r=e.referenceType,c=a.enter("imageReference");let o=a.enter("label");const u=a.createTracker(s);let h=u.move("![");const m=a.safe(e.alt,T({before:h,after:"]"},u.current()));h+=u.move(m+"]["),o();const g=a.stack;a.stack=[],o=a.enter("reference");const p=a.safe(a.associationId(e),T({before:h,after:"]"},u.current()));return o(),a.stack=g,c(),r==="full"||!m||m!==p?h+=u.move(p+"]"):r==="shortcut"?h=h.slice(0,-1):h+=u.move("]"),h}function N3(){return"!"}RS.peek=j3;function RS(e,t,a){let s=e.value||"",r="`",c=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(s);)r+="`";for(/[^ \r\n]/.test(s)&&(/^[ \r\n]/.test(s)&&/[ \r\n]$/.test(s)||/^`|`$/.test(s))&&(s=" "+s+" ");++c<a.unsafe.length;){const o=a.unsafe[c],u=a.compilePattern(o);let h;if(o.atBreak)for(;h=u.exec(s);){let m=h.index;s.charCodeAt(m)===10&&s.charCodeAt(m-1)===13&&m--,s=s.slice(0,m)+" "+s.slice(h.index+1)}}return r+s+r}function j3(){return"`"}function TS(e,t){const a=Kp(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}MS.peek=k3;function MS(e,t,a,s){const r=ag(a),c=r==='"'?"Quote":"Apostrophe",o=a.createTracker(s);let u,h;if(TS(e,a)){const g=a.stack;a.stack=[],u=a.enter("autolink");let p=o.move("<");return p+=o.move(a.containerPhrasing(e,T({before:p,after:">"},o.current()))),p+=o.move(">"),u(),a.stack=g,p}u=a.enter("link"),h=a.enter("label");let m=o.move("[");return m+=o.move(a.containerPhrasing(e,T({before:m,after:"]("},o.current()))),m+=o.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=a.enter("destinationLiteral"),m+=o.move("<"),m+=o.move(a.safe(e.url,T({before:m,after:">"},o.current()))),m+=o.move(">")):(h=a.enter("destinationRaw"),m+=o.move(a.safe(e.url,T({before:m,after:e.title?" ":")"},o.current())))),h(),e.title&&(h=a.enter(`title${c}`),m+=o.move(" "+r),m+=o.move(a.safe(e.title,T({before:m,after:r},o.current()))),m+=o.move(r),h()),m+=o.move(")"),u(),m}function k3(e,t,a){return TS(e,a)?"<":"["}AS.peek=E3;function AS(e,t,a,s){const r=e.referenceType,c=a.enter("linkReference");let o=a.enter("label");const u=a.createTracker(s);let h=u.move("[");const m=a.containerPhrasing(e,T({before:h,after:"]"},u.current()));h+=u.move(m+"]["),o();const g=a.stack;a.stack=[],o=a.enter("reference");const p=a.safe(a.associationId(e),T({before:h,after:"]"},u.current()));return o(),a.stack=g,c(),r==="full"||!m||m!==p?h+=u.move(p+"]"):r==="shortcut"?h=h.slice(0,-1):h+=u.move("]"),h}function E3(){return"["}function ig(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function R3(e){const t=ig(e),a=e.options.bulletOther;if(!a)return t==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+a+"`) to be different");return a}function T3(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function LS(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function M3(e,t,a,s){const r=a.enter("list"),c=a.bulletCurrent;let o=e.ordered?T3(a):ig(a);const u=e.ordered?o==="."?")":".":R3(a);let h=t&&a.bulletLastUsed?o===a.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&g&&(!g.children||!g.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(h=!0),LS(a)===o&&g){let p=-1;for(;++p<e.children.length;){const v=e.children[p];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(o=u),a.bulletCurrent=o;const m=a.containerFlow(e,s);return a.bulletLastUsed=o,a.bulletCurrent=c,r(),m}function A3(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function L3(e,t,a,s){const r=A3(a);let c=a.bulletCurrent||ig(a);t&&t.type==="list"&&t.ordered&&(c=(typeof t.start=="number"&&t.start>-1?t.start:1)+(a.options.incrementListMarker===!1?0:t.children.indexOf(e))+c);let o=c.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const u=a.createTracker(s);u.move(c+" ".repeat(o-c.length)),u.shift(o);const h=a.enter("listItem"),m=a.indentLines(a.containerFlow(e,u.current()),g);return h(),m;function g(p,v,b){return v?(b?"":" ".repeat(o))+p:(b?c:c+" ".repeat(o-c.length))+p}}function D3(e,t,a,s){const r=a.enter("paragraph"),c=a.enter("phrasing"),o=a.containerPhrasing(e,s);return c(),r(),o}const O3=hd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function z3(e,t,a,s){return(e.children.some(function(r){return O3(r)})?a.containerPhrasing:a.containerFlow).call(a,e,s)}function I3(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}DS.peek=U3;function DS(e,t,a,s){const r=I3(a),c=a.enter("strong"),o=a.createTracker(s),u=o.move(r+r);let h=o.move(a.containerPhrasing(e,T({after:r,before:u},o.current())));const m=h.charCodeAt(0),g=Ku(s.before.charCodeAt(s.before.length-1),m,r);g.inside&&(h=Bo(m)+h.slice(1));const p=h.charCodeAt(h.length-1),v=Ku(s.after.charCodeAt(0),p,r);v.inside&&(h=h.slice(0,-1)+Bo(p));const b=o.move(r+r);return c(),a.attentionEncodeSurroundingInfo={after:v.outside,before:g.outside},u+h+b}function U3(e,t,a){return a.options.strong||"*"}function B3(e,t,a,s){return a.safe(e.value,s)}function F3(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function H3(e,t,a){const s=(LS(a)+(a.options.ruleSpaces?" ":"")).repeat(F3(a));return a.options.ruleSpaces?s.slice(0,-1):s}const OS={blockquote:u3,break:P0,code:g3,definition:v3,emphasis:NS,hardBreak:P0,heading:S3,html:jS,image:kS,imageReference:ES,inlineCode:RS,link:MS,linkReference:AS,list:M3,listItem:L3,paragraph:D3,root:z3,strong:DS,text:B3,thematicBreak:H3};function P3(){return{enter:{table:$3,tableData:$0,tableHeader:$0,tableRow:V3},exit:{codeText:Y3,table:q3,tableData:pm,tableHeader:pm,tableRow:pm}}}function $3(e){const t=e._align;this.enter({type:"table",align:t.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function q3(e){this.exit(e),this.data.inTable=void 0}function V3(e){this.enter({type:"tableRow",children:[]},e)}function pm(e){this.exit(e)}function $0(e){this.enter({type:"tableCell",children:[]},e)}function Y3(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,G3));const a=this.stack[this.stack.length-1];a.type,a.value=t,this.exit(e)}function G3(e,t){return t==="|"?t:e}function K3(e){const t=e||{},a=t.tableCellPadding,s=t.tablePipeAlign,r=t.stringLength,c=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
76
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:o,tableCell:h,tableRow:u}};function o(b,_,S,w){return m(g(b,S,w),b.align)}function u(b,_,S,w){const C=p(b,S,w),R=m([C]);return R.slice(0,R.indexOf(`
77
+ `))}function h(b,_,S,w){const C=S.enter("tableCell"),R=S.enter("phrasing"),j=S.containerPhrasing(b,K(T({},w),{before:c,after:c}));return R(),C(),j}function m(b,_){return o3(b,{align:_,alignDelimiters:s,padding:a,stringLength:r})}function g(b,_,S){const w=b.children;let C=-1;const R=[],j=_.enter("table");for(;++C<w.length;)R[C]=p(w[C],_,S);return j(),R}function p(b,_,S){const w=b.children;let C=-1;const R=[],j=_.enter("tableRow");for(;++C<w.length;)R[C]=h(w[C],b,_,S);return j(),R}function v(b,_,S){let w=OS.inlineCode(b,_,S);return S.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function X3(){return{exit:{taskListCheckValueChecked:q0,taskListCheckValueUnchecked:q0,paragraph:Z3}}}function Q3(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:J3}}}function q0(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Z3(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const a=this.stack[this.stack.length-1];a.type;const s=a.children[0];if(s&&s.type==="text"){const r=t.children;let c=-1,o;for(;++c<r.length;){const u=r[c];if(u.type==="paragraph"){o=u;break}}o===a&&(s.value=s.value.slice(1),s.value.length===0?a.children.shift():a.position&&s.position&&typeof s.position.start.offset=="number"&&(s.position.start.column++,s.position.start.offset++,a.position.start=Object.assign({},s.position.start)))}}this.exit(e)}function J3(e,t,a,s){const r=e.children[0],c=typeof e.checked=="boolean"&&r&&r.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",u=a.createTracker(s);c&&u.move(o);let h=OS.listItem(e,t,a,T(T({},s),u.current()));return c&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),h;function m(g){return g+o}}function W3(){return[MD(),JD(),n3(),P3(),X3()]}function eO(e){return{extensions:[AD(),WD(e),a3(),K3(e),Q3()]}}const tO={tokenize:lO,partial:!0},zS={tokenize:oO,partial:!0},IS={tokenize:cO,partial:!0},US={tokenize:uO,partial:!0},nO={tokenize:dO,partial:!0},BS={name:"wwwAutolink",tokenize:sO,previous:HS},FS={name:"protocolAutolink",tokenize:rO,previous:PS},si={name:"emailAutolink",tokenize:iO,previous:$S},Ra={};function aO(){return{text:Ra}}let ws=48;for(;ws<123;)Ra[ws]=si,ws++,ws===58?ws=65:ws===91&&(ws=97);Ra[43]=si;Ra[45]=si;Ra[46]=si;Ra[95]=si;Ra[72]=[si,FS];Ra[104]=[si,FS];Ra[87]=[si,BS];Ra[119]=[si,BS];function iO(e,t,a){const s=this;let r,c;return o;function o(p){return!tp(p)||!$S.call(s,s.previous)||sg(s.events)?a(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(p))}function u(p){return tp(p)?(e.consume(p),u):p===64?(e.consume(p),h):a(p)}function h(p){return p===46?e.check(nO,g,m)(p):p===45||p===95||sn(p)?(c=!0,e.consume(p),h):g(p)}function m(p){return e.consume(p),r=!0,h}function g(p){return c&&r&&hn(s.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):a(p)}}function sO(e,t,a){const s=this;return r;function r(o){return o!==87&&o!==119||!HS.call(s,s.previous)||sg(s.events)?a(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(tO,e.attempt(zS,e.attempt(IS,c),a),a)(o))}function c(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function rO(e,t,a){const s=this;let r="",c=!1;return o;function o(p){return(p===72||p===104)&&PS.call(s,s.previous)&&!sg(s.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),r+=String.fromCodePoint(p),e.consume(p),u):a(p)}function u(p){if(hn(p)&&r.length<5)return r+=String.fromCodePoint(p),e.consume(p),u;if(p===58){const v=r.toLowerCase();if(v==="http"||v==="https")return e.consume(p),h}return a(p)}function h(p){return p===47?(e.consume(p),c?m:(c=!0,h)):a(p)}function m(p){return p===null||Vu(p)||wt(p)||Gs(p)||ud(p)?a(p):e.attempt(zS,e.attempt(IS,g),a)(p)}function g(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function lO(e,t,a){let s=0;return r;function r(o){return(o===87||o===119)&&s<3?(s++,e.consume(o),r):o===46&&s===3?(e.consume(o),c):a(o)}function c(o){return o===null?a(o):t(o)}}function oO(e,t,a){let s,r,c;return o;function o(m){return m===46||m===95?e.check(US,h,u)(m):m===null||wt(m)||Gs(m)||m!==45&&ud(m)?h(m):(c=!0,e.consume(m),o)}function u(m){return m===95?s=!0:(r=s,s=void 0),e.consume(m),o}function h(m){return r||s||!c?a(m):t(m)}}function cO(e,t){let a=0,s=0;return r;function r(o){return o===40?(a++,e.consume(o),r):o===41&&s<a?c(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(US,t,c)(o):o===null||wt(o)||Gs(o)?t(o):(e.consume(o),r)}function c(o){return o===41&&s++,e.consume(o),r}}function uO(e,t,a){return s;function s(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(e.consume(u),s):u===38?(e.consume(u),c):u===93?(e.consume(u),r):u===60||u===null||wt(u)||Gs(u)?t(u):a(u)}function r(u){return u===null||u===40||u===91||wt(u)||Gs(u)?t(u):s(u)}function c(u){return hn(u)?o(u):a(u)}function o(u){return u===59?(e.consume(u),s):hn(u)?(e.consume(u),o):a(u)}}function dO(e,t,a){return s;function s(c){return e.consume(c),r}function r(c){return sn(c)?a(c):t(c)}}function HS(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||wt(e)}function PS(e){return!hn(e)}function $S(e){return!(e===47||tp(e))}function tp(e){return e===43||e===45||e===46||e===95||sn(e)}function sg(e){let t=e.length,a=!1;for(;t--;){const s=e[t][1];if((s.type==="labelLink"||s.type==="labelImage")&&!s._balanced){a=!0;break}if(s._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const fO={tokenize:xO,partial:!0};function hO(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:yO,continuation:{tokenize:vO},exit:bO}},text:{91:{name:"gfmFootnoteCall",tokenize:gO},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:mO,resolveTo:pO}}}}function mO(e,t,a){const s=this;let r=s.events.length;const c=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let o;for(;r--;){const h=s.events[r][1];if(h.type==="labelImage"){o=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return u;function u(h){if(!o||!o._balanced)return a(h);const m=da(s.sliceSerialize({start:o.end,end:s.now()}));return m.codePointAt(0)!==94||!c.includes(m.slice(1))?a(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function pO(e,t){let a=e.length;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";const s={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const c={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},u=[e[a+1],e[a+2],["enter",s,t],e[a+3],e[a+4],["enter",r,t],["exit",r,t],["enter",c,t],["enter",o,t],["exit",o,t],["exit",c,t],e[e.length-2],e[e.length-1],["exit",s,t]];return e.splice(a,e.length-a+1,...u),e}function gO(e,t,a){const s=this,r=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let c=0,o;return u;function u(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),h}function h(p){return p!==94?a(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(p){if(c>999||p===93&&!o||p===null||p===91||wt(p))return a(p);if(p===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return r.includes(da(s.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):a(p)}return wt(p)||(o=!0),c++,e.consume(p),p===92?g:m}function g(p){return p===91||p===92||p===93?(e.consume(p),c++,m):m(p)}}function yO(e,t,a){const s=this,r=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let c,o=0,u;return h;function h(_){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(_){return _===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):a(_)}function g(_){if(o>999||_===93&&!u||_===null||_===91||wt(_))return a(_);if(_===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return c=da(s.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return wt(_)||(u=!0),o++,e.consume(_),_===92?p:g}function p(_){return _===91||_===92||_===93?(e.consume(_),o++,g):g(_)}function v(_){return _===58?(e.enter("definitionMarker"),e.consume(_),e.exit("definitionMarker"),r.includes(c)||r.push(c),nt(e,b,"gfmFootnoteDefinitionWhitespace")):a(_)}function b(_){return t(_)}}function vO(e,t,a){return e.check(Yo,t,e.attempt(fO,t,a))}function bO(e){e.exit("gfmFootnoteDefinition")}function xO(e,t,a){const s=this;return nt(e,r,"gfmFootnoteDefinitionIndent",5);function r(c){const o=s.events[s.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(c):a(c)}}function _O(e){let t=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:r,resolveAll:s};return t==null&&(t=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function s(c,o){let u=-1;for(;++u<c.length;)if(c[u][0]==="enter"&&c[u][1].type==="strikethroughSequenceTemporary"&&c[u][1]._close){let h=u;for(;h--;)if(c[h][0]==="exit"&&c[h][1].type==="strikethroughSequenceTemporary"&&c[h][1]._open&&c[u][1].end.offset-c[u][1].start.offset===c[h][1].end.offset-c[h][1].start.offset){c[u][1].type="strikethroughSequence",c[h][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},c[h][1].start),end:Object.assign({},c[u][1].end)},g={type:"strikethroughText",start:Object.assign({},c[h][1].end),end:Object.assign({},c[u][1].start)},p=[["enter",m,o],["enter",c[h][1],o],["exit",c[h][1],o],["enter",g,o]],v=o.parser.constructs.insideSpan.null;v&&Un(p,p.length,0,dd(v,c.slice(h+1,u),o)),Un(p,p.length,0,[["exit",g,o],["enter",c[u][1],o],["exit",c[u][1],o],["exit",m,o]]),Un(c,h-1,u-h+3,p),u=h+p.length-2;break}}for(u=-1;++u<c.length;)c[u][1].type==="strikethroughSequenceTemporary"&&(c[u][1].type="data");return c}function r(c,o,u){const h=this.previous,m=this.events;let g=0;return p;function p(b){return h===126&&m[m.length-1][1].type!=="characterEscape"?u(b):(c.enter("strikethroughSequenceTemporary"),v(b))}function v(b){const _=cl(h);if(b===126)return g>1?u(b):(c.consume(b),g++,v);if(g<2&&!t)return u(b);const S=c.exit("strikethroughSequenceTemporary"),w=cl(b);return S._open=!w||w===2&&!!_,S._close=!_||_===2&&!!w,o(b)}}}class SO{constructor(){this.map=[]}add(t,a,s){wO(this,t,a,s)}consume(t){if(this.map.sort(function(c,o){return c[0]-o[0]}),this.map.length===0)return;let a=this.map.length;const s=[];for(;a>0;)a-=1,s.push(t.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),t.length=this.map[a][0];s.push(t.slice()),t.length=0;let r=s.pop();for(;r;){for(const c of r)t.push(c);r=s.pop()}this.map.length=0}}function wO(e,t,a,s){let r=0;if(!(a===0&&s.length===0)){for(;r<e.map.length;){if(e.map[r][0]===t){e.map[r][1]+=a,e.map[r][2].push(...s);return}r+=1}e.map.push([t,a,s])}}function CO(e,t){let a=!1;const s=[];for(;t<e.length;){const r=e[t];if(a){if(r[0]==="enter")r[1].type==="tableContent"&&s.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(r[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const c=s.length-1;s[c]=s[c]==="left"?"center":"right"}}else if(r[1].type==="tableDelimiterRow")break}else r[0]==="enter"&&r[1].type==="tableDelimiterRow"&&(a=!0);t+=1}return s}function NO(){return{flow:{null:{name:"table",tokenize:jO,resolveAll:kO}}}}function jO(e,t,a){const s=this;let r=0,c=0,o;return u;function u(M){let U=s.events.length-1;for(;U>-1;){const H=s.events[U][1].type;if(H==="lineEnding"||H==="linePrefix")U--;else break}const F=U>-1?s.events[U][1].type:null,q=F==="tableHead"||F==="tableRow"?O:h;return q===O&&s.parser.lazy[s.now().line]?a(M):q(M)}function h(M){return e.enter("tableHead"),e.enter("tableRow"),m(M)}function m(M){return M===124||(o=!0,c+=1),g(M)}function g(M){return M===null?a(M):Oe(M)?c>1?(c=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),b):a(M):Qe(M)?nt(e,g,"whitespace")(M):(c+=1,o&&(o=!1,r+=1),M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),o=!0,g):(e.enter("data"),p(M)))}function p(M){return M===null||M===124||wt(M)?(e.exit("data"),g(M)):(e.consume(M),M===92?v:p)}function v(M){return M===92||M===124?(e.consume(M),p):p(M)}function b(M){return s.interrupt=!1,s.parser.lazy[s.now().line]?a(M):(e.enter("tableDelimiterRow"),o=!1,Qe(M)?nt(e,_,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):_(M))}function _(M){return M===45||M===58?w(M):M===124?(o=!0,e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),S):I(M)}function S(M){return Qe(M)?nt(e,w,"whitespace")(M):w(M)}function w(M){return M===58?(c+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),C):M===45?(c+=1,C(M)):M===null||Oe(M)?k(M):I(M)}function C(M){return M===45?(e.enter("tableDelimiterFiller"),R(M)):I(M)}function R(M){return M===45?(e.consume(M),R):M===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),j):(e.exit("tableDelimiterFiller"),j(M))}function j(M){return Qe(M)?nt(e,k,"whitespace")(M):k(M)}function k(M){return M===124?_(M):M===null||Oe(M)?!o||r!==c?I(M):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(M)):I(M)}function I(M){return a(M)}function O(M){return e.enter("tableRow"),z(M)}function z(M){return M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),z):M===null||Oe(M)?(e.exit("tableRow"),t(M)):Qe(M)?nt(e,z,"whitespace")(M):(e.enter("data"),B(M))}function B(M){return M===null||M===124||wt(M)?(e.exit("data"),z(M)):(e.consume(M),M===92?P:B)}function P(M){return M===92||M===124?(e.consume(M),B):B(M)}}function kO(e,t){let a=-1,s=!0,r=0,c=[0,0,0,0],o=[0,0,0,0],u=!1,h=0,m,g,p;const v=new SO;for(;++a<e.length;){const b=e[a],_=b[1];b[0]==="enter"?_.type==="tableHead"?(u=!1,h!==0&&(V0(v,t,h,m,g),g=void 0,h=0),m={type:"table",start:Object.assign({},_.start),end:Object.assign({},_.end)},v.add(a,0,[["enter",m,t]])):_.type==="tableRow"||_.type==="tableDelimiterRow"?(s=!0,p=void 0,c=[0,0,0,0],o=[0,a+1,0,0],u&&(u=!1,g={type:"tableBody",start:Object.assign({},_.start),end:Object.assign({},_.end)},v.add(a,0,[["enter",g,t]])),r=_.type==="tableDelimiterRow"?2:g?3:1):r&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")?(s=!1,o[2]===0&&(c[1]!==0&&(o[0]=o[1],p=xu(v,t,c,r,void 0,p),c=[0,0,0,0]),o[2]=a)):_.type==="tableCellDivider"&&(s?s=!1:(c[1]!==0&&(o[0]=o[1],p=xu(v,t,c,r,void 0,p)),c=o,o=[c[1],a,0,0])):_.type==="tableHead"?(u=!0,h=a):_.type==="tableRow"||_.type==="tableDelimiterRow"?(h=a,c[1]!==0?(o[0]=o[1],p=xu(v,t,c,r,a,p)):o[1]!==0&&(p=xu(v,t,o,r,a,p)),r=0):r&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")&&(o[3]=a)}for(h!==0&&V0(v,t,h,m,g),v.consume(t.events),a=-1;++a<t.events.length;){const b=t.events[a];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=CO(t.events,a))}return e}function xu(e,t,a,s,r,c){const o=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",u="tableContent";a[0]!==0&&(c.end=Object.assign({},Pr(t.events,a[0])),e.add(a[0],0,[["exit",c,t]]));const h=Pr(t.events,a[1]);if(c={type:o,start:Object.assign({},h),end:Object.assign({},h)},e.add(a[1],0,[["enter",c,t]]),a[2]!==0){const m=Pr(t.events,a[2]),g=Pr(t.events,a[3]),p={type:u,start:Object.assign({},m),end:Object.assign({},g)};if(e.add(a[2],0,[["enter",p,t]]),s!==2){const v=t.events[a[2]],b=t.events[a[3]];if(v[1].end=Object.assign({},b[1].end),v[1].type="chunkText",v[1].contentType="text",a[3]>a[2]+1){const _=a[2]+1,S=a[3]-a[2]-1;e.add(_,S,[])}}e.add(a[3]+1,0,[["exit",p,t]])}return r!==void 0&&(c.end=Object.assign({},Pr(t.events,r)),e.add(r,0,[["exit",c,t]]),c=void 0),c}function V0(e,t,a,s,r){const c=[],o=Pr(t.events,a);r&&(r.end=Object.assign({},o),c.push(["exit",r,t])),s.end=Object.assign({},o),c.push(["exit",s,t]),e.add(a+1,0,c)}function Pr(e,t){const a=e[t],s=a[0]==="enter"?"start":"end";return a[1][s]}const EO={name:"tasklistCheck",tokenize:TO};function RO(){return{text:{91:EO}}}function TO(e,t,a){const s=this;return r;function r(h){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?a(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),c)}function c(h){return wt(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),o):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),o):a(h)}function o(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):a(h)}function u(h){return Oe(h)?t(h):Qe(h)?e.check({tokenize:MO},t,a)(h):a(h)}}function MO(e,t,a){return nt(e,s,"whitespace");function s(r){return r===null?a(r):t(r)}}function AO(e){return W_([aO(),hO(),_O(e),NO(),RO()])}const LO={};function DO(e){const t=this,a=e||LO,s=t.data(),r=s.micromarkExtensions||(s.micromarkExtensions=[]),c=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),o=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);r.push(AO(a)),c.push(W3()),o.push(eO(a))}const qS=A.memo(({content:e,isStreaming:t=!1,className:a,syntaxHighlighter:s})=>{const r=A.useMemo(()=>({p:({children:o})=>f.jsx("p",{className:"chat-markdown__p",children:o}),h1:({children:o})=>f.jsx("h1",{className:"chat-markdown__h1",children:o}),h2:({children:o})=>f.jsx("h2",{className:"chat-markdown__h2",children:o}),h3:({children:o})=>f.jsx("h3",{className:"chat-markdown__h3",children:o}),ul:({children:o})=>f.jsx("ul",{className:"chat-markdown__ul",children:o}),ol:({children:o})=>f.jsx("ol",{className:"chat-markdown__ol",children:o}),li:({children:o})=>f.jsx("li",{className:"chat-markdown__li",children:o}),blockquote:({children:o})=>f.jsx("blockquote",{className:"chat-markdown__blockquote",children:o}),a:({children:o,href:u})=>f.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"chat-markdown__link",children:o}),table:({children:o})=>f.jsx("div",{className:"chat-markdown__table-wrapper",children:f.jsx("table",{className:"chat-markdown__table",children:o})}),thead:({children:o})=>f.jsx("thead",{className:"chat-markdown__thead",children:o}),tbody:({children:o})=>f.jsx("tbody",{className:"chat-markdown__tbody",children:o}),tr:({children:o})=>f.jsx("tr",{className:"chat-markdown__tr",children:o}),th:({children:o})=>f.jsx("th",{className:"chat-markdown__th",children:o}),td:({children:o})=>f.jsx("td",{className:"chat-markdown__td",children:o}),pre:({children:o})=>f.jsx(f.Fragment,{children:o}),code:({children:o,className:u})=>{const h=/language-(\w+)/.exec(u!=null?u:"");if(!h)return f.jsx("code",{className:"chat-markdown__code-inline",children:o});const m=h[1],g=String(o).replace(/\n$/,"");return s?f.jsx(f.Fragment,{children:s(g,m)}):f.jsx("pre",{className:"chat-markdown__pre",children:f.jsx("code",{className:"chat-markdown__code-block",children:o})})},hr:()=>f.jsx("hr",{className:"chat-markdown__hr"}),strong:({children:o})=>f.jsx("strong",{className:"chat-markdown__strong",children:o}),em:({children:o})=>f.jsx("em",{className:"chat-markdown__em",children:o})}),[s]),c=["chat-markdown",t&&"chat-markdown--streaming",a].filter(Boolean).join(" ");return f.jsx("div",{className:c,"aria-busy":t||void 0,children:f.jsx(_D,{remarkPlugins:[DO],components:r,children:e})})});qS.displayName="ChatMarkdownContent";const np=ie.forwardRef((v,p)=>{var b=v,{query:e,onQueryChange:t,results:a=[],onSelect:s,onClear:r,placeholder:c="Search entities...",disabled:o=!1,inputId:u,placement:h="bottom-start",className:m}=b,g=de(b,["query","onQueryChange","results","onSelect","onClear","placeholder","disabled","inputId","placement","className"]);const[_,S]=A.useState(!1),w=A.useRef(null),C=A.useRef(null),R=A.useRef(null),j=ie.useId(),k=H=>`${j}-option-${H}`,I=A.useCallback(()=>S(!1),[]),{focusedValue:O,setFocusedValue:z}=id({triggerRef:w,panelRef:R,isOpen:_,onClose:I,restoreFocus:!1});A.useEffect(()=>{a.length===0?z(null):a.some(H=>H.id===O)||z(a[0].id)},[a,O,z]),A.useEffect(()=>{if(!_)return;const H=Y=>{var $;if(Y.key!=="Enter"||!(($=w.current)!=null&&$.contains(Y.target)))return;const X=a.find(Z=>Z.id===O);X&&(Y.preventDefault(),s(X),S(!1))};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[_,a,O,s]),A.useImperativeHandle(p,()=>C.current);const B=H=>{o||(t(H.target.value),S(!0))},P=()=>{o||e.length>0&&a.length>0&&S(!0)},M=()=>{var H;r(),S(!1),(H=w.current)==null||H.focus()},U=H=>{s(H),S(!1)},F=_&&a.length>0,q=F&&O?k(O):void 0;return f.jsxs("div",K(T({ref:C,className:["entity-picker",o&&"entity-picker--disabled",m].filter(Boolean).join(" ")},g),{children:[f.jsxs("div",{className:"entity-picker__input-wrapper",children:[f.jsx("input",{ref:w,id:u,type:"text",role:"combobox","aria-autocomplete":"list","aria-expanded":F,"aria-controls":j,"aria-activedescendant":q,className:"entity-picker__input",placeholder:c,value:e,disabled:o,onChange:B,onFocus:P,"data-testid":"entity-picker-input"}),e&&!o&&f.jsx("button",{type:"button",className:"entity-picker__clear",onClick:M,"aria-label":"Clear search","data-testid":"entity-picker-clear",children:f.jsx(Ce,{name:"x",size:16})})]}),F&&f.jsx("div",{ref:R,id:j,role:"listbox",className:`dropdown-panel ${sd(h)} entity-picker__dropdown`,"data-testid":"entity-picker-dropdown",children:a.map(H=>{const Y=H.id===O;return f.jsxs("div",{id:k(H.id),role:"option","aria-selected":Y,"data-dropdown-item":H.id,className:["dropdown-item","entity-picker__result",Y&&"dropdown-item--focused"].filter(Boolean).join(" "),onMouseEnter:()=>z(H.id),onMouseDown:$=>{$.preventDefault(),U(H)},"data-testid":`entity-picker-result-${H.id}`,children:[H.domain&&H.domainColor&&f.jsx(Nn,{variant:H.domainColor,className:"entity-picker__badge",children:H.domain}),f.jsx("span",{className:"dropdown-item__label entity-picker__label",children:H.label})]},H.id)})})]}))});np.displayName="EntityPicker";const OO=ie.forwardRef((p,g)=>{var v=p,{rows:e,onChange:t,datatypeColumn:a=!1,datatypes:s=["string","number","boolean"],disabled:r=!1,keyPlaceholder:c="Key",valuePlaceholder:o="Value",addLabel:u="Add row",className:h}=v,m=de(v,["rows","onChange","datatypeColumn","datatypes","disabled","keyPlaceholder","valuePlaceholder","addLabel","className"]);const b=ie.useId(),_=ie.useRef(0),S=(k,I)=>{t(e.map(O=>O.id===k?K(T({},O),{key:I}):O))},w=(k,I)=>{t(e.map(O=>O.id===k?K(T({},O),{value:I}):O))},C=(k,I)=>{t(e.map(O=>O.id===k?K(T({},O),{datatype:I}):O))},R=k=>{t(e.filter(I=>I.id!==k))},j=()=>{const k=T({id:`${b}-${_.current++}`,key:"",value:""},a&&{datatype:"string"});t([...e,k])};return f.jsxs("div",K(T({ref:g,className:["key-value-editor",a&&"key-value-editor--has-datatype",r&&"key-value-editor--disabled",h].filter(Boolean).join(" "),"data-testid":"key-value-editor"},m),{children:[f.jsxs("div",{className:"key-value-editor__table",children:[f.jsxs("div",{className:"key-value-editor__header",children:[f.jsx("div",{className:"key-value-editor__col key-value-editor__col--key",children:"Key"}),f.jsx("div",{className:"key-value-editor__col key-value-editor__col--value",children:"Value"}),a&&f.jsx("div",{className:"key-value-editor__col key-value-editor__col--datatype",children:"Type"}),f.jsx("div",{className:"key-value-editor__col key-value-editor__col--actions"})]}),e.map(k=>f.jsxs("div",{className:"key-value-editor__row","data-testid":`key-value-row-${k.id}`,children:[f.jsx(Oo,{className:"key-value-editor__input",placeholder:c,value:k.key,onChange:I=>S(k.id,I.target.value),disabled:r,"data-testid":`key-input-${k.id}`}),f.jsx(Oo,{className:"key-value-editor__input",placeholder:o,value:k.value,onChange:I=>w(k.id,I.target.value),disabled:r,"data-testid":`value-input-${k.id}`}),a&&f.jsx($u,{className:"key-value-editor__input key-value-editor__select",value:k.datatype||"string",onChange:I=>C(k.id,I),disabled:r,"data-testid":`datatype-select-${k.id}`,children:s.map(I=>f.jsx($u.Item,{value:I,children:I},I))}),f.jsx("button",{type:"button",className:"key-value-editor__remove-btn",onClick:()=>R(k.id),"aria-label":"Remove row",disabled:r,"data-testid":`remove-row-${k.id}`,children:f.jsx(Ce,{name:"trash",size:16})})]},k.id))]}),f.jsxs(rn,{variant:"ghost",size:"sm",className:"key-value-editor__add-btn",onClick:j,disabled:r,"data-testid":"add-row-btn",children:[f.jsx(Ce,{name:"plus",size:16}),u]})]}))});OO.displayName="KeyValueEditor";const zO=ie.forwardRef((u,o)=>{var h=u,{items:e,onChange:t,primaryItemId:a,disabled:s=!1,className:r}=h,c=de(h,["items","onChange","primaryItemId","disabled","className"]);const m=A.useCallback(p=>{if(p>0){const v=[...e];[v[p-1],v[p]]=[v[p],v[p-1]],t(v)}},[e,t]),g=A.useCallback(p=>{if(p<e.length-1){const v=[...e];[v[p],v[p+1]]=[v[p+1],v[p]],t(v)}},[e,t]);return f.jsx("div",K(T({ref:o,className:["ordered-list",s&&"ordered-list--disabled",r].filter(Boolean).join(" "),role:"list","aria-disabled":s||void 0,"data-testid":"ordered-list"},c),{children:e.map((p,v)=>f.jsxs("div",{className:["ordered-list__item",a===p.id&&"ordered-list__item--primary"].filter(Boolean).join(" "),role:"listitem","data-testid":`ordered-item-${p.id}`,children:[f.jsxs("div",{className:"ordered-list__rank",children:[a===p.id&&f.jsx("div",{className:"ordered-list__primary-badge",title:"Primary item",children:f.jsx(Ce,{name:"star",size:10})}),f.jsx("div",{className:"ordered-list__index",children:v+1})]}),f.jsx("span",{className:"ordered-list__label",children:p.label}),f.jsxs("div",{className:"ordered-list__controls",children:[f.jsx(rn,{variant:"ghost",size:"sm",disabled:s||v===0,onClick:()=>m(v),"aria-label":"Move up","data-testid":`move-up-${p.id}`,children:f.jsx(Ce,{name:"arrowUp",size:16})}),f.jsx(rn,{variant:"ghost",size:"sm",disabled:s||v===e.length-1,onClick:()=>g(v),"aria-label":"Move down","data-testid":`move-down-${p.id}`,children:f.jsx(Ce,{name:"arrowDown",size:16})})]})]},p.id))}))});zO.displayName="OrderedList";const IO=ie.forwardRef((S,_)=>{var w=S,{value:e,onChange:t,sourceResults:a=[],targetResults:s=[],sourceQuery:r,onSourceQueryChange:c,targetQuery:o,onTargetQueryChange:u,predicates:h=["contains","relates to","depends on","is used by"],onSourceClear:m,onTargetClear:g,disabled:p=!1,className:v}=w,b=de(w,["value","onChange","sourceResults","targetResults","sourceQuery","onSourceQueryChange","targetQuery","onTargetQueryChange","predicates","onSourceClear","onTargetClear","disabled","className"]);const C=ie.useId(),R=`${C}-source`,j=`${C}-predicate`,k=`${C}-target`,I=ie.useCallback(B=>{t(K(T({},e),{source:B})),c("")},[t,c,e]),O=ie.useCallback(B=>{t(K(T({},e),{target:B})),u("")},[t,u,e]),z=ie.useCallback(B=>{t(K(T({},e),{predicate:B}))},[t,e]);return f.jsxs("div",K(T({ref:_,className:["relationship-builder",v].filter(Boolean).join(" "),"data-testid":"relationship-builder"},b),{children:[f.jsxs("div",{className:"relationship-builder__column",children:[f.jsx("label",{htmlFor:R,className:"relationship-builder__label",children:"Source"}),f.jsx(np,{inputId:R,query:r,onQueryChange:c,results:a,onSelect:I,onClear:m,placeholder:"Search source entity...",disabled:p}),e.source&&f.jsxs("div",{className:"relationship-builder__selected","data-testid":"source-selected",children:[e.source.domain&&f.jsx("span",{className:"relationship-builder__domain",children:e.source.domain}),f.jsx("span",{children:e.source.label})]})]}),f.jsxs("div",{className:"relationship-builder__column",children:[f.jsx("label",{htmlFor:j,className:"relationship-builder__label",children:"Predicate"}),f.jsx($u,{id:j,value:e.predicate,placeholder:"Select relation type...",onChange:z,disabled:p,"data-testid":"predicate-select",children:h.map(B=>f.jsx($u.Item,{value:B,children:B},B))})]}),f.jsxs("div",{className:"relationship-builder__column",children:[f.jsx("label",{htmlFor:k,className:"relationship-builder__label",children:"Target"}),f.jsx(np,{inputId:k,query:o,onQueryChange:u,results:s,onSelect:O,onClear:g,placeholder:"Search target entity...",disabled:p}),e.target&&f.jsxs("div",{className:"relationship-builder__selected","data-testid":"target-selected",children:[e.target.domain&&f.jsx("span",{className:"relationship-builder__domain",children:e.target.domain}),f.jsx("span",{children:e.target.label})]})]})]}))});IO.displayName="RelationshipBuilder";const UO=e=>"type"in e&&e.type==="separator",VS=ie.forwardRef((m,h)=>{var g=m,{actions:e,onAction:t,trigger:a,triggerIcon:s="moreVertical",triggerLabel:r="Menu",placement:c="bottom-start",className:o}=g,u=de(g,["actions","onAction","trigger","triggerIcon","triggerLabel","placement","className"]);const[p,v]=A.useState(!1),b=A.useRef(null),_=A.useRef(null),S=A.useRef(null),w=A.useCallback(()=>v(!1),[]),{focusedValue:C,setFocusedValue:R}=id({triggerRef:S,panelRef:_,isOpen:p,onClose:w});A.useImperativeHandle(h,()=>b.current);const j=A.useCallback(k=>{t(k),v(!1)},[t]);return f.jsxs("div",K(T({ref:b,className:["row-menu",o].filter(Boolean).join(" "),"data-testid":"row-menu"},u),{children:[f.jsx("button",{ref:S,type:"button",className:"row-menu__trigger",onClick:()=>v(k=>!k),"aria-label":r,"aria-haspopup":"menu","aria-expanded":p,"data-testid":"row-menu-trigger",children:a||f.jsx(Ce,{name:s,size:16})}),p&&f.jsx("div",{ref:_,role:"menu","aria-label":r,className:`dropdown-panel ${sd(c)} row-menu__dropdown`,"data-testid":"row-menu-dropdown",children:e.map((k,I)=>UO(k)?f.jsx("div",{role:"separator",className:"dropdown-separator","data-testid":`row-menu-separator-${I}`},`separator-${I}`):f.jsx(BO,{action:k,isFocused:C===k.id,onFocus:()=>R(k.id),onClick:()=>j(k.id)},k.id))})]}))});VS.displayName="RowMenu";function BO({action:e,isFocused:t,onFocus:a,onClick:s}){const r=A.useRef(null);return A.useEffect(()=>{var c;t&&((c=r.current)==null||c.focus())},[t]),f.jsxs("button",{ref:r,type:"button",role:"menuitem",tabIndex:t?0:-1,disabled:e.disabled,"data-dropdown-item":e.id,"data-disabled":e.disabled||void 0,onClick:s,onMouseEnter:()=>!e.disabled&&a(),className:["dropdown-item",e.danger&&"dropdown-item--danger",t&&"dropdown-item--focused",e.disabled&&"dropdown-item--disabled"].filter(Boolean).join(" "),"data-testid":`row-menu-action-${e.id}`,children:[e.icon&&f.jsx("span",{className:"dropdown-item__leading",children:f.jsx(Ce,{name:e.icon,size:16})}),f.jsx("span",{className:"dropdown-item__label",children:e.label})]})}const FO={running:"cyan",success:"emerald",idle:"neutral",failed:"rose"},HO=ie.forwardRef((v,p)=>{var b=v,{pipeline:e,onRun:t,onCancel:a,onOptions:s,compact:r=!1,selected:c=!1,headerAction:o,footerContent:u,flowLayout:h="fill",className:m}=b,g=de(b,["pipeline","onRun","onCancel","onOptions","compact","selected","headerAction","footerContent","flowLayout","className"]);const _=FO[e.status];return f.jsxs("div",K(T({ref:p,className:["pipeline-card",r&&"pipeline-card--compact",c&&"pipeline-card--selected",m].filter(Boolean).join(" "),"data-testid":"pipeline-card"},g),{children:[f.jsxs("div",{className:"pipeline-card__head",children:[f.jsxs("div",{className:"pipeline-card__head-top",children:[f.jsxs("div",{className:"pipeline-card__title-group",children:[f.jsx("div",{className:"pipeline-card__name-mono",children:e.name}),e.id&&f.jsx("div",{className:"pipeline-card__id-mono",children:e.id})]}),f.jsxs("div",{className:"pipeline-card__head-right",children:[f.jsxs("div",{className:"pipeline-card__head-chips",children:[f.jsx(Nn,{variant:_,children:e.status}),e.target&&f.jsx(Nn,{variant:"neutral",children:e.target}),e.tags&&e.tags.length>0&&f.jsx("div",{className:"pipeline-card__tags",children:e.tags.map(S=>f.jsx(Nn,{variant:"neutral",children:S},S))})]}),f.jsxs("div",{className:"pipeline-card__head-actions",children:[o,t&&e.status!=="running"&&f.jsx("button",{type:"button",className:"pipeline-card__action-btn",onClick:t,"data-testid":"pipeline-run-btn",children:"Run"}),a&&e.status==="running"&&f.jsx("button",{type:"button",className:"pipeline-card__action-btn pipeline-card__action-btn--cancel",onClick:a,"data-testid":"pipeline-cancel-btn",children:"Cancel"}),s&&f.jsx("button",{type:"button","aria-label":"Pipeline options",className:"pipeline-card__kebab-btn",onClick:s,"data-testid":"pipeline-kebab-btn",children:f.jsx(Ce,{name:"moreVertical",size:16})})]})]})]}),e.description&&f.jsx("p",{className:"pipeline-card__description",children:e.description})]}),f.jsx("div",{className:"pipeline-card__flow","data-layout":h,children:e.flow.map((S,w)=>f.jsxs(ie.Fragment,{children:[f.jsxs("div",{className:"pipeline-card__node","data-color":S.color,children:[f.jsx("div",{className:"pipeline-card__icon-tile",children:typeof S.icon=="string"?f.jsx(Ce,{name:S.icon,size:16}):S.icon}),f.jsxs("div",{className:"pipeline-card__node-content",children:[f.jsx("div",{className:"pipeline-card__node-name",children:S.name}),S.label&&f.jsx("div",{className:"pipeline-card__node-label",children:S.label})]})]}),w<e.flow.length-1&&f.jsx("div",{className:"pipeline-card__arrow"})]},S.id))}),f.jsx("div",{className:"pipeline-card__foot",children:u!=null?u:f.jsxs("div",{className:"pipeline-card__foot-row",children:[f.jsxs("div",{className:"pipeline-card__foot-col",children:[f.jsx("div",{className:"pipeline-card__foot-label",children:"LAST RUN"}),f.jsx("div",{className:"pipeline-card__foot-value",children:e.lastRun||"—"})]}),f.jsxs("div",{className:"pipeline-card__foot-col",children:[f.jsx("div",{className:"pipeline-card__foot-label",children:"INGESTED"}),f.jsx("div",{className:"pipeline-card__foot-value",children:e.recent.ingested})]}),f.jsxs("div",{className:"pipeline-card__foot-col",children:[f.jsx("div",{className:"pipeline-card__foot-label",children:"CREATED"}),f.jsx("div",{className:"pipeline-card__foot-value",children:e.recent.created})]}),f.jsxs("div",{className:"pipeline-card__foot-col",children:[f.jsx("div",{className:"pipeline-card__foot-label",children:"UPDATED"}),f.jsx("div",{className:"pipeline-card__foot-value",children:e.recent.updated})]}),f.jsxs("div",{className:["pipeline-card__foot-col",Number(e.recent.errors)>0&&"pipeline-card__foot-col--error"].filter(Boolean).join(" "),children:[f.jsx("div",{className:"pipeline-card__foot-label",children:"ERRORS"}),f.jsx("div",{className:"pipeline-card__foot-value",children:e.recent.errors})]})]})})]}))});HO.displayName="PipelineCard";const PO=e=>{const t=[];let a=0;const s=/`([^`]+)`/g;let r;for(;(r=s.exec(e))!==null;)r.index>a&&t.push(e.substring(a,r.index)),t.push(f.jsx("code",{className:"form-callout__code",children:r[1]},`code-${r.index}`)),a=s.lastIndex;return a<e.length&&t.push(e.substring(a)),t.length>0?t:[e]},$O=ie.forwardRef((u,o)=>{var h=u,{variant:e="info",icon:t,children:a,className:s="",role:r}=h,c=de(h,["variant","icon","children","className","role"]);const m=typeof a=="string"?PO(a):a,g=r!=null?r:e==="error"||e==="warn"?"alert":"note";return f.jsxs("div",K(T({ref:o,className:["form-callout",`form-callout--${e}`,s].filter(Boolean).join(" "),"data-testid":"form-callout",role:g},c),{children:[t&&f.jsx("div",{className:"form-callout__icon",children:f.jsx(Ce,{name:t,size:16})}),f.jsx("div",{className:"form-callout__body",children:m})]}))});$O.displayName="FormCallout";function qO(e,t,a,s,r,c){const o=r-e,u=c-t;if(o===0&&u===0)return{x:e,y:t};const h=Math.abs(o),m=Math.abs(u),g=a/2,p=s/2;if(h*p>m*g){const v=o>0?1:-1;return{x:e+v*g,y:t+u*g/h}}else{const v=u>0?1:-1;return{x:e+o*p/m,y:t+v*p}}}function Y0(e,t,a,s,r,c){const o=e.maxX-e.minX,u=e.maxY-e.minY,h=Math.min(c,Math.max(r,Math.min((t-2*s)/(o||1),(a-2*s)/(u||1)))),m=(e.minX+e.maxX)/2,g=(e.minY+e.maxY)/2;return{zoom:h,panX:t/2-m*h,panY:a/2-g*h}}const YS=.22;function VO(e,t,a=YS){const s=t.x-e.x,r=t.y-e.y,c=Math.hypot(s,r),o=-r/(c||1),u=s/(c||1),h=Math.min(80,c*a),m=(e.x+t.x)/2+o*h,g=(e.y+t.y)/2+u*h;return{d:`M ${e.x} ${e.y} Q ${m} ${g} ${t.x} ${t.y}`,mid:{x:(e.x+2*m+t.x)/4,y:(e.y+2*g+t.y)/4},angle:Math.atan2(t.y-g,t.x-m)}}const G0={left:{x:-1,y:0},right:{x:1,y:0},top:{x:0,y:-1},bottom:{x:0,y:1}};function K0(e,t,a,s,r,c,o){switch(r){case"left":return{x:e-a/2,y:t};case"right":return{x:e+a/2,y:t};case"top":return{x:e,y:t-s/2};case"bottom":return{x:e,y:t+s/2};default:return qO(e,t,a,s,c,o)}}const GS=.22;function YO(e,t,a="auto",s="auto",r=GS){const c=t.x-e.x,o=t.y-e.y,u=Math.hypot(c,o)||1,h=Math.min(120,u*r),m=-o/u,g=c/u,p=a==="auto"?{x:m,y:g}:G0[a],v=s==="auto"?{x:m,y:g}:G0[s],b={x:e.x+p.x*h,y:e.y+p.y*h},_={x:t.x+v.x*h,y:t.y+v.y*h},S={x:(e.x+b.x)/2,y:(e.y+b.y)/2},w={x:(b.x+_.x)/2,y:(b.y+_.y)/2},C={x:(_.x+t.x)/2,y:(_.y+t.y)/2},R={x:(S.x+w.x)/2,y:(S.y+w.y)/2},j={x:(w.x+C.x)/2,y:(w.y+C.y)/2},k={x:(R.x+j.x)/2,y:(R.y+j.y)/2};return{d:`M ${e.x} ${e.y} C ${b.x} ${b.y} ${_.x} ${_.y} ${t.x} ${t.y}`,mid:k,angle:Math.atan2(j.y-R.y,j.x-R.x)}}function KS(e,t,a={}){var u,h,m,g;const s=(u=a.sourceAnchor)!=null?u:"auto",r=(h=a.targetAnchor)!=null?h:"auto",c=K0(e.x,e.y,e.width,e.height,s,t.x,t.y),o=K0(t.x,t.y,t.width,t.height,r,e.x,e.y);return s==="auto"&&r==="auto"?VO(c,o,(m=a.curvature)!=null?m:YS):YO(c,o,s,r,(g=a.curvature)!=null?g:GS)}function GO(e,t,a={}){const{iterations:s=300,springLength:r=160,springStrength:c=.04,repulsion:o=8e3,damping:u=.85,centerStrength:h=.005}=a;if(e.length===0)return new Map;const m=new Map(e.map(b=>[b.id,0])),g=new Map(e.map(b=>[b.id,0])),p=new Map(e.map(b=>[b.id,{x:b.x,y:b.y}])),v=new Map(e.map(b=>[b.id,b]));for(let b=0;b<s;b++){for(let _=0;_<e.length;_++)for(let S=_+1;S<e.length;S++){const w=e[_],C=e[S];if(w.pinned&&C.pinned)continue;const R=p.get(w.id),j=p.get(C.id),k=j.x-R.x||.1,I=j.y-R.y||.1,O=Math.max(Math.hypot(k,I),1),z=o/(O*O),B=k/O*z,P=I/O*z;w.pinned||(m.set(w.id,m.get(w.id)-B),g.set(w.id,g.get(w.id)-P)),C.pinned||(m.set(C.id,m.get(C.id)+B),g.set(C.id,g.get(C.id)+P))}for(const _ of t){const S=v.get(_.source),w=v.get(_.target);if(!S||!w||S.pinned&&w.pinned)continue;const C=p.get(S.id),R=p.get(w.id),j=R.x-C.x||.1,k=R.y-C.y||.1,I=Math.max(Math.hypot(j,k),1),O=c*(I-r),z=j/I*O,B=k/I*O;S.pinned||(m.set(S.id,m.get(S.id)+z),g.set(S.id,g.get(S.id)+B)),w.pinned||(m.set(w.id,m.get(w.id)-z),g.set(w.id,g.get(w.id)-B))}for(const _ of e){if(_.pinned)continue;const S=p.get(_.id),w=(m.get(_.id)-S.x*h)*u,C=(g.get(_.id)-S.y*h)*u;m.set(_.id,w),g.set(_.id,C),p.set(_.id,{x:S.x+w,y:S.y+C})}}return ZO(e,t,p,m,g,v,{springLength:r,springStrength:c,damping:u}),p}const KO=40,XO=3,QO=50,X0=6;function ZO(e,t,a,s,r,c,o){for(let u=0;u<KO;u++){Q0(e,a);for(let h=0;h<XO;h++)JO(e,t,a,s,r,c,o)}for(let u=0;u<QO&&Q0(e,a);u++);}function Q0(e,t){let a=!1;const s=new Map(e.map(r=>[r.id,{x:0,y:0}]));for(let r=0;r<e.length;r++)for(let c=r+1;c<e.length;c++){const o=e[r],u=e[c];if(o.pinned&&u.pinned)continue;const h=t.get(o.id),m=t.get(u.id),g=m.x-h.x,p=m.y-h.y,v=(o.width+u.width)/2-Math.abs(g),b=(o.height+u.height)/2-Math.abs(p);if(v<=0||b<=0)continue;a=!0;let _=0,S=0;v<b?_=(g>=0?1:-1)*v:S=(p>=0?1:-1)*b;let w=_/2,C=S/2;const R=Math.hypot(w,C);if(R>X0){const j=X0/R;w*=j,C*=j}o.pinned?(s.get(u.id).x+=w*2,s.get(u.id).y+=C*2):u.pinned?(s.get(o.id).x-=w*2,s.get(o.id).y-=C*2):(s.get(o.id).x-=w,s.get(o.id).y-=C,s.get(u.id).x+=w,s.get(u.id).y+=C)}for(const r of e){if(r.pinned)continue;const c=s.get(r.id);if(c.x===0&&c.y===0)continue;const o=t.get(r.id);t.set(r.id,{x:o.x+c.x,y:o.y+c.y})}return a}function JO(e,t,a,s,r,c,{springLength:o,springStrength:u,damping:h}){for(const m of t){const g=c.get(m.source),p=c.get(m.target);if(!g||!p||g.pinned&&p.pinned)continue;const v=a.get(g.id),b=a.get(p.id),_=b.x-v.x||.1,S=b.y-v.y||.1,w=Math.max(Math.hypot(_,S),1),C=u*(w-o),R=_/w*C,j=S/w*C;g.pinned||(s.set(g.id,s.get(g.id)+R),r.set(g.id,r.get(g.id)+j)),p.pinned||(s.set(p.id,s.get(p.id)-R),r.set(p.id,r.get(p.id)-j))}for(const m of e){if(m.pinned)continue;const g=a.get(m.id),p=s.get(m.id)*h,v=r.get(m.id)*h;s.set(m.id,p),r.set(m.id,v),a.set(m.id,{x:g.x+p,y:g.y+v})}}const WO=.25,e4=4,_u=.1,Su=20,Z0=.95,J0=.1;function t4(){return typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function XS({minZoom:e=WO,maxZoom:t=e4,bounds:a,onViewportChange:s}={}){const[r,c]=A.useState(1),[o,u]=A.useState({x:0,y:0}),h=A.useRef(1),m=A.useRef({x:0,y:0}),g=A.useRef(null),p=A.useRef(!1),v=A.useRef(),b=A.useRef(),_=A.useRef(null),S=A.useRef(null);A.useEffect(()=>{h.current=r},[r]),A.useEffect(()=>{m.current=o},[o]),A.useEffect(()=>{s==null||s({x:o.x,y:o.y,zoom:r})},[o,r,s]);const w=A.useCallback((q,H)=>{if(!a)return{x:q,y:H};const Y=-a.maxX*h.current,$=-a.minX*h.current,X=-a.maxY*h.current,Z=-a.minY*h.current;return{x:Math.max(Y,Math.min($,q)),y:Math.max(X,Math.min(Z,H))}},[a]),C=A.useCallback(q=>{var H;(H=v.current)==null||H.call(v,q)},[]),R=A.useCallback(()=>{var q;(q=b.current)==null||q.call(b)},[]),j=A.useCallback(()=>{p.current||(document.addEventListener("pointermove",C),document.addEventListener("pointerup",R),p.current=!0)},[C,R]),k=A.useCallback(()=>{p.current&&(document.removeEventListener("pointermove",C),document.removeEventListener("pointerup",R),p.current=!1)},[C,R]),I=A.useCallback(q=>{if(!g.current)return;const H=q.clientX-g.current.lastX,Y=q.clientY-g.current.lastY,$=performance.now(),X=Math.max(1,$-g.current.time)/1e3;g.current.vx=H/X,g.current.vy=Y/X,g.current.time=$,g.current.lastX=q.clientX,g.current.lastY=q.clientY,_.current!==null&&cancelAnimationFrame(_.current),_.current=requestAnimationFrame(()=>{if(!g.current)return;const Z=w(g.current.panX+(q.clientX-g.current.x),g.current.panY+(q.clientY-g.current.y));u(Z),_.current=null})},[w]),O=A.useCallback(()=>{if(!g.current){k();return}const q=t4(),H=g.current.vx,Y=g.current.vy,$=Math.sqrt(H*H+Y*Y);if(g.current=null,k(),q||$<J0)return;let X=H,Z=Y,fe=m.current,D=performance.now();const he=()=>{const ge=performance.now(),E=(ge-D)/1e3;if(D=ge,X*=Math.pow(Z0,E*60),Z*=Math.pow(Z0,E*60),Math.sqrt(X*X+Z*Z)<J0){S.current=null;return}fe=w(fe.x+X*E,fe.y+Z*E),u(fe),S.current=requestAnimationFrame(he)};S.current=requestAnimationFrame(he)},[k,w]),z=A.useCallback(q=>{S.current!==null&&(cancelAnimationFrame(S.current),S.current=null),g.current={x:q.clientX,y:q.clientY,lastX:q.clientX,lastY:q.clientY,panX:m.current.x,panY:m.current.y,vx:0,vy:0,time:performance.now()},j()},[j]);A.useEffect(()=>{v.current=I},[I]),A.useEffect(()=>{b.current=O},[O]),A.useEffect(()=>()=>{k(),_.current!==null&&cancelAnimationFrame(_.current),S.current!==null&&cancelAnimationFrame(S.current)},[k]);const B=A.useCallback(q=>{q.preventDefault();const H=q.currentTarget.getBoundingClientRect(),Y=q.clientX-H.left,$=q.clientY-H.top;if(!Number.isFinite(Y)||!Number.isFinite($))return;const X=q.deltaY>0?-_u:_u,Z=h.current,fe=Math.min(t,Math.max(e,Z+X)),D=fe-Z,he=w(m.current.x-Y/Z*D,m.current.y-$/Z*D);_.current!==null&&cancelAnimationFrame(_.current),_.current=requestAnimationFrame(()=>{c(fe),u(he),_.current=null})},[w,e,t]),P=A.useCallback(q=>{const H=q.key;let Y=null,$=null;H==="+"||H==="="?(q.preventDefault(),Y=Math.min(t,h.current+_u)):H==="-"||H==="_"?(q.preventDefault(),Y=Math.max(e,h.current-_u)):H==="ArrowUp"?(q.preventDefault(),$=w(m.current.x,m.current.y+Su)):H==="ArrowDown"?(q.preventDefault(),$=w(m.current.x,m.current.y-Su)):H==="ArrowLeft"?(q.preventDefault(),$=w(m.current.x+Su,m.current.y)):H==="ArrowRight"&&(q.preventDefault(),$=w(m.current.x-Su,m.current.y)),(Y!==null||$!==null)&&(_.current!==null&&cancelAnimationFrame(_.current),_.current=requestAnimationFrame(()=>{Y!==null&&c(Y),$!==null&&u($),_.current=null}))},[w,e,t]),M=A.useCallback((q,H,Y)=>{const $=Math.min(t,Math.max(e,q)),X=h.current,Z=$-X;if(c($),H!==void 0&&Y!==void 0){const fe=w(m.current.x-H/X*Z,m.current.y-Y/X*Z);u(fe)}},[w,e,t]),U=A.useCallback((q,H)=>{const Y=w(q,H);u(Y)},[w]),F=A.useCallback(()=>{c(1),u({x:0,y:0})},[]);return{transform:`matrix(${r}, 0, 0, ${r}, ${o.x}, ${o.y})`,viewport:{x:o.x,y:o.y,zoom:r},bind:{onPointerDown:z,onWheel:B,onKeyDown:P,tabIndex:0,role:"region"},zoomTo:M,panTo:U,reset:F}}const QS=A.createContext(null);function ZS(){const e=A.useContext(QS);if(!e)throw new Error("useGraphCanvas must be used within a GraphCanvas");return e}const JS=ie.forwardRef((g,m)=>{var p=g,{id:e,label:t,kind:a,domainColor:s="default",selected:r=!1,onSelect:c,className:o="",style:u}=p,h=de(p,["id","label","kind","domainColor","selected","onSelect","className","style"]);const v=["graph-node",r&&"selected",o].filter(Boolean).join(" ");return f.jsxs("div",K(T({ref:m,className:v,"data-domain":s,"data-kind":a,onClick:b=>{b.stopPropagation(),c==null||c(e)},onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),b.stopPropagation(),c==null||c(e))},role:c?"button":void 0,tabIndex:c?0:void 0,"aria-pressed":c?r:void 0},h),{children:[f.jsx("span",{className:"graph-node__swatch"}),f.jsx("span",{className:"graph-node__label",children:t}),a&&f.jsx("span",{className:"graph-node__kind",children:a})]}))});JS.displayName="GraphNode";const W0=1,n4=8,a4=20,i4={default:1.25,hot:1.75,irrelevant:1.25},gm={default:7,hot:8,irrelevant:7};function s4(e){const t=Number.isFinite(e)?e:0,a=Math.min(100,Math.max(0,t)),s=n4-W0;return W0+s*Math.sqrt(a/100)}function r4(e,t,a){return Math.min(e*(a/t),a4)}function l4(e){return Array.isArray(e)?`${e[0]} ${e[1]}`:`${e} ${e}`}function rg({id:e,d:t,mid:a,label:s,variant:r,weight:c,opacity:o,strokeDash:u,detailedTestIds:h=!1}){const m=`arrow-${e}`,g=`arrow-rose-${e}`,p=`arrow-cyan-${e}`,v=r==="hot"?`url(#${p})`:r==="irrelevant"?`url(#${g})`:`url(#${m})`,b=c!==void 0?s4(c):void 0,_=i4[r],S=O=>b!==void 0?r4(O,_,b):O,w=b!==void 0?"userSpaceOnUse":void 0,C={};b!==void 0&&(C.strokeWidth=b),o!==void 0&&(C.opacity=o),u!==void 0&&(C.strokeDasharray=l4(u));const R=o!==void 0?{opacity:o}:void 0,j=S(gm.default),k=S(gm.irrelevant),I=S(gm.hot);return f.jsxs(f.Fragment,{children:[f.jsxs("defs",{children:[f.jsx("marker",{id:m,viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:j,markerHeight:j,markerUnits:w,orient:"auto-start-reverse",children:f.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"var(--graph-edge-strong, #94a3b8)",style:R})}),f.jsx("marker",{id:g,viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:k,markerHeight:k,markerUnits:w,orient:"auto-start-reverse",children:f.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"rgb(var(--status-rose))",style:R})}),f.jsx("marker",{id:p,viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:I,markerHeight:I,markerUnits:w,orient:"auto-start-reverse",children:f.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"rgb(var(--accent-primary))",style:R})})]}),f.jsx("path",{className:"graph-edge__hit",d:t,"data-testid":h?`graph-edge-hit-${e}`:void 0}),f.jsx("path",{className:"graph-edge__line",d:t,markerEnd:v,style:Object.keys(C).length?C:void 0,"data-testid":h?`graph-edge-line-${e}`:void 0}),s&&f.jsxs("g",{className:"graph-edge__label",transform:`translate(${a.x-(s.length*3.3+7)}, ${a.y-9})`,children:[f.jsx("rect",{width:s.length*6.6+14,height:"18",rx:"3",className:"graph-edge__label-bg","data-testid":h?`graph-edge-label-bg-${e}`:void 0}),f.jsx("text",{x:s.length*3.3+7,y:"12",className:"graph-edge__label-text","data-testid":h?`graph-edge-label-text-${e}`:void 0,children:s})]})]})}rg.displayName="GraphEdgeShape";const yo=138,vo=30,ym=.4,vm=2.5;function o4({id:e,sourceId:t,targetId:a,label:s,variant:r="default",weight:c,opacity:o,strokeDash:u,sourceAnchor:h,targetAnchor:m,curvature:g}){const{getNodeRect:p}=ZS(),v=A.useMemo(()=>{const _=p(t),S=p(a);return!_||!S?null:KS(_,S,{sourceAnchor:h,targetAnchor:m,curvature:g})},[p,t,a,h,m,g]);if(!v)return null;const b=["graph-edge",r!=="default"&&`graph-edge--${r}`].filter(Boolean).join(" ");return f.jsx("g",{className:b,role:"presentation","aria-hidden":"true","data-testid":`graph-edge-${e}`,children:f.jsx(rg,{id:e,d:v.d,mid:v.mid,label:s,variant:r,weight:c,opacity:o,strokeDash:u})})}const WS=ie.forwardRef((p,g)=>{var v=p,{nodes:e=[],edges:t=[],selectedNodeId:a,onNodeSelect:s,renderNode:r,layout:c="manual",fitView:o=!1,fitPadding:u=40,className:h=""}=v,m=de(v,["nodes","edges","selectedNodeId","onNodeSelect","renderNode","layout","fitView","fitPadding","className"]);const[b,_]=A.useState(new Map),[S,w]=A.useState(new Map),C=A.useRef(null),R=A.useRef({}),j=A.useRef(!1),[k,I]=A.useState(null),{transform:O,viewport:z,bind:B,panTo:P,zoomTo:M}=XS({minZoom:ym,maxZoom:vm}),U=A.useCallback(E=>{E.target instanceof Element&&E.target.closest(".graph-node, [data-no-drag]")||B.onPointerDown(E)},[B]),F=`grid${A.useId().replace(/:/g,"")}`;A.useLayoutEffect(()=>{const E=new Map;for(const W of e){const oe=R.current[W.id];E.set(W.id,{width:(oe==null?void 0:oe.offsetWidth)||yo,height:(oe==null?void 0:oe.offsetHeight)||vo})}_(E)},[e]),A.useEffect(()=>{if(c!=="force"||b.size===0)return;const E=e.map((oe,me)=>{var Ae,Ge,ot,qt;var _e,be;return{id:oe.id,x:(Ae=oe.x)!=null?Ae:Math.cos(2*Math.PI*me/e.length)*120,y:(Ge=oe.y)!=null?Ge:Math.sin(2*Math.PI*me/e.length)*120,width:(ot=(_e=b.get(oe.id))==null?void 0:_e.width)!=null?ot:yo,height:(qt=(be=b.get(oe.id))==null?void 0:be.height)!=null?qt:vo,pinned:oe.x!==void 0&&oe.y!==void 0}}),W=(t!=null?t:[]).map(oe=>({source:oe.sourceId,target:oe.targetId}));w(GO(E,W))},[e,t,b,c]),A.useEffect(()=>{const E=C.current;if(!E)return;const W=new ResizeObserver(oe=>{const{width:me,height:_e}=oe[0].contentRect;me>0&&_e>0&&I({width:me,height:_e})});return W.observe(E),()=>W.disconnect()},[]);const q=A.useCallback(()=>{var _e;let E=1/0,W=-1/0,oe=1/0,me=-1/0;for(const be of e){const Ae=be.x!==void 0&&be.y!==void 0?{x:be.x,y:be.y}:S.get(be.id);if(!Ae)continue;const Ge=(_e=b.get(be.id))!=null?_e:{width:yo,height:vo};E=Math.min(E,Ae.x-Ge.width/2),W=Math.max(W,Ae.x+Ge.width/2),oe=Math.min(oe,Ae.y-Ge.height/2),me=Math.max(me,Ae.y+Ge.height/2)}return Number.isFinite(E)?{minX:E,maxX:W,minY:oe,maxY:me}:null},[e,b,S]);A.useEffect(()=>{if(j.current||!k||b.size===0||e.length===0||c==="force"&&S.size===0)return;const E=q();if(E)if(j.current=!0,o){const W=Y0(E,k.width,k.height,u,ym,vm);M(W.zoom),P(W.panX,W.panY)}else{const W=(E.minX+E.maxX)/2,oe=(E.minY+E.maxY)/2;P(k.width/2-W*z.zoom,k.height/2-oe*z.zoom)}},[k,b,S,e,c,z.zoom,P,M,o,u,q]);const H=A.useCallback(E=>{const W=q();if(!W||!k)return;const oe=Y0(W,k.width,k.height,E!=null?E:u,ym,vm);M(oe.zoom),P(oe.panX,oe.panY)},[q,k,u,M,P]),Y=A.useCallback(E=>{var W;return E.x!==void 0&&E.y!==void 0?{x:E.x,y:E.y}:(W=S.get(E.id))!=null?W:{x:0,y:0}},[S]),$=A.useCallback(E=>{var _e;const W=e.find(be=>be.id===E);if(!W)return null;const oe=Y(W),me=(_e=b.get(E))!=null?_e:{width:yo,height:vo};return{x:oe.x,y:oe.y,width:me.width,height:me.height}},[e,b,Y]),X=A.useCallback((E,W)=>r?r(E,W):f.jsx(JS,{id:E.id,label:E.label,kind:E.kind,domainColor:E.domainColor,selected:W,onSelect:s}),[r,s]),Z=A.useMemo(()=>({getNodeRect:$,zoom:z.zoom,pan:{x:z.x,y:z.y},selectedNodeId:a,zoomToFit:H,setZoom:M,setPan:P}),[$,z,a,H,M,P]),fe=E=>{typeof g=="function"?g(E):g&&(g.current=E),C.current=E},D=18*z.zoom,he=(z.x%D+D)%D,ge=(z.y%D+D)%D;return f.jsxs("div",K(T({ref:fe,"aria-label":"Graph canvas",className:["graph-canvas",h].filter(Boolean).join(" "),onPointerDown:U,onWheel:B.onWheel,onKeyDown:B.onKeyDown,tabIndex:B.tabIndex,role:B.role},m),{children:[f.jsx("div",{className:"graph-measure","aria-hidden":"true",children:e.map(E=>f.jsx("div",{ref:W=>{R.current[E.id]=W},style:{display:"inline-block"},children:X(E,!1)},E.id))}),f.jsxs("svg",{className:"graph-svg",width:"100%",height:"100%",style:{position:"absolute",inset:0,overflow:"visible"},children:[f.jsx("defs",{children:f.jsx("pattern",{id:F,x:he,y:ge,width:D,height:D,patternUnits:"userSpaceOnUse",children:f.jsx("circle",{cx:"0",cy:"0",r:Math.min(1,.5*z.zoom),className:"graph-grid-dot"})})}),f.jsx("rect",{width:"100%",height:"100%",fill:`url(#${F})`,className:"graph-grid"}),f.jsx(QS.Provider,{value:Z,children:f.jsxs("g",{className:"graph-viewport","data-testid":"graph-viewport",transform:O,children:[f.jsx("g",{className:"graph-edges",children:t==null?void 0:t.map(E=>f.jsx(o4,{id:E.id,sourceId:E.sourceId,targetId:E.targetId,label:E.label,variant:E.variant,weight:E.weight,opacity:E.opacity,strokeDash:E.strokeDash,sourceAnchor:E.sourceAnchor,targetAnchor:E.targetAnchor,curvature:E.curvature},E.id))}),f.jsx("g",{className:"graph-nodes",children:e.map(E=>{var _e;const W=Y(E),oe=(_e=b.get(E.id))!=null?_e:{width:yo,height:vo},me=E.id===a;return f.jsx("g",{transform:`translate(${W.x} ${W.y})`,"data-node-id":E.id,"data-testid":`graph-node-${E.id}`,"data-domain":E.domainColor,className:me?"selected":void 0,children:f.jsx("foreignObject",{x:-oe.width/2,y:-oe.height/2,width:oe.width,height:oe.height,overflow:"visible",children:X(E,me)})},E.id)})})]})})]})]}))});WS.displayName="GraphCanvas";const c4=ie.forwardRef((_,b)=>{var S=_,{id:e,sourceId:t,targetId:a,label:s,variant:r="default",weight:c,opacity:o,strokeDash:u,sourceAnchor:h,targetAnchor:m,curvature:g,className:p=""}=S,v=de(S,["id","sourceId","targetId","label","variant","weight","opacity","strokeDash","sourceAnchor","targetAnchor","curvature","className"]);const{getNodeRect:w}=ZS(),C=A.useMemo(()=>{const j=w(t),k=w(a);return j?k?KS(j,k,{sourceAnchor:h,targetAnchor:m,curvature:g}):(console.warn(`GraphEdge: target node "${a}" not found`),null):(console.warn(`GraphEdge: source node "${t}" not found`),null)},[w,t,a,h,m,g]);if(!C)return null;const R=["graph-edge",r!=="default"&&`graph-edge--${r}`,p].filter(Boolean).join(" ");return f.jsx("g",K(T({ref:b,className:R,role:"presentation","aria-hidden":"true","data-testid":`graph-edge-${e}`},v),{children:f.jsx(rg,{id:e,d:C.d,mid:C.mid,label:s,variant:r,weight:c,opacity:o,strokeDash:u,detailedTestIds:!0})}))});c4.displayName="GraphEdge";const ew=ie.forwardRef((u,o)=>{var h=u,{node:e,relationships:t=[],onNodeSelect:a,emptyStateText:s="Select a node to inspect.",className:r=""}=h,c=de(h,["node","relationships","onNodeSelect","emptyStateText","className"]);const m=["graph-inspector",r].filter(Boolean).join(" ");if(!e)return f.jsx("div",K(T({ref:o,className:m},c),{children:f.jsx("div",{className:"graph-inspector__empty","data-testid":"inspector-empty",children:s})}));const g=t.filter(v=>v.direction==="out"),p=t.filter(v=>v.direction==="in");return f.jsxs("div",K(T({ref:o,className:m},c),{children:[f.jsxs("div",{className:"graph-inspector__head",children:[f.jsxs("div",{className:"graph-inspector__head-eyebrow",children:[e.kind&&f.jsx("span",{className:"graph-inspector__badge",children:e.kind}),e.domain&&f.jsx("span",{className:`graph-inspector__badge graph-inspector__badge--${e.domain}`,children:e.domain})]}),f.jsx("div",{className:"graph-inspector__title","data-testid":"inspector-title",children:e.title}),f.jsx("div",{className:"graph-inspector__id","data-testid":"inspector-id",children:e.id})]}),f.jsxs("div",{className:"graph-inspector__body",children:[e.description&&f.jsx("p",{className:"graph-inspector__description","data-testid":"inspector-description",children:e.description}),e.metadata&&Object.keys(e.metadata).length>0&&f.jsx("dl",{className:"graph-inspector__kv","data-testid":"inspector-metadata",children:Object.entries(e.metadata).map(([v,b])=>f.jsxs(ie.Fragment,{children:[f.jsx("dt",{children:v}),f.jsx("dd",{children:String(b)})]},v))}),g.length>0&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"graph-inspector__section-label",children:["Outgoing · ",g.length]}),f.jsx("ul",{className:"graph-inspector__rels","data-testid":"inspector-outgoing",children:g.map(v=>f.jsxs("li",{className:"graph-inspector__rel",children:[f.jsx("span",{className:"graph-inspector__rel-dir graph-inspector__rel-dir--out",children:"→"}),f.jsx("span",{className:"graph-inspector__rel-pred",children:v.predicate}),f.jsxs("button",{type:"button",className:"graph-inspector__rel-target","data-domain":v.targetDomain,onClick:()=>a==null?void 0:a(v.target),"aria-label":`Navigate to ${v.targetTitle}`,"data-testid":`inspector-rel-${v.id}`,children:[f.jsx("span",{className:"graph-inspector__rel-swatch"}),f.jsx("span",{children:v.targetTitle})]})]},v.id))})]}),p.length>0&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"graph-inspector__section-label",children:["Incoming · ",p.length]}),f.jsx("ul",{className:"graph-inspector__rels","data-testid":"inspector-incoming",children:p.map(v=>f.jsxs("li",{className:"graph-inspector__rel",children:[f.jsx("span",{className:"graph-inspector__rel-dir graph-inspector__rel-dir--in",children:"←"}),f.jsx("span",{className:"graph-inspector__rel-pred",children:v.predicate}),f.jsxs("button",{type:"button",className:"graph-inspector__rel-target","data-domain":v.targetDomain,onClick:()=>a==null?void 0:a(v.target),"aria-label":`Navigate to ${v.targetTitle}`,"data-testid":`inspector-rel-${v.id}`,children:[f.jsx("span",{className:"graph-inspector__rel-swatch"}),f.jsx("span",{children:v.targetTitle})]})]},v.id))})]}),t.length===0&&f.jsx("div",{className:"graph-inspector__empty-mini",children:"No relationships yet."})]})]}))});ew.displayName="GraphInspector";const u4={ok:"rgb(var(--status-emerald))",warning:"rgb(var(--status-amber))",error:"rgb(var(--status-rose))",idle:"rgb(var(--status-neutral))"},d4=ie.forwardRef((v,p)=>{var b=v,{title:e,nodeRole:t="",status:a="idle",metrics:s=[],selected:r=!1,x:c,y:o,onSelect:u,className:h="",style:m}=b,g=de(b,["title","nodeRole","status","metrics","selected","x","y","onSelect","className","style"]);const _=["topology-node",`topology-node--${a}`,r?"topology-node--selected":"",u?"topology-node--interactive":"",h].filter(Boolean).join(" "),S=T(T({},c!==void 0&&o!==void 0?{position:"absolute",left:`${c}px`,top:`${o}px`}:{}),m),w=e.replace(/\s+/g,"-").toLowerCase(),C=R=>{u&&(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),u())};return f.jsxs("div",K(T({ref:p,className:_,style:S,"data-testid":`topology-node-${w}`,onClick:u,onKeyDown:C,tabIndex:u?0:void 0,"aria-selected":r,role:u?"button":void 0},g),{children:[f.jsxs("div",{className:"topology-node__head",children:[f.jsx("div",{className:"topology-node__title",children:e}),f.jsx("div",{className:"topology-node__status-dot",style:{backgroundColor:u4[a]},"data-testid":`topology-status-${w}`,"aria-label":`Status: ${a}`})]}),f.jsx("div",{className:"topology-node__role","data-testid":`topology-role-${w}`,children:t}),s.length>0&&f.jsx("div",{className:"topology-node__metrics","data-testid":`topology-metrics-${w}`,children:s.map((R,j)=>f.jsxs("div",{className:"topology-node__metric-row",children:[f.jsx("div",{className:"topology-node__metric-label",children:R.label}),f.jsxs("div",{className:"topology-node__metric-value",children:[R.value,R.unit&&f.jsx("span",{className:"topology-node__metric-unit",children:R.unit})]}),f.jsx("div",{className:"topology-node__metric-bar",children:f.jsx("div",{className:"topology-node__metric-fill",style:{width:`${Number.isFinite(R.percent)?Math.max(0,Math.min(100,R.percent)):0}%`,backgroundColor:R.color?`rgb(var(--status-${R.color}))`:"rgb(var(--accent-primary))"}})})]},j))})]}))});d4.displayName="TopologyNode";const ex={life:"var(--dom-life)",climate:"var(--dom-climate)",software:"var(--dom-software)",default:"var(--dom-default)"},f4=ie.forwardRef((v,p)=>{var b=v,{depth:e=0,domain:t,kind:a,label:s,meta:r,description:c,selected:o=!1,onSelect:u,showKind:h=!0,className:m=""}=b,g=de(b,["depth","domain","kind","label","meta","description","selected","onSelect","showKind","className"]);const _=ex[t]||ex.default,S=["hierarchy-row",o&&"selected",u&&"interactive",m].filter(Boolean).join(" "),w=ie.useCallback(C=>{(C.key==="Enter"||C.key===" ")&&u&&(C.preventDefault(),u())},[u]);return f.jsxs("div",K(T({ref:p,className:S,role:u?"button":void 0,tabIndex:u?0:void 0,"aria-pressed":u?o:void 0,onClick:u,onKeyDown:u?w:void 0,style:{"--hierarchy-depth":e,"--domain-color":_}},g),{children:[f.jsxs("div",{className:"hierarchy-row__left",children:[e>0&&f.jsx("div",{className:"hierarchy-row__connector"}),f.jsxs("div",{className:"hierarchy-row__pill",children:[f.jsx("div",{className:"hierarchy-row__swatch"}),h&&f.jsx("span",{className:"hierarchy-row__kind",children:a}),f.jsx("span",{className:"hierarchy-row__label",children:s}),r&&f.jsx("span",{className:"hierarchy-row__meta",children:r})]})]}),c&&f.jsx("div",{className:"hierarchy-row__right",children:f.jsx("span",{className:"hierarchy-row__description",children:c})})]}))});f4.displayName="HierarchyRow";const h4=ie.forwardRef((r,s)=>{var c=r,{className:e="",children:t}=c,a=de(c,["className","children"]);const o=["hierarchy-tree",e].filter(Boolean).join(" ");return f.jsx("div",K(T({ref:s,className:o},a),{children:t}))});h4.displayName="HierarchyTree";const m4=ie.forwardRef((o,c)=>{var u=o,{nodes:e,wrap:t=!1,className:a="","aria-label":s}=u,r=de(u,["nodes","wrap","className","aria-label"]);if(e.length===0)return null;const h=["lineage-rail",t&&"lineage-rail--wrap",a].filter(Boolean).join(" "),m=s||`Lineage: ${e.map(g=>g.label).join(" → ")}`;return f.jsx("div",K(T({ref:c,className:h,role:"list","aria-label":m},r),{children:e.map((g,p)=>{const v=p===0;return f.jsxs(ie.Fragment,{children:[p>0&&f.jsx("span",{className:"lineage-rail__arrow","aria-hidden":"true",children:"→"}),f.jsx(p4,{node:g,isHead:v})]},`${g.label}-${p}`)})}))});m4.displayName="LineageRail";const p4=({node:e,isHead:t})=>{const a=["lineage-rail__node",e.onClick&&"lineage-rail__node--interactive",t&&"lineage-rail__node--head"].filter(Boolean).join(" "),s=r=>{(r.key==="Enter"||r.key===" ")&&e.onClick&&(r.preventDefault(),e.onClick())};return f.jsxs(Nn,{className:a,role:"listitem","aria-current":t?"step":void 0,onClick:e.onClick,onKeyDown:e.onClick?s:void 0,tabIndex:e.onClick?0:void 0,children:[e.icon&&f.jsx(Ce,{name:e.icon,size:14}),f.jsx("span",{className:"lineage-rail__label",children:e.label})]})},g4=ie.forwardRef((m,h)=>{var g=m,{thumb:e,title:t,subtitle:a,meta:s,badge:r,selected:c=!1,className:o=""}=g,u=de(g,["thumb","title","subtitle","meta","badge","selected","className"]);const[p,v]=ie.useState(!1),[b,_]=ie.useState(!1);ie.useEffect(()=>{v(!1),_(!1)},[e.kind==="image"?e.src:null]);const S=["asset-card",c&&"asset-card--selected",o].filter(Boolean).join(" ");return f.jsxs("div",K(T({ref:h,className:S,"aria-selected":c},u),{children:[f.jsxs("div",{className:"asset-card__thumb-wrapper",children:[(()=>{if(e.kind==="doc")return f.jsxs("div",{className:"asset-card__thumb asset-card__thumb--doc",children:[f.jsx("div",{className:"asset-card__doc-page"}),f.jsx("div",{className:`asset-card__doc-tab asset-card__doc-tab--${e.ext.toLowerCase()}`,children:e.ext.toUpperCase()})]});if(e.kind==="cover")return f.jsx("div",{className:"asset-card__thumb asset-card__thumb--cover",style:{"--cover-gradient":e.gradient},children:f.jsx(Ce,{name:e.glyph,size:32,className:"asset-card__cover-glyph"})});if(e.kind==="image")return(p||!b&&!e.src)&&e.fallbackGlyph?f.jsx("div",{className:"asset-card__thumb asset-card__thumb--image-fallback",children:f.jsx(Ce,{name:e.fallbackGlyph,size:32,className:"asset-card__image-glyph"})}):f.jsx("div",{className:"asset-card__thumb asset-card__thumb--image",children:f.jsx("img",{src:e.src,alt:"",className:"asset-card__image",onLoad:()=>_(!0),onError:()=>v(!0),"aria-hidden":"true"})})})(),r&&f.jsx("div",{className:"asset-card__badge",children:r})]}),f.jsxs("div",{className:"asset-card__body",children:[f.jsx("div",{className:"asset-card__title",children:t}),a&&f.jsx("div",{className:"asset-card__subtitle",children:a}),s&&f.jsx("div",{className:"asset-card__meta",children:s})]})]}))});g4.displayName="AssetCard";const y4=ie.forwardRef((o,c)=>{var u=o,{columns:e=3,gap:t=14,className:a="",children:s}=u,r=de(u,["columns","gap","className","children"]);const h=["asset-grid",a].filter(Boolean).join(" ");return f.jsx("div",K(T({ref:c,className:h,style:{"--asset-columns":e,"--asset-gap":`${t}px`}},r),{children:s}))});y4.displayName="AssetGrid";const lg=(e,t=[])=>t.filter(a=>{const s=typeof a.startDate=="string"?new Date(a.startDate):new Date(a.startDate);return ll(e,s)}),v4=({focusedDate:e,selectedDate:t,grid:a,events:s,calendarColors:r,weekStartsOn:c,onSelectDate:o,onSelectEvent:u,renderEvent:h,onKeyDown:m})=>{const g=typeof e=="string"?new Date(e):e,p=t?typeof t=="string"?new Date(t):t:null;let v=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];return c===1&&(v=v.slice(1).concat(v.slice(0,1))),f.jsxs("div",{className:"calendar-month",role:"grid",onKeyDown:m,tabIndex:0,children:[f.jsx("div",{className:"calendar-month__header",role:"row",children:v.map(b=>f.jsx("div",{className:"calendar-month__weekday",role:"columnheader",children:b.slice(0,3).toUpperCase()},b))}),a.map((b,_)=>f.jsx("div",{className:"calendar-month__week",role:"row",children:b.map((S,w)=>{const C=S.getMonth()!==g.getMonth(),R=ll(S,g),j=p?ll(S,p):!1,k=N_(S),I=lg(S,s),O=3,z=I.length-O;return f.jsxs("div",{className:`calendar-month__cell ${C?"calendar-month__cell--out-of-month":""} ${R?"calendar-month__cell--focused":""} ${j?"calendar-month__cell--selected":""}`,role:"gridcell",onClick:()=>!C&&(o==null?void 0:o(S)),onKeyDown:B=>{(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),!C&&(o==null||o(S)))},children:[f.jsx("div",{className:"calendar-month__date-number","aria-current":k?"date":void 0,children:k?f.jsx(Nn,{variant:"amber",form:"default",children:S.getDate()}):f.jsx("span",{children:S.getDate()})}),f.jsxs("div",{className:"calendar-month__events",children:[I.slice(0,O).map(B=>{const P=(r==null?void 0:r[B.calendarId])||"rgb(var(--status-cyan))";return f.jsx("div",{className:"calendar-month__event-bar",style:{borderLeftColor:P},onClick:M=>{M.stopPropagation(),u==null||u(B.id)},role:"button",tabIndex:0,onKeyDown:M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),M.stopPropagation(),u==null||u(B.id))},children:h?h(B,P):f.jsx("span",{className:"calendar-month__event-title",children:B.title||"Event"})},B.id)}),z>0&&f.jsxs("div",{className:"calendar-month__event-overflow",children:["+",z," more"]})]})]},`${_}-${w}`)})},_))]})},b4=({focusedDate:e,weekStartsOn:t,events:a,calendarColors:s,onSelectDate:r,onSelectEvent:c,renderEvent:o})=>{const u=ol(e,t);return f.jsx("div",{className:"calendar-week",children:f.jsx("div",{className:"calendar-week__days",children:u.map(h=>{const m=lg(h,a);return f.jsxs("div",{className:"calendar-week__day",role:"button",tabIndex:0,onClick:()=>r==null?void 0:r(h),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),r==null||r(h))},children:[f.jsx("div",{className:"calendar-week__header",children:h.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})}),f.jsx("div",{className:"calendar-week__events",children:m.map(g=>{const p=(s==null?void 0:s[g.calendarId])||"rgb(var(--status-cyan))";return f.jsx("div",{className:"calendar-week__event",style:{borderLeftColor:p},role:"button",tabIndex:0,onClick:v=>{v.stopPropagation(),c==null||c(g.id)},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),v.stopPropagation(),c==null||c(g.id))},children:o?o(g,p):f.jsx("span",{children:g.title||"Event"})},g.id)})})]},h.toISOString())})})})},x4=({focusedDate:e,events:t,calendarColors:a,onSelectEvent:s,renderEvent:r})=>{const c=lg(e,t);return f.jsxs("div",{className:"calendar-day",children:[f.jsx("div",{className:"calendar-day__title",children:typeof e=="string"?new Date(e).toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric"}):e.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric"})}),f.jsx("div",{className:"calendar-day__events",children:c.length===0?f.jsx("div",{className:"calendar-day__empty",children:"No events scheduled"}):c.map(o=>{const u=(a==null?void 0:a[o.calendarId])||"rgb(var(--status-cyan))";return f.jsx("div",{className:"calendar-day__event",style:{borderLeftColor:u},role:"button",tabIndex:0,onClick:()=>s==null?void 0:s(o.id),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),s==null||s(o.id))},children:r?r(o,u):f.jsx("span",{children:o.title||"Event"})},o.id)})})]})},_4=({focusedDate:e,events:t=[],calendarColors:a,onSelectEvent:s,renderEvent:r})=>{const c=typeof e=="string"?new Date(e):e,o=t.filter(u=>(typeof u.startDate=="string"?new Date(u.startDate):new Date(u.startDate))>=c).sort((u,h)=>{const m=typeof u.startDate=="string"?new Date(u.startDate):new Date(u.startDate),g=typeof h.startDate=="string"?new Date(h.startDate):new Date(h.startDate);return m.getTime()-g.getTime()});return f.jsx("div",{className:"calendar-agenda",children:o.length===0?f.jsx("div",{className:"calendar-agenda__empty",children:"No upcoming events"}):f.jsx("div",{className:"calendar-agenda__list",children:o.map(u=>{const h=(a==null?void 0:a[u.calendarId])||"rgb(var(--status-cyan))";return f.jsxs("div",{className:"calendar-agenda__item",role:"button",tabIndex:0,onClick:()=>s==null?void 0:s(u.id),onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),s==null||s(u.id))},children:[f.jsx("div",{className:"calendar-agenda__date",style:{color:h},children:typeof u.startDate=="string"?new Date(u.startDate).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}):u.startDate.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})}),f.jsx("div",{className:"calendar-agenda__content",children:r?r(u,h):f.jsx("span",{children:u.title||"Event"})})]},u.id)})})})},S4=ie.forwardRef((_,b)=>{var S=_,{view:e,focusedDate:t,selectedDate:a,events:s,calendarColors:r,weekStartsOn:c=0,onChangeView:o,onNavigate:u,onSelectDate:h,onSelectEvent:m,renderEvent:g,className:p=""}=S,v=de(S,["view","focusedDate","selectedDate","events","calendarColors","weekStartsOn","onChangeView","onNavigate","onSelectDate","onSelectEvent","renderEvent","className"]);const w=typeof t=="string"?new Date(t):t,C=A.useMemo(()=>j_(w,c),[w.getTime(),c]),R=[{value:"month",label:"Month"},{value:"week",label:"Week"},{value:"day",label:"Day"},{value:"agenda",label:"Agenda"}],j=A.useCallback(z=>{if(e!=="month")return;const B=new Date(w);if(z.key==="ArrowLeft"||z.key==="ArrowRight"||z.key==="ArrowUp"||z.key==="ArrowDown"){z.preventDefault();const P=z.key==="ArrowLeft"?-1:z.key==="ArrowRight"?1:z.key==="ArrowUp"?-7:7;B.setDate(B.getDate()+P),u==null||u(B)}else if(z.key==="PageUp")z.preventDefault(),B.setMonth(B.getMonth()-1),u==null||u(B);else if(z.key==="PageDown")z.preventDefault(),B.setMonth(B.getMonth()+1),u==null||u(B);else if(z.key==="Home"){z.preventDefault();const P=ol(B,c);u==null||u(P[0])}else if(z.key==="End"){z.preventDefault();const P=ol(B,c);u==null||u(P[6])}},[w.getTime(),u,e,c]),k=A.useCallback(()=>{const z=new Date(w);e==="month"?z.setMonth(z.getMonth()-1):e==="week"?z.setDate(z.getDate()-7):(e==="day"||e==="agenda")&&z.setDate(z.getDate()-1),u==null||u(z)},[w.getTime(),u,e]),I=A.useCallback(()=>{const z=new Date(w);e==="month"?z.setMonth(z.getMonth()+1):e==="week"?z.setDate(z.getDate()+7):(e==="day"||e==="agenda")&&z.setDate(z.getDate()+1),u==null||u(z)},[w.getTime(),u,e]),O=A.useCallback(()=>{u==null||u(new Date)},[u]);return f.jsxs("div",K(T({ref:b,className:`calendar ${p}`.trim()},v),{children:[f.jsxs("div",{className:"calendar__header",children:[f.jsxs("div",{className:"calendar__title",children:[e==="month"&&RR(w),e==="week"&&TR(w,c),e==="day"&&$m(w),e==="agenda"&&"Agenda"]}),f.jsxs("div",{className:"calendar__controls",children:[f.jsx(rn,{variant:"secondary",size:"sm",onClick:k,"aria-label":"Previous",children:f.jsx(Ce,{name:"chevronLeft",size:16})}),f.jsx(rn,{variant:"secondary",size:"sm",onClick:O,children:"Today"}),f.jsx(rn,{variant:"secondary",size:"sm",onClick:I,"aria-label":"Next",children:f.jsx(Ce,{name:"chevronRight",size:16})})]})]}),f.jsx("div",{className:"calendar__view-selector",children:f.jsx(rd,{value:e,onChange:z=>o==null?void 0:o(z),options:R})}),f.jsxs("div",{className:"calendar__content",children:[e==="month"&&f.jsx(v4,{focusedDate:w,selectedDate:a,grid:C,events:s,calendarColors:r,weekStartsOn:c,onSelectDate:h,onSelectEvent:m,renderEvent:g,onKeyDown:j}),e==="week"&&f.jsx(b4,{focusedDate:w,weekStartsOn:c,events:s,calendarColors:r,onSelectDate:h,onSelectEvent:m,renderEvent:g}),e==="day"&&f.jsx(x4,{focusedDate:w,events:s,calendarColors:r,onSelectEvent:m,renderEvent:g}),e==="agenda"&&f.jsx(_4,{focusedDate:w,events:s,calendarColors:r,onSelectEvent:m,renderEvent:g})]})]}))});S4.displayName="Calendar";const w4=({card:e,isSelected:t,renderCard:a,onSelect:s,onCardPointerDown:r,onCardKeyDown:c})=>a?f.jsx("div",{className:`kanban-card ${t?"kanban-card--selected":""}`,onPointerDown:o=>r(o,e.id),onKeyDown:o=>c(o,e.id),onClick:()=>s(e.id),tabIndex:0,role:"button","aria-pressed":t,children:a(e,t)}):f.jsxs("div",{className:`kanban-card ${t?"kanban-card--selected":""} ${e.done?"kanban-card--done":""}`,onPointerDown:o=>r(o,e.id),onKeyDown:o=>c(o,e.id),onClick:()=>s(e.id),tabIndex:0,role:"button","aria-pressed":t,children:[e.context&&f.jsx("div",{className:"kanban-card__context",children:e.context}),f.jsx("div",{className:"kanban-card__title",children:e.title}),e.version&&f.jsx("div",{className:"kanban-card__version",children:f.jsx(In,{children:e.version})}),(e.dueDate||e.badges)&&f.jsxs("div",{className:"kanban-card__meta",children:[e.dueDate&&f.jsx("div",{className:"kanban-card__due-date",children:e.dueDate}),e.badges&&e.badges.length>0&&f.jsx("div",{className:"kanban-card__badges",children:e.badges.map(o=>f.jsx("span",{className:"kanban-card__badge",children:o},o))})]}),e.blocked&&f.jsxs("div",{className:"kanban-card__blocked",children:[f.jsx(Ce,{name:"alert",size:16}),e.blocked]})]}),C4=({column:e,cards:t,selectedId:a,onSelectCard:s,renderCard:r,draggedCardId:c,insertionIndex:o,onCardPointerDown:u,onCardKeyDown:h})=>{const m=A.useRef(null),g=e.wipLimit&&t.length>e.wipLimit;return f.jsxs(v_,{className:"kanban-column",noPadding:!0,children:[f.jsxs("div",{className:"kanban-column__header",children:[f.jsxs("div",{className:"kanban-column__header-left",children:[e.statusColor&&f.jsx("div",{className:"kanban-column__status-dot",style:{backgroundColor:zo[e.statusColor]}}),f.jsx("div",{className:"kanban-column__title",children:e.title})]}),f.jsxs("div",{className:"kanban-column__header-right",children:[f.jsx(Nn,{variant:"neutral",children:t.length}),g&&f.jsx("div",{className:"kanban-column__wip-warning",title:`Over WIP limit of ${e.wipLimit}`,children:f.jsx(Ce,{name:"alert",size:14})})]})]}),f.jsxs("div",{ref:m,className:"kanban-column__body",children:[t.length===0?f.jsx("div",{className:"kanban-column__empty",children:"Drop cards here"}):t.map((p,v)=>f.jsxs(ie.Fragment,{children:[c&&o===v&&f.jsx("div",{className:"kanban-column__insertion-line"}),f.jsx(w4,{card:p,isSelected:a===p.id,renderCard:r,onSelect:b=>s==null?void 0:s(b),onCardPointerDown:u,onCardKeyDown:h})]},p.id)),c&&o===t.length&&f.jsx("div",{className:"kanban-column__insertion-line"})]})]})},N4=ie.forwardRef((m,h)=>{var g=m,{columns:e,cards:t,selectedId:a,onSelectCard:s,onMoveCard:r,renderCard:c,className:o=""}=g,u=de(g,["columns","cards","selectedId","onSelectCard","onMoveCard","renderCard","className"]);const p=A.useRef(null),[v,b]=A.useState(null),[_,S]=A.useState(null),[w,C]=A.useState(null),R=A.useRef(null),j=A.useRef(null),k=A.useMemo(()=>{const M={};return e.forEach(U=>{M[U.id]=t.filter(F=>F.columnId===U.id)}),M},[e,t]),I=A.useCallback((M,U,F)=>{R.current&&(R.current.textContent=`Card "${M}" moved to ${U} at position ${F+1}`)},[]),O=A.useCallback((M,U)=>{const F=t.find(H=>H.id===U);if(!F)return;const q=M.currentTarget;q.setPointerCapture(M.pointerId),p.current={cardId:U,sourceColumnId:F.columnId,sourceIndex:k[F.columnId].findIndex(H=>H.id===U),offsetY:M.clientY,pointerId:M.pointerId,capturingElement:q},b(U),C(F.columnId)},[t,k]),z=A.useCallback(M=>{var U;if(!p.current||!((U=j.current)!=null&&U.getBoundingClientRect()))return;let F=null;for(const Z of e){const fe=document.querySelector(`[data-column-id="${CSS.escape(Z.id)}"]`);if(fe){const D=fe.getBoundingClientRect();if(M.clientX>=D.left&&M.clientX<D.right){F=Z,C(Z.id);break}}}if(!F)return;const q=document.querySelector(`[data-column-id="${CSS.escape(F.id)}"] .kanban-column__body`);if(!q)return;const H=q.getBoundingClientRect(),Y=M.clientY-H.top,$=q.querySelectorAll(".kanban-card");let X=0;for(let Z=0;Z<$.length;Z++){const fe=$[Z].getBoundingClientRect(),D=fe.top-H.top;if(Y<D+fe.height/2){X=Z;break}else X=Z+1}S(X)},[e]),B=A.useCallback(M=>{if(!p.current)return;const U=p.current;if(p.current=null,w&&_!==null){const F=e.find(H=>H.id===U.sourceColumnId),q=e.find(H=>H.id===w);if(q&&F){const H=t.find(Y=>Y.id===U.cardId);H&&(r(U.cardId,w,_),I(H.title,q.title,_))}}if(b(null),S(null),C(null),U.capturingElement&&U.pointerId!==void 0)try{U.capturingElement.releasePointerCapture(U.pointerId)}catch(F){}},[e,t,w,_,r,I]),P=A.useCallback((M,U)=>{var F,q;const H=t.find(Y=>Y.id===U);if(H){if(M.key===" "){M.preventDefault();const Y=p.current;if(Y!=null&&Y.isKeyboardGrab){r(Y.cardId,Y.sourceColumnId,Y.sourceIndex);const $=e.find(X=>X.id===Y.sourceColumnId);I(H.title,($==null?void 0:$.title)||"",Y.sourceIndex),p.current=null,b(null),S(null),C(null)}else{const $=k[H.columnId].findIndex(X=>X.id===U);p.current={cardId:U,sourceColumnId:H.columnId,sourceIndex:$,offsetY:0,isKeyboardGrab:!0,originalColumnId:H.columnId,originalIndex:$},b(U),C(H.columnId)}}else if(M.key==="ArrowUp"||M.key==="ArrowDown"||M.key==="ArrowLeft"||M.key==="ArrowRight"){M.preventDefault();const Y=p.current;if(!Y||!Y.isKeyboardGrab)return;const $=e.findIndex(he=>he.id===Y.sourceColumnId),X=k[Y.sourceColumnId];if(!X){p.current=null,b(null),S(null),C(null);return}const Z=Y.sourceIndex;let fe=Y.sourceColumnId,D=Z;M.key==="ArrowUp"&&Z>0?D=Z-1:M.key==="ArrowDown"&&Z<X.length-1?D=Z+1:M.key==="ArrowLeft"&&$>0?(fe=e[$-1].id,D=0):M.key==="ArrowRight"&&$<e.length-1&&(fe=e[$+1].id,D=0),p.current=K(T({},Y),{sourceColumnId:fe,sourceIndex:D}),C(fe),S(D),I(H.title,((F=e.find(he=>he.id===fe))==null?void 0:F.title)||"",D)}else if(M.key==="Escape"){const Y=p.current;Y!=null&&Y.isKeyboardGrab&&Y.originalColumnId!==void 0&&Y.originalIndex!==void 0&&(r(Y.cardId,Y.originalColumnId,Y.originalIndex),I(H.title,((q=e.find($=>$.id===Y.originalColumnId))==null?void 0:q.title)||"",Y.originalIndex)),p.current=null,b(null),S(null),C(null)}}},[t,k,e,r,I]);return f.jsxs("div",K(T({ref:h,className:`kanban-board ${o}`,onPointerMove:z,onPointerUp:B},u),{children:[f.jsx("div",{ref:j,className:"kanban-board__columns",children:e.map(M=>f.jsx("div",{"data-column-id":M.id,className:"kanban-board__column-wrapper",children:f.jsx(C4,{column:M,cards:k[M.id]||[],selectedId:a,onSelectCard:U=>s==null?void 0:s(U),renderCard:c,draggedCardId:v||void 0,insertionIndex:w===M.id?_!=null?_:0:void 0,onCardPointerDown:O,onCardKeyDown:P})},M.id))}),f.jsx("div",{ref:R,className:"kanban-board__live-region",role:"status","aria-live":"polite","aria-atomic":"true"})]}))});N4.displayName="KanbanBoard";const j4=ie.forwardRef((h,u)=>{var m=h,{entries:e=[],follow:t=!0,maxRows:a=500,showOps:s=!1,className:r="","aria-label":c}=m,o=de(m,["entries","follow","maxRows","showOps","className","aria-label"]);const g=A.useRef(null),p=A.useRef(null),[v,b]=A.useState(t);A.useEffect(()=>{u&&(typeof u=="function"?u(g.current):u.current=g.current)},[u]),A.useEffect(()=>{if(!t||!p.current)return;const C=new IntersectionObserver(R=>{R.forEach(j=>{j.isIntersecting&&b(!0)})},{threshold:.1});return C.observe(p.current),()=>{C.disconnect()}},[t]),A.useEffect(()=>{v&&t&&g.current&&(g.current.scrollTop=g.current.scrollHeight)},[e,t,v]),A.useEffect(()=>{if(!t||!g.current)return;const C=()=>{const{scrollTop:j,scrollHeight:k,clientHeight:I}=g.current;k-j-I<50||b(!1)},R=g.current;return R.addEventListener("scroll",C),()=>{R.removeEventListener("scroll",C)}},[t]);const _=e.slice(-a),S=C=>C.id?C.id:`log-${typeof C.timestamp=="string"?C.timestamp:C.timestamp.getTime()}-${C.level}-${C.message}-${C.op||""}-${C.target||""}`,w=["log-stream",r].filter(Boolean).join(" ");return f.jsxs("div",K(T({ref:g,className:w,role:"log","aria-live":v&&t?"polite":void 0,"aria-label":c!=null?c:"Log stream"},o),{children:[f.jsx("div",{className:"log-stream__content",children:_.length===0?f.jsx("div",{className:"log-stream__empty",children:f.jsx("span",{className:"log-stream__empty-text",children:"No log entries"})}):_.map(C=>{const R=typeof C.timestamp=="string"?new Date(C.timestamp):C.timestamp,j=kR(R),k=`log-stream__level log-stream__level--${C.level.toLowerCase()}`;return f.jsxs("div",{className:s?"log-stream__row log-stream__row--with-ops":"log-stream__row",children:[f.jsx("span",{className:"log-stream__time",children:j}),f.jsx("span",{className:k,children:C.level}),s&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"log-stream__op",children:C.op||""}),f.jsx("span",{className:"log-stream__target",children:C.target||""})]}),f.jsx("span",{className:"log-stream__message",children:C.message})]},S(C))})}),t&&f.jsx("div",{ref:p,className:"log-stream__sentinel"})]}))});j4.displayName="LogStream";function ap(e){const t=e.trim();if(/^#[0-9a-fA-F]{6}$/i.test(t))return t;if(/^#[0-9a-fA-F]{3}$/i.test(t)){const o=t.slice(1);return"#"+o[0]+o[0]+o[1]+o[1]+o[2]+o[2]}const a=t.match(/rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);if(a){const o=Math.max(0,Math.min(255,parseInt(a[1],10))),u=Math.max(0,Math.min(255,parseInt(a[2],10))),h=Math.max(0,Math.min(255,parseInt(a[3],10)));return"#"+[o,u,h].map(m=>m.toString(16).padStart(2,"0")).join("")}const s=t.match(/hsla?\s*\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)%\s*,\s*(\d+(?:\.\d+)?)%/);if(s){const o=parseFloat(s[1])/360,u=parseFloat(s[2])/100,h=parseFloat(s[3])/100,m=(1-Math.abs(2*h-1))*u,g=m*(1-Math.abs(o*6%2-1)),p=h-m/2;let v=0,b=0,_=0;o<1/6?(v=m,b=g):o<2/6?(v=g,b=m):o<3/6?(b=m,_=g):o<4/6?(b=g,_=m):o<5/6?(v=g,_=m):(v=m,_=g);const S=w=>Math.round((w+p)*255).toString(16).padStart(2,"0");return"#"+S(v)+S(b)+S(_)}const r={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff",yellow:"#ffff00",cyan:"#00ffff",magenta:"#ff00ff",gray:"#808080",grey:"#808080",silver:"#c0c0c0",maroon:"#800000",olive:"#808000",lime:"#00ff00",aqua:"#00ffff",teal:"#008080",navy:"#000080",purple:"#800080",fuchsia:"#ff00ff"},c=t.toLowerCase();return c in r?r[c]:"#10b981"}function k4(e,t,a,s){const r=(e-t)/(a-t||1),c=Math.round((.12+r*.88)*255).toString(16).padStart(2,"0");return`${ap(s)}${c}`}function Di(e,t,a){const s=Math.pow(2,a),r=(t+180)/360*s*256,c=Math.max(-85.05112878,Math.min(85.05112878,e)),o=(1-Math.log(Math.tan(c*Math.PI/180)+1/Math.cos(c*Math.PI/180))/Math.PI)/2*s*256;return{x:r,y:o}}function E4(e,t,a){const s=Math.pow(2,a),r=e/(s*256)*360-180;return{lat:Math.atan(Math.sinh(Math.PI*(1-2*(t/(s*256)))))*180/Math.PI,lng:r}}function R4({patternId:e,zoomLevel:t}){const a=32*Math.pow(2,t);return f.jsxs("pattern",{id:e,x:0,y:0,width:a,height:a,patternUnits:"userSpaceOnUse",children:[f.jsx("rect",{width:a,height:a,fill:"none",stroke:"rgb(var(--canvas-fg-3))",strokeWidth:"0.5",opacity:"0.3"}),f.jsx("circle",{cx:0,cy:0,r:1,fill:"rgb(var(--canvas-fg-3))",opacity:"0.4"})]})}function T4({pin:e,x:t,y:a,onClose:s}){const r=A.useRef(null);return ld(r,!0,{mode:"popup"}),A.useEffect(()=>{const c=o=>{o.key==="Escape"&&s()};return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c)}},[s]),f.jsxs("div",{ref:r,className:"map-popover",style:{left:`${t}px`,top:`${a}px`},role:"dialog",children:[e.label&&f.jsx("div",{className:"map-popover__label",children:e.label}),e.timestamp&&f.jsx("div",{className:"map-popover__timestamp",children:e.timestamp}),e.detail&&f.jsx("div",{className:"map-popover__detail",children:e.detail})]})}const M4=ie.forwardRef((C,w)=>{var R=C,{mode:e,pins:t=[],selectedPinId:a,onSelectPin:s,trackPoints:r=[],heatmapData:c=[],heatmapColor:o="#10b981",tileUrl:u,bounds:h,scaleBar:m=!1,minZoom:g=0,maxZoom:p=18,onViewportChange:v,onModeChange:b,className:_=""}=R,S=de(R,["mode","pins","selectedPinId","onSelectPin","trackPoints","heatmapData","heatmapColor","tileUrl","bounds","scaleBar","minZoom","maxZoom","onViewportChange","onModeChange","className"]);const j=A.useRef(null),[k,I]=A.useState(null),[O,z]=A.useState(null),B=A.useRef(!1),P=A.useCallback(D=>{const he=E4(D.x/D.zoom,D.y/D.zoom,Math.round(D.zoom*4));v==null||v({center:{lat:he.lat,lng:he.lng},zoom:D.zoom})},[v]),{transform:M,viewport:U,bind:F,panTo:q}=XS({minZoom:g,maxZoom:p,onViewportChange:P}),H=`map-grid-${A.useId().replace(/:/g,"")}`;A.useEffect(()=>{const D=j.current;if(!D)return;const he=new ResizeObserver(ge=>{const{width:E,height:W}=ge[0].contentRect;E>0&&W>0&&I({width:E,height:W})});return he.observe(D),()=>he.disconnect()},[]),A.useEffect(()=>{if(B.current||!k||!h&&t.length===0&&r.length===0&&c.length===0)return;const D=[...t.map(ke=>({lat:ke.lat,lng:ke.lng})),...r.map(ke=>({lat:ke.lat,lng:ke.lng})),...c.map(ke=>({lat:ke.lat,lng:ke.lng}))];let he=null;if(h)he={north:Math.max(h[0].lat,h[1].lat),south:Math.min(h[0].lat,h[1].lat),east:Math.max(h[0].lng,h[1].lng),west:Math.min(h[0].lng,h[1].lng)};else if(D.length>0){const ke=D.map(Fe=>Fe.lat),ct=D.map(Fe=>Fe.lng);he={north:Math.max(...ke),south:Math.min(...ke),east:Math.max(...ct),west:Math.min(...ct)}}if(!he)return;const ge=60,E=Di(he.north,he.west,10).y,W=Di(he.south,he.east,10).y,oe=Di(he.north,he.west,10).x,me=Di(he.north,he.east,10).x,_e=Math.abs(W-E),be=Math.abs(me-oe);if(_e===0||be===0||k.height<=ge*2||k.width<=ge*2){q(k.width/2,k.height/2),B.current=!0;return}const Ae=Math.log2((k.height-ge*2)/_e),Ge=Math.log2((k.width-ge*2)/be);if(!Number.isFinite(Ae)||!Number.isFinite(Ge)){q(k.width/2,k.height/2),B.current=!0;return}const ot=Math.max(g,Math.min(p,Math.floor(Math.min(Ae,Ge)))),qt=(he.north+he.south)/2,at=(he.east+he.west)/2,Ie=Di(qt,at,ot),qe=k.width/2-Ie.x*ot,bt=k.height/2-Ie.y*ot;q(qe,bt),B.current=!0},[k,h,t.length,r.length,c.length,g,p,q]);const Y=A.useCallback(D=>{D.target instanceof Element&&(D.target.closest(".map-pin")||D.target.closest(".map-popover")||D.target.closest("[data-no-drag]"))||F.onPointerDown(D)},[F]),$=A.useCallback(()=>e!=="pins"||!t.length?null:f.jsx("div",{className:"map-pins","data-testid":"map-pins",style:{position:"absolute",inset:0,pointerEvents:"none"},children:t.map(D=>{const he=Di(D.lat,D.lng,Math.round(U.zoom*4)),ge=U.x+he.x*U.zoom,E=U.y+he.y*U.zoom;return f.jsxs("button",{type:"button",className:["map-pin",a===D.id&&"map-pin--selected"].filter(Boolean).join(" "),onClick:W=>{W.stopPropagation(),s==null||s(D.id);const oe=W.target.getBoundingClientRect();z({x:oe.right+8,y:oe.top})},"aria-label":`${D.label||"Pin"} at latitude ${D.lat.toFixed(4)}, longitude ${D.lng.toFixed(4)}${D.timestamp?` on ${D.timestamp}`:""}`,"data-testid":`map-pin-${D.id}`,"data-no-drag":!0,style:{position:"absolute",left:`${ge}px`,top:`${E}px`,pointerEvents:"auto"},children:[f.jsx("span",{className:"map-pin__dot"}),D.label&&f.jsx("span",{className:"map-pin__label",children:D.label})]},D.id)})}),[e,t,U.zoom,U.x,U.y,a,s]),X=A.useCallback(()=>{if(e!=="track"||!r.length)return null;const D=r.map(he=>Di(he.lat,he.lng,Math.round(U.zoom*4))).map((he,ge)=>`${ge===0?"M":"L"} ${he.x} ${he.y}`).join(" ");return f.jsx("g",{className:"map-track","data-testid":"map-track",children:f.jsx("path",{d:D,className:"map-track__line"})})},[e,r,U.zoom]),Z=A.useCallback(()=>{if(e!=="heatmap"||!c.length)return null;const D=c.map(E=>E.value).filter(E=>E!=null),he=Math.min(...D),ge=Math.max(...D);return f.jsx("g",{className:"map-heatmap","data-testid":"map-heatmap",children:c.map((E,W)=>{const oe=Di(E.lat,E.lng,Math.round(U.zoom*4)),me=(E.value-he)/(ge-he||1),_e=k4(E.value,he,ge,o);return f.jsx("circle",{cx:oe.x,cy:oe.y,r:8+me*4,fill:_e,opacity:.6,"data-testid":`heatmap-point-${W}`},W)})})},[e,c,o,U.zoom]),fe=A.useCallback(()=>{if(!u||!k)return null;const D=Math.min(Math.max(Math.floor(U.zoom*4),0),28),he=Math.pow(2,D),ge=Math.max(0,Math.floor(-U.x/(256*U.zoom))),E=Math.max(0,Math.floor(-U.y/(256*U.zoom))),W=Math.min(he,Math.ceil((k.width-U.x)/(256*U.zoom))),oe=Math.min(he,Math.ceil((k.height-U.y)/(256*U.zoom))),me=typeof u=="function"?u:(be,Ae,Ge)=>u.replace("{x}",String(be)).replace("{y}",String(Ae)).replace("{z}",String(Ge)),_e=[];for(let be=ge;be<W;be++)for(let Ae=E;Ae<oe;Ae++){const Ge=me(be,Ae,D);_e.push(f.jsx("image",{href:Ge,x:be*256,y:Ae*256,width:256,height:256,"data-testid":`tile-${be}-${Ae}`},`${D}-${be}-${Ae}`))}return _e},[u,k,U]);return f.jsxs("div",K(T(K(T({ref:D=>{typeof w=="function"?w(D):w&&(w.current=D),j.current=D},className:["map-canvas",_].filter(Boolean).join(" ")},F),{onPointerDown:Y,role:"application","aria-label":"Map canvas"}),S),{children:[f.jsxs("svg",{className:"map-svg",width:"100%",height:"100%",style:{position:"absolute",inset:0,overflow:"visible"},children:[f.jsx("defs",{children:f.jsx(R4,{patternId:H,zoomLevel:U.zoom})}),u?f.jsx("g",{className:"map-tiles",transform:M,children:fe()}):f.jsx("rect",{width:"100%",height:"100%",fill:`url(#${H})`,className:"map-grid"}),f.jsxs("g",{className:"map-viewport",transform:M,children:[X(),Z()]})]}),$(),f.jsxs("div",{className:"map-overlay",children:[e==="track"&&f.jsx("div",{className:"map-legend",children:f.jsxs("div",{className:"map-legend__item",children:[f.jsx("div",{className:"map-legend__line",style:{backgroundColor:"rgb(var(--status-cyan))"}}),"Track"]})}),e==="heatmap"&&f.jsx("div",{className:"map-legend",children:f.jsxs("div",{className:"map-legend__item",children:[f.jsx("div",{className:"map-legend__gradient",style:{backgroundImage:`linear-gradient(to right, ${ap(o)}20, ${ap(o)}cc)`}}),"Density"]})}),b&&f.jsxs("div",{className:"map-mode-switch",children:[f.jsx("button",{type:"button",className:["map-mode-switch__button",e==="pins"&&"map-mode-switch__button--active"].filter(Boolean).join(" "),onClick:()=>b("pins"),"aria-label":"Switch to pins mode",title:"Pins",children:"Pins"}),f.jsx("button",{type:"button",className:["map-mode-switch__button",e==="track"&&"map-mode-switch__button--active"].filter(Boolean).join(" "),onClick:()=>b("track"),"aria-label":"Switch to track mode",title:"Track",children:"Track"}),f.jsx("button",{type:"button",className:["map-mode-switch__button",e==="heatmap"&&"map-mode-switch__button--active"].filter(Boolean).join(" "),onClick:()=>b("heatmap"),"aria-label":"Switch to heatmap mode",title:"Heatmap",children:"Heatmap"})]}),m&&f.jsx("div",{className:"map-scale-bar",children:f.jsxs("div",{className:"map-scale-bar__label",children:["Zoom: ",U.zoom.toFixed(1)]})})]}),a&&O&&(()=>{const D=t.find(he=>he.id===a);return D?f.jsx(T4,{pin:D,x:O.x,y:O.y,onClose:()=>{s==null||s(null),z(null)}}):null})()]}))});M4.displayName="MapCanvas";const A4=e=>(typeof e=="string"?new Date(e):new Date(e)).toLocaleDateString("en-US",{month:"short",year:"numeric"}),L4=ie.forwardRef((h,u)=>{var m=h,{focusedDate:e,selectedDate:t,markers:a=[],weekStartsOn:s=0,onSelect:r,className:c=""}=m,o=de(m,["focusedDate","selectedDate","markers","weekStartsOn","onSelect","className"]);const g=typeof e=="string"?new Date(e):new Date(e),p=t?typeof t=="string"?new Date(t):t:null,v=A.useMemo(()=>j_(g,s),[g.getTime(),s]),b=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];s===1&&b.push(b.shift());const _=S=>a.some(w=>ll(S,w));return f.jsxs("div",K(T({ref:u,className:`mini-calendar ${c}`.trim()},o),{children:[f.jsx("div",{className:"mini-calendar__header",children:f.jsx("div",{className:"mini-calendar__title",children:A4(g)})}),f.jsxs("div",{className:"mini-calendar__grid",children:[f.jsx("div",{className:"mini-calendar__weekdays",children:b.map(S=>f.jsx("div",{className:"mini-calendar__weekday",children:S.toUpperCase()},S))}),f.jsx("div",{className:"mini-calendar__dates",children:v.map(S=>S.map(w=>{const C=w.getMonth()!==g.getMonth(),R=p?ll(w,p):!1,j=N_(w),k=_(w);return f.jsxs("button",{className:`mini-calendar__date ${C?"mini-calendar__date--out-of-month":""} ${R?"mini-calendar__date--selected":""} ${j?"mini-calendar__date--today":""} ${k?"mini-calendar__date--has-marker":""}`,onClick:()=>!C&&(r==null?void 0:r(w)),type:"button","aria-current":j?"date":void 0,"aria-selected":R,children:[f.jsx("span",{className:"mini-calendar__date-number",children:w.getDate()}),k&&f.jsx("span",{className:"mini-calendar__marker"})]},w.toISOString())}))})]})]}))});L4.displayName="MiniCalendar";const D4={life:"var(--dom-life)",climate:"var(--dom-climate)",software:"var(--dom-software)",data:"var(--dom-default)",infrastructure:"var(--dom-default)"},O4=e=>D4[e]||"var(--accent-primary)",z4=e=>{const t=["emerald","cyan","amber","rose","violet"],a=e.split("").reduce((s,r)=>s+r.charCodeAt(0),0);return t[a%t.length]},I4=ie.forwardRef((v,p)=>{var b=v,{domain:e,source:t,version:a,snippet:s,provenance:r,score:c,onOpen:o,actions:u,selected:h=!1,className:m=""}=b,g=de(b,["domain","source","version","snippet","provenance","score","onOpen","actions","selected","className"]);const _=O4(e),S=z4(e),w=ie.useCallback(j=>{(j.key==="Enter"||j.key===" ")&&o&&(j.preventDefault(),o())},[o]),C=["result-card",h&&"result-card--selected",m].filter(Boolean).join(" "),R=a?`${t} v${a}`:t;return f.jsxs("div",K(T({ref:p,className:C,role:"article","aria-label":R,tabIndex:o?0:void 0,onClick:o,onKeyDown:o?w:void 0,style:{"--domain-color":_}},g),{children:[f.jsxs("div",{className:"result-card__header",children:[f.jsxs("div",{className:"result-card__header-left",children:[f.jsx("div",{className:`result-card__domain-dot result-card__domain-dot--${S}`}),f.jsx("span",{className:"result-card__source",children:t}),a&&f.jsx(In,{children:a})]}),c!==void 0&&f.jsx("span",{className:"result-card__score-label",children:c.toFixed(2)})]}),c!==void 0&&f.jsx("div",{className:"result-card__score-bar",children:f.jsx(zp,{percent:c*100,color:"amber",height:4})}),f.jsx("div",{className:"result-card__snippet",children:s}),r&&Object.values(r).some(j=>j!==void 0)&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"result-card__divider"}),f.jsxs("div",{className:"result-card__provenance",children:[r.collection&&f.jsxs("span",{className:"result-card__provenance-field",children:[f.jsx("span",{className:"result-card__provenance-label",children:"Collection"}),f.jsx("span",{className:"result-card__provenance-value",children:r.collection})]}),r.document&&f.jsxs("span",{className:"result-card__provenance-field",children:[f.jsx("span",{className:"result-card__provenance-label",children:"Document"}),f.jsx("span",{className:"result-card__provenance-value",children:r.document})]}),r.section&&f.jsxs("span",{className:"result-card__provenance-field",children:[f.jsx("span",{className:"result-card__provenance-label",children:"Section"}),f.jsx("span",{className:"result-card__provenance-value",children:r.section})]})]})]}),u&&u.length>0&&f.jsx("div",{className:"result-card__actions",children:u.map((j,k)=>f.jsx(rn,{variant:"ghost",size:"sm",icon:!!j.icon,title:j.label,onClick:I=>{I.stopPropagation(),j.onClick()},children:j.icon?f.jsx(Ce,{name:j.icon,size:16}):j.label},k))})]}))});I4.displayName="ResultCard";const U4=/^[0-9a-fA-F]+$/;function tw(e){let t;typeof atob=="function"?t=atob(e):t=globalThis.Buffer.from(e,"base64").toString("binary");let a="";for(let s=0;s<t.length;s++)a+=t.charCodeAt(s).toString(16).padStart(2,"0");return a}function bm(e,t){if(!e)return"";if(U4.test(e)&&e.length===t)return e.toLowerCase();try{return tw(e).toLowerCase()}catch(a){return e.toLowerCase()}}function B4(e){return!e||/^0+$/.test(e)?null:e}const xm=["UNSPECIFIED","INTERNAL","SERVER","CLIENT","PRODUCER","CONSUMER"];function F4(e){var t,a;if(typeof e=="number")return(t=xm[e])!=null?t:"UNSPECIFIED";if(typeof e=="string"){if(/^\d+$/.test(e))return(a=xm[Number(e)])!=null?a:"UNSPECIFIED";const s=e.replace(/^SPAN_KIND_/,"").toUpperCase();return xm.includes(s)?s:"UNSPECIFIED"}return"UNSPECIFIED"}function H4(e){const t=typeof e=="string"&&/^\d+$/.test(e)?Number(e):e;return t===2||t==="STATUS_CODE_ERROR"?"error":"ok"}function wu(e){if(e==null||e==="")return null;try{return typeof e=="number"?Number.isFinite(e)?BigInt(Math.trunc(e)):null:BigInt(/[.eE]/.test(e)?e.split(/[.eE]/)[0]:e)}catch(t){return null}}function og(e){var t;if(!e)return"";if(e.stringValue!==void 0)return e.stringValue;if(e.boolValue!==void 0)return e.boolValue;if(e.intValue!==void 0){const a=Number(e.intValue);return Number.isSafeInteger(a)?a:String(e.intValue)}if(e.doubleValue!==void 0)return e.doubleValue;if(e.bytesValue!==void 0)try{return tw(e.bytesValue)}catch(a){return e.bytesValue}return e.arrayValue?JSON.stringify(((t=e.arrayValue.values)!=null?t:[]).map(og)):e.kvlistValue?JSON.stringify(ip(e.kvlistValue.values)):""}function ip(e){const t={};return(e!=null?e:[]).forEach(a=>{a&&a.key&&(t[a.key]=og(a.value))}),t}function _m(e,t){const a=(e!=null?e:[]).find(s=>s.key===t);return a?og(a.value):void 0}const P4=["http.response.status_code","http.status_code","rpc.grpc.status_code"];function $4(e,t={}){var p,v,b;const a=(p=t.serviceNameKey)!=null?p:"service.name",s=Array.isArray(e)?e:(v=e==null?void 0:e.resourceSpans)!=null?v:[],r={},c=[];if(s.forEach(_=>{var R,j,k,I;var S;const w=(S=_.resource)==null?void 0:S.attributes,C=String((R=_m(w,a))!=null?R:"unknown_service");if(!r[C]){const O=(j=_m(w,"host.name"))!=null?j:_m(w,"service.instance.id");r[C]={label:C,host:O!=null?String(O):void 0}}((I=(k=_.scopeSpans)!=null?k:_.instrumentationLibrarySpans)!=null?I:[]).forEach(O=>{var z;((z=O.spans)!=null?z:[]).forEach(B=>c.push({span:B,service:C}))})}),c.length===0)return{spans:[],services:r,meta:{traceId:""}};let o=null;c.forEach(({span:_})=>{const S=wu(_.startTimeUnixNano);S!==null&&(o===null||S<o)&&(o=S)});const u=o!=null?o:BigInt(0),h=c.map(({span:_,service:S})=>{var M,U,F,q;var w;const C=(M=wu(_.startTimeUnixNano))!=null?M:u,R=(U=wu(_.endTimeUnixNano))!=null?U:C,j=Number(C-u)/1e6,k=Number(R-C)/1e6,I=ip(_.attributes);let O;const z=((F=_.events)!=null?F:[]).map(H=>{var Z;const Y=ip(H.attributes),$=wu(H.timeUnixNano),X=$!==null?Number($-u)/1e6:j;return H.name==="exception"&&!O&&(O={type:Y["exception.type"]!=null?String(Y["exception.type"]):void 0,message:Y["exception.message"]!=null?String(Y["exception.message"]):void 0,stacktrace:Y["exception.stacktrace"]!=null?String(Y["exception.stacktrace"]):void 0}),{time:X,name:(Z=H.name)!=null?Z:"event",attributes:Y}});let B;for(const H of P4){const Y=I[H];if(Y!==void 0){B=typeof Y=="boolean"?String(Y):Y;break}}const P={id:bm(_.spanId,16),parentId:B4(bm(_.parentSpanId,16)),name:(q=_.name)!=null?q:"(unnamed)",service:S,kind:F4(_.kind),start:j,duration:k,status:H4((w=_.status)==null?void 0:w.code),statusCode:B,attributes:I,exception:O,events:z.length?z:void 0};return t.deriveStatus?K(T({},P),{status:t.deriveStatus(P)}):P}),m=(b=h.find(_=>_.parentId===null))!=null?b:h[0],g={traceId:bm(c[0].span.traceId,32),name:m==null?void 0:m.name,rootService:m==null?void 0:m.service};return{spans:h,services:r,meta:g}}function q4(e){if(!e)return"";const t=e.split("-");return t.length===3?(t[1]+t[2]).toLowerCase():e.replace(/-/g,"").toLowerCase()}function V4(e,t){return t?"SERVER":e.namespace==="aws"||e.namespace==="remote"?"CLIENT":"INTERNAL"}function Y4(e){return e.fault||e.error||e.throttle?"error":"ok"}function sp(e,t,a){if(a!=null){if(typeof a!="object"||Array.isArray(a)){e[t]=Array.isArray(a)?JSON.stringify(a):a;return}Object.entries(a).forEach(([s,r])=>{if(r==null)return;const c=t?`${t}.${s}`:s;typeof r=="object"&&!Array.isArray(r)?sp(e,c,r):e[c]=Array.isArray(r)?JSON.stringify(r):r})}}function G4(e){var t,a;const s={},r=(t=e.http)==null?void 0:t.request,c=(a=e.http)==null?void 0:a.response;if((r==null?void 0:r.method)!=null&&(s["http.request.method"]=r.method),(r==null?void 0:r.url)!=null&&(s["url.full"]=r.url),(r==null?void 0:r.user_agent)!=null&&(s["user_agent.original"]=r.user_agent),(r==null?void 0:r.client_ip)!=null&&(s["client.address"]=r.client_ip),(c==null?void 0:c.status)!=null&&(s["http.response.status_code"]=c.status),(c==null?void 0:c.content_length)!=null&&(s["http.response.body.size"]=c.content_length),e.sql){const o=e.sql;o.database_type!=null&&(s["db.system"]=o.database_type),o.sanitized_query!=null&&(s["db.statement"]=o.sanitized_query),o.url!=null&&(s["server.address"]=o.url),o.user!=null&&(s["db.user"]=o.user)}return e.namespace&&(s["aws.xray.namespace"]=e.namespace),e.throttle&&(s["aws.xray.throttle"]=!0),"origin"in e&&e.origin&&(s["cloud.platform"]=String(e.origin)),e.aws&&sp(s,"aws",e.aws),e.annotations&&Object.entries(e.annotations).forEach(([o,u])=>{s[o]=u}),e.metadata&&sp(s,"metadata",e.metadata),s}function K4(e){var o,u;var t,a,s,r;let c;if(e.cause&&typeof e.cause=="object"&&(t=e.cause.exceptions)!=null&&t.length){const h=e.cause.exceptions[0],m=(a=h.stack)!=null&&a.length?`${(o=h.type)!=null?o:"Error"}: ${(u=h.message)!=null?u:""}
78
+ `+h.stack.map(g=>{var p,v,b;return` at ${(p=g.label)!=null?p:"<anonymous>"} (${(v=g.path)!=null?v:"?"}:${(b=g.line)!=null?b:0})`}).join(`
79
+ `):void 0;c={type:h.type,message:h.message,stacktrace:m}}else typeof e.cause=="string"&&(c={type:"Error",message:`exception ${e.cause}`});return{exception:c,statusCode:(r=(s=e.http)==null?void 0:s.response)==null?void 0:r.status}}function nw(e){var t,a;if(e==null)return[];if(Array.isArray(e))return e.flatMap(nw);if(e.Traces||e.traces){const s=(t=e.Traces)!=null?t:e.traces;let r=s;return s.length>1&&(console.warn(`fromXRay: response has ${s.length} traces; using the first. Pass one trace at a time for the rest.`),r=s.slice(0,1)),r.flatMap(c=>{var o;return((o=c.Segments)!=null?o:[]).map(u=>typeof u.Document=="string"?JSON.parse(u.Document):u.Document)})}return e.Segments||e.segments?((a=e.Segments)!=null?a:e.segments).map(s=>typeof s.Document=="string"?JSON.parse(s.Document):s.Document):[e]}function X4(e,t={}){var p;const a=nw(e);if(a.length===0)return{spans:[],services:{},meta:{traceId:""}};const s=[],r={},c=(v,b,_,S)=>{var w;s.push({node:v,parentId:b,service:_,isRoot:S}),((w=v.subsegments)!=null?w:[]).forEach(C=>c(C,v.id,_,!1))};a.forEach(v=>{var S;const b=v.type==="subsegment",_=v.name;r[_]||(r[_]={label:_}),c(v,(S=v.parent_id)!=null?S:null,_,!b)});let o=1/0,u=-1/0;s.forEach(({node:v})=>{typeof v.start_time=="number"&&(o=Math.min(o,v.start_time)),typeof v.end_time=="number"&&(u=Math.max(u,v.end_time))}),Number.isFinite(o)||(o=0),Number.isFinite(u)||(u=o);const h=s.map(({node:v,parentId:b,service:_,isRoot:S})=>{var P,M,U,F;const w=typeof v.start_time=="number"?v.start_time:o,C=(w-o)*1e3,R=typeof v.end_time=="number"?v.end_time:u,j=Math.max(0,(R-w)*1e3),k=G4(v),{exception:I,statusCode:O}=K4(v),z=I?[{time:C,name:"exception",attributes:{"exception.type":(P=I.type)!=null?P:"","exception.message":(M=I.message)!=null?M:""}}]:void 0,B={id:String((U=v.id)!=null?U:"").toLowerCase(),parentId:b!=null?String(b).toLowerCase():null,name:String((F=v.name)!=null?F:"(unnamed)"),service:_,kind:V4(v,S),start:C,duration:j,status:Y4(v),statusCode:O,attributes:k,exception:I,events:z};return t.deriveStatus?K(T({},B),{status:t.deriveStatus(B)}):B}),m=(p=a.find(v=>v.type!=="subsegment"))!=null?p:a[0],g={traceId:q4(m.trace_id),name:m.name,rootService:m.name};return{spans:h,services:r,meta:g}}function Q4(e){const t={};e.forEach(h=>{t[h.id]=K(T({},h),{end:h.start+h.duration,depth:0,children:[],hasChildren:!1})});const a=[];e.forEach(h=>{const m=t[h.id];h.parentId&&t[h.parentId]&&h.parentId!==h.id?t[h.parentId].children.push(m):a.push(m)});const s=(h,m)=>h.start-m.start||h.end-m.end;a.sort(s);const r=[];let c=0;const o=(h,m)=>{h.depth=m,h.hasChildren=h.children.length>0,m>c&&(c=m),r.push(h),h.children.sort(s),h.children.forEach(g=>o(g,m+1))};a.forEach(h=>o(h,0));const u=r.reduce((h,m)=>m.end>h?m.end:h,0);return{byId:t,ordered:r,roots:a,total:u,maxDepth:c}}function aw(e){if(!e.children.length)return e.duration;const t=e.children.map(c=>[Math.max(c.start,e.start),Math.min(c.end,e.end)]).filter(([c,o])=>o>c).sort((c,o)=>c[0]-o[0]);let a=0,s=null,r=0;return t.forEach(([c,o])=>{s===null?(s=c,r=o):c<=r?r=Math.max(r,o):(a+=r-s,s=c,r=o)}),s!==null&&(a+=r-s),Math.max(0,e.duration-a)}function Z4(e,t){const a=[],s=new Set;return e.forEach(r=>{if(r.parentId&&s.has(r.parentId)){s.add(r.id);return}a.push(r),t.has(r.id)&&s.add(r.id)}),a}function J4(e){let t=0;const a=s=>{s.children.forEach(r=>{t++,a(r)})};return a(e),t}const rp=2;function iw(e,t,a=rp){const s=Math.max(1e-6,t-e),r=100-2*a;return{x:c=>a+(c-e)/s*r,w:c=>Math.max(.5,c/s*r)}}function W4(e,t){const a=Math.max(1e-6,t-e)/8,s=Math.pow(10,Math.floor(Math.log10(a))),r=a/s,c=s*(r<1.5?1:r<3?2:r<7?5:10),o=[],u=Math.ceil(e/c-1e-9)*c;for(let h=u;h<=t+1e-6;h+=c)o.push(+h.toFixed(3));return{ticks:o,step:c}}function Cn(e){return e==null?"—":e>=1e3?(e/1e3).toFixed(2)+" s":e>=10?e.toFixed(0)+" ms":e>=1?e.toFixed(1)+" ms":e.toFixed(2)+" ms"}const sw=["#22D3EE","#818CF8","#10B981","#8B5CF6","#14B8A6","#F59E0B","#38BDF8","#A3E635","#E879F9","#2DD4BF"];function e6(e){let t=2166136261;for(let a=0;a<e.length;a++)t^=e.charCodeAt(a),t=Math.imul(t,16777619)>>>0;return t>>>0}function t6(e,t=sw){return t[e6(e)%t.length]}function n6(e,t,a,s=sw){var r;return(a==null?void 0:a(e))||((r=t==null?void 0:t[e])==null?void 0:r.color)||t6(e,s)}function a6(e,t){var a;return((a=t==null?void 0:t[e])==null?void 0:a.label)||e}const i6={SERVER:"server",CLIENT:"client",INTERNAL:"internal",PRODUCER:"producer",CONSUMER:"consumer",UNSPECIFIED:"internal"},s6={ok:"OK",warn:"WARN",error:"ERROR"};function r6({model:e,resolveColor:t,selectedId:a}){const{ordered:s,total:r}=e,c=100,o=2,u=1,h=3,m=s.length,g=h*2+m*(o+u),p=s.findIndex(b=>b.id===a),v=ie.useMemo(()=>{const b=iw(0,r);return s.map((_,S)=>f.jsx("rect",{x:b.x(_.start),y:h+S*(o+u),width:b.w(_.duration),height:o,rx:"0.6",fill:_.status==="error"?"rgb(var(--status-error))":t(_.service),fillOpacity:.5},_.id))},[s,r,t]);return f.jsxs("svg",{className:"trace-detail__minimap",width:"100%",height:g,viewBox:`0 0 ${c} ${g}`,preserveAspectRatio:"none",children:[p>=0&&f.jsx("rect",{x:"0",y:h+p*(o+u)-1,width:c,height:o+2,className:"trace-detail__minimap-band"}),v]})}function tx({rows:e}){return f.jsx("div",{className:"trace-detail__kv",children:e.map(([t,a],s)=>f.jsxs(ie.Fragment,{children:[f.jsx("div",{className:"trace-detail__kv-key",title:t,children:t}),f.jsx("div",{className:"trace-detail__kv-val",title:typeof a=="string"?a:void 0,children:a})]},t+s))})}function Cs({title:e,right:t,children:a}){return f.jsxs("div",{className:"trace-detail__section",children:[f.jsxs("div",{className:"trace-detail__section-head",children:[f.jsx("span",{className:"trace-detail__eyebrow",children:e}),t]}),f.jsx("div",{className:"trace-detail__section-body",children:a})]})}const rw=ie.forwardRef(function({span:e,model:t,traceId:a,resolveColor:s,serviceLabel:r,serviceHost:c,onClose:o,onSelect:u,renderAttributes:h,closeButtonRef:m},g){var z,B,P,M;var p;const v=s(e.service),b=t.total,_=aw(e),S=b>0?e.duration/b*100:0,w=e.duration>0?_/e.duration*100:0,C=e.parentId?t.byId[e.parentId]:null,R=(z=i6[e.kind])!=null?z:"internal",j=t.ordered.findIndex(U=>U.id===e.id)+1,k=e.attributes?Object.entries(e.attributes):[],I=((B=e.events)!=null?B:[]).filter(U=>U.name!=="exception"),O=({label:U,value:F,sub:q})=>f.jsxs("div",{className:"trace-detail__timing-row",children:[f.jsx("span",{className:"trace-detail__timing-label",children:U}),f.jsxs("span",{className:"trace-detail__timing-value",children:[F,q&&f.jsxs("span",{className:"trace-detail__timing-sub",children:[" ",q]})]})]});return f.jsxs("div",{className:"trace-detail",ref:g,role:"complementary","aria-label":`Span detail: ${e.name}`,onKeyDown:U=>{U.key==="Escape"&&(U.stopPropagation(),o())},children:[f.jsxs("div",{className:"trace-detail__head",children:[f.jsx("span",{className:"trace-detail__head-swatch",style:{background:v}}),f.jsxs("div",{className:"trace-detail__head-main",children:[f.jsxs("div",{className:"trace-detail__eyebrow",children:[r.toUpperCase()," · ",e.kind]}),f.jsx("div",{className:"trace-detail__title",children:e.name}),f.jsx("div",{className:"trace-detail__status-row",children:f.jsxs("span",{className:`trace-detail__status-pill trace-detail__status-pill--${e.status}`,children:[f.jsx("span",{className:"trace-detail__status-dot"}),s6[e.status],e.statusCode!=null&&e.statusCode!==0?` · ${e.statusCode}`:""]})})]}),f.jsx("button",{type:"button",className:"trace-detail__close",onClick:o,title:"Close panel","aria-label":"Close span detail",ref:m,children:f.jsx(Ce,{name:"x",size:14})})]}),f.jsxs("div",{className:"trace-detail__scroll",children:[f.jsxs(Cs,{title:"TRACE MAP",children:[f.jsx("div",{className:"trace-detail__minimap-wrap",children:f.jsx(r6,{model:t,resolveColor:s,selectedId:e.id})}),f.jsxs("div",{className:"trace-detail__minimap-caption",children:["row ",j," of ",t.ordered.length]})]}),f.jsxs(Cs,{title:"TIMING",children:[f.jsx(O,{label:"start offset",value:Cn(e.start)}),f.jsx(O,{label:"duration",value:Cn(e.duration)}),f.jsx(O,{label:"self time",value:Cn(_),sub:`· ${w.toFixed(0)}%`}),f.jsx(O,{label:"% of trace",value:`${S.toFixed(1)}%`}),f.jsxs("div",{className:"trace-detail__selfbar",children:[f.jsx("div",{className:"trace-detail__selfbar-self",style:{width:`${w}%`,background:v}}),f.jsx("div",{className:"trace-detail__selfbar-children"})]}),f.jsxs("div",{className:"trace-detail__selfbar-legend",children:[f.jsxs("span",{children:["SELF ",Cn(_)]}),f.jsxs("span",{children:["IN CHILDREN ",Cn(e.duration-_)]})]})]}),f.jsx(Cs,{title:"IDENTITY",children:f.jsx(tx,{rows:[["span_id",e.id],["parent",C?f.jsx("button",{type:"button",className:"trace-detail__link",onClick:()=>u(C.id),title:C.name,children:C.name}):f.jsx("span",{className:"trace-detail__muted",children:"— root —"})],["service",f.jsxs("span",{className:"trace-detail__svc",title:r,children:[f.jsx("span",{className:"trace-detail__svc-dot",style:{background:v}}),r]})],...c?[["host",c]]:[],["kind",f.jsx("span",{className:`trace-detail__kind trace-detail__kind--${R}`,children:e.kind})],...a?[["trace_id",a]]:[]]})}),h?f.jsx(Cs,{title:"ATTRIBUTES",children:h(e)}):k.length>0?f.jsx(Cs,{title:"ATTRIBUTES",right:f.jsx("span",{className:"trace-detail__count",children:k.length}),children:f.jsx(tx,{rows:k.map(([U,F])=>[U,String(F)])})}):null,I.length>0&&f.jsx(Cs,{title:"EVENTS",right:f.jsx("span",{className:"trace-detail__count",children:I.length}),children:f.jsx("div",{className:"trace-detail__events",children:I.map((U,F)=>f.jsxs("div",{className:"trace-detail__event",children:[f.jsx("span",{className:"trace-detail__event-time",children:Cn(U.time)}),f.jsx("span",{className:"trace-detail__event-name",children:U.name})]},F))})}),f.jsx(Cs,{title:"STATUS",children:e.status==="error"&&e.exception?f.jsxs("div",{className:"trace-detail__error",children:[f.jsxs("div",{className:"trace-detail__error-head",children:[f.jsx(Ce,{name:"alert",size:14}),f.jsx("span",{children:(P=e.exception.type)!=null?P:"Error"})]}),e.exception.message&&f.jsx("div",{className:"trace-detail__error-msg",children:e.exception.message}),e.exception.stacktrace&&f.jsx("pre",{className:"trace-detail__error-stack",children:e.exception.stacktrace})]}):e.status==="warn"?f.jsxs("div",{className:"trace-detail__warn",children:[f.jsx(Ce,{name:"alert",size:13}),"degraded — ",String((M=(p=e.attributes)==null?void 0:p.note)!=null?M:"elevated latency on this span")]}):f.jsxs("div",{className:"trace-detail__ok",children:[f.jsx("span",{className:"trace-detail__ok-dot"}),"OK",e.statusCode?` · ${e.statusCode}`:""]})}),f.jsx("div",{className:"trace-detail__foot-spacer"})]})]})});rw.displayName="TraceDetailPanel";const nx=14,ax=16;function l6({node:e,rowHeight:t,treeWidth:a,selected:s,hovered:r,collapsed:c,color:o,onSelect:u,onHover:h,onToggle:m,registerRef:g}){const p=nx+e.depth*ax,v=[];for(let _=0;_<e.depth;_++)v.push(nx+_*ax+7);const b=["trace-viewer__tree-row",s&&"is-selected",r&&"is-hovered",e.status==="error"&&"is-error",e.status==="warn"&&"is-warn"].filter(Boolean).join(" ");return f.jsxs("div",{ref:_=>g(e.id,_),className:b,role:"treeitem","aria-level":e.depth+1,"aria-selected":s,"aria-expanded":e.hasChildren?!c:void 0,tabIndex:s?0:-1,style:{height:t,paddingLeft:p,width:a},onClick:()=>u(e.id),onMouseEnter:()=>h(e.id),onMouseLeave:()=>h(null),children:[v.map((_,S)=>f.jsx("span",{className:"trace-viewer__guide",style:{left:_}},S)),e.hasChildren?f.jsx("button",{type:"button",className:"trace-viewer__twisty"+(c?"":" is-open"),onClick:_=>{_.stopPropagation(),m(e.id)},tabIndex:-1,"aria-label":c?"Expand":"Collapse",children:f.jsx(Ce,{name:"chevronRight",size:13})}):f.jsx("span",{className:"trace-viewer__twisty trace-viewer__twisty--leaf",children:f.jsx("span",{className:"trace-viewer__leaf-dot"})}),f.jsx("span",{className:"trace-viewer__swatch",style:{background:o}}),f.jsx("span",{className:"trace-viewer__tree-name",children:e.name}),c&&e.hasChildren&&f.jsxs("span",{className:"trace-viewer__desc-count",children:["+",J4(e)]}),f.jsx("span",{className:"trace-viewer__tree-dur",children:Cn(e.duration)})]})}function o6({node:e,rowHeight:t,scaleX:a,scaleW:s,selected:r,hovered:c,color:o,onSelect:u,onHover:h}){const m=a(e.start),g=s(e.duration),p=m+g<68,v=e.status==="error",b=e.status==="warn",_=["trace-viewer__wf-row",r&&"is-selected",c&&"is-hovered"].filter(Boolean).join(" ");return f.jsxs("div",{className:_,style:{height:t},onClick:()=>u(e.id),onMouseEnter:()=>h(e.id),onMouseLeave:()=>h(null),children:[f.jsx("div",{className:"trace-viewer__bar"+(v?" is-error":"")+(r?" is-selected":""),style:{left:`${m}%`,width:`${g}%`,background:o},children:b&&f.jsx("span",{className:"trace-viewer__bar-warn"})}),v&&f.jsx("span",{className:"trace-viewer__bar-alert",style:{left:`calc(${m}% - 4px)`},children:f.jsx(Ce,{name:"alert",size:12})}),f.jsxs("span",{className:"trace-viewer__bar-label",style:p?{left:`calc(${m+g}% + 7px)`}:{right:`calc(${100-m}% + 7px)`},children:[f.jsx("span",{className:"trace-viewer__bar-dur"+(v?" is-error":b?" is-warn":""),children:Cn(e.duration)}),f.jsx("span",{className:"trace-viewer__bar-name",children:e.name})]})]})}const c6=ie.memo(function({model:e,resolveColor:t,resolveLabel:a}){const{ordered:s,total:r}=e,c=new Set(s.map(v=>v.service)),o=s.filter(v=>v.status==="error").length,u=s.filter(v=>v.status==="warn").length,h={};s.forEach(v=>{h[v.service]=(h[v.service]||0)+aw(v)});const m=Object.entries(h).sort((v,b)=>b[1]-v[1]),g=m.reduce((v,[,b])=>v+b,0)||1,p=({label:v,value:b,tone:_})=>f.jsxs("div",{className:"trace-viewer__stat"+(_?` trace-viewer__stat--${_}`:""),children:[f.jsx("span",{className:"trace-viewer__eyebrow",children:v}),f.jsx("span",{className:"trace-viewer__stat-value",children:b})]});return f.jsxs("div",{className:"trace-viewer__summary",children:[f.jsx(p,{label:"DURATION",value:Cn(r),tone:"accent"}),f.jsx(p,{label:"SPANS",value:s.length}),f.jsx(p,{label:"SERVICES",value:c.size}),f.jsx(p,{label:"ERRORS",value:o,tone:o?"error":void 0}),f.jsx(p,{label:"WARNINGS",value:u,tone:u?"warn":void 0}),f.jsxs("div",{className:"trace-viewer__svcbar-wrap",children:[f.jsx("span",{className:"trace-viewer__eyebrow",children:"TIME PER SERVICE · SELF"}),f.jsx("div",{className:"trace-viewer__svcbar",children:m.map(([v,b])=>f.jsx("div",{className:"trace-viewer__svcbar-seg",title:`${a(v)} · ${Cn(b)}`,style:{width:`${b/g*100}%`,background:t(v)}},v))}),f.jsx("div",{className:"trace-viewer__svc-legend",children:m.map(([v,b])=>f.jsxs("span",{className:"trace-viewer__svc-legend-item",children:[f.jsx("span",{className:"trace-viewer__svc-legend-dot",style:{background:t(v)}}),a(v),f.jsx("span",{className:"trace-viewer__svc-legend-val",children:Cn(b)})]},v))})]})]})}),u6=ie.forwardRef(function(B,z){var P=B,{trace:e,otlp:t,xray:a,selectedSpanId:s,defaultSelectedSpanId:r=null,onSelectSpan:c,collapsedSpanIds:o,defaultCollapsedSpanIds:u,onToggleSpan:h,showSummary:m=!0,showToolbar:g=!0,showDetailPanel:p=!0,treeWidth:v=336,detailPanelWidth:b=360,rowHeight:_=30,services:S,serviceColor:w,deriveStatus:C,renderAttributes:R,enableZoom:j=!0,virtualizeThreshold:k=80,className:I=""}=P,O=de(P,["trace","otlp","xray","selectedSpanId","defaultSelectedSpanId","onSelectSpan","collapsedSpanIds","defaultCollapsedSpanIds","onToggleSpan","showSummary","showToolbar","showDetailPanel","treeWidth","detailPanelWidth","rowHeight","services","serviceColor","deriveStatus","renderAttributes","enableZoom","virtualizeThreshold","className"]);var M,U;const F=A.useMemo(()=>{let ae;return t?ae=$4(t):a?ae=X4(a):ae=e!=null?e:{spans:[]},C&&(ae=K(T({},ae),{spans:ae.spans.map(xe=>K(T({},xe),{status:C(xe)}))})),ae},[t,a,e,C]),q=A.useMemo(()=>Q4(F.spans),[F]),{ordered:H,byId:Y,total:$}=q,X=A.useMemo(()=>{var ae;return T(T({},(ae=F.services)!=null?ae:{}),S!=null?S:{})},[F.services,S]),Z=A.useCallback(ae=>n6(ae,X,w),[X,w]),fe=A.useCallback(ae=>a6(ae,X),[X]),[D,he]=A.useState(r),ge=s!==void 0?s:D,E=ge&&Y[ge]?ge:null,W=A.useCallback(ae=>{s===void 0&&he(ae),c==null||c(ae)},[s,c]),[oe,me]=A.useState(()=>new Set(u!=null?u:[])),_e=A.useMemo(()=>o?new Set(o):oe,[o,oe]),be=A.useCallback(ae=>{const xe=!_e.has(ae);o===void 0&&me(Te=>{const He=new Set(Te);return He.has(ae)?He.delete(ae):He.add(ae),He}),h==null||h(ae,xe)},[_e,o,h]),Ae=A.useCallback(ae=>{var xe;if(o!==void 0)return;const Te=[];let He=(xe=Y[ae])!=null&&xe.parentId?Y[Y[ae].parentId]:null;for(;He;)Te.push(He.id),He=He.parentId?Y[He.parentId]:null;Te.length&&me(zt=>{const ya=new Set(zt);return Te.forEach(Aa=>ya.delete(Aa)),ya})},[Y,o]),[Ge,ot]=A.useState(null),[qt,at]=A.useState(null),Ie=qt!=null?qt:[0,$||1],qe=A.useMemo(()=>iw(Ie[0],Ie[1]),[Ie[0],Ie[1]]),bt=A.useMemo(()=>W4(Ie[0],Ie[1]).ticks,[Ie[0],Ie[1]]),ke=A.useMemo(()=>Z4(H,_e),[H,_e]),ct=A.useMemo(()=>{const ae=new Map;return ke.forEach((xe,Te)=>ae.set(xe.id,Te)),ae},[ke]),Fe=ke.length*_,[ma,pa]=A.useState(600),Ta=ke.length>=k,{visibleRange:ri,containerRef:At,sentinelRef:as}=Up({itemCount:ke.length,itemHeight:_,containerHeight:ma,overscan:16}),re=Ta?Math.max(0,ri[0]):0,ve=Ta?Math.min(ke.length,ri[1]):ke.length,Ee=ke.slice(re,ve);A.useEffect(()=>{const ae=At.current;if(!ae||typeof ResizeObserver>"u")return;const xe=new ResizeObserver(()=>pa(ae.clientHeight||600));return xe.observe(ae),pa(ae.clientHeight||600),()=>xe.disconnect()},[At]);const We=A.useMemo(()=>{const ae=new Set;let xe=E?Y[E]:null;for(;xe;)ae.add(xe.id),xe=xe.parentId?Y[xe.parentId]:null;return ae},[E,Y]),Re=A.useRef(new Map),xt=A.useCallback((ae,xe)=>{xe?Re.current.set(ae,xe):Re.current.delete(ae)},[]),Ct=A.useRef(null),Tt=A.useCallback(ae=>{const xe=ct.get(ae),Te=At.current;if(xe==null||!Te)return;const He=xe*_,zt=He+_;He<Te.scrollTop?Te.scrollTop=Math.max(0,He-_):zt>Te.scrollTop+Te.clientHeight&&(Te.scrollTop=zt-Te.clientHeight+_)},[ct,_,At]),Nt=A.useCallback((ae,xe=6)=>{const Te=Re.current.get(ae);if(Te){Te.focus();return}xe>0&&requestAnimationFrame(()=>Nt(ae,xe-1))},[]);A.useEffect(()=>{E&&(Tt(E),Ct.current===E&&(Nt(E),Ct.current=null))},[E,Tt,Nt]);const pt=A.useCallback((ae,xe=!0)=>{Ae(ae),xe&&(Ct.current=ae),W(ae)},[Ae,W]),ut=A.useCallback(ae=>{var xe;const Te=E!=null?E:(xe=ke[0])==null?void 0:xe.id;if(!Te)return;const He=ct.get(Te);if(He==null)return;const zt=Y[Te];switch(ae.key){case"ArrowDown":ae.preventDefault(),ke[He+1]&&pt(ke[He+1].id);break;case"ArrowUp":ae.preventDefault(),ke[He-1]&&pt(ke[He-1].id);break;case"ArrowRight":ae.preventDefault(),zt.hasChildren&&_e.has(Te)?be(Te):ke[He+1]&&ke[He+1].parentId===Te&&pt(ke[He+1].id);break;case"ArrowLeft":ae.preventDefault(),zt.hasChildren&&!_e.has(Te)?be(Te):zt.parentId&&pt(zt.parentId);break;case"Home":ae.preventDefault(),ke[0]&&pt(ke[0].id);break;case"End":ae.preventDefault(),ke[ke.length-1]&&pt(ke[ke.length-1].id);break;case"Enter":case" ":ae.preventDefault(),pt(Te);break;case"Escape":E&&(ae.preventDefault(),W(null));break}},[E,ke,ct,Y,_e,be,pt,W]),ga=A.useMemo(()=>{const ae=new Map;return H.forEach((xe,Te)=>ae.set(xe.id,Te)),ae},[H]),nn=A.useMemo(()=>H.filter(ae=>ae.status==="error").map(ae=>ae.id),[H]),Xo=A.useCallback(ae=>{var ya,Aa;if(!nn.length)return;const xe=cn=>{var sa;return(sa=ga.get(cn))!=null?sa:-1},Te=E?xe(E):-1,He=nn.map(xe).sort((cn,sa)=>cn-sa);let zt;ae===1?zt=(ya=He.find(cn=>cn>Te))!=null?ya:He[0]:zt=(Aa=[...He].reverse().find(cn=>cn<Te))!=null?Aa:He[He.length-1],zt!=null&&pt(H[zt].id)},[nn,H,E,pt]),Zs=A.useCallback(()=>{o===void 0&&me(new Set(H.filter(ae=>ae.hasChildren).map(ae=>ae.id)))},[o,H]),Js=A.useCallback(()=>{o===void 0&&me(new Set)},[o]),is=A.useRef(null),[on,Ma]=A.useState(null),Bn=A.useRef(null),Ws=A.useCallback(ae=>{const xe=is.current;if(!xe)return 0;const Te=xe.getBoundingClientRect();return Math.min(100,Math.max(0,(ae-Te.left)/Te.width*100))},[]),er=A.useCallback(ae=>{const xe=100-2*rp,Te=(ae-rp)/xe;return Ie[0]+Te*(Ie[1]-Ie[0])},[Ie]),pl=A.useCallback(ae=>{if(!j||$<=0)return;ae.currentTarget.setPointerCapture(ae.pointerId);const xe=Ws(ae.clientX);Bn.current=xe,Ma({a:xe,b:xe})},[j,$,Ws]),ss=A.useCallback(ae=>{Bn.current!=null&&Ma({a:Bn.current,b:Ws(ae.clientX)})},[Ws]),_d=A.useCallback(()=>{if(Bn.current==null)return;const ae=on;if(Bn.current=null,Ma(null),!ae||Math.abs(ae.b-ae.a)<1.5)return;const xe=er(Math.min(ae.a,ae.b)),Te=er(Math.max(ae.a,ae.b)),He=Math.max(0,Math.min(xe,Te)),zt=Math.min($,Math.max(xe,Te));zt-He>$*.005&&at([He,zt])},[on,er,$]),gl=A.useCallback(()=>{Bn.current=null,Ma(null)},[]),yl=qt!=null;A.useEffect(()=>{s===void 0&&D&&!Y[D]&&he(null)},[Y,D,s]);const li=E?Y[E]:null,tr=p&&!!li,vl=A.useRef(null),Qo=A.useCallback(()=>{const ae=E;W(null),ae&&Nt(ae)},[E,W,Nt]),oi=nn.length,ia=["trace-viewer",I].filter(Boolean).join(" ");return H.length?f.jsxs("div",K(T({ref:z,className:ia},O),{children:[m&&f.jsx(c6,{model:q,resolveColor:Z,resolveLabel:fe}),g&&f.jsxs("div",{className:"trace-viewer__toolbar",children:[f.jsxs("div",{className:"trace-viewer__toolbar-group",children:[f.jsx("button",{type:"button",className:"trace-viewer__tool-btn",onClick:Js,title:"Expand all","aria-label":"Expand all",children:f.jsx(Ce,{name:"chevronDown",size:14})}),f.jsx("button",{type:"button",className:"trace-viewer__tool-btn",onClick:Zs,title:"Collapse all","aria-label":"Collapse all",children:f.jsx(Ce,{name:"chevronRight",size:14})})]}),f.jsxs("div",{className:"trace-viewer__toolbar-group",children:[f.jsx("button",{type:"button",className:"trace-viewer__tool-btn",onClick:()=>Xo(-1),disabled:!oi,title:"Previous error","aria-label":"Previous error",children:f.jsx(Ce,{name:"arrowUp",size:14})}),f.jsxs("span",{className:"trace-viewer__error-count"+(oi?" is-active":""),children:[oi," error",oi!==1?"s":""]}),f.jsx("button",{type:"button",className:"trace-viewer__tool-btn",onClick:()=>Xo(1),disabled:!oi,title:"Next error","aria-label":"Next error",children:f.jsx(Ce,{name:"arrowDown",size:14})})]}),j&&f.jsxs("div",{className:"trace-viewer__toolbar-group",children:[f.jsx("button",{type:"button",className:"trace-viewer__tool-btn",onClick:()=>at(null),disabled:!yl,title:"Reset zoom","aria-label":"Reset zoom",children:f.jsx(Ce,{name:"reload",size:14})}),f.jsx("span",{className:"trace-viewer__zoom-hint",children:yl?`${Cn(Ie[0])} – ${Cn(Ie[1])}`:"drag axis to zoom"})]})]}),f.jsxs("div",{className:"trace-viewer__body",children:[f.jsxs("div",{className:"trace-viewer__lane",children:[f.jsxs("div",{className:"trace-viewer__lane-head",style:{height:32},children:[f.jsxs("div",{className:"trace-viewer__tree-head",style:{width:v},children:[f.jsxs("span",{className:"trace-viewer__eyebrow",children:["SPAN · ",ke.length,"/",H.length]}),f.jsx("span",{className:"trace-viewer__eyebrow",children:"DURATION"})]}),f.jsxs("div",{className:"trace-viewer__axis"+(j?" is-zoomable":""),ref:is,onPointerDown:pl,onPointerMove:ss,onPointerUp:_d,onPointerCancel:gl,onLostPointerCapture:gl,onDoubleClick:()=>at(null),children:[bt.map((ae,xe)=>f.jsx("div",{className:"trace-viewer__tick-label",style:{left:`${qe.x(ae)}%`},children:ae===0?"0":Cn(ae)},xe)),on&&f.jsx("div",{className:"trace-viewer__brush",style:{left:`${Math.min(on.a,on.b)}%`,width:`${Math.abs(on.b-on.a)}%`}})]})]}),f.jsx("div",{className:"trace-viewer__scroll",ref:At,children:f.jsxs("div",{className:"trace-viewer__rows",style:{height:Fe},children:[f.jsx("div",{ref:as,className:"trace-viewer__sentinel"}),f.jsx("div",{className:"trace-viewer__tree",role:"tree","aria-label":"Span tree",tabIndex:0,onKeyDown:ut,style:{width:v,height:Fe},children:Ee.map((ae,xe)=>{const Te=re+xe;return f.jsx("div",{className:"trace-viewer__row-abs",style:{top:Te*_},children:f.jsx(l6,{node:ae,rowHeight:_,treeWidth:v,selected:E===ae.id,hovered:Ge===ae.id,collapsed:_e.has(ae.id),color:Z(ae.service),onSelect:He=>pt(He,!1),onHover:ot,onToggle:be,registerRef:xt})},ae.id)})}),f.jsxs("div",{className:"trace-viewer__wf",style:{height:Fe},children:[bt.map((ae,xe)=>f.jsx("div",{className:"trace-viewer__gridline",style:{left:`${qe.x(ae)}%`}},xe)),f.jsx("svg",{className:"trace-viewer__connectors",width:"100%",height:Fe,viewBox:`0 0 100 ${Fe}`,preserveAspectRatio:"none",children:ke.map(ae=>{if(!ae.parentId)return null;const xe=ct.get(ae.id),Te=ct.get(ae.parentId);if(xe==null||Te==null)return null;const He=Math.min(xe,Te);if(Math.max(xe,Te)<re-24||He>ve+24)return null;const zt=Y[ae.parentId],ya=qe.x(zt.start),Aa=qe.x(ae.start),cn=Te*_+_/2+5,sa=xe*_+_/2,ci=We.has(ae.id)&&We.has(ae.parentId);return f.jsx("path",{d:`M ${ya} ${cn} L ${ya} ${sa} L ${Aa} ${sa}`,className:"trace-viewer__connector"+(ci?" is-active":""),vectorEffect:"non-scaling-stroke"},ae.id)})}),Ee.map((ae,xe)=>{const Te=re+xe;return f.jsx("div",{className:"trace-viewer__row-abs",style:{top:Te*_},children:f.jsx(o6,{node:ae,rowHeight:_,scaleX:qe.x,scaleW:qe.w,selected:E===ae.id,hovered:Ge===ae.id,color:Z(ae.service),onSelect:He=>pt(He,!1),onHover:ot})},ae.id)})]})]})})]}),p&&f.jsx("div",{className:"trace-viewer__panel"+(tr?" is-open":""),style:{width:tr?b:0},children:li&&f.jsx(rw,{span:li,model:q,traceId:(M=F.meta)==null?void 0:M.traceId,resolveColor:Z,serviceLabel:fe(li.service),serviceHost:(U=X[li.service])==null?void 0:U.host,onClose:Qo,onSelect:ae=>pt(ae,!1),renderAttributes:R,closeButtonRef:vl})})]})]})):f.jsx("div",K(T({ref:z,className:ia},O),{children:f.jsx("div",{className:"trace-viewer__empty",children:"No spans in this trace."})}))});u6.displayName="TraceViewer";const ix=typeof window!="undefined"?window.innerWidth>=1300:!1;function lw(e){typeof document!="undefined"&&document.body.classList.toggle("dark-canvas",e)}const bo=(e,t)=>`${e}:${t}`,je=Qu(e=>({view:"model",layerId:null,selectedId:null,changesetId:null,canvasDark:!1,chatOpen:ix,wide:ix,mode:"graph",focus:"layer",expandedSections:new Set(["model"]),expandedLayers:new Set,setView:t=>e({view:t}),selectLayer:t=>e(a=>{const s=new Set(a.expandedLayers);return s.add(bo(a.view,t)),{layerId:t,selectedId:null,focus:"layer",expandedSections:new Set(a.expandedSections).add(a.view),expandedLayers:s}}),selectNode:t=>e({selectedId:t,focus:"node"}),selectGraphNode:t=>e(a=>({selectedId:t,focus:"node",expandedSections:new Set(a.expandedSections).add(a.view),expandedLayers:a.layerId?new Set(a.expandedLayers).add(bo(a.view,a.layerId)):a.expandedLayers})),navigateToElement:(t,a)=>e(s=>{const c=s.layerId===a?s.expandedLayers:new Set(s.expandedLayers).add(bo("model",a));return{view:"model",layerId:a,selectedId:t,focus:"node",expandedSections:new Set(s.expandedSections).add("model"),expandedLayers:c}}),navigateToSpecNode:(t,a)=>e(s=>{const c=s.layerId===a?s.expandedLayers:new Set(s.expandedLayers).add(bo("spec",a));return{view:"spec",layerId:a,selectedId:t,focus:"node",expandedSections:new Set(s.expandedSections).add("spec"),expandedLayers:c}}),selectChangeset:t=>e(a=>({view:"changesets",changesetId:t,expandedSections:new Set(a.expandedSections).add("changesets")})),setMode:t=>e({mode:t}),toggleCanvasDark:()=>e(t=>{const a=!t.canvasDark;return lw(a),{canvasDark:a}}),toggleChat:()=>e(t=>({chatOpen:!t.chatOpen})),toggleSection:t=>e(a=>{const s=new Set(a.expandedSections);return s.has(t)?s.delete(t):s.add(t),{view:t,expandedSections:s}}),toggleLayer:(t,a)=>e(s=>{const r=bo(t,a),c=new Set(s.expandedLayers),o=c.has(r);return o?c.delete(r):c.add(r),{view:t,layerId:a,selectedId:o?s.selectedId:null,focus:o?s.focus:"layer",expandedSections:new Set(s.expandedSections).add(t),expandedLayers:c}}),setWide:t=>e({wide:t})}));typeof document!="undefined"&&lw(je.getState().canvasDark);typeof window!="undefined"&&window.addEventListener("resize",()=>{const e=window.innerWidth>=1300;e!==je.getState().wide&&je.getState().setWide(e)});const wo=Qu(e=>({state:"disconnected",reconnectAttempt:0,reconnectDelay:0,lastError:null,lastConnectedAt:null,lastDisconnectedAt:null,setConnecting:()=>e({state:"connecting",lastError:null}),setConnected:()=>e({state:"connected",reconnectAttempt:0,reconnectDelay:0,lastError:null,lastConnectedAt:new Date}),setDisconnected:()=>e({state:"disconnected",lastDisconnectedAt:new Date}),setReconnecting:(t,a)=>e({state:"reconnecting",reconnectAttempt:t,reconnectDelay:a}),setError:t=>e({state:"error",lastError:t}),reset:()=>e({state:"disconnected",reconnectAttempt:0,reconnectDelay:0,lastError:null,lastConnectedAt:null,lastDisconnectedAt:null})})),d6={connected:{label:"connected",color:"#10B981"},connecting:{label:"connecting",color:"#FBBF24"},reconnecting:{label:"reconnecting",color:"#FBBF24"},disconnected:{label:"disconnected",color:"#64748B"},error:{label:"disconnected",color:"#F43F5E"}},f6=[{value:"light",label:"light"},{value:"dark",label:"dark"}];function h6(){const e=je(o=>o.canvasDark),t=je(o=>o.toggleCanvasDark),a=je(o=>o.chatOpen),s=je(o=>o.toggleChat),r=wo(o=>o.state),c=d6[r];return f.jsxs("div",{style:{height:54,flex:"none",display:"flex",alignItems:"center",gap:18,padding:"0 16px",background:"rgb(var(--shell-bg-2))",borderBottom:"1px solid rgb(var(--shell-border))"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[f.jsx("div",{style:{width:24,height:24,borderRadius:6,background:"linear-gradient(135deg,#FBBF24,#B45309)",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"'JetBrains Mono',monospace",fontWeight:700,fontSize:12,color:"#1B1206"},children:"dr"}),f.jsxs("div",{style:{display:"flex",flexDirection:"column",lineHeight:1.15},children:[f.jsx("span",{style:{fontSize:13,fontWeight:600,color:"rgb(var(--shell-fg-1))"},children:"Documentation Robotics"}),f.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:10,letterSpacing:"0.08em",color:"rgb(var(--shell-fg-3))"},children:"architecture viewer"})]})]}),f.jsx("div",{style:{flex:1}}),f.jsx(rd,{value:e?"dark":"light",onChange:o=>{o==="dark"!==e&&t()},options:f6,"aria-label":"Canvas theme"}),f.jsxs("button",{type:"button",onClick:s,"aria-pressed":a,style:{display:"flex",alignItems:"center",gap:7,padding:"6px 12px",borderRadius:7,fontSize:12,fontWeight:500,fontFamily:"inherit",cursor:"pointer",transition:"all .12s",background:a?"rgb(var(--shell-surface))":"transparent",color:a?"rgb(var(--shell-fg-1))":"rgb(var(--shell-fg-2))",border:a?"1px solid rgb(var(--shell-border-2))":"1px solid rgb(var(--shell-border))"},children:[f.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"#FBBF24",display:"inline-block"}}),"DrBot"]}),f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:7,paddingLeft:4},"data-testid":"connection-status","data-state":r,children:[f.jsx("span",{style:{position:"relative",width:8,height:8},children:f.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:c.color}})}),f.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:11,color:"rgb(var(--shell-fg-2))"},children:c.label})]})]})}const ow=["motivation","business","security","application","technology","api","data-model","data-store","ux","navigation","apm","testing"],cw={motivation:"#8B5CF6",business:"#F59E0B",security:"#F43F5E",application:"#818CF8",technology:"#22D3EE",api:"#10B981","data-model":"#2DD4BF","data-store":"#38BDF8",ux:"#F472B6",navigation:"#A78BFA",apm:"#FB923C",testing:"#4ADE80"},m6={motivation:"Motivation",business:"Business",security:"Security",application:"Application",technology:"Technology",api:"API","data-model":"Data Model","data-store":"Data Store",ux:"UX",navigation:"Navigation",apm:"APM",testing:"Testing"},p6={motivation:"ArchiMate 3.2",business:"ArchiMate 3.2",security:"NIST SP 800-53",application:"ArchiMate 3.2",technology:"ArchiMate 3.2",api:"OpenAPI 3.0","data-model":"JSON Schema Draft 7","data-store":"ISO/IEC 9075 (SQL)",ux:"HTML 5.3",navigation:"SPA Navigation Patterns",apm:"OpenTelemetry",testing:"IEEE 829-2008"},g6="#6B7280";function pd(e){return e in cw}function ka(e){return e&&pd(e)?cw[e]:g6}function Wi(e){return e&&pd(e)?m6[e]:e?e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" "):""}function gd(e){return e&&pd(e)?p6[e]:""}const y6={nodes:[],links:[],countsByLayer:{},nodesByLayer:{},relCount:0};function ns(){const e=_E(),t=e.data,a=A.useMemo(()=>{var c,o,u,h,m;if(!(t!=null&&t.nodes))return y6;const s={},r={};for(const g of t.nodes){const p=g.layer_id;p&&(s[p]=((c=s[p])!=null?c:0)+1,((o=r[p])!=null?o:r[p]=[]).push(g))}return{nodes:t.nodes,links:(u=t.links)!=null?u:[],countsByLayer:s,nodesByLayer:r,relCount:(m=(h=t.links)==null?void 0:h.length)!=null?m:0}},[t]);return K(T({},e),{derived:a})}const v6={version:"",byLayer:{}};function Qs(){const e=SE(),t=e.data,a=A.useMemo(()=>{var r,c,o,u;if(!(t!=null&&t.schemas))return v6;const s={};for(const h of Object.values(t.schemas)){const m=h,g=m.layer;if(!(g!=null&&g.id))continue;const p=(r=m.nodeSchemas)!=null?r:{},v=Object.keys(p);s[g.id]={typeCount:v.length,typeIds:v,typeTitles:v.map(b=>{var _,S;return(S=(_=p[b])==null?void 0:_.title)!=null?S:b}),standard:(o=(c=g.inspired_by)==null?void 0:c.standard)!=null?o:gd(g.id)}}return{version:(u=t.version)!=null?u:"",byLayer:s}},[t]);return K(T({},e),{derived:a,raw:t})}const b6={add:{op:"add",label:"ADD",color:"#10B981",colorLight:"#047857",background:"rgba(16,185,129,0.12)"},update:{op:"update",label:"MOD",color:"#22D3EE",colorLight:"#0E7490",background:"rgba(34,211,238,0.12)"},delete:{op:"delete",label:"DEL",color:"#F43F5E",colorLight:"#BE123C",background:"rgba(244,63,94,0.12)"}};function uw(e){const t=(e!=null?e:"").toLowerCase();return t.includes("delete")||t==="del"||t==="remove"?"delete":t.includes("add")||t==="create"?"add":"update"}function Sm(e){var a;if(!e)return"element";const t=(a=e.type)!=null?a:e.predicate;return typeof t=="string"&&t.length>0?t:"element"}function Xu(e){if(e===null||typeof e!="object")return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(Xu).join(",")}]`;const t=e;return`{${Object.keys(t).sort().map(a=>`${JSON.stringify(a)}:${Xu(t[a])}`).join(",")}}`}function x6(e,t){if(!e||!t)return[];const a=new Set([...Object.keys(e),...Object.keys(t)]),s=[];for(const r of a)Xu(e[r])!==Xu(t[r])&&s.push(r);return s}function _6(e){var c,o,u;const t=uw(e.type);if(t==="add")return((c=e.type)!=null?c:"").includes("relationship")?"Added relationship":`Added ${Sm(e.after)}`;if(t==="delete")return((o=e.type)!=null?o:"").includes("relationship")?"Removed relationship":`Removed ${Sm(e.before)}`;const a=x6(e.before,e.after);if(a.length===0)return`Updated ${Sm((u=e.after)!=null?u:e.before)}`;const s=a.slice(0,3).join(", "),r=a.length>3?` +${a.length-3} more`:"";return`Changed ${s}${r}`}function S6(e,t){var r,c,o;const a=uw(e.type),s=(r=e.elementId)!=null?r:"(unknown)";return{key:`${s}::${(c=e.sequenceNumber)!=null?c:t}`,op:a,meta:b6[a],elementId:s,layerName:(o=e.layerName)!=null?o:"",detail:_6(e),hasDiff:!!e.before||!!e.after,raw:e}}function w6(e){return e?e.map(S6):[]}function C6(e){const t=e.before?JSON.stringify(e.before,null,2):"",a=e.after?JSON.stringify(e.after,null,2):"",s=t?t.split(`
80
+ `):[],r=a?a.split(`
81
+ `):[],c=new Set(s),o=new Set(r),u=[];for(const h of s)o.has(h)||u.push({type:"removed",content:h});for(const h of r)c.has(h)||u.push({type:"added",content:h});return u}function N6(e,t){if(!t)return e;const{additions:a,modifications:s,deletions:r}=t;return`${a} additions · ${s} modifications · ${r} deletions in this changeset.`}const j6={list:[]};function Ko(){const e=wE(),t=e.data,a=A.useMemo(()=>{const s=t==null?void 0:t.changesets;if(!s)return j6;const r=Object.entries(s).map(([c,o])=>{var u,h,m,g;return{id:c,name:(u=o.name)!=null?u:c,status:(h=o.status)!=null?h:"unknown",created:(m=o.created)!=null?m:"",changesCount:(g=o.changes_count)!=null?g:0}});return r.sort((c,o)=>o.created.localeCompare(c.created)),{list:r}},[t]);return K(T({},e),{derived:a})}const k6={additions:0,modifications:0,deletions:0};function dw(e){const t=CE(e!=null?e:"",{enabled:!!e}),a=t.data,s=A.useMemo(()=>{var r,c,o,u,h,m,g,p,v,b,_,S,w,C,R,j;return a?{id:(c=(r=a.id)!=null?r:e)!=null?c:"",name:(u=(o=a.name)!=null?o:a.id)!=null?u:"",status:(h=a.status)!=null?h:"unknown",created:(m=a.created)!=null?m:"",modified:(g=a.modified)!=null?g:"",baseSnapshot:(p=a.baseSnapshot)!=null?p:"",stats:{additions:(b=(v=a.stats)==null?void 0:v.additions)!=null?b:0,modifications:(S=(_=a.stats)==null?void 0:_.modifications)!=null?S:0,deletions:(C=(w=a.stats)==null?void 0:w.deletions)!=null?C:0},rows:w6(a.changes),changesCount:(j=(R=a.changes)==null?void 0:R.length)!=null?j:0}:null},[a,e]);return K(T({},t),{detail:s,emptyStats:k6})}const E6=[{id:"model",label:"Model",icon:"graph"},{id:"spec",label:"Schema",icon:"schema"},{id:"changesets",label:"Changesets",icon:"clock"}];function fw({open:e}){return f.jsx("span",{style:{position:"absolute",right:12,top:0,bottom:0,display:"flex",alignItems:"center",pointerEvents:"none"},children:f.jsx("span",{className:`drv-chev${e?" drv-chev--open":""}`})})}function R6({section:e}){const t=je(u=>u.view),a=je(u=>u.expandedSections),s=je(u=>u.toggleSection),{derived:r}=Ko(),c=a.has(e.id),o=e.id==="changesets"?r.list.length:12;return f.jsxs("div",{style:{position:"relative"},children:[f.jsx(Io,{icon:e.icon,label:e.label,count:o,active:t===e.id,depth:0,onClick:()=>s(e.id)}),f.jsx(fw,{open:c})]})}function T6({sectionId:e,slug:t}){var C,R,j;const a=je(k=>k.view),s=je(k=>k.layerId),r=je(k=>k.selectedId),c=je(k=>k.expandedLayers),o=je(k=>k.toggleLayer),u=je(k=>k.selectNode),{derived:h}=ns(),{derived:m}=Qs(),g=`${e}:${t}`,p=c.has(g),v=a===e&&s===t,b=m.byLayer[t],_=(C=h.nodesByLayer[t])!=null?C:[],S=e==="spec"?(R=b==null?void 0:b.typeCount)!=null?R:0:_.length,w=e==="spec"?((j=b==null?void 0:b.typeIds)!=null?j:[]).map((k,I)=>{var O;return{id:`${t}.${k}`,label:(O=b==null?void 0:b.typeTitles[I])!=null?O:k}}):_.map(k=>({id:k.id,label:k.name}));return f.jsxs(f.Fragment,{children:[f.jsxs("div",{style:{position:"relative"},children:[f.jsx(Io,{label:Wi(t),count:S,active:v,depth:1,onClick:()=>o(e,t)}),f.jsx(fw,{open:p})]}),p&&w.map(k=>{const I=a===e&&s===t&&r===k.id;return f.jsx("div",{style:{position:"relative"},children:f.jsx(Io,{label:k.label,active:I,depth:1,className:"drv-nav-l2",onClick:()=>u(k.id),title:k.label})},k.id)})]})}function M6(){const e=je(r=>r.view),t=je(r=>r.changesetId),a=je(r=>r.selectChangeset),{derived:s}=Ko();return s.list.length===0?f.jsx("div",{style:{padding:"8px 10px 8px 34px",fontFamily:"'JetBrains Mono',monospace",fontSize:11,color:"rgb(var(--shell-fg-4))"},children:"no changesets"}):f.jsx(f.Fragment,{children:s.list.map(r=>{const c=e==="changesets"&&t===r.id;return f.jsx("div",{style:{position:"relative"},children:f.jsx(Io,{label:r.name,count:r.changesCount,active:c,depth:1,onClick:()=>a(r.id),title:r.name})},r.id)})})}function A6(){const e=je(t=>t.expandedSections);return f.jsx("div",{className:"drv-scroll drv-noscroll",style:{flex:1,overflowY:"auto",padding:"8px"},"data-testid":"nav-tree",children:E6.map(t=>{const a=e.has(t.id);return f.jsxs("div",{children:[f.jsx(R6,{section:t}),a&&t.id==="changesets"&&f.jsx(M6,{}),a&&t.id!=="changesets"&&ow.map(s=>f.jsx(T6,{sectionId:t.id,slug:s},s))]},t.id)})})}function L6(){const{derived:e}=ns(),{derived:t}=Qs(),a=e.relCount,s=t.version||"—";return f.jsxs("div",{style:{width:244,flex:"none",background:"rgb(var(--shell-bg-2))",borderRight:"1px solid rgb(var(--shell-border))",display:"flex",flexDirection:"column",minHeight:0},"data-testid":"left-rail",children:[f.jsxs("div",{style:{height:40,flex:"none",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 14px",borderBottom:"1px solid rgb(var(--shell-border))"},children:[f.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:10,letterSpacing:"0.1em",textTransform:"uppercase",color:"rgb(var(--shell-fg-3))"},children:"Navigation"}),f.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:10,color:"rgb(var(--shell-fg-4))"},"data-testid":"rail-count"})]}),f.jsx(A6,{}),f.jsxs("div",{style:{flex:"none",padding:"10px 14px",borderTop:"1px solid rgb(var(--shell-border))",display:"flex",flexDirection:"column",gap:3},"data-testid":"rail-footer",children:[f.jsxs("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:10,letterSpacing:"0.08em",color:"rgb(var(--shell-fg-3))"},children:["SPEC ",s]}),f.jsxs("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:10,color:"rgb(var(--shell-fg-4))"},children:["12 layers · ",a," rels"]})]})]})}const lp={fontFamily:"'JetBrains Mono',monospace",fontSize:11,color:"rgb(var(--shell-fg-3))"},sx=K(T({},lp),{color:"rgb(var(--shell-fg-4))"});function D6(){var u;const e=je(h=>h.layerId),{derived:t}=ns(),{derived:a}=Qs(),s=e&&(u=t.countsByLayer[e])!=null?u:0,r=e?Wi(e).toLowerCase():"",c=e?`${s} ${r} elements`:`${t.nodes.length} elements`,o=a.version||"—";return f.jsx(Lp,{style:{height:28},"data-testid":"status-bar",left:f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:14},children:[f.jsx("span",{style:lp,"data-testid":"status-elements",children:c}),f.jsx("span",{style:sx,children:"·"}),f.jsxs("span",{style:lp,children:[t.relCount," refs indexed · 0 unresolved"]})]}),right:f.jsxs("span",{style:sx,children:["cli ",o," · refs ok"]})})}function O6(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/\./g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function yd(e){return`${e.layer_id}.${e.type}.${O6(e.name)}`}function vd(e){const t=new Map,a=new Map;for(const s of e.nodes)a.set(s.id,s),t.set(s.id,s),t.set(yd(s),s);return{byEndpoint:t,byUuid:a}}function ja(e,t){return e.byEndpoint.get(t)}function z6(e,t){var s;return((s=e.nodesByLayer[t])!=null?s:[]).map(r=>({id:r.id,label:r.name,kind:r.type,domainColor:t}))}function I6(e,t,a){const s=[];for(const r of e.links){const c=ja(a,r.source),o=ja(a,r.target);!c||!o||c.layer_id!==t||o.layer_id!==t||s.push({id:r.id,sourceId:c.id,targetId:o.id,label:r.type})}return s}function ha(e,t){var s;return(s=e==null?void 0:e.schemas)==null?void 0:s[`${t}.json`]}function bd(e,t){const a=`${e}.`;if(t.startsWith(a))return t.slice(a.length);const s=t.lastIndexOf(".");return s>=0?t.slice(s+1):t}function rx(e,t,a){var c,o,u;const s=bd(t,a),r=ha(e,t);return(u=(o=(c=r==null?void 0:r.nodeSchemas)==null?void 0:c[s])==null?void 0:o.title)!=null?u:s}function U6(e,t){var c;const a=ha(e,t),s=(c=a==null?void 0:a.nodeSchemas)!=null?c:{};return Object.entries(s).map(([o,u])=>{var h;return{id:`${t}.${o}`,label:(h=u.title)!=null?h:o,kind:"spec node",domainColor:t}})}const B6={"many-to-many":"N:N","one-to-many":"1:N","many-to-one":"N:1","one-to-one":"1:1"};function op(e){var t;return e&&(t=B6[e])!=null?t:""}function F6(e,t){var c;const a=ha(e,t),s=(c=a==null?void 0:a.relationshipSchemas)!=null?c:{},r=[];for(const o of Object.values(s))o.source_layer!==t||o.destination_layer!==t||o.source_spec_node_id!==o.destination_spec_node_id&&r.push({id:o.id,sourceId:o.source_spec_node_id,targetId:o.destination_spec_node_id,label:o.predicate});return r}function hw(e,t){var c;const a=ha(e,t),s=(c=a==null?void 0:a.relationshipSchemas)!=null?c:{};let r=0;for(const o of Object.values(s))o.source_layer===t&&o.destination_layer===t&&(r+=1);return r}function H6(e,t,a){var u;const s=ha(e,t),r=(u=s==null?void 0:s.relationshipSchemas)!=null?u:{},c=[];let o=0;for(const h of Object.values(r)){const m=op(h.cardinality),g=m?`${h.predicate} ${m}`:h.predicate;h.source_spec_node_id===a?c.push({id:`out-${o++}-${h.id}`,target:h.destination_spec_node_id,targetTitle:rx(e,h.destination_layer,h.destination_spec_node_id),targetDomain:h.destination_layer,predicate:g,direction:"out"}):h.destination_spec_node_id===a&&c.push({id:`in-${o++}-${h.id}`,target:h.source_spec_node_id,targetTitle:rx(e,h.source_layer,h.source_spec_node_id),targetDomain:h.source_layer,predicate:g,direction:"in"})}return c}function cg(e){var r,c,o;const t=(r=e==null?void 0:e.properties)==null?void 0:r.attributes,a=new Set((c=t==null?void 0:t.required)!=null?c:[]),s=(o=t==null?void 0:t.properties)!=null?o:{};return Object.entries(s).map(([u,h])=>{var m;return{name:u,type:(m=h==null?void 0:h.type)!=null?m:"object",required:a.has(u)}})}function P6(e,t,a){var u,h;const s=ha(e,t),r=bd(t,a),c=(u=s==null?void 0:s.nodeSchemas)==null?void 0:u[r];if(!c)return null;const o={};for(const m of cg(c))o[m.name]=m.required?"required":"—";return{id:a,title:(h=c.title)!=null?h:r,kind:"SPEC NODE",domain:t,description:c.description,metadata:o}}function $6(e,t){var r;const a=ha(e,t),s=Object.keys((r=a==null?void 0:a.nodeSchemas)!=null?r:{})[0];return s?`${t}.${s}`:void 0}const ug=ka("application"),mw=ka("navigation"),pw="rgb(var(--status-emerald))",gw="rgb(var(--accent-primary))",yw="rgb(var(--accent-primary-deep))",cp="—";function Ji(e){return e==null||e===""?cp:String(e)}function Ye(e,t,a){return{text:Ji(e),kind:t,color:a}}function mt(e,t,a){return{key:e,value:Ji(t),prose:a}}function dg(e,t,a){return[{label:e==="spec"?"schema":"model",target:{kind:"section",view:e}},{label:t,target:{kind:"layer",view:e,layerId:t},current:a}]}const q6="minmax(0,1.1fr) minmax(0,1.5fr) 78px",V6="minmax(0,1.3fr) minmax(0,1fr) minmax(0,0.9fr) 96px",Y6="minmax(0,1fr) minmax(0,0.9fr) minmax(0,1.2fr)";function G6(e,t,a,s,r){var R,j,k,I,O,z;if(!pd(t))return null;const c=ha(r,t),o=c==null?void 0:c.layer,u=o==null?void 0:o.number,h=(j=(R=o==null?void 0:o.inspired_by)==null?void 0:R.standard)!=null?j:gd(t),m=(k=c==null?void 0:c.nodeSchemas)!=null?k:{},g=Object.keys(m).length,p=hw(r,t),v=(I=a.nodesByLayer[t])!=null?I:[],b=ka(t),_=Wi(t),S=Object.entries(m).map(([B,P])=>{var U;const M=v.filter(F=>F.type===B).length;return{target:{kind:"specNode",specNodeId:`${t}.${B}`,layerId:t},cells:[Ye((U=P.title)!=null?U:B,"name"),Ye(`${t}.${B}`,"dim"),Ye(M,"num")]}}),w=v.map(B=>{let P=0,M=0;for(const U of a.links){const F=ja(s,U.source);if(!F||F.id!==B.id)continue;const q=ja(s,U.target);q&&(q.layer_id===t?P+=1:M+=1)}return{target:{kind:"element",elementId:B.id,layerId:t},cells:[Ye(B.name,"name"),Ye(B.type,"mono"),Ye(fg(B),"dim"),Ye(`${P} · ${M}`,"num")]}}),C=[];for(const B of v)for(const P of a.links){const M=ja(s,P.source);if(!M||M.id!==B.id)continue;const U=ja(s,P.target);!U||U.layer_id===t||C.push({target:{kind:"element",elementId:U.id,layerId:U.layer_id},cells:[Ye(B.name,"name"),Ye(P.type,"dim"),Ye(`${U.layer_id}.${U.type}`,"mono",ka(U.layer_id))]})}return{eyebrow:`LAYER ${Ji(u)} · ${h}`,title:_,idChip:t,meta:`${g} node types · ${p} relationship schemas`,color:b,crumbs:dg(e,t,!0),description:`${_} is layer ${Ji(u)} of 12 in the federated model, inspired by ${h}. The spec defines ${g} node types and ${p} valid relationship schemas for this layer; the loaded model holds ${v.length} elements.`,stats:[{label:"NODE TYPES",value:g,color:b},{label:"RELATIONSHIPS",value:p,color:ug},{label:"ELEMENTS",value:v.length,color:pw},{label:"LAYER",value:`${Ji(u)} / 12`,color:gw}],factsTitle:"LAYER SPEC",facts:[mt("layer_id",t),mt("number",u),mt("name",_,!0),mt("description",o==null?void 0:o.description,!0),mt("inspired_by.standard",h),mt("inspired_by.version",(O=o==null?void 0:o.inspired_by)==null?void 0:O.version),mt("inspired_by.url",(z=o==null?void 0:o.inspired_by)==null?void 0:z.url),mt("spec source",`spec/dist/${t}.json`)],tables:[{title:"Spec node types",columns:["node type","spec_node_id","instances"],widths:q6,rows:S,emptyText:"No node types are published for this layer."},{title:"Elements in model",columns:["name","type","provenance","rels · xrefs"],widths:V6,rows:w,emptyText:"No elements of this layer in the loaded model."},{title:"Cross-layer references",columns:["from","predicate","to"],widths:Y6,rows:C,emptyText:"This layer emits no cross-layer references."}]}}const vw="minmax(0,1fr) minmax(0,0.8fr) 96px",K6="minmax(0,1fr) minmax(0,1.2fr) minmax(0,0.8fr) minmax(0,1fr) minmax(0,0.7fr) 62px",X6="minmax(0,1.2fr) minmax(0,1fr) minmax(0,1fr) minmax(0,0.8fr)",Q6="minmax(0,1fr) minmax(0,1.5fr) 96px";function Z6(e){var a,s,r;const t=[];for(const c of Object.values((a=e==null?void 0:e.schemas)!=null?a:{})){const o=c;(s=o==null?void 0:o.layer)!=null&&s.id&&t.push(...Object.values((r=o.relationshipSchemas)!=null?r:{}))}return t}function lx(e,t,a){var c,o,u;const s=bd(t,a),r=(o=(c=ha(e,t))==null?void 0:c.nodeSchemas)==null?void 0:o[s];return(u=r==null?void 0:r.title)!=null?u:s}function J6(e,t,a,s){var R,j,k,I,O,z,B,P,M,U,F,q;const r=ha(a,e),c=bd(e,t),o=(R=r==null?void 0:r.nodeSchemas)==null?void 0:R[c];if(!o)return null;const u=ka(e),h=(I=(k=(j=r==null?void 0:r.layer)==null?void 0:j.inspired_by)==null?void 0:k.standard)!=null?I:gd(e),m=cg(o),g=((O=s.nodesByLayer[e])!=null?O:[]).filter(H=>H.type===c),p=Z6(a),v=p.filter(H=>H.source_spec_node_id===t),b=p.filter(H=>H.destination_spec_node_id===t),_=m.map(H=>({cells:[Ye(H.name,"mono"),Ye(H.type,"dim"),Ye(H.required?"required":"optional","dim",H.required?yw:void 0)]})),S=v.map(H=>({target:{kind:"specNode",specNodeId:H.destination_spec_node_id,layerId:H.destination_layer},cells:[Ye(H.predicate,"mono"),Ye(lx(a,H.destination_layer,H.destination_spec_node_id),"name"),Ye(H.destination_layer,"dim",ka(H.destination_layer)),Ye(H.cardinality?op(H.cardinality)||H.cardinality:cp,"dim"),Ye(H.strength,"dim"),Ye(H.required?"yes":"no","num")]})),w=b.map(H=>({target:{kind:"specNode",specNodeId:H.source_spec_node_id,layerId:H.source_layer},cells:[Ye(lx(a,H.source_layer,H.source_spec_node_id),"name"),Ye(H.predicate,"mono"),Ye(H.cardinality?op(H.cardinality)||H.cardinality:cp,"dim"),Ye(H.strength,"dim")]})),C=g.map(H=>({target:{kind:"element",elementId:H.id,layerId:e},cells:[Ye(H.name,"name"),Ye(yd(H),"dim"),Ye(fg(H),"dim")]}));return{eyebrow:`SPEC NODE · ${h}`,title:(z=o.title)!=null?z:c,idChip:t,meta:`${m.length} attributes · ${g.length} instances`,color:u,crumbs:[...dg("spec",e,!1),{label:c,current:!0}],description:(B=o.description)!=null?B:"",stats:[{label:"ATTRIBUTES",value:m.length,color:u},{label:"OUTGOING TYPES",value:v.length,color:ug},{label:"INCOMING TYPES",value:b.length,color:mw},{label:"INSTANCES",value:g.length,color:pw}],factsTitle:"SPEC NODE",facts:[mt("spec_node_id",t),mt("layer_id",e),mt("type",c),mt("title",o.title,!0),mt("extends",(M=(P=o.allOf)==null?void 0:P[0])==null?void 0:M.$ref),mt("schema",o.$id),mt("inspired_by",(F=(U=r==null?void 0:r.layer)==null?void 0:U.inspired_by)!=null&&F.version?`${h} ${r.layer.inspired_by.version}`:h),mt("required",(q=o.required)==null?void 0:q.join(", "))],tables:[{title:"Attributes",columns:["attribute","type","constraint"],widths:vw,rows:_,emptyText:"No attribute schema is published for this node type."},{title:"Valid outgoing relationships",columns:["predicate","destination","layer","cardinality","strength","required"],widths:K6,rows:S,emptyText:"This node type declares no outgoing relationships."},{title:"Valid incoming relationships",columns:["source","predicate","cardinality","strength"],widths:X6,rows:w,emptyText:"No other node type declares a relationship into this one."},{title:"Instances in model",columns:["name","path","provenance"],widths:Q6,rows:C,emptyText:"No instances of this node type in the loaded model."}]}}const W6="minmax(0,1fr) minmax(0,1.5fr) 88px",e5="minmax(0,1fr) minmax(0,1.3fr) minmax(0,0.8fr) minmax(0,1.4fr)",t5="minmax(0,1.3fr) minmax(0,1fr) minmax(0,1fr) minmax(0,0.8fr)";function fg(e){var a;const t=e.source_reference;return(a=t==null?void 0:t.provenance)!=null?a:"authored"}function n5(e){var a,s;const t=e.source_reference;return(s=(a=t==null?void 0:t.locations)==null?void 0:a.find(r=>r.symbol||r.file))!=null?s:{}}function a5(e,t,a,s,r){var k,I,O,z,B;const c=s.byUuid.get(t);if(!c||c.layer_id!==e)return null;const o=ka(e),u=Wi(e),h=ha(r,e),m=(k=h==null?void 0:h.nodeSchemas)==null?void 0:k[c.type],g=cg(m),p=[],v=[];for(const P of a.links){const M=ja(s,P.source),U=ja(s,P.target);if(!(!M||!U))if(M.id===c.id){const F=`${Ji(M.spec_node_id)}.${P.type}.${Ji(U.spec_node_id)}`;p.push({target:{kind:"element",elementId:U.id,layerId:U.layer_id},cells:[Ye(P.type,"mono"),Ye(U.name,"name"),Ye(U.layer_id,"dim",ka(U.layer_id)),Ye(F,"dim")]})}else U.id===c.id&&v.push({target:{kind:"element",elementId:M.id,layerId:M.layer_id},cells:[Ye(M.name,"name"),Ye(P.type,"mono"),Ye(M.type,"dim"),Ye(M.layer_id,"dim",ka(M.layer_id))]})}const b=p.filter(P=>{var M;return((M=P.target)==null?void 0:M.kind)==="element"&&P.target.layerId===e}).length,_=p.length-b,S=[{target:{kind:"specNode",specNodeId:`${e}.${c.type}`,layerId:e},cells:[Ye((I=m==null?void 0:m.title)!=null?I:c.type,"name"),Ye(`${e}.${c.type}`,"dim"),Ye(`${g.length} attrs`,"num")]}],w=g.map(P=>({cells:[Ye(P.name,"mono"),Ye(P.type,"dim"),Ye(P.required?"required":"optional","dim",P.required?yw:void 0)]})),C=yd(c),R=n5(c),j=(O=c.metadata)!=null?O:{};return{eyebrow:`ELEMENT · ${u}`,title:c.name,idChip:c.id,meta:`${p.length} outgoing · ${v.length} incoming`,color:o,crumbs:[...dg("model",e,!1),{label:c.id,current:!0}],description:(z=c.description)!=null?z:"",stats:[{label:"INTRA-LAYER",value:b,color:o},{label:"CROSS-LAYER",value:_,color:ug},{label:"INCOMING",value:v.length,color:mw},{label:"VERSION",value:Ji(j.version),color:gw}],factsTitle:"NODE",facts:[mt("path",C),mt("id",c.id),mt("spec_node_id",(B=c.spec_node_id)!=null?B:`${e}.${c.type}`),mt("type",c.type),mt("layer_id",e),mt("name",c.name,!0),mt("source_reference.provenance",fg(c)),mt("source_reference.file",R.file),mt("source_reference.symbol",R.symbol),mt("metadata.created_at",j.created_at),mt("metadata.updated_at",j.updated_at),mt("metadata.created_by",j.created_by),mt("metadata.version",j.version)],tables:[{title:"Conforms to",columns:["spec node","spec_node_id","attributes"],widths:W6,rows:S,emptyText:"No spec node type resolved for this element."},{title:"Attributes",columns:["attribute","type","constraint"],widths:vw,rows:w,emptyText:"No attribute schema is published for this node type."},{title:"Outgoing relationships",columns:["predicate","target","layer","spec_relationship_id"],widths:e5,rows:p,emptyText:"This element has no outgoing relationships."},{title:"Incoming relationships",columns:["source","predicate","type","layer"],widths:t5,rows:v,emptyText:"No other element references this one."}]}}const fa="'JetBrains Mono',monospace";function i5(){const e=je(u=>u.view),t=je(u=>u.layerId),a=je(u=>u.selectedId),s=je(u=>u.focus),{derived:r}=ns(),{raw:c}=Qs(),o=A.useMemo(()=>vd(r),[r]);return A.useMemo(()=>!t||e==="changesets"?null:s==="layer"?G6(e,t,r,o,c):a?e==="spec"?J6(t,a,c,r):a5(t,a,r,o,c):null,[e,t,a,s,r,o,c])}function s5(){const e=je(r=>r.setView),t=je(r=>r.selectLayer),a=je(r=>r.navigateToElement),s=je(r=>r.navigateToSpecNode);return r=>{if(r)switch(r.kind){case"section":e(r.view);return;case"layer":e(r.view),t(r.layerId);return;case"element":a(r.elementId,r.layerId);return;case"specNode":s(r.specNodeId,r.layerId);return;default:return r}}}const r5={name:{fontSize:13,color:"rgb(var(--canvas-fg-1))",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},mono:{fontFamily:fa,fontSize:11,color:"rgb(var(--canvas-fg-2))",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},dim:{fontFamily:fa,fontSize:11,color:"rgb(var(--canvas-fg-3))",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},num:{fontFamily:fa,fontSize:11,color:"rgb(var(--canvas-fg-2))",textAlign:"right"}};function l5({cell:e}){return f.jsx("span",{role:"cell",style:T(T({},r5[e.kind]),e.color?{color:e.color}:null),children:e.text})}function o5({pg:e,onNavigate:t}){const a={fontFamily:fa,fontSize:11};return f.jsx("nav",{"aria-label":"Breadcrumb",style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:e.crumbs.map((s,r)=>f.jsxs("span",{style:{display:"contents"},children:[r>0&&f.jsx("span",{style:K(T({},a),{color:"rgb(var(--canvas-fg-4))"}),"aria-hidden":"true",children:"/"}),s.target?f.jsx("button",{type:"button",className:`drv-crumb${s.current?" drv-crumb--current":""}`,onClick:()=>t(s.target),"data-testid":"page-crumb",style:T({background:"none",border:"none",padding:0},a),children:s.label}):f.jsx("span",{style:K(T({},a),{color:s.current?"rgb(var(--canvas-fg-1))":"rgb(var(--canvas-fg-3))"}),children:s.label})]},`${s.label}-${r}`))})}function c5({pg:e}){return f.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4,minmax(0,1fr))",gap:14},children:e.stats.map(t=>f.jsxs("div",{style:{padding:"12px 14px",background:"rgb(var(--canvas-card))",border:"1px solid rgb(var(--canvas-border))",borderLeft:`2px solid ${t.color}`,borderRadius:8},children:[f.jsx("div",{style:{fontFamily:fa,fontSize:10,letterSpacing:"0.1em",textTransform:"uppercase",color:"rgb(var(--canvas-fg-3))"},children:t.label}),f.jsx("div",{style:{fontSize:28,fontWeight:700,letterSpacing:"-0.02em",color:"rgb(var(--canvas-fg-1))",marginTop:4},children:t.value})]},t.label))})}function u5({pg:e}){return f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[f.jsx("span",{style:{fontFamily:fa,fontSize:10,letterSpacing:"0.1em",textTransform:"uppercase",color:"rgb(var(--canvas-fg-3))"},children:e.factsTitle}),f.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(2,minmax(0,1fr))",gap:"1px 32px"},children:e.facts.map(t=>f.jsxs("div",{style:{display:"grid",gridTemplateColumns:"minmax(0,150px) minmax(0,1fr)",gap:12,padding:"7px 0",borderBottom:"1px solid rgb(var(--canvas-border))"},children:[f.jsx("span",{style:{fontFamily:fa,fontSize:11,lineHeight:1.45,color:"rgb(var(--canvas-fg-3))",minWidth:0,overflowWrap:"anywhere",wordBreak:"break-word"},children:t.key}),f.jsx("span",{style:t.prose?{fontSize:12,color:"rgb(var(--canvas-fg-1))",overflowWrap:"anywhere"}:{fontFamily:fa,fontSize:11,color:"rgb(var(--canvas-fg-1))",overflowWrap:"anywhere"},children:t.value})]},t.key))})]})}const ox={display:"grid",gap:14,alignItems:"center",padding:"9px 10px",borderBottom:"1px solid rgb(var(--canvas-border))",borderRadius:4};function d5({row:e,widths:t,onNavigate:a}){const s=e.cells.map((r,c)=>f.jsx(l5,{cell:r},c));return e.target?f.jsx("button",{type:"button",role:"row",className:"drv-row",onClick:()=>a(e.target),"data-testid":"page-row",style:K(T({},ox),{gridTemplateColumns:t,width:"100%",border:"none",borderBottom:"1px solid rgb(var(--canvas-border))",textAlign:"left",font:"inherit"}),children:s}):f.jsx("div",{role:"row",style:K(T({},ox),{gridTemplateColumns:t}),children:s})}function f5({pg:e,onNavigate:t}){return f.jsx(f.Fragment,{children:e.tables.map(a=>f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[f.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:8},children:[f.jsx("span",{style:{fontFamily:fa,fontSize:10,letterSpacing:"0.1em",textTransform:"uppercase",color:"rgb(var(--canvas-fg-3))"},children:a.title}),f.jsx("span",{style:{fontFamily:fa,fontSize:10,color:"rgb(var(--canvas-fg-3))"},children:a.rows.length?a.rows.length:""})]}),a.rows.length===0?f.jsx("span",{style:{fontSize:13,color:"rgb(var(--canvas-fg-3))"},children:a.emptyText}):f.jsxs("div",{role:"table","aria-label":a.title,children:[f.jsx("div",{role:"row",style:{display:"grid",gridTemplateColumns:a.widths,gap:14,alignItems:"center",padding:"0 10px 7px",fontFamily:fa,fontSize:10,letterSpacing:"0.08em",textTransform:"uppercase",color:"rgb(var(--canvas-fg-3))",borderBottom:"1px solid rgb(var(--canvas-border))"},children:a.columns.map(s=>f.jsx("span",{role:"columnheader",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s},s))}),a.rows.map((s,r)=>f.jsx(d5,{row:s,widths:a.widths,onNavigate:t},r))]})]},a.title))})}function h5({pg:e}){const t=s5();return f.jsx("div",{className:"drv-scroll",style:{position:"absolute",inset:0,overflowY:"auto",padding:"2px 22px 44px"},"data-testid":"page-view",children:f.jsxs("div",{style:{maxWidth:1040,display:"flex",flexDirection:"column",gap:28},children:[f.jsx(o5,{pg:e,onNavigate:t}),f.jsx("p",{style:{fontSize:14,lineHeight:1.6,color:"rgb(var(--canvas-fg-2))",margin:0,maxWidth:760,textWrap:"pretty"},children:e.description}),f.jsx(c5,{pg:e}),f.jsx(u5,{pg:e}),f.jsx(f5,{pg:e,onNavigate:t})]})})}const m5=[{value:"graph",label:"graph"},{value:"page",label:"page"}];function Cu({message:e}){return f.jsx("div",{style:{flex:1,display:"grid",placeItems:"center",color:"rgb(var(--canvas-fg-3))",fontFamily:"'JetBrains Mono',monospace",fontSize:12},"data-testid":"canvas-empty",children:e})}function p5(){var U;const e=je(F=>F.view),t=je(F=>F.layerId),a=je(F=>F.selectedId),s=je(F=>F.selectGraphNode),r=je(F=>F.mode),c=je(F=>F.setMode),o=i5(),u=r==="page",{derived:h}=ns(),{derived:m,raw:g}=Qs(),p=e==="spec",v=A.useMemo(()=>vd(h),[h]),b=A.useMemo(()=>t?p?U6(g,t):z6(h,t):[],[p,g,h,t]),_=A.useMemo(()=>t?p?F6(g,t):I6(h,t,v):[],[p,g,h,t,v]),S=t!=null?t:"",w=((U=m.byLayer[S])==null?void 0:U.standard)||gd(S),C=p?`META-MODEL${w?` · ${w}`:""}`:`INSTANCE MODEL${w?` · ${w}`:""}`,R=t?p?`${Wi(S)} schema`:Wi(S):p?"Schema":"Model",j=A.useMemo(()=>{var F,q,H;if(!t)return"";if(p){const Y=(q=(F=m.byLayer[S])==null?void 0:F.typeCount)!=null?q:0,$=hw(g,S);return`${Y} node types · ${$} relationships`}return`${(H=h.countsByLayer[S])!=null?H:0} elements`},[p,t,S,m,g,h]),k=p?"select a layer to view its schema":"select a layer to view its instance model",I=p?"no node types in this layer":"no elements in this layer",O=u&&o?o.color:ka(S),z=u&&o?o.eyebrow:C,B=u&&o?o.title:R,P=u&&o?o.idChip:t!=null?t:e,M=u&&o?o.meta:j;return f.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",minWidth:0,background:"rgb(var(--canvas-bg))",borderTopLeftRadius:8,overflow:"hidden"},"data-testid":"canvas",children:[f.jsx(Ip,{style:{flex:"none",padding:"16px 22px 14px"},eyebrow:f.jsxs(f.Fragment,{children:[f.jsx("span",{style:{width:10,height:10,borderRadius:3,flex:"none",background:O,display:"inline-block"}}),f.jsx("span",{children:z})]}),title:B,idChip:P,actions:f.jsxs(f.Fragment,{children:[f.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:11,color:"rgb(var(--canvas-fg-3))"},children:M}),f.jsx(rd,{value:r,onChange:F=>c(F),options:m5,"data-testid":"canvas-mode-toggle"})]})}),f.jsx("div",{style:{flex:1,position:"relative",minHeight:0},children:u?t?o?f.jsx(h5,{pg:o}):f.jsx(Cu,{message:"select a node to view its page"}):f.jsx(Cu,{message:k}):t?b.length===0?f.jsx(Cu,{message:I}):f.jsx(WS,{nodes:b,edges:_,selectedNodeId:a!=null?a:void 0,onNodeSelect:F=>s(F),layout:"force",style:{position:"absolute",inset:0,width:"100%",height:"100%"}},`${e}:${t}`):f.jsx(Cu,{message:k})})]})}const bw="You",g5=/^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$/;function y5(e){return g5.test(e)}function xd(e){return["annotations",e!=null?e:""]}function xw(e){return["annotation-replies",e]}function v5(e){return fl({queryKey:xd(e),enabled:!!e,queryFn:()=>Ue(null,null,function*(){var a;return(a=(yield Ks().getapiannotations({elementId:e})).annotations)!=null?a:[]})})}function b5(e,t=!0){return fl({queryKey:xw(e),enabled:t,queryFn:()=>Ue(null,null,function*(){var s;return(s=(yield Ks().getapiannotationsannotationIdreplies(e)).replies)!=null?s:[]})})}function x5(){const e=dl();return nd({mutationFn:t=>{var a,s;return Ks().postapiannotations({elementId:t.elementId,author:(a=t.author)!=null?a:bw,content:t.content,tags:(s=t.tags)!=null?s:[]})},onSuccess:(t,a)=>{e.invalidateQueries({queryKey:xd(a.elementId)})}})}function _5(){const e=dl();return nd({mutationFn:t=>{const a={};return t.content!==void 0&&(a.content=t.content),t.tags!==void 0&&(a.tags=t.tags),t.resolved!==void 0&&(a.resolved=t.resolved),Ks().patchapiannotationsannotationId(t.id,a)},onSuccess:(t,a)=>{e.invalidateQueries({queryKey:xd(a.elementId)})}})}function S5(){const e=dl();return nd({mutationFn:t=>Ks().deleteapiannotationsannotationId(t.id),onSuccess:(t,a)=>{e.invalidateQueries({queryKey:xd(a.elementId)})}})}function w5(){const e=dl();return nd({mutationFn:t=>{var a;return Ks().postapiannotationsannotationIdreplies(t.annotationId,{author:(a=t.author)!=null?a:bw,content:t.content})},onSuccess:(t,a)=>{e.invalidateQueries({queryKey:xw(a.annotationId)})}})}function _w(e){const t=new Date(e).getTime();if(Number.isNaN(t))return e;const a=Date.now()-t,s=Math.round(a/1e3);if(s<45)return"just now";const r=Math.round(s/60);if(r<60)return`${r}m ago`;const c=Math.round(r/60);if(c<24)return`${c}h ago`;const o=Math.round(c/24);if(o<30)return`${o}d ago`;const u=Math.round(o/30);return u<12?`${u}mo ago`:`${Math.round(u/12)}y ago`}function C5(e){const t=new Set;for(const a of e.split(/[\s,]+/)){const s=a.trim().toLowerCase();s&&t.add(s)}return[...t]}const N5={display:"block",fontFamily:"'JetBrains Mono', monospace",fontSize:10.5,letterSpacing:"0.08em",textTransform:"uppercase",color:"rgb(var(--canvas-fg-3))",fontWeight:500},Ps={fontFamily:"'JetBrains Mono', monospace",fontSize:10.5,color:"rgb(var(--canvas-fg-3))"},j5={background:"rgb(var(--canvas-card))",border:"1px solid rgb(var(--canvas-border))",borderRadius:8,padding:"10px 12px"};function k5({elementId:e,notify:t}){const[a,s]=A.useState(""),[r,c]=A.useState(""),o=x5(),u=a.trim(),h=A.useMemo(()=>C5(r),[r]),m=h.filter(v=>!y5(v)),g=u.length>=1&&u.length<=5e3&&m.length===0&&!o.isPending,p=()=>{g&&o.mutate({elementId:e,content:u,tags:h},{onSuccess:()=>{s(""),c(""),t("success","Annotation added")},onError:()=>t("error","Failed to add annotation")})};return f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[f.jsx(Tp,{value:a,onChange:v=>s(v.target.value),placeholder:"Add an annotation…",rows:3,"aria-label":"New annotation content","data-testid":"annotation-add-content"}),f.jsx(Oo,{mono:!0,value:r,onChange:v=>c(v.target.value),placeholder:"tags (space or comma separated)",error:m.length>0,"aria-label":"New annotation tags","data-testid":"annotation-add-tags"}),m.length>0&&f.jsxs("span",{style:K(T({},Ps),{color:"rgb(var(--status-rose))"}),children:["invalid tag",m.length>1?"s":"",": ",m.join(", ")]}),f.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:f.jsx(rn,{variant:"accent",size:"sm",disabled:!g,onClick:p,"data-testid":"annotation-add-submit",children:o.isPending?"Adding…":"Add"})})]})}function E5({annotationId:e,expanded:t,notify:a}){const{data:s=[],isLoading:r}=b5(e,t),c=w5(),[o,u]=A.useState(""),h=o.trim(),m=h.length>=1&&h.length<=5e3&&!c.isPending,g=()=>{m&&c.mutate({annotationId:e,content:h},{onSuccess:()=>{u(""),a("success","Reply added")},onError:()=>a("error","Failed to add reply")})};return f.jsxs("div",{style:{marginTop:8,paddingLeft:12,borderLeft:"2px solid rgb(var(--canvas-border))",display:"flex",flexDirection:"column",gap:8},"data-testid":"annotation-replies",children:[r&&s.length===0?f.jsx("span",{style:Ps,children:"loading replies…"}):s.map(p=>f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[f.jsx("span",{style:{fontSize:12,fontWeight:600,color:"rgb(var(--canvas-fg-1))"},children:p.author}),f.jsx("span",{style:Ps,title:p.createdAt,children:_w(p.createdAt)})]}),f.jsx("p",{style:{margin:0,fontSize:12.5,lineHeight:1.5,color:"rgb(var(--canvas-fg-2))",whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:p.content})]},p.id)),f.jsxs("div",{style:{display:"flex",gap:6,alignItems:"flex-start"},children:[f.jsx(Oo,{value:o,onChange:p=>u(p.target.value),placeholder:"Reply…","aria-label":"Reply content","data-testid":"annotation-reply-input",style:{flex:1},onKeyDown:p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),g())}}),f.jsx(rn,{variant:"secondary",size:"sm",disabled:!m,onClick:g,"data-testid":"annotation-reply-submit",children:"Reply"})]})]})}function R5({annotation:e,elementId:t,notify:a}){const s=_5(),r=S5(),[c,o]=A.useState(!1),[u,h]=A.useState(e.content),[m,g]=A.useState(!1),[p,v]=A.useState(!1),b=u.trim(),_=b.length>=1&&b.length<=5e3&&b!==e.content&&!s.isPending,S=()=>{_&&s.mutate({id:e.id,elementId:t,content:b},{onSuccess:()=>{o(!1),a("success","Annotation updated")},onError:()=>a("error","Failed to update annotation")})},w=()=>{s.mutate({id:e.id,elementId:t,resolved:!e.resolved},{onSuccess:()=>a("success",e.resolved?"Reopened":"Resolved"),onError:()=>a("error","Failed to update annotation")})},C=()=>{r.mutate({id:e.id,elementId:t},{onSuccess:()=>{g(!1),a("success","Annotation deleted")},onError:()=>{g(!1),a("error","Failed to delete annotation")}})},R=j=>{j==="edit"?(h(e.content),o(!0)):j==="resolve"?w():j==="delete"&&g(!0)};return f.jsxs("div",{style:j5,"data-testid":"annotation-item","data-resolved":e.resolved,children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[f.jsx("span",{style:{fontSize:12.5,fontWeight:600,color:"rgb(var(--canvas-fg-1))"},children:e.author}),f.jsx("span",{style:Ps,title:e.createdAt,children:_w(e.createdAt)}),e.resolved&&f.jsx(Nn,{variant:"emerald","data-testid":"annotation-resolved-chip",children:"resolved"}),f.jsx("div",{style:{marginLeft:"auto"},children:f.jsx(VS,{placement:"bottom-end",triggerLabel:"Annotation actions",actions:[{id:"edit",label:"Edit",icon:"edit"},{id:"resolve",label:e.resolved?"Reopen":"Resolve",icon:"check"},{type:"separator"},{id:"delete",label:"Delete",icon:"trash",danger:!0}],onAction:R})})]}),c?f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[f.jsx(Tp,{value:u,onChange:j=>h(j.target.value),rows:3,"aria-label":"Edit annotation content","data-testid":"annotation-edit-content",autoFocus:!0}),f.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:6},children:[f.jsx(rn,{variant:"ghost",size:"sm",onClick:()=>o(!1),"data-testid":"annotation-edit-cancel",children:"Cancel"}),f.jsx(rn,{variant:"accent",size:"sm",disabled:!_,onClick:S,"data-testid":"annotation-edit-save",children:s.isPending?"Saving…":"Save"})]})]}):f.jsx("p",{style:{margin:0,fontSize:13,lineHeight:1.55,color:"rgb(var(--canvas-fg-2))",whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:e.content}),e.tags.length>0&&f.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginTop:8},"data-testid":"annotation-tags",children:e.tags.map(j=>f.jsx(Nn,{form:"id-tag",children:j},j))}),f.jsx("div",{style:{marginTop:8},children:f.jsx(rn,{variant:"ghost",size:"sm",onClick:()=>v(j=>!j),"aria-expanded":p,"data-testid":"annotation-replies-toggle",children:p?"Hide replies":"Replies"})}),p&&f.jsx(E5,{annotationId:e.id,expanded:p,notify:a}),f.jsx(m_,{isOpen:m,onClose:()=>g(!1),onConfirm:C,title:"Delete annotation",message:"This permanently removes the annotation and its replies. Continue?",confirmLabel:r.isPending?"Deleting…":"Delete",variant:"danger"})]})}function T5({elementId:e}){const{data:t=[],isLoading:a,isError:s}=v5(e),[r,c]=A.useState({open:!1,variant:"success",title:""}),o=(u,h)=>c({open:!0,variant:u,title:h});return f.jsxs("section",{style:{padding:"16px",borderTop:"1px solid rgb(var(--canvas-border))",display:"flex",flexDirection:"column",gap:12},"data-testid":"annotations-section",children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[f.jsx("span",{style:N5,children:"Annotations"}),f.jsxs("span",{style:Ps,"data-testid":"annotations-count",children:["· ",t.length]})]}),f.jsx(k5,{elementId:e,notify:o}),a?f.jsx("span",{style:Ps,children:"loading…"}):s?f.jsx("span",{style:K(T({},Ps),{color:"rgb(var(--status-rose))"}),children:"failed to load annotations"}):t.length===0?f.jsx("span",{style:{fontSize:12.5,color:"rgb(var(--canvas-fg-3))"},"data-testid":"annotations-empty",children:"No annotations yet"}):f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:t.map(u=>f.jsx(R5,{annotation:u,elementId:e,notify:o},u.id))}),f.jsx(y_,{isOpen:r.open,onClose:()=>c(u=>K(T({},u),{open:!1})),variant:r.variant,title:r.title})]})}function M5(e,t,a){if(!a.byUuid.get(t))return[];const r=[];let c=0;for(const o of e.links){const u=ja(a,o.source),h=ja(a,o.target);!u||!h||(u.id===t?r.push({id:`out-${c++}-${o.id}`,target:h.id,targetTitle:h.name,targetDomain:h.layer_id,predicate:o.type,direction:"out"}):h.id===t&&r.push({id:`in-${c++}-${o.id}`,target:u.id,targetTitle:u.name,targetDomain:u.layer_id,predicate:o.type,direction:"in"}))}return r}function A5(e){var t;return(t=e==null?void 0:e.provenance)!=null?t:"authored"}function L5(e){var a,s;const t=(a=e==null?void 0:e.locations)==null?void 0:a.find(r=>r.symbol||r.file);return(s=t==null?void 0:t.symbol)!=null?s:t==null?void 0:t.file}function D5(e,t){const a=e.source_reference,s={layer:t,type:e.type,provenance:A5(a)},r=L5(a);return r&&(s.source=r),{id:e.id,title:e.name,kind:e.type,domain:e.layer_id,description:e.description,metadata:s}}function O5(e){const t=e.lastIndexOf(".");return t>0?e.slice(0,t):e}function z5(){const e=je(R=>R.view),t=je(R=>R.layerId),a=je(R=>R.selectedId),s=je(R=>R.navigateToElement),r=je(R=>R.navigateToSpecNode),{derived:c}=ns(),{raw:o}=Qs(),u=A.useMemo(()=>vd(c),[c]),h=e==="spec",m=!h&&a?u.byUuid.get(a):void 0,g=A.useMemo(()=>m?D5(m,Wi(m.layer_id)):null,[m]),p=A.useMemo(()=>m?M5(c,m.id,u):[],[c,m,u]),v=A.useMemo(()=>h&&t&&a?P6(o,t,a):null,[h,o,t,a]),b=A.useMemo(()=>h&&t&&a?H6(o,t,a):[],[h,o,t,a]),_=h?v:g,S=h?b:p,w=R=>{if(h){r(R,O5(R));return}const j=u.byUuid.get(R);j&&s(j.id,j.layer_id)},C=m?yd(m):null;return f.jsx("div",{style:{width:320,flex:"none",borderLeft:"1px solid rgb(var(--canvas-border))",background:"rgb(var(--canvas-surface))",display:"flex",flexDirection:"column",minHeight:0},"data-testid":"inspector",children:f.jsxs("div",{className:"drv-scroll",style:{flex:1,minHeight:0,overflowY:"auto",display:"flex",flexDirection:"column"},children:[f.jsx(ew,{node:_,relationships:S,onNodeSelect:w,emptyStateText:h?"Select a node type to inspect.":"Select an element to inspect.",style:{flex:"none",border:"none",borderRadius:0}}),C&&f.jsx(T5,{elementId:C})]})})}function I5(e){return e==="staged"?"#FBBF24":"#10B981"}function cx({message:e}){return f.jsx("div",{style:{flex:1,display:"grid",placeItems:"center",color:"rgb(var(--canvas-fg-3))",fontFamily:"'JetBrains Mono',monospace",fontSize:12},"data-testid":"changeset-canvas-empty",children:e})}function U5({row:e}){const[t,a]=A.useState(!1),s=je(c=>c.canvasDark),r=t&&e.hasDiff?C6(e.raw):[];return f.jsxs("div",{style:{background:"rgb(var(--canvas-card))",border:"1px solid rgb(var(--canvas-border))",borderRadius:8,overflow:"hidden"},"data-testid":"changeset-row","data-op":e.op,children:[f.jsxs("div",{role:e.hasDiff?"button":void 0,tabIndex:e.hasDiff?0:void 0,onClick:e.hasDiff?()=>a(c=>!c):void 0,onKeyDown:e.hasDiff?c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),a(o=>!o))}:void 0,style:{display:"flex",alignItems:"flex-start",gap:12,padding:"12px 14px",cursor:e.hasDiff?"pointer":"default"},children:[f.jsx("span",{style:{flex:"none",fontFamily:"'JetBrains Mono',monospace",fontSize:10,letterSpacing:"0.05em",textTransform:"uppercase",padding:"3px 8px",borderRadius:4,width:42,textAlign:"center",background:e.meta.background,color:s?e.meta.color:e.meta.colorLight},"data-testid":"changeset-op-badge",children:e.meta.label}),f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:3,minWidth:0,flex:1},children:[f.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:12,color:"rgb(var(--canvas-fg-1))",wordBreak:"break-all"},children:e.elementId}),f.jsx("span",{style:{fontSize:12,color:"rgb(var(--canvas-fg-3))",lineHeight:1.45},children:e.detail})]}),e.layerName&&f.jsx("span",{style:{flex:"none",fontFamily:"'JetBrains Mono',monospace",fontSize:10,letterSpacing:"0.04em",textTransform:"uppercase",color:"rgb(var(--canvas-fg-3))",alignSelf:"center"},children:e.layerName})]}),t&&e.hasDiff&&f.jsx("div",{style:{borderTop:"1px solid rgb(var(--canvas-border))",padding:"10px 14px 14px"},children:r.length>0?f.jsx(Bp,{lines:r}):f.jsx("div",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:11,color:"rgb(var(--canvas-fg-3))"},children:"no field-level changes"})})]})}function B5(){var u,h,m,g,p,v;const e=je(b=>b.changesetId),{derived:t}=Ko(),{detail:a}=dw(e),s=t.list.find(b=>b.id===e),r=(h=(u=a==null?void 0:a.name)!=null?u:s==null?void 0:s.name)!=null?h:"",c=(g=(m=a==null?void 0:a.status)!=null?m:s==null?void 0:s.status)!=null?g:"unknown",o=(v=(p=a==null?void 0:a.changesCount)!=null?p:s==null?void 0:s.changesCount)!=null?v:0;return f.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",minWidth:0,background:"rgb(var(--canvas-bg))",borderTopLeftRadius:8,overflow:"hidden"},"data-testid":"canvas",children:[e&&f.jsx(Ip,{style:{flex:"none",padding:"16px 22px 14px"},eyebrow:f.jsxs(f.Fragment,{children:[f.jsx("span",{style:{width:10,height:10,borderRadius:3,flex:"none",background:I5(c),display:"inline-block"}}),f.jsx("span",{children:"CHANGESET"})]}),title:r,idChip:c,actions:f.jsxs("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:11,color:"rgb(var(--canvas-fg-3))"},children:[o," changes"]})}),f.jsx("div",{style:{flex:1,position:"relative",minHeight:0},children:e?a?f.jsxs("div",{className:"drv-scroll",style:{position:"absolute",inset:0,overflowY:"auto",padding:"20px 22px"},"data-testid":"changeset-list",children:[f.jsx("p",{style:{fontSize:13,color:"rgb(var(--canvas-fg-2))",margin:"0 0 18px 0",maxWidth:620,lineHeight:1.5},children:N6(a.name,a.stats)}),f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8,maxWidth:760},children:a.rows.map(b=>f.jsx(U5,{row:b},b.key))})]}):f.jsx(cx,{message:"loading changeset…"}):f.jsx(cx,{message:"select a changeset to view its changes"})})]})}function ux(e){return e==="staged"?{color:"amber",label:"STAGED"}:e==="discarded"?{color:"neutral",label:"DISCARDED"}:e==="committed"?{color:"emerald",label:"COMMITTED"}:{color:"neutral",label:e.toUpperCase()}}function dx(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function wm({label:e,value:t}){return f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:5},children:[f.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:10,letterSpacing:"0.08em",textTransform:"uppercase",color:"rgb(var(--canvas-fg-3))"},children:e}),f.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:12,color:"rgb(var(--canvas-fg-1))",wordBreak:"break-all"},children:t})]})}function F5(){const e=je(a=>a.changesetId),{detail:t}=dw(e);return f.jsx("div",{style:{width:320,flex:"none",borderLeft:"1px solid rgb(var(--canvas-border))",background:"rgb(var(--canvas-surface))",display:"flex",flexDirection:"column",minHeight:0},"data-testid":"inspector",children:!e||!t?f.jsx("div",{style:{flex:1,display:"grid",placeItems:"center",padding:24,textAlign:"center",color:"rgb(var(--canvas-fg-3))",fontFamily:"'JetBrains Mono',monospace",fontSize:12},"data-testid":"changeset-inspector-empty",children:e?"loading changeset…":"Select a changeset to inspect."}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{style:{flex:"none",padding:"16px 16px 14px",borderBottom:"1px solid rgb(var(--canvas-border))"},children:[f.jsx("div",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:10,letterSpacing:"0.1em",textTransform:"uppercase",color:"rgb(var(--canvas-fg-3))",marginBottom:6},children:"CHANGESET"}),f.jsx("div",{style:{fontSize:16,fontWeight:600,color:"rgb(var(--canvas-fg-1))",lineHeight:1.3},children:t.name}),f.jsxs("div",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:11,color:"rgb(var(--canvas-fg-3))",marginTop:4},children:[t.changesCount," changes"]})]}),f.jsxs("div",{className:"drv-scroll",style:{flex:1,minHeight:0,overflowY:"auto",padding:16,display:"flex",flexDirection:"column",gap:16},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[f.jsx(l_,{color:ux(t.status).color,"aria-label":t.status}),f.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:11,letterSpacing:"0.06em",color:"rgb(var(--canvas-fg-2))"},children:ux(t.status).label})]}),f.jsxs("div",{style:{display:"flex",gap:8},children:[f.jsx(Mu,{label:"Added",value:t.stats.additions,color:"emerald",style:{flex:1,padding:11}}),f.jsx(Mu,{label:"Modified",value:t.stats.modifications,color:"cyan",style:{flex:1,padding:11}}),f.jsx(Mu,{label:"Deleted",value:t.stats.deletions,color:"rose",style:{flex:1,padding:11}})]}),f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[f.jsx(wm,{label:"Created",value:dx(t.created)}),f.jsx(wm,{label:"Modified",value:dx(t.modified)}),t.baseSnapshot&&f.jsx(wm,{label:"Base Snapshot",value:t.baseSnapshot})]})]})]})})}class De extends Error{constructor(t,a,s){super(a),this.code=t,this.context=s,this.name="ChatValidationError"}}function Nu(e){if(typeof e!="string"||e.trim().length===0)throw new De("INVALID_MESSAGE_ID","Message ID must be a non-empty string",{id:e})}function Sw(e){if(!e||typeof e!="object")throw new De("INVALID_CONTENT","Content must be an object",{content:e});const t=e,a=t.type;if(typeof a!="string")throw new De("INVALID_CONTENT_TYPE","Content must have a type field that is a string",{type:a});if(typeof t.timestamp!="string")throw new De("MISSING_TIMESTAMP","Content must have a timestamp field",{timestamp:t.timestamp});switch(a){case"text":{if(typeof t.content!="string")throw new De("INVALID_TEXT_CONTENT","Text content must have a content field that is a string",{content:t.content});break}case"tool_invocation":{if(typeof t.toolUseId!="string"||t.toolUseId.length===0)throw new De("INVALID_TOOL_USE_ID","Tool invocation must have a non-empty toolUseId",{toolUseId:t.toolUseId});if(typeof t.toolName!="string")throw new De("INVALID_TOOL_NAME","Tool invocation must have a toolName field",{toolName:t.toolName});if(!t.toolInput||typeof t.toolInput!="object")throw new De("INVALID_TOOL_INPUT","Tool invocation must have a toolInput field",{toolInput:t.toolInput});if(!t.status||typeof t.status!="object")throw new De("INVALID_TOOL_STATUS","Tool invocation must have a status field",{status:t.status});break}case"thinking":{if(typeof t.content!="string")throw new De("INVALID_THINKING_CONTENT","Thinking content must have a content field that is a string",{content:t.content});break}case"usage":{if(typeof t.inputTokens!="number")throw new De("INVALID_USAGE","Usage content must have an inputTokens field that is a number",{inputTokens:t.inputTokens});if(typeof t.outputTokens!="number")throw new De("INVALID_USAGE","Usage content must have an outputTokens field that is a number",{outputTokens:t.outputTokens});if(typeof t.totalTokens!="number")throw new De("INVALID_USAGE","Usage content must have a totalTokens field that is a number",{totalTokens:t.totalTokens});if(typeof t.totalCostUsd!="number")throw new De("INVALID_USAGE","Usage content must have a totalCostUsd field that is a number",{totalCostUsd:t.totalCostUsd});break}case"error":{if(typeof t.code!="string")throw new De("INVALID_ERROR","Error content must have a code field that is a string",{code:t.code});if(typeof t.message!="string")throw new De("INVALID_ERROR","Error content must have a message field that is a string",{message:t.message});break}default:throw new De("UNKNOWN_CONTENT_TYPE",`Unknown content type: ${a}. Must be one of: text, tool_invocation, thinking, usage, error`,{type:a})}}function H5(e){if(!e||typeof e!="object")throw new De("INVALID_MESSAGE","Message must be an object",{message:e});const t=e;if(typeof t.id!="string"||t.id.length===0)throw new De("INVALID_MESSAGE_ID","Message must have a non-empty id field",{id:t.id});if(typeof t.role!="string")throw new De("INVALID_ROLE","Message must have a role field that is a string",{role:t.role});const a=["user","assistant","system"];if(!a.includes(t.role))throw new De("INVALID_ROLE_VALUE",`Role must be one of: ${a.join(", ")}`,{role:t.role});if(typeof t.conversationId!="string"||t.conversationId.length===0)throw new De("INVALID_CONVERSATION_ID","Message must have a non-empty conversationId field",{conversationId:t.conversationId});if(typeof t.timestamp!="string"||t.timestamp.length===0)throw new De("INVALID_TIMESTAMP","Message must have a non-empty timestamp field",{timestamp:t.timestamp});if(!Array.isArray(t.parts))throw new De("INVALID_PARTS","Message must have a parts field that is an array",{parts:t.parts});for(let s=0;s<t.parts.length;s++)try{Sw(t.parts[s])}catch(r){throw r instanceof De?new De(r.code,`Invalid content at parts[${s}]: ${r.message}`,K(T({},r.context),{partIndex:s})):r}if(t.isStreaming!==void 0&&typeof t.isStreaming!="boolean")throw new De("INVALID_STREAMING_FLAG","isStreaming must be a boolean",{isStreaming:t.isStreaming})}function P5(e){if(!e||typeof e!="object")throw new De("INVALID_SDK_STATUS","SDK status must be an object",{status:e});const t=e;if(typeof t.sdkAvailable!="boolean")throw new De("INVALID_SDK_AVAILABLE","sdkAvailable must be a boolean",{sdkAvailable:t.sdkAvailable});if(t.sdkVersion!==null&&typeof t.sdkVersion!="string")throw new De("INVALID_SDK_VERSION","sdkVersion must be a string or null",{sdkVersion:t.sdkVersion});if(t.errorMessage!==null&&typeof t.errorMessage!="string")throw new De("INVALID_ERROR_MESSAGE","errorMessage must be a string or null",{errorMessage:t.errorMessage})}function $5(e){if(e!==null&&(typeof e!="string"||e.length===0))throw new De("INVALID_CONVERSATION_ID","Conversation ID must be a non-empty string or null",{id:e})}function q5(e){if(e!==null&&typeof e!="string")throw new De("INVALID_ERROR_MESSAGE","Error message must be a string or null",{error:e})}function V5(e){if(!e||typeof e!="object")throw new De("INVALID_UPDATES","Updates must be an object",{updates:e});const t=e;if(t.id!==void 0&&(typeof t.id!="string"||t.id.length===0))throw new De("INVALID_ID_UPDATE","Updated id must be a non-empty string",{id:t.id});if(t.role!==void 0){const a=["user","assistant","system"];if(!a.includes(t.role))throw new De("INVALID_ROLE_UPDATE",`Updated role must be one of: ${a.join(", ")}`,{role:t.role})}if(t.conversationId!==void 0&&(typeof t.conversationId!="string"||t.conversationId.length===0))throw new De("INVALID_CONVERSATION_ID_UPDATE","Updated conversationId must be a non-empty string",{conversationId:t.conversationId});if(t.timestamp!==void 0&&typeof t.timestamp!="string")throw new De("INVALID_TIMESTAMP_UPDATE","Updated timestamp must be a string",{timestamp:t.timestamp});if(t.isStreaming!==void 0&&typeof t.isStreaming!="boolean")throw new De("INVALID_STREAMING_UPDATE","Updated isStreaming must be a boolean",{isStreaming:t.isStreaming});if(t.parts!==void 0)throw new De("INVALID_PARTS_UPDATE","Parts cannot be directly updated - use appendPart or appendTextContent instead",{parts:t.parts})}function Y5(e){if(!e||typeof e!="object")throw new De("INVALID_UPDATES","Updates must be an object",{updates:e});const t=e;if(t.toolName!==void 0&&(typeof t.toolName!="string"||t.toolName.length===0))throw new De("INVALID_TOOL_NAME","Updated toolName must be a non-empty string",{toolName:t.toolName});if(t.toolInput!==void 0&&(typeof t.toolInput!="object"||t.toolInput===null))throw new De("INVALID_TOOL_INPUT","Updated toolInput must be an object",{toolInput:t.toolInput});if(t.status!==void 0){if(typeof t.status!="object"||t.status===null)throw new De("INVALID_TOOL_STATUS","Updated status must be an object",{status:t.status});const a=t.status,s=["executing","completed","failed"];if(!s.includes(a.state))throw new De("INVALID_STATUS_STATE",`Updated status state must be one of: ${s.join(", ")}`,{state:a.state})}}const wn=Qu((e,t)=>({messages:[],activeConversationId:null,isStreaming:!1,sdkStatus:null,error:null,setActiveConversationId:a=>{$5(a),e({activeConversationId:a})},setStreaming:a=>{if(typeof a!="boolean")throw new De("INVALID_STREAMING_FLAG","isStreaming must be a boolean",{isStreaming:a});e({isStreaming:a})},setSdkStatus:a=>{a!==null&&P5(a),e({sdkStatus:a})},setError:a=>{q5(a),e({error:a})},reset:()=>e({messages:[],activeConversationId:null,isStreaming:!1,sdkStatus:null,error:null}),addMessage:a=>{H5(a);const r=t();if(r.messages.length>=1e3)throw new De("MAX_MESSAGES_EXCEEDED","Cannot add message: maximum limit of 1000 messages reached",{currentCount:r.messages.length,maxLimit:1e3});r.activeConversationId&&a.conversationId!==r.activeConversationId&&console.warn(`Message conversationId "${a.conversationId}" does not match active conversationId "${r.activeConversationId}"`),e(c=>({messages:[...c.messages,a]}))},updateMessage:(a,s)=>{if(Nu(a),V5(s),!t().messages.some(o=>o.id===a))throw new De("MESSAGE_NOT_FOUND",`Message with id "${a}" not found`,{id:a});e(o=>({messages:o.messages.map(u=>u.id===a?T(T({},u),s):u)}))},deleteMessage:a=>{Nu(a),e(s=>({messages:s.messages.filter(r=>r.id!==a)}))},appendPart:(a,s)=>{Nu(a),Sw(s);const o=t().messages.find(u=>u.id===a);if(!o)throw new De("MESSAGE_NOT_FOUND",`Message with id "${a}" not found`,{messageId:a});if(o.parts.length>=500)throw new De("MAX_PARTS_EXCEEDED","Cannot append part: maximum limit of 500 parts per message reached",{messageId:a,currentCount:o.parts.length,maxLimit:500});e(u=>({messages:u.messages.map(h=>{if(h.id===a){const m=K(T({},s),{timestamp:s.timestamp&&s.timestamp.length>0?s.timestamp:new Date().toISOString()});return K(T({},h),{parts:[...h.parts,m]})}return h})}))},appendTextContent:(a,s)=>{if(Nu(a),typeof s!="string")throw new De("INVALID_TEXT_CONTENT","Content must be a string",{content:s});const o=t().messages.find(m=>m.id===a);if(!o)throw new De("MESSAGE_NOT_FOUND",`Message with id "${a}" not found`,{messageId:a});const u=o.parts[o.parts.length-1];if(!(u&&u.type==="text")&&o.parts.length>=500)throw new De("MAX_PARTS_EXCEEDED","Cannot append part: maximum limit of 500 parts per message reached",{messageId:a,currentCount:o.parts.length,maxLimit:500});e(m=>({messages:m.messages.map(g=>{if(g.id===a){const p=g.parts[g.parts.length-1];if(p&&p.type==="text"){const b=[...g.parts];return b[g.parts.length-1]=K(T({},p),{content:p.content+s}),K(T({},g),{parts:b})}const v={type:"text",content:s,timestamp:new Date().toISOString()};return K(T({},g),{parts:[...g.parts,v]})}return g})}))},updateToolInvocation:(a,s)=>{if(typeof a!="string"||a.length===0)throw new De("INVALID_TOOL_USE_ID","toolUseId must be a non-empty string",{toolUseId:a});Y5(s);const r=t();let c=!1;for(const o of r.messages){for(const u of o.parts)if(u.type==="tool_invocation"&&"toolUseId"in u&&u.toolUseId===a){c=!0;break}if(c)break}if(!c)throw new De("TOOL_NOT_FOUND",`Tool invocation with toolUseId "${a}" not found`,{toolUseId:a});e(o=>({messages:o.messages.map(u=>K(T({},u),{parts:u.parts.map(h=>h.type==="tool_invocation"&&"toolUseId"in h&&h.toolUseId===a?T(T({},h),s):h)}))}))},getLastMessage:()=>{const a=t().messages;return a.length>0?a[a.length-1]:void 0},getMessagesByConversation:a=>t().messages.filter(s=>s.conversationId===a),getCurrentStreamingMessage:()=>{const a=t().messages;for(let s=a.length-1;s>=0;s--)if(a[s].isStreaming)return a[s]}})),G5="modulepreload",K5=function(e){return"/"+e},fx={},X5=function(t,a,s){let r=Promise.resolve();if(a&&a.length>0){let o=function(m){return Promise.all(m.map(g=>Promise.resolve(g).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),h=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));r=o(a.map(m=>{if(m=K5(m),m in fx)return;fx[m]=!0;const g=m.endsWith(".css"),p=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${p}`))return;const v=document.createElement("link");if(v.rel=g?"stylesheet":G5,g||(v.as="script"),v.crossOrigin="",v.href=m,h&&v.setAttribute("nonce",h),document.head.appendChild(v),g)return new Promise((b,_)=>{v.addEventListener("load",b),v.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${m}`)))})}))}function c(o){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=o,window.dispatchEvent(u),!u.defaultPrevented)throw o}return r.then(o=>{for(const u of o||[])u.status==="rejected"&&c(u.reason);return t().catch(c)})},jt={JSONRPC_MESSAGE_PARSE_FAILED:"JSONRPC_001",JSONRPC_ATTACH_LISTENER_FAILED:"JSONRPC_002",JSONRPC_ATTACH_LISTENER_BACKGROUND_FAILED:"JSONRPC_003",JSONRPC_SEND_REQUEST_FAILED:"JSONRPC_004",JSONRPC_SEND_NOTIFICATION_FAILED:"JSONRPC_005",JSONRPC_NOTIFICATION_HANDLER_ERROR:"JSONRPC_006",JSONRPC_HANDLE_NOTIFICATION_ERROR:"JSONRPC_007",JSONRPC_MESSAGE_HANDLER_ERROR:"JSONRPC_008",JSONRPC_WEBSOCKET_LOAD_FAILED:"JSONRPC_009",JSONRPC_UNKNOWN_RESPONSE_ID:"JSONRPC_010",CHAT_GET_STATUS_FAILED:"CHAT_001",CHAT_SEND_FAILED:"CHAT_002",CHAT_CANCEL_FAILED:"CHAT_003",WS_CONNECTION_ERROR:"WS_001",WS_MESSAGE_PARSE_FAILED:"WS_002",WS_ERROR_EVENT:"WS_003",WS_EVENT_HANDLER_ERROR:"WS_004",WS_MAX_RECONNECT_ATTEMPTS:"WS_005",WS_SEND_FAILED:"WS_006",WS_NOT_CONNECTED:"WS_007",SPEC_CONVERSION_FAILED:"DATA_001",DATA_LOADER_SUCCESS_CALLBACK_FAILED:"DATA_002",DATA_LOADER_ERROR_CALLBACK_FAILED:"DATA_003",DATA_NORMALIZATION_FAILED:"DATA_004",DATA_LOADER_LOAD_FAILED:"DATA_005",ANNOTATION_CREATE_FAILED:"ANNOTATION_001",ANNOTATION_DELETE_FAILED:"ANNOTATION_002",ANNOTATION_RESOLVE_FAILED:"ANNOTATION_003",ANNOTATION_REPLY_FAILED:"ANNOTATION_004",ANNOTATION_DELETE_ROLLBACK_FAILED:"ANNOTATION_005",SESSION_STORAGE_PARSE_ERROR:"STORAGE_001",AUTH_COOKIE_DECODE_FAILED:"AUTH_001",AUTH_REQUEST_FAILED:"AUTH_002"};var pe=(e=>(e.VALIDATION_ERROR="validation_error",e.NOT_FOUND="not_found",e.NETWORK_ERROR="network_error",e.TIMEOUT="timeout",e.UNAUTHORIZED="unauthorized",e.RATE_LIMITED="rate_limited",e.RESOURCE_EXHAUSTED="resource_exhausted",e.CONFLICT="conflict",e.EXTERNAL_SERVICE_ERROR="external_service_error",e.ASSERTION_FAILED="assertion_failed",e.INVALID_STATE="invalid_state",e.NOT_IMPLEMENTED="not_implemented",e.TYPE_ERROR="type_error",e.PARSE_ERROR="parse_error",e.LOGIC_ERROR="logic_error",e.NULL_REFERENCE="null_reference",e.INTERNAL_ERROR="internal_error",e))(pe||{}),Ns=(e=>(e.LOW="low",e.MEDIUM="medium",e.HIGH="high",e.CRITICAL="critical",e))(Ns||{}),Qn=(e=>(e.RETRY="retry",e.EXPONENTIAL_BACKOFF="exponential_backoff",e.FALLBACK="fallback",e.USER_ACTION="user_action",e.RELOAD="reload",e.NONE="none",e))(Qn||{});const Qt={network:/network|fetch|offline|connection|timeout|ERR_NAME_NOT_RESOLVED|ERR_INTERNET_DISCONNECTED/i,timeout:/timeout|timed out|deadline|took too long/i,networkDetail:{dns:/dns|name.*not.*resolved|ERR_NAME_NOT_RESOLVED/i,timeout:/timeout|timed out|deadline/i},unauthorized:/401|unauthorized|forbidden|not authorized|credentials/i,notFound:/404|not found|does not exist|resource.*not.*found/i,rateLimited:/429|rate limit|too many requests|quota|throttle/i,conflict:/409|conflict|duplicate|already.*exists|constraint/i,serverError:/500|502|503|504|internal.*error|service.*unavailable|gateway/i,validation:/validation|must be|required|bad request|email.*valid|password.*valid|field.*invalid/i,parseError:/parse|syntax|unexpected token|json|xml|invalid.*format/i,typeError:/type|not a function|is not a|undefined|null|cannot read|cannot set/i,resourceExhausted:/out of memory|quota|storage|disk|heap|too large|maximum/i,assertionFailed:/assertion.*failed|assert.*failed/i,invalidState:/invalid state|invariant|unreachable|should not happen/i,externalService:/third.?party|external|webhook|provider|service.*failed/i};function Q5(e,t,a,s){const r=Date.now(),c=a==null?void 0:a.stack,o=`${t} ${(a==null?void 0:a.message)||""}`.toLowerCase(),u=Z5(o,a),h=J5(u,s),m=W5(u),g=ez(u,o),p=tz(u,g),v=g&&nz(u),b=sz(u,t),_=lz(s,u);return{errorId:e,message:t,originalError:a,category:u,severity:h,isExpectedFailure:m,isTransient:g,recoveryStrategy:p,canRetry:v,maxRetryAttempts:az(u),retryDelayMs:iz(u),context:s,userFacingMessage:b,devMessage:rz(u,t,a),timestamp:r,stackTrace:c,affectedFeatures:_}}function Z5(e,t){return t instanceof TypeError?pe.TYPE_ERROR:t instanceof SyntaxError?pe.PARSE_ERROR:t instanceof RangeError?pe.RESOURCE_EXHAUSTED:Qt.network.test(e)?Qt.networkDetail.timeout.test(e)?pe.TIMEOUT:(Qt.networkDetail.dns.test(e),pe.NETWORK_ERROR):Qt.timeout.test(e)?pe.TIMEOUT:Qt.unauthorized.test(e)?pe.UNAUTHORIZED:Qt.notFound.test(e)?pe.NOT_FOUND:Qt.rateLimited.test(e)?pe.RATE_LIMITED:Qt.conflict.test(e)?pe.CONFLICT:Qt.serverError.test(e)?pe.EXTERNAL_SERVICE_ERROR:Qt.assertionFailed.test(e)?pe.ASSERTION_FAILED:Qt.validation.test(e)&&!Qt.invalidState.test(e)&&!Qt.assertionFailed.test(e)?pe.VALIDATION_ERROR:Qt.invalidState.test(e)?pe.INVALID_STATE:Qt.parseError.test(e)?pe.PARSE_ERROR:Qt.typeError.test(e)?pe.TYPE_ERROR:Qt.resourceExhausted.test(e)?pe.RESOURCE_EXHAUSTED:Qt.externalService.test(e)?pe.EXTERNAL_SERVICE_ERROR:pe.INTERNAL_ERROR}function J5(e,t){return t!=null&&t.isCritical||e===pe.ASSERTION_FAILED||e===pe.INVALID_STATE||e===pe.NULL_REFERENCE||e===pe.TYPE_ERROR?Ns.CRITICAL:e===pe.UNAUTHORIZED||e===pe.NETWORK_ERROR||e===pe.TIMEOUT||e===pe.EXTERNAL_SERVICE_ERROR?Ns.HIGH:e===pe.VALIDATION_ERROR||e===pe.NOT_FOUND||e===pe.PARSE_ERROR||e===pe.CONFLICT?Ns.MEDIUM:e===pe.RATE_LIMITED||e===pe.RESOURCE_EXHAUSTED?Ns.LOW:Ns.MEDIUM}function W5(e){return[pe.VALIDATION_ERROR,pe.NOT_FOUND,pe.NETWORK_ERROR,pe.TIMEOUT,pe.UNAUTHORIZED,pe.RATE_LIMITED,pe.RESOURCE_EXHAUSTED,pe.CONFLICT,pe.EXTERNAL_SERVICE_ERROR,pe.PARSE_ERROR].includes(e)}function ez(e,t){const a=[pe.NETWORK_ERROR,pe.TIMEOUT,pe.RATE_LIMITED,pe.EXTERNAL_SERVICE_ERROR];return e===pe.RESOURCE_EXHAUSTED?!t.includes("permanent")&&!t.includes("quota"):a.includes(e)}function tz(e,t){return e===pe.ASSERTION_FAILED||e===pe.INVALID_STATE||e===pe.NOT_IMPLEMENTED||e===pe.TYPE_ERROR||e===pe.NULL_REFERENCE||e===pe.LOGIC_ERROR?Qn.NONE:e===pe.NETWORK_ERROR&&t||e===pe.TIMEOUT&&t||e===pe.EXTERNAL_SERVICE_ERROR&&t||e===pe.RATE_LIMITED?Qn.EXPONENTIAL_BACKOFF:e===pe.UNAUTHORIZED||e===pe.VALIDATION_ERROR||e===pe.NOT_FOUND?Qn.USER_ACTION:e===pe.CONFLICT?Qn.FALLBACK:(e===pe.PARSE_ERROR,Qn.NONE)}function nz(e){return[pe.NETWORK_ERROR,pe.TIMEOUT,pe.RATE_LIMITED,pe.EXTERNAL_SERVICE_ERROR,pe.RESOURCE_EXHAUSTED].includes(e)}function az(e){switch(e){case pe.NETWORK_ERROR:case pe.TIMEOUT:return 3;case pe.EXTERNAL_SERVICE_ERROR:return 2;case pe.RATE_LIMITED:return 1;case pe.RESOURCE_EXHAUSTED:return 2;default:return}}function iz(e){switch(e){case pe.NETWORK_ERROR:return 500;case pe.TIMEOUT:return 1e3;case pe.EXTERNAL_SERVICE_ERROR:return 1e3;case pe.RATE_LIMITED:return 5e3;case pe.RESOURCE_EXHAUSTED:return 2e3;default:return}}function sz(e,t){switch(e){case pe.NETWORK_ERROR:return"Network connection failed. Please check your internet connection.";case pe.TIMEOUT:return"The operation took too long. Please try again.";case pe.UNAUTHORIZED:return"Your session has expired. Please log in again.";case pe.NOT_FOUND:return"The requested resource was not found.";case pe.RATE_LIMITED:return"Too many requests. Please wait before trying again.";case pe.RESOURCE_EXHAUSTED:return"System resources are temporarily exhausted. Please try again.";case pe.VALIDATION_ERROR:return`Invalid input: ${t}`;case pe.CONFLICT:return"This resource has been modified by someone else. Please refresh and try again.";case pe.EXTERNAL_SERVICE_ERROR:return"External service is temporarily unavailable. Please try again.";case pe.PARSE_ERROR:return"Unable to process the response. Please try again or contact support.";case pe.ASSERTION_FAILED:case pe.INVALID_STATE:case pe.TYPE_ERROR:case pe.NULL_REFERENCE:case pe.INTERNAL_ERROR:return"An unexpected error occurred. Please refresh the page or contact support.";default:return"An error occurred. Please try again."}}function rz(e,t,a){var c;return[`[${((c=Object.entries(pe).find(([,o])=>o===e))==null?void 0:c[0])||"UNKNOWN"}] ${t}`,a!=null&&a.message?`Original: ${a.message}`:""].filter(Boolean).join(" | ")}function lz(e,t){const a=[];return e!=null&&e.feature&&typeof e.feature=="string"&&a.push(e.feature),e!=null&&e.layer&&typeof e.layer=="string"&&a.push(`${e.layer}_layer`),t===pe.NETWORK_ERROR?a.push("data_sync","websocket","api_calls"):t===pe.EXTERNAL_SERVICE_ERROR&&a.push("export","integrations"),[...new Set(a)]}function Rt(e,t,a,s){const r=new Date().toISOString(),c=Q5(e,t,s,a),o={errorId:e,message:t,timestamp:r,context:a||{},category:c.category,severity:c.severity,isExpectedFailure:c.isExpectedFailure,isTransient:c.isTransient,recoveryStrategy:c.recoveryStrategy,canRetry:c.canRetry,affectedFeatures:c.affectedFeatures};if(typeof window!="undefined")try{const u=window.__SENTRY__;if(u&&u.captureException){const h=s||new Error(t);h.errorId=e,h.context=a,h.category=c.category,h.severity=c.severity,h.isExpectedFailure=c.isExpectedFailure,h.isTransient=c.isTransient,h.recoveryStrategy=c.recoveryStrategy,u.setTag("error_id",e),u.setTag("error_category",c.category),u.setTag("error_severity",c.severity),u.setTag("is_expected",String(c.isExpectedFailure)),u.setTag("is_transient",String(c.isTransient)),u.captureException(h)}}catch(u){console.warn("[ErrorTracker] Failed to capture error in Sentry:",u instanceof Error?u.message:String(u),{errorId:e,message:t})}if(e!==jt.SESSION_STORAGE_PARSE_ERROR&&typeof sessionStorage!="undefined")try{const u="app:error_log",h=sessionStorage.getItem(u),m=h?JSON.parse(h):[];m.push(o),m.length>50&&m.shift(),sessionStorage.setItem(u,JSON.stringify(m))}catch(u){console.warn("[ErrorTracker] Failed to store error log in session storage:",u instanceof Error?u.message:String(u),{errorId:e,message:t})}return c}function Co(e,t){const a=new Date().toISOString();if(console.warn(e),typeof sessionStorage!="undefined")try{const s="app:warning_log",r=sessionStorage.getItem(s),c=r?JSON.parse(r):[];c.push({message:e,timestamp:a,context:t||{}}),c.length>50&&c.shift(),sessionStorage.setItem(s,JSON.stringify(c))}catch(s){console.warn("[ErrorTracker] Failed to store warning log in session storage:",s instanceof Error?s.message:String(s),{message:e})}}class hg extends Error{constructor(t,a,s){super(s),this.code=t,this.rpcError=a,this.name="JsonRpcErrorResult",Object.setPrototypeOf(this,hg.prototype)}}class oz{constructor(){ht(this,"pendingRequests",new Map);ht(this,"notificationHandlers",new Map);ht(this,"requestTimeout",3e4);ht(this,"requestIdCounter",1);ht(this,"messageListenerAttached",!1);ht(this,"messageListenerAttachmentInProgress",!1);ht(this,"cachedWebSocketClient",null);this.ensureMessageListenerAttached()}getWebSocketClient(){return Ue(this,null,function*(){if(this.cachedWebSocketClient)return this.cachedWebSocketClient;try{const t=yield X5(()=>Promise.resolve().then(()=>Az),void 0);return this.cachedWebSocketClient=t.websocketClient,this.cachedWebSocketClient}catch(t){throw Rt(jt.JSONRPC_WEBSOCKET_LOAD_FAILED,"Failed to load WebSocket client - JSON-RPC communication will not be available",{},t instanceof Error?t:new Error(String(t))),t}})}ensureMessageListenerAttachedAsync(){return Ue(this,null,function*(){if(!this.messageListenerAttached&&!this.messageListenerAttachmentInProgress){this.messageListenerAttachmentInProgress=!0;try{(yield this.getWebSocketClient()).on("message",a=>{try{if(!this.isValidJsonRpcMessage(a)){Rt(jt.JSONRPC_MESSAGE_PARSE_FAILED,"Invalid JSON-RPC message structure - missing required fields",{message:String(a)});return}this.handleMessage(a)}catch(s){s instanceof TypeError?Rt(jt.JSONRPC_MESSAGE_PARSE_FAILED,"Invalid JSON-RPC message structure",{error:s instanceof Error?s.message:String(s),message:String(a)},s instanceof Error?s:new Error(String(s))):Rt(jt.JSONRPC_MESSAGE_HANDLER_ERROR,"Unexpected error while handling JSON-RPC message - possible programming bug",{error:s instanceof Error?s.message:String(s),errorType:s instanceof Error?s.constructor.name:typeof s,message:String(a),stack:s instanceof Error?s.stack:void 0},s instanceof Error?s:new Error(String(s)))}}),this.messageListenerAttached=!0}catch(t){Rt(jt.JSONRPC_ATTACH_LISTENER_FAILED,"Failed to attach message listener to WebSocket - JSON-RPC responses will not be received",{error:t instanceof Error?t.message:String(t)},t instanceof Error?t:new Error(String(t)))}finally{this.messageListenerAttachmentInProgress=!1}}})}ensureMessageListenerAttached(){this.messageListenerAttached||this.messageListenerAttachmentInProgress||this.ensureMessageListenerAttachedAsync().catch(t=>{Rt(jt.JSONRPC_ATTACH_LISTENER_BACKGROUND_FAILED,"Failed to attach message listener in background",{error:t instanceof Error?t.message:String(t)})})}sendRequest(t,a,s){return Ue(this,null,function*(){const r=this.generateRequestId(),c={jsonrpc:"2.0",method:t,id:r};return a&&(c.params=a),new Promise((o,u)=>{const h=s!=null?s:this.requestTimeout,m=setTimeout(()=>{this.pendingRequests.delete(r),u(new Error(`JSON-RPC request timeout for method '${t}' after ${h}ms`))},h);this.pendingRequests.set(r,{id:r,method:t,resolve:g=>o(g),reject:u,timeout:m}),this._sendRequestMessage(c,r,m,u)})})}sendNotification(t,a){const s=T({jsonrpc:"2.0",method:t},a&&{params:a});this._sendNotificationMessage(s,t)}_sendRequestMessage(t,a,s,r){return Ue(this,null,function*(){try{if(!(yield this.getWebSocketClient()).send(t)){this.pendingRequests.delete(a),clearTimeout(s);const u="Failed to send JSON-RPC request: WebSocket not connected";Rt(jt.JSONRPC_SEND_REQUEST_FAILED,u,{method:t.method}),r(new Error(u))}}catch(c){this.pendingRequests.delete(a),clearTimeout(s);const o=`Failed to send JSON-RPC request: ${c instanceof Error?c.message:"Unknown error"}`;Rt(jt.JSONRPC_SEND_REQUEST_FAILED,o,{error:c instanceof Error?c.message:String(c),method:t.method}),r(new Error(o))}})}_sendNotificationMessage(t,a){return Ue(this,null,function*(){try{(yield this.getWebSocketClient()).send(t)||Rt(jt.JSONRPC_SEND_NOTIFICATION_FAILED,`Failed to send notification for method '${a}': WebSocket not connected`,{method:a})}catch(s){Rt(jt.JSONRPC_SEND_NOTIFICATION_FAILED,`Failed to send notification for method '${a}'`,{error:s instanceof Error?s.message:String(s),method:a})}})}onNotification(t,a){this.notificationHandlers.has(t)||this.notificationHandlers.set(t,new Set);const s=this.notificationHandlers.get(t);return s.add(a),()=>{s.delete(a),s.size===0&&this.notificationHandlers.delete(t)}}handleMessage(t){"result"in t||"error"in t?this.handleResponse(t):"method"in t&&!("id"in t)&&this.handleNotification(t)}handleResponse(t){const{id:a}=t,s=this.pendingRequests.get(a);if(!s){const r=`Received JSON-RPC response for unknown request ID: ${a}. This may indicate a timing issue or protocol error.`;Rt(jt.JSONRPC_UNKNOWN_RESPONSE_ID,r,{responseId:a},new Error(r));return}if(this.pendingRequests.delete(a),clearTimeout(s.timeout),"result"in t)s.resolve(t.result);else if("error"in t){const r=this.createError(t.error,s.method);s.reject(r)}}handleNotification(t){const{method:a,params:s}=t;if(!a){Co("Received notification without method");return}const r=this.notificationHandlers.get(a);!r||r.size===0||r.forEach(c=>{try{const o=c(s!=null?s:{});o&&typeof o.then=="function"&&o.catch(u=>{Rt(jt.JSONRPC_NOTIFICATION_HANDLER_ERROR,`Error in notification handler for '${a}'`,{error:u instanceof Error?u.message:String(u),method:a})})}catch(o){Rt(jt.JSONRPC_NOTIFICATION_HANDLER_ERROR,`Error in notification handler for '${a}'`,{error:o instanceof Error?o.message:String(o),method:a})}})}createError(t,a){const s=`JSON-RPC Error (${t.code}): ${t.message} [method: ${a}]`;return new hg(t.code,t,s)}generateRequestId(){return`req-${Date.now()}-${this.requestIdCounter++}`}clearPendingRequests(){this.pendingRequests.forEach(({timeout:a})=>{clearTimeout(a)});const t=new Error("WebSocket connection closed");this.pendingRequests.forEach(({reject:a})=>{a(t)}),this.pendingRequests.clear()}getPendingRequestCount(){return this.pendingRequests.size}static validateRequest(t){if(typeof t!="object"||t===null)return!1;const a=t;return a.jsonrpc==="2.0"&&typeof a.method=="string"&&(a.id===void 0||typeof a.id=="string"||typeof a.id=="number")}static validateResponse(t){if(typeof t!="object"||t===null)return!1;const a=t;return a.jsonrpc!=="2.0"||a.id===void 0&&a.id!==0?!1:"result"in a&&!("error"in a)||"error"in a&&!("result"in a)}isValidJsonRpcMessage(t){if(typeof t!="object"||t===null)return!1;const a=t;if(a.jsonrpc!=="2.0")return!1;const s="id"in a,r="method"in a,c="result"in a,o="error"in a;return s&&(c||o)?c&&!o||!c&&o:!!(r&&!s)}}const Oi=new oz;function cz(e,t,a){switch(e){case"executing":return{state:"executing"};case"completed":return{state:"completed",result:t};case"failed":return{state:"failed",error:a||"Unknown error"};default:return console.warn(`[ChatService] Unknown tool status: "${e}", treating as executing`),{state:"executing"}}}class uz{constructor(){ht(this,"currentConversationId",null);ht(this,"currentRequestId",null);this.setupNotificationHandlers()}setupNotificationHandlers(){Oi.onNotification("chat.response.chunk",t=>{this.handleResponseChunk(t)}),Oi.onNotification("chat.tool.invoke",t=>{this.handleToolInvoke(t)}),Oi.onNotification("chat.thinking",t=>{this.handleThinking(t)}),Oi.onNotification("chat.usage",t=>{this.handleUsage(t)}),Oi.onNotification("chat.error",t=>{this.handleError(t)})}getStatus(){return Ue(this,null,function*(){var t,a,s,r,c,o;try{const u=yield Oi.sendRequest("chat.status",{}),h={sdkAvailable:(a=(t=u.sdkAvailable)!=null?t:u.sdk_available)!=null?a:!1,sdkVersion:(r=(s=u.sdkVersion)!=null?s:u.sdk_version)!=null?r:null,errorMessage:(o=(c=u.errorMessage)!=null?c:u.error_message)!=null?o:null};return wn.getState().setSdkStatus(h),h}catch(u){const h=u instanceof Error?u.message:"Unknown error";Rt(jt.CHAT_GET_STATUS_FAILED,"Failed to get status",{error:h});const m={sdkAvailable:!1,sdkVersion:null,errorMessage:h};throw wn.getState().setSdkStatus(m),u}})}sendMessage(t){return Ue(this,null,function*(){if(!t.trim())throw new Error("Message cannot be empty");const a=wn.getState(),r={id:this.generateMessageId(),role:"user",conversationId:this.currentConversationId||this.generateConversationId(),timestamp:new Date().toISOString(),parts:[{type:"text",content:t,timestamp:new Date().toISOString()}]};this.currentConversationId=r.conversationId,a.setActiveConversationId(this.currentConversationId),a.addMessage(r);const c=this.generateMessageId(),o={id:c,role:"assistant",conversationId:r.conversationId,timestamp:new Date().toISOString(),parts:[],isStreaming:!0};a.addMessage(o),a.setStreaming(!0),a.setError(null);try{this.currentRequestId=this.generateRequestId();const u=yield Oi.sendRequest("chat.send",{message:t},6e4);return a.updateMessage(c,{isStreaming:!1}),a.setStreaming(!1),u}catch(u){a.setStreaming(!1);const h=u instanceof Error?u.message:"Unknown error";throw a.setError(h),Rt(jt.CHAT_SEND_FAILED,"Failed to send message",{error:h,message:t}),a.appendPart(c,{type:"error",code:"SEND_FAILED",message:h,timestamp:new Date().toISOString()}),u}})}cancelMessage(){return Ue(this,null,function*(){const t=wn.getState();try{const a=yield Oi.sendRequest("chat.cancel",{},5e3);return t.setStreaming(!1),a}catch(a){const s=a instanceof Error?a.message:"Unknown error";throw Rt(jt.CHAT_CANCEL_FAILED,"Failed to cancel",{error:s}),t.setStreaming(!1),a}})}handleResponseChunk(t){const a=wn.getState(),s=a.getCurrentStreamingMessage();if(!s){Co("Received response chunk but no streaming message");return}a.appendTextContent(s.id,t.content)}handleToolInvoke(t){const a=wn.getState(),s=a.getCurrentStreamingMessage();if(!s){Co("Received tool invoke but no streaming message");return}const r=cz(t.status,t.result,t.error);s.parts.find(o=>o.type==="tool_invocation"&&o.toolUseId===t.tool_use_id)?a.updateToolInvocation(t.tool_use_id,{status:r}):a.appendPart(s.id,{type:"tool_invocation",toolUseId:t.tool_use_id,toolName:t.toolName,toolInput:t.toolInput,status:r,timestamp:t.timestamp||new Date().toISOString()})}handleThinking(t){const a=wn.getState(),s=a.getCurrentStreamingMessage();if(!s){Co("Received thinking but no streaming message");return}a.appendPart(s.id,{type:"thinking",content:t.content,timestamp:t.timestamp||new Date().toISOString()})}handleUsage(t){const a=wn.getState(),s=a.getCurrentStreamingMessage();if(!s){Co("Received usage but no streaming message");return}a.appendPart(s.id,{type:"usage",inputTokens:t.input_tokens,outputTokens:t.output_tokens,totalTokens:t.total_tokens,totalCostUsd:t.total_cost_usd,timestamp:t.timestamp||new Date().toISOString()})}handleError(t){const a=wn.getState(),s=t.message||"Unknown error";a.setError(s),a.setStreaming(!1);const r=a.getCurrentStreamingMessage();r&&a.appendPart(r.id,{type:"error",code:t.code||"UNKNOWN_ERROR",message:s,timestamp:t.timestamp||new Date().toISOString()})}generateMessageId(){return`msg-${Date.now()}-${Math.random().toString(36).substring(2,11)}`}generateConversationId(){return`conv-${Date.now()}-${Math.random().toString(36).substring(2,11)}`}generateRequestId(){return`req-${Date.now()}-${Math.random().toString(36).substring(2,11)}`}getCurrentConversationId(){return this.currentConversationId}getCurrentRequestId(){return this.currentRequestId}reset(){this.currentConversationId=null,this.currentRequestId=null,wn.getState().reset()}}const dz=new uz;function fz(e){return e==="user"?"user":"bot"}function hz(e){return e==="user"?"You":"DrBot"}function mz(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function pz(e){switch(e.state){case"executing":return"running";case"completed":return"success";case"failed":return"error";default:return"running"}}function hx(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch(t){return String(e)}}function gz(e){var s;const t=[],a=(s=e.toolInput)!=null?s:{};for(const[r,c]of Object.entries(a))t.push({key:r,value:hx(c)});return e.status.state==="completed"&&e.status.result!==void 0?t.push({key:"result",value:hx(e.status.result)}):e.status.state==="failed"&&t.push({key:"error",value:e.status.error}),t}function yz(e){return{name:e.toolName,status:pz(e.status),output:gz(e)}}function vz(e){const t=typeof e.totalCostUsd=="number"&&e.totalCostUsd>0?` · $${e.totalCostUsd.toFixed(4)}`:"";return`${e.totalTokens} tokens (${e.inputTokens} in / ${e.outputTokens} out)${t}`}function bz(e){var g,p;const t=fz(e.role),a=hz(e.role),s=mz(e.timestamp),r=!!e.isStreaming,c=[];let o=0,u=null;const h=(v={})=>T({id:`${e.id}:${o++}`,role:t,senderName:a,timestamp:s,body:"",bodyKind:"markdown",isStreaming:r},v),m=()=>{u&&(c.push(u),u=null)};for(const v of e.parts)switch(v.type){case"text":{const b=(g=v.content)!=null?g:"";u&&u.bodyKind==="markdown"&&!u.toolBlock&&!u.thinkingBlock?u.body+=b:(m(),u=h({body:b}));break}case"thinking":{const b={content:(p=v.content)!=null?p:""};u&&u.bodyKind==="markdown"&&!u.thinkingBlock&&!u.toolBlock?(u.thinkingBlock=b,m()):(m(),c.push(h({thinkingBlock:b})));break}case"tool_invocation":{const b=yz(v);u&&u.bodyKind==="markdown"&&!u.toolBlock?(u.toolBlock=b,m()):(m(),c.push(h({toolBlock:b})));break}case"error":{m(),c.push(h({body:v.message,bodyKind:"error",isStreaming:!1}));break}case"usage":{m(),c.push(h({body:vz(v),bodyKind:"usage",isStreaming:!1}));break}}return m(),c.length===0&&c.push(h({})),c}function xz(e){const t=[];for(const a of e)t.push(...bz(a));return t}const Cm=["What does this element do?","Show cross-layer references","Any unresolved references?","Explain the data-model layer"];function _z({row:e}){return e.bodyKind==="error"?f.jsx("span",{style:{color:"#F43F5E",fontSize:12.5,lineHeight:1.5},"data-testid":"chat-error-line",children:e.body}):e.bodyKind==="usage"?f.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:10.5,color:"rgb(var(--canvas-fg-3))"},children:e.body}):f.jsx(qS,{content:e.body,isStreaming:e.isStreaming})}function Sz(){const e=je(I=>I.view),t=je(I=>I.layerId),a=je(I=>I.selectedId),s=je(I=>I.changesetId),r=wn(I=>I.messages),c=wn(I=>I.isStreaming),o=wn(I=>I.error),{derived:u}=ns(),{derived:h}=Ko(),m=A.useMemo(()=>vd(u),[u]),g=e==="model"&&a?m.byUuid.get(a):void 0,p=g==null?void 0:g.name,v=t?Wi(t):"",b=A.useMemo(()=>{if(e==="changesets"){const I=h.list.find(O=>O.id===s);return I?I.name:"changesets"}return p||(v?`${v} layer`:"meta-model")},[e,h.list,s,p,v]),_=A.useMemo(()=>p?[`What does ${p} do?`,"Show cross-layer references","Any unresolved references?",v?`Explain the ${v} layer`:Cm[3]]:v?[...Cm.slice(0,3),`Explain the ${v} layer`]:Cm,[p,v]),S=A.useMemo(()=>xz(r),[r]),[w,C]=A.useState(""),R=I=>{const O=I.trim();!O||c||(C(""),dz.sendMessage(O).catch(()=>{}))},j=r.length<=1,k=f.jsxs(f.Fragment,{children:[o&&f.jsx("div",{role:"alert","data-testid":"chat-store-error",style:{flex:"none",margin:"6px 12px 0 12px",padding:"8px 10px",borderRadius:8,fontSize:12,lineHeight:1.45,color:"#F43F5E",background:"rgba(244,63,94,0.08)",border:"1px solid rgba(244,63,94,0.25)"},children:/-32001|sdk|not (?:installed|available)/i.test(o)?"No chat client is available on the server (the Claude SDK is not installed). The drawer is read-only until it is enabled.":o}),j&&f.jsx("div",{style:{flex:"none",padding:"10px 12px 6px 12px",borderTop:"1px solid rgb(var(--canvas-border))"},children:f.jsx(O_,{suggestions:_,onSelect:I=>R(I)})}),f.jsx("div",{style:{flex:"none",padding:"0 8px 10px 8px"},children:f.jsx(z_,{value:w,onChange:C,onSubmit:I=>R(I),scopeLabel:b,placeholder:"Ask about the model…",loading:c})})]});return f.jsx(I_,{composer:k,children:S.map(I=>f.jsx(A_,{role:I.role,senderName:I.senderName,timestamp:I.timestamp,body:f.jsx(_z,{row:I}),toolBlock:I.toolBlock,thinkingBlock:I.thinkingBlock},I.id))})}const mx={width:372,flex:"none",background:"rgb(var(--canvas-bg))",display:"flex",flexDirection:"column",minHeight:0,borderLeft:"1px solid rgb(var(--canvas-border))"},wz={position:"absolute",right:0,top:0,bottom:0,zIndex:30,boxShadow:"-16px 0 44px -22px rgba(0,0,0,0.5)"};function Cz(){const e=je(s=>s.chatOpen),t=je(s=>s.wide);if(!e)return null;const a=t?mx:T(T({},mx),wz);return f.jsxs("div",{style:a,"data-testid":"chat-drawer","data-mode":t?"pane":"overlay",children:[f.jsxs("div",{style:{height:40,flex:"none",display:"flex",alignItems:"center",gap:8,padding:"0 16px",borderBottom:"1px solid rgb(var(--canvas-border))"},children:[f.jsx("span",{className:"drv-chat-pulse",style:{width:6,height:6,borderRadius:"50%",background:"#FBBF24",display:"inline-block"}}),f.jsx("span",{style:{fontSize:13,fontWeight:600,color:"rgb(var(--canvas-fg-1))"},children:"DrBot"}),f.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:10,letterSpacing:"0.06em",textTransform:"uppercase",color:"rgb(var(--canvas-fg-3))"},children:"model assistant"})]}),f.jsx("div",{style:{flex:1,minHeight:0,position:"relative"},children:f.jsx("div",{style:{position:"absolute",inset:0},children:f.jsx(Sz,{})})})]})}const ju="data-model",Nz="I'm **DrBot**, scoped to the loaded architecture model. Select any element to inspect it, then ask me to explain it, trace its cross-layer references, or validate reference integrity.";function jz(){A.useEffect(()=>{var s;const e=wn.getState();if(e.messages.length>0)return;const t=new Date().toISOString(),a={id:`msg-greeting-${Date.now()}`,role:"assistant",conversationId:(s=e.activeConversationId)!=null?s:"greeting",timestamp:t,parts:[{type:"text",content:Nz,timestamp:t}]};e.addMessage(a)},[])}function kz(){const e=je(g=>g.view),t=je(g=>g.layerId),a=je(g=>g.changesetId),s=je(g=>g.navigateToElement),r=je(g=>g.navigateToSpecNode),c=je(g=>g.selectChangeset),{derived:o}=ns(),{derived:u,raw:h}=Qs(),{derived:m}=Ko();A.useEffect(()=>{var g,p,v;if(e==="changesets"){if(a)return;const b=m.list[0];b&&c(b.id);return}if(!t){if(e==="model"){if(o.nodes.length===0)return;const b=(g=o.nodesByLayer[ju])!=null&&g.length?ju:Object.keys(o.nodesByLayer)[0];if(!b)return;const _=(p=o.nodesByLayer[b])==null?void 0:p[0];_&&s(_.id,b);return}if(e==="spec"){if(Object.keys(u.byLayer).length===0)return;const b=(v=u.byLayer[ju])!=null&&v.typeCount?ju:ow.find(S=>{var w;return(w=u.byLayer[S])==null?void 0:w.typeCount});if(!b)return;const _=$6(h,b);_&&r(_,b)}}},[e,t,a,o,u,h,m,s,r,c])}function Ez(){const e=je(r=>r.view),t=je(r=>r.mode),a=e==="changesets",s=a||t!=="page";return kz(),jz(),f.jsxs("div",{style:{height:"100vh",minWidth:880,display:"flex",flexDirection:"column",background:"rgb(var(--shell-bg))",color:"rgb(var(--shell-fg-1))",fontFamily:"Inter, system-ui, sans-serif",overflow:"hidden"},"data-testid":"app-shell",children:[f.jsx(h6,{}),f.jsxs("div",{style:{flex:1,display:"flex",minHeight:0,position:"relative"},children:[f.jsx(L6,{}),a?f.jsx(B5,{}):f.jsx(p5,{}),s&&(a?f.jsx(F5,{}):f.jsx(z5,{})),f.jsx(Cz,{})]}),f.jsx(D6,{})]})}const Rz=0,zi=1,Tz=2,Mz=3;class ww{constructor(t,a=null){ht(this,"ws",null);ht(this,"url");ht(this,"token",null);ht(this,"reconnectAttempts",0);ht(this,"maxReconnectAttempts",10);ht(this,"reconnectDelay",1e3);ht(this,"maxReconnectDelay",3e4);ht(this,"reconnectTimer",null);ht(this,"heartbeatTimer",null);ht(this,"heartbeatInterval",3e4);ht(this,"eventHandlers",new Map);ht(this,"isIntentionallyClosed",!1);ht(this,"subscribedTopics",[]);ht(this,"mode","detecting");ht(this,"connectionTimeout",null);ht(this,"maxConnectionAttempts",3);ht(this,"connectionErrors",[]);this.url=t,this.token=a}setToken(t){this.token=t,console.log("[WebSocket] Token updated:",t?"present":"cleared")}getAuthProtocols(){if(this.token)return["token",this.token]}connect(){if(this.ws&&this.ws.readyState===zi){console.log("[WebSocket] Already connected");return}if(this.mode==="rest"){console.log("[WebSocket] Using REST mode, skipping WebSocket connection"),this.emit("rest-mode",{});return}this.ws&&(this.ws.onopen=null,this.ws.onmessage=null,this.ws.onerror=null,this.ws.onclose=null,this.ws.close(),this.ws=null),this.isIntentionallyClosed=!1,this.mode==="detecting"&&console.log(`[WebSocket] Attempting WebSocket connection (attempt ${this.reconnectAttempts+1}/${this.maxConnectionAttempts})...`);try{const t=this.getAuthProtocols();this.ws=new WebSocket(this.url,t),this.ws.onopen=this.handleOpen.bind(this),this.ws.onmessage=this.handleMessage.bind(this),this.ws.onerror=this.handleError.bind(this),this.ws.onclose=this.handleClose.bind(this),this.mode==="detecting"&&(this.connectionTimeout=setTimeout(()=>{this.ws&&this.ws.readyState!==zi&&(console.log("[WebSocket] Connection timeout during detection phase"),this.ws.close())},3e3))}catch(t){this.mode==="detecting"?(console.debug("[WebSocket] Connection error during detection:",t),this.handleConnectionFailure(),this.connectionErrors.push(t instanceof Error?t:new Error(String(t)))):(Rt(jt.WS_CONNECTION_ERROR,"WebSocket connection error",{error:t instanceof Error?t.message:String(t)}),this.scheduleReconnect())}}getConnectionErrors(){return[...this.connectionErrors]}isTestEnvironment(){return up()}triggerCloseForTesting(){this.isTestEnvironment()&&(this.ws&&this.ws.readyState===zi?(console.log("[WebSocket] TEST: Forcing close event"),this.ws.close(1e3,"Test-triggered close")):console.warn("[WebSocket] TEST: Cannot close, not connected"))}simulateMaxReconnectAttemptsForTesting(){this.isTestEnvironment()&&(console.log("[WebSocket] TEST: Simulating max reconnect attempts"),this.reconnectAttempts=this.maxReconnectAttempts,Rt(jt.WS_MAX_RECONNECT_ATTEMPTS,"Max reconnection attempts reached (TEST SIMULATION)",{attempts:this.reconnectAttempts}),this.emit("max-reconnect-attempts",{attempts:this.reconnectAttempts}))}disconnect(){this.isIntentionallyClosed=!0,this.stopHeartbeat(),this.cancelReconnect(),this.connectionTimeout&&(clearTimeout(this.connectionTimeout),this.connectionTimeout=null),this.ws&&(this.ws.onopen=null,this.ws.onmessage=null,this.ws.onerror=null,this.ws.onclose=null,this.ws.close(),this.ws=null),console.log("[WebSocket] Disconnected"),this.emit("disconnect",{})}subscribe(t){this.subscribedTopics=t,this.ws&&this.ws.readyState===zi&&this.send({type:"subscribe",topics:t})}send(t){var a;if(this.ws&&this.ws.readyState===zi)try{return this.ws.send(JSON.stringify(t)),!0}catch(s){return Rt(jt.WS_SEND_FAILED,"Failed to send WebSocket message",{error:s instanceof Error?s.message:String(s),message:t}),!1}else return Rt(jt.WS_NOT_CONNECTED,"Cannot send message, WebSocket not connected",{connectionState:(a=this.ws)==null?void 0:a.readyState,message:t}),!1}on(t,a){this.eventHandlers.has(t)||this.eventHandlers.set(t,new Set),this.eventHandlers.get(t).add(a)}off(t,a){const s=this.eventHandlers.get(t);s&&s.delete(a)}get isConnected(){return this.ws!==null&&this.ws.readyState===zi}get connectionState(){if(!this.ws)return this.reconnectTimer?"reconnecting":"disconnected";switch(this.ws.readyState){case Rz:return"connecting";case zi:return"connected";case Tz:case Mz:return this.reconnectTimer?"reconnecting":"disconnected";default:return"disconnected"}}get transportMode(){return this.mode}handleConnectionFailure(){this.reconnectAttempts++,this.reconnectAttempts>=this.maxConnectionAttempts?(console.log("[WebSocket] Server does not support WebSocket, using REST mode"),this.connectionErrors.length>0&&(console.warn("[WebSocket] Connection attempts failed with the following errors:"),this.connectionErrors.forEach((t,a)=>{console.warn(` [${a+1}] ${t.message}`)})),this.mode="rest",this.reconnectAttempts=0,this.emit("rest-mode",{}),this.emit("connect",{})):setTimeout(()=>this.connect(),500)}handleOpen(){this.connectionTimeout&&(clearTimeout(this.connectionTimeout),this.connectionTimeout=null),console.log("[WebSocket] Connected successfully"),this.mode="websocket",this.reconnectAttempts=0,this.reconnectDelay=1e3,this.startHeartbeat(),this.emit("connect",{}),this.subscribedTopics.length>0&&this.subscribe(this.subscribedTopics)}handleMessage(t){var a;try{const s=JSON.parse(t.data),r=(a=s.type)!=null?a:"message";console.log("[WebSocket] Received:",r),this.emit(r,s),r!=="message"&&this.emit("message",s)}catch(s){Rt(jt.WS_MESSAGE_PARSE_FAILED,"Failed to parse WebSocket message",{error:s instanceof Error?s.message:String(s),data:t.data})}}handleError(t){const a=up();if(this.mode==="detecting"){const s=t instanceof ErrorEvent?t.message:String(t);this.connectionErrors.push(new Error(`[Attempt ${this.reconnectAttempts+1}/${this.maxConnectionAttempts}] ${s}`)),console.debug("[WebSocket] Connection error during detection (attempt %d/%d): %s",this.reconnectAttempts+1,this.maxConnectionAttempts,s)}else a?console.debug("[WebSocket] Error in test environment:",t):Rt(jt.WS_ERROR_EVENT,"WebSocket error event",{error:t instanceof ErrorEvent?t.message:String(t)});this.emit("error",{kind:"event",error:t})}handleClose(t){if(this.connectionTimeout&&(clearTimeout(this.connectionTimeout),this.connectionTimeout=null),this.mode==="detecting"){this.handleConnectionFailure();return}console.log(`[WebSocket] Closed (code: ${t.code}, reason: ${t.reason})`),this.stopHeartbeat(),this.emit("close",{code:t.code,reason:t.reason}),!this.isIntentionallyClosed&&this.mode!=="rest"&&this.scheduleReconnect()}scheduleReconnect(){if(this.isIntentionallyClosed)return;if(this.reconnectAttempts>=this.maxReconnectAttempts){Rt(jt.WS_MAX_RECONNECT_ATTEMPTS,"Max reconnection attempts reached",{attempts:this.reconnectAttempts}),this.emit("max-reconnect-attempts",{attempts:this.reconnectAttempts});return}this.reconnectAttempts++;const t=Math.min(this.reconnectDelay*Math.pow(2,this.reconnectAttempts-1),this.maxReconnectDelay);console.log(`[WebSocket] Reconnecting in ${t}ms (attempt ${this.reconnectAttempts}/${this.maxReconnectAttempts})`),this.emit("reconnecting",{attempt:this.reconnectAttempts,delay:t}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}cancelReconnect(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.ws&&this.ws.readyState===zi&&this.send({type:"ping"})},this.heartbeatInterval)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}emit(t,a){const s=this.eventHandlers.get(t);s&&s.forEach(r=>{try{r(a)}catch(c){Rt(jt.WS_EVENT_HANDLER_ERROR,`Error in WebSocket event handler for '${t}'`,{error:c instanceof Error?c.message:String(c),event:t})}})}}function up(){return typeof window=="undefined"?!1:!!(window.__PLAYWRIGHT__||window.__STORYBOOK_MOCK_WEBSOCKET__||window.__karma__||window.jasmine||window.jest)}let Yt;if(typeof window!="undefined"){const t=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;Yt=new ww(t,null)}else{const e=new Map;Yt={setToken:()=>{},connect:()=>{setTimeout(()=>{const t=e.get("error");t&&t.forEach(s=>s({code:"SSR_ENVIRONMENT",message:"WebSocket not available in SSR/Node.js environment"}));const a=e.get("rest-mode");a&&a.forEach(s=>s({}))},0)},disconnect:()=>{},subscribe:()=>{},send:()=>(Rt(jt.WS_SEND_FAILED,"Cannot send message in SSR/Node.js environment - use REST API instead",{environment:"SSR/Node.js"}),!1),on:(t,a)=>{e.has(t)||e.set(t,new Set),e.get(t).add(a)},off:(t,a)=>{const s=e.get(t);s&&s.delete(a)},get isConnected(){return!1},get connectionState(){return"disconnected"},get transportMode(){return"rest"}}}typeof window!="undefined"&&up()&&(window.__WEBSOCKET_CLIENT__=Yt);const Az=Object.freeze(Object.defineProperty({__proto__:null,WebSocketClient:ww,get websocketClient(){return Yt}},Symbol.toStringTag,{value:"Module"}));function Lz(){const e=Ep(g=>g.token),t=wo(g=>g.setConnected),a=wo(g=>g.setDisconnected),s=wo(g=>g.setReconnecting),r=wo(g=>g.setError),c=A.useCallback(()=>{console.log("[RootShell] WebSocket connected"),t(),Yt.transportMode==="websocket"&&Yt.subscribe(["model","changesets","annotations"])},[t]),o=A.useCallback(()=>{console.log("[RootShell] Using REST mode"),t()},[t]),u=A.useCallback(()=>{console.log("[RootShell] WebSocket disconnected"),a()},[a]),h=A.useCallback(g=>{s(g.attempt,g.delay)},[s]),m=A.useCallback(g=>{const p=g.kind==="event"?g.error:`${g.code}: ${g.message}`;console.error("[RootShell] WebSocket error:",p),r("Connection error")},[r]);return A.useEffect(()=>(console.log("[RootShell] Initializing WebSocket connection"),e&&(console.log("[RootShell] Setting authentication token for WebSocket"),Yt.setToken(e)),Yt.on("connect",c),Yt.on("disconnect",u),Yt.on("reconnecting",h),Yt.on("error",m),Yt.on("rest-mode",o),Yt.connect(),()=>{Yt.off("connect",c),Yt.off("disconnect",u),Yt.off("reconnecting",h),Yt.off("error",m),Yt.off("rest-mode",o),Yt.disconnect()}),[e,c,u,h,m,o]),f.jsx(Xx,{})}const Dz={model:"model",spec:"spec",changesets:"changesets"},Oz={model:"model",spec:"spec",changesets:"changesets"},zz={model:"graph",spec:"graph",changesets:"list"};function Iz(){const{section:e}=ed({strict:!1}),t=je(c=>c.view),a=je(c=>c.setView),s=A.useRef(!1),r=A.useRef(t);return A.useEffect(()=>{const c=e?Dz[e]:void 0;c&&a(c)},[e,a]),A.useEffect(()=>{if(!s.current){s.current=!0,r.current=t;return}if(r.current===t)return;r.current=t;const c=Oz[t];e!==c&&Cw.navigate({to:"/$section/$view",params:{section:c,view:zz[c]}})},[t,e]),f.jsx(Ez,{})}const mg=wk({component:Lz}),Uz=Sp({getParentRoute:()=>mg,path:"/",validateSearch:e=>({token:typeof e.token=="string"?e.token:void 0}),component:kE}),Bz=Sp({getParentRoute:()=>mg,path:"/$section/$view",component:Iz}),Fz=mg.addChildren([Uz,Bz]),Cw=Mk({routeTree:Fz,history:tj()}),Hz=new URLSearchParams(window.location.search),Nm=Hz.get("token");if(Nm){console.log("[main] Found token in URL query string, storing to localStorage"),localStorage.setItem("dr_auth_token",Nm),Ep.getState().setToken(Nm),console.log("[main] Updated authStore with new token");const e=window.location.pathname+window.location.hash;window.history.replaceState(null,"",e),console.log("[main] URL cleaned, removed token from query string")}vE();const Nw=document.getElementById("root");if(!Nw)throw new Error("Root element not found");const Pz=NE();GN.createRoot(Nw).render(f.jsx(ie.StrictMode,{children:f.jsx(sE,{client:Pz,children:f.jsx(Dk,{router:Cw})})}))});export default $z();